refactor clock
JSL : RTL to JML SEC not necessary if we branch on BEQ, since BEQ implies a set carry made carry_bit a sublabel
This commit is contained in:
16
clock.asm
16
clock.asm
@@ -66,8 +66,7 @@ endmacro
|
|||||||
|
|
||||||
Clock_Test:
|
Clock_Test:
|
||||||
JSL.l Clock_Init
|
JSL.l Clock_Init
|
||||||
JSL.l Clock_IsSupported
|
JML.l Clock_IsSupported
|
||||||
RTL
|
|
||||||
|
|
||||||
;--------------------------------------------------------------------------------
|
;--------------------------------------------------------------------------------
|
||||||
; Clock_Init
|
; Clock_Init
|
||||||
@@ -112,11 +111,10 @@ Clock_IsSupported:
|
|||||||
PHA : PHX
|
PHA : PHX
|
||||||
LDX #$00;
|
LDX #$00;
|
||||||
-
|
-
|
||||||
LDA $002800 : AND.b #$0F : CMP #$0F : BEQ + ; check for clock chip ready signal
|
LDA $002800 : AND.b #$0F : CMP #$0F : BEQ .done ; check for clock chip ready signal
|
||||||
CPX.b #$0E : !BLT ++ : CLC : BRA .done : ++ ; if we've read 14 bytes with no success, unset carry and exit
|
CPX.b #$0E : BCC ++ : CLC : BRA .done ; if we've read 14 bytes with no success, unset carry and exit
|
||||||
INX
|
++ INX
|
||||||
BRA - : +
|
BRA -
|
||||||
SEC ; found a clock chip
|
|
||||||
.done
|
.done
|
||||||
PLX : PLA
|
PLX : PLA
|
||||||
RTL
|
RTL
|
||||||
@@ -197,9 +195,9 @@ Multiply_A16Y8:
|
|||||||
CLC
|
CLC
|
||||||
ADC $4216
|
ADC $4216
|
||||||
LDY $4217
|
LDY $4217
|
||||||
BCC carry_bit
|
BCC .carry_bit
|
||||||
INY
|
INY
|
||||||
carry_bit:
|
.carry_bit:
|
||||||
XBA
|
XBA
|
||||||
REP #$20 ; set 16-bit accumulator
|
REP #$20 ; set 16-bit accumulator
|
||||||
RTL
|
RTL
|
||||||
|
|||||||
Reference in New Issue
Block a user