Lay down RTC things

This commit is contained in:
SimoneN64
2023-06-05 21:54:06 +02:00
parent 39152893ca
commit ca9204044f
2 changed files with 9 additions and 1 deletions

View File

@@ -20,7 +20,7 @@ void GameDB::match(Mem& mem) {
mem.rom.gameNameDB = i.name; mem.rom.gameNameDB = i.name;
return; return;
} else { } else {
Util::warn("Matched code for %s, but not region! Game supposedly exists in regions [{}] but this image has region {}", Util::warn("Matched code for {}, but not region! Game supposedly exists in regions [{}] but this image has region {}",
i.name, i.regions, rom.header.countryCode[0]); i.name, i.regions, rom.header.countryCode[0]);
} }
} }

View File

@@ -141,6 +141,9 @@ FORCE_INLINE u8 data_crc(const u8* data) {
return crc; return crc;
} }
#define BCD_ENCODE(x) (((x) / 10) << 4 | ((x) % 10))
#define BCD_DECODE(x) (((x) >> 4) * 10 + ((x) & 15))
void PIF::ProcessCommands(Mem &mem) { void PIF::ProcessCommands(Mem &mem) {
u8 control = ram[63]; u8 control = ram[63];
if (control & 1) { if (control & 1) {
@@ -194,6 +197,11 @@ void PIF::ProcessCommands(Mem &mem) {
case 5: case 5:
EepromWrite(cmd, res, mem); EepromWrite(cmd, res, mem);
break; break;
case 6:
res[0] = 0x00;
res[1] = 0x10;
res[2] = 0x00;
break;
default: default:
Util::panic("Invalid PIF command: {:X}", cmd[2]); Util::panic("Invalid PIF command: {:X}", cmd[2]);
} }