From 7a6934187af60cca9f7ae3517a11730f9120d1bc Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Wed, 19 Apr 2017 01:06:51 -0500 Subject: [PATCH] Correct the charset inode read for the charset tiles --- src/core/gba/gba.hpp | 2 +- src/core/gba/gfx.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/gba/gba.hpp b/src/core/gba/gba.hpp index 4c5d0e80..29225945 100644 --- a/src/core/gba/gba.hpp +++ b/src/core/gba/gba.hpp @@ -21,7 +21,7 @@ typedef uint16_t Pallete[256]; typedef Tile CharBlock[512]; typedef Tile8 CharBlock8[256]; -struct __attribute__((packed)) GbaImageData { +struct __attribute__((aligned(4))) GbaImageData { Pallete pal; uint16_t tileCount; uint8_t bpp; diff --git a/src/core/gba/gfx.cpp b/src/core/gba/gfx.cpp index 342ee0d1..69b981a7 100644 --- a/src/core/gba/gfx.cpp +++ b/src/core/gba/gfx.cpp @@ -133,7 +133,7 @@ void initConsole() { REG_BG0CNT |= (1 << 7); // set to use 8 bits per pixel if (fs) { FileStore32::FsSize_t readSize = 0; - fs->read(2, __builtin_offsetof(GbaImageData, tiles), 64 * 38, &TILE8_ADDR[0][1], nullptr); + fs->read(1, __builtin_offsetof(GbaImageData, tiles), 64 * 38, &TILE8_ADDR[0][1], nullptr); fs->read(1, 0, 512, &MEM_PALLETE_BG[0], &readSize); } }