added memory clearing, improved debug code
This commit is contained in:
1 parent
521d0e7994
commit
c6ed0f0d00
5 files changed
+30
-8
No files matched your search
+1
-1
@@ -54,7 +54,7 @@ DBG_print_hex:
|
|||||||
jsr CHROUT
|
jsr CHROUT
|
||||||
pla
|
pla
|
||||||
jsr DBGINT_print_hex_byte
|
jsr DBGINT_print_hex_byte
|
||||||
jmp DBGINT_end
|
bra DBGINT_end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
+Z80_FETCH_VIA_PC_INC
|
+Z80_FETCH_VIA_PC_INC
|
||||||
|
|
||||||
; jsr DBG_print_PC_opcode
|
jsr DBG_print_PC_opcode
|
||||||
|
|
||||||
asl
|
asl
|
||||||
tax
|
tax
|
||||||
|
|||||||
+24
-2
@@ -1,10 +1,10 @@
|
|||||||
|
|
||||||
;
|
;
|
||||||
; Z80 CPU reset
|
; Z80 CPU/memory reset
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
Z80_reset:
|
Z80_reset_CPU:
|
||||||
|
|
||||||
; Reset registers and internal emulation data
|
; Reset registers and internal emulation data
|
||||||
|
|
||||||
@@ -36,3 +36,25 @@ Z80_reset:
|
|||||||
; Default bank is 1 (the one user software runs from)
|
; Default bank is 1 (the one user software runs from)
|
||||||
|
|
||||||
jmp ZVM_set_bank_1
|
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
@@ -56,8 +56,8 @@ ZVM: ; entry point
|
|||||||
; Generate CPU tables, reset the CPU
|
; Generate CPU tables, reset the CPU
|
||||||
|
|
||||||
jsr Z80_table_gen
|
jsr Z80_table_gen
|
||||||
jsr Z80_reset
|
; XXX jsr Z80_reset_MEM
|
||||||
; XXX Z80 clear memory here
|
jsr Z80_reset_CPU
|
||||||
|
|
||||||
; Try CPU test
|
; Try CPU test
|
||||||
|
|
||||||
|
|||||||
@@ -55,9 +55,9 @@ zvm_BIOS_00_BOOT: ; Cold start
|
|||||||
|
|
||||||
; XXX fetch RAM disk image, CPM3.SYS, command interpreter
|
; XXX fetch RAM disk image, CPM3.SYS, command interpreter
|
||||||
; XXX close all the files, reset I/O, set screen mode
|
; 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
|
; FALLTROUGH
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user