Lesson 9: Sprites and full screen pics

Alligned Sprites

First off, we will talk about aligned sprites. What I mean by alligned sprites is that the sprite always starts at the beginnig of a byte in the video buffer and uses up whole bytes. An example of this is my game, BreakDance. BreakDance uses alligned sprites. Whats cool about this is that graphics become super fast because you can access the video buffer. Also you do not have to use FIND_PIXEL, meaning you don't have to switch to page 4. The thing that sucks about aligned sptries is there is only 16 different horizontal places to put a sprite. So you may be asking, why did I use it? Well, if you noticed, the guy in BreakDance never moves. I just draw a new picture over the old one each time. The only time that alligned items can come in handy is when you are doing a background or a title screen picture or something. Just be aware to stroe a full screen picture takes 1024 bytes! That is a tad big. So, for full screen items it is common to use ZCP.

ZCP

What is ZCP? Well it is a routine used in many ZShell and Usgard programs to display compressed data as a full screen pic.

First of all, you make your picture on the calc. Then transfer the pic over to the computer as an 85i file. Then you use an accompanying computer program to make the asm file of DB's that are the encoded 85i. Then you use a routine to display the picture. It is really easy.

In fact all you have to do is make a call to START in the rouine and it covers it all for you. It only allows one picture though labeled ZCP. With some modifications that can be changed though. This routine does not require the rom to be on page 4, and it is pretty easy to use.

Get the ZCP stuff you need

Non-aligned Sprites

What I exactly mean by allgined sprites is sprites that start in the middle of a byte and can spawn over many bytes. These sprites are harder and slower. Routines that use FIND_PIXEL to locate each pixel are incredibly slower than ones that makes one call and bases the others off that one. There are many sprite routines that handle these kinds of sprites. Since each one is different, I won't be going over any one specifically. The most complex is NASR (Non-Aligned Sprite Routine), available at TICALC. It allows for pretty much any size sprite, but is slower that required size sprite functions. You can find a lot of different routines, and since each one is defferent, read the instructions on how to use it that comes with it.

Just for fun I am going to show you how to define sprites:

Sprite:
.db %10000001
.db %01000010
.db %00100100
.db %00011000
.db %00011000
.db %00100100
.db %01000010
.db %10000001

Sometimes you have to define the dimension first, if you do, throw .db 8,8 below the line Sprite:

There is one more sprite function I am going teach you to, but it will be in the lesson about Morphic code.

If you have questions, email me at spot85@hotmail.com

 

 

 

1