示例#1
0
void R4300iOp32::LW()
{
    DWORD Address =  _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;
    if ((Address & 3) != 0)
    {
        ADDRESS_ERROR_EXCEPTION(Address, true);
    }

    if (LogOptions.GenerateLog)
    {
        Log_LW((*_PROGRAM_COUNTER),Address);
    }

    if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0]))
    {
        if (bShowTLBMisses())
        {
            g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str());
        }
        TLB_READ_EXCEPTION(Address);
    }
    else
    {
        _GPR[m_Opcode.rt].W[0] = _GPR[m_Opcode.rt].W[0];
    }
}
示例#2
0
void R4300iOp32::LBU()
{
    DWORD Address =  _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;
    if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0]))
    {
        if (bShowTLBMisses())
        {
            g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str());
        }
        TLB_READ_EXCEPTION(Address);
    }
    else
    {
        _GPR[m_Opcode.rt].UW[0] = _GPR[m_Opcode.rt].UB[0];
    }
}
void R4300iOp32::LB()
{
	DWORD Address =  _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;	
	if (!g_MMU->LB_VAddr(Address,_GPR[m_Opcode.rt].UB[0]))
	{
		if (bShowTLBMisses())
		{
			g_Notify->DisplayError(L"LB TLB: %X",Address);
		}
		TLB_READ_EXCEPTION(Address);
	}
	else
	{
		_GPR[m_Opcode.rt].W[0] = _GPR[m_Opcode.rt].B[0];
	}
}
示例#4
0
void R4300iOp32::LWL()
{
    DWORD Offset, Address, Value;

    Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;
    Offset  = Address & 3;

    if (!g_MMU->LW_VAddr((Address & ~3),Value))
    {
        if (bShowTLBMisses())
        {
            g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str());
        }
        TLB_READ_EXCEPTION(Address);
        return;
    }

    _GPR[m_Opcode.rt].W[0] = (int)(_GPR[m_Opcode.rt].W[0] & LWL_MASK[Offset]);
    _GPR[m_Opcode.rt].W[0] += (int)(Value << LWL_SHIFT[Offset]);
}
示例#5
0
void R4300iOp32::LWR()
{
    DWORD Offset, Address, Value;

    Address = _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;
    Offset  = Address & 3;

    if (!g_MMU->LW_VAddr((Address & ~3),Value))
    {
        g_Notify->BreakPoint(__FILEW__,__LINE__);
        if (bShowTLBMisses())
        {
            g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str());
        }
        return;
    }

    _GPR[m_Opcode.rt].W[0] = (int)(_GPR[m_Opcode.rt].W[0] & LWR_MASK[Offset]);
    _GPR[m_Opcode.rt].W[0] += (int)(Value >> LWR_SHIFT[Offset]);
}
void R4300iOp32::LHU()
{
	DWORD Address =  _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;	
	if ((Address & 1) != 0)
	{
		ADDRESS_ERROR_EXCEPTION(Address, true);
	}
	if (!g_MMU->LH_VAddr(Address,_GPR[m_Opcode.rt].UHW[0]))
	{
		if (bShowTLBMisses())
		{
			g_Notify->DisplayError(L"LHU TLB: %X",Address);
		}
		TLB_READ_EXCEPTION(Address);
	}
	else
	{
		_GPR[m_Opcode.rt].UW[0] = _GPR[m_Opcode.rt].UHW[0];
	}
}
示例#7
0
void R4300iOp32::LL()
{
    DWORD Address =  _GPR[m_Opcode.base].UW[0] + (short)m_Opcode.offset;
    if ((Address & 3) != 0)
    {
        ADDRESS_ERROR_EXCEPTION(Address, true);
    }

    if (!g_MMU->LW_VAddr(Address,_GPR[m_Opcode.rt].UW[0]))
    {
        if (bShowTLBMisses())
        {
            g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).ToUTF16().c_str());
        }
        TLB_READ_EXCEPTION(Address);
    }
    else
    {
        _GPR[m_Opcode.rt].W[0] = _GPR[m_Opcode.rt].W[0];
        (*_LLBit) = 1;
    }
}