Post by DarkKobold on Mar 17, 2020 23:48:21 GMT
So, trying to maximize my overlay space, while still using Squirrel has been... problematic.
Summary of the issue - this is how we adjust which bank Squirrel fills data in -
/*---------------------------------*/
/* includes for song data */
/*---------------------------------*/
#asm
.data
.bank $4
.org $8000
_sngBank1:
.include ".\squirrel\syd.asm"
.code
#endasm
If you tell it bank 4, this is what happens:
BANK 0 Base Library 1 7506/ 686
CODE $C000-$C024 [ 37]
CODE $402F-$406D [ 63]
CODE $4070-$4127 [ 184]
CODE $C130-$DD65 [7222]
BANK 1 Base Library 2/Font 5955/2237
DATA $6000-$65FF [1536]
CODE $A600-$B742 [4419]
BANK 2 Constants 475/7717
DATA $4000-$41DA [ 475]
BANK 3 User Program 200/7992
DATA $6000-$60C7 [ 200]
BANK 4 8192/ 0
DATA $8000-$9FFF [8192]
BANK 5 8192/ 0
DATA $8000-$9FFF [8192]
BANK 6 8192/ 0
DATA $8000-$9FFF [8192]
If we tell it Bank 5, this is what happens -
BANK 0 Base Library 1 7506/ 686
CODE $C000-$C024 [ 37]
CODE $402F-$406D [ 63]
CODE $4070-$4127 [ 184]
CODE $C130-$DD65 [7222]
BANK 1 Base Library 2/Font 5955/2237
DATA $6000-$65FF [1536]
CODE $A600-$B742 [4419]
BANK 2 Constants 1382/6810
DATA $4000-$4565 [1382]
BANK 3 User Program 200/7992
DATA $6000-$60C7 [ 200]
BANK 4 0/8192
BANK 5 8192/ 0
DATA $8000-$9FFF [8192]
BANK 6 8192/ 0
DATA $8000-$9FFF [8192]
BANK 7 8192/ 0
DATA $8000-$9FFF [8192]
BANK 8 8192/ 0
Now, a quick note - if you put code BEFORE you call that above function, HuC will overwrite whatever you put in that Bank. So, we can't put it in Bank 3, because whatever Huc's "User Program" is, despite taking an entire Bank, is important, and crashes if you don't have it. It's frustrating. I tried searching for what User Program was, to no avail.
So here was my "solution"
#asm
.data
.bank $3
.org $8200
_sngBank1:
.include ".\squirrel\syd.asm"
.code
#endasm
And the end result:
Feel free to tell me why I'm retarded and this is a bad idea.
BANK 0 Base Library 1 7506/ 686
CODE $C000-$C024 [ 37]
CODE $402F-$406D [ 63]
CODE $4070-$4127 [ 184]
CODE $C130-$DD65 [7222]
BANK 1 Base Library 2/Font 5955/2237
DATA $6000-$65FF [1536]
CODE $A600-$B742 [4419]
BANK 2 Constants 1394/6798
DATA $4000-$4571 [1394]
BANK 3 User Program 7880/ 312
DATA $6000-$60C7 [ 200]
DATA $8200-$9FFF [7680]
BANK 4 8192/ 0
DATA $8000-$9FFF [8192]
BANK 5 8192/ 0
DATA $8000-$9FFF [8192]
BANK 6 8192/ 0
DATA $8000-$9FFF [8192]
BANK 7 8192/ 0
DATA $8000-$9FFF [8192]
Feel free to tell me why I'm retarded and this is a bad idea.