From 783f853d09ff064e9b4c3be8a106c9ddd604f12f Mon Sep 17 00:00:00 2001 From: Philip Smart Date: Wed, 29 Jul 2020 14:01:21 +0100 Subject: [PATCH] Updates for v2.1 of the tranZPUter board and bug fixes --- software/asm/include/RFS_Definitions.asm | 13 +++-- software/asm/rfs.asm | 17 ++++-- software/asm/rfs_bank2.asm | 67 ++++++++++++++-------- software/asm/rfs_bank6.asm | 69 ++++++++++++----------- software/roms/USER_ROM_256.bin | Bin 576512 -> 576512 bytes software/roms/rfs.rom | Bin 16384 -> 16384 bytes 6 files changed, 101 insertions(+), 65 deletions(-) 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 c7abecf59d7086c1a2507a63e7c9a38f234c590b..3a1cc794ca72caaf7d76ed4e3a3ea6059f7d5fd4 100644 GIT binary patch delta 1197 zcmYjQe`p(39KUyWIUBdO_tGC;vasDXMX!PAK z@4fHm^L^hpKH(alaJ_dL6waR!t>udnxN@&n7SCUAbq7Q?DOzBM!BJ2&gmaqOrwKPT zRnk-|p}18W0Y8Q+MF_7W8wkfn^mNuZYMRb-v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k-%rzC=NnIgQ|JSCtmUk=nyraZfVZLm$Aj)o6?FnO>WDr>Na1W%#{WmVkG5Uy?$o4e&~R z0aWx|^FG{NwRwcZT@gG2_!z}J9pTr?(GAW9ybxre0hg^H4Og+bY7LOER@zQ3=@C?6 zc{iH(Av}eydP2?aa=rK+zPQQ~1Mmj=({p>zOYUcw`~9b diff --git a/software/roms/rfs.rom b/software/roms/rfs.rom index e37a2141e1a24f0e986570d63878ff62853634ca..a3d5026448026753e8c6236beb970927531b5dfa 100644 GIT binary patch delta 1178 zcmY*YZ)_7~9Dd*H^|A`x?(P0~Ee+gl3*MSkujl@>4Vy(Q!Y37FFCUCqBA_2|YLJxBWIn+*{ZMqsdV%n>P-5=^Pr>tbvAJ**G-^HP{~0Vemzr>=K0FySmNn zruD||y|IY=kpa7JYxVNrbDtP)c~W!t{H3~jv6|R}r8o!BtN` z(kw@QktW2oMP*Ev>|zrw{#}-cJ4fdLu)sM9SRkGzzJYOk*tP@S#BbYzY|>zD%`8pT z)Pg23Dl+Q_vw04Hlh4)yhjJ7DX7fWHBhm+N;a#L#Xe+^obd^Wg+Wj!2jDXvX#!}d- zYCxL2Y()0N&g<4uXU$c*`OQ>(5|75mi*2Bg8V09S@ zq;m>sumj`wlW*pg&x&cbE<*wIhn2W(gQ^5_Xm%rh63n5`%M6V!mzgd2!^Ryjf@c~J zw*J@RpHYQ?fDlNd|0m>IKr70WzM7t$!tG71T_;N62XqCpoawHHsFIIF1#?(1`UzBZ zA!9NUS5OXlOVtHt871+1O+sV$#)9dQiRTLx=tm3q`=)CSHz~&^C4?JmuffU)Xk07Pp dBO>naIx`tufDqpc2F!MA=n#adS3@6A{{Z%K+0_65 delta 1031 zcmX|AZ)h837{BK(cO=+u_oit~+S=WvWxItH(sOGr!QG~5N4tjV+E4>yViAXe+nfV! zrGHXE@QcId9XLeCR0MU%7#RfmVHmT3S2-b!jJhwgO1isiE@>HlaMi2Vr1i`DKJWW` z-rw_ke((FHQjki)C-d-d;RB)R#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