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:
Byron Lathi
2022-03-12 22:04:28 -06:00
parent 1a9290b97b
commit a6bcadab6e

View File

@@ -18,6 +18,7 @@ _hex_set_8:
phx
cmp #$3 ; If idx >= 3 then fail
bcc @1
plx
lda #$1
rts
@1: tax ; Move idx into x
@@ -44,6 +45,7 @@ _hex_set_24:
stx SEVEN_SEG+1
lda sreg
sta SEVEN_SEG+2
lda #$0
rts
; @in A: mask