Saloon Cars, Arculator and Logitech G29 wheel/pedals

discuss emulators of 26-bit acorn systems e.g. arculator and rpcemu
Post Reply
timw
Posts: 91
Joined: Tue May 10, 2016 7:55 pm
Contact:

Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by timw »

Arculator v2.1 includes emulation of the AKA10 User/Analogue podule (thank you, Sarah!), so the obvious thing to do is play Saloon Cars with a proper analogue wheel and pedals. I'm pretty sure the game was so difficult because nobody made the measly effort to build these controls as described in the manual, and instead struggled by with mouse or even keyboard. Well, guess what, Saloon Cars is brilliant with a wheel and pedals!
saloonG29.jpg
Here's a description of how to set this up in linux with the Logitech G29, which is a force feedback wheel with 3 pedals and optional gearstick. The force feedback is used here only to centre the wheel. Gearchange is via either the gearstick or the steering wheel paddles.

Quick explanation - The wheel and pedals are connected to the emulated analogue interface, and the buttons/paddles on the wheel and gearshift are connected to a separate emulated joystick interface, and mapped to keyboard keys. This is even better than the setup described in the manual (which still relied on the keyboard for changing gear).

Wheel setup
  • Set the wheel to PS3 mode via the PS3/PS4 mode switch, and plug it in to a USB port.
  • In linux the wheel defaults to "compatibility" mode, but this is no good, we want "native" mode. Download and compile ltwheelconf (you may need libusb-1.0-0-dev for this).
  • Use ltwheelconf to set the wheel in native mode, then perform a reset (wait for the wheel to calibrate itself between commands):

    Code: Select all

    sudo ltwheelconf --wheel G27 -n
    sudo ltwheelconf --wheel G27 -x
  • If this was successful, the wheel will now self-centre (whereas by default when plugged in, it just turns freely). If you like, you can set a udev rule to do this configuration automatically whenever you plug it in.
  • The wheel appears (in native mode) as a single joystick with 4 axes, 1 hat and 23 buttons. The 4 axes will be assigned to the 4 analogue channels of the AKA10 podule in Arculator. The buttons will be mapped to appropriate keys, using one of the supported joystick interfaces.
  • The axes are: 0 wheel, 1 clutch, 2 accel, 3 brake
  • The most useful buttons are: 4 shift up, 5 shift down, 10 Enter/R3, 11 L3, 20 plus, 21 minus, 12-17 gear 1-6, 22 reverse
Arculator v2.1 setup
  • Arculator v2.1 supports the gamespad joystick interface, which can read a lot of buttons, but I couldn't get it to work - I probably haven't got the right RISC OS drivers. However the emulated Serial Port/VT joystick interface worked fine for me, with these drivers.
  • The Serial Port/VT joystick interface supports 10 buttons, which is good. Arculator maps 8 of these "buttons" to 4 analogue axes of the host joysticks, which is not what we want here - we want all the emulated buttons to be mapped to the relevant G29 buttons. So I added another joystick interface to Arculator, which is the same as the Serial Port one, but only maps buttons from the host joystick, and ignores the analogue axes. The updated source files are joystick.h, joystick.c and printer.c, plus a minor change to wx-sdl2-joystick.c to allow all the buttons to be shown in the menus (there are no changes to the code for the existing joystick interfaces).
    Edited_arculator_2_1_joystick_source.zip
    (4.43 KiB) Downloaded 35 times
  • Compile Arculator for linux, using the modified joystick sources (some hints here).
  • Run Arculator and create a new machine configuration - I would suggest an A5000 with RISC OS 3.1.
  • In the joystick configuration tab, select the new interface "TSP / VT interface buttons only".
  • Configure joystick 1: Device=Logitech G29, Up=4, Down=5, Left=10, Right=11, Fire=20, Stir=21
  • Configure joystick 2: Device=Logitech G29, Up=12, Down=13, Left=14, Right=15, Fire=16, Stir=22
  • Configure podule 2 as AKA10/15 IO/MIDI Podule (the real podule is full size and goes in slot 2)
  • Configure podule joystick 1: Device=Logitech G29, X=axis 0, Y=axis 2, Fire=button 0 (not actually used)
  • Configure podule joystick 2: Device=Logitech G29, X=axis 3, Y=axis 1, Fire=button 1 (not actually used)
  • Start the emulated machine and check that the podule is loaded (you need to put the aka10 ROM in podules/aka10)

    Code: Select all

    *podules
    Podule 2: Midi and BBC I/O podule
  • Check that the analogue inputs are working by entering the following in BASIC and moving the wheel and pedals - you should be able to see values between 0 and 65535 for the full range of movement:

    Code: Select all

    *basic
    REPEAT:FOR i% = 1 TO 4:PRINTTAB(0,i%);ADVAL(i%);SPC(5):NEXT:UNTIL0
