Jump to content
LaunchBox Community Forums

Joystick port swapping in CCS64


zorkiii

Recommended Posts

Hi all,  I've been trying to find a way to automatically swap the joystick ports when loading a C64 rom. Many games use Port 1 as the default for Joystick 1, however a number of games have Port 2 assigned as the default controller. In CCS64 I believe Alt+F10 will swap ports when you launch the application, but does anyone know of a way to send this to CC64 on load or a way to configure per game? Just would rather not have to mess with hitting Alt+F10 whenever I load a ROM that has the joystick swapped to the other port.

I am guessing I could map that combination someone to my Xbox One controller someone with a third party app each time I launch, but not sure I'm that committed to this idea. Just curious if anyone has come across any easier way to do this. 

Link to comment
Share on other sites

AFAIK, there is no automatic way. For CCS64 you can try to start it with -config file, separate for each joy port.  Vice has -controlport1device arguments.

 

You can also use Gamebase "The GB64 Collection v15", where every game is preconfigured, but there is no easy way to move that information to LaunchBox.

Link to comment
Share on other sites

6 hours ago, cZ8tL said:

AFAIK, there is no automatic way. For CCS64 you can try to start it with -config file, separate for each joy port.  Vice has -controlport1device arguments.

 

You can also use Gamebase "The GB64 Collection v15", where every game is preconfigured, but there is no easy way to move that information to LaunchBox.

Is this Gamebase collection easily launchable from LaunchBox?

***Edit.....actually, stuff that. I've just looked it up and it is way too complicated lol.

Edited by JamesBond@ge
Link to comment
Share on other sites

You could swap ports with an AHK script. I have several CCS64 functions assigned to various controller buttons/combinations. I can't remember if I have one for joystick swap, but it could certainly be done. I can paste the entire script I'm using later today.

Port 2 is more common by the way. Inputs with a joystick in port 1 could sometimes cause issues with the command line, which is why 2 is basically the "default". There are certainly plenty of games that use 1 though.

"Internally the control ports are not read by dedicated inputs, instead they are attached to various points of the keyboard matrix, which goes to CIA#1. This causes some trouble when the joystick is set to autofire (random chars will be entered) or when a joystick is stuck in one direction it can lock out certain keys. Most games and programs make use of the Control port 2 as it is easier to handle - for example control port 1 joystick left direction is hardwired to the CTRL key and can cause trouble when scrolling out of the screen in basic programs (scrolling slows down)." (source)

Link to comment
Share on other sites

