Skip to content

Commit

Permalink
GE dump playback: Don't flip unless DISPLAY is the last command. This…
Browse files Browse the repository at this point in the history
… messes up the frame structure.
  • Loading branch information
hrydgard committed Jan 30, 2024
1 parent 25a1e6a commit 8b99c9f
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions GPU/Debugger/Playback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class DumpExecute {
void Memcpy(u32 ptr, u32 sz);
void Texture(int level, u32 ptr, u32 sz);
void Framebuf(int level, u32 ptr, u32 sz);
void Display(u32 ptr, u32 sz);
void Display(u32 ptr, u32 sz, bool allowFlip);
void EdramTrans(u32 ptr, u32 sz);

u32 execMemcpyDest = 0;
Expand Down Expand Up @@ -616,7 +616,7 @@ void DumpExecute::Framebuf(int level, u32 ptr, u32 sz) {
}
}

void DumpExecute::Display(u32 ptr, u32 sz) {
void DumpExecute::Display(u32 ptr, u32 sz, bool allowFlip) {
struct DisplayBufData {
PSPPointer<u8> topaddr;
int linesize, pixelFormat;
Expand All @@ -628,7 +628,9 @@ void DumpExecute::Display(u32 ptr, u32 sz) {
SyncStall();

__DisplaySetFramebuf(disp->topaddr.ptr, disp->linesize, disp->pixelFormat, 1);
__DisplaySetFramebuf(disp->topaddr.ptr, disp->linesize, disp->pixelFormat, 0);
if (allowFlip) {
__DisplaySetFramebuf(disp->topaddr.ptr, disp->linesize, disp->pixelFormat, 0);
}
}

void DumpExecute::EdramTrans(u32 ptr, u32 sz) {
Expand Down Expand Up @@ -657,7 +659,8 @@ bool DumpExecute::Run() {
if (gpu)
gpu->SetAddrTranslation(0x400);

for (const Command &cmd : commands_) {
for (size_t i = 0; i < commands_.size(); i++) {
const Command &cmd = commands_[i];
switch (cmd.type) {
case CommandType::INIT:
Init(cmd.ptr, cmd.sz);
Expand Down Expand Up @@ -726,7 +729,7 @@ bool DumpExecute::Run() {
break;

case CommandType::DISPLAY:
Display(cmd.ptr, cmd.sz);
Display(cmd.ptr, cmd.sz, i == commands_.size() - 1);
break;

default:
Expand Down

1 comment on commit 8b99c9f

@InfamousKnight
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this gpu debugger be used to make a tas(tool assisted speedrun)?

Please sign in to comment.