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

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 Width,Height,BitDepth,VertPixelsPerLine;
                     40:   SCREENDRAW_OVERSCAN Overscan[4];  /* Details for starting offset for each overscan mode(none,top,bottom,both) */
                     41: } SCREENDRAW;
                     42: 
1.1.1.5   root       43: typedef struct
                     44: {
1.1.1.7 ! root       45:   SCREENDRAW *pLowRes;
        !            46:   SCREENDRAW *pMediumRes;
        !            47:   SCREENDRAW *pHighRes;
        !            48:   SCREENDRAW *pLowMediumMixRes;
1.1       root       49: } SCREENDRAW_DISPLAYOPTIONS;
                     50: 
                     51: /* ST Resolution defines */
1.1.1.5   root       52: enum
                     53: {
1.1       root       54:   ST_LOW_RES,
                     55:   ST_MEDIUM_RES,
                     56:   ST_HIGH_RES,
                     57:   ST_LOWMEDIUM_MIX_RES
                     58: };
                     59: 
                     60: /* Update Palette defines */
1.1.1.5   root       61: enum
                     62: {
1.1       root       63:   UPDATE_PALETTE_NONE,
                     64:   UPDATE_PALETTE_UPDATE,
                     65:   UPDATE_PALETTE_FULLUPDATE
                     66: };
                     67: 
                     68: /* Palette mask values for 'HBLPaletteMask[]' */
                     69: #define PALETTEMASK_RESOLUTION  0x00040000
1.1.1.2   root       70: #define PALETTEMASK_PALETTE     0x0000ffff
                     71: #define PALETTEMASK_UPDATERES   0x20000000
                     72: #define PALETTEMASK_UPDATEPAL   0x40000000
1.1       root       73: #define PALETTEMASK_UPDATEFULL  0x80000000
                     74: #define PALETTEMASK_UPDATEMASK  (PALETTEMASK_UPDATEFULL|PALETTEMASK_UPDATEPAL|PALETTEMASK_UPDATERES)
                     75: 
                     76: /* Overscan values */
1.1.1.5   root       77: enum
                     78: {
1.1.1.2   root       79:   OVERSCANMODE_NONE,     /* 0x00 */
                     80:   OVERSCANMODE_TOP,      /* 0x01 */
                     81:   OVERSCANMODE_BOTTOM    /* 0x02 (Top+Bottom) 0x03 */
1.1       root       82: };
                     83: 
1.1.1.2   root       84: /* Available fullscreen modes */
                     85: #define NUM_DISPLAYMODEOPTIONS 6
1.1.1.5   root       86: enum
                     87: {
1.1.1.7 ! root       88:   DISPLAYMODE_LOWCOL_LOWRES,     /* low color, low resolution (fastest) */
        !            89:   DISPLAYMODE_LOWCOL_HIGHRES,    /* low color, zoomed resolution */
        !            90:   DISPLAYMODE_LOWCOL_DUMMY,      /* unused */
        !            91:   DISPLAYMODE_HICOL_LOWRES,      /* high color, low resolution */
        !            92:   DISPLAYMODE_HICOL_HIGHRES,     /* high color, zoomed resolution (slowest) */
        !            93:   DISPLAYMODE_HICOL_DUMMY        /* unused */
1.1.1.2   root       94: };
                     95: 
                     96: 
1.1       root       97: /* For palette we don't go from colour '0' as the whole background would change, so go from this value */
                     98: #define  BASECOLOUR       0x0A
                     99: #define  BASECOLOUR_LONG  0x0A0A0A0A
                    100: 
                    101: extern FRAMEBUFFER *pFrameBuffer;
                    102: extern unsigned char *pSTScreen,*pSTScreenCopy;
                    103: extern unsigned char *pPCScreenDest;
                    104: extern int STScreenStartHorizLine,STScreenEndHorizLine;
                    105: extern int PCScreenBytesPerLine,STScreenWidthBytes,STScreenLeftSkipBytes;
                    106: extern BOOL bInFullScreen;
                    107: extern BOOL bScreenContentsChanged;
                    108: extern int STRes,PrevSTRes;
                    109: extern int STScreenLineOffset[NUM_VISIBLE_LINES];
                    110: extern unsigned long STRGBPalette[16];
                    111: extern unsigned long ST2RGB[2048];
1.1.1.3   root      112: extern SDL_Surface *sdlscrn;
1.1.1.4   root      113: extern BOOL bGrabMouse;
1.1       root      114: 
                    115: extern void Screen_Init(void);
                    116: extern void Screen_UnInit(void);
                    117: extern void Screen_Reset(void);
                    118: extern void Screen_SetScreenLineOffsets(void);
                    119: extern void Screen_SetFullUpdate(void);
1.1.1.4   root      120: extern void Screen_SetupRGBTable(void);
1.1       root      121: extern void Screen_EnterFullScreen(void);
                    122: extern void Screen_ReturnFromFullScreen(void);
1.1.1.2   root      123: extern void Screen_ClearScreen(void);
1.1       root      124: extern void Screen_SetDrawModes(void);
1.1.1.6   root      125: extern void Screen_DidResolutionChange(void);
1.1.1.4   root      126: extern void Screen_Handle8BitPalettes(void);
1.1       root      127: extern void Screen_Blit(BOOL bSwapScreen);
                    128: extern void Screen_DrawFrame(BOOL bForceFlip);
                    129: extern void Screen_Draw(void);
1.1.1.3   root      130: 
1.1.1.5   root      131: #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.