mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-21 05:07:06 +00:00
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:
@@ -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
|
||||
Reference in New Issue
Block a user