|
| 1 | +S32 xSGT_LoadPrefsCB(void* vp, st_XSAVEGAME_DATA* xsgdata, st_XSAVEGAME_READCONTEXT* rctxt, U32 ui, |
| 2 | + S32 i) |
| 3 | +{ |
| 4 | + U32 stereo; |
| 5 | + |
| 6 | + xSGReadData(xsgdata, rctxt, &stereo, 1); |
| 7 | + xSGReadData(xsgdata, rctxt, &gSnd.categoryVolFader[2], 1); |
| 8 | + xSGReadData(xsgdata, rctxt, &gSnd.categoryVolFader[0], 1); |
| 9 | + xSGReadData(xsgdata, rctxt, &globals.option_vibration, 1); |
| 10 | + if (globals.option_vibration != 0) |
| 11 | + { |
| 12 | + xPadRumbleEnable(globals.currentActivePad, 1); |
| 13 | + } |
| 14 | + else |
| 15 | + { |
| 16 | + xPadRumbleEnable(globals.currentActivePad, 0); |
| 17 | + } |
| 18 | + return 1; |
| 19 | +} |
| 20 | + |
| 21 | +S32 xSGT_LoadLoadCB(void* vp, st_XSAVEGAME_DATA* xsgdata, st_XSAVEGAME_READCONTEXT* rctxt, U32 ui, |
| 22 | + S32 i) |
| 23 | +{ |
| 24 | + char bigbuf[32] = {}; |
| 25 | + S32 compdiff = 0; |
| 26 | + |
| 27 | + xSGReadData(xsgdata, rctxt, bigbuf, 1, strlen(currSceneStr)); |
| 28 | + if (strlen(currSceneStr) != strlen(bigbuf)) |
| 29 | + { |
| 30 | + compdiff = 1; |
| 31 | + } |
| 32 | + if (compdiff == 0) |
| 33 | + { |
| 34 | + strcpy(sceneRead, bigbuf); |
| 35 | + } |
| 36 | + |
| 37 | + return compdiff == 0; |
| 38 | +} |
| 39 | + |
| 40 | +S32 xSGT_SaveProcPrefsCB(void* vp, st_XSAVEGAME_DATA* xsgdata, st_XSAVEGAME_WRITECONTEXT* wctxt) |
| 41 | +{ |
| 42 | + int sum = 0; |
| 43 | + sum += xSGWriteData(xsgdata, wctxt, &gSnd.stereo, 1); |
| 44 | + sum += xSGWriteData(xsgdata, wctxt, &gSnd.categoryVolFader[2], 1); |
| 45 | + sum += xSGWriteData(xsgdata, wctxt, &gSnd.categoryVolFader[0], 1); |
| 46 | + sum += xSGWriteData(xsgdata, wctxt, &globals.option_vibration, 1); |
| 47 | + return sum + 1; |
| 48 | +} |
| 49 | + |
| 50 | +S32 xSGT_SaveInfoPrefsCB(void* p1, st_XSAVEGAME_DATA* data, S32* i, S32* j) |
| 51 | +{ |
| 52 | + *i = 16; |
| 53 | + *j = *i * 2; |
| 54 | + return 1; |
| 55 | +} |
| 56 | + |
| 57 | +S32 xSGT_SaveProcCB(void* vp, st_XSAVEGAME_DATA* xsgdata, st_XSAVEGAME_WRITECONTEXT* wctxt) |
| 58 | +{ |
| 59 | + if (globals.sceneCur->sceneID == 'PG12') |
| 60 | + { |
| 61 | + strcpy(currSceneStr, xUtil_idtag2string('HB01', 0)); |
| 62 | + } |
| 63 | + else |
| 64 | + { |
| 65 | + strcpy(currSceneStr, xUtil_idtag2string(globals.sceneCur->sceneID, 0)); |
| 66 | + } |
| 67 | + return xSGWriteData(xsgdata, wctxt, currSceneStr, 1, strlen(currSceneStr)) + 1; |
| 68 | +} |
| 69 | + |
| 70 | +S32 xSGT_SaveInfoCB(void* vp, st_XSAVEGAME_DATA* xsgdata, S32* need, S32* most) |
| 71 | +{ |
| 72 | + *need = xSGWriteStrLen(currSceneStr); |
| 73 | + *most = *need << 1; |
| 74 | + return 1; |
| 75 | +} |
0 commit comments