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.
https://pcsx-redux.consoledev.net
GNU General Public License v2.0
652 stars 104 forks source link

export_to_redux.py produces something that doesn't seem to load properly #1291

Open Fuuzetsu opened 1 year ago

Fuuzetsu commented 1 year ago

Describe the bug

I'm using a modified export_to_redux.py. Modification is as below and should hopefully be unrelated (crashes with None otherwise on un-named fields...).

            field_name = component.getFieldName()
            if field_name == None:
              field_name = 'field{}_0x{:02x}'.format(component.getOrdinal(), component.getOffset())

It then producse some redux_funcs.txt and redux_data_types.txt which look sane to me at a glance.

I attach them in the ticket. Let me know if you need more information.

PS: Great software so far, much nicer for debugging/reversing than whatever else I tried!

Expected behavior

I load these in Typed Debugger (dynarec disabled). It doesn't complain but there are no functions listed at all.

As a side-note, exporting symbols from ghidra via the the Java script seems to work...

Steps to reproduce the bug

I guess just load these two in and see if functions come up.

redux_data_types.txt

redux_funcs.txt

Operating System

NixOS

PCSX-Redux version

git 0093bea292920f1d1c3eb7515026b4153fe2e926

CPU model

Intel(R) Core(TM) i7-8086K CPU

GPU model & Drivers

GTX 1080Ti, NVIDIA 530.41.03

BIOS version

scph5500

Options

Iso checks

No response

Logs

Nothing comes up when loading, no failure.

Additional information

empty

Fuuzetsu commented 1 year ago

It was pointed out to me that I was supposed to update the address to main in the script. I did this but end result was sadly the same: no functions. I'm attaching the updated version just in case it matters.

redux_funcs.txt

twevs commented 1 year ago

Thank you for reporting this and providing the files that you encountered the problem with.

I tried loading the latest redux_funcs.txt file that you attached and was able to see the functions as expected:

image

If you expand the window, do you see the function table in the bottom part? If so, this is actually a very real UX problem.

Fuuzetsu commented 1 year ago

OK, you're right. Here's how window looks like once I expand it until vertical scrollbar disappears.

1

but I can expand it further, or just double click the triangle in bottom right side.

2

I guess the bottom table doesn't contribute to the vertical size of the window: this kind of makes sense because we want it to be scrolled separately presumably... but it's too extreme. Not sure what a good fix is but maybe a hack like always expanding the window up to say 4th row of second table would work. I'll leave it up to you. Feel free to close the ticket and re-open a UX one or just re-use this one, thank you!

nicolasnoble commented 1 year ago

Or we can rename its title :) Thanks for investigating! This should be tweakable with ImGui, yes.

twevs commented 1 year ago

Thanks indeed for reporting this. :) Will fix this alongside a few other changes I've been meaning to make and close the issue with the PR.

twevs commented 1 year ago

By the way, please feel free to PR your change to the script, as it would only make it more robust.

Fuuzetsu commented 1 year ago

By the way, please feel free to PR your change to the script, as it would only make it more robust.

I can send something tomorrow. Ideally I think I'd like to just add a new web server endpoint for this so it works like Symbols because it's a bit annoying to use now and if I can just hit 1 button in ghidra instead, that's a lot more comfortable!

rocketz commented 3 days ago

The parsing is actually broken. Just hit the same issue. Ex "8004960c;MyFunc;MATRIX ,pMtx0,4;MATRIX ,pMtx?,4;", will set "addressString" to "8004960c;MyFunc;MATRIX" and "name" to "*,pMtx0,4;MATRIX"