diff --git a/build_rom.sh b/build_rom.sh index e9e5b6ec..38557b6f 100755 --- a/build_rom.sh +++ b/build_rom.sh @@ -5,7 +5,7 @@ set -e echo NOSTALGIA_MEDIA_HEADER_________ > media_header.txt ./build/current/deps/ox/src/ox/fs/oxfs format 32 1k nostalgia_media.oxfs -./build/current/src/tools/nost-pack -fs nostalgia_media.oxfs -img charset.png -inode 101 -tiles 40 -c +./build/current/src/tools/nost-pack -fs nostalgia_media.oxfs -img charset.png -inode 101 -tiles 40 -bpp 4 -c ${DEVKITARM}/bin/padbin 32 build/gba-release/src/player/nostalgia.bin cat build/gba-release/src/player/nostalgia.bin media_header.txt nostalgia_media.oxfs > nostalgia.gba diff --git a/src/core/gba/gfx.cpp b/src/core/gba/gfx.cpp index 8069de1f..cd7c61d5 100644 --- a/src/core/gba/gfx.cpp +++ b/src/core/gba/gfx.cpp @@ -128,6 +128,7 @@ ox::Error initGfx() { } void initConsole() { + auto charsetInode = 101; auto fs = (FileStore32*) findMedia(); GbaImageDataHeader imgData; @@ -136,15 +137,15 @@ void initConsole() { REG_BG0CNT = (28 << 8) | 1; if (fs) { // load palette - fs->read(101, sizeof(GbaImageDataHeader), + fs->read(charsetInode, sizeof(GbaImageDataHeader), 512, (uint16_t*) &MEM_PALLETE_BG[0], nullptr); if (imgData.bpp == 4) { - fs->read(101, __builtin_offsetof(GbaImageData, tiles), + fs->read(charsetInode, __builtin_offsetof(GbaImageData, tiles), sizeof(Tile) * imgData.tileCount, (uint16_t*) &TILE_ADDR[0][1], nullptr); } else { REG_BG0CNT |= (1 << 7); // set to use 8 bits per pixel - fs->read(101, __builtin_offsetof(GbaImageData, tiles), + fs->read(charsetInode, __builtin_offsetof(GbaImageData, tiles), sizeof(Tile8) * imgData.tileCount, (uint16_t*) &TILE8_ADDR[0][1], nullptr); } }