1 /* Caprice32 - Amstrad CPC Emulator
2    (c) Copyright 1997-2004 Ulrich Doewich
3 
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2 of the License, or
7    (at your option) any later version.
8 
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13 
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18 
19 #ifndef CRTC_H
20 #define CRTC_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #include "z80.h"
27 
28 // The next 4 bytes must remain together
29 typedef union
30 {
31    uint32_t combined;
32    struct {
33       uint8_t monVSYNC;
34       uint8_t inHSYNC;
35       union {
36          uint16_t combined;
37          struct {
38             uint8_t DISPTIMG;
39             uint8_t HDSPTIMG;
40          };
41       } dt;
42    };
43 } t_flags1;
44 
45 // The next two bytes must remain together
46 typedef union
47 {
48    uint16_t combined;
49    struct {
50       uint8_t NewDISPTIMG;
51       uint8_t NewHDSPTIMG;
52    };
53 } t_new_dt;
54 
55 void update_skew(void);
56 void CharMR1(void);
57 void CharMR2(void);
58 void prerender_border(void);
59 void prerender_border_half(void);
60 void prerender_sync(void);
61 void prerender_sync_half(void);
62 void prerender_normal(void);
63 void prerender_normal_plus(void);
64 void prerender_normal_half(void);
65 void prerender_normal_half_plus(void);
66 void crtc_cycle(int repeat_count);
67 void crtc_init(void);
68 void crtc_reset(void);
69 
70 void render16bpp(void);
71 void render16bpp_doubleY(void);
72 void render32bpp(void);
73 void render32bpp_doubleY(void);
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif
80