Realtime 3D Cubes on MegaCD

Announce (tech) demos or games releases

Moderator: Mask of Destiny

Post Reply
Orion_
Very interested
Posts: 52
Joined: Mon May 02, 2011 2:26 pm
Location: France
Contact:

Realtime 3D Cubes on MegaCD

Post by Orion_ » Tue Feb 04, 2014 10:54 pm

Well, I've been working these days on the MegaCD, trying to get the most of his powerful cpu and his "Linear Screen to Tile" automatic conversion hardware.
Then I worked on a very fast Horizontal Drawing routine (almost 26kbytes of pre-generated 68k compiled code, one optimized routine per Line Width and Word Offset)
and then I "ported" some of my fast 3D routines I used in an Atari ST demo to see how this would run on the MegaCD.
Here it is !
Running at 50fps in PAL, and 30fps in NTSC, 2 independent realtime 3D cube, on a 320x128 screen.

Image

The zip contains 2 files, 'cube3d_mcd_eur.iso' is the CD iso for PAL system, and 'cube3D_mcd_from_cart.bin' is a cartridge binary that can be booted on the everdrive if you have a MCD attached to it (no need to burn a CD, just have one random CD in the drive) (the bin doesn't work on emulators, use the iso)
http://onorisoft.free.fr/extern/cube3d_mcd.zip

I'm so happy to have this working, big Thanks to Chilly Willy for his MegaCD code and help :)
Last edited by Orion_ on Wed Feb 05, 2014 1:28 pm, edited 1 time in total.
Retro game programming !

djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch » Tue Feb 04, 2014 11:46 pm

Congratulations! That's a lot of hard work!

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Feb 05, 2014 9:27 am

Wow, damn smooth !
I guess you are only transferring the cube window to VRAM to maintain that frame rate.
The bimap to tile feature of the megaCD is definitely a neat idea, too bad it was not present in the original megadrive (probably very cheap to include it) !

Orion_
Very interested
Posts: 52
Joined: Mon May 02, 2011 2:26 pm
Location: France
Contact:

Post by Orion_ » Wed Feb 05, 2014 10:50 am

I transfer a 320x128 screen to vram (double buffered in vram) using DMA
I'm limited to 128 because the MegaCD hardware system to convert linear screen to tile are limited to fixed Height (256/128/64/32/...) so 256 is too much and would require splitted DMA transfer, and the next height is 128

After some test, it's running at 50fps in PAL, and 30fps in NTSC :)
Retro game programming !

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Feb 05, 2014 2:40 pm

Indeed the DMA is the bottleneck here. Still 320x128 at 50 FPS on PAL system is neat =) By extending a bit the vblank you could probably get 60 FPS in NTSC as well ;)

inu
Very interested
Posts: 50
Joined: Thu May 09, 2013 10:12 am

Post by inu » Thu Feb 06, 2014 3:39 am

Definitely very impressive to say the least; nice and smooth.
Plus, its really nice to see some work with the Mega CD too, since the commercial games never really did much with it.

Orion_
Very interested
Posts: 52
Joined: Mon May 02, 2011 2:26 pm
Location: France
Contact:

Post by Orion_ » Thu Feb 06, 2014 11:11 am

I think there are some nice MegaCD game, BC Racer for example really use the MegaCD hardware (zoom/rotation)
Other games use Prerendered graphics, and I think this is the best way to use MegaCD because, What I want to try is a 3D game, but even using fast 3D routines and doing this in realtime, I won't get a nice speed for a game, for the moment I have only two cube, so 12 polygons, you can't really make a game with only 12 polygons :D
Once you make a real 3D scene, you will end up at 15 fps or less, it's not that great :/
but I will try anyway
Retro game programming !

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Feb 06, 2014 11:23 am

Orion_ wrote:I think there are some nice MegaCD game, BC Racer for example really use the MegaCD hardware (zoom/rotation)
Other games use Prerendered graphics, and I think this is the best way to use MegaCD because, What I want to try is a 3D game, but even using fast 3D routines and doing this in realtime, I won't get a nice speed for a game, for the moment I have only two cube, so 12 polygons, you can't really make a game with only 12 polygons :D
Once you make a real 3D scene, you will end up at 15 fps or less, it's not that great :/
but I will try anyway
15 FPS is definitely not bad for a SegaCD full 3D game.

sigflup
Very interested
Posts: 111
Joined: Mon Sep 06, 2010 12:05 pm
Contact:

Post by sigflup » Thu Feb 06, 2014 11:27 am

really impressive, orion_

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Thu Feb 06, 2014 4:14 pm

This is nice to see some Mega CD demo :D

As for the .bin version, I think there is an option in Fusion config file ("cartboot") to enable Mode1 cart booting if you want to test it

bastien
Very interested
Posts: 208
Joined: Mon Jun 25, 2007 7:19 pm
Location: Besançon,France
Contact:

Post by bastien » Thu Feb 06, 2014 7:54 pm

Very Good Job Orion_
And that's also works fine and smooth in a real Mega-CD 2 . :D

gasega68k
Very interested
Posts: 141
Joined: Thu Aug 22, 2013 3:47 am
Location: Venezuela - Caracas
Contact:

Post by gasega68k » Thu Feb 06, 2014 8:59 pm

This is great, congratulations, good to see something like this in the SegaCD/MegaCD. :D
I also think that you could reach 60fps in NTSC, if you extend more VBlank.
One question, have you tried with a resolution of 256x160?, Buffer size would be the same.

Post Reply