Version 1.14.1.1 (beta)

. Fix: Mouse card is now reset on a system reset (reboot from Fantavision to Dazzle Draw : 'no mouse installed' problem)
. Fix: CLEARMOUSE cmd was resetting the clamp value (Fantavision problem)
This commit is contained in:
tomch 2007-12-01 21:21:40 +00:00
parent 43e2546d46
commit 73f2f63298
5 changed files with 80 additions and 35 deletions

View File

@ -18,8 +18,14 @@ Restrictions/bugs:
- During Mockingboard playback, Speaker emulation isn't precise
1.14.1 - 09 Aug 2007 (beta)
---------------------------
1.14.1.1 - 13 Aug 2007 (beta)
-----------------------------
. Fix: Infiltrator (floating bus was not being returned for all unmapped I/O)
. Fix: Mouse card is now reset on a system reset (reboot from Fantavision to Dazzle Draw : 'no mouse installed' problem)
. Fix: CLEARMOUSE cmd was resetting the clamp value (Fantavision problem)
1.14.1.0 - 09 Aug 2007 (beta)
-----------------------------
. Fix: Mouse support in Contiki v1.3

View File

@ -210,8 +210,8 @@ DISK_ICON ICON "DISK.ICO"
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,14,1,0
PRODUCTVERSION 1,14,1,0
FILEVERSION 1,14,1,1
PRODUCTVERSION 1,14,1,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -229,12 +229,12 @@ BEGIN
VALUE "Comments", "http://applewin.berlios.de"
VALUE "CompanyName", "Michael O'Brien, Oliver Schmidt, Tom Charlesworth"
VALUE "FileDescription", "Apple //e Emulator for Windows"
VALUE "FileVersion", "1, 14, 1, 0"
VALUE "FileVersion", "1, 14, 1, 1"
VALUE "InternalName", "APPLEWIN"
VALUE "LegalCopyright", "© 1994-2007 Michael O'Brien, Oliver Schmidt, Tom Charlesworth, Michael Pohoreski, Nick Westgate, Linards Ticmanis"
VALUE "OriginalFilename", "APPLEWIN.EXE"
VALUE "ProductName", "Apple //e Emulator"
VALUE "ProductVersion", "1, 14, 1, 0"
VALUE "ProductVersion", "1, 14, 1, 1"
END
END
BLOCK "VarFileInfo"

View File

@ -1114,6 +1114,7 @@ void ResetMachineState () {
JoyReset();
MB_Reset();
SpkrReset();
sg_Mouse.Reset();
SoundCore_SetFade(FADE_NONE);
}

View File

