Skip to content

Commit f9ba814

Browse files
committed
Fixed right mouse button bug (#913)
1 parent 6089e60 commit f9ba814

File tree

4 files changed

+20
-15
lines changed

4 files changed

+20
-15
lines changed

Emulator/VACore/Components/Agnus/Agnus.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,10 +686,10 @@ Agnus::eolHandler()
686686
pos.eol();
687687

688688
// Update pot counters
689-
if (paula.chargeX0 < 1.0) U8_INC(paula.potCntX0, 1);
690-
if (paula.chargeY0 < 1.0) U8_INC(paula.potCntY0, 1);
691-
if (paula.chargeX1 < 1.0) U8_INC(paula.potCntX1, 1);
692-
if (paula.chargeY1 < 1.0) U8_INC(paula.potCntY1, 1);
689+
if (paula.chargeX0 < 1.0 || controlPort1.mouse.MMB()) U8_INC(paula.potCntX0, 1);
690+
if (paula.chargeY0 < 1.0 || controlPort1.mouse.RMB()) U8_INC(paula.potCntY0, 1);
691+
if (paula.chargeX1 < 1.0 || controlPort2.mouse.MMB()) U8_INC(paula.potCntX1, 1);
692+
if (paula.chargeY1 < 1.0 || controlPort2.mouse.RMB()) U8_INC(paula.potCntY1, 1);
693693

694694
// Transfer DMA requests from Paula to Agnus
695695
paula.channel0.requestDMA();

Emulator/VACore/Peripherals/Mouse/Mouse.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ class Mouse final : public SubComponent {
221221
i64 getDeltaX();
222222
i64 getDeltaY();
223223

224+
// Queries the button state
225+
bool LMB() const { return leftButton; }
226+
bool MMB() const { return middleButton; }
227+
bool RMB() const { return rightButton; }
228+
224229
// Returns the mouse coordinates as they appear in the JOYDAT register
225230
u16 getXY();
226231

GUI/Dialogs/Inspector/Inspector.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ class Inspector: DialogController {
682682

683683
// Enter debug mode
684684
emu.trackOn()
685-
amiga.autoInspectionMask = 0xFF
685+
amiga.autoInspectionMask = Int.max
686686

687687
// Adjust window height to match what we see in interface builder
688688
if let window = self.window {

GUI/Dialogs/Media/DiskExporter.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -463,18 +463,18 @@ extension DiskExporter: NSFilePromiseProviderDelegate {
463463

464464
func filePromiseProvider(_ filePromiseProvider: NSFilePromiseProvider, fileNameForType fileType: String) -> String {
465465

466-
var name: String
467-
466+
var name = "Untitled" // vol?.name ?? "Untitled"
467+
468468
switch formatPopup.selectedTag() {
469469

470-
case Format.hdf: name = "Untitled.hdf"
471-
case Format.hdz: name = "Untitled.hdz"
472-
case Format.adf: name = "Untitled.adf"
473-
case Format.adz: name = "Untitled.adz"
474-
case Format.ext: name = "Untitled.adf"
475-
case Format.img: name = "Untitled.img"
476-
case Format.ima: name = "Untitled.ima"
477-
case Format.vol: name = "Untitled"
470+
case Format.hdf: name += ".hdf"
471+
case Format.hdz: name += ".hdz"
472+
case Format.adf: name += ".adf"
473+
case Format.adz: name += ".adz"
474+
case Format.ext: name += ".adf"
475+
case Format.img: name += ".img"
476+
case Format.ima: name += ".ima"
477+
case Format.vol: break
478478

479479
default: fatalError()
480480
}

0 commit comments

Comments
 (0)