Skip to content

Commit

Permalink
Work on Mouse::operator=
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkwhoffmann committed Jun 4, 2024
1 parent cf86b4c commit cc5eafa
Show file tree
Hide file tree
Showing 4 changed files with 101 additions and 6 deletions.
5 changes: 5 additions & 0 deletions Emulator/Peripherals/Mouse/Mouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ class Mouse final : public SubComponent {

Mouse& operator= (const Mouse& other) {

CLONE(targetX)
CLONE(targetY)
CLONE(scaleX)
CLONE(scaleY)

CLONE(mouse1350)
CLONE(mouse1351)
CLONE(mouseNeos)
Expand Down
32 changes: 30 additions & 2 deletions Emulator/Peripherals/Mouse/Mouse1350.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,41 @@ class Mouse1350 final : public SubComponent {
public:

Mouse1350(C64 &ref) : SubComponent(ref) { }
const Descriptions &getDescriptions() const override { return descriptions; }

Mouse1350& operator= (const Mouse1350& other) { return *this; }
Mouse1350& operator= (const Mouse1350& other) {

CLONE(mouseX)
CLONE(mouseY)
CLONE(leftButton)
CLONE(rightButton)
CLONE(dividerX)
CLONE(dividerY)
CLONE_ARRAY(latchedX)
CLONE_ARRAY(latchedY)
CLONE(controlPort)

return *this;
}

//
// Methods from Serializable
//

public:

template <class T> void serialize(T& worker) { } SERIALIZERS(serialize);
void _reset(bool hard) override;


//
// Methods from CoreComponent
//

public:

const Descriptions &getDescriptions() const override { return descriptions; }


//
// Accessing
//
Expand Down
32 changes: 30 additions & 2 deletions Emulator/Peripherals/Mouse/Mouse1351.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,41 @@ class Mouse1351 final : public SubComponent {
public:

Mouse1351(C64 &ref) : SubComponent(ref) { }
const Descriptions &getDescriptions() const override { return descriptions; }

Mouse1351& operator= (const Mouse1351& other) { return *this; }
Mouse1351& operator= (const Mouse1351& other) {

CLONE(mouseX)
CLONE(mouseY)
CLONE(leftButton)
CLONE(rightButton)
CLONE(dividerX)
CLONE(dividerY)
CLONE(shiftX)
CLONE(shiftY)

return *this;
}


//
// Methods from Serializable
//

public:

template <class T> void serialize(T& worker) { } SERIALIZERS(serialize);
void _reset(bool hard) override;


//
// Methods from CoreComponent
//

public:

const Descriptions &getDescriptions() const override { return descriptions; }


//
// Accessing
//
Expand Down
38 changes: 36 additions & 2 deletions Emulator/Peripherals/Mouse/NeosMouse.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,47 @@ class NeosMouse final : public SubComponent {
public:

NeosMouse(C64 &ref) : SubComponent(ref) { }
const Descriptions &getDescriptions() const override { return descriptions; }

NeosMouse& operator= (const NeosMouse& other) { return *this; }
NeosMouse& operator= (const NeosMouse& other) {

CLONE(mouseX)
CLONE(mouseY)
CLONE(leftButton)
CLONE(rightButton)
CLONE(dividerX)
CLONE(dividerY)
CLONE(shiftX)
CLONE(shiftY)
CLONE(state)
CLONE(triggerCycle)
CLONE(latchedX)
CLONE(latchedY)
CLONE(deltaX)
CLONE(deltaY)

return *this;
}


//
// Methods from Serializable
//

public:

template <class T> void serialize(T& worker) { } SERIALIZERS(serialize);
void _reset(bool hard) override;


//
// Methods from CoreComponent
//

public:

const Descriptions &getDescriptions() const override { return descriptions; }


//
// Accessing
//
Expand Down

0 comments on commit cc5eafa

Please sign in to comment.