#ifndef __TYPES__ #include #endif #ifndef __GTE__ #define __GTE__ /* Tool Number */ #define GTE_TOOLNUM 0x0085 /* GetAddress constants */ #define oamAddr 0 #define leftEdgeAddr 1 #define rightEdgeAddr 2 /* GTE tool error codes (lest significant byte) */ #define gteBadTileWidth 0x0003 #define gteBadTileHeight 0x0004 #define gteBadAddress 0x0005 #define gteBadFieldWidth 0x0006 #define gteBadFieldHeight 0x0007 #define gteBadData 0x0008 #define gteNotImplemented 0x00FF /* Sprite structure */ typedef struct { Word height; /* Height of sprite in pixels */ Word width; /* Width of sprite in pixels */ Word offsets[8]; /* Offsets to the sprite procs */ Word type; Word flags; Word size; } GTESprite, *GTESpritePtr; /* Object Attribute Memory (OAM) structure */ typedef struct { Word xpos; /* Horizontal position */ Word ypos; /* Vertical position */ Word flags; /* Dynamic flags */ GTESpritePtr sprite; /* The sprite pointer */ } OAMEntry, *OAMEntryPtr; /* MasterMode defines */ #define fWidth4 0x0000 #define fWidth8 0x0001 #define fWidth16 0x0002 #define fHeight4 0x0000 #define fHeight8 0x0004 #define fHeight16 0x0008 #define fModeBG1 0x0080 /* Use the second background */ #define fModeMask 0x0040 /* Use the scrolling mask layer */ #define fModeAnimated 0x0020 /* Use the animated BG0 tiles */ #define fModeStatic 0x0010 /* Use the static layer */ #define masterWidthBits 0x0003 #define masterHeightBits 0x000C /* Sprite Compilation Flags */ #define fNoHFlip 0x0002 #define fNoVFlip 0x0004 #define fNoPriority 0x0008 /* Do not clip against the field mask */ #define fNoMask 0x0010 /* Do not clip against the screen (DANGEROUS) */ /* Tile flags */ #define fTileFringe 0x0800 #define fTileAnim 0x1000 #define fTilePriority 0x2000 #define fTileHFlip 0x4000 #define fTileVFlip 0x8000 /* user tool dispatcher */ #define usertool 0xE10008L extern pascal void GTEBootInit(void) inline(0x0185, usertool); extern pascal void GTEStartUp(Word dPageAddr, Word masterMode, Word userID) inline(0x0285, usertool); extern pascal void GTEShutDown(void) inline(0x0385, usertool); extern pascal Word GTEVersion(void) inline(0x0485, usertool); extern pascal void GTEReset(void) inline(0x0585, usertool); extern pascal Boolean GTEStatus(void)inline(0x0685, usertool); extern pascal Long GTEGetAddress(Word tableID) inline(0x0985, usertool); extern pascal void GTESetFieldRect(Rect *rectPtr) inline(0x0A85, usertool); extern pascal void GTEGetFieldRect(Rect *rectPtr) inline(0x0B85, usertool); extern pascal Handle GTENewSprite(LocInfoPtr ptrToDataLocInfo, RectPtr ptrToDataRect, LocInfoPtr ptrToMaskLocInfo, RectPtr ptrToMaskRect, Word spriteFlags) inline(0x0C85, usertool); extern pascal void GTEDisposeSprite(Handle spriteHndl) inline(0x0D85, usertool); extern pascal Word GTEToolNum(void) inline(0x0E85, usertool); extern pascal Handle GTENewTile(LocInfoPtr ptrToDataLocInfo, Point *ptrToDataLoc, LocInfoPtr ptrToMaskLocInfo, Point *ptrToMaskLoc) inline(0x0F85, usertool); extern pascal void GTEDisposeTile(Handle tileHndl) inline(0x1085, usertool); extern pascal void GTESetTile(Handle tileHndl, Word tileID) inline(0x1185, usertool); extern pascal Handle GTEGetTile(Word tileID) inline(0x1285, usertool); extern pascal void GTESetBGColor(Word color) inline(0x1385, usertool); extern pascal void GTESetBG0TileMap(Pointer mapPtr, Word mapHeight, Word mapWidth) inline(0x1485, usertool); extern pascal void GTESetBG0Origin(Word xOrigin, Word yOrigin) inline(0x1585, usertool); extern pascal void GTEUpdate(Word flags) inline(0x1685, usertool); extern pascal void GTERefreshBG0(Word top, Word left, Word bottom, Word right) inline(0x1785, usertool); extern pascal void GTEShadowOn(void) inline(0x1885, usertool); extern pascal void GTEShadowOff(void) inline(0x1985, usertool); extern pascal void GTESetBG0FringeMap(Pointer mapPtr) inline(0x1A85, usertool); extern pascal void GTECopyToBG0(LocInfoPtr locinfo, Word x, Word y) inline(0x1B85, usertool); /*** Internal Debugging ***** * * This structure defines all the direct page variables */ typedef struct { Word userId; /* user Id for memory manager */ Word masterMode; /* mode of the engine */ Word tileCapMask; /* enabled tile features */ Rect field; /* Rect defining the size of the playing */ /* field. The width must be even. */ Word fieldBlockWidth; /* Width and height in blocks */ Word fieldBlockHeight; Rect visible; /* Rect defining the size of the visible */ /* portion of the playing field */ Word fieldIsVisible; /* Boolean. Is a portion of the field visible? */ Word tileByteWidth; Word tileLineHeight; Word tileByteSize; Handle shrHndl; Handle bufrHndl; Word bgndColor; Word noBgndColor; Pointer palettePtr; Point bg0Origin; /* Origin point of the BG0 buffer */ Point bg0Block; Word bg0Xmod168; Word bg0Ymod224; Word bg0MaskAddr; Word bg0MaskOffset; Point bg1Origin; /* Origin point of the BG0 buffer */ Point bg1Block; Word bg1Xmod168; Word bg1Ymod224; Pointer bg0TileMap; Word bg0MapWidth; Word bg0MapHeight; Pointer bg0FringeMap; Pointer bg1TileMap; Word bg1MapWidth; Word bg1MapHeight; Pointer bg1FringeMap; Word tileModMaskX; Word tileModMaskY; Word invModMaskX; Word invModMaskY; } DPVars; /* Define the variables in the blitter */ typedef struct { Pointer bg0RtnAddr; /* Return address from BG0 code */ Pointer bg0EntryAddr; /* Entry the BG0 Field here */ Pointer staticEntry; Word visWidth; /* Width of the visible field in bytes */ Word line; /* Current scanline */ Pointer instPtr; /* Instruction point to BG0 */ Pointer instPtr2; /* Instruction point to BG0 */ Word bg0YTblPtr; /* Bank Address of BG0 YTable */ Word bg1YTblPtr; /* Bank Address of YTable */ Word staticPtr; /* Bank Address of static field YTable */ Word dynAddrPtr; /* Bank Address of Dynamic field */ Pointer blitFieldPtr; Pointer staticBuffer; Word mode; } BlitterVars; #endif