size-optimized cartridge check
This commit is contained in:
1 parent
13b7172ed5
commit
021c9b3189
3 files changed
+8
-9
No files matched your search
@@ -1,15 +1,13 @@
|
|||||||
// c64 prg p263
|
// c64 prg p263
|
||||||
|
|
||||||
cartridge_check:
|
cartridge_check:
|
||||||
ldx #$04
|
ldx #$05
|
||||||
cartridge_check_l1:
|
cartridge_check_l1:
|
||||||
lda CART_SIG,x
|
lda CART_SIG-1,x
|
||||||
cmp cartridge_signature,x
|
cmp cartridge_signature-1,x
|
||||||
bne no_cartridge
|
bne no_cartridge
|
||||||
dex
|
dex
|
||||||
bpl cartridge_check_l1
|
bne cartridge_check_l1
|
||||||
sec
|
|
||||||
rts
|
rts
|
||||||
no_cartridge:
|
no_cartridge:
|
||||||
clc
|
|
||||||
rts
|
rts
|
||||||
@@ -16,7 +16,7 @@ default_nmi_handler:
|
|||||||
// XXX confirm NMIs from CIA, or no other NMI will arrive!
|
// XXX confirm NMIs from CIA, or no other NMI will arrive!
|
||||||
|
|
||||||
jsr cartridge_check
|
jsr cartridge_check
|
||||||
bcc !+
|
bne !+
|
||||||
jmp (ICART_WARM_START)
|
jmp (ICART_WARM_START)
|
||||||
!:
|
!:
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,12 @@
|
|||||||
|
|
||||||
|
|
||||||
reset_entry:
|
reset_entry:
|
||||||
|
|
||||||
// The GPL program at https://github.com/Klaus2m5/6502_65C02_functional_tests/blob/master/6502_functional_test.a65
|
// The GPL program at https://github.com/Klaus2m5/6502_65C02_functional_tests/blob/master/6502_functional_test.a65
|
||||||
// uses the following initial reset sequence
|
// uses the following initial reset sequence
|
||||||
// affirmed by c64 PRG p269
|
// affirmed by c64 PRG p269
|
||||||
cld
|
cld
|
||||||
ldx #$ff
|
ldx #$FF
|
||||||
txs
|
txs
|
||||||
sei
|
sei
|
||||||
|
|
||||||
@@ -18,7 +19,7 @@ reset_entry:
|
|||||||
|
|
||||||
// C64 PRG p269
|
// C64 PRG p269
|
||||||
jsr cartridge_check
|
jsr cartridge_check
|
||||||
bcc !+
|
bne !+
|
||||||
jmp (ICART_COLD_START)
|
jmp (ICART_COLD_START)
|
||||||
!:
|
!:
|
||||||
// Initialising IO is obviously required. Also indicated by c64 prg p269.
|
// Initialising IO is obviously required. Also indicated by c64 prg p269.
|
||||||
|
|||||||
Reference in new issue
Block a user