PS3 N64 Emulator (PS3 PoC wii64 Port by emukidid) Surfaces 9 years after first announced

We have more Nintendo 64 Emulation news following the recent port to the Vita, It appears after 9 years since it was first announcements and previewed, the mythical PS3 Port of wii64 (mupen64) has finally surfaced, From one of the developer behind the port emukidid, the developer recently found the files for the old (unreleased) PoC for the PS3 on an old HDD and decided it was time to release the PoC to the public, However, don't get too excited as the emulator is very rough around the edges and is simply a proof of concept as stated that needs alot of work but the developer does leave some bits of info and even a lending hand. Back in 2011 development did not get off the ground to far past the initial phases due to various roadbloacks (explained below), In the current form its only running in "interpreter only" and does not have the advancements needed to run many games at all, but compiled in pslight v2 could provide some recent changes and maybe even better support. Below you will see a quote from the developer (emukidid) and also some instructions / video demo from psx-place user @SniperSnake whom recently was exploring some N64 options himself.

Its great to see this emulator and its source finally emerge and perhaps gives some hope or inspirations for others to bring this project full circle and create a stable n64 emulator for the PS3.
-STLcardsWS



  • 300px-Nintendo-64-wController-L.jpg
    wii64-ps3 proof of concept

    Found this on my HDD from way back in 2011 when we were messing with porting wii64 (mupen64) to the PS3. It has software rendered graphics limited to probably Mario 64 only as well as pure interpreter only and likely no audio.

    I'm not sure what state the release I've attached is in because I compiled it a long time ago, it's messy and it was just considered a "test"

    A very old proof of concept in porting mupen64 (wii64 specifically from 2011) to the PS3 using PSL1GHT v1.​
    Features

    • Bad audio
    • Preliminary hardware accelerated graphics
    • Basic input
    • Pure interpreter
    • Menu
    • USB loading
    • USB saving
    Future

    • I've had a go at getting this to work with PSL1GHT v2 (https://github.com/ps3dev/PSL1GHT) and have run into some issues I'm looking into (basially the menu loops once every 3-4 seconds and everything becomes unresponsive). Once this is resolved I'd be happy to try and merge upstream changes from newer Wii64 releases back into this and even try at porting the Wii64 dynarec over to ppc64.
    • Issues we'd run into at the time with the state of homebrew on the PS3 were mostly due to the newness of the library and toolchain but also the fact that we couldn't get decent performance at all from the pure interpreter and we were unable to execute from heap (no dynarec). The pure interpreter ran faster on the Wii than it did with the PS3's main CPU, probably due to the fact that there's no branch prediction.
    • UPDATE (1): Ready to jump back into some PS3 Dev after 9 years with this nice HORI 720p/1080i display I picked up for $39!
      • EX0FRYPVAAAKK3C.jpg

  • via @SniperSnake:

    Emukidid has decided to take a 2011 build of wii64/cube64 a mupen64 fork thats been ported to ps3 has finally be relased. It works in interpeter mode as dynarec haddent been worked on yet for ps3.
    • I have tested it myself via ps3 multiman self loading off usb.
    • The roms run off dev_usbX/wii64/roms folder.
    The ground work is here and supposedly ps3 dynarec is already a thing iin the shadows lets make this happen!!!



 
Last edited by a moderator:
Yeah I haven't had success with this yet - using ps3mapi_process_page_allocate I get a nice buffer back that I can copy into but again it fails when trying to bctr to it.
Here's what I get back (I think it looks promising):
Code:
result: 0x0000000000000000 page_addr: 0x00000000D010C000

So I think the issue lies in how I jump to it from my userland application. You mention TOC/r2 but none of this is being used in the code generated by making a function pointer and calling it. What am I missing, do you have an example of what the assembly is meant to look like when trying to execute this lv2 buffer?
 
Yeah I haven't had success with this yet - using ps3mapi_process_page_allocate I get a nice buffer back that I can copy into but again it fails when trying to bctr to it.
Here's what I get back (I think it looks promising):
Code:
result: 0x0000000000000000 page_addr: 0x00000000D010C000

So I think the issue lies in how I jump to it from my userland application. You mention TOC/r2 but none of this is being used in the code generated by making a function pointer and calling it. What am I missing, do you have an example of what the assembly is meant to look like when trying to execute this lv2 buffer?
Wait the code I gave you was to execute in userland application dynamically generates code.

your code to execute code in lv2.....it's pretty easy
lv2syscall2(7,MKA(0x3d98), <your code>)
///....repeat till you are done
lv2syscall0_sc10_15(15, MKA(0x3d98));

that's it and your code will execute in kernel
https://github.com/Joonie86/LV2dumper_SC15/blob/master/sc15/common/include/sc10_15.h

That's code by me showing how to execute a function address. The address must point to pure code
 
Userland would be ideal if it could work but I haven't been able to.

lv2 would have issues like requiring address translation into my userland app if I was to put code there that wanted to reference things in my userland app?
 
