Browse Source

ZMP LInux/MacOS Build

- Added new ZMP application to Linux/MacOS Build
- More ZX cleanup
patch
Wayne Warthen 4 years ago
parent
commit
6aa216e040
  1. 4
      Binary/Apps/Clean.cmd
  2. 2
      Binary/Apps/Makefile
  3. 2
      Source/Apps/Build.cmd
  4. 1
      Source/Apps/Clean.cmd
  5. 2
      Source/Apps/Makefile
  6. 2
      Source/Apps/ZMP/Build.cmd
  7. 0
      Source/Apps/ZMP/Clean.cmd
  8. 10
      Source/Apps/ZMP/Makefile
  9. 16
      Source/Apps/ZMP/Notes.txt
  10. 0
      Source/Apps/ZMP/zmconfig.ovr
  11. 0
      Source/Apps/ZMP/zminit.ovr
  12. 19
      Source/Apps/ZMP/zmo-rw01.z80
  13. 0
      Source/Apps/ZMP/zmp-blnk.z80
  14. 0
      Source/Apps/ZMP/zmp-ovl.upd
  15. 0
      Source/Apps/ZMP/zmp.cfg
  16. 0
      Source/Apps/ZMP/zmp.doc
  17. 0
      Source/Apps/ZMP/zmp.fon
  18. 0
      Source/Apps/ZMP/zmp.for
  19. 0
      Source/Apps/ZMP/zmp.hlp
  20. 0
      Source/Apps/ZMP/zmp15+-.new
  21. 0
      Source/Apps/ZMP/zmterm.ovr
  22. 0
      Source/Apps/ZMP/zmxfer.ovr
  23. 7
      Source/Images/d_bp.txt
  24. 7
      Source/Images/d_cpm22.txt
  25. 7
      Source/Images/d_cpm3.txt
  26. 7
      Source/Images/d_nzcom.txt
  27. 7
      Source/Images/d_zpm3.txt
  28. 7
      Source/Images/d_zsdos.txt
  29. 3
      Tools/Makefile.inc
  30. 101
      Tools/unix/zx/cpmdrv.c
  31. 6
      Tools/unix/zx/cpmglob.c
  32. 3
      Tools/unix/zx/cpmint.h
  33. 1139
      Tools/unix/zx/edops.h
  34. 33
      Tools/unix/zx/readme.txt
  35. 5
      Tools/unix/zx/zx.html
  36. BIN
      Tools/zx/zx-src.zip
  37. BIN
      Tools/zx/zx.exe
  38. 5
      Tools/zx/zx.html
  39. BIN
      Tools/zx/zxdbg.exe

4
Binary/Apps/Clean.cmd

@ -2,5 +2,9 @@
setlocal
if exist *.com del *.com
if exist *.ovr del *.ovr
if exist *.doc del *.doc
if exist *.hlp del *.hlp
if exist Tunes\*.pt? del Tunes\*.pt?
if exist Tunes\*.mym del Tunes\*.mym

2
Binary/Apps/Makefile

