I thought I'd try all the games in the sirius collection as they'd be the ones most likely to have sirius joyport support.

So far I've found that bandits, hadron, buzzard bait, freefall work with the joyport.

Copts and robbers is a curious case. It has code to read the joyport, but it just doesn't work, moving the character only when the fire button is pressed and then backwards and diagonally to the upper left.

Copts and robbers is a loose clone of adventure, down to the use of a magnet and a block representing the player's character.

The manual doesn't mention the joyport. https://mocagh.org/miscgame/coptsrobbers.pdf

[Linked Image from i.imgur.com]

CTRL+shift+P activates the joyport, CTRL+K goes back to keyboard.

I looked and looked at the code at 1f40 and it just doesn't work because the joyport has buttons that are active low, hi bit set when pressed.


If we change the BMIs to BPLs and vice versa ($30 to $10) and ($10 to $30) then the routine behaves normally.

The first thing it does is to check the button and bmi to 1fbf if the button is pressed to return the value in $c4. This is clearly backwards and must be a BPL.

puts left button in $26
right in $27
up in $28
down in $29

when the routine exits, it has loaded the accumulator with the value of one of the following memory addresses (which basically mimics the keyboard actions):
Code
$c0 = c1 = A
$c1 = 95 = CTRL+U or right arrow
$c2 = da = Z
$c3 = 88 = CTRL+H or left arrow
$c4 = a0 = space

1F40: AD 61 C0 lda RDBTN0
1F43: 30 7A    bmi $1fbf
1F45: AD 5A C0 lda CLRAN1
1F48: AD 62 C0 lda BUTN1
1F4B: 85 26    sta <GBASL
1F4D: AD 63 C0 lda RD63
1F50: 85 27    sta <GBASH
1F52: AD 5B C0 lda SETAN1
1F55: AD 62 C0 lda BUTN1
1F58: 85 28    sta <BASL
1F5A: AD 63 C0 lda RD63
1F5D: 85 29    sta <BASH
1F5F: A5 26    lda <GBASL
1F61: 05 27    ora $27
1F63: 85 2A    sta $2a
1F65: A5 28    lda <BASL
1F67: 05 29    ora $29
1F69: 25 2A    and $2a
1F6B: 10 0A    bpl $1f77
1F6D: 24 FE    bit $fe
1F6F: 10 03    bpl $1f74
1F71: 4C 8B 1F jmp $1f8b
1F74: 4C 96 1F jmp $1f96
1F77: 20 8B 1F jsr $1f8b
1F7A: F0 01    beq $1f7d
1F7C: 60       rts
1F7D: 20 96 1F jsr $1f96
1F80: F0 01    beq $1f83
1F82: 60       rts
1F83: A9 00    lda #$00
1F85: 85 80    sta $80
1F87: AD 00 C0 lda KBD / 80STOREOFF
1F8A: 60       rts

if 26 (left) is pressed, go to 1faf  (load $c3)

1F8B: A5 26    lda <GBASL
1F8D: 30 20    bmi $1faf        

if 27 (right) is pressed go to 1fb3  (load $c1)

1F8F: A5 27    lda <GBASH
1F91: 30 20    bmi $1fb3
1F93: A9 00    lda #$00
1F95: 60       rts
1F96: A5 28    lda <BASL
1F98: 30 1D    bmi $1fb7
1F9A: A5 29    lda <BASH
1F9C: 30 1D    bmi $1fbb
1F9E: A9 00    lda #$00
1FA0: 60       rts
1FA1: 08       php
1FA2: A0 00    ldy #$00
1FA4: 84 FE    sty $fe
1FA6: 28       plp
1FA7: 60       rts
1FA8: 08       php
1FA9: A0 80    ldy #$80
1FAB: 84 FE    sty $fe
1FAD: 28       plp
1FAE: 60       rts

load the value into A and set/clear the diagonal flag in $fe on the way out

1FAF: A5 C3    lda $c3
1FB1: D0 EE    bne $1fa1          clear the diagonal flag
1FB3: A5 C1    lda $c1
1FB5: D0 EA    bne $1fa1
1FB7: A5 C0    lda $c0
1FB9: D0 ED    bne $1fa8          set the diagonal flag
1FBB: A5 C2    lda $c2
1FBD: D0 E9    bne $1fa8
1FBF: A5 C4    lda $c4
1FC1: 60       rts

 

So I after I flipped the bmi <-> bpl, the routine worked more normally, but diagonals weren't working so I had to flip the ora <-> and ($05 to $25) as well.

Code
< 1F43: 30 7A    bmi $1fbf
---
> 1F43: 10 7A    bpl $1fbf
14c14
< 1F61: 05 27    ora $27
---
> 1F61: 25 27    and $27
17,19c17,19
< 1F67: 05 29    ora $29
< 1F69: 25 2A    and $2a
< 1F6B: 10 0A    bpl $1f77
---
> 1F67: 25 29    and $29
> 1F69: 05 2A    ora $2a
> 1F6B: 30 0A    bmi $1f77
35c35
< 1F8D: 30 20    bmi $1faf
---
> 1F8D: 10 20    bpl $1faf
37c37
< 1F91: 30 20    bmi $1fb3
---
> 1F91: 10 20    bpl $1fb3
41c41
< 1F98: 30 1D    bmi $1fb7
---
> 1F98: 10 1D    bpl $1fb7
43c43
< 1F9C: 30 1D    bmi $1fbb
---
> 1F9C: 10 1D    bpl $1fbb

I wonder if this code is a vestige of an early version of the joyport when it may have had active high buttons, or a copy protection?

It's soooo much better with a joyport than the keyboard.