|
|
1.1 ! root 1: /* ! 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. ! 6: */ ! 7: ! 8: #ifndef HATARI_SCREEN_H ! 9: #define HATARI_SCREEN_H ! 10: ! 11: #include <SDL_video.h> /* for SDL_Surface */ ! 12: ! 13: ! 14: /* The 'screen' is a representation of the ST video memory */ ! 15: /* taking into account all the border tricks. Data are stored */ ! 16: /* in 'planar' format (1 word per plane) and are then converted */ ! 17: /* to an SDL buffer that will be displayed. */ ! 18: /* So, all video lines are converted to a unique line of */ ! 19: /* SCREENBYTES_LINE bytes in planar format. */ ! 20: /* SCREENBYTES_LINE should always be a multiple of 8. */ ! 21: ! 22: /* left/right borders must be multiple of 8 bytes */ ! 23: #define SCREENBYTES_LEFT (nBorderPixelsLeft/2) /* Bytes for left border */ ! 24: #define SCREENBYTES_MIDDLE 160 /* Middle (320 pixels) */ ! 25: #define SCREENBYTES_RIGHT (nBorderPixelsRight/2) /* Right border */ ! 26: #define SCREENBYTES_LINE (SCREENBYTES_LEFT+SCREENBYTES_MIDDLE+SCREENBYTES_RIGHT) ! 27: #define SCREENBYTES_MONOLINE 80 /* Byte per line in ST-high resolution */ ! 28: ! 29: ! 30: ! 31: /* Frame buffer, used to store details in screen conversion */ ! 32: typedef struct ! 33: { ! 34: Uint8 *pNEXTScreen; /* Copy of screen built up during frame (copy each line on HBL to simulate monitor raster) */ ! 35: Uint8 *pNEXTScreenCopy; /* Previous frames copy of above */ ! 36: bool bFullUpdate; /* Set TRUE to cause full update on next draw */ ! 37: } FRAMEBUFFER; ! 38: ! 39: /* Number of frame buffers (1 or 2) - should be 2 for supporting screen flipping */ ! 40: #define NUM_FRAMEBUFFERS 2 ! 41: ! 42: ! 43: /* ST/TT resolution defines */ ! 44: enum ! 45: { ! 46: ST_HIGH_RES, ! 47: }; ! 48: #define ST_MEDIUM_RES_BIT 0x1 ! 49: #define ST_RES_MASK 0x3 ! 50: ! 51: /* Update Palette defines */ ! 52: enum ! 53: { ! 54: UPDATE_PALETTE_NONE, ! 55: UPDATE_PALETTE_UPDATE, ! 56: UPDATE_PALETTE_FULLUPDATE ! 57: }; ! 58: ! 59: /* Palette mask values for 'HBLPaletteMask[]' */ ! 60: #define PALETTEMASK_RESOLUTION 0x00040000 ! 61: #define PALETTEMASK_PALETTE 0x0000ffff ! 62: #define PALETTEMASK_UPDATERES 0x20000000 ! 63: #define PALETTEMASK_UPDATEPAL 0x40000000 ! 64: #define PALETTEMASK_UPDATEFULL 0x80000000 ! 65: #define PALETTEMASK_UPDATEMASK (PALETTEMASK_UPDATEFULL|PALETTEMASK_UPDATEPAL|PALETTEMASK_UPDATERES) ! 66: ! 67: /* Overscan values */ ! 68: enum ! 69: { ! 70: OVERSCANMODE_NONE, /* 0x00 */ ! 71: OVERSCANMODE_TOP, /* 0x01 */ ! 72: OVERSCANMODE_BOTTOM /* 0x02 (Top+Bottom) 0x03 */ ! 73: }; ! 74: ! 75: /* Available fullscreen modes */ ! 76: #define NUM_DISPLAYMODEOPTIONS 6 ! 77: enum ! 78: { ! 79: DISPLAYMODE_LOWCOL_LOWRES, /* low color, low resolution (fastest) */ ! 80: DISPLAYMODE_LOWCOL_HIGHRES, /* low color, zoomed resolution */ ! 81: DISPLAYMODE_LOWCOL_DUMMY, /* unused */ ! 82: DISPLAYMODE_HICOL_LOWRES, /* high color, low resolution */ ! 83: DISPLAYMODE_HICOL_HIGHRES, /* high color, zoomed resolution (slowest) */ ! 84: DISPLAYMODE_HICOL_DUMMY /* unused */ ! 85: }; ! 86: ! 87: ! 88: extern bool bGrabMouse; ! 89: extern bool bInFullScreen; ! 90: extern int nScreenZoomX, nScreenZoomY; ! 91: extern int nBorderPixelsLeft, nBorderPixelsRight; ! 92: extern int NEXTScreenStartHorizLine; ! 93: extern int NEXTScreenLeftSkipBytes; ! 94: extern FRAMEBUFFER *pFrameBuffer; ! 95: extern Uint8 pNEXTScreen[(1120*832)*2]; ! 96: extern SDL_Surface *sdlscrn; ! 97: extern Uint32 STRGBPalette[16]; ! 98: extern Uint32 ST2RGB[4096]; ! 99: ! 100: extern void Screen_Init(void); ! 101: extern void Screen_UnInit(void); ! 102: extern void Screen_Reset(void); ! 103: extern void Screen_SetFullUpdate(void); ! 104: extern void Screen_EnterFullScreen(void); ! 105: extern void Screen_ReturnFromFullScreen(void); ! 106: extern void Screen_ModeChanged(void); ! 107: extern bool Screen_Draw(void); ! 108: ! 109: #endif /* ifndef HATARI_SCREEN_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.