Skip to content

Commit

Permalink
fix carry flag in clock_run on full hours
Browse files Browse the repository at this point in the history
  • Loading branch information
Zirias committed Jan 10, 2019
1 parent 464df72 commit 0da2e87
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/clock.s
Expand Up @@ -162,11 +162,12 @@ nostall: ldx seconds ; load current seconds
stx minutes
ldx hours ; load current hours
inx ; increment
stx hours ; and store
cpx #24 ; reached 24?
bcc hoursok ; if not, skip resetting them
bcc clock_get ; if not, return current clock
ldx #$0 ; reset hours to 0
hoursok: stx hours ; and store
bpl clock_get ; go to returning current clock
stx hours ; and store
beq clock_get ; go to returning current clock

done: clc ; clear carry to signal "no change"
rts ; and return
Expand Down

0 comments on commit 0da2e87

Please sign in to comment.