Page 1 of 3

Wolf32X - now at alpha 4!

Posted: Tue Feb 03, 2009 6:31 am
by Chilly Willy
Okay, here's my first release of Wolfenstein 3D for the 32X. It's an alpha release - it's certainly not done, but I reached a point where it's rather playable, so I decided to put this out as an alpha release. This uses one SH2 to drive the game - it's surprisingly fast for a 23 MHz CPU on a 16 bit bus. The game runs at 320x200 in 256 color packed mode. Over the last few days, I've been modifying to original engine as I kept running out of memory. As it is now, the graphics have been decompressed, and the sprites all "decompiled" as they call it. Both are now accessed directly from the rom area instead of being loaded into ram. Having worked on this, I have a lot more respect for the folks who did Doom32X.

There's probably a bug in my graphics decompression routines as some wall textures are wrong. Most seem okay, and the sprites all seem okay so far. Again, this is just an alpha release. I do my testing in Gens as I don't have a flash card for my real system. If someone can point out where I can get a 4MB flash card that works with the 32X, I'll get this working on a real 32X as well. :D

Wolf3D is GPL licensed, so in accordance with the GPL, all source code is included. Feel free to look over the code and use anything you find helpful. In particular, look at the debug_32.c/debug_font.c/debug_32x.h files. They're how I debugged this project. They're derived from the debug files in the PSP SDK from ps2dev, and licensed as BSD, so feel free to use those files. One caveat - the varargs in the SH2 libc doesn't seem to work right. You'll notice in Wolf32X that I use sprintf() to strings, then use Debug32xScreenPuts() at the moment.

Also incuded are the original shareware data files, and my decompressed versions, along with the command line apps to do the decompression. While not really part of the source, I did make some changes to the ld linker scripts, so those are included with the source.

This version has only one assembly optimization right now - the fixed point multiply. I may work in others later. I also plan to use the slave CPU to handle the audio (this version has no audio). The controls are SUPPOSED to be A = run, B = Fire, C = strafe/operate, Start+A+dpad = select weapon, Start+B+dpad = cheats, and Start+C = escape/menu. They seem to be mixed up, but they do work, so just try it. I plan to have six button support where X/Y/Z take the place of Start+A/B/C.

EDIT 2009-02-06: Alpha 2 up. Changes include wall textures fix, control fix, and six button controller support.
EDIT 2009-02-07: Alpha 3 up. The view size now defaults to 256 wide. You can increase the view size with Start+B+Right/Y+Right, and decrease the view size with Start+B+Left/Y+Left.
EDIT 2009-02-09: Alpha 4 up. Digital sound effects now played.

alpha 1
alpha 2
Wolf32X-a3.zip
Wolf32X-a4.zip

Posted: Tue Feb 03, 2009 6:58 am
by mic_
Really cool.
The speed seemed quite acceptable in Kega, too bad I can't put ROMs larger than 3MB on the Megacart (afaik) to test this on my real 32X.

Posted: Tue Feb 03, 2009 7:17 am
by Chilly Willy
I was originally loading the sprites on the go, so it was under 2MB in size. The problem was you ran out of memory after 27 sprites, and there are hundreds (437). I had a replacement routine that reused the memory for sprites, but that slowed things down as well as still needing to much memory. The switch to pre-compiled sprites added another 1.7 MB to the size of the cart. I could probably trim it by discarding the parts of the vswap file that correspond to the sprites, but I don't feel it's worth the time right now.

Posted: Tue Feb 03, 2009 2:03 pm
by TmEE co.(TM)
Mediafire sucks, and it does not want to let me DL the file... I have a 4Mbyte flashcart and I'm more than eager to try this on my 32X. Fileden is much much nicer that all other file hosts.

Posted: Tue Feb 03, 2009 2:11 pm
by Oerg866
FileDen is slow-ass :P

mirror'd: http://oergomized.gulli.to/Wolf32X-a1.zip


Well, I'm definately looking forward to progress, I really like it :)

PS: Any info on how the Sound is going to be implemented?

Posted: Tue Feb 03, 2009 2:19 pm
by TmEE co.(TM)
http://www.fileden.com/files/2008/4/21/ ... 32X-a1.zip

