PS/2 / USB discussion (split from What's the state of play with serial port support?)

Chat about anything CX16 related that doesn't fit elsewhere
Perifractic
Posts: 511
Joined: Sat Apr 25, 2020 4:53 pm

PS/2 / USB discussion (split from What's the state of play with serial port support?)

Post by Perifractic »



13 minutes ago, martinot said:




I find it very strange for the X16, as a (spiritual) model in the Commodore history line of computers, to not have DE-9 ports build in. A real missed opportunity IMHO.



Have you read the reasoning in the FAQ and does that change your opinion? 

BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

PS/2 / USB discussion (split from What's the state of play with serial port support?)

Post by BruceMcF »



26 minutes ago, martinot said:




I find it very strange for the X16, as a (spiritual) model in the Commodore history line of computers, to not have DE-9 ports build in. A real missed opportunity IMHO.



An opportunity to what, exactly? To have games limited to four directions and one fire button, and lose 5-6 out of 14 GPIO from the User Port?

That's mostly the opportunity to lose game developers for the CX16, because once you've gotten used to developing for a controller with an adequate number of inputs, going back to the Atari joystick with single fire button is very constraining.

rje
Posts: 1263
Joined: Mon Apr 27, 2020 10:00 pm
Location: Dallas Area

PS/2 / USB discussion (split from What's the state of play with serial port support?)

Post by rje »



On 7/24/2020 at 5:53 PM, TomXP411 said:




Correct - the box to request the 2.5 firmware is already checked; IIRC,  you can also choose to check the 3.0 firmware, with the knowledge that you gain more programability but lose the PS/2 protocol. 



I didn't realize that keyboards had to have dual control firmware to handle PS/2 + USB.  Learn something new every day.

I've got one of the X16 WASD keyboards, and I love it, by the way.  I use it every day for work, and non-work, and X16 hacking.  Just icing on the cake that it works in both modes. With Cherry switches I guess it will last for the rest of my life.

 


4 hours ago, martinot said:




I find it very strange for the X16, as a (spiritual) model in the Commodore history line of computers, to not have DE-9 ports build in. A real missed opportunity IMHO.



I found it a little worrisome, because I *already know* how to read the C64's joystick ports -- heck, I remember that they're at $DC00 and $DC01, and I haven't programmed for them in 34 years.

But, I understand the argument for MOAR BUTTONS, and I think that opens up interesting stuff you can do, so, OK.

I'm also glad that there are pin headers for an additional two controllers, but that's just me remembering M.U.L.E.  Hmm, there's another game I want to write for the X16.  I should have a list.

 

 

User avatar
StephenHorn
Posts: 565
Joined: Tue Apr 28, 2020 12:00 am
Contact:

PS/2 / USB discussion (split from What's the state of play with serial port support?)

Post by StephenHorn »



59 minutes ago, rje said:




I found it a little worrisome, because I *already know* how to read the C64's joystick ports -- heck, I remember that they're at $DC00 and $DC01, and I haven't programmed for them in 34 years.



The new interface is to jsr $FF53 to poll the controllers, followed by jsr $ff56 with the accumulator set to 0 or 1 (to select which controller to read). This will put the state of the joystick into the accumulator, and the x and y registers. See also: Joystick.

Developer for Box16, the other X16 emulator. (Box16 on GitHub)
I also accept pull requests for x16emu, the official X16 emulator. (x16-emulator on GitHub)
Michael Steil
Posts: 94
Joined: Mon May 18, 2020 7:25 pm

PS/2 / USB discussion (split from What's the state of play with serial port support?)

Post by Michael Steil »



7 hours ago, StephenHorn said:




The new interface is to jsr $FF53 to poll the controllers, followed by jsr $ff56 with the accumulator set to 0 or 1 (to select which controller to read). This will put the state of the joystick into the accumulator, and the x and y registers. See also: Joystick.



And unless you have disabled the default IRQ handler, you don't need to call $FF53. Also, the reason you have to call $FF56 to get the state is because I want to move away from magic memory locations. Even the VIC-20 had an API to query the size of the screen, but it lacked calls for more advanced functionality. For the X16, I want to expose as much as possible/necessary through calls, so I have more freedom changing the memory layout in the future.

rje
Posts: 1263
Joined: Mon Apr 27, 2020 10:00 pm
Location: Dallas Area

PS/2 / USB discussion (split from What's the state of play with serial port support?)

Post by rje »



On 8/27/2020 at 7:45 AM, Michael Steil said:




And unless you have disabled the default IRQ handler, you don't need to call $FF53. Also, the reason you have to call $FF56 to get the state is because I want to move away from magic memory locations. Even the VIC-20 had an API to query the size of the screen, but it lacked calls for more advanced functionality. For the X16, I want to expose as much as possible/necessary through calls, so I have more freedom changing the memory layout in the future.



When I read about polling the controllers, I thought that it was sinful moving away from memory-mapped I/O.  But then I remember (once again) a video by 8-bit Show and Tell where the "1nvader" programmer had to do what almost amounts to "de-bouncing" the joystick fire button to avoid false triggerings.



And, I was glancing over Woz' tiny monitor, and I see that in order to print stuff to the Apple's screen, he has to explicitly check the state of the display driver.  Whereas we simply have to jsr $ffd2.

So, bring on the routines.  This is fine.

BruceMcF
Posts: 1336
Joined: Fri Jul 03, 2020 4:27 am

PS/2 / USB discussion (split from What's the state of play with serial port support?)

Post by BruceMcF »



On 8/27/2020 at 8:45 PM, Michael Steil said:




And unless you have disabled the default IRQ handler, you don't need to call $FF53. Also, the reason you have to call $FF56 to get the state is because I want to move away from magic memory locations. Even the VIC-20 had an API to query the size of the screen, but it lacked calls for more advanced functionality. For the X16, I want to expose as much as possible/necessary through calls, so I have more freedom changing the memory layout in the future.



Though shift / control was always by magic memory locations, even when you called the KERNAL, since SCNKEY put the keyboard scan value in a magic memory location, return shift/control/commodore status in a register and put the key in the keyboard buffer, which was another magic memory location.

It would be lovely if SCNKEY returned full shift/roll-over information with a shift mask and the number of keys in the keyboard event in A, 0 if no key is pressed, b7=Shift b6=Ctrl b5=Cmndr, b0-b2 number of roll-over keys, with the address of the rollover keys (normally 0 or 1) in XY.

martinot
Posts: 115
Joined: Fri Aug 21, 2020 3:32 pm

PS/2 / USB discussion (split from What's the state of play with serial port support?)

Post by martinot »



On 8/27/2020 at 1:43 AM, BruceMcF said:




An opportunity to what, exactly? To have games limited to four directions and one fire button, and lose 5-6 out of 14 GPIO from the User Port?



That's mostly the opportunity to lose game developers for the CX16, because once you've gotten used to developing for a controller with an adequate number of inputs, going back to the Atari joystick with single fire button is very constraining.



Yes, I can understand that. It is just that anything Commodore (or Atari) is so (for me) tightly linked to that type of connector and style of joystick!

But I can see why you would like to have something better. In fact I did that even back in the days; As the Apple II+ (and not the Commodore/Spectrum/Atari) computers where my own machine growing up, I actually prefer/preferred the analogue joystick input those provided (way better than digital only directions). ?

Post Reply