1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-24 11:31:31 +00:00

Fixed an issue with the changing the d040 value while detecting.

This commit is contained in:
Marco van den Heuvel 2018-04-14 11:31:28 -07:00
parent 6076316f38
commit cb04bc5465

View File

@ -18,7 +18,7 @@
_detect_c64dtv: _detect_c64dtv:
ldy C64DTV_Extended_Regs ldy C64DTV_Extended_Regs
lda #$00 lda #$00
tax ldx $D000
; Make sure the CPU is a 6510 ; Make sure the CPU is a 6510
.byte $1A ; NOP on 8502, INA on 65(S)C(E)02, 4510 and 65816 .byte $1A ; NOP on 8502, INA on 65(S)C(E)02, 4510 and 65816
@ -27,17 +27,18 @@ _detect_c64dtv:
sta C64DTV_Extended_Regs sta C64DTV_Extended_Regs
; Check if $D000 is mirrored at $D040 ; Check if $D000 is mirrored at $D040
lda $D040 cpx $D040
cmp $D000
bne found bne found
inc $D040 inc $D000
cmp $D000 cpx $D040
bne not_found bne not_found
found: found:
lda #$01 lda #$01
.byte $2C .byte $2C
not_found: not_found:
lda #$00 lda #$00
stx $D000
ldx #$00
sty C64DTV_Extended_Regs sty C64DTV_Extended_Regs
rts rts