Jump to content
IGNORED

Smooth scrolling


Asmusr

Recommended Posts

 

About msx1 scrolling, it is possible to have

- Sprites perfectly active (no cloning)

- Double buffering with two pages with 256 tiles per page

...

 

This is a brilliant technique! I wonder how fast it would run on a TI. Does anyone know how the CPU RAM to VDP RAM bandwidth on the MSX1 compares to the TI?

Link to comment
Share on other sites

  • 2 weeks later...

On msx1, while the vdp's raster is in active, the z80 can overrun the vdp sending data with successive outs

The minimum delay between successive outs to do not incur in data loss is 28 cpu cycles

In average the z80 can write in VRAM about 1500 bytes per frame (this in PAL systems: NTSC systems can handle barely 900 bytes per frame).

 

Here for more accurate figures (in Spanish)

 

How many bytes per frame can the TI update in VRAM ?

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

  • 10 months later...

I got inspired by senior_falcon's Star Wars text scroller written in XB256 to see what I could do in pure assembler.

 

This demo is using The Mole's VDP memory layout with 8 banks of 128 patterns, where each bank represents a frame scrolled between 0 and 7 pixels, i.e. 1024 patterns are pre-loaded into VDP RAM.

 

Each bank of 128 patterns is divided in two sets of 64 patterns, each set representing the 64 ASCII characters from 32-127. If you think of a 8x16 pixel rectangle where a character is scrolling from the bottom to the top in 8 frames, set 1 contains the top half of this rectangle while set 2 contains the bottom half. On screen, even rows contain patterns from set 1 and odd rows contain patterns from set 2 (and vice verse after every 8 frames). Character A (ASCII code 65), for instance, is represented by pattern 65-32=33 in set 1 and 65+32=97 in set 2.

 

All that is required to scroll the screen is to cycle the pattern table (VDP reg 4) between 0-7 each frame. After 8 frames the entire name table must be scrolled one row. This is done in an off-screen double buffer 3 rows per frame (3x8=24). One original text line is copied to two VDP rows simply by subtracting 32 from all character codes for the top row and adding 32 to all character codes for the bottom row. For 3 VDP rows this only takes about 1/300 sec without any special optimization, so the demo is just waiting for vertical refresh most of the time. The TI is too fast for this!

 

I could easily have added some VGM music using Tursi's player, but I couldn't find anything suitable for reading of The Hobbit.

 

 

 

 

 

Scrolling text.zip

  • Like 4
Link to comment
Share on other sites

That's a neat use of the characteristics of the algorithm. Instead of calculating the occurring transitions in a pre-defined map, you just pre-scrolled every character into an empty 8x8 pattern, allowing you to scroll any text without having to do the pre-calculation. I like it, and might steal the idea for the story progression in Alex Kidd.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...

I have updated my latest scrolling demo with some spinning coins:

 

 

Note that if you run this file (VS2P) on a real old VDP you should see the sprite duplication bug in action because more than 8 sprites are displayed in 'half-bitmap' mode. VS3P should fix this, but runs slower because it has to update 3 pattern tables (but still only one color table).

 

The second video (VS4P) is actually more interesting, I think. The screen is divided in 3 where the top 3rd shows colors only (patterns set to 0), the middle 3rd shows patterns and colors, and the bottom 3rd shows patterns only (colors set to >F0).

 

 

It's interesting too see how much of the information is carried in the colors.

vscroll.dsk

Platform 2 src.zip

  • Like 4
Link to comment
Share on other sites

  • 2 weeks later...

What about a game with color only scrolling?

 

It looks good for abstract games, the pixel would be 4x1.

It solves many problems (speed and sprites glitch)

 

Yes, an interesting option if you prefer speed over detail. And with only one table to update you should be able to run at 60 Hz.

Link to comment
Share on other sites

  • 8 months later...

Rasmus,

I'm not asking you or anyone to make this, I'm just asking. From a technical aspect, do you think this is doable with a 512K cartridge and an F18 with your Smooth Scrolling technique?

 

Smooth scrolling on the F18A is very different from smooth scrolling on the 9918A because the F18A has hardware scroll registers. What's matters is how many unique 8x8 characters that are displayed at the same time. If there are more than 256 you would have to reduce the complexity of the graphics before it could be displayed on an F18A. To find out what's possible for Duke Nukem II you (yes you :)) could make some screen shots and import them into Magellan using the "Map image" option. This is not easy since the sprites would have to be removed from the screen shots first (and of course that screen shots have to be in scale 1:1).

 

It's probably more realistic to look here for graphics that would work well on the F18A:

http://www.smspower.org/Maps/Index?sid=f52cd339681d4a5ca7cabb90089caddd

  • Like 1
Link to comment
Share on other sites

  • 2 months 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?

 

.......

 

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

Hi Rasmus

 

First of all happy holidays and wish you the best for the new year. Secondly I was reading a lot of machine code documentation this last week and dabbling with some scrolling of my own, (very basic - not close to your method) but I am happy so far. I later started reading on your methods through the source code you kindly gave us 2 years ago. I could understand that you pre-scroll the tiles before you actually start rendering to get smooth pixel scrolling. What I was not sure of was that given that a tile, when it scrolls UP/DOWN will go into another tile on top of it or underneath it would it ever risk of running out of characters (I think the combinations may become much more than the max allowed in TI). I will be very interested in your notes so that I can learn some serious assembly.

 

Thanks

 

David

Link to comment
Share on other sites

Hi Rasmus

 

First of all happy holidays and wish you the best for the new year. Secondly I was reading a lot of machine code documentation this last week and dabbling with some scrolling of my own, (very basic - not close to your method) but I am happy so far. I later started reading on your methods through the source code you kindly gave us 2 years ago. I could understand that you pre-scroll the tiles before you actually start rendering to get smooth pixel scrolling. What I was not sure of was that given that a tile, when it scrolls UP/DOWN will go into another tile on top of it or underneath it would it ever risk of running out of characters (I think the combinations may become much more than the max allowed in TI). I will be very interested in your notes so that I can learn some serious assembly.

 

Thanks

 

David

 

Another question is, would this work on an unexpanded TI or would it require a 32k upgrade ?

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...