aboutsummaryrefslogtreecommitdiff
path: root/source/spc7110.h
blob: 92fb1d37bf2651ece511f5cfa0b22ad63979be88 (plain)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#include "../copyright"

#ifndef _spc7110_h
#define _spc7110_h
#include "port.h"

#define DECOMP_BUFFER_SIZE 0x10000

extern void (*LoadUp7110)(char*);
extern void (*CleanUp7110)(void);
extern void (*Copy7110)(void);

extern uint16_t cacheMegs;

void Del7110Gfx(void);
void Close7110Gfx(void);
void Drop7110Gfx(void);
uint8_t S9xGetSPC7110(uint16_t Address);
uint8_t S9xGetSPC7110Byte(uint32_t Address);
uint8_t* Get7110BasePtr(uint32_t);
void S9xSetSPC7110(uint8_t data, uint16_t Address);
void S9xSpc7110Init();
uint8_t* Get7110BasePtr(uint32_t);
void S9xSpc7110Reset();
void S9xUpdateRTC();
void Do7110Logging();
int   S9xRTCDaysInMonth(int month, int year);

//These are platform-dependant functions, but should work on
//most systems that use GNU compilers, and on Win32.
void SPC7110Load(char*);
void SPC7110Open(char*);
void SPC7110Grab(char*);

typedef struct SPC7110RTC
{
   unsigned char reg[16];
   int16_t       index;
   uint8_t       control;
   bool          init;
   time_t        last_used;
} S7RTC;

typedef struct SPC7110EmuVars
{
   unsigned char reg4800;
   unsigned char reg4801;
   unsigned char reg4802;
   unsigned char reg4803;
   unsigned char reg4804;
   unsigned char reg4805;
   unsigned char reg4806;
   unsigned char reg4807;
   unsigned char reg4808;
   unsigned char reg4809;
   unsigned char reg480A;
   unsigned char reg480B;
   unsigned char reg480C;
   unsigned char reg4811;
   unsigned char reg4812;
   unsigned char reg4813;
   unsigned char reg4814;
   unsigned char reg4815;
   unsigned char reg4816;
   unsigned char reg4817;
   unsigned char reg4818;
   unsigned char reg4820;
   unsigned char reg4821;
   unsigned char reg4822;
   unsigned char reg4823;
   unsigned char reg4824;
   unsigned char reg4825;
   unsigned char reg4826;
   unsigned char reg4827;
   unsigned char reg4828;
   unsigned char reg4829;
   unsigned char reg482A;
   unsigned char reg482B;
   unsigned char reg482C;
   unsigned char reg482D;
   unsigned char reg482E;
   unsigned char reg482F;
   unsigned char reg4830;
   unsigned char reg4831;
   unsigned char reg4832;
   unsigned char reg4833;
   unsigned char reg4834;
   unsigned char reg4840;
   unsigned char reg4841;
   unsigned char reg4842;
   uint8_t       AlignBy;
   uint8_t       written;
   uint8_t       offset_add;
   uint32_t      DataRomOffset;
   uint32_t      DataRomSize;
   uint32_t      bank50Internal;
   uint8_t       bank50[DECOMP_BUFFER_SIZE];
} SPC7110Regs;

extern SPC7110Regs s7r;
extern S7RTC rtc_f9;

// These are defined in spc7110.cpp
bool S9xSaveSPC7110RTC(S7RTC* rtc_f9);
bool S9xLoadSPC7110RTC(S7RTC* rtc_f9);

#endif