Skip to content

Commit

Permalink
memory_card: fixed off by one in card numbering
Browse files Browse the repository at this point in the history
  • Loading branch information
JaCzekanski committed Nov 18, 2021
1 parent b568e67 commit dd517d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/device/controller/peripherals/abstract_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace peripherals {
enum class Type { None, Digital, Analog, Mouse, MemoryCard };
struct AbstractDevice {
Type type;
int port; // Physical port number
int port; // Physical port number (numbered from 1..n)
int state = 0;

AbstractDevice(Type type, int port);
Expand Down
2 changes: 1 addition & 1 deletion src/device/controller/peripherals/memory_card.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ uint8_t MemoryCard::handleWrite(uint8_t byte) {
state = 0;
command = Command::None;

bus.notify(Event::Controller::MemoryCardContentsChanged{port});
bus.notify(Event::Controller::MemoryCardContentsChanged{port - 1});

return static_cast<uint8_t>(writeStatus);

Expand Down

0 comments on commit dd517d8

Please sign in to comment.