Move the joystick code to its own file
Use macros instead of hardcoded ST codes
Move the function to emulate the mouse to joystick.c
Now read the joystick config from "joystick.ini"
Rename joystick_mouse_motion to joystick_motion
Use 3 different input modes, that can be toggled by a button

The 3 input modes are Adventure, Battle, Mouse.
Add a custom Amiga-like cursor for the software renderer
In mouse mode, make the joystick control the cursor
Don't move the cursor in adventure and battle modes
Allow sending mouse button events from the joystick

And map the button 1 of the joystick to the left mouse button
in mouse mode.
Launch the game in mouse mode by default