32X Progress


notaz

Certified Guru
Joined
Aug 23, 2005
Messages
4,913
Location
Lithuania
Website
notaz.gp2x.de
So you might have read some hints that PicoDrive is getting 32X support. Here is what I have now:

01.png

I've finished the "get it working" stage, that is system emulation and CPU sync is good enough for around 2/3 of games to work correctly. It is using MAME SH2 interpreter for now and have some basic idle loop detection.


02.png

The screenshots are taken directly from GP2X running @250MHz. Note the FPS counter.


03.png

This shows how it looks with 32X and one MD layer disabled. Notice how it almost doesn't help the FPS count, most time is spent emulating those SH2s, which also means frameskip will not help much for 32X games..


04.png

One of the most inefficient ways to run Doom..


05.png

06.png

Some more slideshow-like running games.


From these tests we can see that I need to improve speed at least 6 times to get at least some games playable on GP2X. To get everything running fullspeed I need 10-11x improvement from what I have now. So to answer someone's question if we can have playable 32x on GP2X/Wiz, I still don't know. Well at least pandora should be able to handle it after some basic recompiler is implemented.


To end this post I leave you with one more screenshot, guess what game is it from?
07.png
 
notaz said:
To end this post I leave you with one more screenshot, guess what game is it from?
07.png
lmao, the (thankfully) unreleased x-men 32x

Thanks for the progress update, looking forward to seeing some more 32x =]
 
Last edited by a moderator:
I used to own a 32X and had a lotta fun with Virtua Racing. Nice to see this stuff as well as having your custom emulator for the MD version of Virtua Racing.

I also liked Star Wars on 32X but man oh man was it difficult.
 
Thank you very much for the report and the efforts Notaz. :)
 
How much synchronization/switch granularity did the SH2 emulation end up requiring? As you already know Steve Snake claims that 32X emulation is not worthwhile without cycle by cycle lockstep synchronization between the CPUs. If this is the case then you won't end up with a very good recompiler, but somehow I think that this isn't what you're doing right now.
 
Wow! This is very awesome work.
A pity that it may be technically impossible to achieve fullspeed emulation on GP2X/Wiz.

I'm sure you've thought of it already but I assume the 2nd GP2X CPU is of no use here? I know it's already being used to generate FM sound but could it be doing something else?
 
32X on the GP2X! This is awesome news! Thanks so much for your very hard efforts in getting this baby to work Notaz!
biggrin.gif
 
Last edited by a moderator:
Exophase said:
How much synchronization/switch granularity did the SH2 emulation end up requiring? As you already know Steve Snake claims that 32X emulation is not worthwhile without cycle by cycle lockstep synchronization between the CPUs. If this is the case then you won't end up with a very good recompiler, but somehow I think that this isn't what you're doing right now.
It seems it's enough to switch to tighter synchronization when they start accessing communication registers, which usually happens a couple of times per frame (but some games do it more). By "tighter synchronization" I mean rescheduling CPUs something like 4-10 times per line, not single stepping them. This way all "interesting" games work, there are a couple that don't but I'm not aiming at 100% compatibility at the moment (and they might have unrelated reasons to not work, I haven't really looked).

It rather common for 32X games like doing evil things like
Code:
68k        SH2
----
write 1    busy wait for 1
nop        busy wait for 2
nop        <do work>
write 2
I don't know why so many games were coded like this. 68k could just issue CMD interrupt for SH2! There are plenty of such code used for 32X and SegaCD too, in some cases it feels like they were just stuffing nops randomly until it works.

slaanesh said:
I'm sure you've thought of it already but I assume the 2nd GP2X CPU is of no use here? I know it's already being used to generate FM sound but could it be doing something else?
Well it's still doing FM sound as usual (32X games still use YM2612 a lot, as opposed to Sega CD games). There is not much else I could give it do, maybe it could "render" the 32X layer (palette lookups or color space conversion in 15bpp mode), but that would cause lots of bus accesses for reading 32X framebuffer memory and writing to real framebuffer, as opposed to generating data "from nothing" when emulating YM2612.
 
Last edited by a moderator:
Nice progress, notaz. I think the performance is not too bad for an interpreter core. Perhaps we could see at least some games playable on the Wiz. Are the framerates with 32x PWM sound turned on or is this not emulated yet?

Any chance of a Star Wars screen shot?

+1

One of my all time favorite game and together with Virtua Racing Deluxe the best on the 32x, IMHO.

I also liked Acclaim's NFL Quarterback Club (In fact these are the only three modules I purchased for the extension...)
 
slaanesh said:
Any chance of a Star Wars screen shot? :D
I'll do that when I get first version of recompiler working.

sbock said:
Are the framerates with 32x PWM sound turned on or is this not emulated yet?
They're with PWM, but turning that off will not help things much because PWM sound is done in software on 32X, usually by one of SH2s.
 
Last edited by a moderator:
notaz said:
slaanesh said:
Any chance of a Star Wars screen shot? :D
I'll do that when I get first version of recompiler working.

sbock said:
Are the framerates with 32x PWM sound turned on or is this not emulated yet?
They're with PWM, but turning that off will not help things much because PWM sound is done in software on 32X, usually by one of SH2s.

