git @ Cat's Eye Technologies linapple / 6456abd
Re-added quantitized joystick support (via mouse/mousepad). This is critical for games like Sabotage, which will now work properly. Also, the joystick is far, far more prevalent in Apple ][ software than the mouse... ghedger authored 6 years ago T. Joseph Carter committed 3 years ago
2 changed file(s) with 3 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
753753
754754 case SDL_MOUSEBUTTONDOWN:
755755 if(e->button.button == SDL_BUTTON_LEFT) {// left mouse button was pressed
756
757756 if (buttondown == -1)
758757 {
759758 x = e->button.x; // mouse cursor coordinates
773772 JoySetButton(BUTTON0, BUTTON_DOWN);
774773 }
775774 }// we do not use mouse
776 else if ( (/*(x < buttonx) &&*/ JoyUsingMouse() && ((g_nAppMode == MODE_RUNNING) ||
775 else if ( (/*(x < buttonx) && JoyUsingMouse() && */((g_nAppMode == MODE_RUNNING) ||
777776 (g_nAppMode == MODE_STEPPING))) || (sg_Mouse.Active()) )
778777 {
779778 SetUsingCursor(1); // capture cursor
232232 }
233233 else
234234 {
235 joytype[0] = DEVICE_MOUSE;
235 joytype[0] = DEVICE_JOYSTICK;
236236 }
237237 }
238238
568568 // Called when mouse is being used as a joystick && mouse position changes
569569 void JoySetPosition (int xvalue, int xrange, int yvalue, int yrange)
570570 {
571 int nJoyNum = (joyinfo[joytype[0]].device == DEVICE_MOUSE) ? 0 : 1;
571 int nJoyNum = 0; (joyinfo[joytype[0]].device == DEVICE_MOUSE) ? 0 : 1;
572572 xpos[nJoyNum] = (xvalue * 255) / xrange;
573573 ypos[nJoyNum] = (yvalue * 255) / yrange;
574574 }