great option to add the line of code - be aware though that if you own hardware and have previously used the config option to map the 8 bit do pads to the "sega" option (whch is the option to ensure correct mapping on the 3 buttons) it may change the button press from button A to either B or C if youre using a different config like the kempston option. I wonder if in a game theres a way to detect what the config is and alert the user they need to change their config (or have the game adjust itself accordingly).
Viewing post in ROAD KILL (ZX Spectrum Next) comments
The joystick config is available though REG 5: https://gitlab.com/SpectrumNext/ZX_Spectrum_Next_FPGA/-/blob/master/cores/zxnext/nextreg.txt#L99
the main problem with changing it is that users expect to be in control of it themselves. It’s not reset by the OS when you do a soft reset, only a hard reset.
A typical way round that is for a game to read the config, change it, read the sticks then immediately restore the config. Warhawk does that, for example.
It's probably over(road)kill for this purpose where the game itself already works and reading the "A" button was a cheap QOL hack, but anyone looking at adding general joystick support to NextBASIC might want to look at paulossilva's GameInput driver:
https://github.com/paulossilva/gameinput
It's possible that later additions to NextZXOS might render it obsolete, but for now it's about the simplest way of adding joystick support. I used it to modify the TAP loader so I could choose the mode using UP, DOWN, LEFT, RIGHT, FIRE on the joypad in addition to 1, 0, 4, P, N on the keyboard (hacking code for a more lean-back experience is something of a pattern for me) and it worked perfectly. Of course later revisions of NextZXOS also render this particular use largely pointless with the ability to remember launch configurations, but it was a good test for the joystick driver.
Definitely worth a look if you're going to add joystick support, especially reconfigurable joystick support, to your program.