diff --git a/src/apu/Gb_Apu.cpp b/src/apu/Gb_Apu.cpp index 14004d59..e3518846 100644 --- a/src/apu/Gb_Apu.cpp +++ b/src/apu/Gb_Apu.cpp @@ -218,6 +218,7 @@ void Gb_Apu::run_until_( blip_time_t end_time ) case 6: // 128 Hz square1.clock_sweep(); + [[fallthrough]]; case 0: case 4: // 256 Hz diff --git a/src/gb/GB.cpp b/src/gb/GB.cpp index e7b1a9f0..2445a7b8 100644 --- a/src/gb/GB.cpp +++ b/src/gb/GB.cpp @@ -1553,7 +1553,7 @@ void gbWriteMemory(uint16_t address, uint8_t value) } inBios = false; } - } + } break; // HDMA1 case 0x51: { @@ -1747,7 +1747,7 @@ void gbWriteMemory(uint16_t address, uint8_t value) gbMemory[0xff70] = register_SVBK = value; return; } - } + } break; case 0x75: { gbMemory[0xff75] = 0x8f | value; diff --git a/src/gba/Cheats.cpp b/src/gba/Cheats.cpp index 0c59678c..9ef876dc 100644 --- a/src/gba/Cheats.cpp +++ b/src/gba/Cheats.cpp @@ -1086,10 +1086,11 @@ int cheatsCheckKeys(uint32_t keys, uint32_t extended) break; case GSA_32_BIT_WRITE_IOREGS: if (cheatsList[i].address <= 0x3FF) { - if (((cheatsList[i].address & 0x3FC) != 0x6) && ((cheatsList[i].address & 0x3FC) != 0x130)) - ioMem[cheatsList[i].address & 0x3FC] = (cheatsList[i].value & 0xFFFF); - if ((((cheatsList[i].address & 0x3FC) + 2) != 0x6) && ((cheatsList[i].address & 0x3FC) + 2) != 0x130) - ioMem[(cheatsList[i].address & 0x3FC) + 2] = ((cheatsList[i].value >> 16) & 0xFFFF); + uint32_t cheat_addr = cheatsList[i].address & 0x3FC; + if ((cheat_addr != 6) && (cheat_addr != 0x130)) + ioMem[cheat_addr] = (cheatsList[i].value & 0xFFFF); + if (((cheat_addr + 2) != 0x6) && (cheat_addr + 2) != 0x130) + ioMem[cheat_addr + 2] = ((cheatsList[i].value >> 16) & 0xFFFF); } break; case GSA_8_BIT_IF_TRUE3: @@ -1352,6 +1353,7 @@ void cheatsDelete(int number, bool restore) } else { CPUWriteMemory(cheatsList[x].address, cheatsList[x].oldValue); } + [[fallthrough]]; case GSA_16_BIT_ROM_PATCH: if (cheatsList[x].status & 1) { cheatsList[x].status &= ~1; diff --git a/src/gba/GBA.cpp b/src/gba/GBA.cpp index ae0e6b06..00940872 100644 --- a/src/gba/GBA.cpp +++ b/src/gba/GBA.cpp @@ -2250,7 +2250,8 @@ void CPUSoftwareInterrupt(int comment) break; case 0x2A: BIOS_SndDriverJmpTableCopy(); - // let it go, because we don't really emulate this function + // let it go, because we don't really emulate this function + [[fallthrough]]; default: #ifdef GBA_LOGGING if (systemVerbose & VERBOSE_SWI) { diff --git a/src/gba/GBAinline.h b/src/gba/GBAinline.h index a9310552..9f78cf0f 100644 --- a/src/gba/GBAinline.h +++ b/src/gba/GBAinline.h @@ -131,7 +131,7 @@ static inline uint32_t CPUReadMemory(uint32_t address) value = flashRead(address) * 0x01010101; break; } - // default + [[fallthrough]]; default: unreadable: #ifdef GBA_LOGGING @@ -281,7 +281,7 @@ static inline uint32_t CPUReadHalfWord(uint32_t address) value = flashRead(address) * 0x0101; break; } - // default + [[fallthrough]]; default: unreadable: if (cpuDmaRunning|| ((reg[15].I - cpuDmaPC) == (armState ? 4 : 2))) { @@ -407,7 +407,7 @@ static inline uint8_t CPUReadByte(uint32_t address) case 0x8500: return systemGetSensorY() >> 8; } - // default + [[fallthrough]]; default: unreadable: #ifdef GBA_LOGGING diff --git a/src/gba/ereader.cpp b/src/gba/ereader.cpp index 4f1ad7b2..2ed07b63 100644 --- a/src/gba/ereader.cpp +++ b/src/gba/ereader.cpp @@ -456,7 +456,7 @@ void BIOS_EReader_ScanCard(int swi_num) THUMB_PREFETCH } else if ((swi_num == 0xE3) || (swi_num == 0xE5)) //Dotcode data { - if ((reg[0].I >= 0) && (reg[0].I <= 0x10)) { + if (((int)reg[0].I >= 0) && (reg[0].I <= 0x10)) { if (decodestate == 0) { for (i = 0x17; i >= 0; i--) { if ((0x17 - i) < 8)