Re: A89: C programming basics


[Prev][Next][Index][Thread]

Re: A89: C programming basics




Well, I can help a little bit...

defining a sprite (i'm using the sprites.h stuff-i don't understand all that 
bitmap stuff in graph.h, and this goes faster anyway)
static BYTE sprite_x[]={0x81,0x42,0x24,0x18,0x18,0x24,0x42,0x81};
this is just byte values with each bit being one pixel, bit 0 being on the 
left side of the sprite
now, to draw it:
Sprite8(x,y,8,sprite_x,LCD_MEM,SPRT_XOR);
this will XOR it at x,y (you could use SPRT_OR or SPRT_AND also)
8 is the height (# of elements in the sprite array)
LCD_MEM is the video adress
Sprite16 and Sprite32 work the same way

If you are using ngetchx, the keys are the same as for BASIC
here's a function to get them with (written in BASIC)
inkey()
Func
Local a
0->a
While a=0
getkey()->a
EndWhile
EndFunc
Type it in, run it, press a key... it returns the value for that key!!!
(the keycodes are also in appendix B of the manual, assuming you still have 
it)

I haven't tried grayscale with TI-GCC yet, but I know sorta how it works, so 
I'll try...
The program sets up an extra video memory and then flips between LCD_MEM and 
that really fast, making it look gray. To make something black, draw it on 
both memories, dark gray=LCD_MEM only, light gray=extra memory only, 
white=don't draw it
Just make sure you set the video address for your grafix functions. I think 
the libraries do all the setting up and taking down for you, so you don't 
need to worry about that.

Well, i tried... If you don't understand, ask again

-Noah Medling

P.S.: stay tuned for my first TIGCC game, sometime next week!!!


>From: "Mahlon Hull" <xavier_02@hotmail.com>
>Reply-To: assembly-89@lists.ticalc.org
>To: assembly-89@lists.ticalc.org
>Subject: A89: C programming basics
>Date: Sat, 28 Oct 2000 12:59:03 PDT
>
>
>I need some help on the basics of graphical programming with tigcc. If
>someone that knows how to program C really well or just knows how to do 
>what
>I'm asking has the time to teach me how to do this stuff that would be
>great! I am having some trouble trying to figure out the documentation for
>tigcc(I wish they would have put it it layman's terms!!!). Anyway I want to
>be able to a little mor with the graphics of the game I'm making. I
>currently have to draw a ton of lines just for one image. I know that you
>can use sprites to do the same job and in a lot less code, but I cannot
>figure out how to define sprites and then *DRAW THEM* on the screen. I also
>am having trouble figuring out how to use the *GRAY SCALE* with tigcc. I
>have read the documentation on it and know it is possible I just can't
>figure out how to use it. The last thing I need help on is how do you 
>figure
>out the *KEY CODES* for the calculator? Anyway, I have a ti-89(HW2) and 
>have
>just started trying to program with tigcc. If anyone can explain to me how
>this stuff works or create some EXTREMELY WELL DOCUMENTED examples I would
>be very grateful.
>
>Thanks alot,
>Mahlon Hull
>_________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
>Share information about yourself, create your own public profile at
>http://profiles.msn.com.
>
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.