size-optimized cartridge check

This commit is contained in:
FeralChild64 committed 2019-09-11 21:50:48 +02:00
1 parent 13b7172ed5
commit 021c9b3189
3 files changed
+8 -9

No files matched your search

+4 -6
View File
@@ -1,15 +1,13 @@
// c64 prg p263
cartridge_check:
ldx #$04
ldx #$05
cartridge_check_l1:
lda CART_SIG,x
cmp cartridge_signature,x
lda CART_SIG-1,x
cmp cartridge_signature-1,x
bne no_cartridge
dex
bpl cartridge_check_l1
sec
bne cartridge_check_l1
rts
no_cartridge:
clc
rts
@@ -16,7 +16,7 @@ default_nmi_handler:
// XXX confirm NMIs from CIA, or no other NMI will arrive!
jsr cartridge_check
bcc !+
bne !+
jmp (ICART_WARM_START)
!:
+3 -2
View File
@@ -3,11 +3,12 @@
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
ldx #$FF
txs
sei
@@ -18,7 +19,7 @@ reset_entry:
// C64 PRG p269
jsr cartridge_check
bcc !+
bne !+
jmp (ICART_COLD_START)
!:
// Initialising IO is obviously required. Also indicated by c64 prg p269.