Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Question about shifting of scanlines for backgrounds, fps

Reply to topic
Author Message
  • Joined: 05 Mar 2022
  • Posts: 129
  • Location: Seabrook, New Hampshire
Reply with quote
Question about shifting of scanlines for backgrounds, fps
Post Posted: Mon Sep 04, 2023 8:05 am
On racing games, the appearance of turns as achieved in the same way as parallax scrolling, by shifting the background X value over by different amounts as the VDP draws each line.

In games like Road Rash, even the Y value is adjusted to create the appearance of hills and dips in the road.

However, I have some ideas for adding structures and objects above the horizon and would like to use the same techniques to get those 3D effects. My worry is the drop in frame rate.

Since the Z80 only offers 228 cycles per scanline (assuming that we're counting cycles rather than using horizontal interrupts with their 30-40 cycle overhead), that doesn't leave a lot of time left for loading the X and Y adjustment values from the game ROM, then changing those values in the VDP at run time.

And I don't know if Road Rash uses horizontal interrupts or some more efficient method. I certainly do notice the clear loss in frame rate performing all of this advanced mathematics at run time.

Can we draw 3D structures above the horizon using this method without dropping frames?

Super Monaco GP, Kawasaki Superbike Challenge (polygons), and Outrun 2019 (least accurate prediction of the future ever) all draw 3D structures above the race track on the Genesis.

  View user's profile Send private message
  • Joined: 06 Mar 2022
  • Posts: 671
  • Location: London, UK
Reply with quote
Post Posted: Mon Sep 04, 2023 8:16 am
You can't change vertical scroll mid frame — register 9 is latched in VBLANK.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14745
  • Location: London
Reply with quote
Post Posted: Mon Sep 04, 2023 9:37 am
Doing raster FX on the top half of the screen is possible, Space Harrier does it for some stages and many racing games do it for parallax clouds/hills/etc with fewer splits. It's not really a CPU speed concern, you'd compute the offsets (or arrange a table lookup) during alternate frames or vblank.

Road Rash does much more complicated things to draw hills.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Jan 2010
  • Posts: 439
Reply with quote
Post Posted: Mon Sep 04, 2023 10:34 am
Maxim wrote
Doing raster FX on the top half of the screen is possible, Space Harrier does it for some stages and many racing games do it for parallax clouds/hills/etc with fewer splits. It's not really a CPU speed concern, you'd compute the offsets (or arrange a table lookup) during alternate frames or vblank.

Road Rash does much more complicated things to draw hills.

What supermaxx is refering not is about the hills and effects but about the road elevactions. This matter already exhaustively debated, which the NES fan claims that SMS cannot do a game like Rad Racer smoothly. SMS developers or ommited the road elevactions like Chase HQ or dont ommited it and the game dont is so smooth. If this happened is because the hardware limitations are recognized. Something that supermaxx dont understood and want create something never programmed before. However the examples are with Genesis/MD games.
  View user's profile Send private message
  • Joined: 05 Mar 2022
  • Posts: 129
  • Location: Seabrook, New Hampshire
Reply with quote
Post Posted: Tue Oct 03, 2023 8:49 pm
Maxim wrote
Doing raster FX on the top half of the screen is possible, Space Harrier does it for some stages and many racing games do it for parallax clouds/hills/etc with fewer splits. It's not really a CPU speed concern, you'd compute the offsets (or arrange a table lookup) during alternate frames or vblank.

Road Rash does much more complicated things to draw hills.


Do you know if work has been done comparing the performance difference between the calculation vs. a Look Up Table? I've always thought that a memory efficient way of doing it would be to calculate the LUT while the stage/game is loading, then put that table in RAM.

IIRC, up to 12-14 load-stores can be performed in one scanline. That is, one could look up the value in the LUT from RAM or ROM, then move that value to the VDP for the very next scanline.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14745
  • Location: London
Reply with quote
Post Posted: Tue Oct 03, 2023 8:52 pm
I’m sure it’s LUTs all the way. You wouldn’t try to calculate curves on the Z80.

You’d build a table in RAM of the scroll values for he next frame and then simply read, output and increment the pointer in the line handler. You wouldn’t cycle count, there’s no point.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!