2008-05-12 22:40:26 +00:00
|
|
|
//============================================================================
|
|
|
|
//
|
2016-12-30 00:00:30 +00:00
|
|
|
// SSSS tt lll lll
|
|
|
|
// SS SS tt ll ll
|
|
|
|
// SS tttttt eeee ll ll aaaa
|
2008-05-12 22:40:26 +00:00
|
|
|
// 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
|
|
|
|
//
|
2016-12-30 00:00:30 +00:00
|
|
|
// Copyright (c) 1995-2017 by Bradford W. Mott, Stephen Anthony
|
2010-04-10 21:37:23 +00:00
|
|
|
// and the Stella Team
|
2008-05-12 22:40:26 +00:00
|
|
|
//
|
2010-01-10 03:23:32 +00:00
|
|
|
// See the file "License.txt" for information on usage and redistribution of
|
2008-05-12 22:40:26 +00:00
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//============================================================================
|
|
|
|
|
2017-02-12 00:37:42 +00:00
|
|
|
#ifndef ATARIMOUSE_HXX
|
|
|
|
#define ATARIMOUSE_HXX
|
2008-05-12 22:40:26 +00:00
|
|
|
|
2017-07-30 13:18:13 +00:00
|
|
|
#include "PointingDevice.hxx"
|
2008-05-12 22:40:26 +00:00
|
|
|
|
2017-07-30 13:18:13 +00:00
|
|
|
namespace {
|
2008-05-12 22:40:26 +00:00
|
|
|
|
2017-07-30 13:18:13 +00:00
|
|
|
class AtariMouseHelper {
|
2008-05-12 22:40:26 +00:00
|
|
|
|
2017-07-30 13:18:13 +00:00
|
|
|
public:
|
|
|
|
static uInt8 ioPortA(uInt8 countH, uInt8 countV, uInt8 left, uInt8 down) {
|
|
|
|
static constexpr uInt32 ourTableH[4] = { 0x00, 0x80, 0xc0, 0x40 };
|
|
|
|
static constexpr uInt32 ourTableV[4] = { 0x00, 0x10, 0x30, 0x20 };
|
2008-05-12 22:40:26 +00:00
|
|
|
|
2017-07-30 13:18:13 +00:00
|
|
|
return ourTableV[countV] | ourTableH[countH];
|
|
|
|
}
|
2012-10-24 10:10:32 +00:00
|
|
|
|
2017-07-30 13:18:13 +00:00
|
|
|
public:
|
|
|
|
static constexpr Controller::Type controllerType = Controller::AtariMouse;
|
2017-07-30 22:49:00 +00:00
|
|
|
static constexpr double trackballSensitivity = 0.8; // TODO: make configurable
|
2017-07-30 13:18:13 +00:00
|
|
|
};
|
|
|
|
}
|
2008-05-12 22:40:26 +00:00
|
|
|
|
2017-07-30 14:18:52 +00:00
|
|
|
using AtariMouse = PointingDevice<AtariMouseHelper>;
|
2012-04-19 13:00:02 +00:00
|
|
|
|
2017-07-30 13:18:13 +00:00
|
|
|
#endif // ATARIMOUSE_HXX
|