< Homer>D'oh!< /Homer>
Ok, it turned out I (once again) coded something that was quick/easy/lazy that (once again) worked fine on Simulator but went 'over the line' on actual hardware.
In several places I do something like this (level serialization for all levels - '<delete|read|write>' just means one of those is done depending on need, that's not actually/literally in the code):
local gamesName = "games_"
local chestsName = "chests_"
local fogName = "fog_"
local messagesName = "messages_"
local mobsName = "mobs_"
local pickupsName = "pickups_"
local staticName = "static_"
local triggersName = "triggers_"
local indexName = ""
for index = 1, MaxLevels, 1 do
indexName = tostring(index)
playdate.datastore.<delete|read|write>(chestsName .. indexName)
playdate.datastore.<delete|read|write>(fogName .. indexName)
playdate.datastore.<delete|read|write>(messagesName .. indexName)
playdate.datastore.<delete|read|write>(mobsName .. indexName)
playdate.datastore.<delete|read|write>(pickupsName .. indexName)
playdate.datastore.<delete|read|write>(staticName .. indexName)
playdate.datastore.<delete|read|write>(triggersName .. indexName)
end
So, waaaay back in time I didn't know how many levels we'd wind up with, so I set MaxLevels to something 'big' (256). Which still works fine (on Simulator) with the lazy code above, 'cause if there's an attempted datastore operation for a chunk-o-state for a level that doesn't actually exist (like 'pickups_22' when there's only 10 levels) then that datastore op will 'just fail', no harm no foul.
And that 'works' on actual hardware, too... until it doesn't, as the time wasted doing 240-ish * 7 failed datastore ops on hardware (much slower I/O than Simulator) turns out to have been what was pushing things past the watchdog timer edge.
I went back and set MaxLevels to the actual number of levels (10 or so) and now game slot save/restore is just under 8 seconds on actual hardware, no longer hitting the watchdog time and is working fine.
I'd still like to see a way to adjust that hard 10 second watchdog in future, though - there may be circumstances where it isn't practical to work around it.