From 6bc6d20a87c49d11eec582a74aa9559d3946bf25 Mon Sep 17 00:00:00 2001 From: Akash Date: Thu, 18 Aug 2016 20:10:08 +0530 Subject: [PATCH] R5900: Add an enum class for SYSCALL v2: Fix indentation on switch-case. --- pcsx2/R5900OpcodeImpl.cpp | 32 ++++++++++++++++++-------------- pcsx2/R5900OpcodeTables.h | 8 ++++++++ 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/pcsx2/R5900OpcodeImpl.cpp b/pcsx2/R5900OpcodeImpl.cpp index 23b85bf365..7d3db0ec4b 100644 --- a/pcsx2/R5900OpcodeImpl.cpp +++ b/pcsx2/R5900OpcodeImpl.cpp @@ -883,8 +883,11 @@ void SYSCALL() BIOS_LOG("Bios call: %s (%x)", R5900::bios[call], call); - switch (call) { - case 2: { + + switch (static_cast(call)) + { + case Syscall::SetGsCrt: + { //Function "SetGsCrt(Interlace, Mode, Field)" //Useful for fetching information of interlace/video/field display parameters of the Graphics Synthesizer @@ -940,22 +943,12 @@ void SYSCALL() } break; - case 13: + case Syscall::SetVTLBRefillHandler: DevCon.Warning("A tlb refill handler is set. New handler %x", (u32*)PSM(cpuRegs.GPR.n.a1.UL[0])); break; - case 0x7c: - { - if(cpuRegs.GPR.n.a0.UL[0] == 0x10) - { - eeConLog( ShiftJIS_ConvertString((char*)PSM(memRead32(cpuRegs.GPR.n.a1.UL[0]))) ); - } - else - __Deci2Call( cpuRegs.GPR.n.a0.UL[0], (u32*)PSM(cpuRegs.GPR.n.a1.UL[0]) ); - } - break; - case 0x77: + case Syscall::sceSifSetDma: // The only thing this code is used for is the one log message, so don't execute it if we aren't logging bios messages. if (SysTraceActive(EE.Bios)) { @@ -981,6 +974,17 @@ void SYSCALL() } break; + case Syscall::Deci2Call: + { + if (cpuRegs.GPR.n.a0.UL[0] == 0x10) + { + eeConLog(ShiftJIS_ConvertString((char*)PSM(memRead32(cpuRegs.GPR.n.a1.UL[0])))); + } + else + __Deci2Call(cpuRegs.GPR.n.a0.UL[0], (u32*)PSM(cpuRegs.GPR.n.a1.UL[0])); + } + break; + default: break; } diff --git a/pcsx2/R5900OpcodeTables.h b/pcsx2/R5900OpcodeTables.h index 394fb8c4c1..03d219de11 100644 --- a/pcsx2/R5900OpcodeTables.h +++ b/pcsx2/R5900OpcodeTables.h @@ -17,6 +17,14 @@ #include "Pcsx2Defs.h" +enum Syscall : u8 +{ + SetGsCrt = 2, + SetVTLBRefillHandler = 13, + sceSifSetDma = 119, + Deci2Call = 124 +}; + // TODO : Move these into the OpcodeTables namespace extern void (*Int_COP2PrintTable[32])(); extern void (*Int_COP2BC2PrintTable[32])();