A89: Re: Re: TI-GCC IDE v2.4 with Syntax Highlighting


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

A89: Re: Re: TI-GCC IDE v2.4 with Syntax Highlighting




Hi!

| Note that TIGCCLIB 2.0 (I hope that it will be released
| tomorrow) has sprite.h header file, and supports sprites
| up to 32 pixels wide (I hope that wider sprites are rarely
| needed).

I actually mean a sprite editor in the IDE, which should support all
available formats, including icons, bitmaps, 32x32 sprites.  Also, I want to
finish my "Buffered Graphics" header file, and add support for scaled
sprites (I need it for AUTOmatix 3D).

| > - a help file
|
| Don't do this without consultation with me ;-)

Yes, of course.  Actually, I plan to create a program help file first, and
then I will eventually add a TI-GCC help file, if you allow me to do that,
and can report any changes to me.

| > - a function library
|
| What do you mean under "function library"?

I just mean that everything general I create for myself should be available
to others as well, either through TIGCCLIB or together with the IDE.  For
that purpose, I was planning to write my own set of header files, but it
might as well be distributed along with TIGCCLIB.  Since this is a community
of sharing, this is probably the most logical step.

| > Also, if that's possible, I might provide libraries of object files.
| > These would only work with my IDE.  I have an idea on how to do this,
| > but I don't know how much time it would take to link everything
| > together. It shouldn't take too long, though.
|
| Again, don't do this without consultation with me :-))

Yes.  I stated my idea in a previous post.  I don't think this could fail in
any way.  If you want to help me with this, just email me.

| Anyway, I think that further developing of C "development kit" must
| be with a high degree of cooperation. Independent developing of the
| copiler/linker itself, library and environment may be extremely messy
| if anybody don't know about what is planed by somebody else...

Good idea.  Also, about the distribution as one part:  I emailed Xavier
about this, and he didn't seem too interested (at least not until syntax
highlighting, or something).  Maybe now is the time to do this.  I could
provide us with an easy-to-use GUI setup program.

| I also think that VTI must be included in the our "SDK": reduced
| version which supports only MC68000 calcs, but which may communicate
| with TIGCC+LIB+IDE...

I tried to email Rusty Wagner once, but he never responded.  In this, I
stated exactly what you just wrote.  In my opinion, we might eventually be
able to create a C debugger.

| I think that even at this state of development, TIGCC+TIGCCLIB+TIGCCIDE
| is better than SDK planed by TI. If I am informed correctly, TIGCC SDK
| will have nothing more than:
|
| - the command line assembler, compiler and linker;
| - compiler can't produce code greater than 8K except for making flash
|   applications (but you must pay 300$ for possibility of making
flashapps);
| - compiler library will include only TIOS calls (no stdio.h, no stdlib.h,
|   no sprites.h etc. like in TIGCCLIB 2.0);
| - the documentation, but I hope that soon I will have informations about
|   nearly all TIOS calls (look new doc with TIGCCLIB 2.0);
|
| Where is the emulator, where is IDE etc. in their SDK? And where is
| their SDK at all??? And 8K limit?????
|
| It seems that TI sucks. We can do it better than they can do...

Right!  Actually, when it comes out, I could probably add support for it in
my IDE.  But who cares?  With an 8K limit and without external libraries,
you can't do anything big.

BTW:  I found something in the ftp.ti.com archives.  I suppose that TIGCCLIB
is probably based on it, but I posted it anyway (see below).  I found it at
ftp://ftp.ti.com/pub/graph-ti/calc-apps/89/asm/.  There you will also find
another document about the ROM jump table.  Sorry if I'm just about the very
last person to find this out, but from my point of view, who knows, maybe
I'm the first.  It doesn't seem to be very complete, either.

Bye

Sebastian Reichelt

--------------------------------------------

// You must define either _92 or _89 depending
// on the platform you want to build for
// #define _89

#define _92

/*==========================================================================
====*/

#ifndef TRUE
#define TRUE  (1u)
#define FALSE (0u)
#endif

#define H_NULL       0

typedef unsigned char  BYTE;
typedef unsigned char  UCHAR;
typedef unsigned short BOOL;
typedef unsigned short WORD;
typedef unsigned short USHORT;
typedef unsigned int   UINT;
typedef unsigned long  DWORD;
typedef unsigned long  ULONG;
typedef signed char    SBYTE;
typedef signed char    SCHAR;
typedef signed short   SWORD;
typedef signed short   SSHORT;
typedef signed int     SINT;
typedef signed long    SDWORD;
typedef signed long    SLONG;

