@@ -64,38 +64,14 @@ class EmuInstance
64
64
std::string moveString = " |..|........|" ;
65
65
#endif
66
66
67
- if (move & 0b00010000 )
68
- moveString += ' U' ;
69
- else
70
- moveString += ' .' ;
71
- if (move & 0b00100000 )
72
- moveString += ' D' ;
73
- else
74
- moveString += ' .' ;
75
- if (move & 0b01000000 )
76
- moveString += ' L' ;
77
- else
78
- moveString += ' .' ;
79
- if (move & 0b10000000 )
80
- moveString += ' R' ;
81
- else
82
- moveString += ' .' ;
83
- if (move & 0b00001000 )
84
- moveString += ' S' ;
85
- else
86
- moveString += ' .' ;
87
- if (move & 0b00000100 )
88
- moveString += ' s' ;
89
- else
90
- moveString += ' .' ;
91
- if (move & 0b00000010 )
92
- moveString += ' B' ;
93
- else
94
- moveString += ' .' ;
95
- if (move & 0b00000001 )
96
- moveString += ' A' ;
97
- else
98
- moveString += ' .' ;
67
+ if (move & 0b00010000 ) moveString += ' U' ; else moveString += ' .' ;
68
+ if (move & 0b00100000 ) moveString += ' D' ; else moveString += ' .' ;
69
+ if (move & 0b01000000 ) moveString += ' L' ; else moveString += ' .' ;
70
+ if (move & 0b10000000 ) moveString += ' R' ; else moveString += ' .' ;
71
+ if (move & 0b00001000 ) moveString += ' S' ; else moveString += ' .' ;
72
+ if (move & 0b00000100 ) moveString += ' s' ; else moveString += ' .' ;
73
+ if (move & 0b00000010 ) moveString += ' B' ; else moveString += ' .' ;
74
+ if (move & 0b00000001 ) moveString += ' A' ; else moveString += ' .' ;
99
75
100
76
moveString += " |" ;
101
77
return moveString;
@@ -108,18 +84,16 @@ class EmuInstance
108
84
advanceStateImpl (moveStringToCode (move), 0 );
109
85
}
110
86
111
- inline size_t getStateSize () const { return _stateSize; }
112
- inline size_t getLiteStateSize () const { return _liteStateSize; }
113
87
inline std::string getRomSHA1 () const { return _romSHA1String; }
114
88
115
89
inline hash_t getStateHash () const
116
90
{
117
91
MetroHash128 hash;
118
92
119
93
hash.Update (getLowMem (), _LOW_MEM_SIZE);
120
- hash.Update (getHighMem (), _HIGH_MEM_SIZE);
121
- hash.Update (getNametableMem (), _NAMETABLES_MEM_SIZE);
122
- hash.Update (getChrMem (), getChrMemSize ());
94
+ // hash.Update(getHighMem(), _HIGH_MEM_SIZE);
95
+ // hash.Update(getNametableMem(), _NAMETABLES_MEM_SIZE);
96
+ // hash.Update(getChrMem(), getChrMemSize());
123
97
124
98
hash_t result;
125
99
hash.Finalize (reinterpret_cast <uint8_t *>(&result));
@@ -134,14 +108,14 @@ class EmuInstance
134
108
std::string stateData;
135
109
bool status = loadStringFromFile (stateData, stateFilePath);
136
110
if (status == false ) EXIT_WITH_ERROR (" Could not find/read state file: %s\n " , stateFilePath.c_str ());
137
- deserializeState ((uint8_t *)stateData.data ());
111
+ deserializeFullState ((uint8_t *)stateData.data ());
138
112
}
139
113
140
114
inline void saveStateFile (const std::string &stateFilePath) const
141
115
{
142
116
std::string stateData;
143
- stateData.resize (_stateSize );
144
- serializeState ((uint8_t *)stateData.data ());
117
+ stateData.resize (_fullStateSize );
118
+ serializeFullState ((uint8_t *)stateData.data ());
145
119
saveStringToFile (stateData, stateFilePath.c_str ());
146
120
}
147
121
@@ -159,10 +133,10 @@ class EmuInstance
159
133
if (status == false ) EXIT_WITH_ERROR (" Could not process ROM file: %s\n " , romFilePath.c_str ());
160
134
161
135
// Detecting full state size
162
- _stateSize = getStateSizeImpl ();
136
+ _fullStateSize = getFullStateSize ();
163
137
164
138
// Detecting lite state size
165
- _liteStateSize = getLiteStateSizeImpl ();
139
+ _liteStateSize = getLiteStateSize ();
166
140
}
167
141
168
142
// Virtual functions
@@ -174,10 +148,15 @@ class EmuInstance
174
148
virtual uint8_t *getHighMem () const = 0;
175
149
virtual const uint8_t *getChrMem () const = 0;
176
150
virtual size_t getChrMemSize () const = 0;
177
- virtual void serializeState (uint8_t *state) const = 0;
178
- virtual void deserializeState (const uint8_t *state) = 0;
179
- virtual size_t getStateSizeImpl () const = 0;
180
- virtual size_t getLiteStateSizeImpl () const { return getStateSizeImpl (); };
151
+ virtual void serializeFullState (uint8_t *state) const = 0;
152
+ virtual void deserializeFullState (const uint8_t *state) = 0;
153
+ virtual void serializeLiteState (uint8_t *state) const = 0;
154
+ virtual void deserializeLiteState (const uint8_t *state) = 0;
155
+ virtual size_t getFullStateSize () const = 0;
156
+ virtual size_t getLiteStateSize () const = 0;
157
+ virtual void enableLiteStateBlock (const std::string& block) = 0;
158
+ virtual void disableLiteStateBlock (const std::string& block) = 0;
159
+
181
160
virtual void doSoftReset () = 0;
182
161
virtual void doHardReset () = 0;
183
162
virtual std::string getCoreName () const = 0;
@@ -190,7 +169,7 @@ class EmuInstance
190
169
size_t _liteStateSize;
191
170
192
171
// Storage for the full state size
193
- size_t _stateSize ;
172
+ size_t _fullStateSize ;
194
173
195
174
// Flag to determine whether to enable/disable rendering
196
175
bool _doRendering = true ;
0 commit comments