Button mapping
  • Copy the Serial Port/VT joystick drivers into hostfs, make sure that RISC OS has seen them, and then double-click on the attached SCars_G29 key mapping file (filetype &C8B) to activate it.
    SaloonCars_G29_VTJoystickMapping.zip
    (776 Bytes) Downloaded 40 times
  • Run the !Key_Test application to check that the G29 buttons are pressing the correct keys.
I've set up the button mapping to press the following keys:
  • Up arrow - shift up paddle
  • Down arrow - shift down paddle
  • n (neutral) - both paddles together
  • b (horn) - Enter/R3
  • m (fix mirror/call mechanic) - L3
  • s (start engine) - plus
  • a (stop engine) - both paddles and plus
  • h (handbrake) - minus
  • q-f12 (exit session) - both paddles and Enter/R3
  • keypad 1-5 (manual gears) - gearshift
  • r (reverse) - gearshift
When the shifter is positioned in gear, the key is effectively held down. This works fine, as long as you move the shifter out of gear before you exit the session. The mapping generates 'n' when the shifter is moved out of gear, but this key is released when any other button is pressed, to avoid having 'n' stuck down all the time (this is done using the joystick flags, see the mapping text source in the attached zip file). When you first load the joystick mapping file, put the shifter in neutral and then press one of the used buttons, to release the 'n'.

Saloon Cars setup
  • Copy Saloon Cars into hostfs (or your emulated hard disc). The "Risc PC compatible" version from the APDL Racing Collection is good because it doesn't need a protection disc and runs fine from hostfs. But if you use this version, open up !SaloonCar.Protect.Object and comment out the first line that loads rpcpatch, because this patch stops the game from running in Arculator.
  • In the Saloon Cars control menu, select custom controls, and change the steering and pedals to analogue. Leave the others unchanged (if you change them, there seems to be a bug where there are two options called "keyboard", but only one of them works).
  • For manual gearbox, use the shifter or the paddles. For automatic, use the paddles to select between D, N, R. I'm not sure how kickdown is supposed to work with the analogue pedals - logically the game would just use the full throttle position, but it doesn't. I haven't looked at this because I'm too busy trying to improve my lap times with the manual gearbox.
That's it! It's definitely worth the effort to set it up, and it works really well - like it was meant to be played this way. It's a lot of fun!
vid.gif
vid.gif (710.78 KiB) Viewed 4465 times
:D
User avatar
vanpeebles
Posts: 763
Joined: Wed Nov 28, 2012 10:01 am
Location: UK
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by vanpeebles »

vanpeebles wrote: Fri Oct 22, 2021 8:19 am I'll have a go at this on w10!
Gah, needs stuff compiling!
timw
Posts: 91
Joined: Tue May 10, 2016 7:55 pm
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by timw »

vanpeebles wrote: Fri Oct 22, 2021 8:22 am
vanpeebles wrote: Fri Oct 22, 2021 8:19 am I'll have a go at this on w10!
Gah, needs stuff compiling!
If you can get the gamespad joystick interface working, there's a chance it would work "out of the box" with Arculator v2.1 on windows, as long as it picks up the host joystick (G29) OK. I'm not familiar with the gamespad (powerpad?) interface and how you would set up the button mappings - I tried these drivers and couldn't see the button presses in RISC OS, but they might be the wrong drivers.
Andy1979
Posts: 325
Joined: Mon Mar 27, 2017 10:04 pm
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by Andy1979 »

Great work!

Gutted that I sold my Logitech Driving Force GT wheel and pedals a few years back. Only a few years until my son is old enough to justify a repurchase...

In the meantime, will have to try this with the analogue sticks on a PS3 or 8bitdo joypad.

Many years ago, having made the move from my A3010 to a Pentium PC, I did try to make something along the lines of the diagram in the saloon cars manual for my PC racing games, but never got further than a project box with buttons and a potentiometer (the pedals were momentary switches connected to resistors). No use for the Acorn as didn't have an analogue port (or podule space for one).
User avatar
vanpeebles
Posts: 763
Joined: Wed Nov 28, 2012 10:01 am
Location: UK
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by vanpeebles »

timw wrote: Fri Oct 22, 2021 11:19 am
vanpeebles wrote: Fri Oct 22, 2021 8:22 am
vanpeebles wrote: Fri Oct 22, 2021 8:19 am I'll have a go at this on w10!
Gah, needs stuff compiling!
If you can get the gamespad joystick interface working, there's a chance it would work "out of the box" with Arculator v2.1 on windows, as long as it picks up the host joystick (G29) OK. I'm not familiar with the gamespad (powerpad?) interface and how you would set up the button mappings - I tried these drivers and couldn't see the button presses in RISC OS, but they might be the wrong drivers.
I'll have a go! :) Mine is a G27.
User avatar
BeebMaster
Posts: 7379
Joined: Sun Aug 02, 2009 5:59 pm
Location: Lost in the BeebVault!
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by BeebMaster »