@ -7,4 +7,4 @@ all::
mkdir -p Tunes
clobber::
@rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom *.COM *.BIN Tunes/*.mym Tunes/*.pt?
@rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom *.ovr *.hlp *.doc *.COM *.BIN Tunes/*.mym Tunes/*.pt?

2
Source/Apps/Build.cmd

@ -35,7 +35,7 @@ pushd Tune && call Build || exit /b & popd
pushd FAT && call Build || exit /b & popd
pushd I2C && call Build || exit /b & popd
pushd ramtest && call Build || exit /b & popd
pushd zmodem && call Build || exit /b & popd
pushd ZMP && call Build || exit /b & popd
copy *.com %APPBIN%\ || exit /b

1
Source/Apps/Clean.cmd

@ -13,3 +13,4 @@ pushd Tune && call Clean || exit /b 1 & popd
pushd FAT && call Clean || exit /b 1 & popd
pushd I2C && call Clean || exit /b 1 & popd
pushd ramtest && call Clean || exit /b 1 & popd
pushd ZMP && call Clean || exit /b 1 & popd

2
Source/Apps/Makefile

@ -2,7 +2,7 @@ OBJECTS = sysgen.com survey.com \
syscopy.com assign.com format.com talk.com mode.com rtc.com \
timer.com inttest.com rtchb.com ppidetst.com tstdskng.com
OTHERS = *.hex *.com
SUBDIRS = XM FDU FAT Tune I2C ramtest
SUBDIRS = XM FDU FAT Tune I2C ramtest ZMP
DEST = ../../Binary/Apps
TOOLS =../../Tools

2
Source/Apps/ZMODEM/Build.cmd → Source/Apps/ZMP/Build.cmd

@ -15,4 +15,4 @@ zx MLOAD25 -ZMP.COM=ZMPX.COM,ZMO-RW01 || exit /b
copy /Y zmp.com ..\..\..\Binary\Apps\ || exit /b
copy /Y *.ovr ..\..\..\Binary\Apps\ || exit /b
copy /Y *.hlp ..\..\..\Binary\Apps\ || exit /b
copy /Y zmp.doc ..\..\..\Doc\ || exit /b
copy /Y zmp.doc ..\..\..\Binary\Apps\ || exit /b

0
Source/Apps/ZMODEM/Clean.cmd → Source/Apps/ZMP/Clean.cmd

10
Source/Apps/ZMP/Makefile

@ -0,0 +1,10 @@
OBJECTS = zmp.com *.ovr *.hlp zmp.doc
DEST = ../../../Binary/Apps
TOOLS = ../../../Tools
OTHERS = *.hex
NODELETE = *.ovr zmp.doc *.hlp
include $(TOOLS)/Makefile.inc
zmp.com: zmo-rw01.hex
$(ZXCC) $(CPM)/MLOAD25 -ZMP.COM=ZMPX.COM,ZMO-RW01

16
Source/Apps/ZMP/Notes.txt

@ -0,0 +1,16 @@
- Overlay files must reside on default drive at time program is
launched. This seems to preclude the path search feature of
ZSDOS/ZCPR which would be nice. Need to look into this.
- Need some mechanism for user to select a CIO unit other than CIO 1
without modifying and rebuilding application.
- Initialization messages refer to CIO 1 as CIO 0
- System hangs after error message if there is no CIO 1 unit
- When leaving program, terminal cursor remains hidden
--WBW 1:42 PM 8/23/2021
- When leaving program, terminal cursor remains hidden (fixed)
- System hangs after error message if there is no CIO 1 unit (fixed)
- Initialization messages refer to CIO 1 as CIO 0 (fixed)
--WBW 1:58 PM 8/23/2021

0
Source/Apps/ZMODEM/zmconfig.ovr → Source/Apps/ZMP/zmconfig.ovr

0
Source/Apps/ZMODEM/zminit.ovr → Source/Apps/ZMP/zminit.ovr

19
Source/Apps/ZMODEM/zmo-rw01.z80 → Source/Apps/ZMP/zmo-rw01.z80

@ -457,7 +457,8 @@ init:
call print
db 'CIO device initialized: ',0
ld a,(port)
add a,'0'-1
;add a,'0'-1
add a,'0'
call cout
call print
db cr,lf,0
@ -472,12 +473,16 @@ initerr:
call print
db 'Unable to initialize CIO device: ',0
ld a,(port)
add a,'0'-1
;add a,'0'-1
add a,'0'
call cout
call print
db cr,lf,0
ret
;ret
call show ; show cursor, then ...
jp 0 ; bail out to avoid system hang!
;--------------------------------------------------------------------------
stop: dw 1 ; stop bits
@ -539,7 +544,8 @@ setport:
pop hl
ld a,l
add a,'0'-1
;add a,'0'-1
add a,'0'
call cout
call print
db cr,lf,0
@ -550,7 +556,8 @@ seterr:
db 'Unable to set CIO device: ',0
pop hl
ld a,l
add a,'0'-1
;add a,'0'-1
add a,'0'
call cout
call print
db cr,lf,0
@ -641,7 +648,7 @@ hide:
;Turn on cursor:
show:
call print
db esc,'.3',0
db esc,'[?25h',0
ret
;Save cursor position:

0
Source/Apps/ZMODEM/zmp-blnk.z80 → Source/Apps/ZMP/zmp-blnk.z80

0
Source/Apps/ZMODEM/zmp-ovl.upd → Source/Apps/ZMP/zmp-ovl.upd

0
Source/Apps/ZMODEM/zmp.cfg → Source/Apps/ZMP/zmp.cfg

0
Source/Apps/ZMODEM/zmp.doc → Source/Apps/ZMP/zmp.doc

0
Source/Apps/ZMODEM/zmp.fon → Source/Apps/ZMP/zmp.fon

0
Source/Apps/ZMODEM/zmp.for → Source/Apps/ZMP/zmp.for

0
Source/Apps/ZMODEM/zmp.hlp → Source/Apps/ZMP/zmp.hlp

0
Source/Apps/ZMODEM/zmp15+-.new → Source/Apps/ZMP/zmp15+-.new

0
Source/Apps/ZMODEM/zmterm.ovr → Source/Apps/ZMP/zmterm.ovr

0
Source/Apps/ZMODEM/zmxfer.ovr → Source/Apps/ZMP/zmxfer.ovr

7
Source/Images/d_bp.txt

@ -26,6 +26,13 @@
../../Binary/Apps/timer.com 15:
../../Binary/Apps/tune.com 15:
../../Binary/Apps/xm.com 15:
../../Binary/Apps/zmp.com 15:
../../Binary/Apps/zmp.hlp 15:
../../Binary/Apps/zmp.doc 15:
../../Binary/Apps/zmxfer.ovr 15:
../../Binary/Apps/zmterm.ovr 15:
../../Binary/Apps/zminit.ovr 15:
../../Binary/Apps/zmconfig.ovr 15:
#
../../Binary/Apps/i2clcd.com 2:
../../Binary/Apps/i2cscan.com 2:

7
Source/Images/d_cpm22.txt

@ -16,6 +16,13 @@
../../Binary/Apps/timer.com 0:
../../Binary/Apps/tune.com 0:
../../Binary/Apps/xm.com 0:
../../Binary/Apps/zmp.com 0:
../../Binary/Apps/zmp.hlp 0:
../../Binary/Apps/zmp.doc 0:
../../Binary/Apps/zmxfer.ovr 0:
../../Binary/Apps/zmterm.ovr 0:
../../Binary/Apps/zminit.ovr 0:
../../Binary/Apps/zmconfig.ovr 0:
#
../../Binary/Apps/i2clcd.com 2:
../../Binary/Apps/i2cscan.com 2:

7
Source/Images/d_cpm3.txt

@ -36,6 +36,13 @@
../../Binary/Apps/timer.com 0:
../../Binary/Apps/tune.com 0:
../../Binary/Apps/xm.com 0:
../../Binary/Apps/zmp.com 0:
../../Binary/Apps/zmp.hlp 0:
../../Binary/Apps/zmp.doc 0:
../../Binary/Apps/zmxfer.ovr 0:
../../Binary/Apps/zmterm.ovr 0:
../../Binary/Apps/zminit.ovr 0:
../../Binary/Apps/zmconfig.ovr 0:
#
../../Binary/Apps/i2clcd.com 2:
../../Binary/Apps/i2cscan.com 2:

7
Source/Images/d_nzcom.txt

@ -16,6 +16,13 @@
../../Binary/Apps/timer.com 0:
../../Binary/Apps/tune.com 0:
../../Binary/Apps/xm.com 0:
../../Binary/Apps/zmp.com 0:
../../Binary/Apps/zmp.hlp 0:
../../Binary/Apps/zmp.doc 0:
../../Binary/Apps/zmxfer.ovr 0:
../../Binary/Apps/zmterm.ovr 0:
../../Binary/Apps/zminit.ovr 0:
../../Binary/Apps/zmconfig.ovr 0:
#
../../Binary/Apps/i2clcd.com 2:
../../Binary/Apps/i2cscan.com 2:

7
Source/Images/d_zpm3.txt

@ -35,6 +35,13 @@
../../Binary/Apps/timer.com 15:
../../Binary/Apps/tune.com 15:
../../Binary/Apps/xm.com 15:
../../Binary/Apps/zmp.com 15:
../../Binary/Apps/zmp.hlp 15:
../../Binary/Apps/zmp.doc 15:
../../Binary/Apps/zmxfer.ovr 15:
../../Binary/Apps/zmterm.ovr 15:
../../Binary/Apps/zminit.ovr 15:
../../Binary/Apps/zmconfig.ovr 15:
#
#../../Binary/Apps/i2clcd.com 2:
#../../Binary/Apps/i2cscan.com 2:

7
Source/Images/d_zsdos.txt

@ -28,6 +28,13 @@ d_cpm22/u0/XSUB.COM 0:
../../Binary/Apps/timer.com 0:
../../Binary/Apps/tune.com 0:
../../Binary/Apps/xm.com 0:
../../Binary/Apps/zmp.com 0:
../../Binary/Apps/zmp.hlp 0:
../../Binary/Apps/zmp.doc 0:
../../Binary/Apps/zmxfer.ovr 0:
../../Binary/Apps/zmterm.ovr 0:
../../Binary/Apps/zminit.ovr 0:
../../Binary/Apps/zmconfig.ovr 0:
#
../../Binary/Apps/i2clcd.com 2:
../../Binary/Apps/i2cscan.com 2:

3
Tools/Makefile.inc

@ -93,6 +93,9 @@ CPM=$(TOOLS)/cpm/bin
%.rel: %.z80
$(ZXCC) $(CPM)/Z80ASM -$(basename $<)/MF
%.hex: %.z80
$(ZXCC) $(CPM)/Z80ASM -$(basename $<)/HF
%.hex: %.180
$(ZXCC) $(CPM)/SLR180 -$(basename $<)/HF

101
Tools/unix/zx/cpmdrv.c

@ -139,6 +139,7 @@ cpm_word fcb_purge()
#endif
}
/* Generic 8MB disk definition */
static cpm_byte exdpb[0x11] = {
0x80, 0, /* 128 records/track */
@ -154,61 +155,7 @@ static cpm_byte exdpb[0x11] = {
cpm_word fcb_getdpb(cpm_byte *dpb)
{
#ifdef WIN32
DWORD spc, bps, fc, tc;
unsigned bsh, blm, psh, phm;
char *hostd = drive_to_hostdrive(redir_cpmdrive);
if (!hostd) return 0x01FF; /* Can't select */
if (!GetDiskFreeSpace(hostd, &spc, &bps, &fc, &tc))
return 0x01FF; /* Can't select */
/* Store total clusters */
//if (tc > 0x10000L) tc = 0x10000L;
if (tc > 0xFFFFL) tc = 0xFFFFL;
psh = 0; phm = 0;
while (bps > 128) /* Get sector size */
{
bps /= 2;
psh++;
phm = (phm << 1) | 1;
}
bsh = psh; blm = phm;
while (spc > 1) /* Get cluster size */
{
spc /= 2;
bsh++;
blm = (blm << 1) | 1;
}
exdpb[2] = bsh;
exdpb[3] = blm;
exdpb[5] = tc & 0xFF;
exdpb[6] = tc >> 8;
exdpb[15] = psh;
exdpb[16] = phm;
#else
struct statfs buf;
cpm_word nfiles;
/* Get DPB for redir_cpmdrive. Currently just returns a dummy. */
if (!statfs(redir_drive_prefix[redir_cpmdrive], &buf))
{
/* Store correct directory entry count */
if (buf.f_files >= 0x10000L) nfiles = 0xFFFF;
else nfiles = buf.f_files;
exdpb[7] = nfiles & 0xFF;
exdpb[8] = nfiles >> 8;
}
#endif
/* Return the example dpb */
memcpy(dpb, &exdpb, 0x11);
return 0x11;
}
@ -223,7 +170,7 @@ cpm_word fcb_getalv(cpm_byte *alv, cpm_word max)
memset(alv, 0xFF, max / 2);
memset(alv + (max / 2), 0, max / 2);
return max;
}
@ -231,45 +178,7 @@ cpm_word fcb_getalv(cpm_byte *alv, cpm_word max)
cpm_word fcb_dfree (cpm_byte drive, cpm_byte *dma)
{
#ifdef WIN32
DWORD spc, bps, fc, tc;
DWORD freerec;
char *hostd = drive_to_hostdrive(drive);
if (!hostd) return 0x01FF;
if (!hostd) return 0x01FF; /* Can't select */
if (!GetDiskFreeSpace(hostd, &spc, &bps, &fc, &tc))
return 0x01FF; /* Can't select */
freerec = fc; /* Free clusters */
freerec *= spc; /* Free sectors */
freerec *= (bps / 128); /* Free CP/M records */
/* Limit to maximum CP/M drive size */
if (freerec > 4194303L) freerec = 4194303L;
redir_wr24(dma, freerec);
#else
struct statfs buf;
long dfree;
if (!redir_drive_prefix[drive]) return 0x01FF; /* Can't select */
if (statfs(redir_drive_prefix[drive], &buf)) return 0x01FF;
dfree = (buf.f_bavail * (buf.f_bsize / 128));
if (dfree < buf.f_bavail || /* Calculation has wrapped round */
dfree > 4194303L) /* Bigger than max CP/M drive size */
{
dfree = 4194303L;
}
redir_wr24(dma, dfree);
#endif
/* Return half of disk capacity */
redir_wr24(dma, 0x8000L); /* 8MB / 128 / 2 */
return 0;
}

6
Tools/unix/zx/cpmglob.c

@ -277,7 +277,11 @@ cpm_word redir_find(int n, cpm_byte *fcb, cpm_byte *dma)
while (n >= 0)
{
de = next_entry(hostdir, fcb, dma + 1, &st);
if (!de) return 0xFF;
if (!de)
{
closedir(hostdir);
return 0xFF;
}
--n;
}
/* Valid entry found & statted. dma+1 holds filename. */

3
Tools/unix/zx/cpmint.h

@ -67,6 +67,9 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#ifdef WIN32
# define strcasecmp _stricmp
#endif
#ifdef __MSDOS__

1139
Tools/unix/zx/edops.h

File diff suppressed because it is too large

33
Tools/unix/zx/readme.txt

@ -9,6 +9,9 @@ which is essentially just the zxcc command.
Please see http://www.seasip.info/Unix/Zxcc/ for more information on zxcc.
Note that this is a Win32 build. The code has not been updated to build as a 64-bit
binary. However, Win32 binaries run very nicely under 64 bit Windows.
To build under Open Watcom or Microsoft Visual C++, use the following command:
cl /Fe"zx.exe" zx.c cpmdrv.c cpmglob.c cpmparse.c cpmredir.c drdos.c util.c xlt.c zxbdos.c zxcbdos.c zxdbdos.c z80.c dirent.c
@ -17,9 +20,9 @@ To build a debug version, use the following command:
cl /DDEBUG /Fe"zxdbg.exe" zx.c cpmdrv.c cpmglob.c cpmparse.c cpmredir.c drdos.c util.c xlt.c zxbdos.c zxcbdos.c zxdbdos.c z80.c dirent.c
WARNING: There seems to be a rare scenario that breaks zx under the Open Watcom build. CP/M allows a file to be accessed
under multiple FCB's without an error. Open Watcom will see this as an error. At present, the only tool I know of that does
this is M80.
WARNING: There seems to be a rare scenario that breaks zx under the Open Watcom build.
CP/M allows a file to be accessed under multiple FCB's without an error. Open Watcom
will see this as an error. At present, the only tool I know of that does this is M80.
December 5, 2014
@ -43,5 +46,27 @@ March 15, 2017
- Implemented BDOS console status function.
- Set stdin and stdout to binary mode at startup.
August 21, 2021
- Incorporated filename case insensitivity changes from Curt Mayer
- Incorporated fixes from Tony Nicholson at https://github.com/agn453/ZXCC
- Emulation of CP/M BDOS function 60 (call resident system extension)
should be disabled and return 0xFF in both the A and L registers.
- Change cpm_bdos_10() to return an unsigned result to avoid buffer
size being interpreted as negative.
- Fix the emulation of Z80 opcodes for IN (HL),(C) and
OUT (C),(HL) - opcodes 0xED,0x70 and 0xED,0x71 respectively.
This is noted in Fred Weigel's AM9511 arithmetic processing unit
emulation from https://github.com/ratboy666/am9511 in the howto.txt
description. NB: I have not included Fred's am9511 support at this
time into ZXCC.
- Fixed parse_to_fcb function in zx.c to handle parsing second automatic
FCB from command line
- I have not been able to reproduce the multiple FCBs referring to a
single file issue with Watcom documented above. Perhaps I fixed it
and don't remember or I found a bug-fixed version of M80. Not sure.
Wayne Warthen
wwarthen@gmail.com
wwarthen@gmail.com
--WBW 4:09 PM 8/21/2021

5
Tools/unix/zx/zx.html

@ -6,7 +6,7 @@
Windows command line. It is compatible with Windows XP and greater (both
32 and 64 bit).</p>
<p><em>zx</em> is basically a port of a subset of the zxcc package by John Elliott.
<p><em>zx</em> is basically a port of a subset of the zxcc program by John Elliott.
The GPLv2 licensing carries forward. Please refer to the
<a href="http://http://www.seasip.info/Unix/Zxcc/">
zxcc web page</a> for more information.</p>
@ -15,7 +15,8 @@ zxcc web page</a> for more information.</p>
execution of the Hi-Tech C CP/M compiler under Unix, <em>zx</em> is slightly
more general and intended to allow running most CP/M tools. Specific
changes were incorporated to improve interactice console operation of
CP/M applications.</p>
CP/M applications. Additionally, Curt Mayer added case insensitivity
for filenames under Unix variants.</p>
<h2>Setup</h2>

BIN
Tools/zx/zx-src.zip

Binary file not shown.

BIN
Tools/zx/zx.exe

Binary file not shown.

5
Tools/zx/zx.html

@ -6,7 +6,7 @@
Windows command line. It is compatible with Windows XP and greater (both
32 and 64 bit).</p>
<p><em>zx</em> is basically a port of a subset of the zxcc package by John Elliott.
<p><em>zx</em> is basically a port of a subset of the zxcc program by John Elliott.
The GPLv2 licensing carries forward. Please refer to the
<a href="http://http://www.seasip.info/Unix/Zxcc/">
zxcc web page</a> for more information.</p>
@ -15,7 +15,8 @@ zxcc web page</a> for more information.</p>
execution of the Hi-Tech C CP/M compiler under Unix, <em>zx</em> is slightly
more general and intended to allow running most CP/M tools. Specific
changes were incorporated to improve interactice console operation of
CP/M applications.</p>
CP/M applications. Additionally, Curt Mayer added case insensitivity
for filenames under Unix variants.</p>
<h2>Setup</h2>

BIN
Tools/zx/zxdbg.exe

Binary file not shown.
Loading…
Cancel
Save