2012-01-02 16:37:17 +00:00
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// SSSS tt lll lll
|
|
|
|
// SS SS tt ll ll
|
|
|
|
// SS tttttt eeee ll ll aaaa
|
|
|
|
// SSSS tt ee ee ll ll aa
|
|
|
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
|
|
|
// SS SS tt ee ll ll aa aa
|
|
|
|
// SSSS ttt eeeee llll llll aaaaa
|
|
|
|
//
|
|
|
|
// Copyright (c) 1995-2012 by Bradford W. Mott, Stephen Anthony
|
|
|
|
// and the Stella Team
|
|
|
|
//
|
|
|
|
// See the file "License.txt" for information on usage and redistribution of
|
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//
|
|
|
|
// $Id$
|
|
|
|
//============================================================================
|
|
|
|
|
2012-03-14 01:19:23 +00:00
|
|
|
#include "Control.hxx"
|
|
|
|
#include "System.hxx"
|
2012-01-02 16:37:17 +00:00
|
|
|
#include "CompuMate.hxx"
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2012-03-14 01:19:23 +00:00
|
|
|
CompuMate::CompuMate(const Event& event, const System& system)
|
|
|
|
: mySystem(system),
|
|
|
|
myLeftController(0),
|
|
|
|
myRightController(0),
|
|
|
|
myCycleAtLastUpdate(0),
|
2012-01-02 16:37:17 +00:00
|
|
|
myIOPort(0xff)
|
|
|
|
{
|
2012-03-14 01:19:23 +00:00
|
|
|
myLeftController = new CMControl(*this, Controller::Left, event, system);
|
|
|
|
myRightController = new CMControl(*this, Controller::Right, event, system);
|
2012-01-02 16:37:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2012-03-14 01:19:23 +00:00
|
|
|
void CompuMate::update()
|
2012-01-02 16:37:17 +00:00
|
|
|
{
|
2012-03-14 01:19:23 +00:00
|
|
|
uInt32 cycle = mySystem.cycles();
|
2012-01-02 16:37:17 +00:00
|
|
|
|
2012-03-14 01:19:23 +00:00
|
|
|
// Only perform update once for both ports in the same cycle
|
|
|
|
if(myCycleAtLastUpdate != cycle)
|
|
|
|
{
|
|
|
|
myCycleAtLastUpdate = cycle;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
myCycleAtLastUpdate = cycle;
|
2012-01-02 16:37:17 +00:00
|
|
|
|
2012-03-14 01:19:23 +00:00
|
|
|
// TODO - handle SWCHA changes
|
2012-01-02 16:37:17 +00:00
|
|
|
}
|