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

1.1       root        1: /*
                      2:   Hatari
                      3: */
                      4: 
1.1.1.3 ! root        5: #ifndef SCREEN_H
        !             6: #define SCREEN_H
        !             7: 
        !             8: #include <SDL_video.h>    /* for SDL_Surface */
        !             9: 
1.1       root       10: 
                     11: /* Frame buffer, used to store details in screen conversion */
                     12: typedef struct {
                     13:   unsigned short int HBLPalettes[(NUM_VISIBLE_LINES+1)*16];  /* 1x16 colour palette per screen line, +1 line as may write after line 200 */
                     14:   unsigned long HBLPaletteMasks[NUM_VISIBLE_LINES+1];        /* Bit mask of palette colours changes, top bit set is resolution change */
                     15:   unsigned char *pSTScreen;          /* Copy of screen built up during frame(copy each line on HBL to simulate monitor raster) */
                     16:   unsigned char *pSTScreenCopy;      /* Previous frames copy of above  */
                     17:   int OverscanModeCopy;              /* Previous screen overscan mode */
                     18:   BOOL bFullUpdate;                  /* Set TRUE to cause full update on next draw */
                     19: } FRAMEBUFFER;
                     20: #define NUM_FRAMEBUFFERS  2
                     21: 
                     22: /* Details for each display screen - both Window and FullScreen */
                     23: typedef struct {
                     24:   int STScreenLeftSkipBytes,STScreenWidthBytes;     /* Bytes to skip on left and number of bytes of screen to draw */
                     25:   int STScreenStartHorizLine,STScreenEndHorizLine;  /* Start/End points in ST screen(28 is top of normal screen) */
                     26:   int PCStartHorizLine,PCStartXOffset;              /* Source ST lines/bytes to skip, Destination screen lines/bytes to skip */
                     27: } SCREENDRAW_OVERSCAN;
                     28: 
                     29: typedef struct {
                     30:   void *pDrawFunction;              /* Draw function */
                     31:   /*int DirectDrawMode;*/           /* Mode required for DirectDraw. eg MODE_320x200x256 */
                     32:   int Width,Height,BitDepth,VertPixelsPerLine;
                     33:   SCREENDRAW_OVERSCAN Overscan[4];  /* Details for starting offset for each overscan mode(none,top,bottom,both) */
                     34: } SCREENDRAW;
                     35: 
                     36: typedef struct {
                     37:   SCREENDRAW *pLowRes, *pAltLowRes;
                     38:   SCREENDRAW *pMediumRes, *pAltMediumRes;
                     39:   SCREENDRAW *pHighRes, *pAltHighRes;
                     40:   SCREENDRAW *pLowMediumMixRes, *pAltLowMediumMixRes;
                     41: } SCREENDRAW_DISPLAYOPTIONS;
                     42: 
                     43: /* ST Resolution defines */
                     44: enum {
                     45:   ST_LOW_RES,
                     46:   ST_MEDIUM_RES,
                     47:   ST_HIGH_RES,
                     48:   ST_LOWMEDIUM_MIX_RES
                     49: };
                     50: 
                     51: /* Update Palette defines */
                     52: enum {
                     53:   UPDATE_PALETTE_NONE,
                     54:   UPDATE_PALETTE_UPDATE,
                     55:   UPDATE_PALETTE_FULLUPDATE
                     56: };
                     57: 
                     58: /* Palette mask values for 'HBLPaletteMask[]' */
                     59: #define PALETTEMASK_RESOLUTION  0x00040000
1.1.1.2   root       60: #define PALETTEMASK_PALETTE     0x0000ffff
                     61: #define PALETTEMASK_UPDATERES   0x20000000
                     62: #define PALETTEMASK_UPDATEPAL   0x40000000
1.1       root       63: #define PALETTEMASK_UPDATEFULL  0x80000000
                     64: #define PALETTEMASK_UPDATEMASK  (PALETTEMASK_UPDATEFULL|PALETTEMASK_UPDATEPAL|PALETTEMASK_UPDATERES)
                     65: 
                     66: /* Overscan values */
                     67: enum {
1.1.1.2   root       68:   OVERSCANMODE_NONE,     /* 0x00 */
                     69:   OVERSCANMODE_TOP,      /* 0x01 */
                     70:   OVERSCANMODE_BOTTOM    /* 0x02 (Top+Bottom) 0x03 */
1.1       root       71: };
                     72: 
1.1.1.2   root       73: /* Available fullscreen modes */
                     74: #define NUM_DISPLAYMODEOPTIONS 6
                     75: enum {
                     76:        DISPLAYMODE_16COL_LOWRES,               /* (fastest) */
                     77:        DISPLAYMODE_16COL_HIGHRES,
                     78:        DISPLAYMODE_16COL_FULL,
                     79:        DISPLAYMODE_HICOL_LOWRES,
                     80:        DISPLAYMODE_HICOL_HIGHRES,
                     81:        DISPLAYMODE_HICOL_FULL                  /* (slowest) */
                     82: };
                     83: 
                     84: 
1.1       root       85: /* For palette we don't go from colour '0' as the whole background would change, so go from this value */
                     86: #define  BASECOLOUR       0x0A
                     87: #define  BASECOLOUR_LONG  0x0A0A0A0A
                     88: 
                     89: extern SCREENDRAW ScreenDrawWindow[4];
                     90: extern SCREENDRAW ScreenDrawFullScreen[4];
                     91: extern FRAMEBUFFER *pFrameBuffer;
                     92: extern unsigned char *pScreenBitmap;
                     93: extern unsigned char *pSTScreen,*pSTScreenCopy;
                     94: extern unsigned char *pPCScreenDest;
                     95: extern int STScreenStartHorizLine,STScreenEndHorizLine;
                     96: extern int PCScreenBytesPerLine,STScreenWidthBytes,STScreenLeftSkipBytes;
                     97: extern BOOL bInFullScreen;
                     98: extern BOOL bFullScreenHold;
                     99: extern BOOL bScreenContentsChanged;
                    100: extern int STRes,PrevSTRes;
                    101: extern int STScreenLineOffset[NUM_VISIBLE_LINES];
                    102: extern unsigned long STRGBPalette[16];
                    103: extern unsigned long ST2RGB[2048];
1.1.1.3 ! root      104: extern SDL_Surface *sdlscrn;
1.1       root      105: 
                    106: extern void Screen_Init(void);
                    107: extern void Screen_UnInit(void);
                    108: extern void Screen_Reset(void);
                    109: extern void Screen_SetScreenLineOffsets(void);
                    110: extern void Screen_SetFullUpdate(void);
                    111: extern void Screen_SetupRGBTable(BOOL bFullScreen);
                    112: extern void Screen_EnterFullScreen(void);
                    113: extern void Screen_ReturnFromFullScreen(void);
1.1.1.2   root      114: extern void Screen_ClearScreen(void);
1.1       root      115: extern void Screen_SetDrawModes(void);
1.1.1.2   root      116: extern void Screen_SetWindowRes(int Width,int Height,int BitCount);
1.1       root      117: extern void Screen_Blit(BOOL bSwapScreen);
                    118: extern FRAMEBUFFER *Screen_GetOtherFrameBuffer(void);
                    119: extern void Screen_DrawFrame(BOOL bForceFlip);
                    120: extern void Screen_Draw(void);
1.1.1.3 ! root      121: 
        !           122: #endif  /* ifndef SCREEN_H */

unix.superglobalmegacorp.com

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