mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-09-29 06:55:15 +00:00
Mouse: support VBL even when in 'mouse off' mode. (Fixes #1138)
This commit is contained in:
parent
6a1ebe7801
commit
0000e8b9c3
@ -111,7 +111,7 @@ Etc.
|
||||
#define MODE_MOUSE_ON (1<<0) // | | | | | | | \--- Mouse off (0) or on (1)
|
||||
#define MODE_INT_MOVEMENT (1<<1) // | | | | | | \----- Interrupt if mouse is moved
|
||||
#define MODE_INT_BUTTON (1<<2) // | | | | | \------- Interrupt if button is pressed
|
||||
#define MODE_INT_VBL (1<<3) // | | | | \--------- Interrupt on VBL
|
||||
#define MODE_INT_VBL (1<<3) // | | | | \--------- Interrupt on VBL [*1]
|
||||
#define MODE_RESERVED4 (1<<4) // | | | \----------- Reserved
|
||||
#define MODE_RESERVED5 (1<<5) // | | \------------- Reserved
|
||||
#define MODE_RESERVED6 (1<<6) // | \--------------- Reserved
|
||||
@ -119,6 +119,9 @@ Etc.
|
||||
|
||||
#define MODE_INT_ALL STAT_INT_ALL
|
||||
|
||||
// [*1] "A mode byte of $08 (mouse off but VBL interrupt on) will generate VBL interrupts."
|
||||
// Ref. Apple II Technical Notes - Mouse #3: "Mode Byte of the SetMouse Routine"
|
||||
|
||||
//===========================================================================
|
||||
|
||||
void M6821_Listener_B( void* objTo, BYTE byData )
|
||||
@ -449,9 +452,11 @@ void CMouseInterface::OnMouseEvent(bool bEventVBL)
|
||||
{
|
||||
int byState = 0;
|
||||
|
||||
if ( !( m_byMode & MODE_MOUSE_ON ) ) // Mouse Off
|
||||
return;
|
||||
if ((m_byMode & MODE_INT_VBL) && bEventVBL)
|
||||
byState |= STAT_INT_VBL;
|
||||
|
||||
if (m_byMode & MODE_MOUSE_ON)
|
||||
{
|
||||
if (m_nX != m_iX || m_nY != m_iY)
|
||||
{
|
||||
byState |= STAT_INT_MOVEMENT | STAT_MOVEMENT_SINCE_READMOUSE; // X/Y moved since last READMOUSE | Movement interrupt
|
||||
@ -460,11 +465,13 @@ void CMouseInterface::OnMouseEvent(bool bEventVBL)
|
||||
|
||||
if (m_bBtn0 != m_bButtons[0] || m_bBtn1 != m_bButtons[1])
|
||||
byState |= STAT_INT_BUTTON; // Button 0/1 interrupt
|
||||
if ( bEventVBL )
|
||||
byState |= STAT_INT_VBL;
|
||||
|
||||
//byState &= m_byMode & 0x2E;
|
||||
byState &= ((m_byMode & MODE_INT_ALL) | STAT_MOVEMENT_SINCE_READMOUSE); // [TC] Keep "X/Y moved since last READMOUSE" for next MOUSE_READ (Contiki v1.3 uses this)
|
||||
}
|
||||
else // if MOUSE OFF then only consider VBL (GH#1138)
|
||||
{
|
||||
byState &= STAT_INT_VBL;
|
||||
}
|
||||
|
||||
if ( byState & STAT_INT_ALL )
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user