Remove unused code and use explicit type coercions

This commit is contained in:
Fabrice de Gans 2023-04-24 17:44:11 -07:00 committed by Fabrice de Gans
parent 1f57d5f797
commit 7b5d4a82d7
5 changed files with 5 additions and 13 deletions

View File

@ -105,10 +105,6 @@ extern void systemShowSpeed(int);
extern void system10Frames();
extern void systemFrame();
extern void systemGbBorderOn();
extern void Sm60FPS_Init();
extern bool Sm60FPS_CanSkipFrame();
extern void Sm60FPS_Sleep();
extern void DbgMsg(const char *msg, ...);
extern void (*dbgOutput)(const char *s, uint32_t addr);
extern void (*dbgSignal)(int sig, int number);
extern uint16_t systemColorMap16[0x10000];

View File

@ -568,7 +568,6 @@ int gbRemainingClockTicks = 0;
int gbOldClockTicks = 0;
int gbIntBreak = 0;
int gbInterruptLaunched = 0;
uint8_t gbCheatingDevice = 0; // 1 = GS, 2 = GG
// breakpoint
bool breakpoint = false;
// interrupt

View File

@ -256,7 +256,7 @@ void mapperMBC2ROM(uint16_t address, uint8_t value)
void mapperMBC2RAM(uint16_t address, uint8_t value)
{
if (gbDataMBC2.mapperRAMEnable) {
if (g_gbCartData.ram_size() && address < 0xa200) {
if (g_gbCartData.HasRam() && address < 0xa200) {
gbMemoryMap[address >> 12][address & 0x0fff] = value;
systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED;
}
@ -407,7 +407,7 @@ void mapperMBC3RAM(uint16_t address, uint8_t value)
{
if (gbDataMBC3.mapperRAMEnable) {
if (gbDataMBC3.mapperRAMBank >= 0) {
if (g_gbCartData.ram_size()) {
if (g_gbCartData.HasRam()) {
gbMemoryMap[address >> 12][address & 0x0fff] = value;
systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED;
}
@ -1035,7 +1035,7 @@ void mapperHuC3RAM(uint16_t address, uint8_t value)
if (gbDataHuC3.mapperRAMFlag < 0x0b || gbDataHuC3.mapperRAMFlag > 0x0e) {
if (gbDataHuC3.mapperRAMEnable) {
if (g_gbCartData.ram_size()) {
if (g_gbCartData.HasRam()) {
gbMemoryMap[address >> 12][address & 0x0fff] = value;
systemSaveUpdateCounter = SYSTEM_SAVE_UPDATED;
}
@ -1138,7 +1138,7 @@ void memoryUpdateMapHuC3()
gbMemoryMap[0x06] = &gbRom[tmpAddress + 0x2000];
gbMemoryMap[0x07] = &gbRom[tmpAddress + 0x3000];
if (g_gbCartData.ram_size()) {
if (g_gbCartData.HasRam()) {
tmpAddress = gbDataHuC3.mapperRAMBank << 13;
tmpAddress &= g_gbCartData.ram_mask();
gbMemoryMap[0x0a] = &gbRam[tmpAddress];

View File

@ -190,9 +190,6 @@ void mapperMMM01ROM(uint16_t, uint8_t);
void mapperMMM01RAM(uint16_t, uint8_t);
void mapperGGROM(uint16_t, uint8_t);
void mapperGS3ROM(uint16_t, uint8_t);
// extern void (*mapper)(uint16_t,uint8_t);
// extern void (*mapperRAM)(uint16_t,uint8_t);
// extern uint8_t (*mapperReadRAM)(uint16_t);
extern void memoryUpdateMapMBC1();
extern void memoryUpdateMapMBC2();

View File

@ -933,7 +933,7 @@ static void gb_init(void)
if (option_useBios) {
snprintf(biosfile, sizeof(biosfile), "%s%c%s",
retro_system_directory, SLASH, biosname[gbCgbMode]);
retro_system_directory, SLASH, biosname[gbCgbMode ? 1 : 0]);
log("Loading bios: %s\n", biosfile);
}