|
|
1.1 root 1: /*
1.1.1.4 root 2: Hatari - video.h
3:
4: This file is distributed under the GNU Public License, version 2 or at
5: your option any later version. Read the file gpl.txt for details.
1.1 root 6: */
7:
1.1.1.4 root 8: #ifndef HATARI_VIDEO_H
9: #define HATARI_VIDEO_H
10:
1.1.1.7 ! root 11: /*
! 12: All the following processor timings are based on a bog standard 8MHz 68000 as
! 13: found in all standard STs:
! 14:
! 15: Clock cycles per line (50Hz) : 512
! 16: NOPs per scan line (50Hz) : 128
! 17: Scan lines per VBL (50Hz) : 313 (64 at top,200 screen,49 bottom)
! 18:
! 19: Clock cycles per line (60Hz) : 508
! 20: NOPs per scan line (60Hz) : 127
! 21: Scan lines per VBL (60Hz) : 263
! 22:
! 23: Clock cycles per VBL (50Hz) : 160256
! 24: NOPs per VBL (50Hz) : 40064
! 25:
! 26: Pixels per clock cycle (low res) : 1
! 27: Pixels per clock cycle (med res) : 2
! 28: Pixels per clock cycle (high res) : 4
! 29: Pixels per NOP (low res) : 4
! 30: Pixels per NOP (med res) : 8
! 31: Pixels per NOP (high res) : 16
! 32: */
! 33:
! 34: /* Scan lines per frame */
! 35: #define SCANLINES_PER_FRAME_50HZ 313 /* Number of scan lines per frame in 50 Hz */
! 36: #define SCANLINES_PER_FRAME_60HZ 263 /* Number of scan lines per frame in 60 Hz */
! 37: #define MAX_SCANLINES_PER_FRAME 313 /* Max. number of scan lines per frame */
! 38:
! 39: /* Cycles per line */
! 40: #define CYCLES_PER_LINE_50HZ 512
! 41: #define CYCLES_PER_LINE_60HZ 508
! 42:
! 43: /* Vertical border/display enable/disable:
! 44: * Normal screen starts 63 lines in, top border is 29 lines */
! 45: #define SCREEN_START_HBL_50HZ 63 /* Usually the first line of the displayed screen in 50 Hz */
! 46: #define SCREEN_START_HBL_60HZ 34 /* The first line of the displayed screen in 60 Hz */
! 47: #define FIRST_VISIBLE_HBL_50HZ 34 /* At this line we start rendering our screen in 50 Hz */
! 48: #define FIRST_VISIBLE_HBL_60HZ (34-29) /* At this line we start rendering our screen in 60 Hz (29 = 63-34) */
! 49:
! 50: #define SCREEN_HEIGHT_HBL 200 /* This is usually the height of the screen */
! 51:
! 52: /* FIXME: SCREEN_START_CYCLE should rather be 52 or so, but this breaks a lot of other things at the moment... */
! 53: #define SCREEN_START_CYCLE 96 /* Cycle first normal pixel appears on */
! 54:
! 55: /* Bytes for opened left and right border: */
! 56: #define BORDERBYTES_LEFT 26
! 57: #define BORDERBYTES_RIGHT 44
! 58:
! 59: /* Legacy defines: */
! 60: #define CYCLES_PER_FRAME (nScanlinesPerFrame*nCyclesPerLine) /* Cycles per VBL @ 50fps = 160256 */
! 61: #define CYCLES_HBL (nCyclesPerLine+96) /* Cycles for first HBL - very inaccurate on ST */
! 62:
! 63:
1.1 root 64: extern BOOL bUseHighRes;
65: extern int nVBLs,nHBL;
1.1.1.5 root 66: extern int nStartHBL, nEndHBL;
1.1 root 67: extern int OverscanMode;
1.1.1.7 ! root 68: extern Uint16 HBLPalettes[];
1.1.1.5 root 69: extern Uint16 *pHBLPalettes;
1.1.1.7 ! root 70: extern Uint32 HBLPaletteMasks[];
1.1.1.6 root 71: extern Uint32 *pHBLPaletteMasks;
1.1.1.5 root 72: extern Uint32 VideoBase;
1.1.1.3 root 73: extern int nScreenRefreshRate;
1.1 root 74:
1.1.1.7 ! root 75: extern int nScanlinesPerFrame;
! 76: extern int nCyclesPerLine;
! 77:
! 78:
1.1 root 79: extern void Video_Reset(void);
80: extern void Video_MemorySnapShot_Capture(BOOL bSave);
81: extern void Video_InterruptHandler_VBL(void);
82: extern void Video_InterruptHandler_EndLine(void);
83: extern void Video_InterruptHandler_HBL(void);
84: extern void Video_SetScreenRasters(void);
1.1.1.4 root 85:
1.1.1.5 root 86: extern void Video_ScreenCounterHigh_ReadByte(void);
87: extern void Video_ScreenCounterMed_ReadByte(void);
88: extern void Video_ScreenCounterLow_ReadByte(void);
89: extern void Video_Sync_ReadByte(void);
90: extern void Video_BaseLow_ReadByte(void);
91: extern void Video_LineWidth_ReadByte(void);
92: extern void Video_ShifterMode_ReadByte(void);
1.1.1.7 ! root 93: extern void Video_HorScroll_Read(void);
1.1.1.5 root 94:
1.1.1.6 root 95: extern void Video_ScreenBaseSTE_WriteByte(void);
96: extern void Video_ScreenCounter_WriteByte(void);
1.1.1.5 root 97: extern void Video_Sync_WriteByte(void);
1.1.1.7 ! root 98: extern void Video_LineWidth_WriteByte(void);
1.1.1.5 root 99: extern void Video_Color0_WriteWord(void);
100: extern void Video_Color1_WriteWord(void);
101: extern void Video_Color2_WriteWord(void);
102: extern void Video_Color3_WriteWord(void);
103: extern void Video_Color4_WriteWord(void);
104: extern void Video_Color5_WriteWord(void);
105: extern void Video_Color6_WriteWord(void);
106: extern void Video_Color7_WriteWord(void);
107: extern void Video_Color8_WriteWord(void);
108: extern void Video_Color9_WriteWord(void);
109: extern void Video_Color10_WriteWord(void);
110: extern void Video_Color11_WriteWord(void);
111: extern void Video_Color12_WriteWord(void);
112: extern void Video_Color13_WriteWord(void);
113: extern void Video_Color14_WriteWord(void);
114: extern void Video_Color15_WriteWord(void);
115: extern void Video_ShifterMode_WriteByte(void);
1.1.1.7 ! root 116: extern void Video_HorScroll_Write(void);
1.1.1.5 root 117:
1.1.1.4 root 118: #endif /* HATARI_VIDEO_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.