|
|
1.1 root 1: /* 1.1.1.5 ! root 2: Hatari - screen.h ! 3: ! 4: This file is distributed under the GNU Public License, version 2 or at your ! 5: option any later version. Read the file gpl.txt for details. 1.1 root 6: */ 7: 1.1.1.5 ! root 8: #ifndef HATARI_SCREEN_H ! 9: #define HATARI_SCREEN_H 1.1.1.3 root 10: 11: #include <SDL_video.h> /* for SDL_Surface */ 12: 1.1 root 13: 14: /* Frame buffer, used to store details in screen conversion */ 1.1.1.5 ! root 15: typedef struct ! 16: { 1.1 root 17: unsigned short int HBLPalettes[(NUM_VISIBLE_LINES+1)*16]; /* 1x16 colour palette per screen line, +1 line as may write after line 200 */ 18: unsigned long HBLPaletteMasks[NUM_VISIBLE_LINES+1]; /* Bit mask of palette colours changes, top bit set is resolution change */ 19: unsigned char *pSTScreen; /* Copy of screen built up during frame(copy each line on HBL to simulate monitor raster) */ 20: unsigned char *pSTScreenCopy; /* Previous frames copy of above */ 21: int OverscanModeCopy; /* Previous screen overscan mode */ 22: BOOL bFullUpdate; /* Set TRUE to cause full update on next draw */ 23: } FRAMEBUFFER; 1.1.1.5 ! root 24: ! 25: /* WinSTon used NUM_FRAMEBUFFERS=2, but =1 seems to be working better in Hatari... */ ! 26: #define NUM_FRAMEBUFFERS 1 1.1 root 27: 28: /* Details for each display screen - both Window and FullScreen */ 1.1.1.5 ! root 29: typedef struct ! 30: { 1.1 root 31: int STScreenLeftSkipBytes,STScreenWidthBytes; /* Bytes to skip on left and number of bytes of screen to draw */ 32: int STScreenStartHorizLine,STScreenEndHorizLine; /* Start/End points in ST screen(28 is top of normal screen) */ 33: int PCStartHorizLine,PCStartXOffset; /* Source ST lines/bytes to skip, Destination screen lines/bytes to skip */ 34: } SCREENDRAW_OVERSCAN; 35: 1.1.1.5 ! root 36: typedef struct ! 37: { 1.1 root 38: void *pDrawFunction; /* Draw function */ 39: /*int DirectDrawMode;*/ /* Mode required for DirectDraw. eg MODE_320x200x256 */ 40: int Width,Height,BitDepth,VertPixelsPerLine; 41: SCREENDRAW_OVERSCAN Overscan[4]; /* Details for starting offset for each overscan mode(none,top,bottom,both) */ 42: } SCREENDRAW; 43: 1.1.1.5 ! root 44: typedef struct ! 45: { 1.1 root 46: SCREENDRAW *pLowRes, *pAltLowRes; 47: SCREENDRAW *pMediumRes, *pAltMediumRes; 48: SCREENDRAW *pHighRes, *pAltHighRes; 49: SCREENDRAW *pLowMediumMixRes, *pAltLowMediumMixRes; 50: } SCREENDRAW_DISPLAYOPTIONS; 51: 52: /* ST Resolution defines */ 1.1.1.5 ! root 53: enum ! 54: { 1.1 root 55: ST_LOW_RES, 56: ST_MEDIUM_RES, 57: ST_HIGH_RES, 58: ST_LOWMEDIUM_MIX_RES 59: }; 60: 61: /* Update Palette defines */ 1.1.1.5 ! root 62: enum ! 63: { 1.1 root 64: UPDATE_PALETTE_NONE, 65: UPDATE_PALETTE_UPDATE, 66: UPDATE_PALETTE_FULLUPDATE 67: }; 68: 69: /* Palette mask values for 'HBLPaletteMask[]' */ 70: #define PALETTEMASK_RESOLUTION 0x00040000 1.1.1.2 root 71: #define PALETTEMASK_PALETTE 0x0000ffff 72: #define PALETTEMASK_UPDATERES 0x20000000 73: #define PALETTEMASK_UPDATEPAL 0x40000000 1.1 root 74: #define PALETTEMASK_UPDATEFULL 0x80000000 75: #define PALETTEMASK_UPDATEMASK (PALETTEMASK_UPDATEFULL|PALETTEMASK_UPDATEPAL|PALETTEMASK_UPDATERES) 76: 77: /* Overscan values */ 1.1.1.5 ! root 78: enum ! 79: { 1.1.1.2 root 80: OVERSCANMODE_NONE, /* 0x00 */ 81: OVERSCANMODE_TOP, /* 0x01 */ 82: OVERSCANMODE_BOTTOM /* 0x02 (Top+Bottom) 0x03 */ 1.1 root 83: }; 84: 1.1.1.2 root 85: /* Available fullscreen modes */ 86: #define NUM_DISPLAYMODEOPTIONS 6 1.1.1.5 ! root 87: enum ! 88: { ! 89: DISPLAYMODE_16COL_LOWRES, /* (fastest) */ ! 90: DISPLAYMODE_16COL_HIGHRES, ! 91: DISPLAYMODE_16COL_FULL, ! 92: DISPLAYMODE_HICOL_LOWRES, ! 93: DISPLAYMODE_HICOL_HIGHRES, ! 94: DISPLAYMODE_HICOL_FULL /* (slowest) */ 1.1.1.2 root 95: }; 96: 97: 1.1 root 98: /* For palette we don't go from colour '0' as the whole background would change, so go from this value */ 99: #define BASECOLOUR 0x0A 100: #define BASECOLOUR_LONG 0x0A0A0A0A 101: 102: extern SCREENDRAW ScreenDrawWindow[4]; 103: extern SCREENDRAW ScreenDrawFullScreen[4]; 104: extern FRAMEBUFFER *pFrameBuffer; 105: extern unsigned char *pScreenBitmap; 106: extern unsigned char *pSTScreen,*pSTScreenCopy; 107: extern unsigned char *pPCScreenDest; 108: extern int STScreenStartHorizLine,STScreenEndHorizLine; 109: extern int PCScreenBytesPerLine,STScreenWidthBytes,STScreenLeftSkipBytes; 110: extern BOOL bInFullScreen; 111: extern BOOL bFullScreenHold; 112: extern BOOL bScreenContentsChanged; 113: extern int STRes,PrevSTRes; 114: extern int STScreenLineOffset[NUM_VISIBLE_LINES]; 115: extern unsigned long STRGBPalette[16]; 116: extern unsigned long ST2RGB[2048]; 1.1.1.3 root 117: extern SDL_Surface *sdlscrn; 1.1.1.4 root 118: extern BOOL bGrabMouse; 1.1 root 119: 120: extern void Screen_Init(void); 121: extern void Screen_UnInit(void); 122: extern void Screen_Reset(void); 123: extern void Screen_SetScreenLineOffsets(void); 124: extern void Screen_SetFullUpdate(void); 1.1.1.4 root 125: extern void Screen_SetupRGBTable(void); 1.1 root 126: extern void Screen_EnterFullScreen(void); 127: extern void Screen_ReturnFromFullScreen(void); 1.1.1.2 root 128: extern void Screen_ClearScreen(void); 1.1 root 129: extern void Screen_SetDrawModes(void); 1.1.1.4 root 130: extern void Screen_Handle8BitPalettes(void); 1.1 root 131: extern void Screen_Blit(BOOL bSwapScreen); 132: extern void Screen_DrawFrame(BOOL bForceFlip); 133: extern void Screen_Draw(void); 1.1.1.3 root 134: 1.1.1.5 ! root 135: #endif /* ifndef HATARI_SCREEN_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.