1
0
mirror of synced 2025-02-07 15:01:20 +01:00

exvs2: fix JVS-related crash

This commit is contained in:
Hay1tsme 2025-01-20 03:55:38 -05:00
parent 9f4e82d5cb
commit a8fa3bcbf5
4 changed files with 21 additions and 1 deletions

View File

@ -192,6 +192,7 @@ void najv4_init(
najv4->jvs.next = next;
najv4->jvs.transact = najv4_transact;
najv4->jvs.sense = najv4_sense;
najv4->jvs.sense_out = true;
najv4->addr = 0xFF;
najv4->ops = ops;
najv4->ops_ctx = ops_ctx;
@ -697,6 +698,7 @@ static HRESULT najv4_cmd_reset(struct najv4 *najv4, struct const_iobuf *req_buf)
dprintf("JVS I/O: Reset (param %02x)\n", req.unknown);
najv4->addr = 0xFF;
najv4->jvs.sense_out = true;
if (najv4->ops->reset != NULL) {
najv4->ops->reset(najv4->ops_ctx);
@ -731,6 +733,7 @@ static HRESULT najv4_cmd_assign_addr(
}
najv4->addr = req.addr;
najv4->jvs.sense_out = false;
return iobuf_write_8(resp_buf, 0x01);
}

View File

@ -13,6 +13,7 @@ struct jvs_node {
size_t nbytes,
struct iobuf *resp);
bool (*sense)(struct jvs_node *node);
bool sense_out;
};
void jvs_bus_transact(

View File

@ -1,4 +1,10 @@
#include <windows.h>
#ifdef __GNUC__
#include <ntdef.h>
#else
#include <winnt.h>
#endif
#include <ntddser.h>
#include <assert.h>
#include <process.h>
@ -85,6 +91,16 @@ static HRESULT jvs_handle_irp_locked(struct irp *irp)
}
}
if (irp->op == IRP_OP_IOCTL) {
switch (irp->ioctl) {
case IOCTL_SERIAL_GET_MODEMSTATUS:
jvs_uart.cts_on = !jvs_root->sense_out; // WAJVIO.dll is cool
dprintf("JVS: Set CTS to %X\n", jvs_uart.cts_on);
break;
default: break;
}
}
hr = uart_handle_irp(&jvs_uart, irp);
if (FAILED(hr) || irp->op != IRP_OP_WRITE) {

View File

@ -1,4 +1,4 @@
[wrap-git]
directory = capnhook
url = https://github.com/Hay1tsme/capnhook
revision = b595e4bf8a274ba3bdaf583e13a7ebc7efe0f48f
revision = cbffaed8041fd675685236781f2042339f54202f