#ifndef JOYCOMPAT_H_INCLUDED
#define JOYCOMPAT_H_INCLUDED

/*

Compatibility shims for two other modules' historical raw SWI numbers

Both are only reachable via UKSWIV (the Unknown SWI Vector) - see
doc.Architecture, "Vector and service-call claims".

*/

#include "joyswis.h"   // swi_joystick_status(), encode_stick_serial_port()

// This is what we will also trap for Serial Port interface compatibility
#define USBJoystickSerialPortSWI  0x81540

// This is what we will also trap for Joy interface conpatibility
#define JoySWI_Read0      0xCFFC0
#define JoySWI_Read1      0xCFFC1
#define JoySWI_Test       0xCFFC2
#define JoySWI_ReadPipe   0xCFFC3

extern void ukswiv_pre_hook(void*);
_kernel_oserror* ukswiv_hook_handler(_kernel_swi_regs *r, void *pw);

_kernel_oserror* swi_joy_read(_kernel_swi_regs *r, int32_t n);
_kernel_oserror* swi_joy_test(_kernel_swi_regs *r);
_kernel_oserror* swi_joy_readpipe(_kernel_swi_regs *r);

#endif
