summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices
diff options
context:
space:
mode:
author 987123879113 <63495610+987123879113@users.noreply.github.com>2022-11-23 23:46:04 +0900
committer GitHub <noreply@github.com>2022-11-24 01:46:04 +1100
commitcfba0af15c43603b6f925e161f5bb4a13ec9540c (patch)
treebac9769fb039d63447d9fb2c4f265ed7deff8ace /src/devices
parent60f7688d7bf6aaa8a301f75a4b6a684f1bca7f7c (diff)
machine/jvsdev.cpp: Fixed chaining resets, and always cascade broadcast messages to slave devices. (#10582)
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/machine/jvsdev.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/devices/machine/jvsdev.cpp b/src/devices/machine/jvsdev.cpp
index f55a836cd01..e752df0cf4f 100644
--- a/src/devices/machine/jvsdev.cpp
+++ b/src/devices/machine/jvsdev.cpp
@@ -73,12 +73,18 @@ void jvs_device::message(uint8_t dest, const uint8_t *send_buffer, uint32_t send
} else
s += len;
}
- recv_size = d - recv_buffer;
+
+ // d will always have at least a 1 byte difference due to adding the status code byte before processing messages.
+ // Don't count the status code in the received message size unless we're at the end of the device chain so the
+ // message buffer can be chained to slave devices. Required for resets to be chained.
+ const uint32_t new_recv_size = d - recv_buffer;
+ if (!next_device || new_recv_size > 1)
+ recv_size = new_recv_size;
}
// Pass along the message if the device hasn't replied
// Should we cumulate answers instead?
- if(next_device && !recv_size)
+ if(next_device && (dest == 0xff || !recv_size))
next_device->message(dest, send_buffer, send_size, recv_buffer, recv_size);
}