Page 1 of 1

how to do software sprites for MZ-800?

Posted: Wed Feb 14, 2018 9:32 am
by KnaxMax
Hi,

I always wondered how software sprites could be done efficiently for the MZ-800 graphics mode. It seems a lot of Sharp games used MZ-700 character mode and PCG.

With "software sprite" I mean small 8x8 or 16*16 bitmaps that can be freely positioned, have a transparent color where the background is still visible, can restore the background and my have collision detection and configurable layering.

Are there any tutorials that show how this was achieved with other Z80 machines with similar bitmap graphics?

What is an estimate how many 8x8 sprites could be (re)drawn in the vertical blank period for 4 color mode or 16 color mode?

How to do horizontal pixel positioning? Is it fast enough to use rotate instructions or have precomputed/saved all 8 positions?

Re: how to do software sprites for MZ-800?

Posted: Wed Feb 14, 2018 12:56 pm
by hlide
From what I read somewhere, drawing pixels on MZ-800 is painfully slow. So, probably a reason why there are few games with true pixel drawing.

Re: how to do software sprites for MZ-800?

Posted: Wed Feb 14, 2018 1:46 pm
by goev
I believe it uses ports to write to v-ram, in that case there will probably be many reads and writes in order to move a sprite.
I tried to find more info about the actual videomodes, but couldn't find much info...

Anyone with better knowledge about this that could write a few words?

Re: how to do software sprites for MZ-800?

Posted: Wed Feb 14, 2018 2:25 pm
by KnaxMax
goev wrote: Wed Feb 14, 2018 1:46 pm I believe it uses ports to write to v-ram, in that case there will probably be many reads and writes in order to move a sprite.
I tried to find more info about the actual videomodes, but couldn't find much info...

Anyone with better knowledge about this that could write a few words?
It's not as bad. The IO ports are used to switch in the VRAM bank at 8000H and setup write/read modes.

But I have no idea if this modes are very helpful for other stuff than XOR or setting single pixels in a specific color.
For sprites normal read/write memory access would be separated per 'bitplane', which surely will be slow for 16 color mode.

In 4 color mode it would be possible to do double buffering (with the 16KB VRAM extension).

Re: how to do software sprites for MZ-800?

Posted: Tue Apr 14, 2020 1:50 pm
by Sharpals
Ok ist very old, but read the manual and you i'll find

PATTERN
( PAT. )
800 Allows the user to define his own graphics pattern. It is used in the form PATTERN [PC,sm]n,text data
The colour specification consists of palette code and superimpose mode, although this can be omitted, in which case the current colour specification will be used. The command must be followed by the number of rows of 8 dots, and the actual format of each row is controlled by the text data which must correspond to the binary representation of the dot patterns.

Re: how to do software sprites for MZ-800?

Posted: Sun Apr 19, 2020 9:00 am
by fitus
PATTERN was a very nice feature of Sharp MZ 800 Basic, but it was quite slow, as I remember.
BASIC with direct capability of programmable character generator was X Basic Compiler made by BBG Germany. And this was fast. Some nice games were made in this BASIC compiler- I remember Arkanoids. This was one of the best BASIC modifications made for 8 bit computers, with many features of Pascal. It was available for Sharp MZ 800, 700 and Amstrad CPC