• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

ok, "tutor me to bypass bad sector copy protection" challenge

Crutch

Well-known member
Wow that is excellent work!  Soon there will be a ResPatch update to include this patch to Winter Games! 

I spent many many hours Macsbugging my way through this.  It didn’t occur to me that the issue could be specific to the very excellent miniVMac (though it should have).

 
Last edited by a moderator:

cheesestraws

Well-known member
I patched this in Mini vMac's disk driver (by adding a VBL task that does nothing, to keep the queue from being empty), you can download my wintergames branch and build it: 
are you planning on contributing this upstream?  It sounds like something worth fixing.

 

Crutch

Well-known member
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? 

 

zydeco

Well-known member
How did you work it out?
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).

 

techknight

Well-known member
You know, this was a neat read. 

But at the same time, this all seems very familiar, like dejavu. 

I think there was a youtube video done on this very same thing/concept. Was it one of you? 

 

zydeco

Well-known member
Hopefully you do get the patch merged in soon, then looks like the description of Winter Games on Macintosh Garden can be updated to remove the note that Mini vMac doesn't work.

https://macintoshgarden.org/games/winter-games

Keep us posted.


It's been merged into the development snapshot now, and is available in the alpha branch of the variations service .  :)  

You know, this was a neat read. 

But at the same time, this all seems very familiar, like dejavu. 

I think there was a youtube video done on this very same thing/concept. Was it one of you? 


Not me, but I'd be very interested to watch this if you find it!

 
Last edited by a moderator:

Mu0n

Well-known member
Well done Zydeco. I haven't forgotten about this thread even though I have been neglecting this forum for a while. It's currently a wild ride teaching remotely in this semester. 

I'll have to absorb as much knowledge as I can so I can apply it to Déjà Vu from rubicon soft.

 

Mu0n

Well-known member
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? 
I've tried patching a duplicate of Winter Games with your tool and I got this:




 

Mu0n

Well-known member
Alternatively, you can patch Wintergames itself by replacing the VBL task installation with a call to VInstall (in CODE 1 and 3, or you can edit the disk image):

Search: 40 C0 00 40 07 00 46 C0 43 F8 01 62 20 91 22 88 40 C0 02 40 F8 FF 46 C0

Replace with: A0 33 4E 71 4E 71 4E 71 4E 71 4E 71 4E 71 4E 71 4E 71 4E 71 4E 71 4E 71

(a call to _VInstall and NOPs to match the size)


I can't find that string in CODE1 but I could find it in CODE3. I swapped it only there, using ResEdit (my Resorcerer skills aren't high enough to do it with that). It seems to work fine with just CODE3 modified, is that expected?

 

Crutch

Well-known member
Pretty sure the above two posts are the same issue. ResPatch is expecting to find the string in both CODE resources but is only finding it in one, thus the “incomplete” patch message? ... I think. I’ll check it this weekend. Thanks for pointing this out. 

 
Last edited by a moderator:

Crutch

Well-known member
Is that string really not in your CODE 1?  Here it is in mine, which I think I got from your disk image you kindly shared a while back!

I was wrong about ResPatch though.  -34 is a disk full error.  Are you patching in-place on a 400k disk image?  There might not be enough room to save the patch.  Try copying to a larger disk and patching?

Screen Shot 2020-10-23 at 1.26.24 PM.png

 
Last edited by a moderator:
Top