forums.PPSSPP.org
PPSSPP on a mips device? - Printable Version

+- forums.PPSSPP.org (https://forums.ppsspp.org)
+-- Forum: PPSSPP - Playstation Portable Simulator Suitable for Playing Portably (/forumdisplay.php?fid=1)
+--- Forum: Development (/forumdisplay.php?fid=3)
+--- Thread: PPSSPP on a mips device? (/showthread.php?tid=3938)



PPSSPP on a mips device? - EIREXE - 06-09-2013 09:35 AM

Hi, i'm curentlly on the scene of a mips based open-source linux device called gcw-zero, so I was talking on the irc with mth, and we talked about psp emulation.

What I want to know is, can we run ppsspp on mips? since psp uses mips cpu we would only need to emulate the mediaengine apart.

So what do you think it would be easier, a wine-like aproach with low-level gpu comunication and emulating the extra stuff from scratch or using ppsspp as base?


RE: PPSSPP on a mips device? - Orphis - 06-09-2013 10:32 AM

You can't use the CPU directly, you still need to emulate parts of it. Then, we already have a wine like approach. Considering MIPS devices aren't so common, it's not likely that we'll have a proper MIPS version soon with the right amount of optimisations.


RE: PPSSPP on a mips device? - [Unknown] - 06-09-2013 02:32 PM

Supposedly it runs on one MIPS processor that internally emulates ARM or x86, I can't remember.

It's doable but we'd have to write a jit for it since the memory access has to be different, and the PSP has some special opcodes. So it can't really be native or even necessarily wine like, since the instructions themselves are different.

-[Unknown]


RE: PPSSPP on a mips device? - EIREXE - 06-09-2013 06:20 PM

(06-09-2013 02:32 PM)[Unknown] Wrote:  Supposedly it runs on one MIPS processor that internally emulates ARM or x86, I can't remember.

It's doable but we'd have to write a jit for it since the memory access has to be different, and the PSP has some special opcodes. So it can't really be native or even necessarily wine like, since the instructions themselves are different.

-[Unknown]
Psp emulates arm/x86?

Wow, that's weird


RE: PPSSPP on a mips device? - [Unknown] - 06-09-2013 06:56 PM

No, no, backwards. I think it was Longsoon. Apparently its MIPS cpu has some dedicated instructions for emulating either x86 or arm (I forget which, I think x86?) I know there were fixes to make PPSSPP compile on it, and supposedly the jit works (with that emulation.)

The PSP itself does not emulate any other instruction sets.

-[Unknown]


RE: PPSSPP on a mips device? - EIREXE - 06-09-2013 07:44 PM

(06-09-2013 06:56 PM)[Unknown] Wrote:  No, no, backwards. I think it was Longsoon. Apparently its MIPS cpu has some dedicated instructions for emulating either x86 or arm (I forget which, I think x86?) I know there were fixes to make PPSSPP compile on it, and supposedly the jit works (with that emulation.)

The PSP itself does not emulate any other instruction sets.

-[Unknown]

it was x86


RE: PPSSPP on a mips device? - VIRGIN KLM - 06-09-2013 07:50 PM

Isn't MIPS and ARM very close? on an unrelated note, wouldn't ARM builds have more speed/compatibility potential than x86/x64?


RE: PPSSPP on a mips device? - [Unknown] - 06-09-2013 08:21 PM

Well, for CPU at least, the most crucial difference between MIPS and ARM is how they handle 32-bit constants, which turns out to be pretty common.

In MIPS, you'll often see:
lui a0, 0x1234
addiu a0, a0, 0x5678

On x86, this would be (and the jit combines it automatically):
MOV edx, 0x12346578

On ARM, it's reversed on ARMv6T2+ and has to eat a memory cycle on older ones.
MOV r2, 0x5678
MOVT r2, 0x1234

This seems like a trivial diffence, but it ends up adding a lot of ops from what I've seen. PSP games will lui once, and then use that same reg to displace other addresses. For example:
lui a0, 0x1234
addiu a1, a0, 0x4123
lw a2, a0(0x3214)
addiu a3, a0, 0x4980

This makes a lot of sense because of the way it's written. But in ARM, that has to end up something like this in the best case:
MOV r2, 0
MOVW r2, 0x1234
MOV r0, 0x4123
ADD r3, r2, r0
MOV r0, 0x3214
ADD r0, r0, r2
LDR r4, r11, +r0 ; All memory access has to be offset.
MOV r0, 0x4980
ADD r5, r2, r0

In practice, I think we actually do worse than the above with extra MOVW's. However, for *certain* constants we're able to optimize this down to less ops.

That's at least double as many instructions, just because they handle immediate values so differently. In contrast, here's what x64 (just to type simple reg names) looks like:

MOV rdx, 0x12340000
MOV r8, 0x12344123
MOV r9, [rbx + 0x12343214] ; All memory access has to be offset.
MOV r10, 0x12344980

So x86 is actually a lot more efficient in this case.

-[Unknown]


RE: PPSSPP on a mips device? - CrashedSystem - 08-30-2014 02:51 PM

Sorry to reply in the old thread, but a new MIPS (Just MIPS32) Development Board called CI20 made me think about such port again. It seems that there's still no documentation saying that PPSSPP works on MIPS.

Here is the link for CI20: store.imgtec.com/product/mips-creator-ci20/
(HTTP of course)

It was available for free for a short time, and they ran out of available boards. I was thinking about making a PSP-emu board actually..


RE: PPSSPP on a mips device? - [Unknown] - 08-30-2014 05:20 PM

It would definitely need some porting efforts. Should be possible, though.

It won't run out of the box, primarily because you'll need to stub out the jit and use only the interpreter (and it'll be super slow until a jit is built.)

-[Unknown]


RE: PPSSPP on a mips device? - xsacha - 11-12-2014 07:42 AM

I have acquired a CI20 using that Ingenic MIPS processor.
I will begin porting efforts Smile


RE: PPSSPP on a mips device? - Henrik - 11-12-2014 09:18 AM

Cool Smile Getting it up and running on the interpreter shouldn't be too hard, at least.


RE: PPSSPP on a mips device? - xsacha - 11-14-2014 05:24 AM

Interpreter running fine now on CI20 and GCW-Zero too.
Both devices having issue with graphics drivers.