1 /******************************************************************************/
2 /* Mednafen Sega Saturn Emulation Module                                      */
3 /******************************************************************************/
4 /* vdp2_render.h:
5 **  Copyright (C) 2016-2017 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 __MDFN_SS_VDP2_RENDER_H
23 #define __MDFN_SS_VDP2_RENDER_H
24 
25 #include "../git.h"
26 
27 void VDP2REND_Init(const bool IsPAL) MDFN_COLD;
28 void VDP2REND_SetGetVideoParams(MDFNGI* gi, const bool caspect, const int sls, const int sle, const bool show_h_overscan, const bool dohblend) MDFN_COLD;
29 void VDP2REND_Kill(void) MDFN_COLD;
30 void VDP2REND_GetGunXTranslation(const bool clock28m, float* scale, float* offs);
31 void VDP2REND_StartFrame(EmulateSpecStruct* espec, const bool clock28m, const int SurfInterlaceField);
32 void VDP2REND_EndFrame(void);
33 void VDP2REND_Reset(bool powering_up) MDFN_COLD;
34 void VDP2REND_SetLayerEnableMask(uint64 mask) MDFN_COLD;
35 
36 void VDP2REND_StateAction(StateMem* sm, const unsigned load, const bool data_only, uint16 (&rr)[0x100], uint16 (&cr)[2048], uint16 (&vr)[262144]) MDFN_COLD;
37 
38 struct VDP2Rend_LIB
39 {
40  struct
41  {
42   uint32 Xsp, Ysp;// .10
43   uint32 Xp, Yp; // .10
44   uint32 dX, dY; // .10
45   int32 kx, ky;	 // .16
46   uint32 KAstAccum;
47   uint32 DKAx;
48  } rv[2];
49  bool vdp1_hires8;
50  bool win_ymet[2];
51  uint16 vdp1_line[352];
52 };
53 
54 VDP2Rend_LIB* VDP2REND_GetLIB(unsigned line);
55 void VDP2REND_DrawLine(int vdp2_line, const uint32 crt_line, const bool field);
56 
57 void VDP2REND_Write8_DB(uint32 A, uint16 DB);
58 void VDP2REND_Write16_DB(uint32 A, uint16 DB);
59 
60 
61 #endif
62