fixed duplicate events (menu + emulation) in debugger

This commit is contained in:
thrust26 2023-08-16 07:28:35 +02:00
parent 58c12ca254
commit 8f0ea1a70b
3 changed files with 95 additions and 78 deletions

View File

@ -4942,7 +4942,7 @@ Ms Pac-Man (Stella extended codes):
<tr><td>UASW </td><td>8K UA Ltd. (swapped banks)</td><td>.UASW </td></tr>
<tr><td>WD </td><td>Wickstead Design (Pink Panther) </td><td>.WD </td></tr>
<tr><td>WDSW </td><td>Wickstead Design (Pink Panther) (bad)</td><td>.WDSW </td></tr>
<tr><td>X07 &#185;</td><td>64K AtariAge </td><td>.X07 </td></tr>
<tr><td>X07</td><td>64K AtariAge </td><td>.X07 </td></tr>
</table></td>
</tr>

View File

@ -137,90 +137,93 @@ void DebuggerDialog::handleKeyDown(StellaKey key, StellaMod mod, bool repeated)
}
}
// handle emulation keys second (can be remapped)
const Event::Type event = instance().eventHandler().eventForKey(EventMode::kEmulationMode, key, mod);
switch (event)
// Do not handle emulation events which have the same mapping as menu events
if(instance().eventHandler().eventForKey(EventMode::kMenuMode, key, mod) == Event::NoType)
{
case Event::ExitMode:
// make consistent, exit debugger on key UP
if(!repeated)
myExitPressed = true;
return;
// handle emulation keys second (can be remapped)
const Event::Type event = instance().eventHandler().eventForKey(EventMode::kEmulationMode, key, mod);
switch(event)
{
case Event::ExitMode:
// make consistent, exit debugger on key UP
if(!repeated)
myExitPressed = true;
return;
// events which can be handled 1:1
case Event::ToggleP0Collision:
case Event::ToggleP0Bit:
case Event::ToggleP1Collision:
case Event::ToggleP1Bit:
case Event::ToggleM0Collision:
case Event::ToggleM0Bit:
case Event::ToggleM1Collision:
case Event::ToggleM1Bit:
case Event::ToggleBLCollision:
case Event::ToggleBLBit:
case Event::TogglePFCollision:
case Event::TogglePFBit:
case Event::ToggleFixedColors:
case Event::ToggleCollisions:
case Event::ToggleBits:
// events which can be handled 1:1
case Event::ToggleP0Collision:
case Event::ToggleP0Bit:
case Event::ToggleP1Collision:
case Event::ToggleP1Bit:
case Event::ToggleM0Collision:
case Event::ToggleM0Bit:
case Event::ToggleM1Collision:
case Event::ToggleM1Bit:
case Event::ToggleBLCollision:
case Event::ToggleBLBit:
case Event::TogglePFCollision:
case Event::TogglePFBit:
case Event::ToggleFixedColors:
case Event::ToggleCollisions:
case Event::ToggleBits:
case Event::ToggleTimeMachine:
case Event::ToggleTimeMachine:
case Event::SaveState:
case Event::SaveAllStates:
case Event::PreviousState :
case Event::NextState:
case Event::LoadState:
case Event::LoadAllStates:
case Event::SaveState:
case Event::SaveAllStates:
case Event::PreviousState:
case Event::NextState:
case Event::LoadState:
case Event::LoadAllStates:
case Event::ConsoleColor:
case Event::ConsoleBlackWhite:
case Event::ConsoleColorToggle:
case Event::Console7800Pause:
case Event::ConsoleLeftDiffA:
case Event::ConsoleLeftDiffB:
case Event::ConsoleLeftDiffToggle:
case Event::ConsoleRightDiffA:
case Event::ConsoleRightDiffB:
case Event::ConsoleRightDiffToggle:
if(!repeated)
instance().eventHandler().handleEvent(event);
return;
case Event::ConsoleColor:
case Event::ConsoleBlackWhite:
case Event::ConsoleColorToggle:
case Event::Console7800Pause:
case Event::ConsoleLeftDiffA:
case Event::ConsoleLeftDiffB:
case Event::ConsoleLeftDiffToggle:
case Event::ConsoleRightDiffA:
case Event::ConsoleRightDiffB:
case Event::ConsoleRightDiffToggle:
if(!repeated)
instance().eventHandler().handleEvent(event);
return;
// events which need special handling in debugger
case Event::TakeSnapshot:
if(!repeated)
instance().debugger().parser().run("saveSnap");
return;
// events which need special handling in debugger
case Event::TakeSnapshot:
if(!repeated)
instance().debugger().parser().run("saveSnap");
return;
case Event::Rewind1Menu:
doRewind();
return;
case Event::Rewind1Menu:
doRewind();
return;
case Event::Rewind10Menu:
doRewind10();
return;
case Event::Rewind10Menu:
doRewind10();
return;
case Event::RewindAllMenu:
doRewindAll();
return;
case Event::RewindAllMenu:
doRewindAll();
return;
case Event::Unwind1Menu:
doUnwind();
return;
case Event::Unwind1Menu:
doUnwind();
return;
case Event::Unwind10Menu:
doUnwind10();
return;
case Event::Unwind10Menu:
doUnwind10();
return;
case Event::UnwindAllMenu:
doUnwindAll();
return;
case Event::UnwindAllMenu:
doUnwindAll();
return;
default:
break;
default:
break;
}
}
Dialog::handleKeyDown(key, mod);
}

View File

@ -797,7 +797,9 @@
<ClCompile Include="..\..\debugger\gui\Cart0840Widget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\Cart0FA0Widget.cxx" />
<ClCompile Include="..\..\debugger\gui\Cart0FA0Widget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\Cart2KWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
@ -831,7 +833,9 @@
<ClCompile Include="..\..\debugger\gui\CartBFWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartBUSInfoWidget.cxx" />
<ClCompile Include="..\..\debugger\gui\CartBUSInfoWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartBUSWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
@ -868,7 +872,9 @@
<ClCompile Include="..\..\debugger\gui\CartE0Widget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartE7Widget.cxx" />
<ClCompile Include="..\..\debugger\gui\CartE7Widget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartEFSCWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
@ -911,14 +917,18 @@
<ClCompile Include="..\..\debugger\gui\CartFEWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartGLWidget.cxx" />
<ClCompile Include="..\..\debugger\gui\CartGLWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartMDMWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartRamWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\Cart03E0Widget.cxx" />
<ClCompile Include="..\..\debugger\gui\Cart03E0Widget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\CartTVBoyWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
@ -949,7 +959,9 @@
<ClCompile Include="..\..\debugger\gui\GenesisWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\Joy2BPlusWidget.cxx" />
<ClCompile Include="..\..\debugger\gui\Joy2BPlusWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\gui\JoystickWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
@ -977,7 +989,9 @@
<ClCompile Include="..\..\debugger\gui\TrakBallWidget.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\debugger\TimerMap.cxx" />
<ClCompile Include="..\..\debugger\TimerMap.cxx">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\emucore\Bankswitch.cxx" />
<ClCompile Include="..\..\emucore\Cart03E0.cxx" />
<ClCompile Include="..\..\emucore\Cart3EPlus.cxx" />