SCD Direct Color DMA examples

Ask anything your want about Mega/SegaCD programming.

Moderator: Mask of Destiny

Post Reply
Chilly Willy
Very interested
Posts: 2493
Joined: Fri Aug 17, 2007 9:33 pm

SCD Direct Color DMA examples

Post by Chilly Willy » Sat Feb 23, 2013 8:15 pm

Here's a thread for posting various direct color dma mode examples for the SegaCD. Here's one - this is LCDWolf. It just renders a Wolf3D style level. The pistol isn't centered horizontally, and it tends to find walls on the right where it shouldn't (not sure if it's his bug or mine), but it works well enough at this point to post.

Burn the ISO file in the arc to disc and run on a real SCD. It's US region, but that shouldn't be a problem for most folks. The DPad moves forward/backward and turns. Use A and C for strafing.

The turn rate is low to give smoother turning - there are 200 turns in a circle, and it takes 20 seconds to turn all the way around, so this is currently doing 10 FPS. I'm rendering 128x64, but doubling the pixels vertically to cover 128x128 of the screen since the pixel aspect ratio is about 2:1. The only assembly is the fixed point multiply.

This example waits for the next vblank before switching banks, so you never get any tearing.

Code: Select all

        // wait for vblank and then switch banks
        while (ticks >= GET_TICKS) ;
        ticks = GET_TICKS;
        switch_banks();
dmawolfdemo1.7z

peekpoke
Interested
Posts: 37
Joined: Fri Feb 01, 2013 1:11 am

Post by peekpoke » Sat Feb 23, 2013 8:56 pm

Thats great!! Sad, that i cant currently try this on my mega cd :( Maybe someone may put video of it running, on utub?

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

Post by Chilly Willy » Sat Feb 23, 2013 10:13 pm

On the next one, I'll include an EU ISO.

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

Post by Chilly Willy » Sat Feb 23, 2013 10:41 pm

Okay, here's the next version... other than the bugs I mentioned, I increased the resolution of the sin/cos tables. It's even better, but I still get a segment of wall close to you under certain conditions. I think at this point that the fixed point numbers are overflowing due to distance.

This arc has both US and EU ISO images.

dmawolfdemo2.7z

peekpoke
Interested
Posts: 37
Joined: Fri Feb 01, 2013 1:11 am

Post by peekpoke » Sun Feb 24, 2013 9:05 am

Thank you very much! Great work!

Will try right now to catch this "ghost" wall segment bug!

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

Post by Chilly Willy » Sun Feb 24, 2013 11:28 pm

Okay, here's the latest lcdwolf conversion. It seems okay... no noticeable bugs that I ran into in my quick check.

dmawolfdemo3.7z

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

Post by Chilly Willy » Mon Feb 25, 2013 3:22 am

Now with collision detection! Now you can't walk through walls... you slide along walls nicely when at an angle. I also made sure you can reach everywhere on the map (no blocked off areas).

dmawolfdemo4.7z

peekpoke
Interested
Posts: 37
Joined: Fri Feb 01, 2013 1:11 am

Post by peekpoke » Mon Feb 25, 2013 8:25 am

Amazing! Looks so nice! Thank you, Chilly Willy, for this great work!

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests