Re: A92: how to draw lines and stuff with TI-GCC


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

Re: A92: how to draw lines and stuff with TI-GCC




You sould write an assembler interface like this:

#define clrscr graphlib__0005
#define fillrect graphlib__0000
#define pause userlib__0000

void fill(),fillrect(),clrscr(),pause();
int _ti89,_ti92plus;

_main()
{
      clrscr();
      fill(10,10,135,10,0);
      pause();
};

void fill(x,y,width,height,color)   /* interface inline assembler */
int x;
int y;
int width;
int height;
int color;
{
asm("
           move.w 8(%sp),%d0
           move.w 10(%sp),%d1
           move.w 12(%sp),%d2
           move.w 14(%sp),%d3
           move.w 16(%sp),%d4
       ");
fillrect();
};

TurboSoft@aol.com wrote:

> how am l supposed to use the library functions in graphlib.h with
> TI-GCC?  l
> don't understand how l'm supposed to do something like
> fill(0,0,30,30,2) (in
> the graphlib.h file) with this program.  l can #define it at the top
> of my
> source code, and put fill(0,0,30,30,2); in my program but it doesn't
> do
> anything.  Am l supposed to somehow switch to a graph mode or
> something?  And
> also what is the point of void clr_scr(); in the source code?  And
> also one
> more thing, where is the DrawStr command (in the source code) listed?
>
>
> -------------------------------------------------------------------------------------------------------------
>
> #include <romcalls.h>   // include file for rom calls
>
> #define clr_scr graphlib__0005
> #define idle_loop userlib__0000
>
> void idle_loop();       // prototype for idle_loop();
> void clr_scr();         // prototype for clr_scr();
>
> int _ti89,_ti92plus; // compile for both calcs
>
> void _main()    // entry point
> {
>  clr_scr();     // clears the screen
>  DrawStr(0,0,"Hello, World",4); // displays '"Hello, World" at x=0,
> y=0
>  idle_loop();   // waits for a key press
> }





References: