__forceinline u32 InterpretDisplayList(u32 address, u32 size) { u8* startAddress; if (g_use_deterministic_gpu_thread) startAddress = static_cast<u8*>(PopFifoAuxBuffer(size)); else startAddress = static_cast<u8*>(Memory::GetPointer(address)); u32 cycles = 0; // Avoid the crash if Memory::GetPointer failed .. if (startAddress != nullptr) { u8* old_pVideoData = g_VideoData.GetReadPosition(); u8* old_pVideoDataEnd = g_VideoData.GetEnd(); g_VideoData.SetReadPosition(startAddress, startAddress + size); // temporarily swap dl and non-dl (small "hack" for the stats) Statistics::SwapDL(); OpcodeDecoder_Run<false, false>(g_VideoData, &cycles); INCSTAT(stats.thisFrame.numDListsCalled); // un-swap Statistics::SwapDL(); // reset to the old pointer g_VideoData.SetReadPosition(old_pVideoData, old_pVideoDataEnd); } return cycles; }
static u32 InterpretDisplayList(u32 address, u32 size) { u8* startAddress; if (g_use_deterministic_gpu_thread) startAddress = (u8*) PopFifoAuxBuffer(size); else startAddress = Memory::GetPointer(address); u32 cycles = 0; // Avoid the crash if Memory::GetPointer failed .. if (startAddress != nullptr) { // temporarily swap dl and non-dl (small "hack" for the stats) Statistics::SwapDL(); OpcodeDecoder_Run(DataReader(startAddress, startAddress + size), &cycles, true); INCSTAT(stats.thisFrame.numDListsCalled); // un-swap Statistics::SwapDL(); } return cycles; }
// TODO - verify that it is correct. Seems to work, though. void LoadIndexedXF(u32 val, int refarray) { int index = val >> 16; int address = val & 0xFFF; // check mask int size = ((val >> 12) & 0xF) + 1; //load stuff from array to address in xf mem u32* currData = (u32*)(&xfmem) + address; u32* newData; if (g_use_deterministic_gpu_thread) { newData = (u32*)PopFifoAuxBuffer(size * sizeof(u32)); } else { newData = (u32*)Memory::GetPointer(g_main_cp_state.array_bases[refarray] + g_main_cp_state.array_strides[refarray] * index); } bool changed = false; for (int i = 0; i < size; ++i) { if (currData[i] != Common::swap32(newData[i])) { changed = true; XFMemWritten(size, address); break; } } if (changed) { for (int i = 0; i < size; ++i) currData[i] = Common::swap32(newData[i]); } }