[Project] Cross-Platform PSP Emulator for PC
[Project] Cross-Platform PSP Emulator for PC
Hi all!
I'm currently working on a PSP Emulator for PC. After having seen the great progress of noxa and soywiz with their emus I decided I wanted to do it slightly different and try to keep the Emulation as Low Level as possible.
Here in my Dev-Blog you can check out the code via a svn mirror or you can browse it Here.
It's in early stages and I've written the MIPS Core + FPU and I'm currently writing the VFPU instructions.
Now to my main question: This is still far away but, as for the boot-process of the PSP with the decrypting of the IPL through the KIRK SecChip and so on. Is there a way to get the Bootstrap commands so I could later on implement them in the emulator or will I have to do this differently?
Hope you guys can help me out :)
Greets
Mauro
I'm currently working on a PSP Emulator for PC. After having seen the great progress of noxa and soywiz with their emus I decided I wanted to do it slightly different and try to keep the Emulation as Low Level as possible.
Here in my Dev-Blog you can check out the code via a svn mirror or you can browse it Here.
It's in early stages and I've written the MIPS Core + FPU and I'm currently writing the VFPU instructions.
Now to my main question: This is still far away but, as for the boot-process of the PSP with the decrypting of the IPL through the KIRK SecChip and so on. Is there a way to get the Bootstrap commands so I could later on implement them in the emulator or will I have to do this differently?
Hope you guys can help me out :)
Greets
Mauro
Last edited by MFZ007 on Fri Jun 06, 2008 8:42 am, edited 2 times in total.
I'm also planning to make a PSP emulator for PC and maybe Pandora.
I rewrote from scratch a R3000 dynarec (c++) for PSP and ARM (zodttd uses my very old recompiler/generator I rewrote for his psx4gp2x/psx4iphone). Zodttd were supposed to work with me to bring yapse4all in life but he seems to be very busy with all the other ports he makes.
It wouldn't be difficult to make a PSP dynarec for PC as well : I just need to write the appropriate generator.
I intend to reuse my new dynarec and to extend it to a PSP dynarec (CPU/FPU/VFPU) to make a PSP emulator. But it must be fast and don't need to deal with low emulation of hardware unlike PSX.
I think HLE is the best strategy to emulate PSP because it would be faster and hardware emulation is beyond question due to the lack of documentation about hardware.
But HLE is probably hell to build since we need to reverse any kernel modules to emulate functions accurately.
So, my question is how far you want to keep the emulation low level ?
I rewrote from scratch a R3000 dynarec (c++) for PSP and ARM (zodttd uses my very old recompiler/generator I rewrote for his psx4gp2x/psx4iphone). Zodttd were supposed to work with me to bring yapse4all in life but he seems to be very busy with all the other ports he makes.
It wouldn't be difficult to make a PSP dynarec for PC as well : I just need to write the appropriate generator.
I intend to reuse my new dynarec and to extend it to a PSP dynarec (CPU/FPU/VFPU) to make a PSP emulator. But it must be fast and don't need to deal with low emulation of hardware unlike PSX.
I think HLE is the best strategy to emulate PSP because it would be faster and hardware emulation is beyond question due to the lack of documentation about hardware.
But HLE is probably hell to build since we need to reverse any kernel modules to emulate functions accurately.
So, my question is how far you want to keep the emulation low level ?
I've thought about that too and I know it's not yet possible to complete a Low Level Emulator but I didn't mean this project to be completed any time soon anyway. I guess the final goal would be to get a Firmware to run correctly. Of course HLE would be faster to realise but my main interest is on the hardware emulation anyway :) Maybe as soon as I can no longer continue with the VFPU or any other component I'll think about making a HLE branch and try to make things work until more hardware-information is revealed.
with your dynarec do you recompile the VFPU instructions into normal MIPS instructions?
with your dynarec do you recompile the VFPU instructions into normal MIPS instructions?
ok, let me tell you there is no way to get a firmware to run correctly. Don't ask why, I'm not a specialist about firmware hacking but I do know there is a lot of hardware we cannot emulate because we don't have the details and because you CANNOT emulate KIRK to encrypt/decrypt blocks for instance : this issue is probably enough to state it is impossible to run a firmware on an emulator.MFZ007 wrote:I've thought about that too and I know it's not yet possible to complete a Low Level Emulator but I didn't mean this project to be completed any time soon anyway. I guess the final goal would be to get a Firmware to run correctly. Of course HLE would be faster to realise but my main interest is on the hardware emulation anyway :) Maybe as soon as I can no longer continue with the VFPU or any other component I'll think about making a HLE branch and try to make things work until more hardware-information is revealed.
huh ? just a minute. I have a R3000 dynarec for PSP and ARM, that I can turn into a PSP dynarec by extending it with allegrex/fpu/vfpu instructions and writing a x86 generator (to make it running on PC). I'm not in hurry to make it because I need to investigate if it is easy to make a compatible HLE for most games to run properly.MFZ007 wrote:with your dynarec do you recompile the VFPU instructions into normal MIPS instructions?
My real challenge would be able to make a PSP emulator on Pandora (an ARM cortex-a8 with OpenGL ES 2.0).
KIRK is a hardware piece, not a software piece. The algorithm used by this hardware piece is totally unknown for public.MFZ007 wrote:Ok, I got it this time ^^
Is there no way to get the already decrypted data from KIRK on the PSP itself and make a dump? I'm not really into PSP-Development itself so I don't know if there's a way to access KIRK.
If your question is about to avoid the use of KIRK, I suggest for you to hack a firmware to do so before writing an emulator able to run a (hacked) firmware.
Last edited by hlide on Sun May 25, 2008 11:14 pm, edited 1 time in total.
it DOES ! so it can load crypted modules for instanceMFZ007 wrote:yes of course. I understand why KIRK can't be emulated (for obvious reasons) but the firmware itself, does it have functions that allow interaction with the chip in any way?
and what about AVC codec and Audio images loaded on ME processor. There is a Media Engine which uses an unknown hardware accelerator. How do you plan to emulate them ? (in fact, you may also need to emulate two processors) or even a third processor (an ARM ?) to emulate Wifi controller ?
Yeah, I guess i will, and I see now that I'll probably have to get into HLE because of it. Surely for Audio ^^ I do not plan to emulate the decoder unit for atrac3 what would be the point...You'll run into hardware problems, as there is some critical hardware for emulation we don't know a lot about:
- thread management
- exception management
- audio
- GE
- ...
But you're right in the fact that you can use already pre-decrypted firmware files.
You certainly know how to crunch my hopes and dreams, don't you :) But you're right. It will get nasty eventually.it DOES ! so it can load crypted modules for instance
and what about AVC codec and Audio images loaded on ME processor. There is a Media Engine which uses an unknown hardware accelerator. How do you plan to emulate them ? (in fact, you may also need to emulate two processors) or even a third processor (an ARM ?) to emulate Wifi controller ?
well, I'm sorry :). In fact, is there a reason you absolutely need to run a firmware on a PSP emulator ? My opinion is a HLE would be far easier to do than a true hardware emulation because PSP has a much more complex and nasty hardware than the old consoles.MFZ007 wrote:You certainly know how to crunch my hopes and dreams, don't you :) But you're right. It will get nasty eventually.it DOES ! so it can load crypted modules for instance
and what about AVC codec and Audio images loaded on ME processor. There is a Media Engine which uses an unknown hardware accelerator. How do you plan to emulate them ? (in fact, you may also need to emulate two processors) or even a third processor (an ARM ?) to emulate Wifi controller ?
Yeah, I think so too. But this is not about justifying my way of wanting to do an LL-Emu. I'll certainly try to keep it as Low Level as possible. But I agree with hlide saying it's impossible atm.kernel homebrew, you mean. As long as you don't try to trick the firmware, it should be okay with user homebrew.
If you want to make a PSP emulator to help debugging homebrew or firmware, you may try for a pc to drive a psp. Code could be run on PC or PSP as you wish. Of course, when hardware is implied you have no choice else to run on PSP. It would be in fact a debugger/emulator. Maybe studying psplink may help to make it realizable at a finer granularity.
oh well, probably a fantasy !
oh well, probably a fantasy !
with a HLE, there is two possibilities :MFZ007 wrote:Yeah, I think so too. But this is not about justifying my way of wanting to do an LL-Emu. I'll certainly try to keep it as Low Level as possible. But I agree with hlide saying it's impossible atm.kernel homebrew, you mean. As long as you don't try to trick the firmware, it should be okay with user homebrew.
1) to emulate only the kernel modules where hardware are directly implied : most modules would then be in target binary format (they need to be decrypted first of course). This solution may lead to a slower execution but would be more friendly to compatibility.
2) to emulate the higher level modules as possible : most modules would then be in host binary. This solution may lead to a faster execution but would be less friendly to compatibility because it means you would probably don't emulate the intermediate user and kernel modules which are normally only called from user modules that a psp application uses.
note that kernel homebrew modules dealing with direct access to hardware address are still forbidden
Now that it's clear that HLE will be a must I'll clearly want it this way:
1) to emulate only the kernel modules where hardware are directly implied : most modules would then be in target binary format (they need to be decrypted first of course). This solution may lead to a slower execution but would be more friendly to compatibility.
Hey!
Back again with a question!
Since our project ist Open-Source already, I'd like to ask if some of you guys would be interested in helping us completing the seperate parts of the emulator. You would have direct access to the main svn repository. And of course would be named in the credits ^^.
I'm still working on the VFPU atm so there are other things you could do if you wanted to:
- GE basic structure
- basic HLE-Functions (threading etc..)
- File-Loader (implementing support for pbp, images and so on)
- Unix/Linux GUI, since this project is meant to be multi-platform
It's just a huge load of work and the time draws near where I have to study for University again. So I'd gladly appreciate any help I got :)
We currently work with eclipse cdt as IDE (because it runs on linux/osx as well). The instructions to set up the compiler with eclipse are posted in the Dev-Blog.
Hope someone is interested.
This projects means quite a lot to me so please, if you are just beginning to learn how to program, please don't sign up for this yet.
Looking forward to working with you guys.
If you want to take a look at the code, the link to the svn repository is in the Dev-Blog.
Greetings
Back again with a question!
Since our project ist Open-Source already, I'd like to ask if some of you guys would be interested in helping us completing the seperate parts of the emulator. You would have direct access to the main svn repository. And of course would be named in the credits ^^.
I'm still working on the VFPU atm so there are other things you could do if you wanted to:
- GE basic structure
- basic HLE-Functions (threading etc..)
- File-Loader (implementing support for pbp, images and so on)
- Unix/Linux GUI, since this project is meant to be multi-platform
It's just a huge load of work and the time draws near where I have to study for University again. So I'd gladly appreciate any help I got :)
We currently work with eclipse cdt as IDE (because it runs on linux/osx as well). The instructions to set up the compiler with eclipse are posted in the Dev-Blog.
Hope someone is interested.
This projects means quite a lot to me so please, if you are just beginning to learn how to program, please don't sign up for this yet.
Looking forward to working with you guys.
If you want to take a look at the code, the link to the svn repository is in the Dev-Blog.
Greetings
I wouldn't say theres big news.
I'm still working on it and will continue working, I've been in Spain for 2 weeks now and I'm getting back on Monday. I'll get working again by tuesday I think. So far it has been a lot of fun and I've met some interesting people.
If you want to see a little bit older revision of the code, search MFZPSP in google code.
---
Mauro
I'm still working on it and will continue working, I've been in Spain for 2 weeks now and I'm getting back on Monday. I'll get working again by tuesday I think. So far it has been a lot of fun and I've met some interesting people.
If you want to see a little bit older revision of the code, search MFZPSP in google code.
---
Mauro
Be sure to check out MFZPSP - PSP Emulator Project