123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571 |
- .include "inc/z80.mac"
- .include "inc/spt.mac"
- ;
- ;
- ;
- ;
- ;
- ;
- VBASE equ 03000h
- VSIZE equ 0ffeh
- VLINE equ 80
- .org 0000h
- reset:
- di
- im 1
- diagnostics:
- xor a
- out (0c0h),a
- out (0c4h),a
- out (0c5h),a
- out (0c6h),a
- out (0c7h),a
- out (0d4h),a
- out (0d8h),a
- ld hl,set_regs_start
- jp set_monroe_regs
- init_continue:
- jp setupclearscreen
- screen_clear_continue:
- ld a,080h
- out (0d4h),a
-
- ld a,005h
- out (0a3h),a
- ld a,068h
- out (0a3h),a
- ld a,0f0h
- out (0c8h),a
-
- ld a,004h
- out (0c8h),a
- ;
-
-
- test_vram:
- SPTHREAD_BEGIN
- SPT_SKIP_NMIVEC
-
- dw spt_select_test, tp_vram
- dw memtestmarch
- dw spt_check_7bit_vram
-
- dw spt_jp_nc, .vram_ok
-
- dw spt_prepare_display
- dw spt_chartest
- .vram_bad_loop:
-
-
- dw spt_jp,.vram_bad_loop
- .vram_7bit:
- dw spt_con_print, msg_ok7bit
-
-
- .vram_ok:
- dw spt_prepare_display
- MAC_SPT_CON_GOTO 2,0
- dw spt_announcetest2
-
- dw spt_jp_e_7bit_vram, .vram_7bit
- dw spt_con_print, msg_ok8bit
- .vram_goodtones:
-
- .vram_continue:
- MAC_SPT_CON_GOTO 3,0
- dw spt_select_test, tp_16k
- dw spt_jp, .start
- .start dw spt_con_goto
- MAC_SPT_CON_OFFSET 3,0
- .loop: dw spt_announcetest
- dw memtestmarch2
- dw spt_jp_nc, .ok
-
- dw spt_con_print, msg_biterrs
- dw print_biterrs
-
- dw spt_jp, .cont
-
- .ok: dw spt_con_print, msg_testok
-
- .cont:
- dw spt_tp_next, .start
- dw spt_jp, .loop
- spt_prepare_display:
- SPTHREAD_ENTER
- dw con_clear
- dw spt_con_print, msg_banner
- dw spt_print_charset
- dw spt_exit
- spt_check_vram_contents:
- pop bc
- ld a,b
- ld d,c
- check_vram_contents:
- ld hl,VBASE
- ld bc,VSIZE
- .fillloop:
- ld (HL),a
- cpi
- jp pe,.fillloop
- ld hl,VBASE
- ld bc,VSIZE
- ld a,d
- .readloop:
- cpi
- jr nz,.bad
- jp pe,.readloop
- or a
- ret
- .bad: scf
- ret
- spt_check_7bit_vram:
- ret nc
- ld a,01000000b
- cp e
- jr z,.scantests
- scf
- ret
- .scantests:
- SPTHREAD_ENTER
- dw spt_check_vram_contents, $0040
- dw spt_jp_c, .exit
- dw spt_check_vram_contents, $FFBF
- dw spt_jp_c, .exit
- dw spt_check_vram_contents, $AAAA
- dw spt_jp_c, .exit
- dw spt_check_vram_contents, $5555
- dw spt_jp_c, .exit
- .exit: dw spt_exit
- spt_sim_error:
- pop de
- scf
- ret
- spt_jp_all_bits_bad:
- pop hl
- ld a,$FF
- cp e
- ret nz
- ld sp,hl
- ret
- spt_jp_e_7bit_vram:
- pop hl
- ld a,01000000b
- cp e
- ret nz
- ld sp,hl
- ret
- spt_jp_e_zero:
- pop hl
- ld a,0
- cp e
- ret nz
- ld sp,hl
- ret
- spt_ld_hl_tp_label:
- ld l,(iy+4)
- ld h,(iy+5)
- ret
- spt_ld_hl_tp_tones:
- ld l,(iy+6)
- ld h,(iy+7)
- ret
- spt_ld_new_line:
- ld a,(iy+9)
- ld ixh,a
- ld a,(iy+8)
- ld ixl,a
- ret
- spt_tp_next: pop hl
- ld bc,tp_size
- add iy,bc
- ld a,(iy+0)
- add a,(iy+1)
- ret nz
- ld c,(iy+2)
- ld b,(iy+3)
- ld iy,0
- add iy,bc
-
- ld sp,hl
- ret
- spt_announcetest:
-
- SPTHREAD_ENTER
- dw spt_ld_new_line
-
- dw spt_ld_hl_tp_label
- dw con_print
- dw spt_con_print, msg_testing
- dw spt_con_index, -18
- dw spt_exit
- spt_announcetest2:
-
- SPTHREAD_ENTER
- dw spt_ld_hl_tp_label
- dw con_print
- dw spt_con_print, msg_testing
- dw spt_con_index, -18
- dw spt_exit
- spt_play_testresult:
- SPTHREAD_SAVE
- SPTHREAD_BEGIN
- dw spt_ld_hl_tp_tones
-
- dw spt_pause, $2000
- SPTHREAD_END
- ld a,$FF
- cp e
- jr z,.allbad
- cpl
- cp e
- jr z,.allgood
- ld d,8
- .showbit:
- rlc e
- jr nc,.zero
- ld hl,tones_bitbad
- jr .msbe_cont
- .zero:
- ld hl,tones_bitgood
- .msbe_cont:
- SPTHREAD_BEGIN
-
- dw spt_pause, $2000
- SPTHREAD_END
-
- dec d
- jr nz,.showbit
- jr .done
- .allbad:
- SPTHREAD_BEGIN
-
- dw spt_pause, $8000
- SPTHREAD_END
- jr .done
- .allgood:
- SPTHREAD_BEGIN
-
- dw spt_pause, $8000
- SPTHREAD_END
- .done:
- SPTHREAD_RESTORE
- ret
- spt_pause:
- pop bc
- pause_bc:
- .loop:
- dec bc
- ld a,b
- or c
- jr nz,.loop
- ret
- print_biterrs:
- ld a,004h
- out (0c8h),a
- ld a,'7'
- ld b,8
- .showbit:
- rlc e
- jr nc,.zero
- ld (ix+1),a
- jr .cont
- .zero:
- ld (ix+1),'.'
- .cont:
- inc ix
- inc ix
- dec a
- djnz .showbit
- xor a
- out (0c8h),a
- ret
- spt_ld_bc: pop bc
- ret
- spt_print_charset:
-
- ld a,ixh
- ld h,a
- ld a,ixl
- ld l,a
- ld a,0
- SPTHREAD_ENTER
- MAC_SPT_CON_GOTO 15,24
- dw spt_con_print, msg_charset
- MAC_SPT_CON_GOTO 16,0
- dw spt_ld_bc, $100
- dw do_charset_ix
- dw spt_exit
- spt_chartest:
- ld ix,VBASE
- ld bc,VSIZE
- do_charset_ix:
- ld a,004h
- out (0c8h),a
- ld a,32
- .charloop:
- ld (ix+1),a
- inc a
- inc ix
- inc ix
- cpi
- jp pe, .charloop
- xor a
- out (0c8h),a
- ret
- screenclearloop:
- otir
- set_monroe_regs:
- ld c,(hl)
- inc hl
- ld b,(hl)
- inc hl
- ld a,b ;
- and a ;
- jr nz,screenclearloop
- jp init_continue
- setupclearscreen:
- xor a
- ld bc,00eb9h
- ld hl,set_up_crt ;
- setupclearloop:
- out (0b8h),a
- inc a
- outi
- jr nz,setupclearloop
- jp screen_clear_continue
- label_vram: dbz " 4K VRAM 3000-3FFE "
- label_dram16k1: dbz "16K DRAM 0 C000-FFFF "
- label_dram16k2: dbz "16K DRAM 1 C000-FFFF "
- label_dram16k3: dbz "16K DRAM 2 C000-FFFF "
- label_dram16k4: dbz "16K DRAM 3 C000-FFFF "
- label_dram16k5: dbz "16K DRAM 4 C000-FFFF "
- label_dram16k6: dbz "16K DRAM 5 C000-FFFF "
- label_dram16k7: dbz "16K DRAM 6 C000-FFFF "
- label_dram16k8: dbz "16K DRAM 7 C000-FFFF "
- msg_banner: dbz "Monroe OC8820 TEST ROM -- FRANK IZ8DWF / DAVE KI3V / ADRIAN BLACK"
- msg_charset: dbz "-CHARACTER SET-"
- msg_testing: dbz "..TEST.. "
- msg_testok: dbz "---OK--- "
- msg_biterrs: dbz "BIT ERRS "
- msg_ok7bit: dbz "OK! (7-BIT MODEL 1)"
- msg_ok8bit: dbz "OK! (8-BIT)"
- tp_size equ 10
- memtest_ld_bc_size .macro
- ld c,(iy+0)
- ld b,(iy+1)
- .endm
- memtest_ld_hl_base .macro
- ld l,(iy+2)
- ld h,(iy+3)
- .endm
- memtest_loadregs .macro
- memtest_ld_bc_size
- memtest_ld_hl_base
- .endm
- spt_ld_iya6 .macro
- ld a,(iy+6)
- .endm
- spt_ld_iya7 .macro
- ld a,(iy+7)
- .endm
- tp_vram: dw VSIZE, VBASE, label_vram, tones_vram
- tp_16k: dw $4000, $C000, label_dram16k1, $a100,$31e0
- dw $4000, $C000, label_dram16k2, $c100,$3280
- dw $4000, $C000, label_dram16k3, $e100,$3320
- dw $4000, $C000, label_dram16k4, $0000,$33c0
- dw $4000, $C000, label_dram16k5, $2000,$3460
- dw $4000, $C000, label_dram16k6, $4020,$3500
- dw $4000, $C000, label_dram16k7, $6020,$35a0
- dw $4000, $C000, label_dram16k8, $8020,$3640
- dw $0000, tp_16k
-
- set_regs_start:
- defb 0b5h
- defb 004h
- defb 0cfh
- defb 0b8h
- defb 037h
- defb 0efh
- ;
- defb 0b4h
- defb 001h
- defb 001h
- ;
- defb 0a1h
- defb 006h
- defb 048h
- defb 048h
- defb 004h
- defb 044h
- defb 005h
- defb 0eah
- ;
- defb 0a3h
- defb 008h
- defb 048h
- defb 048h
- defb 004h
- defb 044h
- defb 001h
- defb 000h
- defb 003h
- defb 0c1h
- ;
- defb 0a5h
- defb 002h
- defb 048h
- defb 048h
- ;
- defb 0a7h
- defb 002h
- defb 048h
- defb 048h
- ;
- defb 0a8h
- defb 002h
- defb 003h
- defb 003h
- ;
- defb 0a9h
- defb 002h
- defb 003h
- defb 003h
- ;
- defb 0aah
- defb 002h
- defb 057h
- defb 04eh
- ;
- defb 000h
- defb 000h
- set_up_crt:
- defb 069h
- defb 050h
- defb 056h
- defb 00bh
- defb 019h
- defb 003h
- defb 018h
- defb 018h
- defb 000h
- defb 00bh
- defb 020h
- defb 000h
- defb 000h
- defb 000h
- include "inc/spt.asm"
- include "inc/memtestmarch.asm"
- include "inc/monroecon.asm"
- include "inc/trs80music.asm"
|