@ -59,30 +59,9 @@ CMouseInterface::CMouseInterface() :
m_6821.SetListenerB( this, M6821_Listener_B );
m_6821.SetListenerA( this, M6821_Listener_A );
// g_cDIMouse.SetMouseListener( this, MouseHandler );
m_by6821A = 0;
m_by6821B = 0x40; // Set PB6
m_6821.SetPB(m_by6821B);
m_bVBL = FALSE;
//
m_iX = 0;
m_iMinX = 0;
m_iMaxX = 1023;
m_iRangeX = 0;
m_iY = 0;
m_iMinY = 0;
m_iMaxY = 1023;
m_iRangeY = 0;
m_bButtons[0] = m_bButtons[1] = FALSE;
//
Uninitialize();
Reset();
memset( m_byBuff, 0, sizeof( m_byBuff ) );
m_bActive = false;
}
CMouseInterface::~CMouseInterface()
@ -129,8 +108,44 @@ void CMouseInterface::Initialize(LPBYTE pCxRomPeripheral, UINT uSlot)
m_bActive = true;
}
void CMouseInterface::Uninitialize()
{
m_bActive = false;
}
void CMouseInterface::Reset()
{
m_by6821A = 0;
m_by6821B = 0x40; // Set PB6
m_6821.SetPB(m_by6821B);
m_bVBL = FALSE;
//
m_iX = 0;
m_iMinX = 0;
m_iMaxX = 1023;
m_iRangeX = 0;
m_iY = 0;
m_iMinY = 0;
m_iMaxY = 1023;
m_iRangeY = 0;
m_bButtons[0] = m_bButtons[1] = FALSE;
//
Clear();
memset( m_byBuff, 0, sizeof( m_byBuff ) );
SetSlotRom();
}
void CMouseInterface::SetSlotRom()
{
if (!m_bActive)
return;
LPBYTE pCxRomPeripheral = MemGetCxRomPeripheral();
if (pCxRomPeripheral == NULL)
return;
@ -255,7 +270,7 @@ void CMouseInterface::OnCommand()
CpuIrqDeassert(IS_MOUSE);
break;
case MOUSE_CLEAR:
Reset();
Clear(); // [TC] NB. Don't reset clamp values (eg. Fantavision)
m_nDataLen = 1;
break;
case MOUSE_POS:
@ -341,7 +356,7 @@ void CMouseInterface::OnMouseEvent()
if ( m_bVBL )
byState |= 0x08;
//byState &= m_byMode & 0x2E;
byState &= ((m_byMode & 0x0E) | 0x20); // Keep "X/Y moved since last READMOUSE" for next MOUSE_READ (Contiki v1.3 uses this)
byState &= ((m_byMode & 0x0E) | 0x20); // [TC] Keep "X/Y moved since last READMOUSE" for next MOUSE_READ (Contiki v1.3 uses this)
if ( byState & 0x0E )
{
@ -360,7 +375,7 @@ void CMouseInterface::SetVBlank(bool bVBL)
}
}
void CMouseInterface::Reset()
void CMouseInterface::Clear()
{
m_nBuffPos = 0;
m_nDataLen = 1;
@ -371,8 +386,6 @@ void CMouseInterface::Reset()
m_nY = 0;
m_bBtn0 = 0;
m_bBtn1 = 0;
ClampX( 0, 1023 );
ClampY( 0, 1023 );
SetPosition( 0, 0 );
// CpuIrqDeassert(IS_MOUSE);
@ -407,8 +420,23 @@ void CMouseInterface::SetPosition(int xvalue, int yvalue)
return;
}
#if NDEBUG
m_iX = (UINT) ((xvalue*m_iMaxX) / m_iRangeX);
m_iY = (UINT) ((yvalue*m_iMaxY) / m_iRangeY);
#else
if (m_iMaxX <= m_iRangeX)
{
m_iX = (UINT) ((xvalue*m_iMaxX) / m_iRangeX);
m_iY = (UINT) ((yvalue*m_iMaxY) / m_iRangeY);
}
else
{
// m_iX = (UINT) ((xvalue*m_iRangeX) / m_iMaxX);
// m_iY = (UINT) ((yvalue*m_iRangeY) / m_iMaxY);
m_iX = xvalue;
m_iY = yvalue;
}
#endif
}
void CMouseInterface::SetPosition(int xvalue, int xrange, int yvalue, int yrange)
@ -416,6 +444,15 @@ void CMouseInterface::SetPosition(int xvalue, int xrange, int yvalue, int yrange
m_iRangeX = (UINT) xrange;
m_iRangeY = (UINT) yrange;
#if NDEBUG
#else
if (m_iMaxX > m_iRangeX)
{
xvalue = (int) ( ((float)xvalue / (float)m_iRangeX) * (float)m_iMaxX );
yvalue = (int) ( ((float)yvalue / (float)m_iRangeY) * (float)m_iMaxY );
}
#endif
SetPosition(xvalue, yvalue);
OnMouseEvent();
}

View File

@ -13,7 +13,8 @@ public:
virtual ~CMouseInterface();
void Initialize(LPBYTE pCxRomPeripheral, UINT uSlot);
void Uninitialize(){ m_bActive = false; }
void Uninitialize();
void Reset();
void SetSlotRom();
static BYTE __stdcall IORead(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nCyclesLeft);
static BYTE __stdcall IOWrite(WORD PC, WORD uAddr, BYTE bWrite, BYTE uValue, ULONG nCyclesLeft);
@ -29,7 +30,7 @@ protected:
void OnCommand();
void OnWrite();
void OnMouseEvent();
void Reset();
void Clear();
friend WRITE_HANDLER( M6821_Listener_A );
friend WRITE_HANDLER( M6821_Listener_B );