Page 1 of 1

Send "F1" command to computer via controller?

Posted: Wed Apr 22, 2020 6:26 pm
by rwv01
Hi guys.
I would like to have a way to start games from the controller that normally require "F1" to start such as Avenger.
Does anyone know of a new controller that can do this? Is it possible to modify a controller, e.g. by adding new components, to send the correct signal for "F1"?

Thanks!

Re: Send "F1" command to computer via controller?

Posted: Thu Apr 23, 2020 12:57 am
by srowe
There's no way to do this in hardware, the joystick interface is completely independent of the keyboard.

It may be possible to create a software wedge to emulate this, but it wouldn't be possible to use that with an autostart cartridge like Avenger.

Re: Send "F1" command to computer via controller?

Posted: Thu Apr 23, 2020 5:08 am
by Vic20-Ian
Could you do it with a wedge and run the software dump of the cart with an SYS call?

e.g. Fire and Down would not normally be used

Re: Send "F1" command to computer via controller?

Posted: Thu Apr 23, 2020 6:08 am
by srowe
Vic20-Ian wrote: Thu Apr 23, 2020 5:08 am Could you do it with a wedge and run the software dump of the cart with an SYS call?
That would work fine, although you'd have to find some region of memory that the cart code didn't also try and use.

Re: Send "F1" command to computer via controller?

Posted: Thu Apr 23, 2020 3:48 pm
by Noizer
rwv01 wrote: Wed Apr 22, 2020 6:26 pm Hi guys.
I would like to have a way to start games from the controller that normally require "F1" to start such as Avenger.
Does anyone know of a new controller that can do this? Is it possible to modify a controller, e.g. by adding new components, to send the correct signal for "F1"?

Thanks!
I think one solution could be to patch you keyboard's onboard connector with an external prober long cabel connected to a switch, in this case connected to the F1 selection logic.
For this you need a HW reference and explanation of how to control keyboard input - only in machine code rational to implement.

Anothe solution could be buying THE64 - the joystick has al lot of buttons which can be mapped to every key ;)

Otherwise one would really have to hack every game... Maybee Miklós?

Re: Send "F1" command to computer via controller?

Posted: Sat Apr 25, 2020 8:37 am
by Mike
Noizer wrote:I think one solution could be to patch you keyboard's onboard connector with an external prober long cabel connected to a switch, in this case connected to the F1 selection logic.
That would be the most practical solution, locating those two pins of the keyboard connector where the f1 key is located in the keyboard matrix. Then, disconnect the POTX and POTY pins of the joystick port and repurpose them for a switch in the controller.

Re: Send "F1" command to computer via controller?

Posted: Sat Apr 25, 2020 11:49 pm
by rwv01
Thanks for your replies.
Well, patching the F1 key to the control port would be the most practical way to do it, but I'd rather not
hack the VIC itself. If a software wedge is possible, would it work like the CardKey numeric keypad and software combination?

Re: Send "F1" command to computer via controller?

Posted: Mon Apr 27, 2020 9:44 am
by Mike
rwv01 wrote:If a software wedge is possible, would it work like the CardKey numeric keypad and software combination?
A software wedge would work like this, yes, but only in the standard BASIC+KERNAL environment. And only in those cases, where an application or game does not touch (or even just re-initialise) the involved vectors used to wedge in the new keyboard routines.

Autostarting cartridges take control at a very early point of the KERNAL reset routine. They are likely to use their own routines to access the I/O chips and are free to basically ignore/stop anything the KERNAL would do with I/O once they gain control.

Any patches to 'rewire' input functions of a cartridge game are a one-off procedure. There is no hardware abstraction at that point that would help to unify such patches. What looks easy today - especially if one has been exposed to what is possible in an emulated environment, like remapping keys - was not on any priority list for OS design at that time.

Re: Send "F1" command to computer via controller?

Posted: Fri May 15, 2020 10:17 am
by Noizer
rwv01 wrote: Sat Apr 25, 2020 11:49 pm Thanks for your replies.
Well, patching the F1 key to the control port would be the most practical way to do it, but I'd rather not
hack the VIC itself. If a software wedge is possible, would it work like the CardKey numeric keypad and software combination?
#toolz.JPG
It is not such a great hacking issue, only a few tools are needed, such as screwdriver, knive, two wire cable, about 145 ohm resistor, soldering tools and insulating tape, since the keyboad itself has a free plug-in connection. There you could patch the keyboard cable, there is no need to touch the sacred motherboard at all.
More advanced could be to plug in a second connector with exposed prepared cable piggy back between CB connector and the keyboard connector, so that every button can be patched or reached from external.
#piggy.JPG
To be on the safe side, you can use a second spare keyboard.
I did something similar a while ago. Here I patched the F1 key with an external button the first time.

At a next time, I connected a 64 buttons square custom matrix to study the behavior when more buttons pressed at time, you know, some games get cheats working that way. But this was not my principal purpose.
#keyb.JPG
As you can see there are 18 lines = 8 row select + 8 column select, if you can imagine an 8x8 matrix. The leftover black and white cables are for restore key.
The green cable from the right side half from connector on following picture is the first line leading to F1 button.
The grey-white cable (near brown) starting from the left on the picture is the second line leading to F1 button.

Disconnect the keyboard connector with care. Mark both cables with an marker pen or isulating tape.
#adv.JPG
Cut the two lines you marked and prepare it to solder with the external two wires, or carefully peel the cable sheating with a cable cutter at a small point around the cable, so that the wire for connecting the external button can be reached, without cutting the cabel.
On one of this lines you should insert in serie an around 145 Ohm resistor, as in the original keyboard button I measured this value. 120 ohm should do the job too. Now solder your new key to the ends of you external cabel. Done. If you want to be sure what you have done, use an multimeter to check connections or even to be sure you have not done some shot circuit.
Connect now your patched keyboard to CB and check the software side of the matter.

0 PRINT PEEK(197):GOTO
RUN

If you get a value of 64 when no key is pressed and 39 by pressing F1 operation was successfully.
Now fix the new extension key to the joystick with super glue and have fun with your cartridge game :D