Skip to content

Commit

Permalink
The bal to the decompression code is now variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasnoble committed Dec 13, 2023
1 parent 0a4c06f commit 85eea1e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/supportpsx/ps1-packer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ void PCSX::PS1Packer::pack(IO<File> src, IO<File> dest, uint32_t addr, uint32_t

// Now we start writing our decompressor stub.
// First, dump the decompressor code.
size_t n2estart = dataOut.size();
pushBytes(dataOut, n2e_d::code);

Check warning on line 145 in src/supportpsx/ps1-packer.cc

View check run for this annotation

Codecov / codecov/patch

src/supportpsx/ps1-packer.cc#L144-L145

Added lines #L144 - L145 were not covered by tests

// At this point in the dataOut buffer, we have the following:
Expand Down Expand Up @@ -171,7 +172,7 @@ void PCSX::PS1Packer::pack(IO<File> src, IO<File> dest, uint32_t addr, uint32_t
pushBytes(dataOut, lui(Reg::A0, getHI(compLoad)));
pushBytes(dataOut, addiu(Reg::A0, Reg::A0, getLO(compLoad)));
pushBytes(dataOut, lui(Reg::A1, getHI(addr)));
pushBytes(dataOut, bgezal(Reg::R0, -((int16_t)(sizeof(n2e_d::code) + 7 * 4))));
pushBytes(dataOut, bgezal(Reg::R0, -((int16_t)(dataOut.size() + 4 - n2estart))));

Check warning on line 175 in src/supportpsx/ps1-packer.cc

View check run for this annotation

Codecov / codecov/patch

src/supportpsx/ps1-packer.cc#L175

Added line #L175 was not covered by tests
pushBytes(dataOut, addiu(Reg::A1, Reg::A1, getLO(addr)));

// Then, bootstrap our newly-decompressed binary.
Expand Down

0 comments on commit 85eea1e

Please sign in to comment.