Code:
#define SC_COBRA_SYSCALL8                               8
#define SYSCALL8_OPCODE_PS3MAPI                        0x7777
#define PS3MAPI_OPCODE_PROC_PAGE_ALLOCATE            0x0033
#define KB(n) (1024*n)
typedef struct
{
    void *unk_0; // ptr to some funcs
    uint64_t unk_8;
    uint32_t unk_10;
    uint32_t unk_14;
    void *unk_18;
    void *unk_20; // same as unk_18? :S
    uint64_t unk_28[3];
    void *unk_40; // same as unk_0?
                  // ...
} thread_t;
int ps3mapi_process_page_allocate(sys_pid_t pid, uint64_t size, uint64_t page_size, uint64_t flags, uint64_t is_executable, uint64_t *page_address)
{
    system_call_8(SC_COBRA_SYSCALL8, SYSCALL8_OPCODE_PS3MAPI, PS3MAPI_OPCODE_PROC_PAGE_ALLOCATE, (uint64_t)pid, (uint64_t)size, (uint64_t)page_size, (uint64_t)flags, (uint64_t)is_executable, (uint64_t)page_address);
    return_to_user_prog(int);
}
    uint64_t page_addr;
    int result = ps3mapi_process_page_allocate(sys_process_getpid(), KB(20), 0x100, 0x2F, 0x1, &page_addr);
    printf("result: 0x%016llX\n", result);
    if (result != 0)
    {
        // failed
        return 0;
    }
    printf("page_addr: 0x%016llX\n", page_addr);

this is what i got from rouletteboi

try this code please.
it should give rwx on userland. please try on latest rebug 4.86

your hangs can be due to bad calling conventions

Code:
typedef struct function_descriptor
{
    uint32_t addr;
    uint32_t toc;
}f_desc_t

your calling should be done as
f_desc_t *code=myfunc;
now your toc determines r2 which will get changed as function executes.


i suggest you do this for a quick test

*(uint32_t *)page_addr=(uint32_t)(page_addr+8);
*(uint32_t *)(page_addr+4)=0;
*(uint64_t *)(page_addr+8)=0x386000004e800020;

int(*func)()=(void *)page_addr;
int ret=1;
ret=func();
Excuse me I noticed the the disassembly. My bad here. The descriptors and toc is 64 bit
*(uint32_t *)page_addr=(uint32_t)(page_addr+0x10);
*(uint32_t *)(page_addr+8)=0;
*(uint64_t *)(page_addr+0x10)=0x386000004e800020;

int(*func)()=(void *)page_addr;
int ret=1;
ret=func();

Please test this in userland with the page allocated

with that said here's proper function descriptor
Code:
typedef struct function_descriptor
{
    uint64_t addr;
    uint64_t toc;
}f_desc_t;
 
Userland would be ideal if it could work but I haven't been able to.

lv2 would have issues like requiring address translation into my userland app if I was to put code there that wanted to reference things in my userland app?
To answer this question it's completely safe for you to simply use pointers to reference your userland memory. As you can see I did that in my application using a simple internal memcpy doing "unsafe" copy to userland memory that I allocated. So yeah there's no problem there in translations. Except you can't execute code from userland while in kernel
 
Its doesn't work in my ps3 :frown new:
when i open (Self) file it's take me back to the main menu!

I watched a lot of videos but no one said about source code files thing!
idk if i have to download it or do something with it in my ps3 bucause i dont have experience in this stuff so i want a easy explain plz :(
And thanks :adoration:.
 
Last edited:
Its doesn't work in my ps3 :frown new:
when i open (Self) file it's take me back to the main menu!

I watched a lot of videos but no one said about source code files thing!
idk if i have to download it or do something with it in my ps3 bucause i dont have experience in this stuff so i want a easy explain plz :(
And thanks :adoration:.
At this point is not worthy to try it because only plays mario64 at hyper-slow-motion speed, with texture problems, and maybe even some polygons broken too
Is the kind of thing you will run it only for a couple of minutes for the sake of running it and for curiosity sake.. but using it more than 2 minutes could trigger the epilepsy warning, lol

If you are really interested in it is better to wait for a new release, right now we know is not usable so is a bit pointless to report problems, but in the nexts versions the user feedback could help with betatesting andd bughunting
 
At this point is not worthy to try it because only plays mario64 at hyper-slow-motion speed, with texture problems, and maybe even some polygons broken too
Is the kind of thing you will run it only for a couple of minutes for the sake of running it and for curiosity sake.. but using it more than 2 minutes could trigger the epilepsy warning, lol

If you are really interested in it is better to wait for a new release, right now we know is not usable so is a bit pointless to report problems, but in the nexts versions the user feedback could help with betatesting andd bughunting
Ok good i hope it will be a great version soon :encouragement:, Thank u .
 
Hi All (Newbee here) - iv seen @emu_kidid has done some great work over the years.
Does anyone know if he or anyone else has done a N64 Emulator / Core for the PS3 yet? Thanks.
 
Some guy apparently did it:
[video removed by mod]
that is an actual port of super mario 64. it's available here but you need your own legal rom to make it. this thread is about an emulator (but it is not complete).

i removed the video because it has link with the rom so we can't post that here.
 

Similar threads

Back
Top