What would it take to add SVI boot disk support to appmake?
-Thom
Adding SVI boot disk support to appmake?
Here is the boot code from CP/M
The code puts the machine in 64k RAM mode and copies X sectors to a given location
The code puts the machine in 64k RAM mode and copies X sectors to a given location
Code: Select all
; -------------------------------------------------------------------------
;
; Spectravideo SVI-328 CP/M Boot Sector
;
; -------------------------------------------------------------------------
;
; CP/M size and entry definition
;
BIOSB EQU 0E600h
;
; Bank switching ports
;
PSGLAW equ 88H ; PSG latch port
PSGDAW equ 8CH ; PSG write port
PSGDAR equ 90H ; PSG read port
;
; Address definition
;
FDCCMD equ 30H ; Command to FDC
FDCSTT equ FDCCMD ; Status from FDC
FDCTRK equ 31H ; Track register
FDCSEC equ 32H ; Sector register
FDCDAT equ 33H ; Data register
;
; Command definition
;
RDCMD equ 10000000B ; Sector read command
;
; Miscellaneous I/O ports
;
INTRQP equ 34H ; Address of INTRQ and DRQ
INTRQ equ 10000000B ; Interrupt request bit
DRQ equ 01000000B ; Data request bit
;
DENSEL equ 38H ; Address of density select flag
DESMFM equ 00000000B ; Density MFM bit
DESFM equ 00000001B ; Density FM bit
DESMFM2 equ 00000010B ; Density MFM bit and side 2
org 0C100h
ld a, 11011101b ; Bank 21
out (PSGDAW), a ; Register already set in ROM, just enable bank
ld sp, 100h ; Set temporary stack pointer
ld b, 17
call RDMSEC ; Read remaining sectors of first track
xor a
out (DENSEL), a ; Set MFM density for rest of tracks
ld hl, 256
ld (BYTSEC+1), hl ; Modify sector size
ld a, 18
ld (MAXSEC+1), a ; Modify number of sectors / track
ld b, 5
call RDMSEC ; Read remaing part
jp BIOSB ; Jump to cold boot routine
;
; Sector read routine
;
RDMSEC:
push bc
SETSEC:
ld a, 2
out (FDCSEC), a ; Write to sector register
ld a, RDCMD ; Sector read command
out (FDCCMD), a ; Issue read command
ld c, FDCDAT
ex (sp), hl
ex (sp), hl
ex (sp), hl
ex (sp), hl
SETBUF:
ld hl, BIOSB ; Load destination address
RDLOP:
in a, (INTRQP) ; Read data request port
add a, a
jr c, RDONE ; Read confirmed
jp p, RDLOP ; No data valid
ini ; Read data from FDC
jr RDLOP
RDONE:
in a, (FDCSTT)
and 00011100b ; Any errors detected?
jr nz, SETSEC
ld hl, (SETBUF+1)
BYTSEC:
ld de, 128 ; Sector size
add hl, de
ld (SETBUF+1), hl
ld hl, SETSEC+1
inc (hl) ; Increase sector count
ld a, (hl)
MAXSEC:
cp 19 ; Read all sectors?
jr c, DECSCZ
ld a, 1010010b ; Issue FDC STEP IN command
out (FDCCMD), a
ld (hl), 1
ex (sp), hl ; Wait for the drive head
ex (sp), hl
ex (sp), hl
ex (sp), hl
ex (sp), hl
ex (sp), hl
ex (sp), hl
ex (sp), hl
ex (sp), hl
ex (sp), hl
ex (sp), hl
ex (sp), hl
ex (sp), hl
ex (sp), hl
ex (sp), hl
ex (sp), hl
BUSY:
in a, (FDCSTT) ; Get FDC status
rra ; Look busy bit [LSB]
jr c, BUSY ; Wait
DECSCZ:
pop bc
djnz RDMSEC
ret
; -------------------------------------------------------------------------
db 0, 0, 0, 0, 0, 0, 0, 0
end
That's wonderful - thank you for saving me a bit of time figuring that out for myself! I've just started working on adding support so hopefully I'll have it working this coming weekend.
It's irrelevant to this thread, but +cpm -subtype=svi will now create a CP/M disk image suitable for usage with CP/M on the svi
It's irrelevant to this thread, but +cpm -subtype=svi will now create a CP/M disk image suitable for usage with CP/M on the svi
I had a few problems with the FM/MFM transition and the .dsk format doesn't seem to work in Mame for this target - it looks like only IMD is supported.
However, there's now a new -subtype=disk option to the +svi target which will generate a raw .SVI image for use in Mame.
I've tested it in Mame with the following option:
./mame64 svi328 -exp sv601 -exp:sv601:1 sv801 -flop1 a.svi
However, there's now a new -subtype=disk option to the +svi target which will generate a raw .SVI image for use in Mame.
I've tested it in Mame with the following option:
./mame64 svi328 -exp sv601 -exp:sv601:1 sv801 -flop1 a.svi