typedef unsigned short HANDLE;
/*==========================================================================
====*/

#define ValidateRect(r) assert(r.xy.x0 <= MAX_X && r.xy.x1 <= MAX_X &&  \
r.xy.y0 <= MAX_Y && r.xy.y1 <= MAX_Y && r.xy.x0 <= r.xy.x1 && r.xy.y0 <=
r.xy.y1 )
#define ValidateRectP(r) assert(r->xy.x0 <= MAX_X && r->xy.x1 <= MAX_X &&  \
r->xy.y0 <= MAX_Y && r->xy.y1 <= MAX_Y && r->xy.x0 <= r->xy.x1 && r->xy.y0
<= r->xy.y1 )
#define ValidateX(x) assert(x >= 0 && x <= MAX_X)
#define ValidateY(y) assert(y >= 0 && y <= MAX_Y)
#define ValidateFont(f) assert(f <= F_8x10)
typedef unsigned char SCR_COORDS;
#define BITMAP_HDR_SIZE   4

// #pragma pack(1)
typedef union {
struct {
  SCR_COORDS x0, y0;
  SCR_COORDS x1, y1;
} xy;
unsigned long l;
} SCR_RECT;
// #pragma pack()


#if defined(_92)
#define MAX_X 239
#define MAX_Y 127

#elif defined(_89)
#define MAX_X 159
#define MAX_Y 99

#else
#error Target product not defined
#endif

typedef signed short WIN_COORDS;

typedef struct {unsigned short i[16];} ICON;
typedef unsigned short *pICON;

// #pragma pack(1)

typedef struct {
  WORD NumRows;
  WORD NumCols;
  BYTE Data[1];  /* should be [] */
} BITMAP;
// #pragma pack()

typedef struct {
  WIN_COORDS x0, y0;
  WIN_COORDS x1, y1;
} WIN_RECT;

typedef struct {
  WIN_COORDS x0, y0;
} WIN_POINT;

enum Attrs { A_REVERSE=0, A_NORMAL=1, A_XOR, A_SHADED, A_REPLACE, A_OR,
      A_AND, A_THICK1, A_SHADE_V, A_SHADE_H, A_SHADE_NS, A_SHADE_PS };
enum BoxAddrs { B_NORMAL=0x10, B_ROUNDED=0x20, B_DOUBLE=0x40, B_CUT=0x80 };
enum Fonts { F_4x6, F_6x8, F_8x10 };

/*  Defines / Structures  */

#define WinEnd(w)
#define WinSetCursor(w,x,y) (w)->CursorX=x; (w)->CursorY=y
#define WinShow(w) (w)->Flags |= WF_VISIBLE

enum WinFlags { WF_SYS_ALLOC=0x0001, WF_STEAL_MEM=0x0002,
  WF_DONT_REALLOC=0x0004, WF_ROUNDEDBORDER=0x0008,
  WF_SAVE_SCR=0x0010, WF_DUP_SCR=0x0020, WF_TTY=0x0040,
  WF_ACTIVE=0x0080, WF_NOBORDER=0x0100, WF_NOBOLD=0x0200,
  WF_DUP_ON=0x0400, WF_VIRTUAL=0x0800, WF_TITLE=0x1000,
  WF_DIRTY=0x2000, WF_TRY_SAVE_SCR=0x4010, WF_VISIBLE=0x8000 };

typedef struct WindowStruct {
  WORD Flags;         /* WinFlags */
  BYTE CurFont;         /* Current font */
  BYTE CurAttr;         /* Current text/line attribute */
  BYTE Background;        /* Background attribute */
  SINT TaskId;         /* Task ID of owner */
  WIN_COORDS CurX, CurY;       /* Current X,Y position (window coordinates)
*/
  WIN_COORDS CursorX, CursorY; /* Cursor X,Y position */
  SCR_RECT Client;        /* Client region of window (excludes border) */
  SCR_RECT Window;        /* Window region (entire window inc border) */
  SCR_RECT Clip;        /* Current clipping region */
  SCR_RECT Port;        /* Port region for DUP_SCR */
  HANDLE DupScr;        /* Duplicated or saved screen area */
  struct WindowStruct *Next;   /* Windows kept in linked list */
  char *Title;         /* Optional title */
} WINDOW;

void ValidateWin( WINDOW *w );

WIN_COORDS WinWidth( WINDOW *w );
WIN_COORDS WinHeight( WINDOW *w );

/*==========================================================================
====*/


