added memory clearing, improved debug code

This commit is contained in:
FeralChild64 committed 2021-01-30 17:07:11 +01:00
1 parent 521d0e7994
commit c6ed0f0d00
5 files changed
+30 -8

No files matched your search

+1 -1
View File
@@ -54,7 +54,7 @@ DBG_print_hex:
jsr CHROUT
pla
jsr DBGINT_print_hex_byte
jmp DBGINT_end
bra DBGINT_end
+1 -1
View File
@@ -9,7 +9,7 @@
+Z80_FETCH_VIA_PC_INC
; jsr DBG_print_PC_opcode
jsr DBG_print_PC_opcode
asl
tax
+24 -2
View File
@@ -1,10 +1,10 @@
;
; Z80 CPU reset
; Z80 CPU/memory reset
;
Z80_reset:
Z80_reset_CPU:
; Reset registers and internal emulation data
@@ -36,3 +36,25 @@ Z80_reset:
; Default bank is 1 (the one user software runs from)
jmp ZVM_set_bank_1
Z80_reset_MEM:
lda #$05
sta BIOS_LOADPTR+2
lda #$00
sta BIOS_LOADPTR+0
sta BIOS_LOADPTR+1
sta BIOS_LOADPTR+3
@loop:
dec BIOS_LOADPTR+2
sta [BIOS_LOADPTR],z
inc BIOS_LOADPTR+2
sta [BIOS_LOADPTR],z
inw BIOS_LOADPTR
bne @loop
rts
+2 -2
View File
@@ -56,8 +56,8 @@ ZVM: ; entry point
; Generate CPU tables, reset the CPU
jsr Z80_table_gen
jsr Z80_reset
; XXX Z80 clear memory here
; XXX jsr Z80_reset_MEM
jsr Z80_reset_CPU
; Try CPU test
+2 -2
View File
@@ -55,9 +55,9 @@ zvm_BIOS_00_BOOT: ; Cold start
; XXX fetch RAM disk image, CPM3.SYS, command interpreter
; XXX close all the files, reset I/O, set screen mode
; XXX clear memory
jsr Z80_reset
jsr Z80_reset_MEM
jsr Z80_reset_CPU
; FALLTROUGH