Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDE support fixed, floppy boot loader and keyboard support small fixes. #1112

Merged
merged 6 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 8 additions & 150 deletions Kernel/dev/cpc/cpcide.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ void devide_read_data(uint8_t *p) __naked
doread:
ld bc,#0x7f10
out (c),c
ld c,#0x53
ld c,#0x51 ; Sea Green
out (c),c
ld bc, #IDE_REG_DATA ; setup port number
; and count
ld a,#8
doread1: ; transfer first 256 bytes
ld a,#16
doread1: ; transfer 512 bytes
ini
inc b
ini
Expand Down Expand Up @@ -113,78 +113,7 @@ doread1: ; transfer first 256 bytes
inc b
dec a
jr nz,doread1
ld bc,#0x7f10
out (c),c
ld c,#0x4c
out (c),c
ld a,#8
doread2: ; transfer second 256 bytes
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
ini
inc b
dec a
jr nz,doread2

ld bc,#0x7f10
out (c),c
ld a,(_vtborder)
Expand Down Expand Up @@ -230,12 +159,12 @@ void devide_write_data(uint8_t *p) __naked

ld bc,#0x7f10
out (c),c
ld c,#0x55
ld c,#0x5d ;Mauve
out (c),c
ld bc, #IDE_REG_DATA ; setup port number
; and count
ld a,#8
dowrite1: ; transfer first 256 bytes
ld a,#16
dowrite1: ; transfer 512 bytes
inc b
outi
inc b
Expand Down Expand Up @@ -302,78 +231,7 @@ dowrite1: ; transfer first 256 bytes
outi
dec a
jr nz,dowrite1
ld bc,#0x7f10
out (c),c
ld c,#0x4e
out (c),c
ld a,#8
dowrite2:
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
inc b
outi
dec a
jr nz,dowrite2

ld bc,#0x7f10
out (c),c
ld a,(_vtborder)
Expand Down
6 changes: 4 additions & 2 deletions Kernel/dev/cpc/cpckeyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ static void keydecode(void)

if (ct) {
m |= KEYPRESS_CTRL;
if (c == 'C' || c == 'c')
c = KEY_STOP;
if (c >= 'a' && c <= 'z')
c = CTRL(c - ('a' - 'A'));
else
c = CTRL(c);
}
if (c) {
switch (keyboard_grab) {
Expand Down
14 changes: 8 additions & 6 deletions Kernel/platform/platform-cpc6128/README
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,24 @@ Video mode 2 is used. The video driver configures the CRTC in 64x32 characters t

Trying to mount the floppy hangs the machine, and may do nasty things to the floppy and the drive, don't try on a real machine!!

The IDE driver that is supposed to work with the symbiface and xmass fails to initialize.
The IDE driver that is supposed to work with the symbiface and xmass fails to initialize. FIXED, tested with ACE-DL emulator x-mass suport.

The USB mass storage of the Albiero works using the ch375 driver used in other platforms. It should be easy to get it working with the Usifac/Ulifac.

There isn't a proper loader, for now a snapshot is generated.
There isn't a proper loader, for now a snapshot is generated. FIXED, dsk floppy boot image generated.

To test it burn disk.img on a spare usb pendrive and put it on the albireo. Load an run the snapshot.
To test it burn disk.img on a spare usb pendrive and put it on the albireo. Load an run the snapshot or burn the dsk in a floppy and start FUZIX with |cpm.


## TODO

Fix fdc driver.
Fix IDE driver.
Fix IDE driver. DONE
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
Vertical scroll shows the bottom line of the screen in the top of the screen. FIXED
Fix memory size reporting 64 v 48K (inherited from zx+3).
do_beep() doesn't seem to work.
Write a proper loader.
Write a proper loader. DONE.
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, try slip with the serial port of the usifac...

Expand All @@ -63,4 +63,6 @@ Look for speed optimization opportunities.
make diskimage with cpc6128 target in base Makefile
.sna snapshot, .dsk Floppy image, and mass storage filesystem images are generated in Images folder. Tu boot from floppy use |cpm command from basic prompt

To run on emulator use ACE-DL emulator and use disk.img as image for the x-mass IDE interface emulation.


10 changes: 6 additions & 4 deletions Kernel/platform/platform-cpc6128/loader.s
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ ld hl,#0x100
ld de,#0xfdff
ld bc,#512
ldir

jp start

start:
;;clean room
ld hl,#0
ld de ,#1
ld (#0),hl
ld bc,#0xfdfe
ldir
;;patch interrupt vector
LD HL,#0XC9FB
LD (#0X0038),HL
jp start

start:
;; turn on disc motor
ld bc,#0xfa7e
ld a,#1
Expand Down Expand Up @@ -76,7 +78,7 @@ call fdc_recalibrate

;; now the drive is at a known position and is ready the fdc knows it is at a known position
;; we can read data..
call read_file
;call read_file

read_file:
;; set variable for starting sector for our data (#0xC1 is first sector ID for
Expand Down
Loading