MCPcopy Create free account
hub / github.com/TASEmulators/fceux / save

Method save

src/debugsymboltable.cpp:228–337  ·  view source on GitHub ↗

--------------------------------------------------------------

Source from the content-addressed store, hash-verified

226}
227//--------------------------------------------------------------
228int debugSymbolPage_t::save(void)
229{
230 FILE *fp;
231 debugSymbol_t *sym;
232 std::map <int, debugSymbol_t*>::iterator it;
233 const char *romFile;
234 std::string filename;
235 char stmp[512];
236 int i,j;
237
238 if ( symMap.size() == 0 )
239 {
240 //printf("Skipping Empty Debug Page Save\n");
241 return 0;
242 }
243 if ( _pageNum == -2 )
244 {
245 //printf("Skipping Register Debug Page Save\n");
246 return 0;
247 }
248
249 romFile = getRomFile();
250
251 if ( romFile == nullptr )
252 {
253 return -1;
254 }
255 i=0;
256 while ( romFile[i] != 0 )
257 {
258
259 if ( romFile[i] == '|' )
260 {
261 filename.push_back('.');
262 }
263 else
264 {
265 filename.push_back(romFile[i]);
266 }
267 i++;
268 }
269
270 if ( _pageNum < 0 )
271 {
272 filename.append(".ram.nl" );
273 }
274 else
275 {
276 char suffix[32];
277
278 sprintf( suffix, ".%X.nl", _pageNum );
279
280 filename.append( suffix );
281 }
282
283 fp = ::fopen( filename.c_str(), "w" );
284
285 if ( fp == nullptr )

Callers

nothing calls this directly

Calls 6

FCEU_printfFunction · 0.85
offsetMethod · 0.80
getRomFileFunction · 0.70
sizeMethod · 0.45
beginMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected