joeylib2/patches/mame-0.264-apple2gs-scc-clock.patch

18 lines
1.1 KiB
Diff

--- /tmp/apple2gs.cpp.orig 2026-08-13 15:22:16.445448309 -0500
+++ toolchains/cache/mame-mame0264/src/mame/apple/apple2gs.cpp 2026-08-13 15:22:16.497448131 -0500
@@ -3839,8 +3839,13 @@
ADDRESS_MAP_BANK(config, A2GS_C300_TAG).set_map(&apple2gs_state::c300bank_map).set_options(ENDIANNESS_LITTLE, 8, 32, 0x100);
/* serial */
- SCC85C30(config, m_scc, A2GS_14M / 2);
- m_scc->configure_channels(3'686'400, 3'686'400, 3'686'400, 3'686'400);
+ // RetroNet patch: a real IIgs feeds the SCC BRG a 3.6864 MHz PCLK (the classic 115200
+ // time-constant base); A2GS_14M/2 = 7.159 MHz made every firmware/native BRG rate ~1.94x
+ // fast. Zeroed rxc/txc: the m_rxc>0 path in z80scc update_serial() otherwise FORCES the
+ // receive rate to rxc/16 = 230400 regardless of the programmed BRG, which no rs232 peer
+ // can match.
+ SCC85C30(config, m_scc, 3'686'400);
+ m_scc->configure_channels(0, 0, 0, 0);
m_scc->out_int_callback().set(FUNC(apple2gs_state::scc_irq_w));
m_scc->out_txda_callback().set("printer", FUNC(rs232_port_device::write_txd));
m_scc->out_txdb_callback().set("modem", FUNC(rs232_port_device::write_txd));