Code: Select all
Run <Chuck$Dir>.JSTestCode: Select all
RMLoad <Chuck$Dir>.JoyMod
Set JSflag 1 Now the joystick works! But the game quits via CTRL+SHIFT+F12 with: undefined instruction at &01A00048
Code: Select all
Run <Chuck$Dir>.JSTestCode: Select all
RMLoad <Chuck$Dir>.JoyMod
Set JSflag 1 I can't reproduce the error, so suspect there may be another issue in your !Run. It should be:Vanfanel wrote: Mon Apr 02, 2018 the game quits via CTRL+SHIFT+F12 with: undefined instruction at &01A00048
Code: Select all
Set Chuck$Dir <Obey$dir>
Wimpslot -min 464K -max 464K
RMEnsure QTMTracker 1.44 RMLoad ADFFS:trackers.QTMModule
RMEnsure MusicModule2 0.09 RMLoad ADFFS:trackers.MusMod2
ADFReserveMemory 800K
IF ADFFS$OSVersion>=&35000 THEN ADFRemapVideoMemory 9 160 ELSE ScreenSize 160
IF ADFFS$OSVersion<&35000 THEN Echo <22><9>
IF ADFFS$CPUID>=&A10 THEN GOARM3JIT 0
RMLoad <Chuck$Dir>.JoyMod
Run <Chuck$Dir>.JSTest
Run <Chuck$Dir>.ChuckProg
MusSampleRate 2
FX 19
FX 19
Unset Chuck$Dir
IF JSflag>0 Then RMKill JoyStick
IF ADFFS$OSVersion>=&35000 THEN GOARM3JIT
IF ADFFS$OSVersion>=&35000 THEN ADFRemapVideoMemory
RMKill MusicModule2
RMKill QTMTracker
Unset JSflag
Richard, do you want to add these SWI to USBJoystick? Joy_Read0, Joy_Read1 and Joy_Test are pretty straight forward to add. Joy_ReadPipe however is a problem, but we might get away with simply returning if the SWI is called. I've checked dumps of the following games and none use Joy_ReadPipe, so it's possibly its not used by any games:JonAbbott wrote: Mon Apr 02, 2018 JoyMod SWI block: CFFC00 - Joy_Read0 (returns RTFM Joystick 0 value R0 = %FUDLR)
1 - Joy_Read1 (returns RTFM Joystick 1 value R0 = %FUDLR)
2 - Joy_Test (Checks for RTFM and returns R0=255 - Nothing in Econet port, R0=128 - Econet present, R0=0 - RTFM present)
3 - Joy_ReadPipe (Input R1=?, R2=table pointer. If R1<&11 or >=&1B returns R1=[R2, R1]. For R1=&11..1A returns R1=0 or 1 depending on an internal table read)
Detailed in my post:richw wrote: Tue Apr 03, 2018 @Jon: Your joystick which is returning diff values... can you tell me the min/max/mid values from *USBJoystick_Read/List/Debug? I think I print those things out in one of those commands (read rings a bell).
Mid's are obviously 0, Min -512, Max 511The values returned by Joystick_Read are the wrong way round for me. All the way down is returning 0 (should be -127), centred is returning 127 (should be 0) and all the way up is returning -2 (should be 127). The Joystick axis read -512/-512 at top/left and 511/511 at bottom right.
I believe that will be okay, the games are all machine code. IIRC even the BASIC test code uses the SWI number.richw wrote: Tue Apr 03, 2018 Note that I'll only be able to claim the SWIs by number (which I assume is how any assembled/compiled code would hit them). If you try by name, like SYS "Blah" then it won't be handled. But I wouldn't have thought any legacy code would be doing that.