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 - Fun with zooming

Reply to topic
Author Message
  • Joined: 28 Sep 1999
  • Posts: 1169
Reply with quote
Fun with zooming
Post Posted: Sun Oct 30, 2005 5:40 pm
Since I can never get anything finished in time for the infamous Bock's Birthday event, I'm going through my directories of SMS stuff and looking for bits and pieces of programs other folks may want to check out.

Here's a program that does full screen zooming at 60 FPS on the SMS, using TMS9918 graphics mode I. It's all raster effects and precalculated data rather than number crunching:

http://cgfm2.emuviews.com/zip/zoomex1.zip

Some of the raster timing (NOP delay) will need to be tweaked for a PAL machine to hide visual garbage - it works fine on a NTSC SMS 1. I've included some technical details about how the effect works.

Edit: works with Kega Fusion. What doesn't Kega do correctly? :)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 8349
  • Location: Paris, France
Reply with quote
Post Posted: Sun Oct 30, 2005 6:27 pm
Great stuff.

Interesting how you do raster effect on TMS9918 video mode using timed HALT. I haven't seen a single SG-1000/Coleco game doing that due to lack of line interrupts.

It's not showing properly in MEKA since I'm rendering TMS9918 video modes on a screen basis rather than line-basis. Now this demo is a motivation to switch to line-based rendering, but it will take more CPU, causing a probable noticeable effect on older computers. ALL YOUR FAULT!! :)
  View user's profile Send private message Visit poster's website
  • Joined: 28 Sep 1999
  • Posts: 1169
Reply with quote
Post Posted: Sun Oct 30, 2005 7:09 pm
Bock wrote
Great stuff.
Interesting how you do raster effect on TMS9918 video mode using timed HALT. I haven't seen a single SG-1000/Coleco game doing that due to lack of line interrupts.


It's mainly to minimalize display 'glitches' that show up when the VDP registers are changed.

If the main loop was something like:

loop: jr loop;

Then the best case interrupt response time is right after the JR, and the worst case is where the JR has to finish executing first beforehand (12 T-states, I think).

By using a bunch of HALTs, interrupts are serviced as quickly as possible. However I just realized the interrupt routine change the return address to the start of the HALT block, otherwise every 512 interrupts there's a bit of sync loss due to the JP being executed. Oops.

Otherwise there wasn't any NOP delay that would hide all the garbage, all the time. So this is a good technique for keeping the display tidy.

Quote
It's not showing properly in MEKA since I'm rendering TMS9918 video modes on a screen basis rather than line-basis. Now this demo is a motivation to switch to line-based rendering, but it will take more CPU, causing a probable noticeable effect on older computers. ALL YOUR FAULT!! :)


I'll try to release some of my other TMS9918 based programs that require line rendering just to make MEKA more complete (or difficult to develop! ;)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13661
  • Location: London
Reply with quote
Post Posted: Sun Oct 30, 2005 7:57 pm
Well, that is mightily impressive. I'm aiming to have something done for 25th November, and since I didn't do anything yet it might not be so great :)

One very pointless minor question: what did the COASTER sine table creation program do that WLA DX's .DBSIN couldn't? [Edit: looking closer, generating matching C and ASM tables would be one thing.]
  View user's profile Send private message Visit poster's website
  • Joined: 28 Sep 1999
  • Posts: 1169
Reply with quote
Post Posted: Sun Oct 30, 2005 10:18 pm
Maxim wrote
Well, that is mightily impressive. I'm aiming to have something done for 25th November, and since I didn't do anything yet it might not be so great :)


Based on your track record for other SMS software, I think whatever is finished by then will be pretty good. :)

Quote
One very pointless minor question: what did the COASTER sine table creation program do that WLA DX's .DBSIN couldn't? [Edit: looking closer, generating matching C and ASM tables would be one thing.]


It has a GUI that allows you to edit several parameters and see resulting sine wave plotted in a little window. You can edit a second one and merge them together in different ways.

I find it easier to observe the sine wave on the screen rather than try to guess what it will look like based on the input parameters WLA-DX accepts.

And the plain text output is nice for using in C and assembly programs, as you mentioned.
  View user's profile Send private message Visit poster's website
  • Joined: 16 Dec 2004
  • Posts: 486
  • Location: El Cerrito, CA
Reply with quote
Post Posted: Tue Nov 01, 2005 5:05 pm
WOW! That's an awesome effect. Can you only do this with the checkerboard pattern, or can you do this effect with something more complex?
  View user's profile Send private message Visit poster's website
  • Joined: 28 Sep 1999
  • Posts: 1169
Reply with quote
Post Posted: Wed Nov 02, 2005 6:58 am
Raccoon Lad wrote
WOW! That's an awesome effect. Can you only do this with the checkerboard pattern, or can you do this effect with something more complex?


You are pretty much limited to displaying something with intersecting straight lines. It would be cool to zoom up a bitmap or do other solid shapes like circles or triangles, but it just can't be done in hardware.

You can do some minor tweaks to this effect, mainly in the coloring. For example:

http://cgfm2.emuviews.com/zip/pt.zip

The movement data is heavily distorted so you get a more interesting result, and four colors instead of two are used. Looks better on a real TV then in Kega.

http://cgfm2.emuviews.com/zip/vras.zip

Original effect but with vertical scrolling bars in the background. However because of the tile size (8 pixels across) and limited palette in the TMS9918 modes, it doesn't look that great due to the choppy movement.

You could probably do horizontal bars in the foreground with smooth movement, but I think you'd run out of H-Blank time doing the color table updates per frame so I didn't try.
  View user's profile Send private message Visit poster's website
  • Joined: 08 Jan 2008
  • Posts: 5
Reply with quote
Post Posted: Mon Jun 29, 2009 3:24 am
urgh, an old post with dead links! :) i'd be interested to check this effect out, does anyone have it laying around still?
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!