; Utilities for writing test ROMs zp_res test_code,1 ; code of current test zp_res test_name,2 ; address of name of current test, or 0 of none ; Reports that all tests passed tests_passed: .if !BUILD_MULTI jsr print_filename print_str "Passed" .endif lda #0 jmp exit ; Reports that the current test failed. Prints code and ; name last set with set_test, or just "Failed" if none ; have been set yet. test_failed: lda test_code ; Treat 0 as 1, in case it wasn't ever set bne :+ lda #1 sta test_code : ; If code >= 2, print name cmp #2 blt :+ lda test_name+1 beq :+ jsr print_newline sta addr+1 lda test_name sta addr jsr print_str_addr jsr print_newline : .if !BUILD_MULTI jsr print_filename .endif ; End program lda test_code jmp exit ; Sets current test code and optional name. Also resets ; checksum. .macro set_test code,name pha lda #code jsr set_test_ .local Addr lda #Addr sta