3.6 Building for WarpOS

If you build plugins for WarpOS, the hwPluginAPI pointer that is passed to your InitPlugin() will contain function pointers to PPC code. However, many of these function pointers will immediately do a context switch and run on the 68k context. You might already be aware of the fact that context switches are quite expensive so you should do your best to minimize the number of context switches your plugin has to perform. To achieve this, you need to know which of the functions in the hwPluginAPI base pointer run PPC-native and which of them need a context switch. So here's an overview on the functions that don't need a context switch. All other functions not listed here will immediately perform a context switch.

CRTBase:
The following functions are available in PPC native versions: malloc(), calloc(), realloc(), free(), strdup(), qsort(), stricmp(), strnicmp(), toupper(), tolower(), strtolower(), strtoupper(), gettimeofday(), time(), lrint(), strtol(), strtoul(), strtod(), vsscanf(), vsnprintf(), atol(), dtostr().

SysBase:
The following functions are available in PPC native versions: hw_GetSysTime(), hw_SubTime(), hw_AddTime(), hw_CmpTime(), hw_Delay(), hw_MasterControl() (but this function is only PPC-native when querying the HWMCP_GETPOWERPCBASE tag to make Hollywood return its PowerPCBase pointer to you), hw_TrackedAlloc(), hw_TrackedFree(), hw_AllocSemaphore(), hw_FreeSemaphore(), hw_LockSemaphore(), hw_UnLockSemaphore().

DOSBase:
All functions here are implemented in 68k code and will immediately do a context switch.

GfxBase:
All functions here are implemented in 68k code and will immediately do a context switch.

AudioBase:
All functions here are implemented in 68k code and will immediately do a context switch.

RequesterBase:
All functions here are implemented in 68k code and will immediately do a context switch.

FontBase:
All functions here are implemented in 68k code and will immediately do a context switch.

FT2Base:
All functions here are PPC-native and don't need a context switch. Note that the PPC-native FT2Base for WarpOS is not available before Hollywood 5.3. You need to make sure that your plugin was opened by Hollywood 5.3 at least before trying to make any calls in FT2Base.

LuaBase:
All functions here are implemented in 68k code and will immediately do a context switch.

ZBase:
All functions here are PPC-native and don't need a context switch.

JPEGBase:
All functions here are PPC-native and don't need a context switch.

PluginBase:
All functions here are implemented in 68k code and will immediately do a context switch.

UtilityBase:
All functions here are PPC-native and don't need a context switch.

UnicodeBase:
All functions here are PPC-native and don't need a context switch.

LocaleBase:
All functions here are implemented in 68k code and will immediately do a context switch.

Also, be careful about structure alignment when developing for WarpOS. The WarpOS version of Hollywood doesn't use the traditional Amiga structure alignment of 2 bytes but is optimized for performance. This means, for example, that 64-bit double values will always be aligned on an 8 byte boundary.


Show TOC