[Projext64] Add Load32VideoInterface

This commit is contained in:
zilmar 2015-12-21 21:01:56 +11:00
parent 0324714be7
commit 6d4ea6d693
2 changed files with 33 additions and 23 deletions

View File

@ -2527,29 +2527,8 @@ bool CMipsMemoryVM::LW_NonMemory(uint32_t PAddr, uint32_t* Value)
*Value = m_MemLookupValue.UW[0];
break;
case 0x04400000:
switch (PAddr)
{
case 0x04400000: *Value = g_Reg->VI_STATUS_REG; break;
case 0x04400004: *Value = g_Reg->VI_ORIGIN_REG; break;
case 0x04400008: *Value = g_Reg->VI_WIDTH_REG; break;
case 0x0440000C: *Value = g_Reg->VI_INTR_REG; break;
case 0x04400010:
UpdateHalfLine();
*Value = m_HalfLine;
break;
case 0x04400014: *Value = g_Reg->VI_BURST_REG; break;
case 0x04400018: *Value = g_Reg->VI_V_SYNC_REG; break;
case 0x0440001C: *Value = g_Reg->VI_H_SYNC_REG; break;
case 0x04400020: *Value = g_Reg->VI_LEAP_REG; break;
case 0x04400024: *Value = g_Reg->VI_H_START_REG; break;
case 0x04400028: *Value = g_Reg->VI_V_START_REG; break;
case 0x0440002C: *Value = g_Reg->VI_V_BURST_REG; break;
case 0x04400030: *Value = g_Reg->VI_X_SCALE_REG; break;
case 0x04400034: *Value = g_Reg->VI_Y_SCALE_REG; break;
default:
*Value = 0;
return false;
}
Load32VideoInterface();
*Value = m_MemLookupValue.UW[0];
break;
case 0x04500000:
switch (PAddr)
@ -5663,3 +5642,33 @@ void CMipsMemoryVM::Load32MIPSInterface(void)
}
}
}
void CMipsMemoryVM::Load32VideoInterface(void)
{
switch (m_MemLookupAddress & 0x1FFFFFFF)
{
case 0x04400000: m_MemLookupValue.UW[0] = g_Reg->VI_STATUS_REG; break;
case 0x04400004: m_MemLookupValue.UW[0] = g_Reg->VI_ORIGIN_REG; break;
case 0x04400008: m_MemLookupValue.UW[0] = g_Reg->VI_WIDTH_REG; break;
case 0x0440000C: m_MemLookupValue.UW[0] = g_Reg->VI_INTR_REG; break;
case 0x04400010:
g_MMU->UpdateHalfLine();
m_MemLookupValue.UW[0] = g_MMU->m_HalfLine;
break;
case 0x04400014: m_MemLookupValue.UW[0] = g_Reg->VI_BURST_REG; break;
case 0x04400018: m_MemLookupValue.UW[0] = g_Reg->VI_V_SYNC_REG; break;
case 0x0440001C: m_MemLookupValue.UW[0] = g_Reg->VI_H_SYNC_REG; break;
case 0x04400020: m_MemLookupValue.UW[0] = g_Reg->VI_LEAP_REG; break;
case 0x04400024: m_MemLookupValue.UW[0] = g_Reg->VI_H_START_REG; break;
case 0x04400028: m_MemLookupValue.UW[0] = g_Reg->VI_V_START_REG; break;
case 0x0440002C: m_MemLookupValue.UW[0] = g_Reg->VI_V_BURST_REG; break;
case 0x04400030: m_MemLookupValue.UW[0] = g_Reg->VI_X_SCALE_REG; break;
case 0x04400034: m_MemLookupValue.UW[0] = g_Reg->VI_Y_SCALE_REG; break;
default:
m_MemLookupValue.UW[0] = 0;
if (bHaveDebugger())
{
g_Notify->BreakPoint(__FILE__, __LINE__);
}
}
}

View File

@ -186,6 +186,7 @@ private:
static void Load32SPRegisters(void);
static void Load32DPCommand(void);
static void Load32MIPSInterface(void);
static void Load32VideoInterface(void);
CMipsMemory_CallBack * const m_CBClass;