From 05e4b67858ad5fc69cb41ff1e7379bf63a2b1ab6 Mon Sep 17 00:00:00 2001 From: Christian Werner Date: Sun, 18 Oct 2026 10:04:40 +0200 Subject: [PATCH] fix(arnitech): NET_SEND writes the chip's data port with plain stores The copy loop wrote each byte with STA RRNET_RX_TX_DATA,X, and an indexed store reads its address first. Reads of RxTxData take the bytes of a received frame (AN181), so on a real CS8900A each byte sent took one of a frame the program had started reading. The loop now stores to the port's low or high byte by address, as ip65's and Contiki's drivers do; reads stay indexed, which read once. --- src/kernal/arnitech/arnitech_net.s | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/kernal/arnitech/arnitech_net.s b/src/kernal/arnitech/arnitech_net.s index a4a9c26f..a391b817 100644 --- a/src/kernal/arnitech/arnitech_net.s +++ b/src/kernal/arnitech/arnitech_net.s @@ -273,7 +273,12 @@ arnitech_net_copy: tax bvs @2 lda (SAL), y - sta RRNET_RX_TX_DATA, x + cpx #$01 ; plain stores: an indexed one reads the port + beq @7 ; first, which takes a byte of a received frame + sta RRNET_RX_TX_DATA+0 + bvc @3 ; branch always +@7: + sta RRNET_RX_TX_DATA+1 bvc @3 ; branch always @2: lda RRNET_RX_TX_DATA, x