User Tools

Site Tools


portability

Writing code that is portable across Amiga-like OS's

Checklist

  • Endianness: If you want to target AROS, which can run on x86, you need to ensure you don't depend on the in-memory structure of types larger than 1 byte. For example this means never casting a long to char[4]. It also means being careful about how you read/write binary data from/to disk, or the files you write may not be possible to move over to other systems. FIXME: Macros to handle this efficiently in the default case.
  • Test on at least AmigaOS 3.1. AROS, MorphOS and the various incarnations of AmigaOS are all mostly backwards compatible with 3.1, or try to. If you test on 3.1 frequently you are likely to run into far fewer compatibility issues with the other platforms (of course ideally you'd test on all the ones you want to support all the time)
  • Verify library availability and fall back when possible. For functionality that is not vital, make use of the fact that AmigaOS libraries are loaded “manually” to check for their existence and instead of refusing to run, warn the user about what functionality will not be available if they don't install a specific library. Good practice is to ask the user whether or not to suppress the warning in the future, and save/remember that choice.
  • Keep in mind the vast performance disparity between slow classics, OS4 machines and AROS which may run on high end x86 boxes - test on the slowest machines you want to target, and add progress indicators when/where appropriate.
  • Keep in mind that if you target older/unexpanded classics, the number of colors your application will have to work with may be *very* limited and the screen resolution may be very low. Verify that the user interface remains usable with as few colours and small screens as may be reasonable on the smallest classic you target.
  • Isolate any assembler hacks in specific locations, and if possible write C (or whatever other language you prefer) fallbacks for other platforms.

Key library availability / differences

  • MUI: 4.0 on MorphOS. 3.8 on AmigaOS. Zune (clone, somewhat incomplete) on AROS. On AOS4, the native GUI is ReAction.

TODO: Table of the most important differences.

Resources

* SDI Tools A set of header files that hides a lot of compiler differences for the Amiga * Guide to portable Amiga programming (English version; PDF) * Guide to portable Amiga programming (French version; PDF)

portability.txt · Last modified: 2011/03/20 16:05 by vidarh