Table of Contents

Banking diagnostics (GBS0300–GBS0399)

ROM banking: placement, cross-bank access, trampoline costs, and bank overflow.

GBS0300: The entry point cannot be banked

Severity: Error · Suppressible: no

'{0}' is the entry point and must stay in the resident bank.

Execution starts here, before any bank has been switched in, so this code has to be mapped already. Move the work into a [Bank] method and call it from Main.

GBS0301: Banked call

Severity: Performance · Suppressible: no

Calling '{0}' switches to ROM bank {1}.

A banked call goes through a trampoline that saves the current bank, switches, calls, and switches back, which costs roughly a hundred cycles more than a local call. The caller's own bank is unmapped for the duration. Mark the callee [Bank(0)] to keep it resident if it runs every frame.

GBS0302: Bank overflow

Severity: Error · Suppressible: no

Bank {0} holds {1} bytes of declared data; a ROM bank is 16,384.

This counts only the data GB# placed here. The code in this bank is measured by the linker and reported after the build, so the real budget is tighter than this number. Move an asset to another bank, or split the type across two.

GBS0303: Banked data read directly

Severity: Error · Suppressible: no

'{0}' is in ROM bank {1} and cannot be read directly.

Data outside bank 0 is only mapped while its bank is switched in, so a plain read gets whatever happens to be at that address instead. Pass it to a loader that takes its bank, such as Background.Load, or switch explicitly with Banking.Switch and take responsibility for restoring the previous bank.

GBS0304: Invalid ROM bank

Severity: Error · Suppressible: no

Bank {0} on '{1}' is not a valid ROM bank.

Bank 0 is the resident bank and is always mapped, so [Bank(0)] means "keep this resident". Banked code and data go in banks 1 to 255.

GBS0305: Conflicting banks for shared data

Severity: Error · Suppressible: no

'{0}' and '{1}' name the same image but ask for different banks ({2} and {3}).

Assets with identical contents share one copy in ROM, and one copy can only live in one bank. Give both fields the same bank, or make the images differ so each gets its own copy.

GBS0306: Mutable data cannot be banked

Severity: Error · Suppressible: no

'{0}' is not read-only and cannot be placed in a ROM bank.

A ROM bank holds cartridge data, which cannot be written to. Mutable statics live in the 8 KB of work RAM, which is always mapped and is not banked on a Game Boy. Add 'readonly' to move the data into the cartridge.

GBS0307: Bank 0 nearly full

Severity: Resource · Suppressible: no

Bank 0 is {0}% full ({1} of {2} bytes).

Bank 0 is always mapped and holds the interrupt vectors, the GBDK runtime, and everything not marked [Bank]. When it fills, nothing more fits at any address, however large the cartridge is. Move code or data out with [Bank].

GBS0308: Bank placement

Severity: Info · Suppressible: no

Bank {0} holds {1} symbol{2} and {3} bytes of declared data.

GBS0309: Automatic placement

Severity: Info · Suppressible: no

'{0}' was placed automatically in bank {1}.

GB# left this to GBDK's bankpack rather than choosing itself. Write [Bank(n)] on the declaration, with the bank named above, to pin it there instead.

GBS0310: Bank 0 overflowed

Severity: Error · Suppressible: no

Bank 0 overflowed by {0} bytes: '{1}' runs from {2} to {3}, past the 0x4000 boundary.

Bank 0 is the 16 KB at 0x0000-0x3FFF, and the linker placed this area straight through the end of it. Everything above 0x4000 is where the switchable bank appears, so at run time it is overlaid by whichever bank is mapped: the ROM builds, and then fails as soon as it reaches the part that moved. Neither lcc nor sdld reports this, and the bank usage above cannot show it, because the spilled bytes are counted against the bank whose addresses they landed on. Move code or data out of the resident bank with [Bank].