[comp.sys.mac.games] Mine Sweeper control click patch

huff@mcclb0.med.nyu.edu (Edward J. Huff) (05/31/91)

After losing a few Mine Sweeper games by holding down the wrong key 
while clicking on a square which I knew hid a mine, I decided 
it was time for MacNosy, to fix the program to accept any modifier 
key instead of just the shift key.  MacNosy works great, although 
the user interface is more than a little weird.  It is a very good 
disassembler with a lot of knowledge of Macintosh conventions built in.

I found the appropriate code by first looking with ResEdit at the
resources.  I found that the little pictures are all in a SICN (small
icon) resource.  So I looked in Nosy's system trap cross reference
for references to GetResource and found DRAWSICN.  I looked at places
which call DRAWSICN and by placing breakpoints, found one which
is called when the shift key is held down. It was in function CLICKMIN.
Then I found the code which tests a bit from the event record, and 
modified it so it tests the whole word instead of just the shift key bit.

First, make sure you have the same program I'm talking about.  It
was distributed with the following note:

>Group: comp.binaries.mac, Item 3326
>Subject: Mine Sweeper
>From: woody@tybalt.caltech.edu (William Edward Woody)
>Date: 17 May 91 04:00:42 EDT
>
>[Mine Sweeper]
>
>Here's an addictive little game based on a similar game I have been
>playing under Microsoft Windows.  It's yet another variant of the Mine       
>Sweeper/Mine Field games; in this game, the object is to find the    
>location of all the mines in an otherwise covered landscape.         
>  
>This is not a public domain program, though you are encouraged to    
>distribute it as far and as wide as possible.  I only ask that the   
>program be distributed unmolested, and not for significant financial 
>gain.    
>  
>                                -- Bill         

To install the patch, obtain the new ResEdit version 2.1 from 
ftp.apple.com. No doubt you can do it with the old ResEdit, but
the new one is a lot better.

"Version 2.1 of ResEdit is a fully-tested, non-beta release which 
supersedes the v1.2 release and interim beta releases (notably v2.0b2).
If you've obtained the ResEdit software without documentation, be 
aware that the ResEdit Reference book will be available in February 
1991 from the Apple Programmers and Developers Association.
ResEdit Reference will also be distributed to bookstores worldwide 
by the Addison-Wesley Publishing Company. Ask for it at your favorite 
bookstore!"

Next, open a copy of Mine Sweeper.  Open DITL ID 128.  Drag the v1.0 
item to the top and widen it.  Double click on v1.0 to open the string
and modify it to read "v1.0 with cmd/opt/ctl patch".  Close the string
edit window and make sure the whole string is visible.

Close the DITL windows and open CODE resource #2.  Scroll down to
location 22C0.  Change 082E 0001 0010 6700 to 4A6E 0010 4E71 6700.
They haven't changed the hex input routine, it is still strange.
Make sure you didn't change the length of the code resource.
The surrounding lines should read
0022B8 FFE8 4EBA F430 508F 
0022C0 4A6E 0010 4E71 6700 
0022C8 00E8 302E FFE6 C1FC
The last line should be 0028D8 494E.

Then close the file and launch it.  Try the about button to be sure
the patch notice shows.  Then try command click, option click, and 
control click.  They should all work like shift click.

Please do not distribute the modified version without permission.