#59 Port to PSP

open
nobody
None
5
2007-08-07
2007-08-07
Richard Natal
No

Hi Coders,

I always use zsnes to emulate SNES and play my favorite games on the PC! (Mario Kart and Super Metroid).

Now, I bought a PSP and I'd like to play SNES over PSP :D.

Sinse PSP processor can run to 333MHz, and Snes9x has a port to PSP (very buggy until now http://yoyofr92.free.fr/psp/snespsp.html\), I think that zsnes could be ported to PSP too.

At http://ps2dev.org/ you can download pspsdk and psptoolchains to compile (over linux) programs for PSP!

I don't know much about emulation... but pspsdk has a graphic library very similar to sdl and opengl... and it has sound, input, usb and wlan libraries too.

Could you implement a port of ZSnes to PSP ? (or give me some help to port it??)

Thanks
Bigous

Discussion

  • Logged In: YES
    user_id=888507
    Originator: NO

    FYI zsnes is written in x86 assembler, which means it can't be ported to the PSP or anything else than a PC, ever. Sad, isn't it ?

     
  • Logged In: NO

    Well, I can give you pointers to porting ZSNES, first you have to get permission from the original ZSNES team...
    once you get that, bug them for some source, all you *REALLY* need is the emulation source, and the code that talks to the graphic/sound/input libraries... (the storage management on the PSP is the same as a PC, so you don't need much work there)
    to start:
    - read the PSP tutorials on that one website (pspprogramming.com iirc)
    - get used to blitting images to the PSP screen, and (if you use a predesigned OGL-style library) get used to that a bit, do a few example programs, and at least get some movement (yes, animation) on the screen.
    - once you have that down, compare operations:
    for example say ZSNES calls to an OpenGL function (pulling this out of where the sun doesn't shine here) "create_Layer()" and the PSP library has a function called "PSP_Sony_Layers.create()" you could essentially assume the code does about the same thing... keep working through the many many lines of source code (including the non-graphic etc.. code) replacing non-psp functions with psp-functions (DO NOT WORRY ABOUT STANDARD C/C#/C++/Z80/68k/[insert programming language here] code, that will be converted to psp-friendly code by the compiler...)
    add some debugging functions (or enable those provided to you):
    [recommended] (there are lots of tutorials on how to add these functions)
    FPS counter (x/60)
    Memory Usage (X/32mb)
    logging (i reccomend logging on a fast memory stick, and logging ONLY what you need [errors]
    crash dump [semi-required] if the program crashes for whatever reason, have the main code within some other function that will resume if the program crashes, have the end of that function assume the program crashed, and dump the contents of the PSP (and if you can, SNES memory) so that you can do some bug tracking

    also, read over this blog, this guy is really smart and is single-handedly porting and maintaining his own N64 emulator for the PC over to PSP (and improving it severly)
    strmnnrmn.blogspot.com
    a lot of what he notes in his blog still applies to SNES emulation on the PSP... and the way he explains things makes it very clear the different issues etc.. you can run into
    anyway, good luck
    Xaero