Having wrote the book (emulator) on the subject, do you think the 32x was ever really pushed? I actually thought the concept was kind of neat, to piggyback hardware (if not inefficient)and create the most complicated system possible. It seems to me that this could have really been a kick-ass 2d system with basic 3d capabilities. I know VF pushes the 3d capabilities somewhat (it's kind of slow), but do any of the 2d games push it? Do you think they could have really advanced the system had it seen the Mars release?
 
Last edited by a moderator:
While Sega CD has a bunch of dedicated hardware, 32X really only adds CPU power and direct framebuffer and audio buffer access mixed on top of what the Genesis could do. So any 2D beyond what's provided by the Genesis has to be rendered in software. What a couple 20some MHz SH2s can do in software is not all that great, but you at least got some scaled sprites and stuff out of it and you weren't as limited by the Genesis's palette restrictions. What the SegaCD's graphics chip could do probably easily surpassed this, although that WAS limited by the Genesis's palette restrictions.
 
Good to hear from you as always Notaz.

Here's my favorite 32x games:

---1st tier---
Knuckles Chaotix
Blackthorne
Virtua Racing
Virtua Fighter
Shadow Squadron
Afterburner Complete
Mortal Kombat 2

---2nd tier---
Star Wars Arcade
Space Harrier
Tempo
NFL Quarterback Club
World Series Baseball
FIFA '96
Toughman Contest
Kolbri

Edit: Some comments didn't go through..

The 32X is actually one of my favorite systems. My brother and I received it as Christmas gift when I was 12, and boy was I excited! I got Virtua Fighter and it was actually a really good port. I used to play it a lot in the arcade and I remember the 32x version being pretty close other than the sound. Anyways, good times back then :)

About potential, yeah the 32X was definitely an underutilized system. Most games were simply Genesis/MD ports with a higher color palette. Very few games took advantage of the added audio capabilities of the system either, opting instead to use the Genesis sound hardware. There are some nice tech demos on Youtube showing a few glimpses at what the system was capable of. Actually the GP2X dual CPU design reminded me a little of the 32X and Saturn. It may sound illogical, but this nostalgia partly is what attracted me to the GP2X community when most people were telling me to get a PSP.
 
notaz said:
I'll do that when I get first version of recompiler working.
How much faster do you expect the re-compiler to be than the interpreter?

Oh yeah, almost forgot, would Darxide work? I'd love to play this game on handheld!

Hmm, adding 32x to Picodrive would make it a pretty complete Megadrive emulator - there wouldn't really be anything missing as you've covered the base model, CD and now working on 32x. Pretty slick!
 
Last edited by a moderator:
christo930 said:
Having wrote the book (emulator) on the subject, do you think the 32x was ever really pushed? I actually thought the concept was kind of neat, to piggyback hardware (if not inefficient)and create the most complicated system possible. It seems to me that this could have really been a kick-ass 2d system with basic 3d capabilities. I know VF pushes the 3d capabilities somewhat (it's kind of slow), but do any of the 2d games push it? Do you think they could have really advanced the system had it seen the Mars release?
People tend to say it's underused, but it's not entirely true due to various limitations the system has. One of them is slow framebuffer access (3 cycles), which makes it impossible to even clear whole framebuffer in one NTSC frame. Another problem is even slower ROM access (6-15 cycles, 68k and SH2s share the same ROM bus). To reduce ROM problem SH2 code needs to be copied to SDRAM in 32x, but there is only 256K of it, leaving very little space for data. Then again SH2s are sitting on the same bus, which means only one of them can access memory at the same time (they do have 4kiB of cache, but that only helps a bit). The 32x VDP is only a framebuffer, with exception that it offers is 256-byte fill and RLE display mode, what makes it way inferior to even Genesis/MD VDP for 2D stuff (except of course it has more colors). PWM only has 4-word buffer, which means some CPU has to keep looking after it, reducing any other useful work it can do.

I think VR/VF are pretty much pushing it to the limit. At least I saw VR calculating polys with both SH2s simultaneously and using the fill hardware, which gave me impression it's pretty efficient. I wouldn't call it "kick-ass 2d system" as there are no 2D features to speak of, but as Genesis/MD if fully functional with 32x attached, some decent mixture can be made.

Jaguarandine said:
Very few games took advantage of the added audio capabilities of the system either, opting instead to use the Genesis sound hardware.
That's because there was too little memory for that - PWM is a sample player, and high quality samples need lots of memory. If only it supported some sort of compression like ADPCM..

slaanesh said:
notaz said:
I'll do that when I get first version of recompiler working.
How much faster do you expect the re-compiler to be than the interpreter?
N times ;) where 2 should be easy, 4 should be doable, I'm hoping for for 6 and more :) but we'll see. There are other places to improve like memory handlers and 32x layer drawing code.

slaanesh said:
Oh yeah, almost forgot, would Darxide work? I'd love to play this game on handheld!
It starts under the interpreter, haven't played it much though.

slaanesh said:
Hmm, adding 32x to Picodrive would make it a pretty complete Megadrive emulator - there wouldn't really be anything missing as you've covered the base model, CD and now working on 32x. Pretty slick!
Yup, that's the goal - Genesis/MegaDrive with all it's addons, also including power base converter :)
 
Last edited by a moderator:
notaz said:
Yup, that's the goal - Genesis/MegaDrive with all it's addons, also including power base converter :)
Master system as well? I forgot about that one. THEN it really will be complete.

You must have fond memories of the Megadrive and it's add-on hardware?
 
Last edited by a moderator:
Back
Top