Re: A89: More fun with custom variables...


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

Re: A89: More fun with custom variables...




>ok, anyone have any idea what's wrong with this code...
>
>//sprite definition
>unsigned int sprite[16] = 
>	{0xFFFF,0x8001,0x8001,0x8001,0x8001,>0x8001,0x8001,0x8001, 
> 
>0x8001,0x8001,0x8001,0x8001,0x8001,0x8001,>0x8001,0xFFFF};
>unsigned int pic[16];
>
>//open the file
>fp = fopen ("example","wb");
>
>//write the sprite data to the file
>fwrite (sprite,32,1,fp);
>
>//make a file of type SPT
>fputc (0,fp);
>fputs ("SPT",fp);\
>fputc (0,fp);
>fputc (OTH_TAG,fp);
>fclose (fp);
>
>//open the file
>fp = fopen ("example","rb");
>
>//read the data into the block pointed by pic
>
>
>fread (pic,32,1,fp);
>fclose (fp);
>
>//draw the sprite pic
>Sprite16 (5,5,16,pic,LCD_MEM,SPRT_XOR);
>The sprite drawn is garbled... please help me! :'O
>
>Michael Cowart

Make sure you are using version 2.1 of TIGCC Library. The Sprite16 
function in 2.0 is buggy.

Nathaniel Gibson
ngibson@ptd.net
http://sicode.ticalc.org



Follow-Ups: References: