MSX 1 smoothscroller general purpose engine

Page 1/6
| 2 | 3 | 4 | 5 | 6

By hit9918

Paragon (1755)

hit9918's picture

08-05-2010, 19:37

MSX 1 smoothscroller general purpose engine

Download demo at http://jf.peer.name/msx/smoothscroller.zip

tech details in README.txt.

Use cursorkeys to scroll, and don't forget to check out diagonal :) :) :)

16bit nametable

on demand charset loader, only load chars really needed

dynamic distribution across 3 vdp charsets, only load chars really needed

method also usable for BOBs

level sketch easily painted as a .gif

B-)

Login or register to post comments

By ARTRAG

Enlighted (4790)

ARTRAG's picture

08-05-2010, 20:25

Very good!
going to study it!

By Latok

msx guru (3287)

Latok's picture

08-05-2010, 20:28

I'm no coder, I just tried your example and idd, it's smooth in 8 directions! What about the speed, can it go faster?

By hit9918

Paragon (1755)

hit9918's picture

08-05-2010, 21:01

I'm no coder, I just tried your example and idd, it's smooth in 8 directions! What about the speed, can it go faster?

Yes. Better framerate is not easy, but more scrollspeed is easily possible.

There is no byte rotation going on, but dumping precalculated charset from RAM to VRAM, so a 2 pixel move takes no longer than a 1 pixel move.

When you call the draw code, you set up X and Y as if there were softscrollregisters, I programmed that part with a big grin in my face.

By Latok

msx guru (3287)

Latok's picture

08-05-2010, 22:01

Awesome Smile

By Hrothgar

Champion (410)

Hrothgar's picture

08-05-2010, 22:49

Looks cool.
What is the maximum level size for this technique?

By hit9918

Paragon (1755)

hit9918's picture

09-05-2010, 00:28

Looks cool.
What is the maximum level size for this technique?

There is no single answer. The quick answer is "consider the low 32k gone for the scrollers bitmaps".
Then you are left with something like 24k.

By the way, is there a way to use the bytes the disk drives steal without wrecking the disk functionality for later loading?

Snipping 32k sounds harsh, but didn't Konami games run without lower 32k?
Note that my saying "lower 32k are gone" are just my idea of what it is worth to trade for removing the wobblescroller shame.
There is no fix size/limit, watch the odd numbers the convertor tool prints to the shell (press a key to see bitmap mass).
But the scroller needs 8 charsets prerotated in RAM, that is the deal.
A normal charset got 4k, so 8 times that make 32k.

In current demo everthing is loaded to lower 32k except RAM-nametable (the part directly related to level size),
and BASIC sits in between, so first step to get more RAM is to move BASIC out of the way.
I favour BASIC for loading because unchanged code would BLOAD from cassette on a real MSX with drives turned off?
Nowadays PCs no more got diskette drives :\

Next step, there is somewhere an article about Turrican Tile Compression.
I haven't checked the method but I think this is way to go.
You would decompress stuff to the 16bit RAM-nametable the engine works on.

Having said all that. The 8x memory consumption is only for horizontal scrolling.
A vertical-only scroller on the other hand needs only one bitmap.
Then using 32k your level can have a whopping 8 charsets, i.e. 8/3 times more graphics
than all 3 vram charsets fully loaded. Sidenote, check docs about turning off Xscroll variable in convertor tool, then it will compress better.

The only caveat is that never more than halve a charset can be onscreen simultaneously or doublebuffering is wrecked.
To be more precise, no more than halve a charset simultaneously in one of the 3 vdp charsets. 9918 mathemathics is complex Wink

Sidenote, checking tripple buffering is todo. Then only max a third charset per vdp charset simultaneously onscreen.

Anyways, this is crying for a softscroll Knightmare getting programmed Wink
There are many scenarios on the same base idea, ranging from extreme work trying to do a 50Hz game including
horizontal bleed wrestles to other extremes like a level consisting of BOBs.

On the other hand, you can do a Knightmare out of the box.
You get smoothscrolling and more charset. In this case the engine practically is better than the VDP alone,
except for the max-halve-a-charset-onscreen limit.

By muffie

Paladin (933)

muffie's picture

09-05-2010, 03:36

By evulopah

Hero (585)

evulopah's picture

09-05-2010, 09:53

Nice! Very nice!

If RyJuZo just started his topics like hit9918 nobody would ever doubt him!

By ARTRAG

Enlighted (4790)

ARTRAG's picture

09-05-2010, 10:05

why not moving to a megarom with any mapper you like?
if the prerotated tiles have to stay in the z80 memory to be loaded in vram when needed the best thing is to devote some pages in a megarom mapper (I like konamy scc, but any other is good too).

Consider that working with magarom allows you to use all the RAM you like (you can use the disk drive ram as you like).
Moreover, you can arrange tiles and megarom pages in order to acces to a potentially unlimited number of prerotated tiles. All you need to have handy is a table that tells for each tile what is the page and the address to set in order to get the data.
Do you agree?

By PingPong

Prophet (2628)

PingPong's picture

09-05-2010, 13:28

@9918: good work, really: is there a way to half the tiles by using a 2px scroll step?
i do not remember if the sprite bug also appear when using the 2/3 name table trick. If not, one could use a single charset for first two parts of screen in order to conserve memory.

Page 1/6
| 2 | 3 | 4 | 5 | 6
My MSX profile