another mirror :)

For sound, I can offer my sound system... its messed up right now though...

Posted: Tue Feb 03, 2009 6:42 pm
by AamirM
Awesome piece of work Chilly Willy. :o Makes me wanna finally implement 32x in Regen :) .

Now why can't I come up with these ideas. :D

Posted: Tue Feb 03, 2009 7:43 pm
by Chilly Willy
Thanks for the mirrors, guys. It seems that file share places are different everywhere. From where I live, MediaFire is clearly the best, but I know others can't hardly ever use it. :?

AamirM: I helped work on the PSP version, which this is based on. I wanted to see what kind of work was involved on making a FPS for the 32X via homebrew, and this was more likely to get running than Doom.

TmEE: I'm working on the audio right now... once that is going, that'll be alpha 2. I'll do some bug fixing at that point.

As to flash carts, I was looking at the Tototek 64Mb cart and programmer. It says it works on the 32X. What's folks experience with that? If it's positive, I'll order that tonight.

Posted: Tue Feb 03, 2009 9:14 pm
by TmEE co.(TM)
http://www.fileden.com/files/2008/4/21/ ... 2XWOLF.jpg ;)

It would be sweet to finally hear music :) You could manage SFX on 32X side, and music playback could be done on MD side (my sound engine runs solely on the Z80).

MD pro and Megacart are good stuff.

http://www.sega-16.com/feature_page.php ... ash%20Card

Posted: Tue Feb 03, 2009 9:46 pm
by Chilly Willy
Holy Cow!! Is that on a REAL 32X?!?! :shock:

And what did you do to your thumb??? :lol:
It would be sweet to finally hear music :) You could manage SFX on 32X side, and music playback could be done on MD side (my sound engine runs solely on the Z80).
Well, I'm going to try the "standard" fmopl emulation code and see if the slave SH2 can handle it. Otherwise I'll rig some way of using the MD side and the YM2612. The slave shouldn't have any trouble at all with the digital sound effects.
MD pro and Megacart are good stuff.

http://www.sega-16.com/feature_page.php ... ash%20Card
Thanks! That was helpful.

Posted: Tue Feb 03, 2009 9:52 pm
by TmEE co.(TM)
Chilly Willy wrote:Holy Cow!! Is that on a REAL 32X?!?! :shock:

And what did you do to your thumb??? :lol:
Yep, real 32X, worked like a charm on first try :D

And I managed to cut a small slice out of my thumb while performing required actions to add RGB out to a Game Gear.... moral : be extra careful with very sharp knives when cutting hard plastic :P

Well, I'm going to try the "standard" fmopl emulation code and see if the slave SH2 can handle it. Otherwise I'll rig some way of using the MD side and the YM2612. The slave shouldn't have any trouble at all with the digital sound effects.
Ok then, I hope things will work out nicely :)
Thanks! That was helpful.
np, Sega-16 is FULL of great stuff :)

Posted: Tue Feb 03, 2009 10:18 pm
by Jorge Nuno
This is absolutely incredible :shock: ! I can't even put some constructive criticism in this useless post.

Posted: Wed Feb 04, 2009 1:45 am
by Snake
Nice :)

I'd love to see how fast this can go with more optimisations. It's achieving a decent speed already :)

Posted: Wed Feb 04, 2009 10:21 am
by Christuserloeser
Jorge Nuno wrote:This is absolutely incredible :shock: ! I can't even put some constructive criticism in this useless post.
I was so excited that I didn't know what to post.

Two thoughts that I had while reading, aside of being worried about Tiido's thumb! - Would it be possible for the 2612 to somehow interpret and play the OPL music ? and This belongs on Saturn! - just like Knuckles Chaotix, Kolibri and Virtua Racing Deluxe! ....seriously: A Saturn port would be sweet!

Posted: Wed Feb 04, 2009 10:26 am
by mic_
It's possible that someone already is working on a Saturn port for the C4 2008 compo, I dunno. Otherwise Chilly Willy could always submit his - moving from the 32X to the Saturn is very easy, just set up a 256-color BG on VDP2 and you're pretty much done.