Skip to content

Commit

Permalink
Corrected several video problems, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ajcasado committed Oct 14, 2024
1 parent c14883a commit fdc3279
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 24 deletions.
27 changes: 16 additions & 11 deletions Kernel/dev/cpc/video.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
7 changes: 4 additions & 3 deletions Kernel/platform/platform-cpc6128/README
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
41 changes: 31 additions & 10 deletions Kernel/platform/platform-cpc6128/cpc6128.s
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
; CPC6128 support
;
; Spectrum +3 support

.module plus3

Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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

0 comments on commit fdc3279

Please sign in to comment.