Magic Cap Simulator


How do I get more fonts into Magic Cap?


Here are the steps necessary to import an styled version of a Macintosh font into Magic Cap. Geneva (Italic) 9 is used here as the example.

  1. Find the font you want to import, such as Geneva (Italic) 9, and copy it to a separate file.
  2. Open this file with ResEdit, and open the 'FOND' resources.
  3. Select the 'FOND' resource, choose "Get Resource Info" from the File name, and change the name of the resource to "GenevaItalic".
  4. Open the 'FOND' resource and scroll to the Font Style field, near the end.
  5. Change the value in the Font Style field to 0. This makes the font a "plain styled" font. Magic Cap only imports plain styles, so we're fooling it into thinking this IS the plain style.
  6. Close the file and save the changes.
  7. Drop the font file on the System Folder to install it in the system's Font Folder. (You can ignore the alert that says this font won't be available in running applications etc.)
  8. Launch Magic Cap, and paste the text "GenevaItalic 9". This will create a TextStyleCoupon, which you can examine with the Inspector and deep dump for inclusion in your package. (Magic Cap can import TrueType fonts. Just specify the point size that you want to import in the text you paste.)
  9. After selecting Dump Inspector Target Deep from the Examine menu in Magic Cap, go to MPW and select select Echo Log from the Utils menu. Copy the TextStyleCoupon, TextStyle, BitmapFont, Pixels, and Text objects into your Objects.Def file. You will need to replace object IDs with instance IDs for the dumped objects. You can do this by choosing "Convert ObjectIDs to Instance IDs" from the Utils menu in MPW.
  10. Create an ObjectList that lists the BitMapFont, and give the ObjectList the name of the font. This list contains all the faces for each size and style of the font family.
  11. Add the ObjectList to the Install list and specify iFaces as the Receiver.

Note: There's a bug in Magic Cap 1.0 where if you try to import a font whose name contains as a substring the name of a font that is already in Magic Cap (i.e., Century Schoolbook v. Book), the imported font will show up as the pre-existing font. You can work around this by picking a different name when you rename the 'FOND' resource in step 3.


How can I make my own border images?


You can create images in MacPaint or some other paint program, copy them to the clipboard, and paste them into MagicCap. MacPaint will create 1 bit images, other applications can create multibit images, but there probably isn't much point to more than 2 bit images, since that's all the devices can display.

To convert these images to BorderCoupons, copy one of the system border coupons, look at it in the Inspector and select "Dump Inspector Target Deep" from the Examine menu. Do the same thing with the image coupon you pasted as well. Next, go to MPW and choose "Echo Log" from the Utils menu. Change the "Instance ImageCoupon" to "Instance BorderCoupon" and for the couponObject field change "Image" to "BorderImage". Now change "Instance Image" to "Instance BorderImage", and add the contentRect and repeatRect fields to your new BorderImage instance. You now (almost) have a working BorderCoupon.

The contentRect and repeatRect fields determine how the border contents are drawn and what the border should look like when it gets stretched. The contentRect is fairly simple, the contents (text, stamps, etc.) will be clipped to this rectangle, therefore the rectangle should be inscribed within your border image. The repeatRect is really the intersection of two rectangles that are used to stretch the border image. If you were to extend the lines of this rectangle to the edges of the image, you would divide the image into nine pieces, much like a tic-tac-toe board. When the border gets stretched, the corner pieces do not get repeated, just moved. The space between the corners gets filled by repeating the image from the side pieces. If you create a pattern that repeats every 2 or more pixels, you will get partial patterns whenever the size of the border is not a multiple of your pattern size.

Below is a sample BorderCoupon that was created with this method. You will need to adjust the instance IDs and the next, previous, and superview fields of the BorderCoupon for inclusion in a scene of your own.

Instance BorderCoupon 17;
           next: nilObject;
       previous: (BorderCoupon 14);
      superview: (Scene 'Closet' 10);
        subview: nilObject;
 relativeOrigin: <51.5,17.5>;
    contentSize: <94.0,73.0>;
      viewFlags: 0x70001200;
     labelStyle: {60,1};
          color: 0xFF000000;
       altColor: 0xFF000000;
         shadow: nilObject;
          sound: nilObject;
   couponObject: (BorderImage 'Celtic 2' 18);
       selector: 0;
         amount: 0;
End Instance;

