PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.58k stars 1.6k forks source link

EE Core logging no longer works #2358

Closed refractionpcsx2 closed 2 years ago

refractionpcsx2 commented 6 years ago

Not sure when it broke, but if you enable logging, EE, Disasm and any of the options inside there (R5900 Core etc), none of them actually make it log anything.

It should log everything when the emulator is running in Interpreter, but right now it does nothing.

Best I can say is it has been broken pre March 2016.

gregory38 commented 6 years ago

Well, potentially EE disasm is kind of disabled. Is it your issue ?

refractionpcsx2 commented 6 years ago

Could be! Didn't really look to deeply in to it. I wonder why it was disabled though.

gregory38 commented 6 years ago

I'm likely guilty. The thing is that dumping is quite verbose. So it is better to trig it in particular section of code (so you need to edit the code anyway). And interpreter is already slow enough to avoid useless check in the run loop.

refractionpcsx2 commented 6 years ago

Well the interpreter shouldn't be used unless you're debugging anyway, it's broken and extremely slow, so it shouldn't be used in the standard environment. Plus that code should only function if the logging for it is enabled, so if you don't want it, disable the logging, not the code :P

gregory38 commented 6 years ago

Feel free to put it back :+1:

PSI-Rockin commented 6 years ago

I found out about this issue the hard way. I had an idea to compare the PCSX2 state with the DobieStation state to figure out any differences while executing the BIOS, but the debugger doesn't look into the ROM... So I tried using the disasm, and that failed hard.

Would like to see this feature again, even if I'm the only one that would use it :P

gregory38 commented 6 years ago

Yes I know. But ultimately, you will need to hack the code. 300MHz means 100 million of prints by seconds. It is much easier to put a trigger to get interesting data.

refractionpcsx2 commented 6 years ago

So, I just turned this back on locally and it's crap now. It literally just shows the op. It used to show the register values and was REALLY handy, but now it's pretty much useless.

refractionpcsx2 commented 6 years ago

Forget it, the debug logging will have to be completely rewritten (or reverted) to be useful again, so this is pointless.

gregory38 commented 6 years ago

Hum. I think there are multiple ways (function/method) to dump value. Could you copy past the output ?

refractionpcsx2 commented 6 years ago

An example of the output

eDis(9fc42900 0008be2f): bne    v0, zero, ->$0x9FC428E8
eDis(9fc42904 0008be2f): nop
eDis(9fc428ec 0008be37): mfc0   v0, Count
eDis(9fc428f0 0008be37): subu   v0,v0, v1
eDis(9fc428f4 0008be37): sltu   v0,v0, a0
eDis(9fc428f8 0008be37): nop
eDis(9fc428fc 0008be37): nop

Simplify defaults to false, so it shouldn't be the "simple" version, but looking at the rest of the code, this is the best it gets.

gregory38 commented 6 years ago

I will try to give it a look. I don't remember if I removed the value because there were wrong or if we break something.

refractionpcsx2 commented 6 years ago

It shouldn't break anything showing the register values, it was just long lines, which obviously made the file bigger.

gregory38 commented 6 years ago

Did you try to enable the define in r5900 disasm file (line 30) ?

refractionpcsx2 commented 6 years ago

Nope, I didn't even know it was there.

refractionpcsx2 commented 6 years ago

It seems to only half work and only shows the source, not the target (obviously doesn't show the destination as that would be pointless)

eDis(9fc42938 001bd021): subu   v0,v0(0x001b0ba5), v1
eDis(9fc4293c 001bd021): sltu   v0,v0(0x00122cbd), a0
gregory38 commented 6 years ago

Issue depends on if you dump before or after the execution of instruction. If before, destination/target would be wrong. If after, some input registers might be wrong (of there are also used as target).

At least we could fix the missing 3rd registers on some opcodes.

refractionpcsx2 commented 6 years ago

Well that's what I mean, the source /target won't be wrong and should both be shown, the destination will be wrong as it's before the instruction is executed, so no need to show that

refractionpcsx2 commented 2 years ago

closing as we're gonna overhaul the logging anyways