Start on support for 4 bpp images
This may be all that's needed, but there seems to be another issue causing the characters to look weird, though that's probably a filesystem issue.
This commit is contained in:
+11
-4
@@ -129,12 +129,19 @@ ox::Error initGfx() {
|
||||
|
||||
void initConsole() {
|
||||
auto fs = (FileStore32*) findMedia();
|
||||
|
||||
GbaImageData imgData;
|
||||
fs->read(101, __builtin_offsetof(GbaImageData, tileCount),
|
||||
sizeof(imgData.tileCount) + sizeof(imgData.bpp),
|
||||
&imgData.tileCount, nullptr);
|
||||
|
||||
REG_BG0CNT = (28 << 8) | 1;
|
||||
REG_BG0CNT |= (1 << 7); // set to use 8 bits per pixel
|
||||
if (imgData.bpp == 8) {
|
||||
REG_BG0CNT |= (1 << 7); // set to use 8 bits per pixel
|
||||
}
|
||||
if (fs) {
|
||||
FileStore32::FsSize_t readSize = 0;
|
||||
fs->read(1, __builtin_offsetof(GbaImageData, tiles), 64 * 38, &TILE8_ADDR[0][1], nullptr);
|
||||
fs->read(1, 0, 512, &MEM_PALLETE_BG[0], &readSize);
|
||||
fs->read(101, __builtin_offsetof(GbaImageData, tiles), 64 * 38, &TILE8_ADDR[0][1], nullptr);
|
||||
fs->read(101, __builtin_offsetof(GbaImageData, pal), 512, &MEM_PALLETE_BG[0], nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user