fuck this shit

This commit is contained in:
2026-06-11 14:37:02 +02:00
parent 2b59e5f461
commit bad1691ee2
13 changed files with 414 additions and 317 deletions
+10 -6
View File
@@ -90,7 +90,10 @@ FORCE_INLINE void SetROMCIC(u32 checksum, ROM &rom) {
}
}
void Mem::LoadROM(const bool isArchive, const std::string &filename) {
ROM Mem::LoadROM(const bool isArchive, const std::string &filename) {
ROM rom;
rom.cart.resize(CART_SIZE);
std::ranges::fill(rom.cart, 0);
u32 endianness;
{
size_t sizeAdjusted;
@@ -133,7 +136,8 @@ void Mem::LoadROM(const bool isArchive, const std::string &filename) {
SetROMCIC(checksum, rom);
endianness = std::byteswap(ircolib::ReadAccess<u32>(rom.cart, 0));
Util::SwapN64Rom(rom.cart, endianness);
rom.pal = IsROMPAL();
rom.pal = IsROMPAL(rom);
return rom;
}
template <>
@@ -451,7 +455,7 @@ void Mem::Write(const u32 paddr, u64 val) {
template <>
u32 Mem::BackupRead<u32>(const u32 addr) {
switch (saveType) {
switch (rom.saveType) {
case SAVE_NONE:
return 0;
case SAVE_EEPROM_4k:
@@ -469,7 +473,7 @@ u32 Mem::BackupRead<u32>(const u32 addr) {
template <>
u8 Mem::BackupRead<u8>(const u32 addr) {
switch (saveType) {
switch (rom.saveType) {
case SAVE_NONE:
return 0;
case SAVE_EEPROM_4k:
@@ -492,7 +496,7 @@ u8 Mem::BackupRead<u8>(const u32 addr) {
template <>
void Mem::BackupWrite<u32>(const u32 addr, const u32 val) {
switch (saveType) {
switch (rom.saveType) {
case SAVE_NONE:
warn("Accessing cartridge with save type SAVE_NONE in write word");
break;
@@ -511,7 +515,7 @@ void Mem::BackupWrite<u32>(const u32 addr, const u32 val) {
template <>
void Mem::BackupWrite<u8>(const u32 addr, const u8 val) {
switch (saveType) {
switch (rom.saveType) {
case SAVE_NONE:
warn("Accessing cartridge with save type SAVE_NONE in write word");
break;