Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/yabause/src/m68kcore.c
2 views
1
/* Copyright 2007 Guillaume Duhamel
2
3
This file is part of Yabause.
4
5
Yabause is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
9
10
Yabause is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
14
15
You should have received a copy of the GNU General Public License
16
along with Yabause; if not, write to the Free Software
17
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
*/
19
20
#include "m68kcore.h"
21
#include "m68kc68k.h"
22
#include "memory.h"
23
24
extern u8 * SoundRam;
25
26
M68K_struct * M68K = NULL;
27
28
extern M68K_struct * M68KCoreList[];
29
30
int M68KInit(int coreid) {
31
int i;
32
33
M68K = &M68KDummy;
34
35
// Go through core list and find the id
36
for (i = 0; M68KCoreList[i] != NULL; i++)
37
{
38
if (M68KCoreList[i]->id == coreid)
39
{
40
// Set to current core
41
M68K = M68KCoreList[i];
42
break;
43
}
44
}
45
46
return 0;
47
}
48
49
static int M68KDummyInit(void) {
50
return 0;
51
}
52
53
static void M68KDummyDeInit(void) {
54
}
55
56
static void M68KDummyReset(void) {
57
}
58
59
static s32 FASTCALL M68KDummyExec(UNUSED s32 cycle) {
60
T2WriteWord(SoundRam, 0x700, 0);
61
T2WriteWord(SoundRam, 0x710, 0);
62
T2WriteWord(SoundRam, 0x720, 0);
63
T2WriteWord(SoundRam, 0x730, 0);
64
T2WriteWord(SoundRam, 0x740, 0);
65
T2WriteWord(SoundRam, 0x750, 0);
66
T2WriteWord(SoundRam, 0x760, 0);
67
T2WriteWord(SoundRam, 0x770, 0);
68
69
T2WriteWord(SoundRam, 0x790, 0);
70
T2WriteWord(SoundRam, 0x792, 0);
71
return 0;
72
}
73
74
static void M68KDummySync(void) {
75
}
76
77
static u32 M68KDummyGetDReg(UNUSED u32 num) {
78
return 0;
79
}
80
81
static u32 M68KDummyGetAReg(UNUSED u32 num) {
82
return 0;
83
}
84
85
static u32 M68KDummyGetPC(void) {
86
return 0;
87
}
88
89
static u32 M68KDummyGetSR(void) {
90
return 0;
91
}
92
93
static u32 M68KDummyGetUSP(void) {
94
return 0;
95
}
96
97
static u32 M68KDummyGetMSP(void) {
98
return 0;
99
}
100
101
static void M68KDummySetDReg(UNUSED u32 num, UNUSED u32 val) {
102
}
103
104
static void M68KDummySetAReg(UNUSED u32 num, UNUSED u32 val) {
105
}
106
107
static void M68KDummySetPC(UNUSED u32 val) {
108
}
109
110
static void M68KDummySetSR(UNUSED u32 val) {
111
}
112
113
static void M68KDummySetUSP(UNUSED u32 val) {
114
}
115
116
static void M68KDummySetMSP(UNUSED u32 val) {
117
}
118
119
static void M68KDummySetFetch(UNUSED u32 low_adr, UNUSED u32 high_adr, UNUSED pointer fetch_adr) {
120
}
121
122
static void FASTCALL M68KDummySetIRQ(UNUSED s32 level) {
123
}
124
125
static void FASTCALL M68KDummyWriteNotify(u32 address, u32 size) {
126
}
127
128
static void M68KDummySetReadB(UNUSED M68K_READ *Func) {
129
}
130
131
static void M68KDummySetReadW(UNUSED M68K_READ *Func) {
132
}
133
134
static void M68KDummySetWriteB(UNUSED M68K_WRITE *Func) {
135
}
136
137
static void M68KDummySetWriteW(UNUSED M68K_WRITE *Func) {
138
}
139
140
M68K_struct M68KDummy = {
141
0,
142
"Dummy 68k Interface",
143
M68KDummyInit,
144
M68KDummyDeInit,
145
M68KDummyReset,
146
M68KDummyExec,
147
M68KDummySync,
148
M68KDummyGetDReg,
149
M68KDummyGetAReg,
150
M68KDummyGetPC,
151
M68KDummyGetSR,
152
M68KDummyGetUSP,
153
M68KDummyGetMSP,
154
M68KDummySetDReg,
155
M68KDummySetAReg,
156
M68KDummySetPC,
157
M68KDummySetSR,
158
M68KDummySetUSP,
159
M68KDummySetMSP,
160
M68KDummySetFetch,
161
M68KDummySetIRQ,
162
M68KDummyWriteNotify,
163
M68KDummySetReadB,
164
M68KDummySetReadW,
165
M68KDummySetWriteB,
166
M68KDummySetWriteW
167
};
168
169