Optimized the code a bit, thanks to Greg for the suggestions/comments.
This commit is contained in:
@@ -37,11 +37,9 @@ _detect_turbomaster:
|
|||||||
; Check for turbo master basic replacement
|
; Check for turbo master basic replacement
|
||||||
ldy TURBOMASTER_DETECT
|
ldy TURBOMASTER_DETECT
|
||||||
cpy #$A2
|
cpy #$A2
|
||||||
bne not_found
|
beq found
|
||||||
found:
|
|
||||||
lda #$01
|
|
||||||
.byte $24
|
|
||||||
not_found:
|
not_found:
|
||||||
txa
|
txa
|
||||||
|
found:
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|||||||
@@ -38,18 +38,11 @@
|
|||||||
_set_turbomaster_speed:
|
_set_turbomaster_speed:
|
||||||
tay
|
tay
|
||||||
lda TURBOMASTER_SPEED_REG
|
lda TURBOMASTER_SPEED_REG
|
||||||
|
asl
|
||||||
cpy #SPEED_4X
|
cpy #SPEED_4X
|
||||||
bcs high_speed
|
ror
|
||||||
low_speed:
|
|
||||||
and #$7F
|
|
||||||
store_speed:
|
store_speed:
|
||||||
sta TURBOMASTER_SPEED_REG
|
sta TURBOMASTER_SPEED_REG
|
||||||
jmp _get_turbomaster_speed
|
|
||||||
|
|
||||||
high_speed:
|
|
||||||
ora #$80
|
|
||||||
bne store_speed
|
|
||||||
|
|
||||||
|
|
||||||
_get_turbomaster_speed:
|
_get_turbomaster_speed:
|
||||||
ldx #$00
|
ldx #$00
|
||||||
|
|||||||
Reference in New Issue
Block a user