Okay, so I reworked this script a bit to include port swapping. You'd need to remove (or change the path accordingly) for NoMousy. Also note that in my case the controller I'm using for this is recognized as "2" in AHK so be aware that any instances that say "2Joy4", "2Joy8", etc. may need to be changed in your case (probably to 1Joy#).

These enable the following controls on a 360 controller:

Y = CCS64 menu
Start = Space
X = Enter
B = Esc
Left thumb stick button = n
Right thumb stick button = y
Back + Left Bumper = Exit CCS64
Back + Right Bumper = Swap joystick ports
A = fire (natively in CCS64)

I could make this better if I could manage to figure out how to map the d-pad (or triggers) in AHK, but I haven't managed that one yet :(

___________________AHK Script Below___________________

#NoEnv
Run, X:\Emulation\LaunchBox\Nomousy\nomousy.exe /hide

SetKeyDelay, -1, 110

2Joy4::Send {F10}

2Joy8::Send {Space}

2Joy3::Send {Enter}

2Joy2::Send {Esc}

2Joy9::Send {n}

2Joy10::Send {y}

;Swap ports
2Joy6:: ;you have to press 2Joy7 first

If !GetKeyState("2Joy7")

Return
send !{F10}

Return

;Exit
2Joy5:: ;you have to press 2Joy7 first

If !GetKeyState("2Joy7")

Return
        Run, X:\Emulation\LaunchBox\Nomousy\nomousy.exe
send {alt down}
send {F4}
send {alt up}

Return

  • Like 1
Link to comment
Share on other sites

I just realized there are next disk and previous disk shortcuts in CCS64 (Alt+F5 and Alt+F6). I've always done it by going into the menu (F10), going to drive 8, navigating to the next/previous disk, and pressing select disk (F4). I just tested the next disk function with The Movie Monster Game which has you swap disks pretty much immediately, and it worked perfectly. I'm assuming it works based off filenames and it changes them in order. Since I don't have the d-pad mapped to arrow keys there's no way to navigate the CCS64 UI with the controller with my script but the only thing I ever used the UI for at this point was swapping disks anyway... so I replaced the CCS64 menu and Enter assignments with next disk and previous disk functions.

A = Fire (natively in CCS64)
B = Esc (which translates to RunStop in-game)
Start = Space
Left thumb stick button = n
Right thumb stick button = y
Back + Y = Next Disk
Back + X = Previous Disk
Back + Left Bumper = Exit CCS64
Back + Right Bumper = Swap joystick ports

___________________AHK Script Below___________________

#NoEnv
Run, X:\Emulation\LaunchBox\Nomousy\nomousy.exe /hide

SetKeyDelay, -1, 110

2Joy8::Send {Space}

2Joy2::Send {Esc}

2Joy9::Send {n}

2Joy10::Send {y}

;Next Disk
2Joy4:: ;you have to press 2Joy7 first

If !GetKeyState("2Joy7")

Return
send !{F5}

Return

;Previous Disk
2Joy3:: ;you have to press 2Joy7 first

If !GetKeyState("2Joy7")

Return
send !{F6}

Return

;Swap ports
2Joy6:: ;you have to press 2Joy7 first

If !GetKeyState("2Joy7")

Return
send !{F10}

Return

;Exit
2Joy5:: ;you have to press 2Joy7 first

If !GetKeyState("2Joy7")

Return
        Run, X:\Emulation\LaunchBox\Nomousy\nomousy.exe
send {alt down}
send {F4}
send {alt up}

Return

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Heck yes, this is great! Thank you zombeaver for adding these scripts. I will be working on this over the next week once I have some free time, once these are setup I imagine I'll probably want to play C64 games more often again :)

I've been keeping my eye out for the C64 mini release, seems pretty cool to have a machine that launches into the game directly. https://thec64.com/ It's not a complete list of games by any stretch, but seems like a pretty cool machine! Will be cool if they continue developing for the machine and new games can be added. But really, it's not so hard using an emulator and Launchbox, I just wish the C64 were more instantaneous like a purely cartridge based system. 

Link to comment
Share on other sites

No problem! Just remember that you'll likely need to change the "2Joy" references to "1Joy", it's just based on how AHK sees them numbered. If you have AHK installed on your computer, you can use a simple test script to check to see what yours is numbered (along with the AHK names of each button as your press them). It can be found here.

I'm kindof interested in the C64 mini but I was very underwhelmed by the game list. Granted, when you're dealing with a library of 25000+ games you're gonna have a very hard time narrowing that down to a list that everyone will love, but I just found the mini's game list to be fairly bleh; very few of my favorites. I'm much more interested in the full-size version that's supposed to be releasing next year, that's basically a fully functioning C64 with HDMI out and USB in place of the 1541 drive.

Link to comment
Share on other sites

Same here, that looks pretty cool too. Hopefully they can polish the mini into something with a better collection of games. 

I bought one of the C64x (Extreme) cases last year and built a PC into it, it's been fun using that as a side PC for other projects. It's of course not a C64 in any way but love that I'm looking at what for all intents and purposes is a C64 in front of me :) 

Yeah I'm looking forward to the evolution of emulation getting to the point of completely skipping the loading stages on the 64 somehow. That and the Amiga. I love playing the game Dark Castle on the Amiga for instance but it's a pretty hard game and having to wait a terribly long time for things to load every time you die is not something I want to kick back and relax doing. The C64 is chock full of game examples like this, and having to swap disks etc makes it less appealing. But I did this stuff for years when it was a new computer and just accepted that's what you had to do, even though I hated it then. It's just harder waiting that long now with how instantaneous everything is. 

Those scripts should help a lot so thanks again.

Link to comment
Share on other sites

14 minutes ago, zorkiii said:

Yeah I'm looking forward to the evolution of emulation getting to the point of completely skipping the loading stages on the 64 somehow. That and the Amiga. I love playing the game Dark Castle on the Amiga for instance but it's a pretty hard game and having to wait a terribly long time for things to load every time you die is not something I want to kick back and relax doing. The C64 is chock full of game examples like this, and having to swap disks etc makes it less appealing. But I did this stuff for years when it was a new computer and just accepted that's what you had to do, even though I hated it then. It's just harder waiting that long now with how instantaneous everything is. 

This is why I use Maximum 1541 Speed in CCS64, it's the single greatest QOL improvement in any C64 emulator out there, and no other emulator really has an equivalent. The load times aren't quite instantaneous, but they're pretty damn close most of the time, while requiring nothing from the user in the meantime. It automatically turns on when a game is loading data and automatically turns off when the load is complete. And you don't lose True Drive compatibility because it's speeding up the emulation speed, rather than performing a fastload. If you don't have Maximum 1541 Speed enabled, you need to ASAP. It's in Special -> Maximum 1541 Speed: On - Quiet (On is the same thing as On - Quiet except it shows a message box on screen when the feature activates).

WHDLoad games in FS-UAE also dramatically cut down on load times for Amiga.

Link to comment
Share on other sites

Thank you , I appreciate it. I compiled the joystick detection script, after running it it is showing:

Quote

Microsoft-PC-Joystick driver (#1):
X050 Y050 Z050 R050 U050 POV-1
Buttons down:

(right click the tray icon to exit)

This is with my Xbox One (wired) controller plugged in to my PC. Moving the joystick doesn't appear to change anything with this. Does this seem to indicate any issue?

Also is the NoMousey.exe required for this script? I ran a game testing this out for 1Joy# (whatever the number was in your script) and wasn't able to get anything to control. Also I couldn't control my mouse when I tried to exit, is there a trick to exiting nomousey when it's running?
 

*Edit* I originally wrote Xbox 360, I meant Xbox One Wireless (but connected wired) controller

Edited by zorkiii
Link to comment
Share on other sites

You should be using 1Joy# in the script I posted then. My joystick test script shows it's #2, which is why I have to use 2Joy#. I couldn't tell you why it's not showing anything when you move the joystick. Does it show anything when you press a button? The joysticks, triggers, and d-pad are all treated differently than standard buttons, because the sticks and triggers are analog and the d-pad is seen as POV/Hat switches.

13 hours ago, zorkiii said:

Also is the NoMousey.exe required for this script? I ran a game testing this out for 1Joy# (whatever the number was in your script) and wasn't able to get anything to control. Also I couldn't control my mouse when I tried to exit, is there a trick to exiting nomousey when it's running?

NoMousy is not required. You'd need to update your paths in the script to where you have NoMousy located if you want to use it. It turns on when the emulator starts and ends when you exit.  If you don't want to use it, just remove the two lines for it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...