Fix RGBLINK scrambling algorithm to work for SRAM

Since SRAM sections start from 0, we had been using a signed
`int8_t curScrambleSRAM` counter to allow 0 as a scrambled bank,
but this actually just placed all floating SRAM sections in bank 0.
This commit is contained in:
Rangi
2026-07-13 22:39:41 -04:00
committed by Rangi
parent 196d50c1d7
commit 5869e0dc60
7 changed files with 59 additions and 53 deletions
+25
View File
@@ -0,0 +1,25 @@
DEF N = 6
SECTION "fixed", ROMX, BANK[3]
; XXX: We rely on these landing at certain banks, which isn't *guaranteed*...
FOR i, 1, N + 1
db BANK(xLabel{d:i})
ENDR
FOR i, 1, N + 1
db BANK(wLabel{d:i})
ENDR
FOR i, 1, N + 1
db BANK(sLabel{d:i})
ENDR
ds $1000 - N * 3, $ff
FOR i, 1, N + 1
SECTION "floating{d:i}", ROMX
xLabel{d:i}:: ds $2000, i
SECTION "wram{d:i}", WRAMX
wLabel{d:i}:: dw
SECTION "sram{d:i}", SRAM
sLabel{d:i}:: dw
ENDR