Instance BorderImage 'Celtic 2' 18;
           next: nilObject;
       previous: nilObject;
     imageFlags: 0x00800000;
      imageSize: 96,55;
     resolution: 256.s;
          depth: 1.s;
       centerPt: 48,27;
          crc32: 0x76A093CD;
    contentRect: 14,14,82,41;
     repeatRect: 30,20,65,35;
           data: $ F5FF 0080 F700 0401 BFE0 607F FDFF 06FE 0607 FDBF F0F0 FBFF 060F 0FFD B039 F9C0 \
                 $ FD00 0703 9F9C 0DB0 1393 80FD 0006 01C9 C80D B007 07FB 0005 E0E0 0DB0 0E0E FB00 \
                 $ 0670 700D B01C 9C80 FD00 0701 3938 0DB0 39F9 C0FD 0006 039F 9C0D B870 F0FB FF06 \
                 $ 0F0E 1D9C E060 7FFD FF05 FE06 0739 8E40 F900 0302 7187 07F9 FF03 E0E1 8384 F900 \
                 $ 0321 C189 C4F9 0003 2391 9CE4 F900 0327 39B8 74F9 0003 2E1D B034 F900 032C 0DB0 \
                 $ 34F9 0003 2C0D B034 F900 032C 0DB0 34F9 0003 2C0D B034 F900 032C 0DB0 34F9 0003 \
                 $ 2C0D B034 F900 032C 0DB0 34F9 0003 2C0D B034 F900 032C 0DB0 34F9 0003 2C0D B034 \
                 $ F900 032C 0DB0 34F9 0003 2C0D B034 F900 032C 0DB0 34F9 0003 2C0D B034 F900 032C \
                 $ 0DB0 34F9 0003 2C0D B034 F900 032C 0DB0 34F9 0003 2C0D B034 F900 032C 0DB8 74F9 \
                 $ 0003 2E1D 9CE4 F900 0327 3989 C4F9 0003 2391 8384 F900 0321 C187 07F9 FF03 E0E1 \
                 $ 8E40 F900 0502 719C E060 7FFD FF06 FE06 0739 B870 F0FB FF06 0F0E 1DB0 39F9 C0FD \
                 $ 0007 039F 9C0D B01C 9C80 FD00 0601 3938 0DB0 0E0E FB00 0570 700D B007 07FB 0006 \
                 $ E0E0 0DB0 1393 80FD 0007 01C9 C80D B039 F9C0 FD00 0603 9F9C 0DBF F0F0 FBFF 060F \
                 $ 0FFD BFE0 607F FDFF 04FE 0607 FD80 F700 0001 F5FF;
End Instance;

How do I dump the script of an object?


Dumping scripts has always been a little bit awkward and mysterious (i.e. nothing has changed).

There are two ways to effectively dump a script so you can compile and run it again later.

  1. Dump the entire package. The code that dumps a package knows how to "do the right thing" with scripts.
  2. Open the inspector. Then, edit your script (option-tinker, etc). Close the script editing window. You'll see the inspector looking at a CompiledScript object. Select Deep Dump Inspector Object from the menu and the CompiledScript and Procedure objects you need will be dumped into the log.

In the Magic Cap simulator, the default size for a simulated RAM card is just under 600K. How can I simulate a bigger RAM card?


If you have ResEdit, or any other Mac resource editing application, you can change the simulated card size by adding a 'Card' resource to the Magic Cap Preferences file, located in the Preferences folder in your System Folder. The ID for this resource should be 128. The contents of this resource should be a four byte number representing the size of newly created pseudo-cards. For example, to create a 4 Mb card, the value you should have in this resource is 0x00400000. (Five zeroes after the 4.) Because the Magic Cap simulator is not segmented and keeps all its data in memory at once, you'll also need to increase the application partition size of the simulator. This amount should be twice the size you specify in the Card resource, because the simulator allocates memory for two simulated slots.


What modems work with the Magic Cap simulator on the Mac?


Magic Cap communicators use the Rockwell RC244ATF chipset for data and fax communication. Any modem that uses this chipset works with Magic Cap. The ones we know about are the AT&T DataPort 14.4, Practical Peripherals PM2400 mini, US Robotics Sportster 14.4, Supra V.32bis fax modem and the Viva 2496.

The Magic Cap simulator allows you to choose the modem model you have from the "Choose Macintosh Modem..." item in the Hardware menu. The five models mentioned above are directly supported by the simulator. The pop up menu also contains a "Hayes compatible modem" entry. If you don't have one of these five modems, you can choose this generic setup for data communications only; faxing will not work.

If you don't have one of the modems with built in support, but you're fluent in your modem's particular dialect of the Hayes command language, and you know how to work a Macintosh resource editor, you can add the proper initialization strings to the "Magic Cap Supported Modems" file, found in the Preferences Folder in your System Folder, following these steps:

  1. Open the "Magic Cap Supported Modems" file with your favorite resource editor.
  2. Create a new resource of type 'Mdm#'. There should be entries for three initialization strings.
  3. The first string puts the modem into a sane state. Magic Cap's concept of a sane state is no echo with verbose result codes. On most modems, the command string for this state is ATE0V1.
  4. The second string is used to initialize the modem for data communication. This string is comprised of the commands that puts your modem in the following state:
    • factory defaults with hardware flow control
    • RTS/CTS flow control
    • +FCLASS=0
    • DTE rate = maximum modulation
    • no echo
    • verbose result codes
    • carrier wait time = 90 seconds
    • loss of DTS causes hangup
    • CD line tracks carrier
  5. The third string is used to initialize the modem for fax communication. This string is comprised of the commands that puts your modem in the following state:
    • factory defaults with software flow control
    • XON/XOFF flow control
    • +FCLASS=1
    • DTE rate 19200
    • no echo
    • verbose result codes
    • carrier wait time = 90 seconds
    • loss of DTS causes hangup
    • CD line tracks carrier
  6. Finally, name the resource after your modem. This is what shows up in the pop up menu.

The RS-232 cable you use to connect your modem to your Macintosh needs to support the following: DTR (pin 20), RTS and CTS (although you can get away with just CTS), TX data (pin 2), RX data (pin 3), and GND (pin 7). Support for CD (pin 8) is optional, but nice to have, as this allows Magic Cap to abort a communication session cleanly when the carrier signal is suddenly lost.

Note that sometimes after selecting "Enable Macintosh Mode" you need to quit the Magic Cap simulator and relaunch for everything to work correctly. Computers can be so finicky sometimes.


It seems like the simulator doesn't save the changes I've made to a simulates PC card. Is this a bug or a feature?


The simulator normally doesn't save changes to a PC card when you quit. However, if you uncheck Don't Save Changes from the File menu, the contents of the PC card will be saved when you quit the simulator. Alternately, you can choose Power Off from the Hardware menu. This forces the contents of the simulated PC card to get written out to disk as well.