1/*****************************************************************************\
2 Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
3 This file is licensed under the Snes9x License.
4 For further information, consult the LICENSE file in the root directory.
5\*****************************************************************************/
6
7#ifndef _SPC7110_H_
8#define _SPC7110_H_
9
10#define SPC7110_DECOMP_BUFFER_SIZE 64
11
12// for snapshot only
13struct SSPC7110Snapshot
14{
15 uint8 r4801;
16 uint8 r4802;
17 uint8 r4803;
18 uint8 r4804;
19 uint8 r4805;
20 uint8 r4806;
21 uint8 r4807;
22 uint8 r4808;
23 uint8 r4809;
24 uint8 r480a;
25 uint8 r480b;
26 uint8 r480c;
27
28 uint8 r4811;
29 uint8 r4812;
30 uint8 r4813;
31 uint8 r4814;
32 uint8 r4815;
33 uint8 r4816;
34 uint8 r4817;
35 uint8 r4818;
36
37 uint8 r481x;
38
39 bool8 r4814_latch; // bool
40 bool8 r4815_latch; // bool
41
42 uint8 r4820;
43 uint8 r4821;
44 uint8 r4822;
45 uint8 r4823;
46 uint8 r4824;
47 uint8 r4825;
48 uint8 r4826;
49 uint8 r4827;
50 uint8 r4828;
51 uint8 r4829;
52 uint8 r482a;
53 uint8 r482b;
54 uint8 r482c;
55 uint8 r482d;
56 uint8 r482e;
57 uint8 r482f;
58
59 uint8 r4830;
60 uint8 r4831;
61 uint8 r4832;
62 uint8 r4833;
63 uint8 r4834;
64
65 uint32 dx_offset; // unsigned
66 uint32 ex_offset; // unsigned
67 uint32 fx_offset; // unsigned
68
69 uint8 r4840;
70 uint8 r4841;
71 uint8 r4842;
72
73 int32 rtc_state; // enum RTC_State
74 int32 rtc_mode; // enum RTC_Mode
75 uint32 rtc_index; // unsigned
76
77 uint32 decomp_mode; // unsigned
78 uint32 decomp_offset; // unsigned
79
80 uint8 decomp_buffer[SPC7110_DECOMP_BUFFER_SIZE];
81
82 uint32 decomp_buffer_rdoffset; // unsigned
83 uint32 decomp_buffer_wroffset; // unsigned
84 uint32 decomp_buffer_length; // unsigned
85
86 struct ContextState
87 {
88 uint8 index;
89 uint8 invert;
90 } context[32];
91};
92
93extern struct SSPC7110Snapshot s7snap;
94
95void S9xInitSPC7110 (void);
96void S9xResetSPC7110 (void);
97void S9xSPC7110PreSaveState (void);
98void S9xSPC7110PostLoadState (int);
99void S9xSetSPC7110 (uint8, uint16);
100uint8 S9xGetSPC7110 (uint16);
101uint8 S9xGetSPC7110Byte (uint32);
102uint8 * S9xGetBasePointerSPC7110 (uint32);
103
104#endif
105