joeylib2/patches/mame-0.264-x68k-rs232.patch

53 lines
2.3 KiB
Diff

--- a/src/mame/sharp/x68k.h 2026-08-04 18:08:43.712316105 -0500
+++ b/src/mame/sharp/x68k.h 2026-08-04 18:06:29.498097848 -0500
@@ -172,18 +172,10 @@
uint8_t hdcvector = 0;
uint8_t prnvector = 0;
} m_ioc;
- struct
- {
- int inputtype = 0; // determines which input is to be received
- bool irqactive = false; // true if IRQ is being serviced
- uint8_t irqvector = 0;
- char last_mouse_x = 0; // previous mouse x-axis value
- char last_mouse_y = 0; // previous mouse y-axis value
- int bufferempty = 0; // non-zero if buffer is empty
- } m_mouse;
uint8_t m_ppi_portc = 0;
bool m_dmac_int = false;
bool m_mfp_int = false;
+ bool m_scc_int = false;
bool m_exp_irq2[2]{};
bool m_exp_irq4[2]{};
bool m_exp_nmi[2]{};
@@ -195,7 +187,6 @@
uint32_t m_gvram_wait = 0;
uint32_t m_tvram_wait = 0;
uint32_t m_vram_wait_accum = 0; // 16.16 carry between accesses
- emu_timer* m_mouse_timer = nullptr;
emu_timer* m_led_timer = nullptr;
unsigned char m_scc_prev = 0;
emu_timer* m_fdc_tc = nullptr;
--- a/src/mame/sharp/x68k.cpp 2026-08-04 18:08:43.712316105 -0500
+++ b/src/mame/sharp/x68k.cpp 2026-08-04 18:06:57.240157174 -0500
@@ -1236,6 +1236,20 @@
mouse.rxd_handler().set(m_scc, FUNC(scc8530_device::rxb_w));
m_scc->out_rtsb_callback().set(mouse, FUNC(rs232_port_device::write_rts));
+ // RS-232C -- SCC channel A. Only channel B (the mouse) was ever wired, so
+ // the machine's actual serial port had no connection at all and could not
+ // be exercised. Exposing it as a standard rs232 slot makes
+ // `-rs232c null_modem` (TCP socket) and `-rs232c pty` available, which is
+ // what an automated both-directions serial test needs.
+ m_scc->out_txda_callback().set("rs232c", FUNC(rs232_port_device::write_txd));
+ m_scc->out_dtra_callback().set("rs232c", FUNC(rs232_port_device::write_dtr));
+ m_scc->out_rtsa_callback().set("rs232c", FUNC(rs232_port_device::write_rts));
+
+ rs232_port_device &rs232c(RS232_PORT(config, "rs232c", default_rs232_devices, nullptr));
+ rs232c.rxd_handler().set(m_scc, FUNC(scc8530_device::rxa_w));
+ rs232c.dcd_handler().set(m_scc, FUNC(scc8530_device::dcda_w));
+ rs232c.cts_handler().set(m_scc, FUNC(scc8530_device::ctsa_w));
+
RP5C15(config, m_rtc, 32.768_kHz_XTAL);
m_rtc->alarm().set(m_mfpdev, FUNC(mc68901_device::i0_w));
m_rtc->set_year_offset(20);