Fix bugs in sevenseg.s
Fixed bug where we forgot to restore x in _hex_set_8 if the idx check fails. We did remember to restore it if the check passed. Fixed bug where _hex_set_24 did not return 0.
This commit is contained in:
@@ -18,6 +18,7 @@ _hex_set_8:
|
|||||||
phx
|
phx
|
||||||
cmp #$3 ; If idx >= 3 then fail
|
cmp #$3 ; If idx >= 3 then fail
|
||||||
bcc @1
|
bcc @1
|
||||||
|
plx
|
||||||
lda #$1
|
lda #$1
|
||||||
rts
|
rts
|
||||||
@1: tax ; Move idx into x
|
@1: tax ; Move idx into x
|
||||||
@@ -44,6 +45,7 @@ _hex_set_24:
|
|||||||
stx SEVEN_SEG+1
|
stx SEVEN_SEG+1
|
||||||
lda sreg
|
lda sreg
|
||||||
sta SEVEN_SEG+2
|
sta SEVEN_SEG+2
|
||||||
|
lda #$0
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; @in A: mask
|
; @in A: mask
|
||||||
|
|||||||
Reference in New Issue
Block a user