diff --git a/Doc/ChangeLog.txt b/Doc/ChangeLog.txt index e7d42423..7a3861a1 100644 --- a/Doc/ChangeLog.txt +++ b/Doc/ChangeLog.txt @@ -58,6 +58,8 @@ Version 3.1.1 - LWN: Substantial BPBIOS cleanup - AJL: Add ZMD adaptation - D?T: Substantial update to TastyBasic incuding a .COM executable +- PMS: Added VGM audio file player +- WBW: ZPMLDR and ZPM3 fixes, credit to Lars Nelson for finding ZPM3 source! Version 3.1 ----------- diff --git a/Doc/ROM Applications.pdf b/Doc/ROM Applications.pdf index be61eaa6..bdf95a31 100644 Binary files a/Doc/ROM Applications.pdf and b/Doc/ROM Applications.pdf differ diff --git a/Doc/RomWBW Applications.pdf b/Doc/RomWBW Applications.pdf index 0b8495cf..b1611059 100644 Binary files a/Doc/RomWBW Applications.pdf and b/Doc/RomWBW Applications.pdf differ diff --git a/Doc/RomWBW Architecture.pdf b/Doc/RomWBW Architecture.pdf index e0055961..7e5baed7 100644 Binary files a/Doc/RomWBW Architecture.pdf and b/Doc/RomWBW Architecture.pdf differ diff --git a/Doc/RomWBW Disk Catalog.pdf b/Doc/RomWBW Disk Catalog.pdf index 9037645c..93265d75 100644 Binary files a/Doc/RomWBW Disk Catalog.pdf and b/Doc/RomWBW Disk Catalog.pdf differ diff --git a/Doc/RomWBW Getting Started.pdf b/Doc/RomWBW Getting Started.pdf index b73abada..ac015941 100644 Binary files a/Doc/RomWBW Getting Started.pdf and b/Doc/RomWBW Getting Started.pdf differ diff --git a/ReadMe.md b/ReadMe.md index e369792e..897958ea 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -3,7 +3,7 @@ author: "Wayne Warthen (mailto:wwarthen@gmail.com)" classoption: - oneside colorlinks: true -date: 27 Oct 2021 +date: 08 Dec 2021 documentclass: book fontfamily: helvet fontsize: 12pt @@ -44,7 +44,7 @@ toc-depth: 1 ## Z80/Z180 System Software Version 3.1 Pre-release -27 Oct 2021 +08 Dec 2021 Wayne Warthen @@ -870,12 +870,14 @@ tracks. `CPMLDR.SYS` chain loads `CPM3.SYS`. ZPM3 is an interesting combination of the features of both CP/M 3 and ZCPR 3. Essentially, it has the features of and compatibility with both. -Like CP/M 3, to make ZPM3 boot disk, you put CPMLDR.SYS on the system +Like CP/M 3, to make ZPM3 boot disk, you put ZPMLDR.SYS on the system tracks of the disk. ### Notes -- `ZPMLDR` is included with ZPM3, but it is not working correctly. +- `ZPMLDR` is equivalent to CPMLDR. Both are included. Previously, + ZPMLDR had issues that prevented it from properly booting RomWBW + ZPM3. However, those issues have been resolved. - The ZPM operating system is contained in the file called CPM3.SYS which is confusing, but this is as intended by the ZPM3 diff --git a/ReadMe.txt b/ReadMe.txt index 20a32d9f..2bc55874 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -1,6 +1,6 @@ RomWBW Getting Started Wayne Warthen (mailto:wwarthen@gmail.com) -27 Oct 2021 +08 Dec 2021 @@ -17,7 +17,7 @@ RomWBW Z80/Z180 System Software Version 3.1 Pre-release -27 Oct 2021 +08 Dec 2021 Wayne Warthen wwarthen@gmail.com @@ -872,12 +872,14 @@ Simeon Cran’s ZPM3 ZPM3 is an interesting combination of the features of both CP/M 3 and ZCPR 3. Essentially, it has the features of and compatibility with both. -Like CP/M 3, to make ZPM3 boot disk, you put CPMLDR.SYS on the system +Like CP/M 3, to make ZPM3 boot disk, you put ZPMLDR.SYS on the system tracks of the disk. Notes -- ZPMLDR is included with ZPM3, but it is not working correctly. +- ZPMLDR is equivalent to CPMLDR. Both are included. Previously, + ZPMLDR had issues that prevented it from properly booting RomWBW + ZPM3. However, those issues have been resolved. - The ZPM operating system is contained in the file called CPM3.SYS which is confusing, but this is as intended by the ZPM3 diff --git a/Source/Doc/GettingStarted.md b/Source/Doc/GettingStarted.md index e7ba2ea3..92ccc134 100644 --- a/Source/Doc/GettingStarted.md +++ b/Source/Doc/GettingStarted.md @@ -850,12 +850,14 @@ ZPM3 is an interesting combination of the features of both CP/M 3 and ZCPR 3. Essentially, it has the features of and compatibility with both. -Like CP/M 3, to make ZPM3 boot disk, you put CPMLDR.SYS on the system +Like CP/M 3, to make ZPM3 boot disk, you put ZPMLDR.SYS on the system tracks of the disk. ### Notes -- `ZPMLDR` is included with ZPM3, but it is not working correctly. +- `ZPMLDR` is equivalent to CPMLDR. Both are included. Previously, +ZPMLDR had issues that prevented it from properly booting RomWBW ZPM3. +However, those issues have been resolved. - The ZPM operating system is contained in the file called CPM3.SYS which is confusing, but this is as intended by the ZPM3 distribution. diff --git a/Source/Images/Build.cmd b/Source/Images/Build.cmd index f2e81edb..2f5672e1 100644 --- a/Source/Images/Build.cmd +++ b/Source/Images/Build.cmd @@ -21,7 +21,7 @@ call BuildDisk.cmd cpm22 wbw_hd512 ..\cpm22\cpm_wbw.sys || exit /b call BuildDisk.cmd zsdos wbw_hd512 ..\zsdos\zsys_wbw.sys || exit /b call BuildDisk.cmd nzcom wbw_hd512 ..\zsdos\zsys_wbw.sys || exit /b call BuildDisk.cmd cpm3 wbw_hd512 ..\cpm3\cpmldr.sys || exit /b -call BuildDisk.cmd zpm3 wbw_hd512 ..\cpm3\cpmldr.sys || exit /b +call BuildDisk.cmd zpm3 wbw_hd512 ..\zpm3\zpmldr.sys || exit /b call BuildDisk.cmd ws4 wbw_hd512 || exit /b if exist ..\BPBIOS\bpbio-ww.rel call BuildDisk.cmd bp wbw_hd512 || exit /b @@ -37,7 +37,7 @@ call BuildDisk.cmd cpm22 wbw_hd1024 ..\cpm22\cpm_wbw.sys || exit /b call BuildDisk.cmd zsdos wbw_hd1024 ..\zsdos\zsys_wbw.sys || exit /b call BuildDisk.cmd nzcom wbw_hd1024 ..\zsdos\zsys_wbw.sys || exit /b call BuildDisk.cmd cpm3 wbw_hd1024 ..\cpm3\cpmldr.sys || exit /b -call BuildDisk.cmd zpm3 wbw_hd1024 ..\cpm3\cpmldr.sys || exit /b +call BuildDisk.cmd zpm3 wbw_hd1024 ..\zpm3\zpmldr.sys || exit /b call BuildDisk.cmd ws4 wbw_hd1024 || exit /b if exist ..\BPBIOS\bpbio-ww.rel call BuildDisk.cmd bp wbw_hd1024 || exit /b diff --git a/Source/Images/Makefile b/Source/Images/Makefile index 7f5a082e..444293d6 100644 --- a/Source/Images/Makefile +++ b/Source/Images/Makefile @@ -1,7 +1,7 @@ # # this makefile subsumes all the work done in Build.cmd, BuildDisk.cmd, BuildDisk.ps1 # -SYSTEMS = ../CPM22/cpm_wbw.sys ../ZSDOS/zsys_wbw.sys ../CPM3/cpmldr.sys +SYSTEMS = ../CPM22/cpm_wbw.sys ../ZSDOS/zsys_wbw.sys ../CPM3/cpmldr.sys ../ZPM3/zpmldr.sys FDIMGS = fd144_cpm22.img fd144_zsdos.img fd144_ws4.img HD512IMGS = hd512_cpm22.img hd512_zsdos.img hd512_nzcom.img \ @@ -71,7 +71,8 @@ blankhd1024: case $@ in \ (*cpm22*) sys=../CPM22/cpm_wbw.sys;; \ (*zsdos* | *nzcom*) sys=../ZSDOS/zsys_wbw.sys;; \ - (*cpm3* | *zpm3*) sys=../CPM3/cpmldr.sys;; \ + (*cpm3*) sys=../CPM3/cpmldr.sys;; \ + (*zpm3*) sys=../ZPM3/zpmldr.sys;; \ esac ; \ if echo $@ | grep -q ^fd144_ ; then \ fmt=wbw_fd144 ; type=fd144_ ; proto=blank144 ; \ diff --git a/Source/Images/d_zpm3/u0/ROMWBW.TXT b/Source/Images/d_zpm3/u0/ROMWBW.TXT index 45528bd5..6bf5d5f0 100644 --- a/Source/Images/d_zpm3/u0/ROMWBW.TXT +++ b/Source/Images/d_zpm3/u0/ROMWBW.TXT @@ -6,9 +6,10 @@ boot directly into ZPM3 by choosing the ZPM3 disk from the RomWBW loader prompt. The ZPM3 disk must be bootable in this case. You may notice that there is a ZPMLDR application on the hard disk -image. This application is equivalent to CPMLDR, but it has some -issues with the number of drives that RomWBW supports. So, as -indicated above, use CPMLDR to launch ZPM3. +image. This application is equivalent to CPMLDR. It originally +had some issues that prevented it from booting RomWBW properly, +but those issues are now resolved (I think). Either ZPMLDR or CPMLDR +can be used to launch ZPM3. I have not found a way to make ZPM3 start up with any drive other than A: as the system drive. So, during the load process, the boot diff --git a/Source/ZPM3/Build.cmd b/Source/ZPM3/Build.cmd index e9ef50ca..f0f5a3c6 100644 --- a/Source/ZPM3/Build.cmd +++ b/Source/ZPM3/Build.cmd @@ -29,8 +29,10 @@ echo. echo *** ZPM Loader *** echo. zx LINK -ZPMLDRD[L100]=ZPM3LDR,BIOSLDRD,UTIL || exit /b +:: zx SLRNK -ZPM3LDR,BIOSLDRD,UTIL,ZPMLDRD/N/E move /Y zpmldrd.com zpmldr.bin || exit /b zx LINK -ZPMLDRC[L100]=ZPM3LDR,BIOSLDRC,UTIL || exit /b +:: zx SLRNK -ZPM3LDR,BIOSLDRC,UTIL,ZPMLDRC/N/E move /Y zpmldrc.com zpmldr.com || exit /b rem pause diff --git a/Source/ZPM3/Notes.txt b/Source/ZPM3/Notes.txt new file mode 100644 index 00000000..3bd07012 --- /dev/null +++ b/Source/ZPM3/Notes.txt @@ -0,0 +1,30 @@ +RESBDOS3.SPR and BNKBDOS3.SPR have been replaced +with versions from the Jon Saxton disassembly with +fixes distribution. The file called zpm3fix.txt +have been included and details the fixes. + +ZPMLDR has also been updated with the version from +the Jon Saxton disassembly. However, it has additionally +been updated to correct an issue that was preventing +RomWBW from booting under ZPMLDR. + +ZPMLDR has a slightly modified version of the rdSeq +procedure (compared to CPMLDR). It appears that this +causes deblocking to be bypassed on the initial disk +read of CPM3.SYS. As a result, the entire disk sector +(512 bytes) is read starting at 0x0080. This winds up +overlaying 0x180 bytes of the start of ZPMLDR.COM causing +it to fail catastrophically. + +According to the documentation at the top of zpm3ldr.z80, +zpmldr is normally loaded from system tracks to address +0x0400. In that scenario, the read of the entire sector +would not overlay the start of the application. So, I +suspect this is why this (bug?) is not relevant to many +implementations. + +The ZPM3LDR.REL file used here has been modified to +sync the rdSeq procedure back to the DIR CPMLDR version. +This seems to allow ZPMLDR to work with RomWBW now. + +--WBW 4:22 PM 12/8/2021 \ No newline at end of file diff --git a/Source/ZPM3/bnkbdos3.spr b/Source/ZPM3/bnkbdos3.spr index cd31a6a4..a2c3537f 100644 Binary files a/Source/ZPM3/bnkbdos3.spr and b/Source/ZPM3/bnkbdos3.spr differ diff --git a/Source/ZPM3/bnkbdos3.spr.bak b/Source/ZPM3/bnkbdos3.spr.bak new file mode 100644 index 00000000..cd31a6a4 Binary files /dev/null and b/Source/ZPM3/bnkbdos3.spr.bak differ diff --git a/Source/ZPM3/resbdos3.spr b/Source/ZPM3/resbdos3.spr index 2908ed3e..c62b0340 100644 Binary files a/Source/ZPM3/resbdos3.spr and b/Source/ZPM3/resbdos3.spr differ diff --git a/Source/ZPM3/resbdos3.spr.bak b/Source/ZPM3/resbdos3.spr.bak new file mode 100644 index 00000000..2908ed3e Binary files /dev/null and b/Source/ZPM3/resbdos3.spr.bak differ diff --git a/Source/ZPM3/zpm3fix.txt b/Source/ZPM3/zpm3fix.txt new file mode 100644 index 00000000..4c6bae87 --- /dev/null +++ b/Source/ZPM3/zpm3fix.txt @@ -0,0 +1,187 @@ +PATCHES TO SIMEON CRAN'S ZPM3 +============================= + +ZPM3 is a CP/M 3 workalike written by Simeon Cran. It is readily available in +binary form; just look for archives like zpm3n10.arc and similar. + +This patch contains updated BNKBDOS3.SPR and RESBDOS3.SPR files although it +is only the banked portion which has been modified. + +Three changes have been implemented. + +1. BDOS function 152 (Parse file name) password bug +=================================================== + +The first change was to fix a bug identified by Tilmann Reh in the file name +parser invoked by BDOS function 152. Unlike the parser in standard CP/M 3, +Simeon's version can deal with a user number. The FCB which is filled in by +the parser has the following structure where the field names are those shown +in the CP/M 3 Programmer's Reference Manual: + + + Offset Field Length + ------ ----- ------ + 0 DR 1 Drive code (0 = current, 1 = A, ... 16 = P + 1 NAME 8 File name + 9 TYPE 3 File type (extension) + 12 PM 1 Password mode + 13 S1 1 Reserved + 14 S2 1 Reserved + 15 RC 1 Reserved (Result code) + 16 PASSWORD 8 Password (encrypted) + 24 RESERVED 8 Used by CP/M 3 + +Now the RC field gets set to FFh if an error occurs during the parse but S1 +and S2 are not used at all by CP/M 3. Simeon's parser uses those fields to +store the user number (S1) and a copy of the DR field (S2) thus rendering the +parser far more useful in that it can now handle names like + + K12:TESSER.CAT + +and deliver a sensible result to a user program. + +None of this is useful to other CP/M 3 implementations and so most programs do +their own parsing but the basic idea is commendable. However Tilmann noticed +that if a password is attached to a file then Simeon's parser puts it in the +wrong place, overwriting the four fields PM through RC. + +It is probably not a critical issue; after all, how many CP/M 3 users bother +to password-protect files? Nevertheless it is clearly wrong and is fixed in +this version of BNKBDOS3.SPR. + +2. BDOS function 152 (Parse file name) user/drive prefix +======================================================== + +A limitation of Simeon's parser is that it cannot handle the UD: (user, drive) +prefix, only the DU: form. That was annoying to me since I am just as likely +to type 7g:tesser.cat as g7:tesser.cat. My second patch was to fix ZPM3 to +handle both the UD: and DU: prefix forms. + +I also put the drive number in the S2 field even when no drive was specified +in the input string. Assuming that the current drive is E and the current +user number is 8 then the following results are obtained with the inputs +shown: + + Input string DR S1 S2 + ------------ -- -- -- + FILE.EXT 0 8 5 + E:FILE.EXT 5 8 5 + 12:FILE.EXT 0 12 5 + G:FILE.EXT 7 8 7 + G12:FILE.EXT 7 12 7 + 12G:FILE.EXT 7 12 7 + +The interesting cases shown above are the first and third. Setting DR to zero +is consistent with the way standard CP/M works and the setting of S2 is just +extra information which may be of use to the calling program but which can +be ignored. Unfortunately it is not possible to do the same thing with the +user number because standard CP/M does not have a field for that. + +3. BDOS function 152 (Parse file name) Clear target FCB +======================================================= + +On 2013-09-05 a contributor to comp.os.cpm known only as "Ed" pointed out that +there is yet another bug in BDOS 152 in that it does not clear the record +number fields in the last four bytes of the FCB populated by the function. +A program which uses the FCB for a read or write operation without first +explicitly setting the fields will have the I/O operation start at some +unexpected position in the file. + +This problem has also been fixed. + +4. Command line editing keys +============================ + +A couple of years ago I added code to yaze-ag (a Z80 emulator) to make it +possible to use the cursor and function keys on a modern PC keyboard to do +sensible things in CP/M. The keyboard translations are specified in external +text files and can be loaded dynamically from within CP/M. + +By far the most useful translate table maps the arrow keys to WordStar +controls. For example, pressing the up arrow key generates a ^E, pressing +PgUp generates ^R and so on. This works really well in most cases but there +is one piece of software which gives problems, namely CP/M itself. + +Yaze-ag uses Simeon Cran's ZPM3 as a replacement for the CP/M 3 BDOS. It was +a good choice because ZPM3 offers more features than standard CP/M 3 and in +particular, it provides a rich command history facility with decent recall and +edit capabilities. + +As originally implemented, ZPM3 viewed the history as an upward-growing +stack, i.e. with new lines being added at the top. For example assume +that lines comprising the single words "one", "two", "three", "four" and +"five" are entered in sequence. The history looks like this: + + -> (current line, blank) + five (newest) + four + three + two + one (oldest) + +According to this view, the NEXT line in the history is the last one +entered. After ^W ^W ^W ^W (NEXT, NEXT, NEXT, NEXT) the view is like this: + + two (line ready for editing) + five (newest) + four + three + -> two + one (oldest) + +After ^E ^E (PREVIOUS, PREVIOUS) the view is: + + four (line ready for editing) + five (newest) + -> four + three + two + one (oldest) + +This is all very consistent. The problem is that it is utterly counter- +intuitive and the complete reverse of any recall and edit scheme in any +other operating system. For example, linux and Windows both view shell +command history as a stack, but one which grows downwards. The most +recently entered command is the one conceptually ABOVE the current line. +This view of the command history also corresponds to the way that we +compose text, where new lines are added below the most recently added +lines. + +Using the same five-line example as above, the initial view would be: + + one (oldest) + two + three + four + five (newest) + -> (current line, blank) + +After UP, UP, UP, UP the view is: + + one (oldest) + -> two + three + four + five (newest) + two (line ready for editing) + +then DOWN, DOWN yields: + + one (oldest) + two + three + -> four + five (newest) + four (line ready for editing) + +Tilman Reh recognised this as a bug when he disassembled this ZPM3. +It was fixed by cross-renaming the two routines NextLine and PreviousLine +and for WordStar compatability the NextLine routine was moved to ^W. +That meant the previous occupant of the ^W position, DeleteToLeft had to +be moved also. For no particularly good reason I chose to use the just- +vacated ^X slot. + +Although I cannot imagine why one would want to do so, the original ZPM3 +behaviour can be recovered by setting the assembly-time switch "HistoryBug" +to some odd number, e.g. 0FFFFh. + \ No newline at end of file diff --git a/Source/ZPM3/zpm3ldr.rel b/Source/ZPM3/zpm3ldr.rel index bca9c4be..af6568df 100644 Binary files a/Source/ZPM3/zpm3ldr.rel and b/Source/ZPM3/zpm3ldr.rel differ diff --git a/Source/ZPM3/zpm3ldr.rel.bak b/Source/ZPM3/zpm3ldr.rel.bak new file mode 100644 index 00000000..bca9c4be Binary files /dev/null and b/Source/ZPM3/zpm3ldr.rel.bak differ diff --git a/Source/ver.inc b/Source/ver.inc index 9da70da2..77402c1e 100644 --- a/Source/ver.inc +++ b/Source/ver.inc @@ -2,4 +2,4 @@ #DEFINE RMN 1 #DEFINE RUP 1 #DEFINE RTP 0 -#DEFINE BIOSVER "3.1.1-pre.142" +#DEFINE BIOSVER "3.1.1-pre.143" diff --git a/Source/ver.lib b/Source/ver.lib index e0ffb279..28719bac 100644 --- a/Source/ver.lib +++ b/Source/ver.lib @@ -3,5 +3,5 @@ rmn equ 1 rup equ 1 rtp equ 0 biosver macro - db "3.1.1-pre.142" + db "3.1.1-pre.143" endm