GB: Clean up some warnings

This commit is contained in:
Jeffrey Pfau 2016-02-17 21:17:00 -08:00
parent ab44084236
commit a8beb9f5f3
4 changed files with 6 additions and 7 deletions

View File

@ -26,7 +26,7 @@ static void GBInterruptHandlerInit(struct LR35902InterruptHandler* irqh);
static void GBProcessEvents(struct LR35902Core* cpu); static void GBProcessEvents(struct LR35902Core* cpu);
static void GBSetInterrupts(struct LR35902Core* cpu, bool enable); static void GBSetInterrupts(struct LR35902Core* cpu, bool enable);
static void GBIllegal(struct LR35902Core* cpu); static void GBIllegal(struct LR35902Core* cpu);
static void GBHitStub(struct LR35902Core* cpu); static void GBStop(struct LR35902Core* cpu);
#ifdef _3DS #ifdef _3DS
extern uint32_t* romBuffer; extern uint32_t* romBuffer;
@ -343,7 +343,7 @@ void GBGetGameTitle(struct GB* gb, char* out) {
cart = (const struct GBCartridge*) &gb->memory.rom[0x100]; cart = (const struct GBCartridge*) &gb->memory.rom[0x100];
} }
if (gb->pristineRom) { if (gb->pristineRom) {
cart = (const struct GBCartridge*) &gb->pristineRom[0x100]; cart = (const struct GBCartridge*) &((uint8_t*) gb->pristineRom)[0x100];
} }
if (!cart) { if (!cart) {
return; return;
@ -362,7 +362,7 @@ void GBGetGameCode(struct GB* gb, char* out) {
cart = (const struct GBCartridge*) &gb->memory.rom[0x100]; cart = (const struct GBCartridge*) &gb->memory.rom[0x100];
} }
if (gb->pristineRom) { if (gb->pristineRom) {
cart = (const struct GBCartridge*) &gb->pristineRom[0x100]; cart = (const struct GBCartridge*) &((uint8_t*) gb->pristineRom)[0x100];
} }
if (!cart) { if (!cart) {
return; return;

View File

@ -101,7 +101,6 @@ void GBReset(struct LR35902Core* cpu);
void GBUpdateIRQs(struct GB* gb); void GBUpdateIRQs(struct GB* gb);
void GBHalt(struct LR35902Core* cpu); void GBHalt(struct LR35902Core* cpu);
void GBStop(struct LR35902Core* cpu);
struct VFile; struct VFile;
bool GBLoadROM(struct GB* gb, struct VFile* vf); bool GBLoadROM(struct GB* gb, struct VFile* vf);

View File

@ -9,7 +9,7 @@
mLOG_DEFINE_CATEGORY(GB_IO, "GB I/O"); 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_SC] = 0x7E, // TODO: GBC differences
[REG_IF] = 0xE0, [REG_IF] = 0xE0,
[REG_TAC] = 0xF8, [REG_TAC] = 0xF8,
@ -378,7 +378,7 @@ static uint8_t _readKeys(struct GB* gb) {
keys |= keys >> 4; keys |= keys >> 4;
break; 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) { uint8_t GBIORead(struct GB* gb, unsigned address) {

View File

@ -89,7 +89,7 @@ void GBMemoryReset(struct GB* gb) {
memset(&gb->video.oam, 0, sizeof(gb->video.oam)); 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) { switch (cart->type) {
case 0: case 0:
case 8: case 8: