git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

commit ef9e22bc9f9b41e719735781fd1dbcb41c8eabb8
parent 304aa0e790d44ffa9ea0bf2278eff41ac8740639
Author: bbbbbr <bbbbbr@users.noreply.github.com>
Date:   Tue, 12 May 2026 11:53:30 -0700

Merge pull request #888 from bbbbbr/docs/no_autobank_static_banked_funcs

Docs: Note about static + BANKED incompatibility
Diffstat:
Mdocs/pages/05_banking_mbcs.md3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/docs/pages/05_banking_mbcs.md b/docs/pages/05_banking_mbcs.md @@ -203,6 +203,9 @@ Banked functions (located in a switchable ROM bank) - A @ref wrapped_function_for_banked_data "NONBANKED wrapper function" may be used to access data in other banks. - Banks cannot be switched manually from inside a BANKED function (otherwise it will switch out it's own function code as it is executing it, likely leading to a crash). +Incompatible function keywords + - Combining the `static` and `BANKED` keywords together for a function is not supported with autobanking, nor is it recommended generally. In that scenario the banked function will not export a symbol for its bank, meaning banked calls to it (even within the same source file) will not have the target bank updated after auto bank assignment and so are likely to crash. + Limitations: - SDCC banked calls and far_pointers in GBDK only save one byte for the ROM bank. So, for example, they are limited to __bank 31__ max for MBC1 and __bank 255__ max for MBC5. This is due to the bank switching for those MBCs requiring a second, additional write to select the upper bits for more banks (banks 32+ in MBC1 and banks 256+ in MBC5).

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.