IMPORTANT NOTICE ABOUT RAM_CALLS: ================================= Just because some RAM_CALLs are supported by Iceberg doesn't mean they should be used. (In fact, I recommend against using kernel mode for new programs at all. But read the following if you are going to write a new kernel-based program anyway.) Many RAM_CALLs are obsolete (for example because there are ROM_CALLs doing the same thing in a cleaner way) and supported by Iceberg for backwards-compatibility only. Others suffer from the opposite problem: they are a portability nightmare because they require a very recent version of PreOs or Iceberg and won't work with any other kernel. And others shouldn't have been introduced in the first place. Only the following RAM_CALLs are safe and appropriate to use: CALCULATOR, LCD_WIDTH, LCD_HEIGHT, ROM_base, LCD_LINE_BYTES, KEY_LEFT, KEY_RIGHT, KEY_UP, KEY_DOWN, KEY_UPRIGHT, KEY_DOWNLEFT, KEY_DIAMOND, LCD_SIZE, KEY_SHIFT, ROM_VERSION (WARNING: ROM_VERSION needs an AMS 2 kernel). As for HW_VERSION, it was a good addition, but unfortunately it was added only in Universal OS 1.14. I. Badly-designed RAM_CALLs - avoid these at all costs! ------------------------------------------------------- The following RAM_CALLs are really badly designed. They don't quite serve their intended purpose, so it is very unwise to use them. Don't. +----------------+---------------------------------------------------+---------------------------+ | Name | Badly designed because | Use instead | +----------------+---------------------------------------------------+---------------------------+ | RegisterVector | Kernel mode is not a good choice for TSRs. If you | _nostub mode | | | use any "function RAM_CALLs" in your kernel-based | | | | TSRs, they will unavoidably either crash or get | | | | forcefully uninstalled (leaking memory) when the | | | | kernel gets uninstalled. This also affects the | | | | conditional lib RAM_CALLs, so you can't use any | | | | libraries. So why are you using kernel mode in | | | | the first place? | | +----------------+---------------------------------------------------+---------------------------+ | GHOST_SPACE | This RAM_CALL is supposedly intended to make | bclr.b #2,$600001 | | | programs more portable. This is a joke! Not only | set NON-GHOSTED interrupt | | | does this require very recent kernels (see III.), | bset.b #2,$600001 | | | but most importantly using it makes it much more | | | | likely to make the programs fail on future | | | | hardware versions than using the clean method | | | | suggested at the right. Thus, NEVER use this! If | | | | you are adapting old programs to the Titanium, do | | | | it properly and cleanly. | | +----------------+---------------------------------------------------+---------------------------+ II. Obsolete RAM_CALLs - don't use these for new programs! ---------------------------------------------------------- The following RAM_CALLs are obsolete. They were introduced at a time where very few was known about the native ROM_CALLs, and it was customary practice to hack around in private AMS globals. (font_small and font_large were technically introduced only later as actual RAM_CALLs, but they existed in the form of obsolete font_medium+offset hacks which don't work properly on the Titanium, even though this is worked around by Iceberg.) This practice is nowadays frowned upon. Don't mess around with private operating system variables, call the supported API instead! +-------------------------------------+--------------------------------------------------+ | Name(s) | Use the following ROM_CALLs instead | +-------------------------------------+--------------------------------------------------+ | font_medium, font_small, font_large | DrawStr, DrawChar, DrawClipChar, DrawStrWidth | +-------------------------------------+--------------------------------------------------+ | kb_globals | kbd_queue (moveq.l #6,d0; trap #9) and OSdequeue | +-------------------------------------+--------------------------------------------------+ | Heap (including the DEREF macro) | HeapDeref | +-------------------------------------+--------------------------------------------------+ | FolderListHandle, MainHandle | Sym* VAT handling functions | +-------------------------------------+--------------------------------------------------+ III. Unportable RAM_CALLs - try avoiding their use -------------------------------------------------- The following RAM_CALLs require high versions of PreOs or Iceberg to work. Only the first 2 are supported by one previous kernel (Universal OS, which introduced them). Some of them aren't supported by TitaniK either. (For the ones supported by Iceberg 0.90, the code is there in TitaniK 0.12 too, but it doesn't work because of the execution protection.) So try to avoid them whenever possible. +----------------------+---------+---------+------------+-----------------------------------------+ | | Minimum | Minimum | Supported | | | Name | PreOs | Iceberg | by TitaniK | Possible alternatives | | | version | version | 0.12? | | +----------------------+---------+---------+------------+-----------------------------------------+ | Idle (from UniOs) | 0.52 | 0.90 | Yes | idle ROM_CALL, move.b #x,$600005 | +----------------------+---------+---------+------------+-----------------------------------------+ | HW_VERSION (UniOs) | 0.52 | 0.90 | Yes | __get_hw_version in TIGCCLIB | +----------------------+---------+---------+------------+-----------------------------------------+ | Exec | 0.52 | 0.90 | Yes (*) | userlib::exec (* for some kernels) | +----------------------+---------+---------+------------+-----------------------------------------+ | Ptr2Hd | 0.52 | 0.90 | Yes | HeapPtrToHandle | +----------------------+---------+---------+------------+-----------------------------------------+ | Hd2Sym | 0.52 | 0.90 | Yes | SymFindFirst and SymFindNext | +----------------------+---------+---------+------------+-----------------------------------------+ | LibsBegin | 0.52 | 0.90 | No | Avoid conditional libraries. Instead, | | LibsEnd | 0.52 | 0.90 | No | either just link the library, or if it | | LibsCall | 0.52 | 0.90 | No | actually isn't a library at all, but | | LibsPtr | 0.52 | 0.90 | No | just a data file, open it as a data | | LibsExec | 0.52 | 0.90 | No | file, don't abuse the library system. | +----------------------+---------+---------+------------+-----------------------------------------+ | HdKeep | 0.52 | 0.90 | Yes | Don't use kernel mode for TSRs. | +----------------------+---------+---------+------------+-----------------------------------------+ | ExtractFromPack | 0.62 | 0.90 | No | Don't use PreOs archive packs. You | | ExtractFile | 0.62 | 0.90 | No | can use the TICT ExePack tech instead. | +----------------------+---------+---------+------------+-----------------------------------------+ | LCD_MEM | 0.62 | 0.90 | Yes | $4c00 | +----------------------+---------+---------+------------+-----------------------------------------+ | font_small | 0.62 | 0.90 | Yes | See II. But do NOT use the old font_ | | font_large | 0.62 | 0.90 | Yes | medium+x hack, it's even less portable. | +----------------------+---------+---------+------------+-----------------------------------------+ | SYM_ENTRY.name | 0.62 | 0.90 | Yes | 0 | +----------------------+---------+---------+------------+-----------------------------------------+ | SYM_ENTRY.compat | 0.62 | 0.90 | Yes | 8 | +----------------------+---------+---------+------------+-----------------------------------------+ | SYM_ENTRY.flags | 0.62 | 0.90 | Yes | 10 | +----------------------+---------+---------+------------+-----------------------------------------+ | SYM_ENTRY.hVal | 0.62 | 0.90 | Yes | 12 | +----------------------+---------+---------+------------+-----------------------------------------+ | SYM_ENTRY.sizeof | 0.62 | 0.90 | Yes | 14 | +----------------------+---------+---------+------------+-----------------------------------------+ | ExtractFileFromPack | 0.64 | 0.90 | No | Don't use archive packs. See above. | +----------------------+---------+---------+------------+-----------------------------------------+ | exit | 0.70 | 2.00? | No | Use the portable TIGCCLIB | | atexit | 0.70 | 2.00? | No | implementations instead. | +----------------------+---------+---------+------------+-----------------------------------------+ | RegisterVector | 0.70 | 2.00? | No | Don't use kernel mode for TSRs. See I. | +----------------------+---------+---------+------------+-----------------------------------------+ | GHOST_SPACE | 0.70 | 2.00? | No | bclr.b #2,$600001. See I. | +----------------------+---------+---------+------------+-----------------------------------------+ | KERNEL_SPACE | 0.70 | 2.00? | No | HW_VERSION==2 ? 0x40000 : 0 (**) | +----------------------+---------+---------+------------+-----------------------------------------+ Note that the minimum PreOs versions shown are the minimum public releases. Private betas are not counted. (*) support for running kernel programs only! (**) but see above for use of the actual HW_VERSION RAM_CALL