System: Fix loading of EXEs with sp=0 (leave unchanged)

This commit is contained in:
Connor McLaughlin
2019-12-11 16:34:56 +10:00
parent 41404cad47
commit cda2394287
2 changed files with 26 additions and 7 deletions

View File

@ -386,9 +386,9 @@ bool System::LoadEXE(const char* filename, std::vector<u8>& bios_image)
std::fclose(fp);
// patch the BIOS to jump to the executable directly
const u32 r_pc = header.load_address;
const u32 r_pc = header.initial_pc;
const u32 r_gp = header.initial_gp;
const u32 r_sp = header.initial_sp_base;
const u32 r_sp = header.initial_sp_base + header.initial_sp_offset;
const u32 r_fp = header.initial_sp_base + header.initial_sp_offset;
return BIOS::PatchBIOSForEXE(bios_image, r_pc, r_gp, r_sp, r_fp);
}