grumpycoders / pcsx-redux

The PCSX-Redux project is a collection of tools, research, hardware design, and libraries aiming at development and reverse engineering on the PlayStation 1. The core product itself, PCSX-Redux, is yet another fork of the Playstation emulator, PCSX.

Home Page:https://pcsx-redux.consoledev.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug in ps1-packer & openbios cart?

the-connors opened this issue · comments

openbios cart boot:

lui $t0, 0b1100101010000000
li $t1, 0x0314
li $t2, 0xffff
mtc0 $t0, $7
mtc0 $t1, $5
mtc0 $t2, $9

ps1-packer:

pushBytes(dataOut, lui(Reg::T0, 0b1100101010000000));
pushBytes(dataOut, lui(Reg::T1, 0x8003));
pushBytes(dataOut, addiu(Reg::T2, Reg::R0, -1));
pushBytes(dataOut, 0x40883800); // mtc0 $t0, $7
pushBytes(dataOut, 0x40892800); // mtc0 $t1, $5
pushBytes(dataOut, 0x408a4800); // mtc0 $t2, $9

This set DCIC before BDA / BDAM. But BDA / BDAM maybe not proper and trigger breakpoint? Maybe better order:

DCIC = 0
BDA = address
BDAM = addressmask
DCIC = mask

make sure breakpoint won't trigger.

Okay, you had my curiosity with #1400 and #1405, but now you've got my attention :-)

DCIC is supposed to be zeroed by the BIOS on boot, so technically the boot.s file is correct.

However, ps1-packer is intended to produce payloads usable in many situations, so this concern is probably legit. I'll adjust the code accordingly.

This was addressed.