Skip to content

Commit

Permalink
remove support for right and middle button with Amiga and AtariST mic…
Browse files Browse the repository at this point in the history
…e - These connect POT lines with GND when pressed, and are open if not, which the C64 can not detect (since there is no pullup resistor)

git-svn-id: https://svn.code.sf.net/p/vice-emu/code/trunk@45196 379a1393-f5fb-40a0-bcee-ef074d9b53f7
  • Loading branch information
mrdudz committed Jun 16, 2024
1 parent 3b01f51 commit e8fb73c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 42 deletions.
8 changes: 0 additions & 8 deletions vice/src/joyport/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,6 @@ static void mouse_button_right(int pressed)
case MOUSE_TYPE_NEOS:
mouse_neos_button_right(pressed);
break;
case MOUSE_TYPE_AMIGA:
case MOUSE_TYPE_ST:
mouse_amiga_st_button_right(pressed);
break;
default:
break;
}
Expand All @@ -434,10 +430,6 @@ static void mouse_button_middle(int pressed)
case MOUSE_TYPE_MICROMYS:
micromys_mouse_button_middle(pressed);
break;
case MOUSE_TYPE_AMIGA:
case MOUSE_TYPE_ST:
mouse_amiga_st_button_right(pressed);
break;
default:
break;
}
Expand Down
45 changes: 13 additions & 32 deletions vice/src/joyport/mouse_quadrature.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
- inception joystick adapter ports (x64/x64sc/xscpu64/x128/xvic/xcbm5x0)
- sidcart joystick adapter port (xplus4)
Note: right and middle button are "open/floating" when not pressed, and connected
to GND when pressed. Since there is no pullup resistor in the mouse, the C64 can
not distinguish between the two states.
cport | cx22 | I/O
-------------------------
1 | X direction | I
Expand Down Expand Up @@ -77,6 +81,11 @@
- native joystick port(s) (x64/x64sc/xscpu64/x128/xvic/xcbm5x0/xplus4)
- inception joystick adapter ports (x64/x64sc/xscpu64/x128/xvic/xcbm5x0)
- sidcart joystick adapter port (xplus4)
Note: right button is "open/floating" when not pressed, and connected to GND
when pressed. Since there is no pullup resistor in the mouse, the C64 can
not distinguish between the two states.
*/

/* #define DEBUG_QUADRATURE */
Expand Down Expand Up @@ -165,25 +174,6 @@ static uint8_t joyport_mouse_poll_value(int port)
return retval;
}

static uint8_t joyport_mouse_amiga_st_read_potx(int port)
{
return _mouse_enabled ? ((amiga_and_atarist_buttons & 1) ? 0xff : 0) : 0xff;
}

static uint8_t joyport_mouse_amiga_st_read_poty(int port)
{
return _mouse_enabled ? ((amiga_and_atarist_buttons & 2) ? 0xff : 0) : 0xff;
}

void mouse_amiga_st_button_right(int pressed)
{
if (pressed) {
amiga_and_atarist_buttons |= JOYPORT_UP;
} else {
amiga_and_atarist_buttons &= ~JOYPORT_UP;
}
}

void mouse_amiga_st_button_left(int pressed)
{
if (pressed) {
Expand All @@ -193,15 +183,6 @@ void mouse_amiga_st_button_left(int pressed)
}
}

void mouse_amiga_st_button_middle(int pressed)
{
if (pressed) {
amiga_and_atarist_buttons |= JOYPORT_DOWN;
} else {
amiga_and_atarist_buttons &= ~JOYPORT_DOWN;
}
}

static int joyport_mouse_set_enabled(int port, int joyportid)
{
int mt;
Expand Down Expand Up @@ -250,8 +231,8 @@ static joyport_t mouse_amiga_joyport_device = {
joyport_mouse_set_enabled, /* device enable/disable function */
joyport_mouse_poll_value, /* digital line read function */
NULL, /* NO digital line store function */
joyport_mouse_amiga_st_read_potx, /* pot-x read function */
joyport_mouse_amiga_st_read_poty, /* pot-y read function */
NULL, /* pot-x read function */
NULL, /* pot-y read function */
NULL, /* NO powerup function */
mouse_amiga_write_snapshot, /* device write snapshot function */
mouse_amiga_read_snapshot, /* device read snapshot function */
Expand Down Expand Up @@ -301,8 +282,8 @@ static joyport_t mouse_st_joyport_device = {
joyport_mouse_set_enabled, /* device enable/disable function */
joyport_mouse_poll_value, /* digital line read function */
NULL, /* NO digital line store function */
joyport_mouse_amiga_st_read_potx, /* pot-x read function */
joyport_mouse_amiga_st_read_poty, /* pot-y read function */
NULL, /* pot-x read function */
NULL, /* pot-y read function */
NULL, /* NO powerup function */
mouse_st_write_snapshot, /* device write snapshot function */
mouse_st_read_snapshot, /* device read snapshot function */
Expand Down
2 changes: 0 additions & 2 deletions vice/src/joyport/mouse_quadrature.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,5 @@ int mouse_st_register(void);
void mouse_amiga_st_init(void);

void mouse_amiga_st_button_left(int pressed);
void mouse_amiga_st_button_right(int pressed);
void mouse_amiga_st_button_middle(int pressed);

#endif

0 comments on commit e8fb73c

Please sign in to comment.