-
Notifications
You must be signed in to change notification settings - Fork 6
/
md.h
63 lines (54 loc) · 1.06 KB
/
md.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// Board internal state.
#pragma once
#include "68k.h"
#include "z80.h"
#include "fc1004.h"
#define MCLK_NTSC 53693182
#define MCLK_PAL 53203425
extern m68k_t m68k;
extern z80_t z80;
extern fc1004_t ym;
extern unsigned char ram[0x10000];
extern unsigned char zram[8192];
#pragma pack(push, 1)
/// <summary>
/// Motherboard interconnects and other context.
/// Just a little bragging on my knowledge of the C standard: type definitions ending in `_t` should only be used for types reserved by the standard, so not `md_state_t` :-P
/// </summary>
typedef struct _md_state
{
int vclk;
int vaddress;
int vdata;
int zaddress;
int zdata;
int dtack;
int hsync;
int m3;
int ntsc;
int cart;
int wres;
int disk;
int port_a;
int port_b;
int port_c;
int jap;
int as;
int lds;
int uds;
int reset;
int halt;
int rw;
int iorq;
int mreq;
int wr;
int rd;
int ovclk;
int odclk;
} md_state;
#pragma pack(pop)
extern md_state md;
extern uint64_t mcycles;
// Used to initiate the save/load state process
extern int pending_save_state;
extern int pending_load_state;