AntonioND / gbt-player

A music player library for the PSG audio channels of the GB, GBC and GBA.
MIT License
284 stars 20 forks source link

Add unbanked support for mod2gbt (GBDK Legacy) #9

Closed bbbbbr closed 4 years ago

bbbbbr commented 4 years ago

Hi,

Here's a PR if you'd like it. It could be useful for other GBDK folks.

The Issue:

In GBDK (2.9x) I encountered the problem where a non-MBC ROM needs to not have "#pragma bank=" in the mod2gbt output. I didn't see an option to suppress it so I've added it here.

When the toolchain is set for non-MBC mode it treats "_CODE" as 32K instead of two 16K regions (_CODE and CODE_1) . If you try to use any bank specifier (such as bank=1) then you get the error: "ERROR: address overflow (addr c51b >= 8000)"

This has also been discussed in more detail here: https://gbdev.gg8.se/forums/viewtopic.php?id=466

The patch:

AntonioND commented 4 years ago

Looks good to me. However, can you split this into two patches?

bbbbbr commented 4 years ago

Sure, this better?

AntonioND commented 4 years ago

Yes, thanks!