Wolf32X - now at alpha 4!

Announce (tech) demos or games releases

Moderator: Mask of Destiny

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Feb 04, 2009 11:52 am

Hmm... I might look into Saturn homebrew a little bit later. It would certainly be much easier to do some things on the Saturn with the extra ram. That's the biggest hassle on the MD/CD/32X - very little memory.

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Wed Feb 04, 2009 12:41 pm

Except for audio there'd be very few changes required. There are just a few more registers to set up.

Code: Select all

RAMCTL &= 0xcf00;
MPOFN = 0;
SCXIN0 = 0;
SCXDN0 = 0;
SCYIN0 = 0;
SCYDN0 = 0;
CHCTLA = 0x12;
BGON = 0x101;
TVMD = 0x8000;
That should give you a 512x256 (of which the first 320x224 pixels are displayed) 8-bit bitmap starting at 0x25E00000. The palette format is the same as on the 32X, except the CRAM is located at 0x25F00000. Vsync is done by checking bit 3 of the TVSTAT register. That's pretty much all there is to it if you just want a linear framebuffer like on the 32X.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Feb 04, 2009 10:18 pm

Well, I'd also need to know how to load from the CD. And how to read the Saturn controllers. Basically, I need to familiarize myself with the Saturn "basics" first. :)

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Wed Feb 04, 2009 10:25 pm

By the way, I was working on the sound code and went to test it when an interesting problem occurred - Gens/GS (and Gens in general) doesn't support PWM sound via SH2 DMA. Anyone know a 32X emu that does? Fusion doesn't work in WINE on linux (tried that first). I'd rather not reformat my other computer so I can put WXP on it, but I will if I need to.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sat Feb 07, 2009 12:45 am

Alpha 2 posted! See first post in thread. I fixed the controls so they really work as described:

A = run
B = fire (enter if in menu)
C = strafe/open/operate (escape if in menu)

X = hold and press dpad for weapon change
Y = hold and press dpad for cheat
Z = menu/escape

Holding START while pressing A/B/C is the same as pressing X/Y/Z (for three button sticks). If it doesn't find a controller in port 1, it'll automatically use port 2.

I put in a temporary hack to fix the wall rendering. Something somewhere is walking on the pagetable, so I tried a few things... If I try to repair the pagetable later, it crashes. If I don't allocate the pagetable, it crashes. So what I do now is allocate the pagetable, but don't use it. I fetch the info that was in the table directly as needed. It's all in rom, so it's fast, but I really need to find what's walking on the damn table.

Okay, still no sound... that's next, followed by optimizations.

Enjoy! :D

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Sat Feb 07, 2009 11:26 am

Well, I'd also need to know how to load from the CD.
Not really. You can upload binaries <=4MB to RAM using a PAR+ and an USB DataLink (or an emulator like Yabause). That's how I run my stuff on my Saturn. I guess it depends on the kind of music you want in the game whether it'd fit in RAM or not.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sun Feb 08, 2009 7:50 am

Alpha 3 now 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. Given the speed you see from changing the view size, I don't think I need to knock myself out trying to optimize the rendering.

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

Post by Stef » Sun Feb 08, 2009 12:11 pm

Chilly Willy wrote:Alpha 3 now 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. Given the speed you see from changing the view size, I don't think I need to knock myself out trying to optimize the rendering.
Does GCC is capable of inlining small functions for optimisation ?
I had a quick look on the C sources and i think you can gain a lot by inlining these functions :

Code: Select all

static void ScaledDraw(byte *gfx, int count, byte *vid, unsigned int frac, unsigned int delta)

static void ScaledDrawTrans(byte *gfx, int count, byte *vid, unsigned int frac, unsigned int delta)

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sun Feb 08, 2009 2:19 pm

Stef wrote:
Chilly Willy wrote:Alpha 3 now 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. Given the speed you see from changing the view size, I don't think I need to knock myself out trying to optimize the rendering.
Does GCC is capable of inlining small functions for optimisation ?
I had a quick look on the C sources and i think you can gain a lot by inlining these functions :

Code: Select all

static void ScaledDraw(byte *gfx, int count, byte *vid, unsigned int frac, unsigned int delta)

static void ScaledDrawTrans(byte *gfx, int count, byte *vid, unsigned int frac, unsigned int delta)
I checked that myself, and it looks like at O3 (the current level I compile at) those are inlined. I compiled the file with it set to save the assembly, and as far as I could tell, it was inlined. I specifically added inline to the functions, and it made no difference in speed I could see, further supporting that idea.

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

Post by Stef » Sun Feb 08, 2009 2:41 pm

Chilly Willy wrote:
Stef wrote:
Chilly Willy wrote:Alpha 3 now 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. Given the speed you see from changing the view size, I don't think I need to knock myself out trying to optimize the rendering.
Does GCC is capable of inlining small functions for optimisation ?
I had a quick look on the C sources and i think you can gain a lot by inlining these functions :

Code: Select all

static void ScaledDraw(byte *gfx, int count, byte *vid, unsigned int frac, unsigned int delta)

static void ScaledDrawTrans(byte *gfx, int count, byte *vid, unsigned int frac, unsigned int delta)
I checked that myself, and it looks like at O3 (the current level I compile at) those are inlined. I compiled the file with it set to save the assembly, and as far as I could tell, it was inlined. I specifically added inline to the functions, and it made no difference in speed I could see, further supporting that idea.
Ok well it seems that GCC for SHX behaves better than GCC for 68k.
GCC 68k can't inline even if you add the "inline" keyword ;)
Maybe you should check it is not the case here too :p

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Sun Feb 08, 2009 10:19 pm

Well, I'm going to put inline in there anyway - can't hurt. I think I'll try inlining the next higher level of those drawing functions, too. I tried to inline the fixed point multiply: it wouldn't compile at O3, and while it would compile at O2, it didn't work. But when it's NOT inline, it works fine at O3. Freaky! :shock:

So the SH compiler has it's own brand of weirdness. :lol:

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Mon Feb 09, 2009 9:36 am

I just saw that your Wolfenstein port was featured on the front page of engadget, complete with TmEE's half-severed thumb and everything :)
Here's the link

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Mon Feb 09, 2009 11:35 am

Yeah, I saw that myself. He's going to have a very famous thumb. :lol:

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Mon Feb 09, 2009 12:09 pm

Okay, thanks to Snake for helping me get Fusion working in WINE, I was able to get digital sound effects going. Still working on the FM synth. Let me know what you think of the level of the sounds. Should they be louder/quieter?

mic_
Very interested
Posts: 265
Joined: Tue Aug 12, 2008 12:26 pm
Location: Sweden
Contact:

Post by mic_ » Mon Feb 09, 2009 12:50 pm

The volume is ok (only tried it with headphones in Fusion, my Megacart does indeed not allow larger ROMs than 24Mbit). All the effects sounds like noise though.. the gunshot is ok, but the soldiers' shouts and the sound of opening a door or picking up ammo are really noisy, and you wouldn't recognize them as the original sound effects from the game.

Post Reply