update reset routine based on c64 prg pp263-269

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-18 23:43:04 +09:30
1 parent 5c701f8dd0
commit d151be5142
2 files changed
+21 -2

No files matched your search

+13
View File
@@ -0,0 +1,13 @@
; c64 prg p263
cartridge_check:
ldx #$04
cartridge_check_l1:
lda $8002,x
cmp cartridge_signature,x
bne no_cartridge
dex
bpl cartridge_check_l1
jmp ($8000)
cartridge_signature:
.byte $C3,$C2,$CD,$38,$30
+8 -2
View File
@@ -5,20 +5,26 @@
reset_entry:
; The GPL program at https://github.com/Klaus2m5/6502_65C02_functional_tests/blob/master/6502_functional_test.a65
; uses the following initial reset sequence
; affirmed by c64 PRG p269
cld
ldx #$ff
txs
sei
; C64 PRG p269
jsr cartridge_check
; The following routine is based on reading the public KERNAL jumptable routine
; list, and making unimaginative assumptions about what should be done on reset.
; Initialising IO is obviously required.
; Initialising IO is obviously required. also indicated by c64 prg p269.
jsr ioinit
; Setting up the screen is obviously required
; Setting up the screen and testing ram is obviously required
; also affirmed by p269 of c64 prg
jsr ramtas
; Resetting IO vectors is obviously required, if we want interrupts to run
; also affirmed by c64 prg p269
jsr restor
; What do we do when finished? A C64 jumps into the BASIC ROM
; c64 prg p269
jmp ($a000)