コード例 #1
0
void Interpreter::Helper_UpdateCR0(u32 value)
{
	s64 sign_extended = (s64)(s32)value;
	u64 cr_val = (u64)sign_extended;
	cr_val = (cr_val & ~(1ull << 61)) | ((u64)GetXER_SO() << 61);

	PowerPC::ppcState.cr_val[0] = cr_val;
}
コード例 #2
0
void Interpreter::stwcxd(UGeckoInstruction _inst)
{
	// Stores Word Conditional indeXed
	u32 uAddress;
	if (g_bReserve) {
		uAddress = Helper_Get_EA_X(_inst);
		if (uAddress == g_reserveAddr) {
			Memory::Write_U32(m_GPR[_inst.RS], uAddress);
			if (!(PowerPC::ppcState.Exceptions & EXCEPTION_DSI))
			{
				g_bReserve = false;
				SetCRField(0, 2 | GetXER_SO());
				return;
			}
		}
	}

	SetCRField(0, GetXER_SO());
}