Skip to content

Commit

Permalink
This is vAmiga 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkwhoffmann committed Jan 6, 2023
1 parent 48d1379 commit 5857285
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 40 deletions.
2 changes: 1 addition & 1 deletion Emulator/Amiga.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Amiga : public Thread {

// Other Peripherals
Keyboard keyboard = Keyboard(*this);

// Shortcuts
FloppyDrive *df[4] = { &df0, &df1, &df2, &df3 };
HardDrive *hd[4] = { &hd0, &hd1, &hd2, &hd3 };
Expand Down
54 changes: 23 additions & 31 deletions Emulator/RetroShell/InterpreterCmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,6 @@ Interpreter::initCommandShell(Command &root)
"Adjusts the texture cutout",
[this](Arguments& argv, long value) {

/*
std::vector<string> vec(argv.begin(), argv.end());
isize x1 = util::parseNum(vec[0]);
isize y1 = util::parseNum(vec[1]);
isize x2 = util::parseNum(vec[2]);
isize y2 = util::parseNum(vec[3]);
*/
isize x1 = parseNum(argv, 0);
isize y1 = parseNum(argv, 1);
isize x2 = parseNum(argv, 2);
Expand Down Expand Up @@ -961,9 +953,9 @@ Interpreter::initCommandShell(Command &root)

root.newGroup("");

for (isize i = 1; i <= 2; i++) {
for (isize i = ControlPort::PORT1; i <= ControlPort::PORT2; i++) {

string nr = (i == 1) ? "1" : "2";
string nr = (i == ControlPort::PORT1) ? "1" : "2";

root.add({"joystick", nr},
"Joystick in port " + nr);
Expand All @@ -972,7 +964,7 @@ Interpreter::initCommandShell(Command &root)
"Displays the current configuration",
[this](Arguments& argv, long value) {

auto &port = (value == 0) ? amiga.controlPort1 : amiga.controlPort2;
auto &port = (value == ControlPort::PORT1) ? amiga.controlPort1 : amiga.controlPort2;
retroShell.dumpConfig(port.joystick);

}, i);
Expand All @@ -984,7 +976,7 @@ Interpreter::initCommandShell(Command &root)
"Enables or disables auto-fire mode",
[this](Arguments& argv, long value) {

auto port = (value == 0) ? ControlPort::PORT1 : ControlPort::PORT2;
auto port = (value == ControlPort::PORT1) ? ControlPort::PORT1 : ControlPort::PORT2;
amiga.configure(OPT_AUTOFIRE, port, parseBool(argv));

}, i);
Expand All @@ -993,7 +985,7 @@ Interpreter::initCommandShell(Command &root)
"Sets the number of bullets per auto-fire shot",
[this](Arguments& argv, long value) {

auto port = (value == 0) ? ControlPort::PORT1 : ControlPort::PORT2;
auto port = (value == ControlPort::PORT1) ? ControlPort::PORT1 : ControlPort::PORT2;
amiga.configure(OPT_AUTOFIRE_BULLETS, port, parseNum(argv));

}, i);
Expand All @@ -1002,7 +994,7 @@ Interpreter::initCommandShell(Command &root)
"Configures the auto-fire delay",
[this](Arguments& argv, long value) {

auto port = (value == 0) ? ControlPort::PORT1 : ControlPort::PORT2;
auto port = (value == ControlPort::PORT1) ? ControlPort::PORT1 : ControlPort::PORT2;
amiga.configure(OPT_AUTOFIRE_DELAY, port, parseNum(argv));

}, i);
Expand All @@ -1011,7 +1003,7 @@ Interpreter::initCommandShell(Command &root)
"Presses a joystick button",
[this](Arguments& argv, long value) {

auto &port = (value == 0) ? amiga.controlPort1 : amiga.controlPort2;
auto &port = (value == ControlPort::PORT1) ? amiga.controlPort1 : amiga.controlPort2;
auto nr = parseNum(argv);

switch (nr) {
Expand All @@ -1030,7 +1022,7 @@ Interpreter::initCommandShell(Command &root)
"Releases a joystick button",
[this](Arguments& argv, long value) {

auto &port = (value == 0) ? amiga.controlPort1 : amiga.controlPort2;
auto &port = (value == ControlPort::PORT1) ? amiga.controlPort1 : amiga.controlPort2;
auto nr = parseNum(argv);

switch (nr) {
Expand All @@ -1052,7 +1044,7 @@ Interpreter::initCommandShell(Command &root)
"Pulls the joystick left",
[this](Arguments& argv, long value) {

auto &port = (value == 0) ? amiga.controlPort1 : amiga.controlPort2;
auto &port = (value == ControlPort::PORT1) ? amiga.controlPort1 : amiga.controlPort2;
port.joystick.trigger(PULL_LEFT);

}, i);
Expand All @@ -1061,7 +1053,7 @@ Interpreter::initCommandShell(Command &root)
"Pulls the joystick right",
[this](Arguments& argv, long value) {

auto &port = (value == 0) ? amiga.controlPort1 : amiga.controlPort2;
auto &port = (value == ControlPort::PORT1) ? amiga.controlPort1 : amiga.controlPort2;
port.joystick.trigger(PULL_RIGHT);

}, i);
Expand All @@ -1070,7 +1062,7 @@ Interpreter::initCommandShell(Command &root)
"Pulls the joystick up",
[this](Arguments& argv, long value) {

auto &port = (value == 0) ? amiga.controlPort1 : amiga.controlPort2;
auto &port = (value == ControlPort::PORT1) ? amiga.controlPort1 : amiga.controlPort2;
port.joystick.trigger(PULL_UP);

}, i);
Expand All @@ -1079,7 +1071,7 @@ Interpreter::initCommandShell(Command &root)
"Pulls the joystick down",
[this](Arguments& argv, long value) {

auto &port = (value == 0) ? amiga.controlPort1 : amiga.controlPort2;
auto &port = (value == ControlPort::PORT1) ? amiga.controlPort1 : amiga.controlPort2;
port.joystick.trigger(PULL_DOWN);

}, i);
Expand All @@ -1091,7 +1083,7 @@ Interpreter::initCommandShell(Command &root)
"Releases the x-axis",
[this](Arguments& argv, long value) {

auto &port = (value == 0) ? amiga.controlPort1 : amiga.controlPort2;
auto &port = (value == ControlPort::PORT1) ? amiga.controlPort1 : amiga.controlPort2;
port.joystick.trigger(RELEASE_X);

}, i);
Expand All @@ -1100,7 +1092,7 @@ Interpreter::initCommandShell(Command &root)
"Releases the y-axis",
[this](Arguments& argv, long value) {

auto &port = (value == 0) ? amiga.controlPort1 : amiga.controlPort2;
auto &port = (value == ControlPort::PORT1) ? amiga.controlPort1 : amiga.controlPort2;
port.joystick.trigger(RELEASE_Y);

}, i);
Expand All @@ -1113,9 +1105,9 @@ Interpreter::initCommandShell(Command &root)

