From fdc3279a21dc346f18802a931a967214d44fe105 Mon Sep 17 00:00:00 2001 From: ajcasado Date: Mon, 14 Oct 2024 16:11:12 +0200 Subject: [PATCH] Corrected several video problems, update README --- Kernel/dev/cpc/video.s | 27 ++++++++------ Kernel/platform/platform-cpc6128/README | 7 ++-- Kernel/platform/platform-cpc6128/cpc6128.s | 41 ++++++++++++++++------ 3 files changed, 51 insertions(+), 24 deletions(-) diff --git a/Kernel/dev/cpc/video.s b/Kernel/dev/cpc/video.s index 6e50e10089..6777a4535a 100644 --- a/Kernel/dev/cpc/video.s +++ b/Kernel/dev/cpc/video.s @@ -307,13 +307,15 @@ zx_cursor_on: push de push hl ld (cursorpos), de - call videopos - ;ld a, #0x38 - ;add a, d - ;ld d, a - ld a, #0xFF - ld (de), a + + ld b,#7 +set_cursor_line: + call scr_next_line + djnz set_cursor_line + ld a,#0xFF + ld (de),a + VIDEO_UNMAP ret .if ZXVID_ONLY @@ -324,12 +326,15 @@ zx_cursor_disable: zx_cursor_off: ld de, (cursorpos) call videopos - ;ld a, #0x38 - ;add a, d - ;ld d, a + + ld b,#7 +reset_cursor_line: + call scr_next_line + djnz reset_cursor_line xor a - ld (de), a - VIDEO_UNMAP + ld (de),a + + VIDEO_UNMAP .if ZXVID_ONLY _do_beep: diff --git a/Kernel/platform/platform-cpc6128/README b/Kernel/platform/platform-cpc6128/README index 8b01020dc6..0e67ac82c1 100644 --- a/Kernel/platform/platform-cpc6128/README +++ b/Kernel/platform/platform-cpc6128/README @@ -44,16 +44,17 @@ To test it burn disk.img on a spare usb pendrive and put it on the albireo. Load Fix fdc driver. Fix IDE driver. -Sometimes the top byte of the characters isn't drawn. +Sometimes the top byte of the characters isn't drawn. FIXED +Vertical scroll shows the bottom line of the screen in the top of the screen Fix memory size reporting 64 v 48K (inherited from zx+3). do_beep() doesn't seem to work. Write a proper loader. Configurable screen, at least add 80x25, maybe also change the video mode and routines to manage 6x8 fonts. -Support more hardware: M4 Board (storage, network and RTC), Ulifac/Usifac, networking with wifi module plugged in the usifac, sdcard in the Albireo, ... +Support more hardware: M4 Board (storage, network and RTC), Ulifac/Usifac, networking with wifi module plugged in the usifac, sdcard in the Albireo, try slip with the serial port of the usifac... Fix lots of bugs. -Switch to a thunked memory model based on C2 Map to use the standard and extended RAM expansions up to 4MiB, the Cromemco port could be an model for this solution. As there is no real common memory, switching the whole 64k space means that the common data area has to be updated in all the used banks, but this can give aprox. 60K for kernel and user and hold a lot of processes in memory with a big RAM expansion. If this proves to be too hard, a RAM disk for swapping can be a way to use the RAM expansions. +Switch to a thunked memory model based on C2 Map to use the standard and extended RAM expansions up to 4MiB, the Cromemco port could be an model to this solution. As ther is no real common memory switching the whole 64k space the common data area has to be updated in all the used banks, but this can give aprox. 60K for kernel and user and hold a lot of processes in memory with a big RAM expansion. If this proves to be too hard, a RAM disk for swapping can be a way to use the RAM expansions. Look for speed optimization opportunities. diff --git a/Kernel/platform/platform-cpc6128/cpc6128.s b/Kernel/platform/platform-cpc6128/cpc6128.s index 963c4e3252..237a706398 100644 --- a/Kernel/platform/platform-cpc6128/cpc6128.s +++ b/Kernel/platform/platform-cpc6128/cpc6128.s @@ -1,4 +1,5 @@ -; CPC6128 support +; +; Spectrum +3 support .module plus3 @@ -62,8 +63,8 @@ _plt_monitor: ; ; Not so much a monitor as wait for space - ; - ;This code is from https://github.com/lronaldo/cpctelera + ; Part of this code is borrowed from https://github.com/lronaldo/cpctelera + ld bc,#0x7fc2 out (c),c ; keep us mapped ld bc, #0xF782 ;; [3] Configure PPI 8255: Set Both Port A and Port C as Output. @@ -89,7 +90,7 @@ _plt_monitor: ld b, e ;; [1] B = F4h => Read from PPI's Port A: Pressed/Not Pressed Values from PSG in a,(c) rla - jr nc, _plt_monitor + jr c, _plt_monitor _plt_reboot: di @@ -143,7 +144,8 @@ init_hardware: ; already by now ld bc,#0x7f10 out (c),c - ld a,#0x54 + ld a,#0x54 ; + ld (_vtborder), a out (c),a ; black border ld bc,#0x7f00 out (c),c @@ -154,6 +156,7 @@ init_hardware: ld a,#0x4b out (c),a ; white ink + ;we set the crtc for a screen with 64x32 colsxrows ;pros: max number of characters on screen and easy hardware scroll ;cons: 80x25 is more standard => TODO list (with mode change) @@ -344,10 +347,28 @@ ___ldhlhl: .globl _nap20 - ; 18.432MHz so 360 cycles (25 in call/ret sequence) -_nap20: - ld b,#120 -snooze: - djnz snooze +_nap20: ;modified, in the cpc 1 nop = 1us. the call-ret add some us', it can be optimized (FIXME) + + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + nop + ret