Ah that's better

used the appropriate instruction for comparison
This commit is contained in:
Brooke Vibber 2025-06-22 23:10:43 -07:00
commit 5cf64970c8

View file

@ -398,6 +398,11 @@ viewport_oy:
.dword ($fffe0000 & $3fffffff) << 2
.dword $ff000000
elapsed_work:
.dword 0
elapsed_digit:
.byte 0
; 2 + 9 * byte cycles
.macro add bytes, dest, arg1, arg2
clc ; 2 cyc
@ -1979,12 +1984,12 @@ update_status:
ldx #.lobyte(total_sec)
ldy #.hibyte(total_sec)
jsr FLD0R
; FR0 -> integer -> temp
; FR0 -> integer -> elapsed_work
jsr FPI
lda FR0
sta temp
sta elapsed_work
lda FR0 + 1
sta temp + 1
sta elapsed_work + 1
;jsr IFP
;jsr FASC
@ -1995,28 +2000,28 @@ update_status:
; count the hours
ldx #0
countdown_loop:
lda temp + 1
lda elapsed_work + 1
cmp #.hibyte(divisor)
bmi countdown_done
lda temp
bcc countdown_done
lda elapsed_work
cmp #.lobyte(divisor)
bmi countdown_done
bcc countdown_done
sec
lda temp
lda elapsed_work
sbc #.lobyte(divisor)
sta temp
lda temp + 1
sta elapsed_work
lda elapsed_work + 1
sbc #.hibyte(divisor)
sta temp + 1
sta elapsed_work + 1
inx
jmp countdown_loop
countdown_done:
lda digits,x
eor #$80
sta temp2
lda #.lobyte(temp2)
sta elapsed_digit
lda #.lobyte(elapsed_digit)
sta INBUFF
lda #.hibyte(temp2)
lda #.hibyte(elapsed_digit)
sta INBUFF + 1
jsr draw_string
.endscope