root.newGroup("");

for (isize i = 1; i <= 2; i++) {
for (isize i = ControlPort::PORT1; i <= ControlPort::PORT2; i++) {

string nr = (i == 1) ? "1" : "2";
string nr = (i == ControlPort::PORT1) ? "1" : "2";

root.add({"mouse", nr},
"Mouse in port " + nr);
Expand All @@ -1124,7 +1116,7 @@ Interpreter::initCommandShell(Command &root)
"Displays the current configuration",
[this](Arguments& argv, long value) {

auto &port = (value == 0) ? amiga.controlPort1 : amiga.controlPort2;
auto &port = (value == ControlPort::PORT1) ? amiga.controlPort1 : amiga.controlPort2;
retroShell.dumpConfig(port.mouse);

}, i);
Expand All @@ -1136,7 +1128,7 @@ Interpreter::initCommandShell(Command &root)
"Enables or disables pull-up resistors",
[this](Arguments& argv, long value) {

auto port = (value == 0) ? ControlPort::PORT1 : ControlPort::PORT2;
auto port = (value == ControlPort::PORT1) ? ControlPort::PORT1 : ControlPort::PORT2;
amiga.configure(OPT_PULLUP_RESISTORS, port, parseBool(argv));

}, i);
Expand All @@ -1145,7 +1137,7 @@ Interpreter::initCommandShell(Command &root)
"Enables or disables the shake detector",
[this](Arguments& argv, long value) {

auto port = (value == 0) ? ControlPort::PORT1 : ControlPort::PORT2;
auto port = (value == ControlPort::PORT1) ? ControlPort::PORT1 : ControlPort::PORT2;
amiga.configure(OPT_SHAKE_DETECTION, port, parseBool(argv));

}, i);
Expand All @@ -1154,7 +1146,7 @@ Interpreter::initCommandShell(Command &root)
"Sets the horizontal and vertical mouse velocity",
[this](Arguments& argv, long value) {

auto port = (value == 0) ? ControlPort::PORT1 : ControlPort::PORT2;
auto port = (value == ControlPort::PORT1) ? ControlPort::PORT1 : ControlPort::PORT2;
amiga.configure(OPT_MOUSE_VELOCITY, port, parseNum(argv));

}, i);
Expand All @@ -1166,7 +1158,7 @@ Interpreter::initCommandShell(Command &root)
"Presses the left mouse button",
[this](Arguments& argv, long value) {

auto &port = (value == 0) ? amiga.controlPort1 : amiga.controlPort2;
auto &port = (value == ControlPort::PORT1) ? amiga.controlPort1 : amiga.controlPort2;
port.mouse.pressAndReleaseLeft();

}, i);
Expand All @@ -1175,7 +1167,7 @@ Interpreter::initCommandShell(Command &root)
"Presses the middle mouse button",
[this](Arguments& argv, long value) {

auto &port = (value == 0) ? amiga.controlPort1 : amiga.controlPort2;
auto &port = (value == ControlPort::PORT1) ? amiga.controlPort1 : amiga.controlPort2;
port.mouse.pressAndReleaseMiddle();

}, i);
Expand All @@ -1184,7 +1176,7 @@ Interpreter::initCommandShell(Command &root)
"Presses the right mouse button",
[this](Arguments& argv, long value) {

auto &port = (value == 0) ? amiga.controlPort1 : amiga.controlPort2;
auto &port = (value == ControlPort::PORT1) ? amiga.controlPort1 : amiga.controlPort2;
port.mouse.pressAndReleaseRight();

}, i);
Expand Down
6 changes: 3 additions & 3 deletions Emulator/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
#define VER_MAJOR 2
#define VER_MINOR 3
#define VER_SUBMINOR 0
#define VER_BETA 1
#define VER_BETA 0

