I started by comparing a disassembly trace from MAME (using the trace command in the debugger) with one Mini vMac (compiled with WantDisasm, and modified to log every instruction), since I had tried Winter Games on MAME some years ago and knew it worked there.
I made
this python script to annotate the trace with trap names, and procedure names from the ROM disassembly, and focused on what happened after the call to _Write that you pointed out before.
This showed that the only thing being called was Wintergames' own VBL task, but not the sound task, which I could see being called in MAME, and I could also see the call to _VInstall from E_Sound_Prime.
Some code added to Mini vMac to print the VBL queue before/after VInstall and when processing VBL interrupts made clear that the sound task wasn't being installed:
LOCALPROC PrintVBLQueue()
{
if (get_ram_long(0x162)) {
dbglog_writeln(" ; VBL Queue:");
} else {
dbglog_writeln(" ; VBL Queue is empty");
}
for(uint32_t elem = get_ram_long(0x162); elem; elem = get_ram_long(elem)) {
uint32_t service_routine = get_ram_long(elem+6);
uint16_t timeout_count = get_ram_word(elem+0xA);
uint16_t phase_count = get_ram_word(elem+0xC);
dbglog_writeCStr(" ; 0x");
dbglog_writeHex(service_routine);
dbglog_writeCStr(", T=");
dbglog_writeNum(timeout_count);
dbglog_writeCStr(", P=");
dbglog_writeNum(phase_count);
dbglog_writeReturn();
}
}
GLOBALPROC DisasmOneOrSave(ui5r pc)
{
switch (pc) {
case 0x401B12:
// P_mVBLInt_VIA
PrintVBLQueue();
break;
case 0x401C2A:
// _VInstall
dbglog_writeln("_VInstall:");
PrintVBLQueue();
break;
case 0x401C72:
// end of _VInstall
dbglog_writeln("end of _VInstall:");
PrintVBLQueue();
break;
default:
break;
}
...
I've created a ResPatch "patch file" for this patch, and added to the ResPatch page at the Garden:
https://macintoshgarden.org/apps/respatch-10
Thanks for discovering this! Oddly on my version of mini vMac, I still get an auto-restart from the main menu ... however, at least I get to watch the intro scene! Maybe because my Mini vMac is set to 4 MB?
That's weird, I've tried patching the 400K disk image with a Hex Editor, and also using ResPatch (by copying the app to another disk and then back to the 400K disk), and they both work for me with the release version of Mini vMac 36.04, emulating a 4MB Mac Plus (minivmac-36.04-mc64).