some code for loading CPU test from SD card

This commit is contained in:
FeralChild64 committed 2021-01-28 23:12:21 +01:00
1 parent 265c29a883
commit 6e42bfe731
4 files changed
+97 -6

No files matched your search

+5
View File
@@ -72,6 +72,11 @@
!addr MISC_BOARDID = $D629 ; board identification byte
!addr MISC_EMU = $D710 ; to enable badlines and slow interrupts
; Hypervisor traps
!addr HTRAP00 = $D640
; SID offsets
!set __SID_R1_OFFSET = $00 ; right SID 1, $D400
+1 -1
View File
@@ -33,6 +33,6 @@ Z80_reset:
stz PTR_IXY_d+3
stz PTR_DATA+3
; Default bank is 1 (the fastest, continuous memory)
; Default bank is 1 (the one user software runs from)
jmp ZVM_set_bank_1
+9 -5
View File
@@ -51,12 +51,18 @@ ZVM: ; entry point
; Check if extended memory is present
jsr ZVM_memtest
; XXX enable test jsr ZVM_memtest
; Generate CPU tables
jsr z80_table_gen
; Try CPU test
jsr ZVM_cputest
; XXX code is not ready to progress further
jsr PRIMM
!pet $0D, "Implementation not finished yet.", 0
@@ -82,12 +88,10 @@ ZVM: ; entry point
ZVM_memtest:
; Simple memory test
; XXX this test is temporary
; XXX this test fails for now
lda #$00
sta PTR_DATA+0
@@ -98,7 +102,7 @@ ZVM_memtest:
ldx #$F0
@1:
ldy #$00
ldy #$10
@2:
lda PTR_DATA+2
eor #%01111111
+82
View File
@@ -0,0 +1,82 @@
;
; Z80 Virtual Machine CPU test
;
ZVM_cputest:
; Copy file name to RAM
ldx #$FF
@loop1:
inx
lda ZVM_filename_Z80TEST, x
sta BUF, x
bne @loop1
; Set Z80TEST.COM file name
ldy #>BUF
ldx #<BUF
lda #$2E ; dos_setname
sta HTRAP00
+nop ; required by hypervisor
bcc @end
; Try to find the file
lda #$34
sta HTRAP00
+nop
bcc @end
jsr PRIMM
!pet "Loading 'Z80TEST.COM'... ", 0
; Open the file
lda #$00
sta HTRAP00
+nop
lda #$18
sta HTRAP00
+nop
; Select SD card buffer
lda #$80
tsb $D689 ; XXX invent name for the register
; Read sectors
@loop2:
lda #$1A
sta HTRAP00
+nop
; .X (low byte) and .Y (high byte) contain number of bytes read
; XXX copy data from buffer at $FFD6E00
; XXX finish the implementation
@end:
rts
ZVM_filename_Z80TEST:
!pet "z80test.com", 0