Screen extent write; doesn't seem to do anything :/

This commit is contained in:
Ben Vanik 2015-03-14 16:50:54 -07:00
parent 7192728fe0
commit 6f0ca00651
2 changed files with 24 additions and 5 deletions

View File

@ -1144,11 +1144,12 @@ bool CommandProcessor::ExecutePacketType3_COND_WRITE(RingbufferReader* reader,
} }
bool CommandProcessor::ExecutePacketType3_EVENT_WRITE(RingbufferReader* reader, bool CommandProcessor::ExecutePacketType3_EVENT_WRITE(RingbufferReader* reader,
uint32_t packet, uint32_t packet,
uint32_t count) { uint32_t count) {
// generate an event that creates a write to memory when completed // generate an event that creates a write to memory when completed
uint32_t initiator = reader->Read(); uint32_t initiator = reader->Read();
// Writeback initiator.
WriteRegister(XE_GPU_REG_VGT_EVENT_INITIATOR, initiator & 0x3F);
if (count == 1) { if (count == 1) {
// Just an event flag? Where does this write? // Just an event flag? Where does this write?
} else { } else {
@ -1186,8 +1187,26 @@ bool CommandProcessor::ExecutePacketType3_EVENT_WRITE_SHD(
bool CommandProcessor::ExecutePacketType3_EVENT_WRITE_EXT( bool CommandProcessor::ExecutePacketType3_EVENT_WRITE_EXT(
RingbufferReader* reader, uint32_t packet, uint32_t count) { RingbufferReader* reader, uint32_t packet, uint32_t count) {
// generate a screen extent event // generate a screen extent event
uint32_t unk0 = reader->Read(); uint32_t initiator = reader->Read();
uint32_t unk1 = reader->Read(); uint32_t address = reader->Read();
// Writeback initiator.
WriteRegister(XE_GPU_REG_VGT_EVENT_INITIATOR, initiator & 0x3F);
auto endianness = static_cast<Endian>(address & 0x3);
address &= ~0x3;
// Let us hope we can fake this.
uint16_t extents[] = {
0 / 8, // min x
2560 / 8, // max x
0 / 8, // min y
2560 / 8, // max y
0, // min z
0, // max z
};
assert_true(endianness == xenos::Endian::k8in16);
poly::copy_and_swap_16_aligned(
reinterpret_cast<uint16_t*>(membase_ + GpuToCpu(address)), extents,
poly::countof(extents));
trace_writer_.WriteMemoryWrite(address, sizeof(extents));
return true; return true;
} }

View File

@ -1259,9 +1259,9 @@ void DrawStateUI(xe::ui::MainWindow* window, TracePlayer& player,
int32_t screen_scissor_x = pa_sc_screen_scissor_tl & 0x7FFF; int32_t screen_scissor_x = pa_sc_screen_scissor_tl & 0x7FFF;
int32_t screen_scissor_y = (pa_sc_screen_scissor_tl >> 16) & 0x7FFF; int32_t screen_scissor_y = (pa_sc_screen_scissor_tl >> 16) & 0x7FFF;
int32_t screen_scissor_w = int32_t screen_scissor_w =
pa_sc_screen_scissor_br & 0x7FFF - screen_scissor_x; (pa_sc_screen_scissor_br & 0x7FFF) - screen_scissor_x;
int32_t screen_scissor_h = int32_t screen_scissor_h =
(pa_sc_screen_scissor_br >> 16) & 0x7FFF - screen_scissor_y; ((pa_sc_screen_scissor_br >> 16) & 0x7FFF) - screen_scissor_y;
ImGui::BulletText("Scissor: %d,%d to %d,%d (%d x %d)", screen_scissor_x, ImGui::BulletText("Scissor: %d,%d to %d,%d (%d x %d)", screen_scissor_x,
screen_scissor_y, screen_scissor_x + screen_scissor_w, screen_scissor_y, screen_scissor_x + screen_scissor_w,
screen_scissor_y + screen_scissor_h, screen_scissor_w, screen_scissor_y + screen_scissor_h, screen_scissor_w,