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

Function FCEUSS_LoadFP_old

src/state.cpp:549–640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

547}
548
549int FCEUSS_LoadFP_old(EMUFILE* is, ENUM_SSLOADPARAMS params)
550{
551 //if(params==SSLOADPARAM_DUMMY && suppress_scan_chunks)
552 // return 1;
553
554 int x;
555 uint8 header[16];
556 int stateversion;
557 char* fn=0;
558
559 ////Make temporary savestate in case something screws up during the load
560 //if(params == SSLOADPARAM_BACKUP)
561 //{
562 // fn=FCEU_MakeFName(FCEUMKF_NPTEMP,0,0);
563 // FILE *fp;
564 //
565 // if((fp=fopen(fn,"wb")))
566 // {
567 // if(FCEUSS_SaveFP(fp))
568 // {
569 // fclose(fp);
570 // }
571 // else
572 // {
573 // fclose(fp);
574 // unlink(fn);
575 // free(fn);
576 // fn=0;
577 // }
578 // }
579 //}
580
581 //if(params!=SSLOADPARAM_DUMMY)
582 {
583 FCEUMOV_PreLoad();
584 }
585 is->fread((char*)&header,16);
586 if(memcmp(header,"FCS",3))
587 {
588 return(0);
589 }
590 if(header[3] == 0xFF)
591 {
592 stateversion = FCEU_de32lsb(header + 8);
593 }
594 else
595 {
596 stateversion=header[3] * 100;
597 }
598 //if(params == SSLOADPARAM_DUMMY)
599 //{
600 // scan_chunks=1;
601 //}
602 x=ReadStateChunks(is,*(uint32*)(header+4));
603 //if(params == SSLOADPARAM_DUMMY)
604 //{
605 // scan_chunks=0;
606 // return 1;

Callers 1

FCEUSS_LoadFPFunction · 0.85

Calls 7

FCEUMOV_PreLoadFunction · 0.85
FCEU_de32lsbFunction · 0.85
ReadStateChunksFunction · 0.85
FCEUPPU_LoadStateFunction · 0.85
FCEUSND_LoadStateFunction · 0.85
FCEUMOV_PostLoadFunction · 0.85
freadMethod · 0.80

Tested by

no test coverage detected