I suspect I should change USBJoystick to return 64 for switched joysticks. Or maybe make the thresholds configurable via a *command.
Regarding the boot scripts, I was thinking of something more dumbed down, like a *command alias. But I see what you mean, the boot scripts are editable enough.
USBJoystick 0.12
Re: USB Joystick driver
Attached is an updated obey.zip (see later post). This includes fixes for Spheres of Chaos and Xenon 2 as well as updated scripts for all games that support JoyMod (these aren't required if USBJoystick 0.06 is being used)
I've now tested all games that support JoyMod, notes below:
I've now tested all games that support JoyMod, notes below:
- Fire & Ice checks for JoyMod/Acorn Joysticks when loading, but the Joystick code isn't called in-game
- Jahangir Khan World Championship Squash, Joysticks don't appear to work when in a match
- Mad Professor Mariarti (all versions), to enable Joysticks, get into a level and press CTRL-D, then press M to enable JoyMod
- Manchester United, you need to go into Disk Options, then the Football with ? over it and select DEFINE KEYS FOR JOYSTICK, press M to enable a Custom Joystick Module (aka JoyMod / RTFM via USBJoystick)
- Manchester United Europe supports Joysticks at the menu, to use them in-match you need to click on the ? and switch player 1 controls to RTFM 1
- Pac-mania [Learning Curve version], you need to press SHIFT-D to define the keys, redefine the keys and select Yes when asked for RTFM Module support
- Revelation! (all versions), press F1 when on the Revelation! title screen to choose the control method, then F1 again to select Joystick
- Sensible Soccer, still suffering from input lag, I need to spend some more time debugging the game
The PRM does state 64 / 192 for switched joysticks, so it would make sense to return those values for switched joysticks. It won't fix analogue sticks though, I'll still need to patch the game code to get them working.
Re: USB Joystick driver
I have found VTJoystick! Having a quick look in StrongEd's disassembly, it looks like the SWI base is &81540, with the following SWIs:
VTJoystick_Status
VTJoystick_Define
VTJoystick_Load
VTJoystick_Die
VTJoystick_Read
also two *commands:
*JoystickLoad
*JoystickDie
I can guess what a few of these do, but to be honest, I'm not exactly a regular at reading assembler! I have attached the module (it's within the !Joystick application). I used to have one of these devices back in the day, and I recall the application being used to configure the Joystick and support things like keyboard/mouse mapping.
I have also attached a hacked version of the AcornTest utility (usually in the USBJoystick source). This shows the raw values coming from the Acorn Joystick_Read SWI. As far as I can tell, the digital stick behaviour is correct - it uses 64. I can't see why Xenon2 would be looking for 192 - am I missing something? I did bake-in the 64 value for digital (HAT) joysticks into USBJoystick, so it should 'just work'.
VTJoystick_Status
VTJoystick_Define
VTJoystick_Load
VTJoystick_Die
VTJoystick_Read
also two *commands:
*JoystickLoad
*JoystickDie
I can guess what a few of these do, but to be honest, I'm not exactly a regular at reading assembler! I have attached the module (it's within the !Joystick application). I used to have one of these devices back in the day, and I recall the application being used to configure the Joystick and support things like keyboard/mouse mapping.
I have also attached a hacked version of the AcornTest utility (usually in the USBJoystick source). This shows the raw values coming from the Acorn Joystick_Read SWI. As far as I can tell, the digital stick behaviour is correct - it uses 64. I can't see why Xenon2 would be looking for 192 - am I missing something? I did bake-in the 64 value for digital (HAT) joysticks into USBJoystick, so it should 'just work'.
- Attachments
-
- TheSerialPort_JS240.zip
- (172.19 KiB) Downloaded 276 times
-
- AcornTest2.zip
- (892 Bytes) Downloaded 281 times
Re: USB Joystick driver
If I'd known you were looking for it, I would have posted it up. It doesn't help though as its impossible to tell what VTJoystick_Define actually does. Load/Die/Read aren't used by any games I've seen so far, I suspect they're used by the additional software that comes on the driver disc.
192 is -64 as an unsigned 8bit value.
I have an analogue Joystick so Xenon 2 would never have worked. The boot script for it in the latest obey.zip changes the code to look for <-32 or >32, so problem solved.
Re: USB Joystick driver
Ah, OK. I thought you were trying to determine the module's behaviour from looking at the games! I had the zip sitting on my Pi. I think I downloaded it a long time ago when I first had the idea for the driver. Somewhere, I probably have the original floppy and parallel port interface!
So would it be helpful if I implement VTJoystick_Define which just does nothing?
Xenon2 sounds buggy!
So would it be helpful if I implement VTJoystick_Define which just does nothing?
Xenon2 sounds buggy!
Re: USB Joystick driver
@Jon: Xenon 2 now works perfectly with joystick, and Spheres of Chaos too!
Pac-Mania (Learnin Curve) works good, too, but trying to run the game twice will show corrupt graphics (duplicate small screen with wrong colors), so I suspect it's not exiting cleanly.
Pac-Mania (Learnin Curve) works good, too, but trying to run the game twice will show corrupt graphics (duplicate small screen with wrong colors), so I suspect it's not exiting cleanly.
Re: USB Joystick driver
If only it were that simple! Two games use VTJoystick_Define so far, Jahangir Khan World Championship Squash and Spheres of Chaos. Without documentation we haven't got a hope in hell of figuring out what it does.
It would prevent the crash in Spheres of Chaos, but I'm going to guess the Joystick mappings won't be correct. The latest boot script for Spheres of Chaos disables both Magnetic Image and Serial Port Joystick support, so there's not really much point in implementing it until we know what it does.
Incidentally, I've now been through the code of 212 games and turned up the following Joystick interfaces:
A - Acorn Joystick interface
B - Bogeysticks
J - Krysalis JoyMod / RTFM Joystick Module (ie RTFM)
M - Magnetic Image
P - Eclipse PowerPad
R - RTFM direct to the Econet port
S - Serial Port/Vertical Twist
T- Arm_Tech
V - Voltmace
B - Bogeysticks
J - Krysalis JoyMod / RTFM Joystick Module (ie RTFM)
M - Magnetic Image
P - Eclipse PowerPad
R - RTFM direct to the Econet port
S - Serial Port/Vertical Twist
T- Arm_Tech
V - Voltmace
Voltmace hangs of the mouse, so we can ignore that. Bogeysticks, Arm_Tech and Eclipse PowerPad plug into the Parallel Port, so we can probably ignore them as the games support other interfaces. I've no idea about the Magnetic Image interface, but Spheres of Chaos does come with an advert for it and I believe is the only game that supports it.
I've tried quitting via CTRL-ESC and CTRL-SHIFT-F12 dozens of times and can't get either to reproduce the problem you're seeing.
Re: USB Joystick driver
I've tracked the crash down to Joystick_Read SWI re-entrancy and/or IRQsema. The Magic Pockets crash is occurring when Joystick_Read is interrupted by VSync and ADFFS then queries Joystick_Read to create the RTFM Econet port values. The C code as it stands can't handle re-entrancy as its reliant on the FPA, so I've changed ADFFS to only query the Joystick if the Econet port is read. Hopefully there's no knock on effect to direct RTFM support.
The only fix I can think of is to recode USBJoystick's SWI handler to be pure assembler, as I don't believe C can handle re-entrancy due to the way it messes with the stack. FPA use may also be an issue if C isn't preserving the FPA registers around the SWI handler, it's likely any game that uses the FPA and expects FPA registers to be preserved across Joystick_Read etc is likely to crash.
With ADFFS modified, Magic Pockets now gets into the game but hangs soon after, again I suspect Joystick_Read re-entrancy or IRQsema issues as the game runs under an IRQ.
Attached are new builds of ADFFS and the current obey.zip (see later post). Whilst testing PON! I noticed it deletes PonCode if it's not run from ADFS::0, so there's an updated boot script that fixes HD installs.
Re: USB Joystick driver
@Jon: With this new version, Overload crashes on startup if UsbJoystick is loaded.
Re: USB Joystick driver
As I feared, its a knock on effect of moving the RTFM code to the Abort handler...back to the drawing board.