void WinActivate( WINDOW *w );
BYTE WinAttr( WINDOW *w, BYTE Attr );
void WinBackupToScr( WINDOW * w);
void WinBackground( WINDOW *w, BYTE Attr );
void WinBegin( WINDOW *w );
BOOL WinBitmapGet( WINDOW *w, const WIN_RECT *WinRect, BITMAP *Bitmap );
void WinBitmapPut( WINDOW *w, SWORD x0, SWORD y0, BITMAP *Bitmap, WORD
Attr);
WORD WinBitmapSize( WINDOW *w, const WIN_RECT WinRect );
void WinChar( WINDOW *w, char c );
void WinCharXY(WINDOW *w, WIN_COORDS x, WIN_COORDS y, char c, short Count );
void WinClose( WINDOW *w );
void WinClr( WINDOW *w );
void WinDeactivate( WINDOW *w );
void WinDupStat( WINDOW *w, BOOL Stat );
void WinEllipse( WINDOW *w, WIN_COORDS x0, WIN_COORDS y0, WIN_COORDS a0,
WIN_COORDS b0 );
void WinEnd( WINDOW *w );
void WinFill( WINDOW *w, const WIN_RECT r, BYTE Attr );
void WinFillLines2( WINDOW *w, const WIN_RECT *l0, const WIN_RECT *l1, BYTE
Attr );
void WinFillTriangle( WINDOW *w, WIN_COORDS ax, WIN_COORDS ay, WIN_COORDS
bx,
  WIN_COORDS by, WIN_COORDS cx, WIN_COORDS cy, BYTE Attr );
void WinFont( WINDOW *w, BYTE Font );
void WinGetCursor(WINDOW *w,WIN_COORDS*x,WIN_COORDS*y);
WIN_COORDS WinHeight( WINDOW *w );
void WinHide( WINDOW *w );
void WinHome( WINDOW *w );
void WinIcon( WINDOW *w, WIN_COORDS x0, WIN_COORDS y0, const WORD *Icon );
void WinLine( WINDOW *w, const WIN_RECT Line );
void WinLineNC( WINDOW *w, const WIN_RECT Line );
void WinLineRel( WINDOW *w, WIN_COORDS x0, WIN_COORDS y0 );
void WinLineTo( WINDOW *w, WIN_COORDS x0, WIN_COORDS y0 );
void WinMoveCursor( WINDOW *w, WIN_COORDS x, WIN_COORDS y );
void WinMoveRel( WINDOW *w, WIN_COORDS x0, WIN_COORDS y0 );
void WinMoveTo( WINDOW *w, WIN_COORDS x0, WIN_COORDS y0 );
BOOL WinOpen( WINDOW *w, const WIN_RECT r, WORD Flags, ... );
WORD WinPixGet( WINDOW *w, WIN_COORDS x0, WIN_COORDS y0 );
void WinPixSet( WINDOW *w, WIN_COORDS x0, WIN_COORDS y0 );
void WinRect( WINDOW *w, const WIN_RECT r, BYTE BoxAttr );
BOOL WinReOpen( WINDOW *w, const WIN_RECT *wr, WORD Flags, ... );

void WinScrollH( WINDOW *w, const WIN_RECT *r, SWORD NumCols );
void WinScrollV( WINDOW *w, const WIN_RECT *r, SWORD NumRows );
void WinStr( WINDOW *w, char *Str );
void WinStrXY( WINDOW *w, WIN_COORDS x, WIN_COORDS y, char *Str );


WIN_COORDS WinWidth( WINDOW *w );

/*==========================================================================
====*/

short FreeHandles( void );
HANDLE HeapAlloc( DWORD Hlen );
HANDLE HeapAllocHigh( DWORD Hlen );
HANDLE HeapAllocHighThrow( DWORD Hlen );
HANDLE HeapAllocThrow( DWORD Hlen );
DWORD HeapAvail( void );
void HeapCompress( void );
void HeapFree( HANDLE Handle );
void HeapFreeIndir( HANDLE *PtrHandle );
BOOL   HeapGetLock( HANDLE handle );
HANDLE HeapLock( HANDLE Handle );
DWORD HeapMax( void );
HANDLE HeapMoveHigh( HANDLE h );
HANDLE HeapRealloc( HANDLE Handle, WORD NewHsize );
WORD HeapSize( HANDLE Handle );
HANDLE HeapUnlock( HANDLE Handle );
void * Hlock( HANDLE h );
void * HeapDeref(HANDLE h);

/*==========================================================================
====*/

