I wanted to see if my Sirius Joyport hack would work with the apple2 driver and it seems to be a bit simpler:

Yes, it's hacky but it works.

I'm having a blast beating Stellar 7 again, this time with the Atari Joystick.

./mame64 apple2p stellar7 -speed 1.5

(it's a bit better a little faster I think, you may have to do -frameskip 4 to get it to actually go faster)


Code
$ cat diff_apple2sirius.cpp 
114a115,116
>                 m_djoy_0_1(*this, "djoy_0_1"),
>                 m_djoy_b(*this, "djoy_b"),
136a139
>         required_ioport m_djoy_0_1, m_djoy_b;
640a644
>              if (!(m_sysconfig->read() & 0x80)) // if not Sirius Joyport enabled
641a646,650
>              else {
>                     // Sirius Joyport return joystick button, active low so read is inverted before &,
>                     //  return 0x0 if pressed, 0x80 if not pressed
>                     return (~(m_djoy_b->read()) & 0x01) ? 0x0 : 0x80;
>                     }
644c653,659
< 		return (m_joybuttons->read() & 0x20) ? 0x80 : 0;
---
> 	if (!(m_sysconfig->read() & 0x80))  // if not Sirius Joyport enabled
> 	         return (m_joybuttons->read() & 0x20) ? 0x80 : 0;
>         else {
>                 // Sirius Joyport return Up (0x01) or Left (0x04) depending on Annunciator #1,
>                 //  active low so read is inverted before &, return 0x0 if pressed, 0x80 if not pressed
>                 return ((~(m_djoy_0_1->read())) & ((m_an1) ? 0x01 : 0x04)) ? 0x0 : 0x80;
>                }
646a662
>                if (!(m_sysconfig->read() & 0x80)) {  // if not Sirius Joyport enabled
652a669,675
>                }
> 
>                else {  
>                // Sirius Joyport return status of Down (0x02) or Right (0x08) depending on Annunciator #1,
>                //  active low so read is inverted before &, return 0x0 if pressed, 0x80 if not pressed
>                return ((~(m_djoy_0_1->read())) & ((m_an1) ? 0x02 : 0x08)) ? 0x0 : 0x80;
> }
1146a1170,1191
> static INPUT_PORTS_START( apple2_sirius_joyport )
>          PORT_START("djoy_0_1")
>          PORT_BIT(0x01, 0x01, IPT_JOYSTICK_UP)    PORT_CODE(KEYCODE_8_PAD) PORT_CODE(JOYCODE_Y_UP_SWITCH)    PORT_PLAYER(1)
>          PORT_BIT(0x02, 0x02, IPT_JOYSTICK_DOWN)  PORT_CODE(KEYCODE_2_PAD) PORT_CODE(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(1)
>          PORT_BIT(0x04, 0x04, IPT_JOYSTICK_LEFT)  PORT_CODE(KEYCODE_4_PAD) PORT_CODE(JOYCODE_X_LEFT_SWITCH)  PORT_PLAYER(1)
>          PORT_BIT(0x08, 0x08, IPT_JOYSTICK_RIGHT) PORT_CODE(KEYCODE_6_PAD) PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(1)
>          PORT_BIT(0x10, 0x10, IPT_JOYSTICK_UP)    PORT_CODE(KEYCODE_8_PAD) PORT_CODE(JOYCODE_Y_UP_SWITCH)    PORT_PLAYER(2)
>          PORT_BIT(0x20, 0x20, IPT_JOYSTICK_DOWN)  PORT_CODE(KEYCODE_2_PAD) PORT_CODE(JOYCODE_Y_DOWN_SWITCH)  PORT_PLAYER(2)
>          PORT_BIT(0x40, 0x40, IPT_JOYSTICK_LEFT)  PORT_CODE(KEYCODE_4_PAD) PORT_CODE(JOYCODE_X_LEFT_SWITCH)  PORT_PLAYER(2)
>          PORT_BIT(0x80, 0x80, IPT_JOYSTICK_RIGHT) PORT_CODE(KEYCODE_6_PAD) PORT_CODE(JOYCODE_X_RIGHT_SWITCH) PORT_PLAYER(2)
> 
>          PORT_START("djoy_b")
>          PORT_BIT(0x01, 0x01, IPT_BUTTON1) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(JOYCODE_BUTTON1) PORT_PLAYER(1)
>          PORT_BIT(0x02, 0x02, IPT_BUTTON1) PORT_CODE(JOYCODE_BUTTON1)  PORT_PLAYER(2)
>          PORT_BIT(0x04, 0x04, IPT_UNUSED)
>          PORT_BIT(0x08, 0x08, IPT_UNUSED)
>          PORT_BIT(0x10, 0x10, IPT_BUTTON2) PORT_CODE(KEYCODE_DEL_PAD) PORT_CODE(JOYCODE_BUTTON2) PORT_PLAYER(1)
>          PORT_BIT(0x20, 0x20, IPT_BUTTON2) PORT_CODE(JOYCODE_BUTTON2) PORT_PLAYER(2)
>          PORT_BIT(0x40, 0x40, IPT_UNUSED)
>          PORT_BIT(0x80, 0x80, IPT_UNUSED)
> INPUT_PORTS_END
> 
1147a1193
>         PORT_INCLUDE( apple2_sirius_joyport )
1161a1208,1212
> 
>         PORT_CONFNAME(0x80, 0x00, "Gameport type")
>         PORT_CONFSETTING(0x00, "Normal")
>         PORT_CONFSETTING(0X80, "Sirius Joyport (Atari Digital)")
>