Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
system: do not set SP when loading .exe when 0
  • Loading branch information
JaCzekanski committed Sep 22, 2019
1 parent ea1fb0e commit 7d70944
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/platform/windows/gui/debug/gpu.cpp
Expand Up @@ -269,7 +269,8 @@ void GPU::logWindow(System *sys) {
// TODO: Render texture
}

vramAreas.push_back({textureInfo, ImVec2(texX, texY), ImVec2(textureWidth, h)});
vramAreas.push_back(
{textureInfo, ImVec2(texPageX + texX / (16 / textureBits), texPageY + texY), ImVec2(textureWidth, h)});

if (clutColors != 0) {
vramAreas.push_back({"CLUT", ImVec2(clutX, clutY), ImVec2(clutColors, 1)});
Expand Down
7 changes: 5 additions & 2 deletions src/system.cpp
Expand Up @@ -426,8 +426,11 @@ bool System::loadExeFile(const std::vector<uint8_t>& _exe) {

cpu->setPC(exe.pc0);
cpu->reg[28] = exe.gp0;
cpu->reg[29] = exe.s_addr + exe.s_size;
cpu->reg[30] = exe.s_addr + exe.s_size;

if (exe.s_addr != 0) {
cpu->reg[29] = exe.s_addr + exe.s_size;
cpu->reg[30] = exe.s_addr + exe.s_size;
}

cpu->inBranchDelay = false;

Expand Down

0 comments on commit 7d70944

Please sign in to comment.