; ; coke.inc -- cokeOS include file ; ; This is the main include file for all coke modules. ; processor 68HC11 include include include include include ; start address for kernel code COKESTART equ ROMBASE ; serial response letters COKE_RESET equ "r" COKE_ACK equ "a" COKE_NAK equ "n" COKE_FAIL equ "f" COKE_QUERY equ "q" COKE_MESSAGE equ "m" STARTCMD equ $02 RESETCHAR equ $0F ; interrupt hook codes HOOK_USER equ $0 HOOK_AUDIO equ $1 HOOK_GFX equ $2 HOOK_IRQ equ $3 HOOK_SWI equ $4 ; start of timers for external use TIMER_USER equ $80 ; IPC flags IPCFLAG_Broadcast equ $80 IPCFLAG_StopAfterOne equ $40 IPCMASK equ $1f ; kernel jump table KERNELSTART equ RAMBASE Coke_Startup equ KERNELSTART Coke_GetChar equ KERNELSTART+3 Coke_SendMessage equ KERNELSTART+6 Coke_InstallCommand equ KERNELSTART+9 Coke_InstallCommandTable equ KERNELSTART+12 Coke_RemoveCommand equ KERNELSTART+15 Coke_RemoveCommandTable equ KERNELSTART+18 Coke_SetTimer equ KERNELSTART+21 Coke_RemoveTimer equ KERNELSTART+24 Coke_InstallHook equ KERNELSTART+27 Coke_RemoveHook equ KERNELSTART+30 Coke_RegisterIPC equ KERNELSTART+33 Coke_UnregisterIPC equ KERNELSTART+36 Coke_CallIPC equ KERNELSTART+39 Coke_InvokeCommand equ KERNELSTART+42 Coke_InvokeCommandMem equ KERNELSTART+45 Coke_reserved48 equ KERNELSTART+48 Coke_reserved51 equ KERNELSTART+51 Coke_reserved54 equ KERNELSTART+54 Coke_reserved57 equ KERNELSTART+57 ; resource jump table RESOURCESTART equ KERNELSTART+60 Resource_GetFreeSpace equ RESOURCESTART Resource_CreateResource equ RESOURCESTART+3 Resource_GetResource equ RESOURCESTART+6 Resource_GetLength equ RESOURCESTART+9 Resource_GetAttributes equ RESOURCESTART+12 Resource_SetAttributes equ RESOURCESTART+15 Resource_FreeResources equ RESOURCESTART+18 Resource_reserved21 equ RESOURCESTART+21 Resource_reserved24 equ RESOURCESTART+24 Resource_reserved27 equ RESOURCESTART+27 ; kernel commands CMD_Coke_QueryVersion equ $10 CMD_Coke_Reset equ $11 CMD_Coke_ScriptResource equ $12 CMD_Coke_SetScriptTimer equ $13 CMD_Coke_RemoveScriptTimer equ $14 CMD_Coke_InitCodeResource equ $15 CMD_Coke_ExecCodeResource equ $16 CMD_Resource_CheckSpace equ $18 CMD_Resource_QuerySpace equ $19 CMD_Resource_QueryResources equ $1a CMD_Resource_LoadResource equ $1b CMD_Resource_FreeResources equ $1c ; kernel errors ERROR_Coke_BadResourceID equ $10 ERROR_Coke_BadTimerID equ $11 ERROR_Coke_BadChecksum equ $12 ERROR_Coke_NotEnoughMemory equ $13 ERROR_Coke_ResourceNotExecutable equ $14 ERROR_Coke_ResourceNotInitialized equ $15 ERROR_Coke_ResourceAlreadyInitialized equ $16 ERROR_Coke_TooManyTimers equ $17 ; kernel messages MESSAGE_Coke_InternalRAMFailure equ $10 MESSAGE_Coke_ExternalRAMFailure equ $11 MESSAGE_Coke_MessageQueueFailure equ $12 ; kernel IPC messages IPC_AreYouThere equ $00 IPC_Coke_Hello equ $10 IPC_Coke_Goodbye equ $11 IPC_Coke_Execute equ $12 ; kernel macros ; _endhook macro is used at the end of all hook functions. mac _endhook rti ; rti or jmp to next function ds 2 dc.w {1} ; pointer to this function ds 2 ; pointer to next block endm ; _versionstuff macro just generates the code necessary to implement ; the QueryVersion command. mac _versionstuff Command_QueryVersion subroutine ldx #.versionstring ldab #[.versionstringend-.versionstring] ldaa #COKE_QUERY rts .versionstring dc.b VERSIONSTRING .versionstringend dc.b 0 endm