Modification request for One Switch games

new games to be launched and discussed here
OneSwitch
Posts: 60
Joined: Tue Nov 22, 2011 5:50 pm
Contact:

Modification request for One Switch games

Postby OneSwitch » Tue Dec 12, 2017 9:34 pm

Alongside some of the fantastic Special Needs / Educational BBC Micro software, there are some interesting one-switch (ish) games it seems.

These are games playable with a single button, and typically, suit disabled gamers finding more complicated controllers too hard to cope with.

I'm planning to build a section on my site (www.oneswitch.org.uk) to promote some of these brilliant (often forgotten) titles. Might inspire people to make more games with simple controls.

Wondering if anyone can help with the following.....

1. Improve the accessibility of Catacastles: http://bbcmicro.co.uk//game.php?id=1446....

Would be great to make the controls SPACE BAR and Enter if possible instead of CAPS LOCK and COPY. They should ideally work to start and restart the game. Even better still, would be to enable switch access. BeemEm can replicate this (known as the USER PORT Break-out Box - although the numbering seems slightly out compared to how the switch interface boxes were made).

I can't work out the code in Catacastles as for how the input works, but I have remembered this for a switch interface box...

Image

10 f%=?&FE60:PRINTf%:GOTO10 (possible to test using BeebEm)

f%=254 SWITCH1
f%=253 SWITCH2
f%=252 (SWITCH 1 + 2 pressed at the same time)
f%=251 SWITCH3
f%=247 SWITCH4
255 = all switches released



2. Apart from Blitz/Bomber/Air Attack games, are people aware of any other games that can be played with a single key on the BBC Micro?

Fingers crossed. :)

Barrie
OneSwitch.org.uk

User avatar
richardtoohey
Posts: 3409
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: Modification request for One Switch games

Postby richardtoohey » Mon Jan 01, 2018 5:57 am

OneSwitch wrote:I can't work out the code in Catacastles as for how the input works
I'm not exactly sure what you are after; the code looks like it's all BASIC:

240DIM B%(1,2),A(4,2),C%(2),KO%(2),P%(2),AN(2),OG%(2),G%(2),I%(2),DA%(2)
...
260KO%(1)=0:KO%(2)=0:C%(1)=0:C%(2)=0:AN(1)=1.6:AN(2)=4.7:G%(1)=0:G%(2)=0:I%(1)=-65:I%(2)=-106
...
590IFINKEY(I%(Z%))=0 GOTO640
...

So I%(1) of -65 ... is CAPS LOCK.

I%(2) of -106 ... is COPY.

So you could try tweaking those values on line 260.

Space bar is -99, Return is -74.

Hope that helps, but if you explain a bit more about what you need, that would be useful!

OneSwitch
Posts: 60
Joined: Tue Nov 22, 2011 5:50 pm
Contact:

Re: Modification request for One Switch games

Postby OneSwitch » Sat Jan 13, 2018 5:56 pm

Thank you! I'll give that a go.

I'm looking to get that game (and others) more easily set-up to work with conventional PC / Mac accessibility switch interfaces. These are normally simple interface boxes that you can plug an external push-button / switch into, that converts input to the SPACE BAR or Enter key for example.

To avoid faff for the end-user, it would be great to get games with obscure key presses to these more conventional controls.

I know this is niche of niche stuff, but I'm keen to show that some of this old stuff can still be great fun and relevant.

OneSwitch
Posts: 60
Joined: Tue Nov 22, 2011 5:50 pm
Contact:

Re: Modification request for One Switch games

Postby OneSwitch » Sat Jan 13, 2018 8:28 pm

Many thanks, Richard. That did the trick. I've attached the simple fix version (will work on-line). This has the left-side player using the SPACE BAR, and the right-side player as ENTER.

I'd like for it also to work with the switch interface box on a real BBC Micro ideally.

Where it checks for keyboard input (SPACE / ENTER), I'd like for it to check for switch input too....

10 f%=?&FE60:PRINTf%:GOTO10

face%=254 SWITCH1 pressed
face%=253 SWITCH2 pressed
face%=252 SWITCH1+2 pressed

I'll see if I can get that working too. This may beat me with my rusty skills.

Anyway, cheers again. Appreciated.
Attachments
Catacastles_OneSwitch_Mod.ssd
(200 KiB) Downloaded 9 times

User avatar
richardtoohey
Posts: 3409
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: Modification request for One Switch games

Postby richardtoohey » Sun Feb 11, 2018 4:04 am

How did you get on?

The logic looks like it handles player 1 and then player 2 via Z%.

Code: Select all

 330FORZ%=1TO2
...
  590IFINKEY(I%(Z%))=0 GOTO640
  600PROCcata(Z%,1):SOUND0,2,29,10
  610OG%(Z%)=0:C%(Z%)=1:P%(Z%)=160
  620A(1,Z%)=X%+1:A(2,Z%)=5
  630A(3,Z%)=0:A(4,Z%)=0
  640NEXT Z%

So the INKEY test at line 590 is a "negative" test (if I'm reading it correctly.) So it's checking for the key being pressed for player 1, and if it's not pressed (INKEY returns 0) then it jumps to line 640 - NEXT - so it will do the same test, but for player 2's key.

So I think just as an initial go, something like this (this won't work if both switches are pressed, it's just a test to see if this is the right direction to go in!)

Code: Select all

591SW%=?&FE60
592IF Z%=1 AND SW%<>254 GOTO 640
593IF Z%=2 AND SW%<>253 GOTO 640

So we get the value from &FE60, then in line 592 we do similar "negative" logic - if we are handling player 1 (Z% is 1) and &FE60 is NOT 254, then we jump to the NEXT at line 640.

When we get back to line 593 Z% will be 2, so we check for switch 2, and if we don't get the value for that, we jump to the NEXT at line 640 (which will be terminated when Z% is 2).

IF the corresponding switch is pressed, then we'll fall into the player movement logic (exactly as the INKEY testing does.)

Might be better making line 591 as line 329 so the contents of FE60 are read once; not sure if it will matter.

Definitely not the best/right way to code this; proof-of-concept at this stage! Should be able to simplify it down to one line/one bit of logic, and also make it work when switch 1 & 2 pressed at the same time.


Who is online

Users browsing this forum: No registered users and 1 guest