// Snapshot version number
#define SNP_MAJOR 2
#define SNP_MINOR 3
#define SNP_SUBMINOR 0
#define SNP_BETA 1
#define SNP_BETA 0

// Uncomment this setting in a release build
// #define RELEASEBUILD
#define RELEASEBUILD


//
Expand Down
2 changes: 1 addition & 1 deletion Resources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
<key>NSAppleEventsUsageDescription</key>
<string></string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2022 Dirk Hoffmann. All rights reserved.</string>
<string>Copyright © 2023 Dirk Hoffmann. All rights reserved.</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
Expand Down
8 changes: 4 additions & 4 deletions vAmiga.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2703,7 +2703,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 221224;
CURRENT_PROJECT_VERSION = 230106;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 3NG65ZLYW7;
ENABLE_APP_SANDBOX = NO;
Expand All @@ -2723,7 +2723,7 @@
"@executable_path/../Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 2.3b1;
MARKETING_VERSION = 2.3;
PRODUCT_BUNDLE_IDENTIFIER = dirkwhoffmann.vAmiga;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Proxy/Bridging-Header.h";
Expand All @@ -2742,7 +2742,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 221224;
CURRENT_PROJECT_VERSION = 230106;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 3NG65ZLYW7;
ENABLE_APP_SANDBOX = NO;
Expand All @@ -2760,7 +2760,7 @@
);
LLVM_LTO = YES_THIN;
MACOSX_DEPLOYMENT_TARGET = 10.15;
MARKETING_VERSION = 2.3b1;
MARKETING_VERSION = 2.3;
PRODUCT_BUNDLE_IDENTIFIER = dirkwhoffmann.vAmiga;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Proxy/Bridging-Header.h";
Expand Down

0 comments on commit 5857285

Please sign in to comment.