From a8beb9f5f38f44e937ff752aee55d9928bf297c4 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Wed, 17 Feb 2016 21:17:00 -0800 Subject: [PATCH] GB: Clean up some warnings --- src/gb/gb.c | 6 +++--- src/gb/gb.h | 1 - src/gb/io.c | 4 ++-- src/gb/memory.c | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gb/gb.c b/src/gb/gb.c index 65c4375a3..984e91636 100644 --- a/src/gb/gb.c +++ b/src/gb/gb.c @@ -26,7 +26,7 @@ static void GBInterruptHandlerInit(struct LR35902InterruptHandler* irqh); static void GBProcessEvents(struct LR35902Core* cpu); static void GBSetInterrupts(struct LR35902Core* cpu, bool enable); static void GBIllegal(struct LR35902Core* cpu); -static void GBHitStub(struct LR35902Core* cpu); +static void GBStop(struct LR35902Core* cpu); #ifdef _3DS extern uint32_t* romBuffer; @@ -343,7 +343,7 @@ void GBGetGameTitle(struct GB* gb, char* out) { cart = (const struct GBCartridge*) &gb->memory.rom[0x100]; } if (gb->pristineRom) { - cart = (const struct GBCartridge*) &gb->pristineRom[0x100]; + cart = (const struct GBCartridge*) &((uint8_t*) gb->pristineRom)[0x100]; } if (!cart) { return; @@ -362,7 +362,7 @@ void GBGetGameCode(struct GB* gb, char* out) { cart = (const struct GBCartridge*) &gb->memory.rom[0x100]; } if (gb->pristineRom) { - cart = (const struct GBCartridge*) &gb->pristineRom[0x100]; + cart = (const struct GBCartridge*) &((uint8_t*) gb->pristineRom)[0x100]; } if (!cart) { return; diff --git a/src/gb/gb.h b/src/gb/gb.h index 085384fd7..e7c5ccd8a 100644 --- a/src/gb/gb.h +++ b/src/gb/gb.h @@ -101,7 +101,6 @@ void GBReset(struct LR35902Core* cpu); void GBUpdateIRQs(struct GB* gb); void GBHalt(struct LR35902Core* cpu); -void GBStop(struct LR35902Core* cpu); struct VFile; bool GBLoadROM(struct GB* gb, struct VFile* vf); diff --git a/src/gb/io.c b/src/gb/io.c index d1aab6aa0..da6d9469a 100644 --- a/src/gb/io.c +++ b/src/gb/io.c @@ -9,7 +9,7 @@ mLOG_DEFINE_CATEGORY(GB_IO, "GB I/O"); -const static uint8_t _registerMask[] = { +static const uint8_t _registerMask[] = { [REG_SC] = 0x7E, // TODO: GBC differences [REG_IF] = 0xE0, [REG_TAC] = 0xF8, @@ -378,7 +378,7 @@ static uint8_t _readKeys(struct GB* gb) { keys |= keys >> 4; break; } - return 0xC0 | (gb->memory.io[REG_JOYP] | 0xF) ^ (keys & 0xF); + return (0xC0 | (gb->memory.io[REG_JOYP] | 0xF)) ^ (keys & 0xF); } uint8_t GBIORead(struct GB* gb, unsigned address) { diff --git a/src/gb/memory.c b/src/gb/memory.c index 3060d1525..c515cf9e9 100644 --- a/src/gb/memory.c +++ b/src/gb/memory.c @@ -89,7 +89,7 @@ void GBMemoryReset(struct GB* gb) { memset(&gb->video.oam, 0, sizeof(gb->video.oam)); - const struct GBCartridge* cart = &gb->memory.rom[0x100]; + const struct GBCartridge* cart = (const struct GBCartridge*) &gb->memory.rom[0x100]; switch (cart->type) { case 0: case 8: