Fixed build warnings for gcc

This commit is contained in:
Robert 2021-10-29 22:33:34 +02:00
parent cabc0ae639
commit a579793bd1
8 changed files with 45 additions and 37 deletions

View file

@ -7,7 +7,7 @@
void logBusState(struct Bus* bus)
{
const char buffer[32];
char buffer[32];
Word oldPC = bus->cpu->pc.word - bus->cpu->currentOpcode->length;
@ -29,7 +29,7 @@ void logBusState(struct Bus* bus)
case ABX: sprintf(buffer, "$%04X, X -> $%04X", (instructionBytes[2] << 8) | instructionBytes[1], bus->cpu->fetchedAddress); break;
case ABY: sprintf(buffer, "$%04X, Y -> $%04X", (instructionBytes[2] << 8) | instructionBytes[1], bus->cpu->fetchedAddress); break;
case IMM: sprintf(buffer, "#$%02X", bus->cpu->fetchedVal); break;
case IMP: sprintf(buffer, ""); break;
case IMP: sprintf(buffer, " "); break;
case IND: sprintf(buffer, "($%04X) -> $%04X", (instructionBytes[2] << 8) | instructionBytes[1], bus->cpu->fetchedAddress); break;
case INDX: sprintf(buffer, "($%02X, X) -> $%04X", instructionBytes[1], bus->cpu->fetchedAddress); break;
case INDY: sprintf(buffer, "($%02X), Y -> $%04X", instructionBytes[1], bus->cpu->fetchedAddress); break;
@ -48,4 +48,4 @@ void logBusState(struct Bus* bus)
bus->cpu->status.raw,
bus->ppu->y, bus->ppu->x,
bus->cpu->totalCycles);
}
}