small changes and fixes

This commit is contained in:
SimoneN64
2023-06-06 10:59:14 +02:00
parent ecdf7473e2
commit be7f1fc5a0
4 changed files with 4 additions and 8 deletions

View File

@@ -23,11 +23,11 @@ void Core::LoadROM(const std::string& rom_) {
cpu.mem.LoadROM(rom);
GameDB::match(cpu.mem);
cpu.mem.mmio.vi.isPal = cpu.mem.IsROMPAL();
cpu.mem.mmio.si.pif.InitDevices(cpu.mem.saveType);
cpu.mem.mmio.si.pif.LoadMempak(rom_);
cpu.mem.mmio.si.pif.LoadEeprom(cpu.mem.saveType, rom_);
cpu.mem.mmio.si.pif.ExecutePIF(cpu.mem, cpu.regs);
cpu.mem.mmio.vi.isPal = cpu.mem.IsROMPAL();
}
void Core::Run(float volumeL, float volumeR) {

View File

@@ -24,7 +24,6 @@ void GameDB::match(Mem& mem) {
i.name, i.regions, rom.header.countryCode[0]);
}
}
}
Util::debug("Did not match any Game DB entries. Code: {} Region: {}", mem.rom.code, mem.rom.header.countryCode[0]);

View File

@@ -5,7 +5,6 @@
#include <SDL_keyboard.h>
#include <cic_nus_6105/n64_cic_nus_6105.hpp>
#include <cassert>
#include <MupenMovie.hpp>
#define MEMPAK_SIZE 32768
@@ -294,8 +293,7 @@ void PIF::EepromRead(u8* cmd, u8* res, const Mem& mem) const {
for (int i = 0; i < 8; i++) {
res[i] = eeprom[(offset * 8) + i];
}
}
else {
} else {
Util::panic("EEPROM read on bad channel {}", channel);
}
}
@@ -313,8 +311,7 @@ void PIF::EepromWrite(u8* cmd, u8* res, const Mem& mem) const {
}
res[0] = 0; // Error byte, I guess it always succeeds?
}
else {
} else {
Util::panic("EEPROM write on bad channel {}", channel);
}
}

View File

@@ -110,7 +110,7 @@ struct PIF {
bool gamepadConnected = false;
SDL_GameController* gamepad{};
JoybusDevice joybusDevices[6]{};
u8 bootrom[PIF_BOOTROM_SIZE]{}, ram[PIF_RAM_SIZE]{}, *mempak, *eeprom;
u8 bootrom[PIF_BOOTROM_SIZE]{}, ram[PIF_RAM_SIZE]{}, *mempak{}, *eeprom{};
int channel = 0;
std::string mempakPath{}, eepromPath{};
size_t eepromSize{};