forked from jeremyrayner/beebem-rg350
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvideo.h
117 lines (94 loc) · 4.23 KB
/
video.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/****************************************************************************/
/* Beebem - (c) David Alan Gilbert 1994 */
/* ------------------------------------ */
/* This program may be distributed freely within the following restrictions:*/
/* */
/* 1) You may not charge for this program or for any part of it. */
/* 2) This copyright message must be distributed with all copies. */
/* 3) This program must be distributed complete with source code. Binary */
/* only distribution is not permitted. */
/* 4) The author offers no warrenties, or guarentees etc. - you use it at */
/* your own risk. If it messes something up or destroys your computer */
/* thats YOUR problem. */
/* 5) You may use small sections of code from this program in your own */
/* applications - but you must acknowledge its use. If you plan to use */
/* large sections then please ask the author. */
/* */
/* If you do not agree with any of the above then please do not use this */
/* program. */
/* Please report any problems to the author at beebem@treblig.org */
/****************************************************************************/
#ifndef VIDEO_HEADER
#define VIDEO_HEADER
//++
extern int time_slept;
extern int IsTeletext;
//<-
//#if HAVE_CONFIG_H
//# include <config.h>
//#endif
#include <stdio.h>
extern int VideoTriggerCount;
extern unsigned char VideoULA_ControlReg;
extern unsigned char VideoULA_Palette[16];
extern unsigned char CRTCControlReg;
extern unsigned char CRTC_HorizontalTotal; /* R0 */
extern unsigned char CRTC_HorizontalDisplayed; /* R1 */
extern unsigned char CRTC_HorizontalSyncPos; /* R2 */
extern unsigned char CRTC_SyncWidth; /* R3 - top 4 bits are Vertical (in scan lines) and bottom 4 are horizontal in characters */
extern unsigned char CRTC_VerticalTotal; /* R4 */
extern unsigned char CRTC_VerticalTotalAdjust; /* R5 */
extern unsigned char CRTC_VerticalDisplayed; /* R6 */
extern unsigned char CRTC_VerticalSyncPos; /* R7 */
extern unsigned char CRTC_InterlaceAndDelay; /* R8 - 0,1 are interlace modes, 4,5 display blanking delay, 6,7 cursor blanking delay */
extern unsigned char CRTC_ScanLinesPerChar; /* R9 */
extern unsigned char CRTC_CursorStart; /* R10 */
extern unsigned char CRTC_CursorEnd; /* R11 */
extern unsigned char CRTC_ScreenStartHigh; /* R12 */
extern unsigned char CRTC_ScreenStartLow; /* R13 */
extern unsigned char CRTC_CursorPosHigh; /* R14 */
extern unsigned char CRTC_CursorPosLow; /* R15 */
extern unsigned char CRTC_LightPenHigh; /* R16 */
extern unsigned char CRTC_LightPenLow; /* R17 */
extern unsigned int ActualScreenWidth;
extern long ScreenAdjust;
void RedoMPTR(void);
void CRTCWrite(int Address, int Value);
int CRTCRead(int Address);
void VideoULAWrite(int Address, int Value);
int VideoULARead(int Address);
void VideoInit(void);
void video_dumpstate(void);
//++
void SetVideoCentered(void);
void SetVideoTop(void);
void SetVideoBottom(void);
void SetVideoScaled(void);
#ifdef OPENDINGUX
void SetVideoIPU(void);
#endif
//<-
void VideoDoScanLine(void);
void VideoGetText(char *text, int line);
extern unsigned char TeletextEnabled;
#define VideoPoll(ncycles) if ((VideoTriggerCount)<=TotalCycles) VideoDoScanLine();
// Allow enough lines for all modes.
// i.e. max(virtical total * scan lines per char) = 38 * 8 (mode 7 excluded)
#define MAX_VIDEO_SCAN_LINES 304
void SaveVideoUEF(FILE *SUEF);
void LoadVideoUEF(FILE *SUEF);
extern char TeletextStyle;
extern int THalfMode;
void SetVHoldOffset(unsigned int vhold);
void Video_SetVHoldNormal(void);
void Video_SetVHoldDown(void);
#ifdef OPENDINGUX
void InitSurfacePalette(SDL_Surface *source_surface);
#endif
void rgb_blit();
void update_rgb_lookup(SDL_Surface *source_surface);
//#define USE_DMA
#ifdef USE_DMA
extern volatile uint16_t *dma_ptr;
#endif
#endif