gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit c005c369370d0d38832dd1019249d7a6dcf96460 parent b373426cff5f6be262eb49bf21d9d039d7e6624e Author: bbbbbr <reg+github@roughhousing.com> Date: Thu, 24 Jun 2021 17:30:57 -0700 Merge pull request #208 from bbbbbr/png2mtspr_autobank png2mtspr: add entries required for autobanking to .c and .h output Diffstat:
| M | gbdk-support/png2mtspr/png2mtspr.cpp | 10 | ++++++++-- |
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/gbdk-support/png2mtspr/png2mtspr.cpp b/gbdk-support/png2mtspr/png2mtspr.cpp @@ -309,6 +309,10 @@ int main(int argc, char *argv[]) fprintf(file, "extern const UINT8 %s_data[%d];\n", data_name.c_str(), (int)(tiles.size() * tile_h * 2)); fprintf(file, "extern const metasprite_t* const %s_metasprites[%d];\n", data_name.c_str(), (int)sprites.size()); + if(bank) { + fprintf(file, "extern const void __bank_%s_metasprite;\n", data_name.c_str()); + } + fclose(file); //Output .c FILE @@ -323,8 +327,10 @@ int main(int argc, char *argv[]) fprintf(file, "#include <gb/metasprites.h>\n"); fprintf(file, "\n"); - if(bank) - fprintf(file, "#pragma bank %d\n\n", bank); + if(bank) { + fprintf(file, "#pragma bank %d\n", bank); + fprintf(file, "const void __at(%d) __bank_%s_metasprite;\n\n", bank, data_name.c_str()); + } fprintf(file, "const UINT8 %s_data[%d] = {\n", data_name.c_str(), (int)(tiles.size() * tile_h * 2)); for(vector< Tile >::iterator it = tiles.begin(); it != tiles.end(); ++ it)
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.