Wolf32X - now at alpha 4!
Moderator: Mask of Destiny
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Except for audio there'd be very few changes required. There are just a few more registers to set up.
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.
Code: Select all
RAMCTL &= 0xcf00;
MPOFN = 0;
SCXIN0 = 0;
SCXDN0 = 0;
SCYIN0 = 0;
SCYDN0 = 0;
CHCTLA = 0x12;
BGON = 0x101;
TVMD = 0x8000;
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 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.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
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!
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!
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Does GCC is capable of inlining small functions for optimisation ?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.
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)
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
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 wrote:Does GCC is capable of inlining small functions for optimisation ?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.
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)
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Ok well it seems that GCC for SHX behaves better than GCC for 68k.Chilly Willy wrote: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 wrote:Does GCC is capable of inlining small functions for optimisation ?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.
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)
GCC 68k can't inline even if you add the "inline" keyword
Maybe you should check it is not the case here too :p
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 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!
So the SH compiler has it's own brand of weirdness.
So the SH compiler has it's own brand of weirdness.
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
Here's the link
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 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.