stella/src/emucore/AmigaMouse.hxx

51 lines
1.6 KiB
C++

//============================================================================
//
// 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-2017 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.
//============================================================================
#ifndef AMIGAMOUSE_HXX
#define AMIGAMOUSE_HXX
#include "PointingDevice.hxx"
class AmigaMouse : public PointingDevice
{
public:
/**
Create a new Amiga Mouse controller plugged into the specified jack
@param jack The jack the controller is plugged into
@param event The event object to use for events
@param system The system using this controller
*/
AmigaMouse(Jack jack, const Event& event, const System& system)
: PointingDevice(jack, event, system, Controller::AmigaMouse,
trackballSensitivity) { }
virtual ~AmigaMouse() = default;
protected:
uInt8 ioPortA(uInt8 countH, uInt8 countV, uInt8, uInt8) override
{
static constexpr uInt32 ourTableH[4] = { 0x00, 0x80, 0xa0, 0x20 };
static constexpr uInt32 ourTableV[4] = { 0x00, 0x10, 0x50, 0x40 };
return ourTableH[countH] | ourTableV[countV];
}
static constexpr float trackballSensitivity = 0.8f;
};
#endif // AMIGAMOUSE_HXX