diff --git a/software/asm/cbios.asm b/software/asm/cbios.asm
index cbbed3b..b07deb8 100644
--- a/software/asm/cbios.asm
+++ b/software/asm/cbios.asm
@@ -17,6 +17,8 @@
;- additional and different hardware. The SPI is now onboard the PCB and
;- not using the printer interface card.
;- Mar 2021 - Updates for the RFS v2.1 board.
+;- Apr 2021 - Removed ROM and RAM Drive functionality as it provided no performance or
+;- use benefit over SD which are much larger and RW.
;--------------------------------------------------------------------------------------------------------
;- This source file is free software: you can redistribute it and-or modify
;- it under the terms of the GNU General Public License as published
@@ -32,6 +34,11 @@
;- along with this program. If not, see .
;--------------------------------------------------------------------------------------------------------
+ ; Bring in definitions and macros.
+ INCLUDE "CPM_BuildVersion.asm"
+ INCLUDE "CPM_Definitions.asm"
+ INCLUDE "Macros.asm"
+
ORG CBIOSSTART
;----------------------------------------------------------------------------------------------------------------------------------------------
@@ -325,11 +332,14 @@ INIT3: LD A,(BNKCTRLRST)
LD A,080H ; Cursor on (Bit D7=1).
LD (FLASHCTL),A
- ; Change to 80 character mode.
- LD HL,DSPCTL ; Setup address of display control register latch.
- LD A, 128 ; 80 char mode.
- LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
- LD (HL), A
+ ; Change to 80 character mode if enabled.
+ IF BUILD_80C = 1
+ LD HL,DSPCTL ; Setup address of display control register latch.
+ LD A, 128 ; 80 char mode.
+ LD E,(HL) ; Dummy operation to enable latch write via multivibrator.
+ LD (HL), A
+ ENDIF
+
CALL ?MLDSP
CALL ?NL
LD DE,CBIOSSIGNON ; Start of sign on message, as devices are detected they are added to the sign on.
@@ -345,6 +355,20 @@ INIT3: LD A,(BNKCTRLRST)
LD (IOBYT),A
LD (CDISK),A
+ ; DRVAVAIL flag definition. Version 1.25 - removed ROM Drives and RAM drives as they provided no speed or use benefit compared with SD drives.
+ ;
+ ; 1 = Active.
+ ;
+ ; 7 6 5 4 3 2 1 0
+ ; ^ ^ ^ ^ ^ ^ ^ ^
+ ; | | | | | | | |-- Floppy Drive Present
+ ; | | | | | | |---- ROM Drive Present
+ ; | | | | | |------ SD Card Present
+ ; | | | | |-------- RAM Drive Present
+ ; | | | |----------
+ ; | | |------------
+ ; | |--------------
+ ; |---------------- Drives present
;
; Initialise the SD Card subsystem (if connected).
;
@@ -353,144 +377,53 @@ INIT3: LD A,(BNKCTRLRST)
JR NZ,STRT2
SET 2,A ; Assume the SD Card is present.
;
- PUSH AF ; Output indicator that SDC drives are available.
LD DE,SDAVAIL
- CALL MONPRTSTR
- POP AF
- SET 7,A
+ CALL PRTSTRTMSG
;
; Locate the CPM Image and store the Bank/Block to speed up warm boot.
STRT2: LD (DRVAVAIL),A
;
+ ; Find the CPM binary in the ROM, used for Warm restart CCP/BDOS reload.
LD HL,CPMROMFNAME ; Name of CPM File in rom.
CALL FINDMZF
- JP NZ,ROMFINDERR ; Failed to find CPM in the ROM! This shouldnt happen as we boot from ROM.
+ JP NZ,ROMFINDERR ; Failed to find CPM in the ROM! This shouldnt happen even if we boot from SD card, a copy needs to be in the ROM.
LD (CPMROMLOC),BC
- ; Locate the ROMFS CPM Disk Images.
- LD HL,0FFFFh
- LD (CPMROMDRV0),HL
- LD (CPMROMDRV1),HL
- LD HL,CPMRDRVFN0 ; Name of CPM Rom Drive File 0 in rom.
- CALL FINDMZF
- JR NZ,STRT3 ; Failed to find the drive image in the ROM!
- LD (CPMROMDRV0),BC ; If found store the bank and page the image is located at.
- LD A,(DRVAVAIL)
- SET 1,A ; Indicate ROM drives are available.
- ;
- PUSH AF ; Output indicator that ROM 1 drive is available.
- BIT 7,A
- JR Z,STRT2A
- LD A,','
- CALL ?PRNT
-STRT2A: LD DE,ROM1AVAIL
- CALL MONPRTSTR
- POP AF
- SET 7,A
- LD (DRVAVAIL),A
- ;
-STRT3: LD HL,CPMRDRVFN1 ; Name of CPM Rom Drive File 1 in rom.
- CALL FINDMZF
- JR NZ,STRT4 ; Failed to find the drive image in the ROM!
- LD (CPMROMDRV1),BC ; If found store the bank and page the image is located at.
- LD A,(DRVAVAIL)
- SET 1,A ; Indicate ROM drives are available.
- ;
- PUSH AF ; Output indicator that ROM 2 drive is available.
- BIT 7,A
- JR Z,STRT3A
- LD A,','
- CALL ?PRNT
-STRT3A: LD DE,ROM2AVAIL
- CALL MONPRTSTR
- POP AF
- SET 7,A
- LD (DRVAVAIL),A
- ;
STRT4: CALL ?DSKINIT ; Initialise the disk subsystem.
JR NZ,STRT5
LD A,(DRVAVAIL)
SET 0,A ; Indicate Floppy drives are available.
- PUSH AF ; Output indicator that FDC drives are available.
- BIT 7,A
- JR Z,STRT4A
- LD A,','
- CALL ?PRNT
-STRT4A: LD DE,FDCAVAIL
- CALL MONPRTSTR
- POP AF
- SET 7,A
- LD (DRVAVAIL),A
+ LD DE,FDCAVAIL
+ CALL PRTSTRTMSG
;
STRT5: LD DE,CBIOSIGNEND ; Terminate the signon message which now includes list of drives detected.
CALL MONPRTSTR
CALL ?NL
;
+ ; Allocate DPB according to drives detected in priorty, SD,FDC
+ ;
LD DE,DPBASE ; Base of parameter block.
LD A,0 ; Using scratch area, setup the disk count, pointer to ALV memory and pointer to CSV memory.
LD (CDIRBUF),A
LD HL,CSVALVMEM
LD (CDIRBUF+1),HL
- ;
- LD A,(DRVAVAIL)
- BIT 1,A
- JR Z,STRT7 ; No ROM drives available then skip.
- ;
- LD BC,0 ; Setup CSV/ALV parameters for a ROM drive - ie. fixed drive so 0.
- LD (CDIRBUF+3),BC
- LD BC,20 ; 240/8 + 1 ; 240/8 + 1 for a 240K drive with 1024B block, 159/8 + 1 for a 320K drive with 2048B block.
- LD (CDIRBUF+5),BC
- LD BC,DPBLOCK1
- LD (CDIRBUF+7),BC ; Address of Disk Parameters
- LD A,(CPMROMDRV0) ; Drive 0 available?
- CP 0FFH
- JR Z,STRT6
- ;
- CALL COPYDPB ; Copy and set parameters
+ ; Drives A,B default to SD card if present.
+ CALL ADDSDDRIVE
+ CALL ADDSDDRIVE
-STRT6: LD A,(CPMROMDRV1) ; Drive 1 available?
- CP 0FFH
- JR Z,STRT7
+ ; Floppy drive controller always has 2 drives so set them up, which will be C,D when SD card present else A,B.
+ CALL ADDFLPYDRV
+ CALL ADDFLPYDRV
- LD BC,DPBLOCK2
- LD (CDIRBUF+7),BC ; Address of Disk Parameters
- CALL COPYDPB
-
-STRT7: LD A,(DRVAVAIL)
- BIT 0,A
- JR Z,STRT8 ; No Floppy drives available then skip.
-
- LD BC,128/4 ; Setup CSV/ALV parameters for a 1.4MB Floppy drive.
- LD (CDIRBUF+3),BC
- LD BC,91 ; 720/8 + 1
- LD (CDIRBUF+5),BC
- LD BC,DPBLOCK3
- LD (CDIRBUF+7),BC ; Address of Disk Parameters
-
- ; Floppy drive controller always has 2 drives so set them up.
- CALL COPYDPB
- CALL COPYDPB
-
-STRT8: LD A,(DRVAVAIL)
- BIT 2,A
- JR Z,STRT10 ; No SD Card drives available then skip.
-
- LD BC,0 ; Setup CSV/ALV parameters for a 16MB SD Card drive.
- LD (CDIRBUF+3),BC
- LD BC,257 ; 2048/8 + 1
- LD (CDIRBUF+5),BC
- LD BC,DPBLOCK4
- LD (CDIRBUF+7),BC ; Address of Disk Parameters
-
- CALL COPYDPB ; Add in 2 SD drives by default.
-STRT9: CALL COPYDPB
+ ; Add additional SD card drives according to free space.
+STRT9: CALL ADDSDDRIVE
;
; Now add as many additional SD drives as we have RAM available within the CBIOS.
;
LD BC,(CDIRBUF+1)
- LD HL,CSVALVEND - 2048/8 + 1 ; Subtract the size of the ALV (CSV has no size for a fixed SD drive)
+ LD HL,CSVALVEND - 257 ; Subtract the size of the ALV (CSV has no size for a fixed SD drive)
OR A
SBC HL,BC
JR C,STRT10 ; If there is no more space, exit.
@@ -498,7 +431,7 @@ STRT9: CALL COPYDPB
STRT10: LD A,(CDIRBUF)
LD (NDISKS),A ; Setup max number of system disks found on this boot up.
-
+
; Setup timer interrupts
LD IX,TIMIN ; Pass the interrupt service handler vector.
LD BC,00000H ; Time starts at 00:00:00 01/01/1980 on initialisation.
@@ -507,7 +440,7 @@ STRT10: LD A,(CDIRBUF)
CALL ?TIMESET
; Signon message after all the hardware has been initialised.
- LD DE,CPMSIGNON
+ LD DE,CPMCOPYRMSG
CALL MONPRTSTR
; CP/M init
@@ -558,6 +491,48 @@ WBTDSKOK2: CALL ?SETDRVMAP ; Refre
GOCPM: EI
JP CCP ; Start the CCP.
+ ; Method to add an SD drive into the CPM disk definitions.
+ ; If the SD controller hasnt been detected the routine exits without configuration.
+ADDSDDRIVE: LD A,(DRVAVAIL)
+ BIT 2,A
+ RET Z ; No SD interface so skip.
+
+ LD BC,0 ; Setup CSV/ALV parameters for a 16MB SD Card drive.
+ LD (CDIRBUF+3),BC
+ LD BC,257 ; 2048/8 + 1
+ LD (CDIRBUF+5),BC
+ LD BC,DPBLOCK4
+ LD (CDIRBUF+7),BC ; Address of Disk Parameters
+ CALL COPYDPB ; Add in an SD drive.
+ RET
+
+ ; Method to add a Floppy drive into the CPM disk definitions table.
+ ; If the Floppy controller hasnt been detected then skip without configuration.
+ADDFLPYDRV: LD A,(DRVAVAIL)
+ BIT 0,A
+ RET Z ; No Floppy drives available then skip.
+
+ LD BC,128/4 ; Setup CSV/ALV parameters for a 1.4MB Floppy drive.
+ LD (CDIRBUF+3),BC
+ LD BC,91 ; 720/8 + 1
+ LD (CDIRBUF+5),BC
+ LD BC,DPBLOCK3
+ LD (CDIRBUF+7),BC ; Address of Disk Parameters
+ CALL COPYDPB ; Add in a floppy drive.
+ RET
+
+ ; Helper method to print a message with a comma if Bit 7 of A is set.
+PRTSTRTMSG: PUSH AF
+ BIT 7,A
+ JR Z,PRTCOMMA1
+ LD A,','
+ CALL ?PRNT
+PRTCOMMA1: CALL MONPRTSTR
+ POP AF
+ SET 7,A
+ LD (DRVAVAIL),A
+ RET
+
;-------------------------------------------------------------------------------
; WBOOT
;
@@ -774,11 +749,9 @@ SELDSK_: LD (SPSAVE),SP ; The o
LD (CDISK),A ; Setup drive.
SELDSK0: CALL ?SETDRVCFG
LD A,(DISKTYPE)
- CP DSKTYP_ROM
- JR Z,SELROMDSK ; Select ROM.
CP DSKTYP_SDC
JR Z,SELSDCDSK ; Select SD Card.
- ; If it is not a ROM drive or an SD drive then it must be a floppy disk.
+ ; If it is not an SD drive then it must be a floppy disk.
LD A,C
JR CALCHL
SELDSK1: LD SP,(SPSAVE) ; Restore the CPM stack.
@@ -789,21 +762,7 @@ SELSDCDSK: LD A,(DRVAVAIL)
BIT 2,A
JR Z,SELDSK1 ; No SD Card drives available then skip.
LD A,C
- JR CALCHL
- ; For ROM drives, check that at least one drive is present, otherwise illegal disk.
-SELROMDSK: CALL ?GETMAPDSK ; Map CDISK to controller + drive number.
- AND 03FH ; Mask out controller id bits.
- JR NZ,SELDSK2 ; There are only 2 ROM drives, so if it isnt drive 0, then always select drive 1.
- LD DE,(CPMROMDRV0) ; Retrieve the bank and page the image is located at.
- JR SELDSK3
-SELDSK2: LD DE,(CPMROMDRV1) ; Retrieve the bank and page the image is located at.
-SELDSK3: INC DE
- LD A,D
- OR E
- JR Z,SELDSK1 ; If the bank and page are FFFFh then no drive, exit.
- ;
- LD A,C
;
; Code for blocking and deblocking algorithm
; (see CP/M 2.2 Alteration Guide p.34 and APPENDIX G)
@@ -958,23 +917,48 @@ ALLOC2: LD (RSFLAG), A ; rsfla
; During normal operations the control registers are enabled. When access is needed to the full User ROM space, ie for drive read/write then the registers are disabled after
; setting the correct bank. The upper bits of the User ROM address space (ie. bits 20:19 which select the device) are set to by the ROMCTL variable.
;
+;SELUSRBNK: DI
+; EXX
+; EX AF,AF'
+; LD A,(ROMCTL) ; Get current setting for the coded latch, ie. number of reads needed to enable it.
+; LD C,A
+; RRA
+; RRA
+; CPL
+; AND 00FH ; Preserve bits 3-1, bit 0 is always 0 on the 74HCT191 latch.
+; LD B,A ; Set value to B for loop.
+; LD A,(BNKCTRLDIS) ; Do a reset for the case where the above read enabled the latch, possible if external programs are reading/writing the latch area.
+; LD A,(BNKCTRL) ; Sample latch at start to detect change.
+; LD E,A
+;SELUSRBNK1: LD A,(BNKCTRL) ; Read the latch and compare with sample. Either we reach the count limit or the read differs indicating latch control.
+; CP E
+; JR NZ,SELUSRBNK2
+; DJNZ SELUSRBNK1
+;SELUSRBNK2: LD A,C
+; LD (BNKCTRL),A
+; EX AF,AF'
+; LD (BNKSELUSER),A ; Select the required bank.
+; EXX
+; JR C,SELUSRBNK3 ; If Carry is set by caller then leave the control registers active.
+; LD (BNKCTRLDIS),A ; Disable the control registers, value of A is not important.
+;SELUSRBNK3: EI
+; RET
SELUSRBNK: PUSH BC
PUSH AF
- LD A,(ROMCTL) ; Get current setting for the coded latch, ie. number of reads needed to enable it.
- LD C,A
- RRA
- RRA
- CPL
- AND 00FH ; Preserve bits 3-1, bit 0 is always 0 on the 74HCT191 latch.
- LD B,A ; Set value to B for loop.
-SELUSRBNK1: LD A,(BNKSELUSER)
+ ; Reset to a known state to allow for spurious read/writes to control area clocking the up counter.
+ LD B,15
+SELUSRBNK0: LD A,(BNKCTRLDIS)
+ DJNZ SELUSRBNK0
+ ; Now loop for the correct up counter required to enable the latches.
+ LD B,15 ; Set value to B for loop.
+SELUSRBNK1: LD A,(BNKCTRL) ; Read the latch and compare with sample. Either we reach the count limit or the read differs indicating latch control.
DJNZ SELUSRBNK1
- LD A,C
- LD (BNKCTRL),A
POP AF
- LD (BNKSELUSER),A ; Select the required bank.
POP BC
- JR C,SELUSRBNK2 ; If Carry is set by caller then leave the control registers active.
+ LD (BNKSELUSER),A ; Select the required bank.
+ LD A,(ROMCTL)
+ LD (BNKCTRL),A
+ JR C,SELUSRBNK2
LD (BNKCTRLDIS),A ; Disable the control registers, value of A is not important.
SELUSRBNK2: RET
@@ -1395,6 +1379,16 @@ L09E8: LD (HL),D
DJNZ ?DINT
RET
+MULT16x8: LD HL,0
+ LD B,8
+MULT16x8_1: ADD HL,HL
+ RLCA
+ JR NC,MULT16x8_2
+ ADD HL,DE
+MULT16x8_2: DJNZ MULT16x8_1
+ RET
+
+
;-------------------------------------------------------------------------------
; START OF ROM DRIVE FUNCTIONALITY
;-------------------------------------------------------------------------------
@@ -1505,6 +1499,7 @@ FINDMZF2: PUSH BC ; Prese
LD B,A
LD C,0
ADD HL,BC
+
CALL ISMZF ; Check to see if this looks like a header entry.
POP DE
POP BC
@@ -1603,7 +1598,7 @@ LROMLOAD0: LD A,(HL) ; Issue
LD A,B
OR C
JR NZ,LROMLOAD0
- ;LDIR
+
LD DE,MZFHDRSZ - MZFHDRNCSZ ; Account for the full MZF header (we only load the initial part to save RAM).
ADD HL,DE
POP DE
@@ -1658,7 +1653,8 @@ LROMLOAD4: LD (TMPSIZE), HL ; HL co
OR C
JR Z, LROMLOAD8
-LROMLOAD9: LD A,(HL) ; Issues with LDIR and a signal artifact from the mainboard, so manual copy.
+LROMLOAD9: LD (BNKCTRLDIS),A ; There exists an issue with using the mainboard decoder signal which I havent quite understood, random activation of the upcounter occurs which appears to be the refresh circuit.
+ LD A,(HL) ; Issues with LDIR and a signal artifact from the mainboard, so manual copy.
INC HL
LD (DE),A
INC DE
@@ -1666,7 +1662,6 @@ LROMLOAD9: LD A,(HL) ; Issue
LD A,B
OR C
JR NZ,LROMLOAD9
- ;LDIR
LD BC, (TMPSIZE)
LD A, B ; Post check to ensure we still have bytes
@@ -1699,189 +1694,7 @@ LROMLOAD5: PUSH AF
POP AF
RET
- ; Calculate offset into the ROM of the required sector.
- ; The sector size is 128 bytes due to the MZF header creating a 128 byte offset. Larger sector
- ; sizes will need to see the math enhanced to cater for the offset.
-
- ; Inputs: (HSTTRK) - 16bit track number.
- ; (HSTSEK) - 8bit sector number.
- ; (CDISK) - Disk drive number.
- ;
-ROMREAD: LD DE,(HSTTRK) ; To cater for larger RFS images in the future we use the full 16bit track number.
- LD (TRACKNO),DE
- LD A, BANKSPERTRACK * SECTORSPERBANK
- LD B,8
- LD HL,0
-ROMREAD2: ADD HL,HL
- RLCA
- JR NC,ROMREAD3
- ADD HL,DE
-ROMREAD3: DJNZ ROMREAD2
- ; HL contains the number of sectors for the given tracks.
- LD A,(HSTSEC)
- OR A
- RL A
- RL A
- LD (SECTORNO), A ; Sector number converted from host 512 byte to local RFS 128 byte.
- LD E,A
- LD D,0
- ADD HL,DE ; Add the number of sectors.
- ; HL contains the number of sectors for the given tracks and sector.
- PUSH HL
- CALL ?GETMAPDSK
- AND 03FH ; Mask out the controller id bits.
- JR NZ,ROMREAD3A ; Only 2 ROM drives, so if it isnt drive 0 then it must be drive 1.
- LD BC,(CPMROMDRV0)
- JR ROMREAD3B
-ROMREAD3A: LD BC,(CPMROMDRV1)
-ROMREAD3B: LD A,C ; Set upper address bits by masking out 7:6 and adding to ROMCTL variable.
- AND 0C0H
- LD D,A
- LD A,(ROMCTL)
- AND 03FH
- OR D
- LD (ROMCTL),A
- ;
- LD A,C ; Remove upper address bits from starting block.
- AND 03FH
- LD C,A
- ;
- LD E,B ; Place number of banks offset and multiply into sectors.
- LD D,0
- LD A,SECTORSPERBANK
- LD B,8
- LD HL,0
-ROMREAD4: ADD HL,HL
- RLCA
- JR NC,ROMREAD5
- ADD HL,DE
-ROMREAD5: DJNZ ROMREAD4 ; HL contains the number of sectors for the offset to the drive image.
- POP DE
- ADD HL,DE
- ; HL contains the sectors for the number of tracks plus the sectors for the offset to the drive image.
- ; C contains current block number.
- LD D,SECTORSPERBLOCK ; Calculate the sectors in the block offset (as RFS uses a different sector size).
- LD B,8
-ROMREAD6: XOR A
- RLCA
- RLC C
- JR NC,ROMREAD7
- ADD A,D
-ROMREAD7: DJNZ ROMREAD6
- LD E,A
- LD D,0
- INC HL ; The MZF Header consumes 1 sector so skip it.
- ADD HL,DE ; HL contains the final absolute sector number to read in ROM.
-
- ; Divide HL by SECTORSPERBANK to obtain the starting bank.
- LD C,SECTORSPERBANK
- LD B,16
- XOR A
-ROMREAD8: ADD HL,HL
- RLA
- CP C
- JR C,ROMREAD9
- INC L
- SUB C
-ROMREAD9: DJNZ ROMREAD8
- ; HL contains the absolute bank number. A contains the block sector.
- PUSH HL
- LD DE,ROMSECTORSIZE
- LD B,8
- LD HL,0
-ROMREAD10: ADD HL,HL
- RLCA
- JR NC,ROMREAD11
- ADD HL,DE
-ROMREAD11: DJNZ ROMREAD10
- LD DE,UROMADDR
- ADD HL,DE
- POP DE ; DE contains the absolute bank number, HL contains the address offset in that bank.
- LD C,A
- LD B,E ; Currently only 8bit bank number, store in B.
- LD A, E
- OR A ; Select the required user bank and Clear carry so that the control registers are disabled.
- CALL SELUSRBNK
- PUSH BC
- PUSH HL
- LD DE,HSTBUF ; Target is the host buffer.
- LD HL,384 ; Size of host sector.
- LD BC,ROMSECTORSIZE
- JR ROMREAD14
-
- ; HL = address in active block to read.
- ; B = Bank
- ; C = Block
-ROMREAD12: LD A, B
- OR A ; Select the required user bank and Clear carry so that the control registers are disabled.
- CALL SELUSRBNK
- ;
- LD A,H ; If we reach the top of the user rom space, wrap around.
- CP FDCROMADDR / 0100H ; Compare high byte against high byte of floppy rom.
- JR NZ,ROMREAD13
- LD HL,UROMADDR
- ;
-ROMREAD13: PUSH BC
- PUSH HL
- LD DE, (TMPADR)
- LD HL, (TMPSIZE)
- LD BC, ROMSECTORSIZE ;128 ;RFSSECTSZ
- CCF
- SBC HL, BC
- JR NC, ROMREAD14
- LD BC, (TMPSIZE)
- LD HL, 0
-ROMREAD14: LD (TMPSIZE), HL ; HL contains remaining amount of bytes to load.
- POP HL
- ;
- LD A, B ; Pre check to ensure BC is not zero.
- OR C
- JR Z, ROMREAD16
-
-ROMREAD18: LD A,(HL) ; Issues with LDIR and a signal artifact from the mainboard, so manual copy.
- INC HL
- LD (DE),A
- INC DE
- DEC BC
- LD A,B
- OR C
- JR NZ,ROMREAD18
- ;LDIR
-
- LD BC, (TMPSIZE)
- LD A, B ; Post check to ensure we still have bytes
- OR C
- JR Z, ROMREAD16
- ;
- LD (TMPADR),DE ; Address we are loading into.
- POP BC
-ROMREAD15: INC C
- LD A, C
- CP SECTORSPERBANK ; Max blocks per page reached?
- JR C, ROMREAD12
- LD C, 0
- INC B
- LD A, B
- CP 000h
- JR NZ, ROMREAD12
- OR 1
- JR ROMREAD17
- ;
-ROMREAD16: POP BC
-ROMREAD17: PUSH AF
- LD A,(ROMCTL)
- AND 03FH
- LD (ROMCTL),A ; Switch back to primary Flash RAM I device.
- LD A,ROMBANK9 ; Reselect utilities bank.
- SCF ; Select the required user bank and Set carry so that the control registers remain enabled.
- CALL SELUSRBNK
- POP AF
- JP READHST3 ; HL/BC pushed onto stack in READHST, a jump was made this method not a call.
-
; Rom filing system error messages.
-ROMLOADERR: LD DE,ROMLDERRMSG
- JR MONPRTSTR
-
ROMFINDERR: LD DE,ROMFDERRMSG
JR MONPRTSTR
@@ -1896,6 +1709,7 @@ MONPRTSTR2: CALL ?PRNT
; END OF ROM DRIVE FUNCTIONALITY
;-------------------------------------------------------------------------------
+
;-------------------------------------------------------------------------------
; START OF SD CARD DRIVE FUNCTIONALITY
;-------------------------------------------------------------------------------
@@ -2100,8 +1914,6 @@ SEKTRKCMP: EX DE, HL
READHST: PUSH BC
PUSH HL
LD A,(DISKTYPE)
- CP DSKTYP_ROM ; Is the drive a ROM?
- JP Z,ROMREAD
CP DSKTYP_SDC ; Is the drive an SD Card?
JP Z,SDCREAD
READHST2: CALL ?DSKREAD ; Floppy card, use the FDC Controller.
@@ -2117,8 +1929,6 @@ READHST3: POP HL
WRITEHST: PUSH BC
PUSH HL
LD A,(DISKTYPE)
- CP DSKTYP_ROM ; Is the drive a ROM? We cannot (yet) write to the Flash ROM, so error.
- JP Z,WRITEHST4
CP DSKTYP_SDC ; Is the drive an SD Card?
JP Z,SDCWRITE
CALL ?DSKWRITE
@@ -2656,18 +2466,21 @@ KTBLC: ; CTRL ON
-CBIOSSIGNON:DB "** CBIOS v1.23, (C) P.D. Smart, 19-21. Drives:", NUL
-CBIOSIGNEND:DB " **", CR, NUL
-CPMSIGNON: DB "CP/M v2.23 (48K) COPYRIGHT(C) 1979, DIGITAL RESEARCH", CR, LF, NUL
-NOBDOS: DB "Failed to load BDOS, aborting!", CR, LF, NUL
+CBIOSSIGNON:IF BUILD_80C = 1
+ DB "** CBIOS v1.25, (C) P.D. Smart, 2019-21. Drives:", NUL
+ ELSE
+ DB "*CBIOS v1.25, (C) P.D. Smart, 2019-21.*", CR
+ DB "Drives:", NUL
+ ENDIF
+CBIOSIGNEND:IF BUILD_80C = 1
+ DB " **", CR, NUL
+ ELSE
+ DB CR, NUL
+ ENDIF
+NOBDOS: DB "No BDOS, aborting!", CR, LF, NUL
CPMROMFNAME:DB "CPM223RFS", NUL
-CPMRDRVFN0: DB "CPM22-DRV0", NUL
-CPMRDRVFN1: DB "CPM22-DRV1", NUL
-ROMLDERRMSG:DB "ROM LOAD ERR", CR, NUL
ROMFDERRMSG:DB "ROM FIND ERR", CR, NUL
SDAVAIL: DB "SD", NUL
-ROM1AVAIL: DB "ROM1", NUL
-ROM2AVAIL: DB "ROM2", NUL
FDCAVAIL: DB "FDC", NUL
;-------------------------------------------------------------------------------
; END OF STATIC LOOKUP TABLES AND CONSTANTS
@@ -2802,9 +2615,26 @@ DPB4: DW 128 ; SPT -
; Bit 2 = Invert, 1 = Invert data, 0 = Use data as read (on MB8866 this is inverted).
; Bit 4:3 = Disk type, 00 = FDC, 10 = ROM, 11 = SD Card, 01 = Unused
; Bit 5 = ROMFS Image, 0 = DRV0, 1 = DRV1
+
+
+; Rom Filing System RAM Drive.
+; If the RFS v2.x board has the optional 512KRAM installed in slot 3 then this definition is used to create a RAM based disk drive within it.
+;
+DPB5: DW 128 ; SPT - 128 bytes sectors per track
+ DB 4 ; 3 ; BSH - block shift factor (Set to 3 for a 240K RomRFS Image).
+ DB 15 ; 7 ; BLM - block mask (Set to 7 for a 240K RomRFS Image).
+ DB 0 ; EXM - Extent mask
+ DW 159 ; 240 ; DSM - Storage size (blocks - 1) (Set to 240 for a 240K RomRFS Image).
+ DW 63 ; 31 ; DRM - Number of directory entries - 1
+ DB 128 ; AL0 - 1 bit set per directory block
+ DB 0 ; AL1 - "
+ DW 0 ; 16 ; CKS - DIR check vector size (DRM+1)/4 (0=fixed disk)
+ DW 0 ; OFF - Reserved tracks
+ DB 8 ; CFG - MZ80A Addition, configuration flag:
+ ; Bit 1:0 = FDC: Sector Size, 00 = 128, 10 = 256, 11 = 512, 01 = Unused.
+ ; Bit 2 = Invert, 1 = Invert data, 0 = Use data as read (on MB8866 this is inverted).
+ ; Bit 4:3 = Disk type, 00 = FDC, 10 = ROM, 11 = SD Card, 01 = RAM
+ ; Bit 5 = ROMFS Image, 0 = DRV0, 1 = DRV1
+
ALIGN_NOPS SCRN
-
- ; Bring in additional macros.
- INCLUDE "CPM_Definitions.asm"
- INCLUDE "Macros.asm"
diff --git a/software/asm/cbios_bank1.asm b/software/asm/cbios_bank1.asm
index 91a9322..21bd6f1 100644
--- a/software/asm/cbios_bank1.asm
+++ b/software/asm/cbios_bank1.asm
@@ -32,6 +32,11 @@
;- along with this program. If not, see .
;--------------------------------------------------------------------------------------------------------
+ ; Bring in definitions and macros.
+ INCLUDE "CPM_BuildVersion.asm"
+ INCLUDE "CPM_Definitions.asm"
+ INCLUDE "Macros.asm"
+
;======================================
;
; USER ROM CPM CBIOS BANK 1
@@ -447,7 +452,3 @@ GETKY2: LD A,(KEYCOUNT) ; No ke
ALIGN_NOPS UROMADDR + 0800h
-
- ; Bring in additional macros.
- INCLUDE "CPM_Definitions.asm"
- INCLUDE "Macros.asm"
diff --git a/software/asm/cbios_bank2.asm b/software/asm/cbios_bank2.asm
index 7056380..8368f7e 100644
--- a/software/asm/cbios_bank2.asm
+++ b/software/asm/cbios_bank2.asm
@@ -34,6 +34,11 @@
;- along with this program. If not, see .
;--------------------------------------------------------------------------------------------------------
+ ; Bring in definitions and macros.
+ INCLUDE "CPM_BuildVersion.asm"
+ INCLUDE "CPM_Definitions.asm"
+ INCLUDE "Macros.asm"
+
;======================================
;
; USER ROM CPM CBIOS BANK 2
@@ -1458,7 +1463,3 @@ RCP: LD HL,(CURSORPSAV) ; (curr
;-------------------------------------------------------------------------------
ALIGN_NOPS UROMADDR + 0800h
-
- ; Bring in additional macros.
- INCLUDE "CPM_Definitions.asm"
- INCLUDE "Macros.asm"
diff --git a/software/asm/cbios_bank3.asm b/software/asm/cbios_bank3.asm
index 7769758..e5c7b0f 100644
--- a/software/asm/cbios_bank3.asm
+++ b/software/asm/cbios_bank3.asm
@@ -31,6 +31,11 @@
;- along with this program. If not, see .
;--------------------------------------------------------------------------------------------------------
+ ; Bring in definitions and macros.
+ INCLUDE "CPM_BuildVersion.asm"
+ INCLUDE "CPM_Definitions.asm"
+ INCLUDE "Macros.asm"
+
;============================================================
;
; USER ROM CPM CBIOS BANK 3 - SD Card Controller functions.
@@ -800,8 +805,8 @@ ADD32: LD BC,(SDSTARTSEC+2)
CALL ADD3216
; Now add the offset to account for the RFS image.
- IF RFS_IMGSZ/SD_SECSIZE < 010000H
- LD BC, RFS_IMGSZ/SD_SECSIZE ; Sector offset for the RFS Image.
+ IF RFS_END_ADDR/SD_SECSIZE < 010000H
+ LD BC, RFS_END_ADDR/SD_SECSIZE ; Sector offset for the RFS Image.
CALL ADD3216
ELSE
LD BC,0 ; Padding is to an even address so lower word will always be zero.
@@ -865,7 +870,3 @@ SDC_WRITE1: RET
ALIGN_NOPS UROMADDR + 0800h
-
- ; Bring in additional macros.
- INCLUDE "CPM_Definitions.asm"
- INCLUDE "Macros.asm"
diff --git a/software/asm/cbios_bank4.asm b/software/asm/cbios_bank4.asm
index 950e1dd..0ddce5d 100644
--- a/software/asm/cbios_bank4.asm
+++ b/software/asm/cbios_bank4.asm
@@ -31,6 +31,11 @@
;- along with this program. If not, see .
;--------------------------------------------------------------------------------------------------------
+ ; Bring in definitions and macros.
+ INCLUDE "CPM_BuildVersion.asm"
+ INCLUDE "CPM_Definitions.asm"
+ INCLUDE "Macros.asm"
+
;============================================================
;
; USER ROM CPM CBIOS BANK 4 - Floppy Disk Controller functions.
@@ -141,10 +146,17 @@ SETDRVMAP2: LD A,B
LD A,(HL)
POP HL
- BIT 4,A ; Disk type = FDC
+ BIT 4,A ; Disk type = FDC?
+ JR NZ,SETDRVMAP2A
+ BIT 3,A
JR Z,SETDRVMAP4 ; Is this an FDC controlled disk, if so store the mapping number in the map unchanged.
;
- BIT 3,A ; Is this an SD Card disk, if so, add 080H to the mapping number and store.
+ LD A,E
+ OR 020H ; This is a RAM drive, add 020H to the mapping number and store.
+ INC E
+ JR SETDRVMAP5
+ ;
+SETDRVMAP2A:BIT 3,A ; Is this an SD Card disk, if so, add 080H to the mapping number and store.
JR Z,SETDRVMAP3
LD A,E
OR 080H
@@ -226,11 +238,15 @@ SETDRV1A: INC A ; Add 1
;
XOR A ; Disk type = FDC
BIT 4,(HL)
- JR Z,SETDRV2
- LD A,DSKTYP_ROM ; Disk type = ROMFS
+ JR NZ,SETDRV1B ; 4 = 1?
BIT 3,(HL)
+ JR Z,SETDRV2 ; 3 = 0 - FDC
+ LD A,DSKTYP_RAM
+ JR SETDRV2
+SETDRV1B: LD A,DSKTYP_ROM ; Disk type = ROMFS
+ BIT 3,(HL) ; 3 = 0? Thus 1:0 = ROM
JR Z,SETDRV2
- LD A,DSKTYP_SDC ; Disk type = SD Card
+ LD A,DSKTYP_SDC ; Disk type = SD Card, ie. 1:1
SETDRV2: LD (DISKTYPE),A
POP BC
POP DE
@@ -252,12 +268,11 @@ SETDRV2: LD (DISKTYPE),A
LD A,(HL) ; Get the physical number after mapping from the CDISK.
POP BC
POP HL
-;CHECK THIS TYPO AND REMOVE SEEMS A COPY PASTE ERROR
- RET NC ; This isnt a physical floppy disk, no need to perform any actions, exit.
+ RET
; Select FDC drive (make active) based on value in DISKMAP[CDISK].
?SELDRIVE: CALL ?GETMAPDSK
- CP 040H ; Anything with bit 6 or 7 set is not an FDC drive.
+ CP 020H ; Anything with bit 7:5 set is not an FDC drive.
RET NC ; This isnt a physical floppy disk, no need to perform any actions, exit.
LD (FDCDISK),A
CALL DSKMTRON ; yes, set motor on and wait
@@ -620,7 +635,3 @@ DATAOVRMSG: DB "DISK ERROR - DATA OVERRUN", CR, NUL
CRCERRMSG: DB "DISK ERROR - CRC ERROR", CR, NUL
ALIGN_NOPS UROMADDR + 0800h
-
- ; Bring in additional macros.
- INCLUDE "CPM_Definitions.asm"
- INCLUDE "Macros.asm"
diff --git a/software/asm/cpm22.asm b/software/asm/cpm22.asm
index 63eb630..dd522f8 100644
--- a/software/asm/cpm22.asm
+++ b/software/asm/cpm22.asm
@@ -7,6 +7,11 @@
;* by Clark A. Calkins
;*
;**************************************************************
+
+ ; Bring in definitions and macros.
+ INCLUDE "CPM_BuildVersion.asm"
+ INCLUDE "CPM_Definitions.asm"
+ INCLUDE "Macros.asm"
;
; Set memory limit here. This is the amount of contigeous
; ram starting from 0000. CP/M will reside at the end of this space.
@@ -59,12 +64,16 @@ CCPFIRS EQU CBASE + 8 ; Address of the first charater of the CCP in
;
INBUFF: DB 127 ;length of input buffer.
DB 0 ;current length of contents.
- DB "Copyright"
- DB " 1979 (c) by Digital Research "
- DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+ IF BUILD_80C = 1
+ DB "CP/M v2.23 (48K) Copyright(c) 1979 by Digital Research", 00DH, 00AH, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; 68 chars
+ ELSE
+ DB "CP/M v2.23 (c) 1979 by Digital Research", 00DH, 00AH, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ; 68 chars
+ ENDIF
+ ;DB "Copyright"
+ ;DB " 1979 (c) by Digital Research "
+ DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+ DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
+ DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
INPOINT:DW INBUFF+2 ;input line pointer
NAMEPNT:DW 0 ;input line pointer used for error message. Points to
; ;start of name in error.
@@ -831,7 +840,11 @@ DIRECT3:JP Z,DIRECT9 ;terminate if no more names.
LD A,E ;bump name count.
INC E
PUSH DE
- AND 03H ;at end of line?
+ IF BUILD_80C = 1
+ AND 03H ;at end of line?
+ ELSE
+ AND 01H ;at end of line?
+ ENDIF
PUSH AF
JP NZ,DIRECT4
CALL CRLF ;yes, end this line and start another.
@@ -3742,8 +3755,7 @@ CKSUMTBL: DB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
; MZ-80A CPM BIOS STUB - Main Logic in CBIOS.ASM
;-----------------------------------------------------------------------
- INCLUDE "Macros.asm"
- INCLUDE "CPM_Definitions.asm"
+ ; Bring in the CBIOS stub, has the bootstrap code and DPB place markers.
INCLUDE "cpm22-bios.asm"
ALIGN_NOPS CBIOSSTART
diff --git a/software/asm/include/CPM_BuildVersion.asm b/software/asm/include/CPM_BuildVersion.asm
new file mode 100644
index 0000000..e02476d
--- /dev/null
+++ b/software/asm/include/CPM_BuildVersion.asm
@@ -0,0 +1 @@
+BUILD_VERSION EQU 0
diff --git a/software/asm/include/CPM_Definitions.asm b/software/asm/include/CPM_Definitions.asm
index 9cbe115..ba95d6e 100644
--- a/software/asm/include/CPM_Definitions.asm
+++ b/software/asm/include/CPM_Definitions.asm
@@ -14,6 +14,8 @@
; additional and different hardware. The SPI is now onboard the PCB and
; not using the printer interface card.
; Mar 2021 - Changes to work with the RFS v2.1 board.
+;- Apr 2021 - Removed ROM and RAM Drive functionality as it provided no performance or
+;- use benefit over SD which are much larger and RW.
;-
;--------------------------------------------------------------------------------------------------------
;- This source file is free software: you can redistribute it and-or modify
@@ -37,6 +39,49 @@ HW_SPI_ENA EQU 1 ; Set t
SW_SPI_ENA EQU 0 ; Set to 1 if software SPI is present on the RFS PCB v2 board.
PP_SPI_ENA EQU 0 ; Set to 1 if using the SPI interface via the Parallel Port, ie. for RFS PCB v1 which doesnt have SPI onboard.
+;-----------------------------------------------
+; Configurable settings.
+;-----------------------------------------------
+; Build time options, only set to '1' to build, '0' to disable, only 1 can be set to '1'.
+; IF BUILD_VERSION = 0
+BUILD_80C EQU 1 ; Build for an MZ-80A with a 40/80 column card.
+BUILD_40C EQU 0 ; Build for a standard 40 column MZ-80A.
+; ENDIF
+; IF BUILD_VERSION = 1
+;BUILD_80C EQU 0 ; Build for an MZ-80A with a 40/80 column card.
+;BUILD_40C EQU 1 ; Build for a standard 40 column MZ-80A.
+; ENDIF
+
+MAXRDRETRY EQU 002h
+MAXWRRETRY EQU 002h
+BLKSIZ EQU 4096 ; CP/M allocation size
+HSTSIZ EQU 512 ; host disk sector size
+HSTSPT EQU 32 ; host disk sectors/trk
+HSTBLK EQU HSTSIZ/128 ; CP/M sects/host buff
+CPMSPT EQU HSTBLK * HSTSPT ; CP/M sectors/track
+SECMSK EQU HSTBLK-1 ; sector mask
+WRALL EQU 0 ; write to allocated
+WRDIR EQU 1 ; write to directory
+WRUAL EQU 2 ; write to unallocated
+TMRTICKINTV EQU 5 ; Number of 0.010mSec ticks per interrupt, ie. resolution of RTC.
+MTROFFMSECS EQU 100 ; Time from last access to motor being switched off in seconds in TMRTICKINTV ticks.
+; IF BUILD_80C = 1
+COLW EQU 80 ; Width of the display screen (ie. columns).
+; ELSE
+;COLW EQU 40 ; Width of the display screen (ie. columns).
+; ENDIF
+ROW EQU 25 ; Number of rows on display screen.
+SCRNSZ EQU COLW * ROW ; Total size, in bytes, of the screen display area.
+SCRLW EQU COLW / 8 ; Number of 8 byte regions in a line for hardware scroll.
+
+; BIOS equates
+MAXDISKS EQU 7 ; Max number of Drives supported
+KEYBUFSIZE EQU 16 ; Ensure this is a power of 2, max size 256.
+
+; Debugging
+ENADEBUG EQU 0 ; Enable debugging logic, 1 = enable, 0 = disable
+
+
;-----------------------------------------------
; Entry/compilation start points.
;-----------------------------------------------
@@ -48,6 +93,7 @@ CBASE EQU 0A000H
CPMCCP EQU CBASE ; CP/M System entry
CPMBDOS EQU CPMCCP + 0806H ; BDOS entry
CPMBIOS EQU CPMCCP + 01600H ; Original CPM22 BIOS entry
+CPMCOPYRMSG EQU CBASE+8 ; Copyright message stored in CP/M binary.
BOOT EQU CBIOSSTART + 0
WBOOT EQU CBIOSSTART + 3
WBOOTE EQU CBIOSSTART + 3
@@ -73,7 +119,7 @@ CCPCLRBUF EQU CBASE + 3
DPBASE EQU CPMBIOS
CDIRBUF EQU CPMBIOS + (MAXDISKS * 16)
CSVALVMEM EQU CDIRBUF + 128
-CSVALVEND EQU CSVALVMEM + 1253
+CSVALVEND EQU CBIOSDATA - 1 ;CSVALVMEM + 1253
IOBYT EQU 00003H ; IOBYTE address
CDISK EQU 00004H ; Address of Current drive name and user number
CPMUSERDMA EQU 00080h ; Default CPM User DMA address.
@@ -87,37 +133,6 @@ DPBLOCK5 EQU DPBLOCK4 + DPSIZE
DPBLOCK6 EQU DPBLOCK5 + DPSIZE
DPBLOCK7 EQU DPBLOCK6 + DPSIZE
-
-;-----------------------------------------------
-; Configurable settings.
-;-----------------------------------------------
-MAXRDRETRY EQU 002h
-MAXWRRETRY EQU 002h
-BLKSIZ EQU 4096 ; CP/M allocation size
-HSTSIZ EQU 512 ; host disk sector size
-HSTSPT EQU 32 ; host disk sectors/trk
-HSTBLK EQU HSTSIZ/128 ; CP/M sects/host buff
-CPMSPT EQU HSTBLK * HSTSPT ; CP/M sectors/track
-SECMSK EQU HSTBLK-1 ; sector mask
-WRALL EQU 0 ; write to allocated
-WRDIR EQU 1 ; write to directory
-WRUAL EQU 2 ; write to unallocated
-TMRTICKINTV EQU 5 ; Number of 0.010mSec ticks per interrupt, ie. resolution of RTC.
-MTROFFMSECS EQU 100 ; Time from last access to motor being switched off in seconds in TMRTICKINTV ticks.
-COLW: EQU 80 ; Width of the display screen (ie. columns).
-ROW: EQU 25 ; Number of rows on display screen.
-SCRNSZ: EQU COLW * ROW ; Total size, in bytes, of the screen display area.
-SCRLW: EQU COLW / 8 ; Number of 8 byte regions in a line for hardware scroll.
-MODE80C: EQU 1
-ROMDRVSIZE: EQU 320 ; Size in K of the Rom RFS Drive, currently 240 or 320 are coded. Please set value in make_cpmdisks.sh when changing this parameter.
-
-; BIOS equates
-MAXDISKS EQU 7 ; Max number of Drives supported
-KEYBUFSIZE EQU 16 ; Ensure this is a power of 2, max size 256.
-
-; Debugging
-ENADEBUG EQU 0 ; Enable debugging logic, 1 = enable, 0 = disable
-
;-------------------------------------------------------
; Function entry points in the CBIOS ROMS
;-------------------------------------------------------
@@ -247,6 +262,9 @@ SECTORSPERBANK EQU UROMSIZE / ROMSECTORSIZE ; (16)
SECTORSPERBLOCK EQU RFSSECTSZ/ROMSECTORSIZE ; (2)
ROMSECTORSIZE EQU 128
ROMSECTORS EQU 128
+RAMDRVSECTORSIZE EQU 512
+RAMDRVMAXBANK EQU (RAMDRVSIZE * 1024)/UROMSIZE ; Maximum Bank number for the RAM drive.
+
;ROMBK1: EQU 01016H ; CURRENT MROM BANK
;ROMBK2: EQU 01017H ; CURRENT USERROM BANK
;WRKROMBK1: EQU 01018H ; WORKING MROM BANK
@@ -393,6 +411,7 @@ CT_BLOCK EQU 008H ; Block
DSKTYP_FDC EQU 0 ; Type of disk is a Floppy disk and handled by the FDC controller.
DSKTYP_ROM EQU 1 ; Type of disk is a ROM and handled by the ROM methods.
DSKTYP_SDC EQU 2 ; Type of disk is an SD Card and handled by the SD Card methods.
+DSKTYP_RAM EQU 3 ; Type of disk is a RAM Drive handled by ROM/RAM methods.
;
; Rom Filing System constants.
@@ -490,8 +509,8 @@ TMPSIZE DS virtual 2 ; TEMPO
TMPCNT DS virtual 2 ; TEMPORARY COUNTER
;
CPMROMLOC: DS virtual 2 ; Upper Byte = ROM Bank, Lower Byte = Page of CPM Image.
-CPMROMDRV0: DS virtual 2 ; Upper Byte = ROM Bank, Lower Byte = Page of CPM Rom Drive Image Disk 0.
-CPMROMDRV1: DS virtual 2 ; Upper Byte = ROM Bank, Lower Byte = Page of CPM Rom Drive Image Disk 1.
+;CPMROMDRV0: DS virtual 2 ; Upper Byte = ROM Bank, Lower Byte = Page of CPM Rom Drive Image Disk 0.
+;CPMROMDRV1: DS virtual 2 ; Upper Byte = ROM Bank, Lower Byte = Page of CPM Rom Drive Image Disk 1.
NDISKS: DS virtual 1 ; Dynamically calculated number of disks on boot.
DISKMAP: DS virtual MAXDISKS ; Disk map of CPM logical to physical controller disk.
FDCDISK: DS virtual 1 ; Physical disk number.
@@ -563,7 +582,7 @@ BIOSSTACK EQU $
ISRSTACK EQU $
DBGSTACKP: DS virtual 2
- DS virtual 64
+ DS virtual 36
DBGSTACK: EQU $
VAREND EQU $ ; End of variables
diff --git a/software/asm/include/RFS_Definitions.asm b/software/asm/include/RFS_Definitions.asm
index 56b2f57..1d2c4fe 100644
--- a/software/asm/include/RFS_Definitions.asm
+++ b/software/asm/include/RFS_Definitions.asm
@@ -375,6 +375,7 @@ CMD38 EQU 64 + 38 ; ERASE
CMD55 EQU 64 + 55 ; APP_CMD
CMD58 EQU 64 + 58 ; READ_OCR
SD_SECSIZE EQU 512 ; Default size of an SD Sector
+SD_RETRIES EQU 00100H ; Number of retries before giving up.
; Card type flags (CardType)
CT_MMC EQU 001H ; MMC ver 3
diff --git a/software/asm/rfs.asm b/software/asm/rfs.asm
index 00b154b..1615488 100644
--- a/software/asm/rfs.asm
+++ b/software/asm/rfs.asm
@@ -20,6 +20,7 @@
; July 2020 - Updated for the v2.1 hardware. RFS can run with a tranZPUter board with
; or without the K64 I/O processor. RFS wont use the K64 processor all
; operations are done by the Z80 under RFS.
+;- April 2021- Updates for the v2.1 RFS board.
;-
;--------------------------------------------------------------------------------------------------------
;- This source file is free software: you can redistribute it and-or modify
@@ -249,7 +250,9 @@ ST1X: CALL NL ; Comma
LD (SDDRIVENO),A
JR ST1X
;
-CMDCMP: LD HL,CMDTABLE
+CMDCMP: XOR A ; Clear the result variable used by interbank calls. Some functions set this variable and we act on it.
+ LD (RESULT),A
+ LD HL,CMDTABLE
CMDCMP0: LD DE,BUFER+1 ; First command byte after the * prompt.
LD A,(HL)
CP 000H
@@ -333,13 +336,13 @@ CMDTABLE: DB 000H | 000H | 000H | 002H ; Bit 2
DB 000H | 000H | 000H | 003H
DB "700" ; Switch to 40 column MZ700 mode.
DW SETMODE700
- DB 000H | 000H | 010H | 005H
+ DB 000H | 000H | 000H | 005H
DB "BASIC" ; Load and run BASIC SA-5510.
DW LOADBASIC
- DB 000H | 000H | 000H | 001H
+ DB 000H | 000H | 020H | 001H
DB 'B' ; Bell.
DW SGX
- DB 000H | 000H | 010H | 003H
+ DB 000H | 000H | 000H | 003H
DB "CPM" ; Load and run CPM.
DW LOADCPM
DB 000H | 000H | 018H | 001H
@@ -870,8 +873,8 @@ LOADROMNX: LD L,0FFH
LOADROM: LD L,000H
LOADROM1: DI
PUSH HL ; Preserve execute flag.
-
EX DE,HL ; User ROM expects HL to have the filename pointer.
+
PUSH HL ; Save pointer to filename for FINDMZF in Monitor ROM.
; D = File sequence number.
@@ -1023,13 +1026,26 @@ LROMLOAD9: RET
; Quick method to load CPM. So long as the filename doesnt change this method will load and boot CPM.
LOADCPM: LD DE,CPMFN48 ; Load up the 48K version of CPM
-LOADPROG: LD HL,LOADSDCARD
- CALL BKSW0to2
- RET
+LOADPRGNM: PUSH HL
+ LD HL,BUFER
+LOADPRGNM1: LD A,(DE)
+ LD (HL),A
+ CP CR
+ JR Z,LOADPRGNM2
+ INC DE
+ INC HL
+ JR LOADPRGNM1
+LOADPRGNM2: POP HL
+ LD DE,BUFER
+ JP LOADROM
; Quick method to load the basic interpreter. So long as the filename doesnt change this method will load and boot Basic.
LOADBASIC: LD DE,BASICFILENM
- JR LOADPROG
+ JR LOADPRGNM
+
+LOADPROG: LD HL,LOADSDCARD
+ CALL BKSW0to2
+ RET
;-------------------------------------------------------------------------------
; END OF RFS COMMAND FUNCTIONS.
@@ -1265,8 +1281,8 @@ _CNV_ATOS: PUSH HL
;--------------------------------------
; Quick load program names.
-CPMFN48: DB "CPM223RFS", 00DH
-BASICFILENM:DB "BASIC SA-5510", 00DH
+CPMFN48: DB "CPM223RFS", 00DH
+BASICFILENM:DB "BASIC SA-5510RFS", 00DH
DEFAULTFN: DB "DEFAULT"
DEFAULTFNE: EQU $
diff --git a/software/asm/rfs_bank2.asm b/software/asm/rfs_bank2.asm
index a8893e3..58151ae 100644
--- a/software/asm/rfs_bank2.asm
+++ b/software/asm/rfs_bank2.asm
@@ -230,14 +230,15 @@ SDINIT: LD A,0FFH ; CS to
;
XOR A ; CS to active (low)
CALL SPICS
- LD BC,01FFFH ; Number of retries before giving up, card not responding.
+ LD BC,SD_RETRIES ; Number of retries before giving up, card not responding.
;
SDINIT1: LD A,CMD0 ; Command 0
LD HL,00000H ; NB. Important, HL should be coded as LH due to little endian and the way it is used in SDCMD.
LD DE,00000H ; NB. Important, DE should be coded as ED due to little endian and the way it is used in SDCMD.
- CALL SDCMD
-
PUSH BC
+ ;
+ CALL SDCMD
+ ;
LD A,(SDBUF+6) ; Get response code.
DEC A ; Set Z flag to test if response is 0x01
JP Z,SDINIT2 ; Command response 0x01? Exit if match.
@@ -248,6 +249,7 @@ SDINIT1: LD A,CMD0 ; Comma
JR NZ,SDINIT1 ; Retry for BC times.
LD A,1
JP SD_EXIT ; Error, card is not responding to CMD0
+
SDINIT2: POP BC
; Now send CMD8 to get card details. This command can only be sent
; when the card is idle.
@@ -380,10 +382,24 @@ SDCMD1: PUSH BC
POP BC
DJNZ SDCMD1
PUSH HL
-SDCMD2: CALL SPIIN
+ LD HL,SD_RETRIES
+SDCMD2: PUSH HL
+ CALL SPIIN
+ POP HL
CP 0FFH
- JR Z,SDCMD2
- JR SDCMD4
+ JR NZ,SDCMD4
+ DEC HL
+ LD A,H
+ OR L
+ JR NZ,SDCMD2
+ ;
+ ; Error as we are not receiving data.
+ ;
+ POP HL
+ LD A,1 ; Force return code to be error.
+ LD (SDBUF+6),A
+ RET
+
SDCMD3: PUSH BC
PUSH HL
CALL SPIIN ;
diff --git a/software/asm/rfs_mrom.asm b/software/asm/rfs_mrom.asm
index 6bad62d..80eeac4 100644
--- a/software/asm/rfs_mrom.asm
+++ b/software/asm/rfs_mrom.asm
@@ -287,29 +287,56 @@ INITBNK_1: LD A,(BNKCTRLRST)
; Function to select a User Bank. If Carry is clear upon entry, on exit the control registers will be disabled. If carry is set then the control registers are left active.
;
-SELUSRBNK: PUSH BC
- PUSH AF
- LD A,(ROMCTL) ; Get current setting for the coded latch, ie. number of reads needed to enable it.
- LD C,A
- RRA
- RRA
- CPL
- AND 00FH ; Preserve bits 3-1, bit 0 is always 0 on the 74HCT191 latch.
- LD B,A ; Set value to B for loop.
- LD A,(BNKCTRLDIS)
-SELUSRBNK1:LD A,(BNKSELUSER)
- DJNZ SELUSRBNK1
- POP AF
- LD (BNKSELUSER),A ; Select the required bank.
- LD A,C
- POP BC
- JR NC,SELUSRBNK2 ; If Carry is set by caller then leave the control registers active.
- AND 03FH ; When we leave the registers active, set upper bank bits to 0 to select Flash RAM I, the default.
- LD (BNKCTRL),A
- RET
-SELUSRBNK2:LD (BNKCTRL),A ; Update the upper address lines according to in-memory value.
- LD (BNKCTRLDIS),A ; Disable the control registers, value of A is not important.
- RET
+
+;SELUSRBNK: PUSH BC
+; PUSH AF
+; LD A,(ROMCTL) ; Get current setting for the coded latch, ie. number of reads needed to enable it.
+; LD C,A
+; RRA
+; RRA
+; CPL
+; AND 00FH ; Preserve bits 3-1, bit 0 is always 0 on the 74HCT191 latch.
+; LD B,A ; Set value to B for loop.
+; LD A,(BNKCTRLDIS)
+;SELUSRBNK1:LD A,(BNKSELUSER)
+; DJNZ SELUSRBNK1
+; POP AF
+; LD (BNKSELUSER),A ; Select the required bank.
+; LD A,C
+; POP BC
+; JR NC,SELUSRBNK2 ; If Carry is set by caller then leave the control registers active.
+; AND 03FH ; When we leave the registers active, set upper bank bits to 0 to select Flash RAM I, the default.
+; LD (BNKCTRL),A
+; RET
+;SELUSRBNK2:LD (BNKCTRL),A ; Update the upper address lines according to in-memory value.
+; LD (BNKCTRLDIS),A ; Disable the control registers, value of A is not important.
+; RET
+
+ ; Function to select a User Bank. If Carry is clear upon entry, on exit the control registers will be disabled. If carry is set then the control registers are left active.
+ ; During normal operations the control registers are enabled. When access is needed to the full User ROM space, ie for drive read/write then the registers are disabled after
+ ; setting the correct bank. The upper bits of the User ROM address space (ie. bits 20:19 which select the device) are set to by the ROMCTL variable.
+ ;
+SELUSRBNK: PUSH BC
+ PUSH AF
+ ; Reset to a known state to allow for spurious read/writes to control area clocking the up counter.
+ LD B,15
+SEL1: LD A,(BNKCTRLDIS)
+ DJNZ SEL1
+ ; Now loop for the correct up counter required to enable the latches.
+ LD B,15 ; Set value to B for loop.
+SELUSRBNK1: LD A,(BNKCTRL) ; Read the latch and compare with sample. Either we reach the count limit or the read differs indicating latch control.
+ DJNZ SELUSRBNK1
+ POP AF
+ POP BC
+ LD (BNKSELUSER),A ; Select the required bank.
+ LD A,(ROMCTL)
+ JR NC,SELUSRBNK2
+ AND 03FH ; When we leave the registers active, set upper bank bits to 0 to select Flash RAM I, the default.
+ LD (BNKCTRL),A
+ RET
+SELUSRBNK2: LD (BNKCTRL),A
+ LD (BNKCTRLDIS),A ; Disable the control registers, value of A is not important.
+ RET
; HL contains address of block to check.
@@ -574,7 +601,6 @@ LROMLOAD1: LD A,(HL) ; Issue
LD A,B
OR C
JR NZ,LROMLOAD1
- ;LDIR
PUSH HL
LD DE, (DTADR)
@@ -594,8 +620,6 @@ LROMLOAD2: LD A, B
OR A ; Select the required user bank and Clear carry so that the control registers are disabled.
CALL SELUSRBNK
- ; LD (BNKCTRLDIS),A ; Disable the control registers, value of A is not important.
-
LROMLOAD3: PUSH BC
LD HL, 0E800h
LD A, C
@@ -625,7 +649,8 @@ LROMLOAD4: LD (TMPSIZE), HL ; HL co
OR C
JR Z, LROMLOAD8
-LROMLOAD9: LD A,(HL) ; Issues with LDIR and a signal artifact from the mainboard, so manual copy.
+LROMLOAD9: LD (BNKCTRLDIS),A ; There exists an issue with using the mainboard decoder signal which I havent quite understood, random activation of the upcounter occurs which appears to be the refresh circuit.
+ LD A,(HL) ; Issues with LDIR and a signal artifact from the mainboard, so manual copy.
INC HL
LD (DE),A
INC DE
@@ -633,7 +658,6 @@ LROMLOAD9: LD A,(HL) ; Issue
LD A,B
OR C
JR NZ,LROMLOAD9
- ;LDIR
LD BC, (TMPSIZE)
LD A, B ; Post check to ensure we still have bytes
@@ -645,7 +669,7 @@ LROMLOAD9: LD A,(HL) ; Issue
LROMLOAD6: INC C
LD A, C
CP UROMSIZE/RFSSECTSZ ; Max blocks per page reached?
- JR C, LROMLOAD3 ;LROMLOAD7
+ JR C, LROMLOAD2 ;LROMLOAD3 ;LROMLOAD7
LD C, 0
INC B
;
diff --git a/software/build.sh b/software/build.sh
index 43351f1..f4807b0 100755
--- a/software/build.sh
+++ b/software/build.sh
@@ -12,12 +12,7 @@ fi
cd $SW_DIR
tools/assemble_rfs.sh
if [ $? != 0 ]; then
- echo "TZFS assembly failed..."
- exit 1
-fi
-tools/assemble_roms.sh
-if [ $? != 0 ]; then
- echo "ROMS assembly failed..."
+ echo "RFS assembly failed..."
exit 1
fi
tools/assemble_cpm.sh
@@ -25,6 +20,11 @@ if [ $? != 0 ]; then
echo "CPM assembly failed..."
exit 1
fi
+tools/assemble_roms.sh
+if [ $? != 0 ]; then
+ echo "ROMS assembly failed..."
+ exit 1
+fi
# Only needed if the program source tree changes, takes too long to run on every build!
if [ ${PROCESS_MFZ_FILES} != 1 ]; then
diff --git a/software/roms/MROM_256.bin b/software/roms/MROM_256.bin
index 91a5403..229a998 100644
Binary files a/software/roms/MROM_256.bin and b/software/roms/MROM_256.bin differ
diff --git a/software/roms/USER_ROM_256.bin b/software/roms/USER_ROM_256.bin
index cc36025..84c1ae3 100644
Binary files a/software/roms/USER_ROM_256.bin and b/software/roms/USER_ROM_256.bin differ
diff --git a/software/roms/cbios.rom b/software/roms/cbios.rom
index 80eb860..09d9346 100644
Binary files a/software/roms/cbios.rom and b/software/roms/cbios.rom differ
diff --git a/software/roms/cbios_bank2.rom b/software/roms/cbios_bank2.rom
index a9e94ba..787d806 100644
Binary files a/software/roms/cbios_bank2.rom and b/software/roms/cbios_bank2.rom differ
diff --git a/software/roms/cbios_bank3.rom b/software/roms/cbios_bank3.rom
index 329f4dc..bfde52a 100644
Binary files a/software/roms/cbios_bank3.rom and b/software/roms/cbios_bank3.rom differ
diff --git a/software/roms/cbios_bank4.rom b/software/roms/cbios_bank4.rom
index e54bc4e..0e148d9 100644
Binary files a/software/roms/cbios_bank4.rom and b/software/roms/cbios_bank4.rom differ
diff --git a/software/roms/rfs.rom b/software/roms/rfs.rom
index fac6d3c..b87df14 100644
Binary files a/software/roms/rfs.rom and b/software/roms/rfs.rom differ
diff --git a/software/roms/rfs_mrom.rom b/software/roms/rfs_mrom.rom
index c7f0e83..f96ea07 100644
Binary files a/software/roms/rfs_mrom.rom and b/software/roms/rfs_mrom.rom differ
diff --git a/software/tools/make_roms.sh b/software/tools/make_roms.sh
index f19e454..1117cff 100755
--- a/software/tools/make_roms.sh
+++ b/software/tools/make_roms.sh
@@ -15,6 +15,8 @@
##
## History: January 2020 - Initial script written.
## March 2021 - Updates for the RFS v2.1 board.
+## April 2021 - Removed the CPM ROM Drive functionality as it provided no benefit
+## over SD card and SD cards are larger.
##
#########################################################################################################
## This source file is free software: you can redistribute it and#or modify
@@ -36,7 +38,7 @@ MZB_PATH=${ROOTDIR}/software/MZB
ROM_PATH=${ROOTDIR}/software/roms/
ROM_LIST_FILE=/tmp/ROMLIST
SECTORSIZE=256
-CPMDISKMODE=SPLIT
+#CPMDISKMODE=SPLIT
MZFTOOL=${ROOTDIR}/software/tools/mzftool.pl
MONITOR_ROM=/tmp/mrom.rom
USER_ROM_I=/tmp/user.rom
@@ -72,29 +74,29 @@ cat ${MZB_PATH}/Common/cpm22.${SECTORSIZE}.bin >> ${USER_ROM_I}
# According to flag set above, either put the CPM Disks in the first ROM, or place one in each ROM allowing for better write spread and larger disks.
#
-if [ "${CPMDISKMODE}" != "SPLIT" ]; then
- # CPM RFS Disks currently only in User ROM.
- for f in 1 2
- do
- if [ -f ${MZB_PATH}/Common/CPM_RFS_${f}.${SECTORSIZE}.bin ]; then
- echo "cat ${MZB_PATH}/Common/CPM_RFS_${f}.${SECTORSIZE}.bin >> ${USER_ROM_I}"
- cat ${MZB_PATH}/Common/CPM_RFS_${f}.${SECTORSIZE}.bin >> ${USER_ROM_I}
- basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
- fi
- done
-else
- if [ -f ${MZB_PATH}/Common/CPM_RFS_1.${SECTORSIZE}.bin ]; then
- echo "cat ${MZB_PATH}/Common/CPM_RFS_1.${SECTORSIZE}.bin >> ${USER_ROM_I}"
- cat ${MZB_PATH}/Common/CPM_RFS_1.${SECTORSIZE}.bin >> ${USER_ROM_I}
- basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
- fi
-
- if [ -f ${MZB_PATH}/Common/CPM_RFS_2.${SECTORSIZE}.bin ]; then
- echo "cat ${MZB_PATH}/Common/CPM_RFS_2.${SECTORSIZE}.bin >> ${USER_ROM_II}"
- cat ${MZB_PATH}/Common/CPM_RFS_2.${SECTORSIZE}.bin >> ${USER_ROM_II}
- basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
- fi
-fi
+#if [ "${CPMDISKMODE}" != "SPLIT" ]; then
+# # CPM RFS Disks currently only in User ROM.
+# for f in 1 2
+# do
+# if [ -f ${MZB_PATH}/Common/CPM_RFS_${f}.${SECTORSIZE}.bin ]; then
+# echo "cat ${MZB_PATH}/Common/CPM_RFS_${f}.${SECTORSIZE}.bin >> ${USER_ROM_I}"
+# cat ${MZB_PATH}/Common/CPM_RFS_${f}.${SECTORSIZE}.bin >> ${USER_ROM_I}
+# basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
+# fi
+# done
+#else
+# if [ -f ${MZB_PATH}/Common/CPM_RFS_1.${SECTORSIZE}.bin ]; then
+# echo "cat ${MZB_PATH}/Common/CPM_RFS_1.${SECTORSIZE}.bin >> ${USER_ROM_I}"
+# cat ${MZB_PATH}/Common/CPM_RFS_1.${SECTORSIZE}.bin >> ${USER_ROM_I}
+# basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
+# fi
+#
+# if [ -f ${MZB_PATH}/Common/CPM_RFS_2.${SECTORSIZE}.bin ]; then
+# echo "cat ${MZB_PATH}/Common/CPM_RFS_2.${SECTORSIZE}.bin >> ${USER_ROM_II}"
+# cat ${MZB_PATH}/Common/CPM_RFS_2.${SECTORSIZE}.bin >> ${USER_ROM_II}
+# basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
+# fi
+#fi
# Manually choose the programs you want installed into the ROMS. The files will be first placed into the USER ROM and when full into the
# Monitor ROM. Thus order is important if you want a particular program in a particular ROM.
@@ -105,13 +107,40 @@ ROM_INCLUDE=""
#
# Common
#
-ROM_INCLUDE+="${MZB_PATH}/Common/A-BASIC_SA-5510.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/SA-5510_RFS.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/BASIC_SA5510.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/BASIC_SA6510.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/MSBASIC_MZ80A.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/MSBASIC_RFS.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/SA-5510_COMPILER.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/BAS_MOD_V374.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/XPATCH_5510_V2.2.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/BASIC_SP5025.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/BASIC_SP5030.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/BASIC_SP-5035MC.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/SOLO_BASIC.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/BASIC_OM-500.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/BASIC_OM-1000.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/BASIC_OM-1001.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/HU-BASIC_V1.3_K.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/HUCOMPILMC.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/COMPILER_A2.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/EXPRESS_COMPILER.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/K_A_CONVERTER.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/HISOFT_PASCAL4.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/Z80ASSEMBLER2MC.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/EDITOR-ASSEMBLER_SP2202MC.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/ZEN.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/8048_CPU_DISAS.MC.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/6502BETRMC.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/6502DEMO2MC.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/6502DEMOMC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/FORTRANSOSZ80.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/MZ700_FORTH1.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/Common/SA-5510_COMPILER.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/Common/XPATCH_5510_V2.2.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/Common/RFSBASIC.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/KNIFORTH.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/TINYLISPMC.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/APOLLO_WORD_1.9MMC_.${SECTORSIZE}.bin:"
+ROM_INCLUDE+="${MZB_PATH}/Common/HUCALC_80A_M.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/SEND-1.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/Common/APOLLO_CHESS_V2A.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/Common/5Z009-1B.MZF:"
@@ -123,7 +152,7 @@ ROM_INCLUDE+="${MZB_PATH}/Common/APOLLO_CHESS_V2A.${SECTORSIZE}.bin:"
#
# MZ-80A
#
-ROM_INCLUDE+="${MZB_PATH}/MZ-80A/SA-6510.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/SA-6510.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/3-D_MAZE.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/80A_PENCIL.A2_C2.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/80A_PENCIL.A2_S.${SECTORSIZE}.bin:"
@@ -135,7 +164,7 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-80A/ALIEN_ATTACK_MACHINECODE.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/ALIEN_EAGLE.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/ALLIGATOR.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/APOLLO_CHESS_V2A.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BASIC80A.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BASIC80A.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BASIC_SA-5510.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BASIC.SA-5510.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/BLOCKING.${SECTORSIZE}.bin:"
@@ -169,9 +198,9 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-80A/GALAXY_INVADERS.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/GREEDY_GREMLINS.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/HANGMAN2.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/HORSE_RACE2.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80A/HUCALC_80A_C2.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80A/HUCALC_80A_M.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80A/HUCALC_80A_S.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/HUCALC_80A_C2.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/HUCALC_80A_M.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80A/HUCALC_80A_S.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/LAND_ESCAPE.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/LASER_DEFENCE.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80A/LE_MANS.${SECTORSIZE}.bin:"
@@ -222,10 +251,10 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-80A/WITCHES.${SECTORSIZE}.bin:"
#
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/3DSPACECBASIC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/3-D_WAY_OUT_BBG_SOFTWARE.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80K/6502BETRMC.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80K/6502DEMO2MC.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80K/6502DEMOMC.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80K/8048_CPU_DISAS.MC.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/6502BETRMC.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/6502DEMO2MC.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/6502DEMOMC.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/8048_CPU_DISAS.MC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/A-BASIC_SA-5510.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/ABENTEUEBASIC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/ADVANCE-GUARDMC.${SECTORSIZE}.bin:"
@@ -233,7 +262,7 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-80K/ADVANCE_GUARD_WICS_1983.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/AIMEMC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/ALIENMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/ANDROMEDAMC.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80K/APOLLO_WORD_1.9MMC_.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/APOLLO_WORD_1.9MMC_.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/ASCII_GAMEBASIC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/ATCF_DATAMC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/ATTACKERSCRAMBLEMC.${SECTORSIZE}.bin:"
@@ -271,7 +300,7 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-80K/COWBOY_DUELMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/DEFEND_THE_CITYBASIC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/DON_CHACKBASIC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/DONKEY_DERBY.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80K/EDITOR-ASSEMBLER_SP2202MC.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/EDITOR-ASSEMBLER_SP2202MC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/ELEKTRONIC_MUSICMC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/EMPIRE_CLIMBERMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/EMPIRE_CLIMBER_WICS.${SECTORSIZE}.bin:"
@@ -291,8 +320,8 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-80K/FORTH_SIMULATORBASIC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/GOMOKUMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/HAT_THE_BOXBASIC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/HOME_BUDGET_MK2BASIC.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80K/HUCOMPILERMC.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80K/HUCOMPILMC.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/HUCOMPILERMC.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/HUCOMPILMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/IDENTI-KIT.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/JAMPACMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/JINTORIMC.${SECTORSIZE}.bin:"
@@ -323,7 +352,7 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-80K/NOTUTORIBASIC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/OTHELLOMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/OTORI_ATTACKMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/PACMANMC.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80K/PASCAL_SP-6610MC.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/PASCAL_SP-6610MC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/PHOENIXMC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/PRINTMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/PUCKMANMC.${SECTORSIZE}.bin:"
@@ -372,7 +401,7 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-80K/TEN-PIN_BOWLING.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/TEST_MATCH.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/THE_MUNCHIES_C_SMITH.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/TIME_BOMBBASIC.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80K/TINYLISPMC.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/TINYLISPMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/TOMAHAWK_HIROSHI_MASUKO.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/TOMAHAWKMC.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-80K/TOWERINGMC.${SECTORSIZE}.bin:"
@@ -396,7 +425,7 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-80K/VOICEMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/WILHELM-TELLMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/WILLHELM_TELLMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/YAKYUKENBASIC.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-80K/Z80ASSEMBLER2MC.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/Z80ASSEMBLER2MC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/ZARDOSMC.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/ZARDOS_MZ_SOFT_GROUP.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-80K/ZEICHENGMC.${SECTORSIZE}.bin:"
@@ -510,7 +539,7 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-700/1Z-013B.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-700/KASBOEK.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-700/K-BASIC_V.5.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-700/KENTUCKY_DERBY.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-700/KNIFORTH.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-700/KNIFORTH.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-700/KNIGHT'S_CASTLE.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-700/KNIGHTS_UFO.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-700/KP_DBASIC.800B.${SECTORSIZE}.bin:"
@@ -660,7 +689,7 @@ ROM_INCLUDE+="${MZB_PATH}/MZ-700/KUMA_INTERPR..${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-700/XBC_F_1_02.${SECTORSIZE}.bin:"
#ROM_INCLUDE+="${MZB_PATH}/MZ-700/YAMS.${SECTORSIZE}.bin:"
ROM_INCLUDE+="${MZB_PATH}/MZ-700/Z80_DESASSEMBLEUR.${SECTORSIZE}.bin:"
-ROM_INCLUDE+="${MZB_PATH}/MZ-700/ZEN.${SECTORSIZE}.bin:"
+#ROM_INCLUDE+="${MZB_PATH}/MZ-700/ZEN.${SECTORSIZE}.bin:"
# Set the pointer which indicates the next ROM to be filled with applications.
GENROM=0
@@ -675,30 +704,32 @@ do
if [ ${FILETYPE} == 1 ]; then
+ # Fill the User ROM as these get listed first.
if (( ${GENROM} == 0 )); then
- cat ${MONITOR_ROM} "${f}" > /tmp/tmp.size
- FILESIZE=$(stat -c%s "/tmp/tmp.size")
- if (( ${FILESIZE} < 524288 )); then
- echo "Adding $f to Monitor Rom"
- cat "${f}" >> ${MONITOR_ROM}
- basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
- else
- GENROM=1
- fi
- fi
-
- if (( ${GENROM} == 1 )); then
cat ${USER_ROM_I} "${f}" > /tmp/tmp.size
FILESIZE=$(stat -c%s "/tmp/tmp.size")
if (( ${FILESIZE} < 524288 )); then
echo "Adding $f to User I Rom"
cat "${f}" >> ${USER_ROM_I}
basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
+ else
+ GENROM=1
+ fi
+ fi
+
+ if (( ${GENROM} == 1 )); then
+ cat ${MONITOR_ROM} "${f}" > /tmp/tmp.size
+ FILESIZE=$(stat -c%s "/tmp/tmp.size")
+ if (( ${FILESIZE} < 524288 )); then
+ echo "Adding $f to Monitor Rom"
+ cat "${f}" >> ${MONITOR_ROM}
+ basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
else
GENROM=2
fi
fi
+ # User ROM II and III are optional.
if (( ${GENROM} == 2 )); then
cat ${USER_ROM_II} "${f}" > /tmp/tmp.size
FILESIZE=$(stat -c%s "/tmp/tmp.size")