Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/yabause/src/cs0.h
2 views
1
/* Copyright 2004-2005 Theo Berkau
2
Copyright 2005 Guillaume Duhamel
3
4
This file is part of Yabause.
5
6
Yabause is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
10
11
Yabause is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with Yabause; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
#ifndef CS0_H
22
#define CS0_H
23
24
#include "memory.h"
25
26
#define CART_NONE 0
27
#define CART_PAR 1
28
#define CART_BACKUPRAM4MBIT 2
29
#define CART_BACKUPRAM8MBIT 3
30
#define CART_BACKUPRAM16MBIT 4
31
#define CART_BACKUPRAM32MBIT 5
32
#define CART_DRAM8MBIT 6
33
#define CART_DRAM32MBIT 7
34
#define CART_NETLINK 8
35
#define CART_ROM16MBIT 9
36
#define CART_JAPMODEM 10
37
38
typedef struct
39
{
40
int carttype;
41
int cartid;
42
const char *filename;
43
44
u8 FASTCALL (*Cs0ReadByte)(u32 addr);
45
u16 FASTCALL (*Cs0ReadWord)(u32 addr);
46
u32 FASTCALL (*Cs0ReadLong)(u32 addr);
47
void FASTCALL (*Cs0WriteByte)(u32 addr, u8 val);
48
void FASTCALL (*Cs0WriteWord)(u32 addr, u16 val);
49
void FASTCALL (*Cs0WriteLong)(u32 addr, u32 val);
50
51
u8 FASTCALL (*Cs1ReadByte)(u32 addr);
52
u16 FASTCALL (*Cs1ReadWord)(u32 addr);
53
u32 FASTCALL (*Cs1ReadLong)(u32 addr);
54
void FASTCALL (*Cs1WriteByte)(u32 addr, u8 val);
55
void FASTCALL (*Cs1WriteWord)(u32 addr, u16 val);
56
void FASTCALL (*Cs1WriteLong)(u32 addr, u32 val);
57
58
u8 FASTCALL (*Cs2ReadByte)(u32 addr);
59
u16 FASTCALL (*Cs2ReadWord)(u32 addr);
60
u32 FASTCALL (*Cs2ReadLong)(u32 addr);
61
void FASTCALL (*Cs2WriteByte)(u32 addr, u8 val);
62
void FASTCALL (*Cs2WriteWord)(u32 addr, u16 val);
63
void FASTCALL (*Cs2WriteLong)(u32 addr, u32 val);
64
65
void *rom;
66
void *bupram;
67
void *dram;
68
} cartridge_struct;
69
70
extern cartridge_struct *CartridgeArea;
71
72
int CartInit(const char *filename, int);
73
void CartDeInit(void);
74
75
int CartSaveState(FILE *fp);
76
int CartLoadState(FILE *fp, int version, int size);
77
78
#endif
79
80