typedef (* const ProcPtr)(void);

#define ProcTableVector (200)


#define ASAP_init \
        ProcPtr * const ProcTable = *(ProcPtr **) ProcTableVector

#define ASAP_use_crt() \
        asm(" .cmnt "); ((char *)ProcTable)[0] = ((char *)ProcTable)[1];
asm(" .endc ")

//#define ASAP_versionCheck() \
//        if ((const long)ProcTable[-1] < ASAP_COUNT) ER_throw(ER_DIMENSION)

//#define ASAP_need(highest) \
//        if ((highest) >= (const long)ProcTable[-1]) ER_throw(ER_DIMENSION)

/* SETUP_PROC_TABLE is deprecated */
#define SETUP_PROC_TABLE \
        ProcPtr * const ProcTable = *(ProcPtr **) ProcTableVector

/* ASAPinit is deprecated */
#define ASAPinit() \
        asm(" .cmnt "); ((char *)ProcTable)[0] = ((char *)ProcTable)[1];
asm(" .endc ")

#ifndef _NOCALLBACK
#define _NOCALLBACK
DWORD NoCallBack(WORD a,DWORD b) {return 1;}
#endif

/*==========================================================================
====*/

typedef void (* const ProcPtr_24)(void);
typedef void (* const ProcPtr_135)(HANDLE);
typedef HANDLE (* const ProcPtr_190)(HANDLE);
typedef void (* const ProcPtr_206)(short);
typedef DWORD (* const ProcPtr_218)(void);
typedef DWORD (* const ProcPtr_219)(HANDLE);
typedef void (* const ProcPtr_220)(HANDLE *);
typedef HANDLE (* const ProcPtr_221)(DWORD);
typedef HANDLE (* const ProcPtr_222)(void const *);
typedef HANDLE (* const ProcPtr_223)(HANDLE,DWORD);
typedef void * (* const ProcPtr_224)(HANDLE);
typedef BOOL (* const ProcPtr_225)(HANDLE);
typedef short (* const ProcPtr_226)(void);
typedef void (* const ProcPtr_404)(WINDOW *);
typedef BYTE (* const ProcPtr_405)(WINDOW *,BYTE);
typedef void (* const ProcPtr_406)(WINDOW *,BYTE);
typedef BOOL (* const ProcPtr_407)(WINDOW *,const WIN_RECT *,BITMAP *);
typedef void (* const ProcPtr_408)(WINDOW *,SWORD,SWORD,BITMAP *,WORD);
typedef WORD (* const ProcPtr_409)(WINDOW *,const WIN_RECT *);
typedef void (* const ProcPtr_410)(WINDOW *,char);
typedef void (* const ProcPtr_411)(WINDOW
*,WIN_COORDS,WIN_COORDS,char,short);
typedef BOOL (* const ProcPtr_412)(WINDOW *,BOOL);
typedef void (* const ProcPtr_413)(WINDOW
*,WIN_COORDS,WIN_COORDS,WIN_COORDS,WIN_COORDS);
typedef void (* const ProcPtr_414)(WINDOW *,const WIN_RECT *,BYTE);
typedef void (* const ProcPtr_415)(WINDOW
*,WIN_COORDS,WIN_COORDS,WIN_COORDS,WIN_COORDS,WIN_COORDS,WIN_COORDS,BYTE);
typedef void (* const ProcPtr_416)(WINDOW *,const WIN_RECT *);
typedef void (* const ProcPtr_417)(WINDOW *,WIN_COORDS,WIN_COORDS);
typedef void (* const ProcPtr_418)(WINDOW *,WIN_COORDS *,WIN_COORDS *);
typedef void (* const ProcPtr_419)(WINDOW *,const WIN_RECT *,const WIN_RECT
*,BYTE);
typedef BOOL (* const ProcPtr_420)(WINDOW *,const WIN_RECT *,WORD,...);
typedef WORD (* const ProcPtr_421)(WINDOW *,WIN_COORDS,WIN_COORDS);
typedef void (* const ProcPtr_422)(WINDOW *,const WIN_RECT *,SWORD);
typedef void (* const ProcPtr_423)(WINDOW *,WIN_COORDS,WIN_COORDS,char *);
typedef void (* const ProcPtr_424)(WINDOW *,char *);
typedef void (* const ProcPtr_425)(WINDOW *,const SCR_RECT *);
typedef WIN_RECT * (* const ProcPtr_426)(const SCR_RECT *,WIN_RECT *);
typedef SCR_RECT * (* const ProcPtr_427)(SCR_RECT *);
typedef SCR_RECT * (* const ProcPtr_428)(const SCR_RECT *,const WIN_RECT
*,SCR_RECT *);
typedef WIN_RECT * (* const ProcPtr_429)(const SCR_RECT *);
typedef WIN_RECT * (* const ProcPtr_430)(SWORD,SWORD,SWORD,SWORD);
typedef SCR_RECT * (* const ProcPtr_431)(const SCR_RECT *,const SCR_RECT
*,short *);

