pcsx-rearmed - Me getting a clue about debugging libre PlayStation emulators (question for notaz)


OmegaPhil

Member
Joined
Jun 9, 2012
Messages
69
Hopefully a question notaz can answer, since I see hes active here!

I am a libre software programmer with some C and C++ experience, no embedded development or assembly experience, and don't like the idea that proprietary emulators and plugins are required to get working x86 PlayStation emulation (I don't use the Pandora for emulation, but it basically sparked my interest in the idea again). I spend most of my time on non-entertainment projects, but I keep thinking that it would be nice to see if I could throw some time at libre emulation and actually achieve something - however as usual at the start I'm a clueless n00b, so I don't even have the common sense of what is present/possible.

Currently I have pcsx-rearmed running in debug mode via Qt Creator (I'm liking this IDE more and more), and I have found and accessed the debug console via 0.0.0.0:12345 - however I haven't found basic debugging functionality like 'game execution is paused, give me a back trace with all locals you're aware of' - i.e. a C-like debugging facility - even with stripped code I should be able to get some idea of what is going on. I remember that PlayStation development was done in C and assembly so such a thing presumably is a valid concept? Obviously I have full access to the emulator itself, but I'm interested in the hosted environment.

Currently I have two bugs of interest - suddenly while playing a game, one of the direction keys associated with the used joypad locks until I reboot the emulator, and then the complete failure of Tomb Raider II to start up Lara's Home or the game proper - with normal programming I would expect to get back traces of what the emulator's runtime is doing in these cases, and then try to work out what to test next, eventually deducing what is actually going wrong.

Aside from this, I'd be interested in what skillsets you gained and how long it took you to get them, that are relevant to this kind of work. E.g. its no good me thinking I have a chance if it requires 5 years embedded development experience with 2 years RISC assembly hacking on top to be able to start asking questions. I also would like to do OpenGL debugging at some point, since thats again a sore point in a number of emulators, of course I have no experience yet ;)

Thanks for your time - I'm happy to donate for a good answer of yours!
 
So this post is from a while back but I am also interested in an answer. Sorry about the necro post but if anyone does have a answer that would be great.
 
While its not really relevant for here, as I didn't get an answer I ditched pcsx-rearmed after a bit of fiddling about and discovering mednafen - I'm using this stuff on a normal x86_64 machine, and its by far the most correct emulator I've found, so 'fixed' the bugs I was experiencing with rearmed :)
 
Emulator debugging doesn't work the way the first post expects - you can't get a backtrace when something bad happens, typically whatever happens just happens and the emulated machine carries on in a corrupted state, until it locks up in some final state it should never be in. Of course it's not always like that, sometimes you get direct emulator crash because of something done wrong by the emulator and that's a really lucky case because it can be fixed a lot easier. You have to really have a lot of motivation or be a total masochist to be able to debug emulators.

So this post is from a while back but I am also interested in an answer. Sorry about the necro post but if anyone does have a answer that would be great.
What exact problem are you going after?
 
If debugging isn't really viable, then I guess my question was more general. I have been wondering, as was stated in the OP,

"I'd be interested in what skillsets you gained and how long it took you to get them, that are relevant to this kind of work."

I'm always a little bit baffled by the skillset required to do work on creating or optimizing emulators, mostly because I can never get a sense of the background required for this kind of work. I would like to contribute to open-source projects like emulators, but I can't seem to figure out where to start. Obviously C tends to be helpful, as well as Assembly. But is there a more specific topic that can be searched to get on the right path in terms of learning what you need to know?
 
Wasn't there someone on here who was coding their own z80 emulator, to understand the ins and outs of a relatively simple emulation project?  That sounds to me like a good place to start, although how you test an emulated CPU in isolation is something I'm not sure about; perhaps you could plug it into MAME and test out a few 8-bit games?
 
Probably me, I made a Chip8 and then an 8080 space invaders emulator (had never done anything like it before) as up until then emulators had been completely magic and alien to me and I wanted to learn a bit more.


There is a thread on the boards somewhere with my progress, essentially it took a few days to do them both, but that was based on full documentation of how each CPU worked, extremely simple architecture and pretty decent knowledge of low level programming.


My plan was to move onto a Z80 emulator next with the thoughts of maybe moving into SMS or something, and whilst that may still happen one day, for the time being I don't think the reward gain was quite there for me (I work six days a week for my job, maybe if I had more time I would be more tempted).
 
Back
Top