Next Generation Emulation banner

1 - 4 of 4 Posts

·
Registered
Joined
·
4 Posts
Discussion Starter #1 (Edited)
Hiyas :)
I just have a quick question for someone to hopefully answer. I was working on the memory part of my project, and I had a thought that maybe the psx takes in the executable file(and/or BIOS) into memory and modifies it through the instructions. I'm not really sure if this is possible, so I thought I would ask to see if any of the popular emu authors knew about it. Is it possible to treat the executable's opcodes as read-only(as well as the BIOS's)? Or, are they fair game to be modified a bit during execution?
Thanks
 

·
Registered
Joined
·
12 Posts
yes i've seen quite a few demos and games use self modifying code... sometimes even creating new code and executing that... the bios upon booting also loads the kernel code into the kernel memory area... so basically any user memory should be treated with read-write access (the bios rom area is not modified though)... this is from my experience with writing the psinex cpu core...
 

·
Registered
Joined
·
12 Posts
when creating a static rec there are some issues because some things can only be known at runtime... e.g. self modifying code: any opcode that writes to memory (LB, LH, LW, etc.) has potential to write over existing code, jump/branch targets: jumps that use target register may not know the correct value until it actually executes to that point... so in these cases you'll need to generate code that will read from your emulated registers so the correct values will be given. or perhaps 'flag' it so during runtime you'll know to do extra checking for modified code or something like that... its probably best to mix static and dynarec techniques...

the bios i mostly found out by running it... disassembling as it executes... doing memory dumps... that kind of thing... as for using it, you basically just need to load it and translate any memory access to the 0xbfc00000-0xbfc80000 range to wherever you loaded the bios, there's nothing special you need to do, the bios is just another block of code (and data)

i'd suggest creating an interpreter first (if you haven't done so), experimenting and getting a feel of how psx software is executed... good luck :)
 

·
Registered
Joined
·
12 Posts
the kernel code handles stuff like interrupts, exceptions, bios dispatch, ie. kernel stuff ;)

the bios image is similar to a normal executable, except that it doesn't have a header. i believe the logo is generated by GPU instructions, though the SONY and COMPUTER ENTERTAINMENT part is stored somewhere in the image...

i've attached a text file which shows what the bios is doing, it might be helpful

edit: uploads don't seem to work at the moment
 
1 - 4 of 4 Posts
Top