Full screen scaling and rotation in Overdrive 2 demo

Discussion of development of software for any "obsolete" computer or video game system. See the WSdev wiki and ObscureDev wiki for more information on certain platforms.
Post Reply
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Full screen scaling and rotation in Overdrive 2 demo

Post by psycopathicteen »

I might as well start a new about it.

It can't be drawing it one pixel at a time because then it has only 228*312*15/7*2/256/224=5.316 cycles per pixel. It has to do at least 4 pixels at once just to move data from one place to another fast enough, but where does it get it's pixel data from then?
lidnariq
Posts: 11430
Joined: Sun Apr 13, 2008 11:12 am

Re: Full screen scaling and rotation in Overdrive 2 demo

Post by lidnariq »

The effect is often called a "rotozoom(er)". There's a writeup about how one was implemented on the contemporary and comparable-spec Atari ST here.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Full screen scaling and rotation in Overdrive 2 demo

Post by psycopathicteen »

That was interesting, but that looks like it would need at least 12 cycles per pixel.
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Full screen scaling and rotation in Overdrive 2 demo

Post by tepples »

If you can't get your rotozoomer up to full speed, render the rotation at 17 fps and use background shearing for inbetweening. This is the effect used to roll the horizon in Star Fox, and we've talked about it before.
  • On Super NES: Use mode 2, load the vertical scroll position per 8 pixels into VRAM, and use HDMA to send the horizontal position per scanline.
  • On Genesis: Load the vertical scroll position per 16 pixels into VSRAM, and load the horizontal position per scanline into VRAM.
But because shearing starts to fall apart when the angle exceeds arctan(1/8), you'll need to actually render about 16 steps.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Full screen scaling and rotation in Overdrive 2 demo

Post by psycopathicteen »

Is this how it works:

-Grab initial frame
-Use offset-per-tile and line-scroll to tilt image, while the CPU does scaling
-When it passes "arctan(1/8)" render a full affine-mapped image
-do the same thing again
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Full screen scaling and rotation in Overdrive 2 demo

Post by psycopathicteen »

Scratch that idea. I think I'm pretty close at figuring this out. It involves color addition and byte aligned shearing, but with x position toggling between 0 and 1 depending on if the first pixel of a scanline is even or odd.
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Full screen scaling and rotation in Overdrive 2 demo

Post by psycopathicteen »

I think I cracked this magic trick.

The 68000 software renders a 2 pixel wide scaled vertical strip, then makes 36 palette swapped copies of itself. Then it DMAs each vertical strips of pixels from the set of 36 possible strips. The DMA source starting point of each strip takes care of the vertical shearing, where as the choice of which of the 36 strips takes care of both horizontal details and horizontal scaling. Then the last step is using line scrolling for the vertical shearing.

Is this correct?
Post Reply