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

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

unix.superglobalmegacorp.com

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