My first efforts to adapt my template for the larger slot 10 mission saves have failed miserably. I'll document what I've learned so far as a lead-in to another investigation.
If a PC player saves during a mission using a saveanywhere script that doesn't check for OM0 (not that that matters much anymore) the save will crash when loaded, but the glitch can be fixed by putting the thread to sleep and killing it with cleo. These saves load just fine in my template without modification, but it doesn't look like the "mission" gets saved, it's just a "thread" with the properties of the mission. SASE also reads these threads without issue.
I tried again to kill an active mission thread on PC without any luck. Setting the wake time to something large keeps it from crashing right away, but tweaking other variables isn;t helping.
isActive = 0 loads but cleo scripts don't work so I can't save.
isActive = -1 can be saved but the mission thread persists in the save.
Fiddling with the short index at the start of the record always produced a crash.
I can't think of anything else that might cause the thread to end by randomly fiddling with the settings. Instead I think I'll look for something in the standard scripts that can kill a sleeping thread for me if I rename it properly. Any suggestions?
Can anyone explain the "range" of the pointers at the start of the thread structures. I'm trying to estimate the range of possible pointer values for pPrev (+6) and currentIP (+22) of the main thread, which should always be located at a static offset in mobile saves. My hypothesis is that I can detect the difference between iOS and Android pointers. Android uses global and local memory addresses quite differently than PC, leading to huge values for most pointers.
pPrev (dword preceding "main"):
A2886CF0 - Android
006B59B4 - iOS
00A90590 - PCv1
I'm not sure what to expect from the Remastered version. I have no known examples to work with. And I only have known iOS saves from one source, which isn't helping. Anyone have a save to donate? Anything will do - start a new game, move away from the bike so the safehouse icons can appear, and pause to produce a slot 10 quicksave. Android saves are useful too. I assume most of what I see are Android saves but I can't tell for sure yet.
Missions in Mobile Saves
From what I can tell the whole mission is saved in-line with the other threads as I see plenty of strings that associate with this mission, and there's a chance that other threads can exist after a mission thread. The structure varies from a thread right away - the thread name is offset by -5 and not even the index looks right. So... stumped again for a while. I think I'll go back to my global variable translation table and look for a what to convert it for 010 so I can finally get my object cleanup scripts working.
Can anyone explain the function of the short index that begins each thread? It seems to be the only hint that a mission is impending in a mobile save. Scanning through thread indexes I find a lot of values in the 0x45 range, give or take a dozen or so, but I haven't worked out a meaning of the values. But when I encounter a mission as the next thread, this example reads as 0x8046. So I'm thinking that 80 byte is flagging it as a mission. The index short is followed by an unknown mobile dword, always -1 as far as I've seen. Then I get 03A4: name_thread 'CRASH1' 0050: gosub and I get lost as I'm not as good at decompiling as Sanny is. How am I supposed to know where the mission ends? I just want to block around it.