1 /******************************************************************************/
2 /* Mednafen Virtual Boy Emulation Module                                      */
3 /******************************************************************************/
4 /* vip.h:
5 **  Copyright (C) 2010-2016 Mednafen Team
6 **
7 ** This program is free software; you can redistribute it and/or
8 ** modify it under the terms of the GNU General Public License
9 ** as published by the Free Software Foundation; either version 2
10 ** of the License, or (at your option) any later version.
11 **
12 ** This program is distributed in the hope that it will be useful,
13 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 ** GNU General Public License for more details.
16 **
17 ** You should have received a copy of the GNU General Public License
18 ** along with this program; if not, write to the Free Software Foundation, Inc.,
19 ** 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 */
21 
22 #ifndef __VB_VIP_H
23 #define __VB_VIP_H
24 
25 namespace MDFN_IEN_VB
26 {
27 
28 extern const CustomPalette_Spec VIP_CPInfo[];
29 
30 void VIP_Init(void) MDFN_COLD;
31 void VIP_Kill(void) MDFN_COLD;
32 void VIP_Power(void) MDFN_COLD;
33 
34 void VIP_SetInstantDisplayHack(bool) MDFN_COLD;
35 void VIP_SetAllowDrawSkip(bool) MDFN_COLD;
36 void VIP_Set3DMode(uint32 mode, bool reverse, uint32 prescale, uint32 sbs_separation) MDFN_COLD;
37 void VIP_SetParallaxDisable(bool disabled) MDFN_COLD;
38 void VIP_SetDefaultColor(uint32 default_color) MDFN_COLD;
39 void VIP_SetAnaglyphColors(uint32 lcolor, uint32 rcolor) MDFN_COLD;	// R << 16, G << 8, B << 0
40 void VIP_SetLEDOnScale(float coeff) MDFN_COLD;
41 
42 v810_timestamp_t MDFN_FASTCALL VIP_Update(const v810_timestamp_t timestamp);
43 void VIP_ResetTS(void);
44 
45 void VIP_StartFrame(EmulateSpecStruct *espec);
46 
47 MDFN_FASTCALL uint8 VIP_Read8(v810_timestamp_t &timestamp, uint32 A);
48 MDFN_FASTCALL uint16 VIP_Read16(v810_timestamp_t &timestamp, uint32 A);
49 
50 
51 MDFN_FASTCALL void VIP_Write8(v810_timestamp_t &timestamp, uint32 A, uint8 V);
52 MDFN_FASTCALL void VIP_Write16(v810_timestamp_t &timestamp, uint32 A, uint16 V);
53 
54 void VIP_StateAction(StateMem *sm, const unsigned load, const bool data_only);
55 
56 
57 enum
58 {
59  VIP_GSREG_IPENDING = 0,	// Current pending interrupt(bits)
60  VIP_GSREG_IENABLE,
61 
62  VIP_GSREG_DPCTRL,
63 
64  VIP_GSREG_BRTA,
65  VIP_GSREG_BRTB,
66  VIP_GSREG_BRTC,
67  VIP_GSREG_REST,
68  VIP_GSREG_FRMCYC,
69  VIP_GSREG_XPCTRL,
70 
71  VIP_GSREG_SPT0,
72  VIP_GSREG_SPT1,
73  VIP_GSREG_SPT2,
74  VIP_GSREG_SPT3,
75 
76  VIP_GSREG_GPLT0,
77  VIP_GSREG_GPLT1,
78  VIP_GSREG_GPLT2,
79  VIP_GSREG_GPLT3,
80 
81  VIP_GSREG_JPLT0,
82  VIP_GSREG_JPLT1,
83  VIP_GSREG_JPLT2,
84  VIP_GSREG_JPLT3,
85 
86  VIP_GSREG_BKCOL,
87 };
88 
89 uint32 VIP_GetRegister(const unsigned int id, char *special, const uint32 special_len);
90 void VIP_SetRegister(const unsigned int id, const uint32 value);
91 
92 
93 }
94 #endif
95