Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/yabause/src/m68kcore.h
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
#ifndef M68KCORE_H
21
#define M68KCORE_H
22
23
#include "core.h"
24
25
#define M68KCORE_DEFAULT -1
26
#define M68KCORE_DUMMY 0
27
#define M68KCORE_C68K 1
28
#define M68KCORE_Q68 2
29
30
typedef u32 FASTCALL M68K_READ(const u32 adr);
31
typedef void FASTCALL M68K_WRITE(const u32 adr, u32 data);
32
33
typedef struct {
34
int id;
35
const char *Name;
36
37
int (*Init)(void);
38
void (*DeInit)(void);
39
void (*Reset)(void);
40
41
s32 FASTCALL (*Exec)(s32 cycle);
42
void (*Sync)(void);
43
44
u32 (*GetDReg)(u32 num);
45
u32 (*GetAReg)(u32 num);
46
u32 (*GetPC)(void);
47
u32 (*GetSR)(void);
48
u32 (*GetUSP)(void);
49
u32 (*GetMSP)(void);
50
51
void (*SetDReg)(u32 num, u32 val);
52
void (*SetAReg)(u32 num, u32 val);
53
void (*SetPC)(u32 val);
54
void (*SetSR)(u32 val);
55
void (*SetUSP)(u32 val);
56
void (*SetMSP)(u32 val);
57
58
void (*SetFetch)(u32 low_adr, u32 high_adr, pointer fetch_adr);
59
void FASTCALL (*SetIRQ)(s32 level);
60
void FASTCALL (*WriteNotify)(u32 address, u32 size);
61
62
void (*SetReadB)(M68K_READ *Func);
63
void (*SetReadW)(M68K_READ *Func);
64
void (*SetWriteB)(M68K_WRITE *Func);
65
void (*SetWriteW)(M68K_WRITE *Func);
66
} M68K_struct;
67
68
extern M68K_struct * M68K;
69
70
int M68KInit(int coreid);
71
72
extern M68K_struct M68KDummy;
73
extern M68K_struct M68KC68K;
74
extern M68K_struct M68KQ68;
75
76
#endif
77
78