Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/waterbox/gpgx/core/loadrom.h
2 views
1
/***************************************************************************************
2
* Genesis Plus
3
* ROM Loading Support
4
*
5
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Charles Mac Donald (original code)
6
* Copyright (C) 2007-2013 Eke-Eke (Genesis Plus GX)
7
*
8
* Redistribution and use of this code or any derivative works are permitted
9
* provided that the following conditions are met:
10
*
11
* - Redistributions may not be sold, nor may they be used in a commercial
12
* product or activity.
13
*
14
* - Redistributions that are modified from the original source must include the
15
* complete source code, including the source code for all components used by a
16
* binary built from the modified sources. However, as a special exception, the
17
* source code distributed need not include anything that is normally distributed
18
* (in either source or binary form) with the major components (compiler, kernel,
19
* and so on) of the operating system on which the executable runs, unless that
20
* component itself accompanies the executable.
21
*
22
* - Redistributions must reproduce the above copyright notice, this list of
23
* conditions and the following disclaimer in the documentation and/or other
24
* materials provided with the distribution.
25
*
26
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36
* POSSIBILITY OF SUCH DAMAGE.
37
*
38
****************************************************************************************/
39
40
#ifndef _LOADROM_H_
41
#define _LOADROM_H_
42
43
#define MAXROMSIZE (32*1024*1024)
44
45
typedef struct
46
{
47
char consoletype[18]; /* Genesis or Mega Drive */
48
char copyright[18]; /* Copyright message */
49
char domestic[50]; /* Domestic name of ROM */
50
char international[50]; /* International name of ROM */
51
char ROMType[4]; /* Boot ROM (BR), Educational (AL) or Game (GM) program */
52
char product[14]; /* Product serial number */
53
unsigned short checksum; /* ROM Checksum (header) */
54
unsigned short realchecksum; /* ROM Checksum (calculated) */
55
unsigned int romstart; /* ROM start address */
56
unsigned int romend; /* ROM end address */
57
char country[18]; /* Country flag */
58
uint16 peripherals; /* Supported peripherals */
59
} ROMINFO;
60
61
62
/* Global variables */
63
extern ROMINFO rominfo;
64
extern uint8 romtype;
65
66
/* Function prototypes */
67
extern int load_bios(void);
68
extern int load_rom(const char *filename);
69
extern void get_region(char *romheader);
70
extern char *get_company(void);
71
extern char *get_peripheral(int index);
72
extern void getrominfo(char *romheader);
73
74
#endif /* _LOADROM_H_ */
75
76
77