- Sprites (v3.3) for your Basic programs (TI83PCE/84+CE)
- 04 Jun 2016 11:44:49 am
- Last edited by grosged on 07 Jun 2016 01:39:20 pm; edited 1 time in total
As KermMartian suggested me yesterday, I propose you my last project named SPRITES
( Available here : https://tiplanet.org/forum/archives_voir.php?id=539203 )
I've just translated the file "instructions.txt" (hope my old-school-english 's not too bad!)
First of all, the installation...Just transmit these 6 files :
The SPRITES project v3.2 (for TI83PCE/TI84+CE) is composed of 6 functions, written in ASM, executables from the TI-OS :
1) SETTINGS ,situated in the beginning of your Basic program, initialises the routines, memorises the Status Bar, clears the screen in black, goes to 256-color-mode (8bpp).
If you write the string "+" just before it, that will force to stay in 16bpp mode
(useful for debugging an error in your Basic program!).
inside your program:
Code:
or just before launching your program DEMO:
Code:
2) CLSCREEN allows you to clear (part of) screen, using one of 256 colors
(see 256_colors.png).
Code:
clears the whole screen in white.
Code:
Displays at least one filled rectangle starting at (x,y) position (top left corner).
You'll notice that chaining of parameters is possible.
3) PALETTE allows you to modify/re-initialise the standard 36-color-palette
(see Palette_36colors.png)
Code:
changes the first colors of the palette (modifying all the palette is possible)
Code:
re-initialise the standard palette.
4) SPRITE allows you to define/display a Sprite.
When defining, you'll have to mention respectively:
-its number (0 to ...),
-its width (1 to 35),
-its height (1 to 35),
-its zooming (x1 to x7),
-then pixels data...
As we need to put values higher than 9, we'll use the base 36 (values between 0 and Z ,eg A=10, B=11....Z=35)
For example:
Code:
define the Sprite number 0 (=000), which size will be 12x3 (=C3), and zoom x5 (=5)
IMPORTANT: : the sprites always have to be defined increasingly : 0,1,2....
Plus, when defining sprite "000", this also (re)set the Sprites Data !
76800 are available for storing sprites (I guess that will be enough)
One sprite = 2+(width*height)*zoom^2 bytes, we can store up to 62 sprites 35x35 , zoom x1
When displaying, a chaining of several sprites parameters is possible:
For example:
Code:
will display the sprite #0, coordinates (100,200) , also the sprite #1 , coordinates (0,0) ( =top left corner of screen) .
5) PRINT allows you to set the displaying mode (graphical position, color/background color (0 to 256), size of characters )
Also allows to display characters (text, variables,...)
Of course, the minus are availables thanks to a double [alpha] key pressing.
For setting...
Code:
or
Code:
or
Code:
And for displaying...
Code:
If you want to "return & go to next line", just put an "i" by pressing [2nd] [.]
Code:
will display...
Hello!
Everything's fine?
Let's mention that PRINT will be more accurate :
Code:
will display 3.1415926535898 instead of usual 3.141592654
By the way, DO NOT FORGET to use the instruction DEC !
...Or else ,
Code:
will display 1
Be careful to put DEC,FLOAT, MATHPRINT, CLASSIC,...Before Asm(prgmSETTINGS !
Simply because these instructions could modify the Status Bar
6) BACKHOME allows a safe return to the TI-OS :
-clear all Data, converts final screen (and goes back) to 16bpp mode, then finally restore the Status Bar
Code:
If you want not to restore the Status Bar (useful for screenshots!)
just write the string "NSB" (No Status Bar)
Code:
IMPORTANT, in order not to annoy your dear Calculator:
-SETTINGS must be in the beginning of your program ( 'cause it initialises things...)
-Always define sprites increasingly (from number 0...)
-obviously NEVER try to display an inexistant Sprite!
-I recommend not to display outside the screen
-no more use of display functions: Output,ClrHome,ClrDraw,Text, Line,Pxl-on,Pt-on...
Voilà! I hope that this tool will be useful for your creations.
Have lots of fun ! And good programming !
I give Thanks to Epharius, DjOmnimaga, Diolum (tip "minuscules"), DrDnar (trick "faster/fastest") and others for their advices , testings, tips and inforrmations !!
-Gérald aka grosged (june 2016)
PS: Please don't hesitate, in case of bugs , tell me, thanks
( Available here : https://tiplanet.org/forum/archives_voir.php?id=539203 )
I've just translated the file "instructions.txt" (hope my old-school-english 's not too bad!)
First of all, the installation...Just transmit these 6 files :
- backhome.8xp
clscreen.8xp
palette.8xp
print.8xp
settings.8xp
sprite.8xp
The SPRITES project v3.2 (for TI83PCE/TI84+CE) is composed of 6 functions, written in ASM, executables from the TI-OS :
1) SETTINGS ,situated in the beginning of your Basic program, initialises the routines, memorises the Status Bar, clears the screen in black, goes to 256-color-mode (8bpp).
If you write the string "+" just before it, that will force to stay in 16bpp mode
(useful for debugging an error in your Basic program!).
inside your program:
Code:
"+":Asm(prgmSETTINGS
or just before launching your program DEMO:
Code:
"+":prgmDEMO
2) CLSCREEN allows you to clear (part of) screen, using one of 256 colors
(see 256_colors.png).
Code:
255:Asm(prgmCLSCREEN
clears the whole screen in white.
Code:
{x,y,width,height,color,x2,y2,width2,height2,color2...:Asm(prgmCLSCREEN
Displays at least one filled rectangle starting at (x,y) position (top left corner).
You'll notice that chaining of parameters is possible.
3) PALETTE allows you to modify/re-initialise the standard 36-color-palette
(see Palette_36colors.png)
Code:
{255,15,0,...:Asm(prgmPALETTE
changes the first colors of the palette (modifying all the palette is possible)
Code:
0:Asm(prgmPALETTE ou "":Asm(prgmPALETTE ...(well, everything but a list!)
4) SPRITE allows you to define/display a Sprite.
When defining, you'll have to mention respectively:
-its number (0 to ...),
-its width (1 to 35),
-its height (1 to 35),
-its zooming (x1 to x7),
-then pixels data...
As we need to put values higher than 9, we'll use the base 36 (values between 0 and Z ,eg A=10, B=11....Z=35)
For example:
Code:
"000,C3,5
Ans+"0123456789AB
Ans+"CDEFGHIJKLMN
Ans+"OPQRSTUVWXYZ
Asm(prgmSPRITE
define the Sprite number 0 (=000), which size will be 12x3 (=C3), and zoom x5 (=5)
IMPORTANT: : the sprites always have to be defined increasingly : 0,1,2....
Plus, when defining sprite "000", this also (re)set the Sprites Data !
76800 are available for storing sprites (I guess that will be enough)
One sprite = 2+(width*height)*zoom^2 bytes, we can store up to 62 sprites 35x35 , zoom x1
When displaying, a chaining of several sprites parameters is possible:
For example:
Code:
{0,100,200,1,0,0:Asm(prgmSPRITE
will display the sprite #0, coordinates (100,200) , also the sprite #1 , coordinates (0,0) ( =top left corner of screen) .
5) PRINT allows you to set the displaying mode (graphical position, color/background color (0 to 256), size of characters )
Also allows to display characters (text, variables,...)
Of course, the minus are availables thanks to a double [alpha] key pressing.
For setting...
Code:
{x,y:Asm(prgmPRINT
Code:
{x,y,color,background color:Asm(prgmPRINT
Code:
{x,y,color,background color,zoom-width,zoom-height:Asm(prgmPRINT
And for displaying...
Code:
"Hello world":Asm(prgmPRINT
x:Asm(prgmPRINT
L1(1:Asm(prgmPRINT
123+4567:Asm(prgmPRINT
π:Asm(prgmPRINT
If you want to "return & go to next line", just put an "i" by pressing [2nd] [.]
Code:
"Hello!iEverything's fine?":Asm(prgmPRINT
will display...
Hello!
Everything's fine?
Let's mention that PRINT will be more accurate :
Code:
π:Asm(prgmPRINT
will display 3.1415926535898 instead of usual 3.141592654
By the way, DO NOT FORGET to use the instruction DEC !
...Or else ,
Code:
π:Asm(prgmPRINT
Be careful to put DEC,FLOAT, MATHPRINT, CLASSIC,...Before Asm(prgmSETTINGS !
Simply because these instructions could modify the Status Bar
6) BACKHOME allows a safe return to the TI-OS :
-clear all Data, converts final screen (and goes back) to 16bpp mode, then finally restore the Status Bar
Code:
Asm(prgmBACKHOME)
If you want not to restore the Status Bar (useful for screenshots!)
just write the string "NSB" (No Status Bar)
Code:
"NSB":Asm(prgmBACKHOME
IMPORTANT, in order not to annoy your dear Calculator:
-SETTINGS must be in the beginning of your program ( 'cause it initialises things...)
-Always define sprites increasingly (from number 0...)
-obviously NEVER try to display an inexistant Sprite!
-I recommend not to display outside the screen
-no more use of display functions: Output,ClrHome,ClrDraw,Text, Line,Pxl-on,Pt-on...
Voilà! I hope that this tool will be useful for your creations.
Have lots of fun ! And good programming !
I give Thanks to Epharius, DjOmnimaga, Diolum (tip "minuscules"), DrDnar (trick "faster/fastest") and others for their advices , testings, tips and inforrmations !!
-Gérald aka grosged (june 2016)
PS: Please don't hesitate, in case of bugs , tell me, thanks