Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/genplus-gx32/core/genesis.h
2 views
1
/***************************************************************************************
2
* Genesis Plus
3
* Internal hardware & Bus controllers
4
*
5
* Support for SG-1000, Mark-III, Master System, Game Gear, Mega Drive & Mega CD hardware
6
*
7
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald (original code)
8
* Copyright (C) 2007-2013 Eke-Eke (Genesis Plus GX)
9
*
10
* Redistribution and use of this code or any derivative works are permitted
11
* provided that the following conditions are met:
12
*
13
* - Redistributions may not be sold, nor may they be used in a commercial
14
* product or activity.
15
*
16
* - Redistributions that are modified from the original source must include the
17
* complete source code, including the source code for all components used by a
18
* binary built from the modified sources. However, as a special exception, the
19
* source code distributed need not include anything that is normally distributed
20
* (in either source or binary form) with the major components (compiler, kernel,
21
* and so on) of the operating system on which the executable runs, unless that
22
* component itself accompanies the executable.
23
*
24
* - Redistributions must reproduce the above copyright notice, this list of
25
* conditions and the following disclaimer in the documentation and/or other
26
* materials provided with the distribution.
27
*
28
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
32
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
33
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38
* POSSIBILITY OF SUCH DAMAGE.
39
*
40
****************************************************************************************/
41
42
#ifndef _GENESIS_H_
43
#define _GENESIS_H_
44
45
#include "md_cart.h"
46
#include "sms_cart.h"
47
#include "scd.h"
48
49
/* External Hardware */
50
typedef union
51
{
52
md_cart_t md_cart;
53
cd_hw_t cd_hw;
54
} external_t;
55
56
/* Global variables */
57
extern external_t ext;
58
extern uint8 boot_rom[0x800];
59
extern uint8 work_ram[0x10000];
60
extern uint8 zram[0x2000];
61
extern uint32 zbank;
62
extern uint8 zstate;
63
extern uint8 pico_current;
64
65
/* Function prototypes */
66
extern void gen_init(void);
67
extern void gen_reset(int hard_reset);
68
extern void gen_tmss_w(unsigned int offset, unsigned int data);
69
extern void gen_bankswitch_w(unsigned int data);
70
extern unsigned int gen_bankswitch_r(void);
71
extern void gen_zbusreq_w(unsigned int state, unsigned int cycles);
72
extern void gen_zreset_w(unsigned int state, unsigned int cycles);
73
extern void gen_zbank_w(unsigned int state);
74
extern int z80_irq_callback(int param);
75
76
#endif /* _GEN_H_ */
77
78
79