Jump to content
IGNORED

Smooth scrolling


Asmusr

Recommended Posts

In Classic99, with Scroll Lock ON, then F9 will swap between ordinary screen and character dump (repeated 3 times). You'll get something like the animation below. In the Debugger you'll see the SIT and PDT updated about every 8th pixel/frame. So for every pixel move you have character patterns being updated/scrolled. Every 8th pixel move the characters and screen have been prepared and are then swapped into place. Characters alternate between >0800 and >1800, and screen at >0000 and >0400.

 

At least Parsec, TI Invaders, Moon Patrol, Buck Rogers, Moon Mine, Frogger, Moon Sweeper and Jungle Hunt (Diving) use some kind of smooth scrolling in parts.

 

:)

 

warzone2.gif

Edited by sometimes99er
  • Like 4
Link to comment
Share on other sites

I'm reposting from a similar subject in Colecovision forum http://atariage.com/...ll#entry2616436

 

For the more technical involved, a small discussion of how I did the scroll in Princess Quest.

 

In the highest resolution VDP mode (mode 2) the screen as you see is composed of 8x8 tiles, there is a frame of 32 columns by 24 rows, each eight rows can have 256 different tiles.

 

In order to do smooth scroll, you should define tiles shifted by pixel AND combined with following tile (by example, 6 pixels of tile plus 2 pixels of following tile)

 

For fast update you change the screen (32x20 tile indexes or so) each two frames so you leave one frame for internal game logic (no way to do it updating pixels, that would be 4K-6K bytes, and VDP is very slow)

 

Need to say that VDP limits colors roughly and you should play tricks to combine different colors, like leaving at least 8 pixels space between tiles of different color.

 

If your game uses less graphics, you can redefine a small number of tiles continuosly.

 

And of course I saved some "untouched" tiles to draw letters for score, record, energy and lifes.

 

By the way, the vertical scrolling is even better because it's not so limiting in terms of color but it's more limited in number of available tiles.

 

Also a good tip for programmers is the use of automated tools to calculate combinations of tiles and removing duplicated tiles in order to get more scene complexity.

 

Here are two videos of my games with smooth scrolling using these techniques running in Colecovision.

 

Princess Quest

 

Mecha-8

http://www.youtube....h?v=hsAUDZpJc0A

Edited by nanochess
  • Like 1
Link to comment
Share on other sites

I forgot to say that the TI/99-4A has the same video chip as Colecovision, so VDP techniques apply to both. :)

 

Of course the games cited are very big (mostly because 1K of memory in Colecovision), so Princess Quest sizes up to 256K and Mecha-8 to 128K.

 

For MSX (another similar machine but with more memory) I was able to compress each game in 64K ROM cartridges.

Edited by nanochess
Link to comment
Share on other sites

  • 3 weeks later...

Thank you sometimes99er and nanochess for guiding me in the right direction. I have been playing around with scrolling for a few weeks, and here is my first demo of pixel smooth scrolling in half bitmap mode:

 

http://www.youtube.com/watch?v=XGc_ZwbnXQ4

 

Note that the video is doing a bad job of showing how smooth the scrolling really is: the screen moves only 1 pixel row at a time - even at the highest speed of 60 FPS.

 

The attached disk contains the E/A 3 file (SCO). Use the joystick to control the speed and move the sprite. On emulators it looks pretty good and on a real console it's even more smooth. However, on the console the top of the screen is flickering - at least on my console with the F18A. If this was to be used in a game I think you could use the top of the screen as text/status area to prevent the flickering.

 

Scrolling.zip

 

This is basically just pattern updating and name page flipping, and it only works with relatively simple graphics. If you're interested in more details I can write some notes...

 

The map/graphics was made in Magellan 1.6:

http://atariage.com/...n/page__st__275

  • Like 5
Link to comment
Share on other sites

Thank you sometimes99er and nanochess for guiding me in the right direction. I have been playing around with scrolling for a few weeks, and here is my first demo of pixel smooth scrolling in half bitmap mode:

 

Very nicely done. Would your scrolling allow you to do the same horizontally or at a diagonal? Just curious :)

Link to comment
Share on other sites

Horizontally, yes, but you would not be able to scroll the colors smoothly so different colors would have to be one character apart. Diagonal would be difficult, I think you would run out of characters.

 

I'm working on another version of the scroller using four buffers that doesn't have any flickering problems. I will post the source code when it's working.

Link to comment
Share on other sites

Horizontally, yes, but you would not be able to scroll the colors smoothly so different colors would have to be one character apart. Diagonal would be difficult, I think you would run out of characters.

 

I'm working on another version of the scroller using four buffers that doesn't have any flickering problems. I will post the source code when it's working.

I was thinking along the lines of simulating a diagonal scroll by scrolling vertically then horizontally.. or horizontlly then vertically. Looking forward to seeing how you are working the magic :)

Link to comment
Share on other sites

  • 2 weeks later...

I have improved my scrolling algorithm, and it's now flawless on real TI-99/4A. Could someone let me know how it looks on a 9918A, please?

 

http://www.youtube.com/watch?v=0_Dtz2F5cIk

 

Don't look at the jerky video, try it on hardware or at least in Classic99!

 

I have attached a zip file with a disk image (use Editor/Assembler option 3 to run DSK1.SCO) and the source code (assemble with WinAsm99).

 

When running the demo, use the joystick to control the ship. Note that the map wraps around after a while.

 

I'm working on some (quite lengthy) notes that I can post if you're interested in how the algorithm works.

Spacescrl.zip

  • Like 5
Link to comment
Share on other sites

I have improved my scrolling algorithm, and it's now flawless on real TI-99/4A. Could someone let me know how it looks on a 9918A, please?

 

http://www.youtube.com/watch?v=0_Dtz2F5cIk

 

Don't look at the jerky video, try it on hardware or at least in Classic99!

 

I have attached a zip file with a disk image (use Editor/Assembler option 3 to run DSK1.SCO) and the source code (assemble with WinAsm99).

 

When running the demo, use the joystick to control the ship. Note that the map wraps around after a while.

 

I'm working on some (quite lengthy) notes that I can post if you're interested in how the algorithm works.

 

Absolutely fucking brilliant ! (pardon my language.)

 

The file runs perfect on a real console and the code converts to a little over 16K of memory image. Only problem I see is that it is not a complete game ;-).....

 

I assume this is compiled BASIC ? If so I am doubly impressed.

 

Good job RasmusM. I hope you continue on.

Link to comment
Share on other sites

The file runs perfect on a real console and the code converts to a little over 16K of memory image. Only problem I see is that it is not a complete game ;-).....

 

I assume this is compiled BASIC ? If so I am doubly impressed.

 

It's 100% assembly language. I can't imagine how this would be possible compiled basic!

 

I'm thinking about turning it into a game, of course, but there are some problems: 1. Apparently you can only rely on 8 sprites working in this mode because of a weird bug, but I could choose to ignore that. 2. I think a have almost run out of clock cycles. To make this a game I would probably have to limit the scrolling to every second frame, but that might not be so bad. 3. Time... I have 3 small children.

 

How do you keep the stars fixed in their position??

I use the undocumented backdrop plane :-) No really, I just add them to the name table after scrolling if the positions are unoccupied. A simple trick with a nice result.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...