That's really exciting. My no-longer-dead A305 is by uncorroborated folklore, reputedly the actual machine Saloon Cars was written on. It didn't come with the user port podule, which I think would have added to the likelihood that it is the Saloon Cars machine, but it could have had it previously, as some parts were removed before it came my way, possibly including a fourth podule.
Image
User avatar
jms2
Posts: 3765
Joined: Mon Jan 08, 2007 6:38 am
Location: Derby, UK
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by jms2 »

This is awesome - I always wondered whether this would work (I mean the pedals, not linking them to an emulator). Saloon Cars always looked like it ought be brilliant but with keyboard or mouse was very, very hard to play. Does this make it much easier?
sirbod
Posts: 1624
Joined: Mon Apr 09, 2012 9:44 am
Location: Essex
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by sirbod »

Good that you got it working as the manual isn’t exactly brimming with detail around how to get gears working. I also had problems with the Joystick emulation under Arculator 2.0, which I raised but didn’t receive a response, I’ve yet to see if Arculator 2.1 resolves the issue.

Coincidentally, the next release of ADFFS is centred around adding Joystick support. I’ve yet to look at Saloon Cars, but have had it working in the past. Annoying my current wheel doesn’t give out a proper USB descriptor that USBJoystick can hook into so I’ll have to test using an XB360 controller as a substitute.

In theory I should be able to provide PnP wheel support on a Pi.
richw
Posts: 114
Joined: Tue Oct 28, 2014 9:54 pm
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by richw »

Brilliant stuff. I have wanted to do that since Arculator was first released!

As Jon alluded to, if you are 'native', on a Pi, I have made a stab with USBJoystick. It can emulate the I/O podule. But it is pretty rough.
sirbod
Posts: 1624
Joined: Mon Apr 09, 2012 9:44 am
Location: Essex
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by sirbod »

I tested with the upcoming release of ADFFS using Joystick to Mouse mapping, which worked perfectly. Using Analogue in conjunction with USBJoystick with ADC mapping to steering, accelerator and brake also worked, although the steering was reversed for some reason.

@timw did you notice the steering is overly sensitive? I think there’s a bug in the game as the steering position indicator doesn’t appear to bear much relation to the actual tire angle. Even with the game set to low settings, the steering is way too aggressive.

I can damp the steering more by default in the game code, but before I do I’m curious what other people think when using Mouse/Joystick with the game. I can sort of understand why the Mouse is so aggressive, but not why the game isn’t indicating the wheel position correctly.
User avatar
vanpeebles
Posts: 763
Joined: Wed Nov 28, 2012 10:01 am
Location: UK
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by vanpeebles »

When I used to play it, I used keys and there was a key on the easier mode that would self centre the steering for you.

I have a feeling any steering angle would have to be wound off by the driver. I could never manage it on mouse, and I LOVED that game!
sirbod
Posts: 1624
Joined: Mon Apr 09, 2012 9:44 am
Location: Essex
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by sirbod »

vanpeebles wrote: Fri Nov 19, 2021 8:02 am I have a feeling any steering angle would have to be wound off by the driver.
It's not a driver issue. There's a disconnect between the wheels and the steering angle as shown in the game, so I believe it's a game code issue. In the screenshot below, the car is pretty much in full left lock, but the steering angle is barely noticeable.
SaloonCarsFullLock.png
SaloonCarsFullLock.png (9.48 KiB) Viewed 4078 times
User avatar
vanpeebles
Posts: 763
Joined: Wed Nov 28, 2012 10:01 am
Location: UK
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by vanpeebles »

Ah, I see! If I remember right, there was two steering modes too?
timw
Posts: 91
Joined: Tue May 10, 2016 7:55 pm
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by timw »

sirbod wrote: Fri Nov 19, 2021 7:09 am I tested with the upcoming release of ADFFS using Joystick to Mouse mapping, which worked perfectly. Using Analogue in conjunction with USBJoystick with ADC mapping to steering, accelerator and brake also worked, although the steering was reversed for some reason.

@timw did you notice the steering is overly sensitive? I think there’s a bug in the game as the steering position indicator doesn’t appear to bear much relation to the actual tire angle. Even with the game set to low settings, the steering is way too aggressive.

I can damp the steering more by default in the game code, but before I do I’m curious what other people think when using Mouse/Joystick with the game. I can sort of understand why the Mouse is so aggressive, but not why the game isn’t indicating the wheel position correctly.
Hi Jon, it would be great to have support in ADFFS! I think the joystick mapping to ADC would work better than to mouse. The reason is that with mouse mode, when you collide with something the wheel position gets reset to centre, so you lose the relationship to absolute mouse position. This doesn't happen with analogue as obviously the wheel has to be an absolute controller, whereas the mouse can be relative.

