added 7800 related messages for color/pause switches
This commit is contained in:
thrust26 2019-01-01 13:49:09 +01:00
parent 951bee3ba9
commit 1f64eecf4e
2 changed files with 26 additions and 19 deletions

View File

@ -111,9 +111,6 @@ void EventHandler::initialize()
// Default phosphor blend
Properties::setDefault(Display_PPBlend,
myOSystem.settings().getString("tv.phosblend"));
// Toggle 7800 mode
set7800Mode();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -128,6 +125,8 @@ void EventHandler::reset(EventHandlerState state)
// and we want time for the ROM to process them
if(state == EventHandlerState::EMULATION)
myOSystem.timer().setTimeout([&ev = myEvent]() { ev.clear(); }, 500);
// Toggle 7800 mode
set7800Mode();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -440,38 +439,48 @@ void EventHandler::handleEvent(Event::Type event, Int32 state)
////////////////////////////////////////////////////////////////////////
// Events which relate to switches()
case Event::ConsoleColor:
if(state && !myIs7800)
if(state)
{
myEvent.set(Event::ConsoleBlackWhite, 0);
myOSystem.frameBuffer().showMessage("Color Mode");
myOSystem.frameBuffer().showMessage(myIs7800 ? "Pause released" : "Color Mode");
}
break;
case Event::ConsoleBlackWhite:
if(state && !myIs7800)
if(state)
{
myEvent.set(Event::ConsoleColor, 0);
myOSystem.frameBuffer().showMessage("B/W Mode");
myOSystem.frameBuffer().showMessage(myIs7800 ? "Pause pushed" : "B/W Mode");
}
break;
case Event::ConsoleColorToggle:
if(state && !myIs7800)
if(state)
{
if(myOSystem.console().switches().tvColor())
{
myEvent.set(Event::ConsoleBlackWhite, 1);
myEvent.set(Event::ConsoleColor, 0);
myOSystem.frameBuffer().showMessage("B/W Mode");
myOSystem.frameBuffer().showMessage(myIs7800 ? "Pause pushed" : "B/W Mode");
}
else
{
myEvent.set(Event::ConsoleBlackWhite, 0);
myEvent.set(Event::ConsoleColor, 1);
myOSystem.frameBuffer().showMessage("Color Mode");
myOSystem.frameBuffer().showMessage(myIs7800 ? "Pause released" : "Color Mode");
}
myOSystem.console().switches().update();
}
return;
case Event::Console7800Pause:
if(state)
{
myEvent.set(Event::ConsoleBlackWhite, 0);
myEvent.set(Event::ConsoleColor, 0);
if (myIs7800)
myOSystem.frameBuffer().showMessage("Pause pressed");
}
break;
case Event::ConsoleLeftDiffA:
if(state)
{

View File

@ -71,16 +71,14 @@ void Switches::update()
mySwitches |= 0x08;
}
}
else
if(myEvent.get(Event::ConsoleColor) != 0)
{
if(myEvent.get(Event::ConsoleColor) != 0)
{
mySwitches |= 0x08;
}
else if(myEvent.get(Event::ConsoleBlackWhite) != 0)
{
mySwitches &= ~0x08;
}
mySwitches |= 0x08;
}
else if(myEvent.get(Event::ConsoleBlackWhite) != 0)
{
mySwitches &= ~0x08;
}
if(myEvent.get(Event::ConsoleRightDiffA) != 0)