AssignBanks out of range? (HUD)

crazygrouptrio

Active member
Trying to add a sprite to the HUD and I get "AssignBanks.asm(111) out of range" error. I've messed with placements but it always gives the same error. I've also been getting an AssignBanks error for other things such as inputs that I've been able to work around, so I was just curious what does the AssignBanks error actually mean? Anything in particular that causes this to occur that I can avoid doing?

Here is the script I was trying to add to make a sprite appear on HUD when the player gets weapon 3, placed in PreDraw.asm under the provided example in the script (around Line 39 for me). Those aren't the exact placement numbers, and like I said I messed around with them a lot and always got the error.

Code:
LDA weaponsUnlocked
AND #%00000100
BEQ skipDrawingSpecial

DrawSprite #$80, #$80, #$10, #%00000001, spriteOffset
UpdateSpritePointer

skipDrawingSpecial:
 

Mugi

Member
assignbanks.asm is the file that defines what is loaded into each bank (assingbanks.asm defines that each bank loads a bank**.asm from bankdata folder)
assignbanks.asm line 111 specifically means that your bank 14 is full, so you cant add any more code into it.
 

crazygrouptrio

Active member
Kinda the gist I was getting. Thanks.
Is there any general way to sort of consolidate the space I'm using for that bank? Writing code differently, etc? I'm getting better at getting code to do what I want but I really doubt I'm doing it in the best way possible.
 

Mugi

Member
well, by default thre's all kinds of things put into it which you might or might not use, so cleaning up the scripts and functions you dont need is a good start.
sans that, writing more compact code always helps. One of the bigger challenges in making nes games is exactly what you're facing, the lack of space :p

oh, and trust me, i feel you with the code efficiency.
i just recently rewrote my game's stage selection and the whole code involving the controllable cursor and whatnot shrunk down to like 1/10th of it's original size, while working better than the original did,
just goes on to show that optimization can go a long way :p
 
Top Bottom