Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions src/desk_acc/cd.remote.s
Original file line number Diff line number Diff line change
Expand Up @@ -2233,7 +2233,7 @@ FoundUnplayedTrack:
lda #$ff
sta (PlayedListPtr),y
tya
jsr Hex2BCDSorta
jsr Hex2BCD
sta BCDRandomPickedTrk

pla
Expand Down Expand Up @@ -2283,8 +2283,8 @@ PRNGMathLoop1:

PRNGMathLoop2:
cmp HexTrackCount0Base
bmi ExitMathLoop2
clc
bcc ExitMathLoop2
sec ; original code was clc
sbc HexTrackCount0Base
jmp PRNGMathLoop2

Expand Down Expand Up @@ -2337,18 +2337,16 @@ CPLLoop:

;;; ============================================================

;; TODO: Analysis - WTF is going on here?? This *seems* like an attempt to convert from BCD to binary, but it's... not. It's kinda wonky.
.proc Hex2BCDSorta
.proc Hex2BCD
stx Hex2BCDSaveX
;; TODO: Analysis - The return values from this function seem bizarre and inexplicable. Better analysis needs to be done on this code.
sty Hex2BCDSaveY

ldx #$00
DivideBy10:
cmp #$0a
bmi TenOrLess
bcc TenOrLess
inx
clc
sec ; original code was clc
sbc #$0a
jmp DivideBy10

Expand All @@ -2371,7 +2369,7 @@ Hex2BCDSaveX := *+1

Hex2BCDTemp:
.byte $00
.endproc ; Hex2BCDSorta
.endproc ; Hex2BCD

;;; ============================================================

Expand Down