|
|
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:
1.1.1.3 ! root 13: #if 1
! 14: void SDL_UpdateRect(SDL_Surface *screen, Sint32 x, Sint32 y, Sint32 w, Sint32 h);
! 15: void SDL_UpdateRects(SDL_Surface *screen, int numrects, SDL_Rect *rects);
! 16: #endif
1.1 root 17:
18: /* The 'screen' is a representation of the ST video memory */
19: /* taking into account all the border tricks. Data are stored */
20: /* in 'planar' format (1 word per plane) and are then converted */
21: /* to an SDL buffer that will be displayed. */
22: /* So, all video lines are converted to a unique line of */
23: /* SCREENBYTES_LINE bytes in planar format. */
24: /* SCREENBYTES_LINE should always be a multiple of 8. */
25:
26: /* left/right borders must be multiple of 8 bytes */
27: #define SCREENBYTES_LEFT (nBorderPixelsLeft/2) /* Bytes for left border */
28: #define SCREENBYTES_MIDDLE 160 /* Middle (320 pixels) */
29: #define SCREENBYTES_RIGHT (nBorderPixelsRight/2) /* Right border */
30: #define SCREENBYTES_LINE (SCREENBYTES_LEFT+SCREENBYTES_MIDDLE+SCREENBYTES_RIGHT)
31: #define SCREENBYTES_MONOLINE 80 /* Byte per line in ST-high resolution */
32:
33:
34:
35: /* Frame buffer, used to store details in screen conversion */
36: typedef struct
37: {
38: Uint8 *pNEXTScreen; /* Copy of screen built up during frame (copy each line on HBL to simulate monitor raster) */
39: Uint8 *pNEXTScreenCopy; /* Previous frames copy of above */
40: bool bFullUpdate; /* Set TRUE to cause full update on next draw */
41: } FRAMEBUFFER;
42:
43: /* Number of frame buffers (1 or 2) - should be 2 for supporting screen flipping */
44: #define NUM_FRAMEBUFFERS 2
45:
46:
47: /* ST/TT resolution defines */
48: enum
49: {
50: ST_HIGH_RES,
51: };
52: #define ST_MEDIUM_RES_BIT 0x1
53: #define ST_RES_MASK 0x3
54:
55:
56: /* Palette mask values for 'HBLPaletteMask[]' */
57: #define PALETTEMASK_RESOLUTION 0x00040000
58: #define PALETTEMASK_PALETTE 0x0000ffff
59: #define PALETTEMASK_UPDATERES 0x20000000
60: #define PALETTEMASK_UPDATEPAL 0x40000000
61: #define PALETTEMASK_UPDATEFULL 0x80000000
62: #define PALETTEMASK_UPDATEMASK (PALETTEMASK_UPDATEFULL|PALETTEMASK_UPDATEPAL|PALETTEMASK_UPDATERES)
63:
64: /* Overscan values */
65: enum
66: {
67: OVERSCANMODE_NONE, /* 0x00 */
68: OVERSCANMODE_TOP, /* 0x01 */
69: OVERSCANMODE_BOTTOM /* 0x02 (Top+Bottom) 0x03 */
70: };
71:
1.1.1.3 ! root 72: extern volatile bool bGrabMouse;
! 73: extern volatile bool bInFullScreen;
! 74: extern struct SDL_Window *sdlWindow;
1.1 root 75: extern SDL_Surface *sdlscrn;
76:
77: extern void Screen_Init(void);
78: extern void Screen_UnInit(void);
79: extern void Screen_Reset(void);
80: extern void Screen_SetFullUpdate(void);
81: extern void Screen_EnterFullScreen(void);
82: extern void Screen_ReturnFromFullScreen(void);
83: extern void Screen_ModeChanged(void);
84: extern bool Screen_Draw(void);
85:
86: #endif /* ifndef HATARI_SCREEN_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.