Skip to content

Commit 1f16902

Browse files
committed
[kuroneko] implement auto-wrap for full list
1 parent 8d956ba commit 1f16902

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

SID.badge/!RunImage.spin

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ PRI SID_task : now | delta, cold ' audio background task
213213
repeat
214214
SID_load(song[sidx]|$8000) ' load song
215215
cold := warm
216-
216+
217217
now := cnt
218218
repeat
219219
SID_exec(@s_play) ' play song
@@ -224,7 +224,7 @@ PRI SID_task : now | delta, cold ' audio background task
224224
waitcnt(now += (delta * word[$7D04]) >> 8) ' finish this cycle
225225
sidcog.resetRegisters ' then silence
226226

227-
ifnot song[++sidx] ' next song available?
227+
ifnot song[sidx := (sidx +1) & 31] ' next song available?
228228
sidx := 0 ' wrap
229229

230230
PRI SID_load(name) : load | addr, size, pcnt ' stream loader
@@ -284,4 +284,4 @@ s_init byte $A9, $00 ' lda #0
284284
s_play byte $20, word $0000 ' jsr init/play
285285
byte ESC ' invalid
286286

287-
DAT
287+
DAT

0 commit comments

Comments
 (0)