--- hatari/src/includes/screen.h 2019/04/01 07:13:38 1.1.1.11 +++ hatari/src/includes/screen.h 2019/04/09 08:53:08 1.1.1.15 @@ -1,8 +1,8 @@ /* Hatari - screen.h - This file is distributed under the GNU Public License, version 2 or at your - option any later version. Read the file gpl.txt for details. + This file is distributed under the GNU General Public License, version 2 + or at your option any later version. Read the file gpl.txt for details. */ #ifndef HATARI_SCREEN_H @@ -27,22 +27,27 @@ #define SCREENBYTES_MONOLINE 80 /* Byte per line in ST-high resolution */ /* Overscan values */ -#define OVERSCAN_TOP 29 -#define OVERSCAN_BOTTOM 47 +#define OVERSCAN_TOP 29 +#define MAX_OVERSCAN_BOTTOM 47 /* number of bottom lines to display on screen */ /* Number of visible screen lines including top/bottom borders */ -#define NUM_VISIBLE_LINES (OVERSCAN_TOP+200+OVERSCAN_BOTTOM) +#define NUM_VISIBLE_LINES (OVERSCAN_TOP+200+MAX_OVERSCAN_BOTTOM) + +/* 1x16 colour palette per screen line, +1 line as may write after line 200 */ +#define HBL_PALETTE_LINES ((NUM_VISIBLE_LINES+1 +3 )*16) /* [NP] FIXME we need to handle 313 hbl, not 310 ; palette code is a mess it should be removed */ +/* Bit mask of palette colours changes, top bit set is resolution change */ +#define HBL_PALETTE_MASKS (NUM_VISIBLE_LINES+1 +3 ) /* [NP] FIXME we need to handle 313 hbl, not 310 ; palette code is a mess it should be removed */ /* Frame buffer, used to store details in screen conversion */ typedef struct { - Uint16 HBLPalettes[(NUM_VISIBLE_LINES+1)*16]; /* 1x16 colour palette per screen line, +1 line as may write after line 200 */ - Uint32 HBLPaletteMasks[NUM_VISIBLE_LINES+1]; /* Bit mask of palette colours changes, top bit set is resolution change */ + Uint16 HBLPalettes[HBL_PALETTE_LINES]; + Uint32 HBLPaletteMasks[HBL_PALETTE_MASKS]; Uint8 *pSTScreen; /* Copy of screen built up during frame (copy each line on HBL to simulate monitor raster) */ Uint8 *pSTScreenCopy; /* Previous frames copy of above */ int OverscanModeCopy; /* Previous screen overscan mode */ - BOOL bFullUpdate; /* Set TRUE to cause full update on next draw */ + bool bFullUpdate; /* Set TRUE to cause full update on next draw */ } FRAMEBUFFER; /* Number of frame buffers (1 or 2) - should be 2 for supporting screen flipping */ @@ -62,14 +67,6 @@ enum #define ST_MEDIUM_RES_BIT 0x1 #define ST_RES_MASK 0x3 -/* Update Palette defines */ -enum -{ - UPDATE_PALETTE_NONE, - UPDATE_PALETTE_UPDATE, - UPDATE_PALETTE_FULLUPDATE -}; - /* Palette mask values for 'HBLPaletteMask[]' */ #define PALETTEMASK_RESOLUTION 0x00040000 #define PALETTEMASK_PALETTE 0x0000ffff @@ -86,21 +83,8 @@ enum OVERSCANMODE_BOTTOM /* 0x02 (Top+Bottom) 0x03 */ }; -/* Available fullscreen modes */ -#define NUM_DISPLAYMODEOPTIONS 6 -enum -{ - DISPLAYMODE_LOWCOL_LOWRES, /* low color, low resolution (fastest) */ - DISPLAYMODE_LOWCOL_HIGHRES, /* low color, zoomed resolution */ - DISPLAYMODE_LOWCOL_DUMMY, /* unused */ - DISPLAYMODE_HICOL_LOWRES, /* high color, low resolution */ - DISPLAYMODE_HICOL_HIGHRES, /* high color, zoomed resolution (slowest) */ - DISPLAYMODE_HICOL_DUMMY /* unused */ -}; - - -extern BOOL bGrabMouse; -extern BOOL bInFullScreen; +extern bool bGrabMouse; +extern bool bInFullScreen; extern int nScreenZoomX, nScreenZoomY; extern int nBorderPixelsLeft, nBorderPixelsRight; extern int STScreenStartHorizLine; @@ -118,6 +102,8 @@ extern void Screen_SetFullUpdate(void); extern void Screen_EnterFullScreen(void); extern void Screen_ReturnFromFullScreen(void); extern void Screen_ModeChanged(void); -extern void Screen_Draw(void); +extern bool Screen_Draw(void); + +extern bool bTTSampleHold; /* TT special video mode */ #endif /* ifndef HATARI_SCREEN_H */