diff --git a/software/asm/include/RFS_Definitions.asm b/software/asm/include/RFS_Definitions.asm index 3327102..cb50e26 100644 --- a/software/asm/include/RFS_Definitions.asm +++ b/software/asm/include/RFS_Definitions.asm @@ -9,10 +9,13 @@ ;- Credits: ;- Copyright: (c) 2019-20 Philip Smart ;- -;- History: Sep 2019 - Initial version. -; May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the -; additional and different hardware. The SPI is now onboard the PCB and -; not using the printer interface card. +;- History: Sep 2019 - Initial version. +; May 2020 - Advent of the new RFS PCB v2.0, quite a few changes to accommodate the +; additional and different hardware. The SPI is now onboard the PCB and +; not using the printer interface card. +; 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. ;- ;-------------------------------------------------------------------------------------------------------- ;- This source file is free software: you can redistribute it and-or modify @@ -444,7 +447,7 @@ TMPLINECNT: EQU 01022H ; Tempo TMPSTACKP: EQU 01024H ; Temporary stack pointer save. SDVER: EQU 01026H SDCAP: EQU 01027H -TZPU: EQU 01027H ; Tranzputer present flag (0 = not present, > 0 = present and version number). +TZPU: EQU 01028H ; Tranzputer present flag (0 = not present, > 0 = present and version number). ; Variables sharing the BUFER buffer, normally the BUFER is only used to get keyboard input and so long as data in BUFER is processed ; before calling the CMT/SD commands and not inbetween there shouldnt be any issue. Also the space used is at the top end of the buffer which is not used so often. ; This frees up memory needed by the CMT and SD card. diff --git a/software/asm/rfs.asm b/software/asm/rfs.asm index d3ce094..0d1e518 100644 --- a/software/asm/rfs.asm +++ b/software/asm/rfs.asm @@ -17,6 +17,9 @@ ; only enable the control registers if a fixed number of reads is made ; into the upper 8 bytes which normally wouldnt occur. Caveat - ensure ; that no loop instruction is ever placed into EFF8H - EFFFH. +; 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. ;- ;-------------------------------------------------------------------------------------------------------- ;- This source file is free software: you can redistribute it and-or modify @@ -163,11 +166,9 @@ ROMFS_3: LD (BNKSELMROM),A ; start ; Replacement command processor in place of the SA1510 command processor. ; MONITOR: IN A,(CPLDINFO) ; See if a tranZPUter board is present. - LD C,A - AND 0A0H ; First nibble needs to be an A if the device is present. CP 0A0H - JR NZ,CHKTZ1 - LD A,C + JR NC,CHKTZ1 + XOR A CHKTZ1: AND 00FH LD (TZPU), A ; Flag = 0 if no tranZPUter present otherwise contains version (1 - 15). ; @@ -196,7 +197,7 @@ SIGNON1: CALL DPCT DEC E JR NZ,SIGNON1 ; - LD A,C + LD A,(TZPU) OR A JR Z,SIGNON2 LD DE,MSGSONTZ @@ -298,9 +299,15 @@ CMDTABLE: DB 000H | 000H | 000H | 001H ; Bit 2 DB 000H | 000H | 000H | 003H DB "700" ; Switch to 40 column MZ700 mode. DW SETMODE700 + DB 000H | 000H | 010H | 005H + DB "BASIC" ; Load and run BASIC SA-5510. + DW LOADBASIC DB 000H | 000H | 000H | 001H DB 'B' ; Bell. DW SGX + DB 000H | 000H | 010H | 003H + DB "CPM" ; Load and run CPM. + DW LOADCPM DB 000H | 000H | 018H | 001H DB 'C' ; Clear Memory. DW INITMEMX diff --git a/software/asm/rfs_bank2.asm b/software/asm/rfs_bank2.asm index 47ae7e1..eb952f8 100644 --- a/software/asm/rfs_bank2.asm +++ b/software/asm/rfs_bank2.asm @@ -17,6 +17,10 @@ ; only enable the control registers if a fixed number of reads is made ; into the upper 8 bytes which normally wouldnt occur. Caveat - ensure ; that no loop instruction is ever placed into EFF8H - EFFFH. +; July 2020 - Bug fixes and additions. +; 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. ;- ;-------------------------------------------------------------------------------------------------------- ;- This source file is free software: you can redistribute it and-or modify @@ -1076,7 +1080,12 @@ FINDSDX: PUSH DE JR C, FINDSDX1 ; LD L,A LD H,0 - LD (TMPCNT), HL ; Store filenumber making load by filenumber valid. + LD A,(DE) ; Before comitting the file number verify it is actually a 2 digit hex string. + CP 00DH + JR Z,FINDSDX0 + OR A + JR NZ,FINDSDX1 +FINDSDX0: LD (TMPCNT), HL ; Store filenumber making load by filenumber valid. FINDSDX1: POP DE ; Method to locate an entry in the SD directory based on a filenumber or a filename. @@ -1094,7 +1103,7 @@ FINDSD2: BIT 7,(HL) ; Is th JR Z,FINDSD3 PUSH HL LD HL,(TMPCNT) - LD H,(HL) + ;LD H,(HL) LD A,H CP 0FFH LD A,L @@ -1105,36 +1114,36 @@ FINDSD2: BIT 7,(HL) ; Is th INC D FINDSD3: INC E DJNZ FINDSD1 - POP DE + POP DE ; No match, waste pointer to input string and exit with 1. LD A,1 JP FINDSD10 ; We didnt find a match so exit with code 1. - -FINDSD4: POP DE ; Get back pointer to given filename. HL contains directory filename. - PUSH DE - PUSH BC ; Save BC as we need it for comparison. + ; +FINDSD4: LD (TMPADR), DE ; Save current directory position and file number. + POP DE ; Get back pointer to given filename. HL contains directory filename. + PUSH DE ; Save DE as the pointer will be needed on next loop. + PUSH BC ; Save directory count. + ; LD B,SDDIR_FNSZ INC HL INC HL ; Hop over flags. -FINDSD5: LD A,(HL) - LD (DE),A +FINDSD5: LD A,(DE) + CP (HL) + JR NZ,FINDSD8 ; Mot a match. CP 00Dh ; If we find a terminator then this is a valid name. JR Z, FINDSD9A - CP 020h ; >= Space - JR C, FINDSD8 - CP 05Dh ; =< ] - JR C, FINDSD6 - CP 091h - JR C, FINDSD8 ; DEL or > 0x7F, cant be a valid filename so this is not an MZF header. FINDSD6: INC DE INC HL - DJNZ FINDSD5 -FINDSD7: LD A,B - CP SDDIR_FNSZ - JR Z,FINDSD9 ; If we matched all FNSIZE characters then this is a valid name. -FINDSD8: POP BC ; No match on filename so go back for next directory entry. - POP DE + DJNZ FINDSD5 ; Loop for all the filename characters until terminator or difference found. + JR FINDSD9 ; If we matched all FNSIZE characters then this is a valid name. + + ; No match. +FINDSD8: POP BC ; Retrieve the directory count for next entry, + LD DE,(TMPADR) ; Retrieve the directory position and file number. JR FINDSD3 -FINDSD9A: POP BC + + ; Match +FINDSD9A: POP BC ; Waste the directory count. + LD DE,(TMPADR) ; Retrieve the directory position and file number. FINDSD9: POP BC ; Waste the pointer to the input string. LD A,0 ; D contains the filenumber. FINDSD10: OR A @@ -1168,6 +1177,13 @@ ERASESD1: LD DE,MSGERAFAIL ; Fail, LD A,1 RET + ; 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 LOADSDCARD + + ; 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 + JR LOADSDCARD ; Entry point when copying the SD file. Setup flags to indicate copying to effect any special processing. ; The idea is to load the file into memory, dont execute and pass back the parameters within the CMT header. @@ -1471,8 +1487,13 @@ SAVESD9: LD DE,MSGSVFAIL ; Fail, ;-------------------------------------- ; ; Message table - Refer to Bank 6 for - ; messages. + ; all printable messages. ; ;-------------------------------------- + + ; Quick load program names. +CPMFN48: DB "CPM223RFS", 00DH +BASICFILENM:DB "BASIC SA-5510", 00DH + ALIGN 0EFFFh DB 0FFh diff --git a/software/asm/rfs_bank6.asm b/software/asm/rfs_bank6.asm index 77c8d24..e86fa5d 100644 --- a/software/asm/rfs_bank6.asm +++ b/software/asm/rfs_bank6.asm @@ -17,6 +17,9 @@ ; only enable the control registers if a fixed number of reads is made ; into the upper 8 bytes which normally wouldnt occur. Caveat - ensure ; that no loop instruction is ever placed into EFF8H - EFFFH. +; 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. ;- ;-------------------------------------------------------------------------------------------------------- ;- This source file is free software: you can redistribute it and-or modify @@ -278,7 +281,9 @@ HELPSCR: DB "4 - 40 col mode.", 00DH DB "700 - Select MZ-700 Mode.", 00DH DB "7008 - Select MZ-700 80 col Mode.", 00DH DB "B - toggle keyboard bell.", 00DH + DB "BASIC - Load BASIC SA-5510.", 00DH DB "C - clear memory $1200-$D000.", 00DH + DB "CPM - Load CPM.", 00DH DB "DXXXX[YYYY] - dump mem XXXX to YYYY.", 00DH DB "EC[FN]- erase file, FN=No, or Filename", 00DH DB "F[X] - boot fd drive X.", 00DH @@ -442,39 +447,39 @@ ATBL: DB 0CCH ; NUL '\0' (null character) ; Message table ; ;-------------------------------------- -MSGSON: DB "+ RFS ", 0ABh, "2.0 **" ,00DH, 000H ; Version 2.0-> as we are now using the v2.x PCB with 4 devices on-board -MSGSONTZ: DB "+ TZ+RFS ", 0ABh, "2.0 **" ,00DH, 000H ; Version 2.0 with version 2.1+ of tranZPUter board installed. -MSGNOTFND: DB "Not Found", 00DH, 000H -MSGRDIRLST: DB "ROM Directory:", 00DH, 000H -MSGTRM: DB 00DH, 000H -MSGBADCMD: DB "???", 00DH, 000H -MSGCDIRLST: DB "SD Card Directory:", 00DH, 000H -MSGSDRERR: DB "SD Read error, Sec:",0FBH, 000H -MSGSDWERR: DB "SD Write error, Sec:",0FBH, 000H -MSGSVFAIL: DB "SD Error, save failed.", 00DH, 000H -MSGERAFAIL: DB "SD Dir update failed.", 00DH, 000H -MSGSVDIRENT:DB "Saving into dir entry:",0FBH, 00DH, 000H -MSGERASEDIR:DB "Deleted dir entry:",0FBH, 000H +MSGSON: DB "+ RFS ", 0ABh, "2.1 **", 00DH, 000H ; Version 2.0-> as we are now using the v2.x PCB with 4 devices on-board +MSGSONTZ: DB "+ TZ+RFS ", 0ABh, "2.0 **", 00DH, 000H ; Version 2.0 with version 2.1+ of tranZPUter board installed. +MSGNOTFND: DB "Not Found", 00DH, 000H +MSGRDIRLST: DB "ROM Directory:", 00DH, 000H +MSGTRM: DB 00DH, 000H +MSGBADCMD: DB "???", 00DH, 000H +MSGCDIRLST: DB "SD Card Directory:", 00DH, 000H +MSGSDRERR: DB "SD Read error, Sec:",0FBH, 000H +MSGSDWERR: DB "SD Write error, Sec:",0FBH, 000H +MSGSVFAIL: DB "SD Error, save failed.", 00DH, 000H +MSGERAFAIL: DB "SD Dir update failed.", 00DH, 000H +MSGSVDIRENT:DB "Saving into dir entry:",0FBH, 00DH, 000H +MSGERASEDIR:DB "Deleted dir entry:",0FBH, 000H MSGCMTDATA: DB "Load:",0FEH,",Exec:",0FFH, ",Size:",0FBH, 00DH, 000H -MSGNOTBIN: DB "Not binary", 00DH, 000H -MSGLOAD: DB 00DH, "Loading ",'"',0FAH,'"', 00DH, 000H -MSGSAVE: DB 00DH, "Filename: ", 000H -MSGDIRFULL: DB "Directory full", 00DH, 000H -MSGE1: DB 00DH, "Check sum error!", 00DH, 000H ; Check sum error. -MSGCMTWRITE:DB 00DH, "Writing ", '"',0FAH,'"', 00DH, 000H -MSGOK: DB 00DH, "OK!", 00DH, 000H -MSGSAVEOK: DB "Tape image saved.", 00DH, 000H -MSGBOOTDRV: DB 00DH, "Floppy boot drive ?", 000H -MSGLOADERR: DB 00DH, "Disk loading error", 00DH, 000H -MSGIPLLOAD: DB 00DH, "Disk loading ", 000H -MSGDSKNOTMST:DB 00DH, "This is not a boot disk",00Dh, 000H -MSGINITM: DB "Init memory", 00DH, 000H -MSGREAD4HEX:DB "Bad hex number", 00DH, 000H -MSGT2SDERR: DB "Copy from Tape to SD Failed", 00DH, 000H -MSGSD2TERR: DB "Copy from SD to Tape Failed", 00DH, 000H -MSGT2SDOK: DB "Success, Tape to SD done.", 00DH, 000H -MSGSD2TOK: DB "Success, SD to Tape done.", 00DH, 000H -MSGNOTZINST:DB "No tranZPUter card installed.",00DH, 000H +MSGNOTBIN: DB "Not binary", 00DH, 000H +MSGLOAD: DB 00DH, "Loading ",'"',0FAH,'"', 00DH, 000H +MSGSAVE: DB 00DH, "Filename: ", 000H +MSGDIRFULL: DB "Directory full", 00DH, 000H +MSGE1: DB 00DH, "Check sum error!", 00DH, 000H ; Check sum error. +MSGCMTWRITE:DB 00DH, "Writing ", '"',0FAH,'"', 00DH, 000H +MSGOK: DB 00DH, "OK!", 00DH, 000H +MSGSAVEOK: DB "Tape image saved.", 00DH, 000H +MSGBOOTDRV: DB 00DH, "Floppy boot drive ?", 000H +MSGLOADERR: DB 00DH, "Disk loading error", 00DH, 000H +MSGIPLLOAD: DB 00DH, "Disk loading ", 000H +MSGDSKNOTMST:DB 00DH, "This is not a boot disk", 00Dh, 000H +MSGINITM: DB "Init memory", 00DH, 000H +MSGREAD4HEX:DB "Bad hex number", 00DH, 000H +MSGT2SDERR: DB "Copy from Tape to SD Failed", 00DH, 000H +MSGSD2TERR: DB "Copy from SD to Tape Failed", 00DH, 000H +MSGT2SDOK: DB "Success, Tape to SD done.", 00DH, 000H +MSGSD2TOK: DB "Success, SD to Tape done.", 00DH, 000H +MSGNOTZINST:DB "No tranZPUter >=v2 card installed.", 00DH, 000H ALIGN 0EFFFh DB 0FFh diff --git a/software/roms/USER_ROM_256.bin b/software/roms/USER_ROM_256.bin index c7abecf..3a1cc79 100644 Binary files a/software/roms/USER_ROM_256.bin and b/software/roms/USER_ROM_256.bin differ diff --git a/software/roms/rfs.rom b/software/roms/rfs.rom index e37a214..a3d5026 100644 Binary files a/software/roms/rfs.rom and b/software/roms/rfs.rom differ