From 3355613c2b8c2a80eb2bb05380e4283a4b6d5917 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Fri, 28 Jun 2024 19:40:13 +0100 Subject: [PATCH] z80membership: fix conversion to new compiler and 16x50 setup buglet --- .../platform/platform-z80membership/devtty.c | 2 +- .../platform-z80membership/z80membership.S | 22 ++++++++++++------- STATUS.md | 4 ++-- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/Kernel/platform/platform-z80membership/devtty.c b/Kernel/platform/platform-z80membership/devtty.c index dcfb82f41..bdbeda9e9 100644 --- a/Kernel/platform/platform-z80membership/devtty.c +++ b/Kernel/platform/platform-z80membership/devtty.c @@ -166,7 +166,7 @@ void tty_setup(uint_fast8_t minor, uint_fast8_t flags) out(uart_ms, w >> 8); out(uart_lcr, d & 0x7F); - out(uart_ier, 0x0D); + out(uart_ier, 0x05); } /* diff --git a/Kernel/platform/platform-z80membership/z80membership.S b/Kernel/platform/platform-z80membership/z80membership.S index 849856e3a..b2be9b66e 100644 --- a/Kernel/platform/platform-z80membership/z80membership.S +++ b/Kernel/platform/platform-z80membership/z80membership.S @@ -255,10 +255,8 @@ map_proc_a: ; used by bankfork map_proc_always_di: map_proc_always: push af - push hl - ld hl, #_udata + U_DATA__U_PAGE - call map_proc_hl - pop hl + ld a, (_udata + U_DATA__U_PAGE) + out (0xCC),a pop af ret ; @@ -269,7 +267,7 @@ map_proc_always: ; map_save_kernel: push af - in a,(0xCC) ; FIXME: check can read back + in a,(0xCC) and #0x0F ld (mapsave), a xor a @@ -295,7 +293,7 @@ map_restore: ; outchar: push af -twait: in a,(0xCD) +twait: in a,(0xCD) bit 5,a jr z, twait pop af @@ -313,6 +311,10 @@ twait: in a,(0xCD) .export _sd_spi_rx_sector _sd_spi_tx_byte: + pop de + pop hl + push hl + push de push bc ld a,l rlca @@ -343,6 +345,10 @@ _sd_spi_tx_byte: pop bc ret _sd_spi_rx_byte: + pop de + pop hl + push hl + push de push bc ld a, 1 out (0xC5),a ; send FF @@ -534,8 +540,8 @@ spi_tx_loop: sd_map: ld a,(_td_raw) or a - jp nz, map_proc_always - ret + ret z + jp map_proc_always _sd_spi_rx_sector: pop de diff --git a/STATUS.md b/STATUS.md index a27fa3c53..80549fb31 100644 --- a/STATUS.md +++ b/STATUS.md @@ -438,7 +438,7 @@ Builds, passes basic tests ## sbc2g -Builds, crashes when running. Under investigation +Builds, passes basic tests ## sbcv2 @@ -578,7 +578,7 @@ Builds, usually passes basic tests, debugging a possible interrupt problem ## z80membership -Builds, need to debug the emulator to do proper testing +Builds,passes basic tests ## z80pack