3D scrolling on ZX
Lord Vader/MAYhEM
Preface
This article was written in 2014
for the magazineSpectrum Today #2.Since then,
however, a lot of time passed and it became clear
that, apparently, there is no Spectrum Today
#2 will no longer exist. Therefore, the article was right─
included in the electronic journalInfo Guide #12,
which was just getting close to release. Osta─
All I had to do was translate the article into Russian─
Chinese...
Introduction
This article is about full screen 50 FPS
3D scroll, such as can be seen in
New Wave 48k demo, released onForever
in 2013. Well, or which one can be seen in
Commodore 64 demo called Trick
and Treat.
I don't claim to be an inventor
this effect. Everything I did was ok─
trill implementation in the above-mentioned C64 demo,
rethought and coded on ZX.
The article consists of several parts.
First, here is a mini-review of similar effects─
Comrade Next, some terminology is introduced.
to make the story easier. Finally,
describes key ideas and providescode examples. Attention is paid to the so-called
precalc. The last part contains my
considerations for possible improvements in efficiency─
that, and also (most importantly!) transmitted
thanks to those who helped me with the implementation
effect and writing this article.
Historical overview
A small selection of historical (and not
very) dem, in which there was/is something about─
similar to 3D scrolling.
A
B
B
G
D
E
Satisfaction Megademo (Fig. 1)
1994, 3D scroller from single sections─
pixels, and not even one-frame.
Insignificant in the context of this article.
4K intro called 4k intro (Fig. 2)
Written in 1995 and published on
Fantop. Perspective-correct 50 FPS 3D
scroll instead of solid texture pixels
There are also patterned ones. Each line according to
scroll bitwise 'compressed' along the boundaries
bytes Moreover, as you move up
some lines disappear. This approach is not
quite accurate and consumes quite a lot
cycles of the Z80, which is why the effect takes
such a small area on the screen.
Adventurer #3 e-zine (Fig. 3)
1996, has a completely fake scroll
with an incorrect (or missing) perspective─
creative, which makes it seem like the letters are stretched out─
bend in height as they move away from view─
body. Full screen, but 25 FPS. Every line
bitwise compressed at byte boundaries, which
toonot entirely correct.
Trick and Treat demo (Fig. 4)
For C64, 2008, has a real (from ver─
new perspective) 3D scroll. It is from this
demos I borrowed the basic idea of this
scroll. The stars on the screen are made by the device─
new C64 sprites. Nuances: all symbols in
fonts always have a width of 3 textures
pixels and 1 pixel of empty space between
them. In addition, in some places the line
scrollbars are distorted. These shortcomings may be
explained by lack of computing power
processor 6510 and precalc errors, cor─
responsibly.
Agony Megademo (Fig. 5)
1993. Here the 3D scrolling is very unique:
one letter takes up the entire width of the screen. Them
however, the perspective is not spoiled, that’s all
runs at 50 FPS. The rendering code is not the best
optimal, but quite at the level for 1993
year. Presumably this is the first complete─
screen perspective-correct 50 FPS 3D
scroller on an 8-bit machine.
Eldorado demo for C64 (Fig. 6)
1994. Supposedly this is the earliest
scrolling like "Star Wars"(by the way, in
movies he met before "Star Wars" -
Buck Rogers (1939), Shining Path (1940),
Flash Gordon (1941) -Ed.).Nevertheless,
this is a fake (see also 4k intro): only by them─
vertical compression by ejection─
reduction of some lines and compression along the horizon─
whether along byte boundaries. Besides, this is absolutely
Definitely not 50 FPS!
RGB C64 demo (Fig. 7)
2014. At the time of writing this is
was the freshest from the partyX'2014.3D scroll
here made by the same person as in the demo
Trick and Treat, with almost the same code.
The main difference is that scroll
here the C64 drives onto the side of the curb.
Of course, drawing sprites on the side
curb on the commodore - it's not that simple,
but it doesn’t relate to the essence of the effect, because pixels
sprites are depicted from bytes exactly like this
the same as the pixels on the C64's main screen.
Different screen and sprite structure
does not matter, since everyone changes─
written screen (and sprite) byte─
is set by the commandSTA abswith is quite defined─
new address in it. In addition, here it is reduced
vertical resolution (lines are duplicated─
xia), which allows you to exchange the amount of li─
tions that require rendering, for double saving─
every visible screen byte.This
cannot be avoided - after all, maintaining appearances
sprites on the side border of the C64 - quite
costly (in terms of cycles) operation for 6502!
Share your thoughts about the article