all repos — mgba @ a8beb9f5f38f44e937ff752aee55d9928bf297c4

mGBA Game Boy Advance Emulator

GB: Clean up some warnings
Jeffrey Pfau jeffrey@endrift.com
Wed, 17 Feb 2016 21:17:00 -0800
commit

a8beb9f5f38f44e937ff752aee55d9928bf297c4

parent

ab44084236a244751d4ecd8e6403d58fb7c38de2

4 files changed, 6 insertions(+), 7 deletions(-)

jump to
M src/gb/gb.csrc/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 @@ if (gb->memory.rom) {

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 @@ if (gb->memory.rom) {

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;
M src/gb/gb.hsrc/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);
M src/gb/io.csrc/gb/io.c

@@ -9,7 +9,7 @@ #include "gb/gb.h"

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 @@ case 0x00:

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) {
M src/gb/memory.csrc/gb/memory.c

@@ -89,7 +89,7 @@ gb->memory.sramBank = gb->memory.sram;

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: