Skip to content

Commit 0d7af2b

Browse files
committed
[SIO] Cleanup
1 parent a5ed181 commit 0d7af2b

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/core/sio.cc

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,7 @@ uint8_t PCSX::SIO::sioRead8() {
339339
}
340340

341341
uint16_t PCSX::SIO::readStatus16() {
342-
uint16_t hard;
343-
344-
hard = m_statusReg;
342+
uint16_t hard = m_statusReg;
345343

346344
#if 0
347345
// wait for IRQ first
@@ -372,7 +370,6 @@ void PCSX::SIO::netError() {
372370

373371
void PCSX::SIO::interrupt() {
374372
SIO0_LOG("Sio Interrupt (CP0.Status = %x)\n", PCSX::g_emulator->m_psxCpu->m_psxRegs.CP0.n.Status);
375-
// PCSX::g_system->printf("Sio Interrupt\n");
376373
m_statusReg |= IRQ;
377374
psxHu32ref(0x1070) |= SWAP_LEu32(0x80);
378375

@@ -398,11 +395,11 @@ void PCSX::SIO::LoadMcd(int mcd, const PCSX::u8string str) {
398395
}
399396

400397
FILE* f = fopen(fname, "rb");
401-
if (f == NULL) {
398+
if (f == nullptr) {
402399
PCSX::g_system->printf(_("The memory card %s doesn't exist - creating it\n"), fname);
403400
CreateMcd(str);
404401
f = fopen(fname, "rb");
405-
if (f != NULL) {
402+
if (f != nullptr) {
406403
struct stat buf;
407404

408405
if (stat(fname, &buf) != -1) {
@@ -414,7 +411,7 @@ void PCSX::SIO::LoadMcd(int mcd, const PCSX::u8string str) {
414411
fseek(f, 3904, SEEK_SET);
415412
}
416413
if (fread(data, 1, MCD_SIZE, f) != MCD_SIZE) {
417-
throw("File read error.");
414+
throw("Error reading memory card.");
418415
}
419416
fclose(f);
420417
} else
@@ -429,7 +426,7 @@ void PCSX::SIO::LoadMcd(int mcd, const PCSX::u8string str) {
429426
fseek(f, 3904, SEEK_SET);
430427
}
431428
if (fread(data, 1, MCD_SIZE, f) != MCD_SIZE) {
432-
throw("File read error.");
429+
throw("Error reading memory card.");
433430
}
434431
fclose(f);
435432
}

0 commit comments

Comments
 (0)