= ASM =

ZXNet echo conference «zx.spectrum»

From Vyacheslav Mednonogov To All 12 November 1997


Get Msg, Yurok!

30 Oct 97 18:56, Yurok Merkulov reported to Vyacheslav Mednonogov about {= ASM =}:

YM>>> and I have 168 sprites on the screen and they need to be constantly redrawn.
VM>> 168 sprites sized 4x4 familiar places on one screen???
YM> Uh-huh..(so tempting)
VM>> Yes, you have meat there ;)

YM> I have isometry there, like you have in Ufoshka the second, but with
YM> animation, such as a rotating fan in the wall, a “running”
YM> strip on the floor, interference on the monitor, fire after pomegranates and so on..

Oh, I understand - cool. However, it is not a fact that it is possible. In UFO-1, at first I also
wanted to redraw the entire screen, but according to calculations it came out a frame per second :((
So I went for a military trick:
a) the buffer stores a drawn piece of the landscape, visible on the screen, without
heroes
b) when scrolling, the buffer shifts and only a strip is drawn on the desired
side
c) the buffer is output to the second buffer, where heroes are superimposed on it
(the hero himself is drawn, then what is in front of him. All heroes are pre
sorted by distance from the observer. The same applies to bullets/explosions)
d) all this is displayed on the screen

YM>>> And it doesn’t work faster.

All this works quite quickly (although with output via the stack it could
be done 40% faster).However, the animation sprites of the landscape had to be
thrown away, otherwise there would have been brakes.

VM>> Now they will advise you to output everything through the stack :)
YM> I am always glad for advice, it is only important to weed out the smart ones...

The key piece is this:

...
POP DE ;the stack is first transferred to the sprite
LD A,(HL) ;hl-address in the screen
AND E
OR D
LD (HL), A
INC L
...

VM>> ps\ by the way, isn’t it easier to store additional mirror sprites?
YM> And the memory??? And so it’s already back to back, as calculated. We will probably make the 128th first
YM> (oh, when only...), and then, if things go well, then the 256th
YM> with all the bells and whistles!

If we did it like in UFO - 2x4 or even 2x3 sprites - there would be a wagonload of memory :))

With warm regards, Glory!