That might explain why the onscreen wheel indication seems to jump around. I've never noticed any problem with it not matching the actual steering angle. With the analogue controls, it is quite sensitive in the centre, and there are a few degrees of steering before the onscreen marker starts to move. With my wheel there's a small deadzone in the self centering that means it's especially sensitive to small movements where you can turn the wheel without any force. I was thinking about making the analogue emulation for the steering channel nonlinear, so there's an exponential response either side of centre, which might help, but you get used to it pretty quickly.

For keyboard steering, the steering angle slowly increases as you hold down the key, and decreases when you release it, and jumps to centre when you hit something.

Regarding the gears with analogue controls, the manual doesn't explain anything. I'm using "custom" controls with the gears assigned to the keyboard, then you can use the number keys and the cursors, which works pretty well assigned to the controller. The custom controls also allow you to set "analogue" for the handbrake and ignition, which doesn't seem to make much sense, unless it's using the two fire buttons on the ADC interface, which I haven't tried to emulate. With automatic gearbox, kickdown is triggered by the clutch pedal, which also seems a bit odd.
timw
Posts: 91
Joined: Tue May 10, 2016 7:55 pm
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by timw »

jms2 wrote: Fri Oct 22, 2021 9:24 pm This is awesome - I always wondered whether this would work (I mean the pedals, not linking them to an emulator). Saloon Cars always looked like it ought be brilliant but with keyboard or mouse was very, very hard to play. Does this make it much easier?
Yes, it's like a different game! Much more fun. Brands Hatch is still quite difficult because it's narrow and you end up bouncing from side to side if you're not careful. But at Silverstone you can cruise around for hours, weaving around the slow traffic. Just get the best tyres you can afford and tune the gears to get your top speed up!
sirbod
Posts: 1624
Joined: Mon Apr 09, 2012 9:44 am
Location: Essex
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by sirbod »

timw wrote: Fri Nov 19, 2021 5:30 pm it would be great to have support in ADFFS! I think the joystick mapping to ADC would work better than to mouse.
The current version of ADFFS does support the game, it just needs the relevent USBJoystick commands issued beforehand to map the three ADC channels.
timw wrote: Fri Nov 19, 2021 5:30 pm The reason is that with mouse mode, when you collide with something the wheel position gets reset to centre, so you lose the relationship to absolute mouse position.
As I've been going through games adding Joystick support, I've been stripping out the Mouse reset code, not only does it break Joystick mapping but it's very annoying having to constantly relocate the physical mouse to counteract it.

I hadn't noticed Saloon Cars repositioning the mouse whilst driving, but will check the code now that you've mentioned it. I did note it repositioning the mouse in the menu system, but that seemed acceptable as it was moving to a suggested selection.
timw wrote: Fri Nov 19, 2021 5:30 pm Regarding the gears with analogue controls, the manual doesn't explain anything. I'm using "custom" controls with the gears assigned to the keyboard, then you can use the number keys and the cursors
That's what I ended up doing, as I couldn't figure out how it was handling the gears when in Analogue mode. When I get time, I'll look through the code and try to figure out what it's expecting.
timw wrote: Fri Nov 19, 2021 5:30 pm The custom controls also allow you to set "analogue" for the handbrake and ignition, which doesn't seem to make much sense, unless it's using the two fire buttons on the ADC interface, which I haven't tried to emulate. With automatic gearbox, kickdown is triggered by the clutch pedal, which also seems a bit odd.
How odd, I'm sure that if the author had bothered to document Analogue fully, it might have made some sense!

This is where the original source code would come in handy.
sirbod
Posts: 1624
Joined: Mon Apr 09, 2012 9:44 am
Location: Essex
Contact:

Re: Saloon Cars, Arculator and Logitech G29 wheel/pedals

Post by sirbod »

sirbod wrote: Sat Nov 20, 2021 8:13 am I couldn't figure out how it was handling the gears when in Analogue mode.
I've had a look at the source code. It doesn't support gears in Analogue mode, it branches to a MOV PC,R14. The only code path for gears that does anything is Keyboard.
timw wrote: Fri Nov 19, 2021 5:30 pm The custom controls also allow you to set "analogue" for the handbrake and ignition
When Ignition is set to Analogue, the code path only checks for the "B" key being pressed to allow the horn to work. When set to Keyboard, it also checks "A" and "S" for the ignition.

HandBrake in Analogue doesn't appear to do anything in the code path.

I would guess the author didn't complete the Analogue code path and subsequently forgot to disable the uncoded Analogue options in the BASIC menu code.
Post Reply

Return to “32-bit acorn emulators”