View Single Post
Old 09-17-2010, 03:29 AM   #9
Junior Member
Join Date: Nov 2009
Posts: 6

Nice tutorial. This debugger is by far the best thing out there for PSX. Practical usage of this debugger has taught me how to avoid a few pitfalls that I would like to add.

[Problem] Sometimes you have a breakpoint which goes off every frame. But you also happen to be at a point in the game that requires you to press buttons to remove text or navigate a menu or whatever. But cannot deactivate this breakpoint or you will miss the crucial moment. How can you step through the debugger whilst entering controller input into the main window?

[Solution] You need to enter the buttons in manually. First you must locate where the games stores it controller inputs. Once these offsets are known you can place a memory write breakpoint there and enter the controller input manually (i suggest also updating the register that was used to store the value as well). A great tool for scanning the RAM of pSX in realtime is CEP it can be used for searching for values or relative changes, with CEP you will soon find all variables that store the controller input. CEP can be found in this list:

[Problem] you have found a part of a file but its only one section. you need to find where the other sections are mapped to. But searching the binary dump in a hexeditor you cannot find the section you are interested in.

[Solution] Sometimes (But honestly not often) data is manipulated in situ it may not always appear the same in RAM as it does on disc. Example in Vagrant Story the minimap files are rotated in situ. if you are looking for the vertex data it only appears the same if you happen to be facing north. To get around this you need to analyze the routine that maps the file to RAM. Get to a point in the game where you know that the file is not yet in RAM but soon will be. place a write breakpoint at the start of the part of the file you already located. sometimes you will see that the game clears the memory with zeros before copying the data. you are only interested in where it is copying the data from. The source should be the file as opened directly from the CDROM. it should be an exact copy. take note of the source location. Then go back to where the file is not yet in memory and place a DMA CDROM break point at this address. Now you can watch as the game maps the file to RAM. This is the fastest meathod I have found to locating pointers and section lengths in unknown file formats. It is also an essential step in finding the entry point to an arbitrary executable. you cant place execute breakpoints to regions of RAM and even if you could the way pSX does executable breakpoints means that it will be overwritten by the game when loading the executable.

REC is another tool worth looking into. Its the only decompiler I have seen that attempts to work with PSX executables it will help immensely when you find that you are staring at a routine and havent a clue what it is doing
Valendian is offline   Reply With Quote