As I have been looking at the Macintosh Portable in more depth. I've run across a couple of pieces of technical information that may be valuable to other developers.
PRAM
The original Macintosh computers (128, 512) had 20 bytes of PRAM (parameter RAM). This battery-preserved memory stored a user's preferences, such as mouse speed. It also stored information like the alarm clock time and which port a printer was connected. In an era of hard disks, we've grown accustomed to storing information in preference files. But, back then, computers were booted from various floppy disks. Thus, a settings file would differ depending on the floppy disk. It would be annoying to set up your printer and then boot from a different disk that wouldn't know about your printer setup.
The Plus and onward expanded PRAM to 256 bytes. This was particularly beneficial for slot-based Macintosh computers, since each card could store configuration information (such as screen resolution or color depth) that would be retained regardless of which floppy disk you booted from. And, it avoided having to resort to DIP switches.
Unfortunately, the Macintosh Portable, Backlit Portable, and PowerBook 100 took a step backwards and only implemented 128 bytes of PRAM. This is stored in the Power Manager chip, which apparently just didn't have enough bytes available. Users would not directly notice the missing PRAM, but it means these machines are special cases. If an Apple engeineer or third-party developer was not aware or did not own a Portable/PowerBook 100, they wouldn't catch problems or limitations.
Examples of two mistakes are:
* TattleTech just shows 20 bytes of PRAM on the Portable
* Apple placed the Reliability Manager data (manufactured date, powered on odometer) in a location that is unavailable on these machines. There are plenty of unused locations available if the developer had wanted to code a special case for these models.
For programmers, any call to ReadXPram will fail if you attempt to read an unavailable location, even if some of the bytes of the read are in supported locations. For example, if you ask for all 256 bytes of PRAM, you'll get nothing.
The Portables and PowerBook 100 support the following bytes. This was determined by reading each location, one byte at a time.
0x00 to 0x1F
0x40 to 0x5F
0x70 to 0x8F
0xE0 to 0xFF
Aside: Apple introduced a bug in later PowerBooks, such as the 540c and 190 where they only read a byte length (0-255), rather than the full word length (0-65535) in the ReadXPram PowerMgr implementation. Thus, asking for 256 bytes of PRAM will not read anything (because that's 0x100 which has a lower byte of 0x00). But asking for 255 bytes and then 1 byte will read everything.
Backlit Portable
I seem to recall that Apple publicly claimed that it is not possible to programmatically determine if you are running on an original or backlit Portable. In fact, you can.
First ask Gestalt if you are running on a Portable. If not, you're done. Otherwise, read the byte at location 0x00FC0200. If it equals A5, A3, or AD, then it is a backlit model. I noticed my non-backlit model reports E1 at that location.
This is the technique that Apple uses at the start of 'INIT' resource id #2 in the Portable 1.3 control panel to determine if the .Backlight driver should be loaded. After that, Apple simply checks for the existence of the .Backlight driver to determine if it is the backlit model. For example, they switch the slider text label between the word 'Contrast' and 'Brightness' depending on the existence of the driver.
ROM
The ROM is completely identical between the original Portable and backlit Portable. The PowerBook 100 is a copy of the Portable ROM with hand patches applied to the warm start routines. The insertion on several 'NOP' and 'JMP' instructions are classic indicators of hand applied patches. Doing so keeps all the remainder of the ROM in the same locations. This reduces test time (few changes) and having to add code in control panels, drivers, and systems to handle the PowerBook 100 differently.
Please forgive the routine numbering. I just pasted the changed code back-to-back for easier review. So, this picture below is not the actual location at the end of ROM where these patches actually appear.
It is amusing that Apple's developers used 'MATT', 'GARY', and 'SARA' as values to store at the global variable WarmStart location in order to determine where in ROM to go.
Based on the text at the end of the ROM, the Portable ROM was frozen on Tuesday, July 18, 1989. The PowerBook 100 date is unchanged; further suggesting the changes were made by hand rather than a recompile.
- David
PRAM
The original Macintosh computers (128, 512) had 20 bytes of PRAM (parameter RAM). This battery-preserved memory stored a user's preferences, such as mouse speed. It also stored information like the alarm clock time and which port a printer was connected. In an era of hard disks, we've grown accustomed to storing information in preference files. But, back then, computers were booted from various floppy disks. Thus, a settings file would differ depending on the floppy disk. It would be annoying to set up your printer and then boot from a different disk that wouldn't know about your printer setup.
The Plus and onward expanded PRAM to 256 bytes. This was particularly beneficial for slot-based Macintosh computers, since each card could store configuration information (such as screen resolution or color depth) that would be retained regardless of which floppy disk you booted from. And, it avoided having to resort to DIP switches.
Unfortunately, the Macintosh Portable, Backlit Portable, and PowerBook 100 took a step backwards and only implemented 128 bytes of PRAM. This is stored in the Power Manager chip, which apparently just didn't have enough bytes available. Users would not directly notice the missing PRAM, but it means these machines are special cases. If an Apple engeineer or third-party developer was not aware or did not own a Portable/PowerBook 100, they wouldn't catch problems or limitations.
Examples of two mistakes are:
* TattleTech just shows 20 bytes of PRAM on the Portable
* Apple placed the Reliability Manager data (manufactured date, powered on odometer) in a location that is unavailable on these machines. There are plenty of unused locations available if the developer had wanted to code a special case for these models.
For programmers, any call to ReadXPram will fail if you attempt to read an unavailable location, even if some of the bytes of the read are in supported locations. For example, if you ask for all 256 bytes of PRAM, you'll get nothing.
The Portables and PowerBook 100 support the following bytes. This was determined by reading each location, one byte at a time.
0x00 to 0x1F
0x40 to 0x5F
0x70 to 0x8F
0xE0 to 0xFF
Aside: Apple introduced a bug in later PowerBooks, such as the 540c and 190 where they only read a byte length (0-255), rather than the full word length (0-65535) in the ReadXPram PowerMgr implementation. Thus, asking for 256 bytes of PRAM will not read anything (because that's 0x100 which has a lower byte of 0x00). But asking for 255 bytes and then 1 byte will read everything.
Backlit Portable
I seem to recall that Apple publicly claimed that it is not possible to programmatically determine if you are running on an original or backlit Portable. In fact, you can.
First ask Gestalt if you are running on a Portable. If not, you're done. Otherwise, read the byte at location 0x00FC0200. If it equals A5, A3, or AD, then it is a backlit model. I noticed my non-backlit model reports E1 at that location.
This is the technique that Apple uses at the start of 'INIT' resource id #2 in the Portable 1.3 control panel to determine if the .Backlight driver should be loaded. After that, Apple simply checks for the existence of the .Backlight driver to determine if it is the backlit model. For example, they switch the slider text label between the word 'Contrast' and 'Brightness' depending on the existence of the driver.
ROM
The ROM is completely identical between the original Portable and backlit Portable. The PowerBook 100 is a copy of the Portable ROM with hand patches applied to the warm start routines. The insertion on several 'NOP' and 'JMP' instructions are classic indicators of hand applied patches. Doing so keeps all the remainder of the ROM in the same locations. This reduces test time (few changes) and having to add code in control panels, drivers, and systems to handle the PowerBook 100 differently.
Please forgive the routine numbering. I just pasted the changed code back-to-back for easier review. So, this picture below is not the actual location at the end of ROM where these patches actually appear.
It is amusing that Apple's developers used 'MATT', 'GARY', and 'SARA' as values to store at the global variable WarmStart location in order to determine where in ROM to go.
Based on the text at the end of the ROM, the Portable ROM was frozen on Tuesday, July 18, 1989. The PowerBook 100 date is unchanged; further suggesting the changes were made by hand rather than a recompile.
- David