All: Fix more warnings

This commit is contained in:
Vicki Pfau 2020-01-16 20:51:17 -08:00
parent 4153a7e21f
commit c0fa8256a2
3 changed files with 12 additions and 12 deletions

View File

@ -936,7 +936,7 @@ static void _updateChannel4(struct mTiming* timing, void* user, uint32_t cyclesL
uint32_t last = 0;
uint32_t now = cycles;
uint32_t next = cycles - cyclesLate;
int32_t next = cycles - cyclesLate;
if (audio->style == GB_AUDIO_GBA) {
last = ch->lastEvent;

View File

@ -508,7 +508,7 @@ static void _GBCoreReset(struct mCore* core) {
bios = NULL;
}
}
if (bios) {
if (found && bios) {
GBLoadBIOS(gb, bios);
}
}

View File

@ -187,7 +187,7 @@ void GBVideoAssociateRenderer(struct GBVideo* video, struct GBVideoRenderer* ren
video->renderer->init(video->renderer, video->p->model, video->sgbBorders);
}
static bool _statIRQAsserted(struct GBVideo* video, GBRegisterSTAT stat) {
static bool _statIRQAsserted(GBRegisterSTAT stat) {
// TODO: variable for the IRQ line value?
if (GBRegisterSTATIsLYCIRQ(stat) && GBRegisterSTATIsLYC(stat)) {
return true;
@ -236,20 +236,20 @@ void _endMode0(struct mTiming* timing, void* context, uint32_t cyclesLate) {
mTimingDeschedule(&video->p->timing, &video->frameEvent);
mTimingSchedule(&video->p->timing, &video->frameEvent, -cyclesLate);
if (!_statIRQAsserted(video, oldStat) && GBRegisterSTATIsOAMIRQ(video->stat)) {
if (!_statIRQAsserted(oldStat) && GBRegisterSTATIsOAMIRQ(video->stat)) {
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
}
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_VBLANK);
}
video->stat = GBRegisterSTATSetMode(video->stat, video->mode);
if (!_statIRQAsserted(video, oldStat) && _statIRQAsserted(video, video->stat)) {
if (!_statIRQAsserted(oldStat) && _statIRQAsserted(video->stat)) {
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
}
// LYC stat is delayed 1 T-cycle
oldStat = video->stat;
video->stat = GBRegisterSTATSetLYC(video->stat, lyc == video->ly);
if (!_statIRQAsserted(video, oldStat) && _statIRQAsserted(video, video->stat)) {
if (!_statIRQAsserted(oldStat) && _statIRQAsserted(video->stat)) {
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
}
@ -287,7 +287,7 @@ void _endMode1(struct mTiming* timing, void* context, uint32_t cyclesLate) {
GBRegisterSTAT oldStat = video->stat;
video->stat = GBRegisterSTATSetMode(video->stat, video->mode);
video->stat = GBRegisterSTATSetLYC(video->stat, lyc == video->p->memory.io[REG_LY]);
if (!_statIRQAsserted(video, oldStat) && _statIRQAsserted(video, video->stat)) {
if (!_statIRQAsserted(oldStat) && _statIRQAsserted(video->stat)) {
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
GBUpdateIRQs(video->p);
}
@ -305,7 +305,7 @@ void _endMode2(struct mTiming* timing, void* context, uint32_t cyclesLate) {
video->modeEvent.callback = _endMode3;
GBRegisterSTAT oldStat = video->stat;
video->stat = GBRegisterSTATSetMode(video->stat, video->mode);
if (!_statIRQAsserted(video, oldStat) && _statIRQAsserted(video, video->stat)) {
if (!_statIRQAsserted(oldStat) && _statIRQAsserted(video->stat)) {
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
GBUpdateIRQs(video->p);
}
@ -326,7 +326,7 @@ void _endMode3(struct mTiming* timing, void* context, uint32_t cyclesLate) {
video->modeEvent.callback = _endMode0;
GBRegisterSTAT oldStat = video->stat;
video->stat = GBRegisterSTATSetMode(video->stat, video->mode);
if (!_statIRQAsserted(video, oldStat) && _statIRQAsserted(video, video->stat)) {
if (!_statIRQAsserted(oldStat) && _statIRQAsserted(video->stat)) {
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
GBUpdateIRQs(video->p);
}
@ -416,7 +416,7 @@ void GBVideoWriteLCDC(struct GBVideo* video, GBRegisterLCDC value) {
GBRegisterSTAT oldStat = video->stat;
video->stat = GBRegisterSTATSetMode(video->stat, 0);
video->stat = GBRegisterSTATSetLYC(video->stat, video->ly == video->p->memory.io[REG_LYC]);
if (!_statIRQAsserted(video, oldStat) && _statIRQAsserted(video, video->stat)) {
if (!_statIRQAsserted(oldStat) && _statIRQAsserted(video->stat)) {
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
GBUpdateIRQs(video->p);
}
@ -447,7 +447,7 @@ void GBVideoWriteSTAT(struct GBVideo* video, GBRegisterSTAT value) {
if (!GBRegisterLCDCIsEnable(video->p->memory.io[REG_LCDC]) || video->p->model >= GB_MODEL_CGB) {
return;
}
if (!_statIRQAsserted(video, oldStat) && video->mode < 3) {
if (!_statIRQAsserted(oldStat) && video->mode < 3) {
// TODO: variable for the IRQ line value?
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
GBUpdateIRQs(video->p);
@ -458,7 +458,7 @@ void GBVideoWriteLYC(struct GBVideo* video, uint8_t value) {
GBRegisterSTAT oldStat = video->stat;
if (GBRegisterLCDCIsEnable(video->p->memory.io[REG_LCDC])) {
video->stat = GBRegisterSTATSetLYC(video->stat, value == video->ly);
if (!_statIRQAsserted(video, oldStat) && _statIRQAsserted(video, video->stat)) {
if (!_statIRQAsserted(oldStat) && _statIRQAsserted(video->stat)) {
video->p->memory.io[REG_IF] |= (1 << GB_IRQ_LCDSTAT);
GBUpdateIRQs(video->p);
}