Apple II Technical Notes _____________________________________________________________________________ Developer Technical Support Apple II Miscellaneous #15: Compatibility Across Apple II Models Written by: Dave Lyons January 1990 This Technical Note explains how you can get in big trouble by using a soft switch before checking to make sure it exists on the particular Apple II model being used. _____________________________________________________________________________ When a soft switch location is defined on one Apple II model but not others, it is not safe to read the soft switch and later decide whether to use the value that was read. The following two examples demonstrate the hazards of this method. An application must read KEYMODREG ($C025) only after determining that it is running on an Apple IIGS (using IDROUTINE at $FE1F). Reading KEYMODREG and later ignoring the result if not on an Apple IIGS does not work. NEWVIDEO ($C029) is also defined only on the Apple IIGS. Again, an application must know that it is running on an Apple IIGS before reading or writing this location. (If your application uses double-high resolution, check for an Apple IIGS before attempting to set the monochrome-double-hires bit in NEWVIDEO.) Both of these locations are reserved on the Apple IIc Plus, and reading from or writing to them currently causes the Apple IIc Plus ROM to be swapped out and replaced by additional ROM, instantly killing your application. Further Reference _____________________________________________________________________________ o Apple IIGS Hardware Reference o Apple IIe Technical Reference Manual o Apple IIc Technical Reference Manual, Second Edition o Miscellaneous Technical Note #7, Apple II Family Identification