Annotation of hatari/src/includes/screen.h, revision 1.1.1.6

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: 
1.1.1.6 ! root       25: /* Number of frame buffers (1 or 2) - should be 2 for supporting screen flipping */
        !            26: #define NUM_FRAMEBUFFERS  2
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 *pSTScreen,*pSTScreenCopy;
                    106: extern unsigned char *pPCScreenDest;
                    107: extern int STScreenStartHorizLine,STScreenEndHorizLine;
                    108: extern int PCScreenBytesPerLine,STScreenWidthBytes,STScreenLeftSkipBytes;
                    109: extern BOOL bInFullScreen;
                    110: extern BOOL bFullScreenHold;
                    111: extern BOOL bScreenContentsChanged;
                    112: extern int STRes,PrevSTRes;
                    113: extern int STScreenLineOffset[NUM_VISIBLE_LINES];
                    114: extern unsigned long STRGBPalette[16];
                    115: extern unsigned long ST2RGB[2048];
1.1.1.3   root      116: extern SDL_Surface *sdlscrn;
1.1.1.4   root      117: extern BOOL bGrabMouse;
1.1       root      118: 
                    119: extern void Screen_Init(void);
                    120: extern void Screen_UnInit(void);
                    121: extern void Screen_Reset(void);
                    122: extern void Screen_SetScreenLineOffsets(void);
                    123: extern void Screen_SetFullUpdate(void);
1.1.1.4   root      124: extern void Screen_SetupRGBTable(void);
1.1       root      125: extern void Screen_EnterFullScreen(void);
                    126: extern void Screen_ReturnFromFullScreen(void);
1.1.1.2   root      127: extern void Screen_ClearScreen(void);
1.1       root      128: extern void Screen_SetDrawModes(void);
1.1.1.6 ! root      129: extern void Screen_DidResolutionChange(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 */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.