Permalink
Browse files

Gekko: Make UReg_MSR's single-argument constructor explicit

Prevents implicit construction of MSR instances from integral values.
This is beneficial, considering MSR values have an intended
representation while a regular magic value doesn't. So make these
conversions required to be explicit.
  • Loading branch information...
lioncash committed May 5, 2018
1 parent ffcf107 commit 0043b77ccd4aec9fc5d3dda155c35286caf67da3
@@ -428,7 +428,7 @@ void FifoPlayer::LoadMemory()
UReg_MSR newMSR;
newMSR.DR = 1;
newMSR.IR = 1;
MSR = newMSR.Hex;
MSR.Hex = newMSR.Hex;
PowerPC::ppcState.spr[SPR_IBAT0U] = 0x80001fff;
PowerPC::ppcState.spr[SPR_IBAT0L] = 0x00000002;
PowerPC::ppcState.spr[SPR_DBAT0U] = 0x80001fff;
@@ -378,7 +378,7 @@ union UReg_MSR
u32 Hex = 0;
UReg_MSR() = default;
UReg_MSR(u32 hex_) : Hex{hex_} {}
explicit UReg_MSR(u32 hex_) : Hex{hex_} {}
};
#define FPRF_SHIFT 12
@@ -144,7 +144,7 @@ static void ResetRegisters()
SystemTimers::TimeBaseSet();
// MSR should be 0x40, but we don't emulate BS1, so it would never be turned off :}
ppcState.msr = 0;
ppcState.msr.Hex = 0;
rDEC = 0xFFFFFFFF;
SystemTimers::DecrementerSet();
}

0 comments on commit 0043b77

Please sign in to comment.