]> git.sur5r.net Git - cc65/commitdiff
Fixed an issue with the changing the d040 value while detecting.
authorMarco van den Heuvel <blackystardust68@yahoo.com>
Sat, 14 Apr 2018 18:31:28 +0000 (11:31 -0700)
committerMarco van den Heuvel <blackystardust68@yahoo.com>
Sat, 14 Apr 2018 18:31:28 +0000 (11:31 -0700)
libsrc/c64/acc_detect_c64dtv.s

index ce30806dbb496250678de30a2ead2727bdbb2d88..1734095b17b3b7f96845cf577e53af1683ff65d6 100755 (executable)
@@ -18,7 +18,7 @@
 _detect_c64dtv:
         ldy     C64DTV_Extended_Regs
         lda     #$00
-        tax
+        ldx     $D000
 
 ; Make sure the CPU is a 6510
         .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
 
 ; Check if $D000 is mirrored at $D040
-        lda     $D040
-        cmp     $D000
+        cpx     $D040
         bne     found
-        inc     $D040
-        cmp     $D000
+        inc     $D000
+        cpx     $D040
         bne     not_found
 found:
         lda     #$01
         .byte   $2C
 not_found:
         lda     #$00
+        stx     $D000
+        ldx     #$00
         sty     C64DTV_Extended_Regs
         rts