|
|
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:
1.1.1.11 root 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 */
1.1.1.10 root 26: #define SCREENBYTES_LINE (SCREENBYTES_LEFT+SCREENBYTES_MIDDLE+SCREENBYTES_RIGHT)
27: #define SCREENBYTES_MONOLINE 80 /* Byte per line in ST-high resolution */
28:
29: /* Overscan values */
1.1.1.12! root 30: #define OVERSCAN_TOP 29
! 31: #define MAX_OVERSCAN_BOTTOM 47 /* number of bottom lines to display on screen */
1.1.1.10 root 32:
33: /* Number of visible screen lines including top/bottom borders */
1.1.1.12! root 34: #define NUM_VISIBLE_LINES (OVERSCAN_TOP+200+MAX_OVERSCAN_BOTTOM)
1.1.1.10 root 35:
36:
1.1 root 37: /* Frame buffer, used to store details in screen conversion */
1.1.1.5 root 38: typedef struct
39: {
1.1.1.9 root 40: Uint16 HBLPalettes[(NUM_VISIBLE_LINES+1)*16]; /* 1x16 colour palette per screen line, +1 line as may write after line 200 */
41: Uint32 HBLPaletteMasks[NUM_VISIBLE_LINES+1]; /* Bit mask of palette colours changes, top bit set is resolution change */
42: Uint8 *pSTScreen; /* Copy of screen built up during frame (copy each line on HBL to simulate monitor raster) */
43: Uint8 *pSTScreenCopy; /* Previous frames copy of above */
44: int OverscanModeCopy; /* Previous screen overscan mode */
1.1.1.12! root 45: bool bFullUpdate; /* Set TRUE to cause full update on next draw */
1.1 root 46: } FRAMEBUFFER;
1.1.1.5 root 47:
1.1.1.6 root 48: /* Number of frame buffers (1 or 2) - should be 2 for supporting screen flipping */
49: #define NUM_FRAMEBUFFERS 2
1.1 root 50:
51:
1.1.1.11 root 52: /* ST/TT 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,
1.1.1.11 root 58: TT_MEDIUM_RES = 4,
59: TT_HIGH_RES = 6,
60: TT_LOW_RES
1.1 root 61: };
1.1.1.11 root 62: #define ST_MEDIUM_RES_BIT 0x1
63: #define ST_RES_MASK 0x3
1.1 root 64:
65: /* Update Palette defines */
1.1.1.5 root 66: enum
67: {
1.1 root 68: UPDATE_PALETTE_NONE,
69: UPDATE_PALETTE_UPDATE,
70: UPDATE_PALETTE_FULLUPDATE
71: };
72:
73: /* Palette mask values for 'HBLPaletteMask[]' */
74: #define PALETTEMASK_RESOLUTION 0x00040000
1.1.1.2 root 75: #define PALETTEMASK_PALETTE 0x0000ffff
76: #define PALETTEMASK_UPDATERES 0x20000000
77: #define PALETTEMASK_UPDATEPAL 0x40000000
1.1 root 78: #define PALETTEMASK_UPDATEFULL 0x80000000
79: #define PALETTEMASK_UPDATEMASK (PALETTEMASK_UPDATEFULL|PALETTEMASK_UPDATEPAL|PALETTEMASK_UPDATERES)
80:
81: /* Overscan values */
1.1.1.5 root 82: enum
83: {
1.1.1.2 root 84: OVERSCANMODE_NONE, /* 0x00 */
85: OVERSCANMODE_TOP, /* 0x01 */
86: OVERSCANMODE_BOTTOM /* 0x02 (Top+Bottom) 0x03 */
1.1 root 87: };
88:
1.1.1.2 root 89: /* Available fullscreen modes */
90: #define NUM_DISPLAYMODEOPTIONS 6
1.1.1.5 root 91: enum
92: {
1.1.1.7 root 93: DISPLAYMODE_LOWCOL_LOWRES, /* low color, low resolution (fastest) */
94: DISPLAYMODE_LOWCOL_HIGHRES, /* low color, zoomed resolution */
95: DISPLAYMODE_LOWCOL_DUMMY, /* unused */
96: DISPLAYMODE_HICOL_LOWRES, /* high color, low resolution */
97: DISPLAYMODE_HICOL_HIGHRES, /* high color, zoomed resolution (slowest) */
98: DISPLAYMODE_HICOL_DUMMY /* unused */
1.1.1.2 root 99: };
100:
101:
1.1.1.12! root 102: extern bool bGrabMouse;
! 103: extern bool bInFullScreen;
1.1.1.11 root 104: extern int nScreenZoomX, nScreenZoomY;
105: extern int nBorderPixelsLeft, nBorderPixelsRight;
1.1.1.9 root 106: extern int STScreenStartHorizLine;
107: extern int STScreenLeftSkipBytes;
108: extern FRAMEBUFFER *pFrameBuffer;
109: extern Uint8 *pSTScreen;
1.1.1.3 root 110: extern SDL_Surface *sdlscrn;
1.1.1.9 root 111: extern Uint32 STRGBPalette[16];
112: extern Uint32 ST2RGB[4096];
1.1 root 113:
114: extern void Screen_Init(void);
115: extern void Screen_UnInit(void);
116: extern void Screen_Reset(void);
117: extern void Screen_SetFullUpdate(void);
118: extern void Screen_EnterFullScreen(void);
119: extern void Screen_ReturnFromFullScreen(void);
1.1.1.11 root 120: extern void Screen_ModeChanged(void);
1.1.1.12! root 121: extern bool Screen_Draw(void);
1.1.1.3 root 122:
1.1.1.5 root 123: #endif /* ifndef HATARI_SCREEN_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.