Re: A82: Re: 2 questions
[Prev][Next][Index][Thread]
Re: A82: Re: 2 questions
The library contains the follwong functions:
BWrite : Display 8*y sprite
BCWrite : Display 8x*y prite
BErase : Display 8*y sprite
BCErase : Display 8x*y prite
BRead : Display 8*y sprite
BCRead : Display 8x*y prite
8*y means a sprite 8 pixels wide and y lines long.
8x*y means a sprite 8*x pixels wide and y lines long.
All sprites which have the size 8*y are defined like below :
:DB Number_Of_Lines
.DB Sprite_byte_1
...
So the first byte determines how long the sprite is and after that you place
the data.
All sprites which have the size 8x*y are define like below:
.DB Number_Of_Cols
.DB Number_Of_Lines
.DB Sprite_byte1
....
So the first byte determines how many times 8 pixels the sprite is wide, and
the next byte for meny lines long it is. After these bytes you place the
data (one colum after the other).
Let me give an exampel :
TestSprite:
:DB 2
.DB 3
.DB 0FFh
.DB 080h
.DB 0FFh
.DB 0FFh
.DB 001h
.DB 0FFh
This would define a sprite 16 pixels (8*2) wide and 3 lines long, it would
look something like this:
XXXXXXXXXXXXXXXX
X______________X
XXXXXXXXXXXXXXXX
(X=pixel on _=pixelf off)
*Write display the sprite pointed to by HL
*Erase erases the sprite pointed to by HL
*Read reads a sprite from the display and places it at HL
All these function expects the coordinates in BC.
The following code would display the sprite defined above in 12h,12h (in Ash
3.0)
LD HL,TestSprite
LD BC,$1212
CALL BCWrite
In all other ti82 asm shells you could do
LD HL,TestSprite ; The following 3 lines could be replaced by
L_DATA(TestSprite)
LD DE,(PROGRAM_ADDR) ; which is defined in SPLIB
ADD HL,DE
LD BC,$1212
CALL_(BCWrite)
Besides the sprite functions included in SPLIB i have also made some macros
which i find useful when doing graphics on the ti82. The macro L_DATA should
only be used with shells which does not have relocation. The lib was
originally writen for Ash 1.x so the test program will not compile under Ash
3.0 unless you remove all the lines which uses PROGRAM_ADDR and you include
oldcalls.h.
DInes
-----Original Message-----
From: GeradS711@aol.com <GeradS711@aol.com>
To: assembly-82@lists.ticalc.org <assembly-82@lists.ticalc.org>
Date: 24. september 1997 05:04
Subject: Re: A82: Re: 2 questions
>How would I use splib to display a sprite stored at the base of a program
or
>would I just use a sprite stored at (hl) i.e. in the text mem? I don't
really
>understand the coding. BTW does Jimmy Mordel's put_sprite work for the 82
or
>does it use the video mem?
>
>