//==========================================================================
=======

#define WinActivate ((ProcPtr_404)ProcTable[1])
#define WinAttr ((ProcPtr_405)ProcTable[2])
#define WinBackupToScr ((ProcPtr_404)ProcTable[3])
#define WinBackground ((ProcPtr_406)ProcTable[4])
#define WinBegin ((ProcPtr_404)ProcTable[5])
#define WinBitmapGet ((ProcPtr_407)ProcTable[6])
#define WinBitmapPut ((ProcPtr_408)ProcTable[7])
#define WinBitmapSize ((ProcPtr_409)ProcTable[8])
#define WinCharXY ((ProcPtr_411)ProcTable[9])
#define WinChar ((ProcPtr_410)ProcTable[10])
#define WinClose ((ProcPtr_404)ProcTable[11])
#define WinClr ((ProcPtr_404)ProcTable[12])
#define WinDeactivate ((ProcPtr_404)ProcTable[13])
#define WinDupStat ((ProcPtr_412)ProcTable[14])
#define WinEllipse ((ProcPtr_413)ProcTable[15])
#define WinFill ((ProcPtr_414)ProcTable[16])
#define WinFillLines2 ((ProcPtr_419)ProcTable[17])
#define WinFillTriangle ((ProcPtr_415)ProcTable[18])
#define WinFont ((ProcPtr_406)ProcTable[19])
#define WinGetCursor ((ProcPtr_418)ProcTable[20])
#define WinHide ((ProcPtr_404)ProcTable[21])
#define WinHome ((ProcPtr_404)ProcTable[22])
#define WinLine ((ProcPtr_416)ProcTable[23])
#define WinLineNC ((ProcPtr_416)ProcTable[24])
#define WinLineTo ((ProcPtr_417)ProcTable[25])
#define WinLineRel ((ProcPtr_417)ProcTable[26])
#define WinMoveCursor ((ProcPtr_417)ProcTable[27])
#define WinMoveTo ((ProcPtr_417)ProcTable[28])
#define WinMoveRel ((ProcPtr_417)ProcTable[29])
#define WinOpen ((ProcPtr_420)ProcTable[30])
#define WinPixGet ((ProcPtr_421)ProcTable[31])
#define WinPixSet ((ProcPtr_417)ProcTable[32])
#define WinRect ((ProcPtr_414)ProcTable[33])
#define WinReOpen ((ProcPtr_420)ProcTable[34])
#define WinScrollH ((ProcPtr_422)ProcTable[35])
#define WinScrollV ((ProcPtr_422)ProcTable[36])
#define WinStr ((ProcPtr_424)ProcTable[37])
#define WinStrXY ((ProcPtr_423)ProcTable[38])

#define FreeHandles ((ProcPtr_226)ProcTable[571])
#define HeapAvail ((ProcPtr_218)ProcTable[143])
#define HeapAlloc ((ProcPtr_221)ProcTable[144])
#define HeapAllocHigh ((ProcPtr_221)ProcTable[146])
#define HeapAllocThrow ((ProcPtr_221)ProcTable[147])
#define HeapAllocHighThrow ((ProcPtr_221)ProcTable[148])
#define HeapCompress ((ProcPtr_24)ProcTable[149])
#define HeapFree ((ProcPtr_135)ProcTable[151])
#define HeapFreeIndir ((ProcPtr_220)ProcTable[152])
#define HeapLock ((ProcPtr_190)ProcTable[154])
#define HLock ((ProcPtr_224)ProcTable[153])
#define HeapGetLock ((ProcPtr_225)ProcTable[155])
#define HeapMax ((ProcPtr_218)ProcTable[156])
#define HeapMoveHigh ((ProcPtr_190)ProcTable[160])
#define HeapRealloc ((ProcPtr_223)ProcTable[157])
#define HeapSize ((ProcPtr_219)ProcTable[158])
#define HeapUnlock ((ProcPtr_190)ProcTable[159])
#define HeapDeref ((ProcPtr_224)ProcTable[150])




References: