//Bibliothèques de fonctions graphique avancé //Ecran virtuel #define ScreenBuffer_WIDTH 240 #define ScreenBuffer_HEIGHT 200 #define ScreenBuffer_WIDTH2 239 #define ScreenBuffer_HEIGHT2 199 #define ScreenBuffer_SIZE 12000 #define ScreenBuffer_SIZEPLAN 6000 #define GAME_WIDTH 216 //223 #define GAME_WIDTH2 215 //222 #define GAME_HEIGHT 200 #define GAME_HEIGHT2 199 #define START_X 8 #define START_Y 8 #define GAME_MAX_WIDTH 224 #define FRAMESKIP 0 static unsigned char COUNTER_FRAMESKIP=0; //Buffers static unsigned char BufferSprite8_0[9]={}; static unsigned char BufferSprite8_1[9]={}; //static unsigned short BufferSprite16_0[16]={}; //static unsigned short BufferSprite16_1[16]={}; static unsigned long BufferSprite32_0[9]={}; static unsigned long BufferSprite32_1[9]={}; //Ecran virtuel comprenant 2 plans void *ScreenBuffer=NULL; //Fonctions graphique optimisé void FastGraySprite8_OR_R( register short x asm("%d0"), register short y asm("%d1"), register short h asm("%d2"), register char *sprt asm("%a1"), register void *dest asm("%a0")); void FastGraySprite8_MASK_R( register short x asm("%d0"), register short y asm("%d1"), register short h asm("%d2"), register char *sprt asm("%a1"), register void *dest asm("%a0")); void FastGraySprite16_OR_R( register short x asm("%d0"), register short y asm("%d1"), register short h asm("%d2"), register short *sprt asm("%a1"), register void *dest asm("%a0")); void FastGraySprite16_MASK_R( register short x asm("%d0"), register short y asm("%d1"), register short h asm("%d2"), register short *sprt asm("%a1"), register void *dest asm("%a0")); void FastGraySprite32_OR_R( register short x asm("%d0"), register short y asm("%d1"), register short h asm("%d2"), register long *sprt asm("%a1"), register void *dest asm("%a0")); void FastGraySprite32_MASK_R( register short x asm("%d0"), register short y asm("%d1"), register short h asm("%d2"), register long *sprt asm("%a1"), register void *dest asm("%a0")); //Scrolling //Copie une zone de 240x128 sur l'écran void CopyScreenBufferToScreen (register short x asm("%d0"), register short y asm("%d1"), register void *src asm("%a0"), register void *dest1 asm("%a2"), register void *dest2 asm("%a3")); //Copie directement 240x200 pixels à l'écran avec un dézoom TI92+ void CopyScreenBufferToScreen2 (register void *src asm("%a0"), register void *dest1 asm("%a2"), register void *dest2 asm("%a3")); //Copie directement 224x200 pixels à l'écran avec un dézoom TI89 void CopyScreenBufferToScreen3 (register void *src asm("%a0"), register void *dest1 asm("%a1"), register void *dest2 asm("%a2")); //Copie mode Scrolling sur TI89 void CopyScreenBufferToScreen4 (register short x asm("%d0"), register short y asm("%d1"), register void *src asm("%a0"), register void *dest1 asm("%a2"), register void *dest2 asm("%a3")); //Copie 240x128 en 160x100 pour TI89 void CopyScreenBufferToScreen5 (register void *src asm("%a0"), register void *dest1 asm("%a1"), register void *dest2 asm("%a2")); //Efface ScreenBuffer void ClearScreenBuffer (register void *buffer asm("%a0")); //Remplie en noire void BlackScreenBuffer (register void *buffer asm("%a0")); //Dessine le décors (tout l'écran) void DrawScreen (register long *sprt asm("%a0"), register void *dest asm("%a1")); //Dessine décors manquante entre 136 et 200 void DrawScreen2 (register long *sprt asm("%a0"), register void *dest asm("%a1")); //Dessine décors entre 136 et 193 void DrawScreen3 (register long *sprt asm("%a0"), register void *dest asm("%a1")); //Ombre void DrawScreenShadow (register void *dest asm("%a0")); //Dessine barres UP void DrawSquareUp (register unsigned char *sprt1 asm("%a2"), register unsigned char *sprt2 asm("%a3"), register unsigned char *sprt3 asm("%a4"), register unsigned long *sprt4 asm("%a5"), register void *dest asm("%a0")); //Dessine barres SIDE void DrawSquareSide (register unsigned char *sprt asm("%a2"), register void *dest asm("%a0")); //Dessine Block valeur absolue void _DrawBlock (register short x asm("%d0"), register short y asm("%d1"), register void *sprite asm("%a0"), register void *dest asm("%a1"), register unsigned char shadow asm("%d3")); //Dessine que plan0 du Block void DrawBlock2 (register short x asm("%d0"), register short y asm("%d1"), register void *sprite asm("%a0"), register void *dest asm("%a1")); //Dessine Block sans ombres void DrawBlockNoShadow (register short x asm("%d0"), register short y asm("%d1"), register void *sprite asm("%a0"), register void *dest asm("%a1")); //Dessine Block spécial MOVE void DrawBlockMove (register short x asm("%d0"), register short y asm("%d1"), register void *sprite asm("%a1"), register void *dest asm("%a0")); //Dessine un bout du décors void DrawSmallBackground (register short x asm("%d0"), register short y asm("%d1"), register unsigned short offset asm("%d2"), register void *sprite asm("%a0"), register void *dest asm("%a1")); //Copie un sprite de 32x32 dans un buffer de 64x64 void CopyDecorsBlocks (register void *sprite asm("%a0"), register void *dest asm("%a1")); //Dessine une simple ombre taille 8x void _DrawSmallShadowBlock (register short x asm("%d0"), register short y asm("%d1"), register void *dest asm("%a0")); //Effet d'ombres avec sprites 16x void _DrawSprite16_SHADOW (register short x asm("%d0"), register short y asm("%d1"), register short h asm("%d2"), register short *sprt asm("%a1"), register void *dest asm("%a0")); //Effet d'ombres avec sprites 32x void _DrawSprite32_SHADOW (register short x asm("%d0"), register short y asm("%d1"), register short h asm("%d2"), register void *sprite asm("%a1"), register void *dest asm("%a0")); //Effet d'ombres avec sprites 8x void _DrawSprite8_SHADOW (register short x asm("%d0"), register short y asm("%d1"), register short h asm("%d2"), register void *sprite asm("%a1"), register void *dest asm("%a0")); //Copie le contenu de l'écran dans BufferLifes void CopyScreenToBufferLifes (register void *src asm("%a0"), register void *dest asm("%a1")); //Copie contenu de BufferLifes à l'écran void CopyBufferLifesToScreen (register void *src asm("%a0"), register void *dest asm("%a1")); //Dessine bonus (Sprite 16x masque en paramètre) void DrawBonus (register short x asm("%d0"), register short y asm("%d1"), register short h asm("%d2"), register void *sprite asm("%a1"), register void *mask asm("%a2"), register void *dest asm("%a0")); //Dessine ombre Bonus void _DrawBonusShadow (register short x asm("%d0"), register short y asm("%d1"), register short h asm("%d2"), register void *sprite asm("%a1"), register void *dest asm("%a0")); //Dessine Fleche void DrawFleche (register short x asm("%d0"), register short y asm("%d1"), register short h asm("%d2"), register void *sprite asm("%a1"), register void *mask asm("%a2"), register void *dest asm("%a0")); //Copie MASK Sprite8 dans Buffer void CopySprite8_8 (register void *src asm("%a0"), register void *dest asm("%a1"), register short h asm("%d2"), register short h2 asm("%d3")); //Copie MASK Sprite8 dans Buffer de 16 void CopySprite8_16 (register void *src asm("%a0"), register void *dest asm("%a1"), register short h asm("%d2"), register short h2 asm("%d3")); //Copie MASK Sprite8 dans Buffer de 32 void CopySprite8_32 (register void *src asm("%a0"), register void *dest asm("%a1"), register short h asm("%d2"), register short h2 asm("%d3")); //Copie MASK Sprite16 dans Buffer de 16 void CopySprite16_16 (register void *src asm("%a0"), register void *dest asm("%a1"), register short h asm("%d2"), register short h2 asm("%d3")); //Copie MASK Sprite16 dans Buffer de 32 void CopySprite16_32 (register void *src asm("%a0"), register void *dest asm("%a1"), register short h asm("%d2"), register short h2 asm("%d3")); //Copie MASK Sprite32 dans Buffer de 32 void CopySprite32_32 (register void *src asm("%a0"), register void *dest asm("%a1"), register short h asm("%d2"), register short h2 asm("%d3")); //Test de collision entre sprite de 8 pixels short CollideSprite8 (register short x0 asm ("%d0"), register short y0 asm ("%d1"), register short x1 asm ("%d2"), register short y1 asm ("%d3"), register short h asm ("%d4"), register void *sprite0 asm ("%a0"), register void *sprite1 asm ("%a1")); //Test de collision entre sprite de 16 pixels short CollideSprite16 (register short x0 asm ("%d0"), register short y0 asm ("%d1"), register short x1 asm ("%d2"), register short y1 asm ("%d3"), register short h asm ("%d4"), register void *sprite0 asm ("%a0"), register void *sprite1 asm ("%a1")); //Test de collision entre sprite de 32 pixels short CollideSprite32 (register short x0 asm ("%d0"), register short y0 asm ("%d1"), register short x1 asm ("%d2"), register short y1 asm ("%d3"), register short h asm ("%d4"), register void *sprite0 asm ("%a0"), register void *sprite1 asm ("%a1")); //Dessine Logo void DrawLogo (register void *sprite asm("%a0"), register void *dest asm("%a1")); //Dessine EndDoors void DrawEndDoors (register void *sprite asm("%a0"), register void *dest asm("%a1")); //Dessine pleine image de 240x128 pixels void DrawFullPicture0 (register void *img asm("%a0"), register void *dest asm("%a1")); //Dessine pleine image de 160x100 pixels void DrawFullPicture1 (register void *img asm("%a0"), register void *dest asm("%a1")); //Dessine image Introduction0 pour TI92+/V200 void DrawIntro0_Picture0 (register void *img asm("%a0"), register void *dest asm("%a1")); //Dessine image Introduction0 pour TI89 void DrawIntro0_Picture1 (register void *img asm("%a0"), register void *dest asm("%a1")); //Dessine un sprite à une position absolue et de taille absolue void DrawAbsSprite (register short x asm("%d0"), register short y asm("%d1"), register short w asm("%d2"), register short h asm("%d3"), register void *sprite asm("%a1"), register void *dest asm("%a0"));