X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2FArea.c;h=0ec25ecc49b85415e2ec0ee3e4b0968ef84a7fa1;hb=fad248933b6676d30ccf419858b4ee10cc123fc5;hp=68d7c7c63678e9fe1bfb9e68622de1b76481df39;hpb=71bb1b7bd0186eb056609fec62a134dcaadbffdf;p=picodrive.git diff --git a/Pico/Area.c b/Pico/Area.c index 68d7c7c..0ec25ec 100644 --- a/Pico/Area.c +++ b/Pico/Area.c @@ -28,6 +28,8 @@ areaeof *areaEof = (areaeof *) 0; areaseek *areaSeek = (areaseek *) 0; areaclose *areaClose = (areaclose *) 0; +void (*PicoLoadStateHook)(void) = NULL; + // Scan one variable and callback static int ScanVar(void *data,int len,char *name,void *PmovFile,int PmovAction) @@ -177,7 +179,11 @@ int PmovState(int PmovAction, void *PmovFile) if ((PicoMCD & 1) || carthw_chunks != NULL) { if (PmovAction&1) return PicoCdSaveState(PmovFile); - if (PmovAction&2) return PicoCdLoadState(PmovFile); + if (PmovAction&2) { + int ret = PicoCdLoadState(PmovFile); + if (PicoLoadStateHook) PicoLoadStateHook(); + return ret; + } } memset(head,0,sizeof(head)); @@ -197,6 +203,8 @@ int PmovState(int PmovAction, void *PmovFile) // Scan memory areas: PicoAreaScan(PmovAction, *(unsigned int *)(head+0x8), PmovFile); + if ((PmovAction&2) && PicoLoadStateHook) PicoLoadStateHook(); + return 0; }