├── .gitattributes ├── .gitignore ├── AUTHORS ├── COPYING ├── ChangeLog ├── INSTALL ├── LICENSE ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── README.md ├── Z80 ├── Makefile.am ├── Makefile.in ├── bios.bin └── bios.zsm ├── aclocal.m4 ├── bin ├── Makefile.am ├── Makefile.in ├── cbops.h ├── edops.h ├── z80.c ├── z80.h ├── z80ops.h ├── zxas.c ├── zxbdos.c ├── zxbdos.h ├── zxc.c ├── zxcbdos.c ├── zxcbdos.h ├── zxcc.c ├── zxcc.h ├── zxdbdos.c ├── zxdbdos.h ├── zxlibr.c ├── zxlink.c └── zxobjtohex.c ├── changes.md ├── config.h.in ├── config ├── compile ├── config.guess ├── config.sub ├── depcomp ├── install-sh ├── ltmain.sh └── missing ├── configure ├── configure.ac ├── cpmio ├── AUTHORS ├── COPYING.LIB ├── ChangeLog ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── aclocal.m4 ├── check │ ├── Makefile.am │ ├── Makefile.in │ └── testio.c ├── config.h.in ├── config │ ├── compile │ ├── config.guess │ ├── config.sub │ ├── depcomp │ ├── install-sh │ ├── ltmain.sh │ └── missing ├── configure ├── configure.ac ├── include │ ├── Makefile.am │ ├── Makefile.in │ └── cpmio.h ├── install-sh ├── lib │ ├── Makefile.am │ ├── Makefile.in │ ├── conbdos.c │ ├── cpmio.c │ ├── cpmio_i.h │ ├── iosig.c │ ├── termansi.c │ ├── termcore.c │ ├── termcore.h │ └── termvt52.c ├── m4 │ ├── libtool.m4 │ ├── ltoptions.m4 │ ├── ltsugar.m4 │ ├── ltversion.m4 │ └── lt~obsolete.m4 ├── missing └── mkinstalldirs ├── cpmredir ├── AUTHORS ├── COPYING ├── ChangeLog ├── INSTALL ├── Makefile.am ├── Makefile.in ├── NEWS ├── README ├── Z80 │ ├── chdir.com │ ├── chdir.z80 │ ├── cpmredir.rsx │ ├── cpmredir.z80 │ ├── dparse.z80 │ ├── dpcmd.z80 │ ├── fstype.z80 │ ├── lsdir.com │ ├── lsdir.z80 │ ├── make.sub │ ├── mkdir.com │ ├── mkdir.z80 │ ├── mount.com │ ├── mount.z80 │ ├── redir.com │ ├── redir.z80 │ ├── redirect.doc │ ├── rmdir.com │ ├── rmdir.z80 │ ├── umount.com │ └── umount.z80 ├── aclocal.m4 ├── config.h.in ├── config │ ├── compile │ ├── config.guess │ ├── config.sub │ ├── depcomp │ ├── install-sh │ ├── ltmain.sh │ └── missing ├── configure ├── configure.ac ├── doc │ ├── COPYING.LIB │ ├── README │ └── sample.c ├── include │ ├── Makefile.am │ ├── Makefile.in │ └── cpmredir.h ├── lib │ ├── Makefile.am │ ├── Makefile.in │ ├── cpmdrv.c │ ├── cpmglob.c │ ├── cpmint.h │ ├── cpmparse.c │ ├── cpmredir.c │ ├── drdos.c │ ├── track.c │ ├── util.c │ └── xlt.c └── m4 │ ├── libtool.m4 │ ├── ltoptions.m4 │ ├── ltsugar.m4 │ ├── ltversion.m4 │ └── lt~obsolete.m4 ├── m4 ├── libtool.m4 ├── ltoptions.m4 ├── ltsugar.m4 ├── ltversion.m4 └── lt~obsolete.m4 ├── update-configure.sh ├── winbuild ├── README.md ├── Scripts │ └── install.cmd ├── cpmio │ ├── cpmio.vcxproj │ └── cpmio.vcxproj.filters ├── cpmredir │ ├── cpmredir.vcxproj │ ├── cpmredir.vcxproj.filters │ └── dirent.c ├── external │ ├── include │ │ └── curses.h │ ├── x64-Debug │ │ ├── pdcurses.dll │ │ └── pdcurses.lib │ ├── x64-Release │ │ ├── pdcurses.dll │ │ └── pdcurses.lib │ ├── x86-Debug │ │ ├── pdcurses.dll │ │ └── pdcurses.lib │ └── x86-Release │ │ ├── pdcurses.dll │ │ └── pdcurses.lib ├── include │ ├── config-win.h │ └── dirent.h ├── install.cfg ├── wzxcc.sln ├── zxas │ ├── zxas.vcxproj │ └── zxas.vcxproj.filters ├── zxc │ ├── zxc.vcxproj │ └── zxc.vcxproj.filters ├── zxcc │ ├── zxcc.vcxproj │ └── zxcc.vcxproj.filters ├── zxlibr │ ├── zxlibr.vcxproj │ └── zxlibr.vcxproj.filters └── zxlink │ ├── zxlink.vcxproj │ └── zxlink.vcxproj.filters ├── zxcc.doc └── zxcc.html /.gitattributes: -------------------------------------------------------------------------------- 1 | # Default is to keep crlf line endings 2 | text=auto 3 | 4 | README.md text eol=crlf 5 | LICENSE text eol=crlf 6 | *.c text eol=crlf linguist-language=C 7 | *.h text eol=crlf linguist-language=C 8 | *.as text eol=crlf linguist-language=Assembly 9 | *.z80 text eol=crlf linguist-language=Assembly 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # cache files 2 | stamp-h1 3 | autom4te.cache 4 | .deps 5 | config.log 6 | config.status 7 | 8 | # generated files 9 | Makefile 10 | config.h 11 | libtool 12 | *.o 13 | *~ 14 | 15 | # programs 16 | bin/zxas 17 | bin/zxc 18 | bin/zxcc 19 | bin/zxlibr 20 | bin/zxlink 21 | bin/zxobjtohex 22 | 23 | # libraries 24 | cpmio/lib/libcpmio.a 25 | cpmredir/lib/libcpmredir.a 26 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | 2 | * John Elliott 3 | Original Author. 4 | 5 | * Tony Nicholson (agn453) 6 | * Mark Ogden (ogdenpm) 7 | * Michal Tomek (mtdev79) 8 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 2012-08-01 John Elliott 2 | 3 | * zxcc-0.5.7 release. 4 | 5 | * Fixed compilation on Mac OS X [Mike Naberezny]. 6 | 7 | 2012-08-01 John Elliott 8 | 9 | * Altered the BIOS traps to be jumps to calls rather than calls. 10 | Mallard BASIC (and presumably other programs which assume the 11 | BIOS jumpblock is composed of JMP xxxx instructions) will now 12 | launch correctly. 13 | 14 | 2010-11-10 John Elliott 15 | 16 | * zxcc-0.5.6 release. 17 | 18 | * Fixed the implementation of the BIOS traps. Console I/O using 19 | BIOS functions should now work. 20 | 21 | 2010-07-14 John Elliott 22 | 23 | * Fixed a bug where the last record of files read using the 24 | CP/M Plus multi-record I/O system was not being padded with 25 | 0x1A bytes [Volker Pohlers] 26 | 27 | 2009-11-03 John Elliott 28 | 29 | * zxcc-0.5.4 release. 30 | 31 | * Fixed a couple of string-formatting funnies. 32 | 33 | 2003-04-04 John Elliott 34 | 35 | * zxcc-0.5.3 release. 36 | 37 | * Commented out temporary debugging code from z80.c which should not 38 | have been there (Andy Parkins). 39 | 40 | 2003-03-28 John Elliott 41 | 42 | * zxcc-0.5.2 release. 43 | 44 | * Bug fix: BDOS function 10 now takes pointer to unsigned char, 45 | so that more than 128 bytes can be input (Andy Parkins). 46 | 47 | * Bug fixes: Add missing "break;"s to the big switch in zxbdos.c, 48 | so that functions 0x1F and 0x2E return the correct values. 49 | 50 | * Implement functions 0x1F and 0x2E when compiling under Windows. 51 | 52 | * Compile fix: Ignore the return value of sync() in cpmredir. 53 | 54 | 2001-07-27 John Elliott 55 | 56 | * zxcc-0.5.0 release. 57 | 58 | * First automake/autoconf version. 59 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | SUBDIRS= . @LSUBDIRS@ Z80 bin 4 | EXTRA_DIST= $(srcdir)/config/* $(srcdir)/zxcc.doc $(srcdir)/zxcc.html 5 | pkgdata_DATA = zxcc.doc 6 | 7 | ACLOCAL_AMFLAGS=-I m4 8 | 9 | zxcc.doc: $(srcdir)/zxcc.html 10 | lynx -dump $(srcdir)/zxcc.html > zxcc.doc 11 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | 2 | Current development occurs on Github 3 | 4 | 2012-08-01 John Elliott 5 | 6 | * zxcc-0.5.7 release. 7 | 8 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | 2 | zxcc v0.5.0 15 July 2001 3 | 4 | Documentation is in the file zxcc.doc / zxcc.html 5 | 6 | 7 | -------------------------------------------------------------------------------- /Z80/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | noinst_DATA = bios.bin 3 | EXTRA_DIST=bios.bin bios.zsm 4 | CLEANFILES = bios.lis 5 | 6 | bios.bin: bios.zsm 7 | z80asm -fb -l bios.zsm 8 | 9 | install-data-local: 10 | $(mkinstalldirs) $(DESTDIR)$(libdir)/cpm/bin80 11 | $(mkinstalldirs) $(DESTDIR)$(libdir)/cpm/lib80 12 | $(mkinstalldirs) $(DESTDIR)$(libdir)/cpm/include80 13 | $(INSTALL_DATA) $(srcdir)/bios.bin $(DESTDIR)$(libdir)/cpm/bin80/bios.bin 14 | 15 | uninstall-local: 16 | $(RM) $(DESTDIR)$(libdir)/cpm/bin80/bios.bin 17 | -------------------------------------------------------------------------------- /Z80/bios.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/Z80/bios.bin -------------------------------------------------------------------------------- /Z80/bios.zsm: -------------------------------------------------------------------------------- 1 | ; BIOS / BDOS for the ZXCC environment. 2 | ; 3 | org 0FE00h 4 | DEFB 'ZXCC04' ;Serial number 5 | ; 6 | ; Some CP/M programs expect a jump at the start of BDOS, so here it is. 7 | ; 8 | BDOS0: JP BDOS1 9 | 10 | BDOS1: LD A,0C0h 11 | DEFB 0EDh,0FEh 12 | RET 13 | ; 14 | ;This is not a real BIOS, so let its code live below the BIOS jumpblock. 15 | ; 16 | UBIOS: LD (XIX),IX 17 | POP IX ;IX = address of UBIOS function 18 | ; 19 | ; ZXCC was written on the assumption that the BIOS jumpblock was a series 20 | ; of CALL UBIOS instructions; in which case, IX would be the return address, 21 | ; or the address of the jumpblock entry plus 3. 22 | ; 23 | ; Now that the BIOS jumpblock is a true jumpblock and the CALL instructions 24 | ; are elsewhere, the offset is relative to BIOS2 rather than CONST0. So 25 | ; adjust the offset. 26 | ; 27 | PUSH DE 28 | LD DE,CONST0 - BIOS2 29 | ADD IX,DE 30 | POP DE 31 | LD A,0C3h ;C3h = BIOS call 32 | DEFB 0EDh,0FEh ;ZXCC trap; IX = BIOS function 33 | LD IX,(XIX) 34 | RET 35 | ; 36 | XIX: DEFW 0 37 | 38 | CBOOT: LD HL,WBOOT0 ;ZXCC cold boot: Initialise the Zero Page. 39 | LD (1),HL 40 | LD HL,BDOS0 41 | LD (6),HL 42 | LD A,0C3h 43 | LD (0),A 44 | LD (5),A 45 | LD A,0C9h 46 | LD (038h),A 47 | LD A,0C1h ;C1h = program load 48 | DEFB 0EDh,0FEh 49 | LD HL,0 50 | PUSH HL ;In case called program tries to RET 51 | JP 0100h 52 | ; 53 | WBOOT: LD A,0C3h ;Program termination 54 | LD IX,6 ;BIOS call 1 55 | DEFB 0EDh,0FEh 56 | HALT 57 | JP $ 58 | ; 59 | ; Implementation of all other BIOS functions 60 | ; 61 | BIOS2: CALL UBIOS 62 | BIOS3: CALL UBIOS 63 | BIOS4: CALL UBIOS 64 | BIOS5: CALL UBIOS 65 | BIOS6: CALL UBIOS 66 | BIOS7: CALL UBIOS 67 | BIOS8: CALL UBIOS 68 | BIOS9: CALL UBIOS 69 | BIOS10: CALL UBIOS 70 | BIOS11: CALL UBIOS 71 | BIOS12: CALL UBIOS 72 | BIOS13: CALL UBIOS 73 | BIOS14: CALL UBIOS 74 | BIOS15: CALL UBIOS 75 | BIOS16: CALL UBIOS 76 | BIOS17: CALL UBIOS 77 | BIOS18: CALL UBIOS 78 | BIOS19: CALL UBIOS 79 | BIOS20: CALL UBIOS 80 | BIOS21: CALL UBIOS 81 | BIOS22: CALL UBIOS 82 | BIOS23: CALL UBIOS 83 | BIOS24: CALL UBIOS 84 | BIOS25: CALL UBIOS 85 | BIOS26: CALL UBIOS 86 | BIOS27: CALL UBIOS 87 | BIOS28: CALL UBIOS 88 | BIOS29: CALL UBIOS 89 | BIOS30: CALL UBIOS 90 | BIOS31: CALL UBIOS 91 | BIOS32: CALL UBIOS 92 | ; 93 | ; 94 | org 0FEECh 95 | tmpdrv: defb 0FFh ;Temp drive = current 96 | 97 | 98 | ; 99 | ;TODO: SCB at FE9Ch 100 | ; 101 | 102 | ; 103 | ; Mallard BASIC (and maybe other programs) assumes that the BIOS 104 | ; jumpblock is a list of jumps, not calls. So rather than composing the 105 | ; BIOS jumpblock of a sequence of CALL UBIOS, it's now a sequence 106 | ; of jumps to CALL UBIOS. 107 | ; 108 | org 0FF00h 109 | JP CBOOT ;FF00 110 | WBOOT0: JP WBOOT ;03 111 | CONST0: JP BIOS2 112 | JP BIOS3 113 | JP BIOS4 114 | JP BIOS5 115 | JP BIOS6 116 | JP BIOS7 117 | JP BIOS8 118 | JP BIOS9 119 | JP BIOS10 120 | JP BIOS11 121 | JP BIOS12 122 | JP BIOS13 123 | JP BIOS14 124 | JP BIOS15 125 | JP BIOS16 126 | JP BIOS17 127 | JP BIOS18 128 | JP BIOS19 129 | JP BIOS20 130 | JP BIOS21 131 | JP BIOS22 132 | JP BIOS23 133 | JP BIOS24 134 | JP BIOS25 135 | JP BIOS26 136 | JP BIOS27 137 | JP BIOS28 138 | JP BIOS29 139 | JP BIOS30 140 | JP BIOS31 141 | JP BIOS32 142 | ; 143 | org 0FFC0h ;Space for DPB 144 | dpb: defs 20h 145 | 146 | END 147 | 148 | -------------------------------------------------------------------------------- /bin/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | bin_PROGRAMS=zxcc zxc zxas zxlibr zxlink zxobjtohex 3 | 4 | zxc_SOURCES=zxc.c 5 | zxas_SOURCES=zxas.c 6 | zxlibr_SOURCES=zxlibr.c 7 | zxobjtohex_SOURCES=zxobjtohex.c 8 | zxcc_SOURCES=zxbdos.c zxcbdos.c zxdbdos.c zxcc.c \ 9 | z80.c z80.h z80ops.h cbops.h edops.h \ 10 | zxbdos.h zxcc.h zxcbdos.h zxdbdos.h 11 | -------------------------------------------------------------------------------- /bin/cbops.h: -------------------------------------------------------------------------------- 1 | /* Emulations of the CB operations of the Z80 instruction set. 2 | * Copyright (C) 1994 Ian Collier. 3 | * 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program; if not, write to the Free Software 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 | */ 18 | 19 | #define var_t unsigned char t 20 | #define rlc(x) (x=(x<<1)|(x>>7),rflags(x,x&1)) 21 | #define rrc(x) do{var_t=x&1;x=(x>>1)|(t<<7);rflags(x,t);}while(0) 22 | #define rl(x) do{var_t=x>>7;x=(x<<1)|(f&1);rflags(x,t);}while(0) 23 | #define rr(x) do{var_t=x&1;x=(x>>1)|(f<<7);rflags(x,t);}while(0) 24 | #define sla(x) do{var_t=x>>7;x<<=1;rflags(x,t);}while(0) 25 | #define sra(x) do{var_t=x&1;x=((signed char)x)>>1;rflags(x,t);}while(0) 26 | #define sll(x) do{var_t=x>>7;x=(x<<1)|1;rflags(x,t);}while(0) 27 | #define srl(x) do{var_t=x&1;x>>=1;rflags(x,t);}while(0) 28 | 29 | #define rflags(x,c) (f=(c)|(x&0xa8)|((!x)<<6)|parity(x)) 30 | 31 | #define bit(n,x) (f=(f&1)|((x&(1<>3)&7; 122 | switch(op&0xc7){ 123 | case 0x40: bit(n,b); break; 124 | case 0x41: bit(n,c); break; 125 | case 0x42: bit(n,d); break; 126 | case 0x43: bit(n,e); break; 127 | case 0x44: bit(n,h); break; 128 | case 0x45: bit(n,l); break; 129 | case 0x46: tstates+=4;val=fetch(addr);bit(n,val);store(addr,val);break; 130 | case 0x47: bit(n,a); break; 131 | case 0x80: res(n,b); break; 132 | case 0x81: res(n,c); break; 133 | case 0x82: res(n,d); break; 134 | case 0x83: res(n,e); break; 135 | case 0x84: res(n,h); break; 136 | case 0x85: res(n,l); break; 137 | case 0x86: tstates+=4;val=fetch(addr);res(n,val);store(addr,val);break; 138 | case 0x87: res(n,a); break; 139 | case 0xc0: set(n,b); break; 140 | case 0xc1: set(n,c); break; 141 | case 0xc2: set(n,d); break; 142 | case 0xc3: set(n,e); break; 143 | case 0xc4: set(n,h); break; 144 | case 0xc5: set(n,l); break; 145 | case 0xc6: tstates+=4;val=fetch(addr);set(n,val);store(addr,val);break; 146 | case 0xc7: set(n,a); break; 147 | } 148 | } 149 | if(ixoriy)switch(reg){ 150 | case 0:b=val; break; 151 | case 1:c=val; break; 152 | case 2:d=val; break; 153 | case 3:e=val; break; 154 | case 4:h=val; break; 155 | case 5:l=val; break; 156 | case 7:a=val; break; 157 | } 158 | } 159 | 160 | #undef var_t 161 | #undef rlc 162 | #undef rrc 163 | #undef rl 164 | #undef rr 165 | #undef sla 166 | #undef sra 167 | #undef sll 168 | #undef srl 169 | #undef rflags 170 | #undef bit 171 | #undef set 172 | #undef res 173 | -------------------------------------------------------------------------------- /bin/z80.h: -------------------------------------------------------------------------------- 1 | /* Miscellaneous definitions for xz80, copyright (C) 1994 Ian Collier. 2 | * 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program; if not, write to the Free Software 15 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 16 | */ 17 | 18 | /* [John Elliott, 15 July 2001] 19 | * Copied this file into ZXCC, a CP/M emulator. 20 | * Since ZXCC's memory is a flat 64k space and will never be bank-switched, 21 | * the bank-switching code is removed. 22 | * Since ZXCC has no memory-mapped screen, all the screen management code 23 | * goes as well. 24 | * Since ZXCC doesn't need its speed regulated, all the speed regulation 25 | * code goes as well. 26 | * Since ZXCC doesn't save or load snapshots... OK, you get the idea. 27 | */ 28 | 29 | #ifdef HAVE_SYS_PARAM_H 30 | #include 31 | #endif 32 | 33 | #define Z80_quit 1 34 | #define Z80_NMI 2 35 | #define Z80_reset 3 36 | #define Z80_load 4 37 | #define Z80_save 5 38 | #define Z80_log 6 39 | 40 | unsigned int in(); 41 | unsigned int out(); 42 | int interrupt(); 43 | int snapload(); 44 | void snapsave(); 45 | void mainloop(word xpc, word xsp); 46 | void eachframe(); 47 | void itimeron(); 48 | void itimeroff(); 49 | void startwatch(); 50 | unsigned long stopwatch(); 51 | void requester(); 52 | int loader(); 53 | int saver(); 54 | void multiloader(); 55 | void usage(); 56 | void version(); 57 | void drawborder(); 58 | 59 | #define fetch(x) (RAM[x]) 60 | #define fetch2(x) ((fetch((x)+1)<<8)|fetch(x)) 61 | 62 | #define store(x,y) do { RAM[(x)] = (y); } while(0) 63 | 64 | #define store2b(x,hi,lo) do {\ 65 | RAM[(x)]=(lo); \ 66 | RAM[((x+1) & 0xFFFF)]=(hi); } while(0) 67 | 68 | #define store2(x,y) store2b(x,(y)>>8,y) 69 | 70 | #ifdef __GNUC__ 71 | static void inline storefunc(unsigned short ad,unsigned char b){ 72 | store(ad,b); 73 | } 74 | #undef store 75 | #define store(x,y) storefunc(x,y) 76 | 77 | static void inline store2func(unsigned short ad,unsigned char b1,unsigned char b2){ 78 | store2b(ad,b1,b2); 79 | } 80 | #undef store2b 81 | #define store2b(x,hi,lo) store2func(x,hi,lo) 82 | #endif 83 | 84 | #define bc ((b<<8)|c) 85 | #define de ((d<<8)|e) 86 | #define hl ((h<<8)|l) 87 | -------------------------------------------------------------------------------- /bin/zxas.c: -------------------------------------------------------------------------------- 1 | 2 | #include "zxcc.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | static char cmdbuf[1024]; 10 | 11 | int fname_opt(char *arg, char c) 12 | { 13 | if ((arg[1] == c || arg[1] == toupper(c)) && arg[2]) 14 | { 15 | sprintf(cmdbuf + strlen(cmdbuf), "-%c +%s", c, arg + 2); 16 | strcat(cmdbuf," "); 17 | return 1; 18 | } 19 | return 0; 20 | } 21 | 22 | int main(int argc, char **argv) 23 | { 24 | int n; 25 | 26 | strcpy(cmdbuf,"zxcc zas.com "); 27 | for (n = 1; n < argc; n++) 28 | { 29 | if (argv[n][0] == '-') /* An option */ 30 | { 31 | strcat(cmdbuf,"-"); 32 | 33 | /* The following options can take filenames */ 34 | 35 | if (fname_opt(argv[n], 'o')) continue; 36 | if (fname_opt(argv[n], 'l')) continue; 37 | } 38 | strcat(cmdbuf,argv[n]); 39 | strcat(cmdbuf," "); 40 | } 41 | return system(cmdbuf); 42 | } 43 | -------------------------------------------------------------------------------- /bin/zxbdos.h: -------------------------------------------------------------------------------- 1 | extern char *progname; 2 | extern char **argv; 3 | extern int argc; 4 | 5 | extern byte cpm_drive; 6 | extern byte cpm_user; 7 | 8 | extern byte RAM[65536]; /* The Z80's address space */ 9 | 10 | extern void Msg(char *s, ...); 11 | 12 | #ifdef BDOS_DEF 13 | 14 | word cpm_dma = 0x80; /* DMA address */ 15 | byte err_mode = 0xFF; 16 | byte rec_multi = 1; 17 | word rec_len = 128; 18 | word ffirst_fcb = 0xFFFF; 19 | byte cpm_error = 0; /* Error code returned by CP/M */ 20 | 21 | #else /* BDOS_DEF */ 22 | 23 | extern word cpm_dma, rec_len, ffirst_fcb; 24 | extern byte err_mode, rec_multi, cpm_error; 25 | 26 | #endif /* BDOS_DEF */ 27 | 28 | #ifndef O_BINARY /* Necessary in DOS, not present in Linux */ 29 | #define O_BINARY 0 30 | #endif 31 | 32 | typedef unsigned long dword; 33 | 34 | /* Functions in zxbdos.c */ 35 | 36 | void wr24(word addr, dword v); 37 | void wr32(word addr, dword v); 38 | dword rd24(word addr); 39 | dword rd32(word addr); 40 | dword cpmtime(time_t t); 41 | word cpm_errcde(word DE); 42 | 43 | #ifdef USE_CPMGSX 44 | gsx_byte gsxrd(gsx_word addr); 45 | void gsxwr(gsx_word addr, gsx_byte value); 46 | #endif 47 | 48 | void cpmbdos(); 49 | void cpmbios(); 50 | 51 | -------------------------------------------------------------------------------- /bin/zxc.c: -------------------------------------------------------------------------------- 1 | 2 | #include "zxcc.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | static char cmdbuf[1024]; 10 | 11 | int fname_opt(char *arg, char c) 12 | { 13 | if ((arg[1] == c || arg[1] == toupper(c)) && arg[2]) 14 | { 15 | sprintf(cmdbuf + strlen(cmdbuf), "-%c +%s", c, arg + 2); 16 | strcat(cmdbuf," "); 17 | return 1; 18 | } 19 | return 0; 20 | } 21 | 22 | int cref_opt(char *arg) 23 | { 24 | if ((arg[1] == 'c' || arg[1] == 'C') && 25 | (arg[2] == 'r' || arg[2] == 'R') && arg[3]) 26 | { 27 | strcat(cmdbuf, "-cr +"); 28 | strcat(cmdbuf, arg + 3); 29 | strcat(cmdbuf, " "); 30 | return 1; 31 | } 32 | return 0; 33 | } 34 | 35 | 36 | 37 | int main(int argc, char **argv) 38 | { 39 | int n; 40 | 41 | /* note c: is predefined as the default include directory 42 | * in zxcc. So use it 43 | */ 44 | strcpy(cmdbuf, "zxcc c.com --IC: "); 45 | 46 | for (n = 1; n < argc; n++) 47 | { 48 | if (argv[n][0] == '-') /* An option */ 49 | { 50 | strcat(cmdbuf,"-"); 51 | 52 | /* The following options can take filenames */ 53 | 54 | if (fname_opt(argv[n], 'e')) continue; /* executable */ 55 | if (fname_opt(argv[n], 'f')) continue; /* symbol */ 56 | if (fname_opt(argv[n], 'i')) continue; /* include dir */ 57 | if (fname_opt(argv[n], 'm')) continue; /* map */ 58 | if (cref_opt(argv[n])) continue; /* cross-referencce */ 59 | } 60 | strcat(cmdbuf,argv[n]); 61 | strcat(cmdbuf," "); 62 | } 63 | return system(cmdbuf); 64 | } 65 | 66 | -------------------------------------------------------------------------------- /bin/zxcbdos.c: -------------------------------------------------------------------------------- 1 | #include "zxcc.h" 2 | #include "zxbdos.h" 3 | #include "zxcbdos.h" 4 | 5 | #ifdef __MSDOS__ 6 | #include 7 | #endif 8 | 9 | /* Line input */ 10 | /* modified to allow 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #if HAVE_UNISTD_H 57 | #include 58 | #endif 59 | #include 60 | #include 61 | #ifdef __MSDOS 62 | #include 63 | #endif 64 | 65 | /* Library includes */ 66 | 67 | #ifdef USE_CPMIO 68 | #include "cpmio.h" 69 | #endif 70 | 71 | #ifdef USE_CPMGSX 72 | #include "cpmgsx.h" 73 | #endif 74 | 75 | #include /* BDOS disc simulation */ 76 | 77 | typedef unsigned char byte; /* Must be exactly 8 bits */ 78 | typedef unsigned short word; /* Must be exactly 16 bits */ 79 | 80 | /* Prototypes */ 81 | 82 | void ed_fe (byte *a, byte *b, byte *c, byte *d, byte *e, byte *f, 83 | byte *h, byte *l, word *pc, word *ix, word *iy); 84 | void cpmbdos(byte *a, byte *b, byte *c, byte *d, byte *e, byte *f, 85 | byte *h, byte *l, word *pc, word *ix, word *iy); 86 | void cpmbios(byte *a, byte *b, byte *c, byte *d, byte *e, byte *f, 87 | byte *h, byte *l, word *pc, word *ix, word *iy); 88 | void dump_regs(FILE *fp, byte a, byte b, byte c, byte d, byte e, byte f, 89 | byte h, byte l, word pc, word ix, word iy); 90 | void Msg(char *s, ...); 91 | int zxcc_term(void); 92 | void zxcc_exit(int code); 93 | 94 | /* Global variables */ 95 | 96 | extern char *progname; 97 | extern char **argv; 98 | extern int argc; 99 | extern byte RAM[65536]; /* The Z80's address space */ 100 | extern int file_conin; /* non zero if stdin not a terminal */ 101 | extern int eof_conin; /* non zero if eof of stdin */ 102 | /* Z80 CPU emulation */ 103 | 104 | #include "z80.h" 105 | 106 | -------------------------------------------------------------------------------- /bin/zxdbdos.c: -------------------------------------------------------------------------------- 1 | #include "zxcc.h" 2 | #include "zxbdos.h" 3 | #include "zxdbdos.h" 4 | 5 | /* This file used to deal with all disc-based BDOS calls. 6 | Now the calls have been moved into libcpmredir, it's a bit empty round 7 | here. 8 | 9 | ZXCC does a few odd things when searching, to make Hi-Tech C behave 10 | properly. 11 | */ 12 | 13 | 14 | /* If a file could not be found on the default drive, try again on a "search" 15 | drive (A: for .COM files, B: for .LIB and .OBJ files) */ 16 | 17 | int fcbforce(byte *fcb, byte *odrv) 18 | { 19 | byte drive; 20 | char nam[9]; 21 | char typ[4]; 22 | int n; 23 | 24 | for (n = 0; n < 8; n++) nam[n] = fcb[n+1] & 0x7F; 25 | nam[8] = 0; 26 | for (n = 0; n < 3; n++) typ[n] = fcb[n+9] & 0x7F; 27 | typ[3] = 0; 28 | 29 | drive = 0; 30 | if (*fcb) return 0; /* not using default drive */ 31 | 32 | /* Microsoft BASIC compiler run-time */ 33 | if (!strcmp(nam,"BCLOAD ") && !strcmp(typ, " ")) drive = 2; 34 | 35 | /* HI-TECH C options help file */ 36 | if (!strcmp(nam,"OPTIONS ") && !strcmp(typ, " ")) drive = 1; 37 | 38 | /* binaries, libraries and object files */ 39 | if (!strcmp(typ, "COM")) drive = 1; 40 | if (!strcmp(typ, "LIB")) drive = 2; 41 | if (!strcmp(typ, "OBJ")) drive = 2; 42 | 43 | /* some extras for messages, overlays, includes */ 44 | if (!strcmp(typ, "HLP")) drive = 1; 45 | if (!strcmp(typ, "MSG")) drive = 1; 46 | if (!strcmp(typ, "OVR")) drive = 1; 47 | if (!strcmp(typ, "REL")) drive = 2; 48 | if (!strcmp(typ, "H ")) drive = 3; 49 | 50 | if (!drive) return 0; 51 | 52 | *odrv = *fcb; 53 | *fcb = drive; 54 | return 1; 55 | } 56 | 57 | /* zxcc has a trick with some filenames: If it can't find them where they 58 | should be, and a drive wasn't specified, it searches BINDIR80, 59 | LIBDIR80 or INCDIR80 (depending on the type of the file). 60 | */ 61 | 62 | word x_fcb_open(byte *fcb, byte *dma) 63 | { 64 | word rv = fcb_open(fcb, dma); 65 | byte odrv; 66 | 67 | if (rv == 0xFF) 68 | { 69 | if (fcbforce(fcb, &odrv)) 70 | { 71 | rv = fcb_open(fcb, dma); 72 | *fcb = odrv; 73 | } 74 | } 75 | return rv; 76 | } 77 | 78 | 79 | 80 | word x_fcb_stat(byte *fcb) 81 | { 82 | word rv = fcb_stat(fcb); 83 | byte odrv; 84 | 85 | if (rv == 0xFF) 86 | { 87 | if (fcbforce(fcb, &odrv)) 88 | { 89 | rv = fcb_stat(fcb); 90 | *fcb = odrv; 91 | } 92 | } 93 | return rv; 94 | } 95 | 96 | 97 | 98 | -------------------------------------------------------------------------------- /bin/zxdbdos.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | int fcbforce(byte *fcb, byte *odrv); 5 | 6 | word x_fcb_open(byte *fcb, byte *dma); 7 | word x_fcb_stat(byte *fcb); 8 | 9 | -------------------------------------------------------------------------------- /bin/zxlibr.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | static char cmdbuf[1024]; 6 | 7 | int main(int argc, char **argv) 8 | { 9 | int n; 10 | 11 | strcpy(cmdbuf,"zxcc libr.com "); 12 | for (n = 1; n < argc; n++) 13 | { 14 | if (n == 1) /* 1st argument is an option */ 15 | { 16 | strcat(cmdbuf,"-"); 17 | } 18 | strcat(cmdbuf,argv[n]); 19 | strcat(cmdbuf," "); 20 | } 21 | return system(cmdbuf); 22 | } 23 | -------------------------------------------------------------------------------- /bin/zxlink.c: -------------------------------------------------------------------------------- 1 | 2 | #include "zxcc.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | static char cmdbuf[1024]; 10 | 11 | int fname_opt(char *arg, char c) 12 | { 13 | if ((arg[1] == c || arg[1] == toupper(c)) && arg[2]) 14 | { 15 | sprintf(cmdbuf + strlen(cmdbuf), "-%c +%s", c, arg + 2); 16 | strcat(cmdbuf," "); 17 | return 1; 18 | } 19 | return 0; 20 | } 21 | 22 | int main(int argc, char **argv) 23 | { 24 | int n; 25 | 26 | strcpy(cmdbuf,"zxcc linq.com "); 27 | for (n = 1; n < argc; n++) 28 | { 29 | if (argv[n][0] == '-') /* An option */ 30 | { 31 | strcat(cmdbuf,"-"); 32 | 33 | /* The following options can take filenames */ 34 | 35 | if (fname_opt(argv[n], 'o')) continue; 36 | if (fname_opt(argv[n], 'm')) continue; 37 | if (fname_opt(argv[n], 'd')) continue; 38 | } 39 | strcat(cmdbuf,argv[n]); 40 | strcat(cmdbuf," "); 41 | } 42 | return system(cmdbuf); 43 | } 44 | -------------------------------------------------------------------------------- /bin/zxobjtohex.c: -------------------------------------------------------------------------------- 1 | 2 | #include "zxcc.h" 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | static char cmdbuf[1024]; 10 | 11 | 12 | int main(int argc, char **argv) 13 | { 14 | int n; 15 | 16 | strcpy(cmdbuf,"zxcc objtohex.com "); 17 | for (n = 1; n < argc; n++) 18 | { 19 | if (argv[n][0] == '-') /* An option */ 20 | strcat(cmdbuf,"-"); 21 | strcat(cmdbuf,argv[n]); 22 | strcat(cmdbuf," "); 23 | } 24 | return system(cmdbuf); 25 | } 26 | -------------------------------------------------------------------------------- /changes.md: -------------------------------------------------------------------------------- 1 | # Recent changes 2 | 3 | These notes record some of the recent changes to ZXCC 4 | 5 | 26-Dec-2021 6 | 7 | ZXCC now works under Windows (32 & 64bit). There is a Visual Studio solution file under winbuild. 8 | 9 | Key changes & bug fixes 10 | 11 | 1) For Windows, some operations e.g. delete file and rename file can fail if a file is still open. To avoid this a level of open file tracking is now done, which can be used to force close open files, prior to delete, rename or truncation. It is optional for non Windows builds, however it does reduce the number of open file handles. 12 | 2) truncate and fcb_sdate are now supported 13 | 3) basic file attributes are supported i.e. hidden, system and archive 14 | 4) fcb_randwr - bug fix to make sure that the file length calculation takes into account the sector(s) just written 15 | 5) fcb_randwz - to implement this correctly requires tracking of sparse files. The previous solutions padded a file with zeros up to the new write point, if required. As this is effectively the default behaviour for lseek anyway, the function now just calls fcb_randwr. 16 | 6) fcb_randrd - now pads last partial sector to 128 bytes if eof if reached on multi sector read 17 | 7) bdos_rdline - modified to support redirect of stdin from a file and to handle \r\n correctly under unix variants 18 | 8) A number of conditional compilation checks have been simplified, including where specific Microsoft library capability is used, which is handled differently by CYGWIN etc. 19 | 9) The ability to modify the search path, using environmental variables, has been extended to allow for a single environment variable to be used as a prefix for the bin80, lib80 and include80 directories. 20 | 21 | Mark Ogden -------------------------------------------------------------------------------- /config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DLFCN_H 5 | 6 | /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ 7 | #undef HAVE_DOPRNT 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_FCNTL_H 11 | 12 | /* Define to 1 if you have the header file. */ 13 | #undef HAVE_INTTYPES_H 14 | 15 | /* Define to 1 if you have the `curses' library (-lcurses). */ 16 | #undef HAVE_LIBCURSES 17 | 18 | /* Define to 1 if you have the `ncurses' library (-lncurses). */ 19 | #undef HAVE_LIBNCURSES 20 | 21 | /* Define to 1 if you have the `readline' library (-lreadline). */ 22 | #undef HAVE_LIBREADLINE 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_MEMORY_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_STDINT_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_STDLIB_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_STRINGS_H 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #undef HAVE_STRING_H 38 | 39 | /* Define to 1 if you have the `strstr' function. */ 40 | #undef HAVE_STRSTR 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_SYS_PARAM_H 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #undef HAVE_SYS_STAT_H 47 | 48 | /* Define to 1 if you have the header file. */ 49 | #undef HAVE_SYS_TYPES_H 50 | 51 | /* Define to 1 if you have the header file. */ 52 | #undef HAVE_UNISTD_H 53 | 54 | /* Define to 1 if you have the `vprintf' function. */ 55 | #undef HAVE_VPRINTF 56 | 57 | /* Define to the sub-directory where libtool stores uninstalled libraries. */ 58 | #undef LT_OBJDIR 59 | 60 | /* Name of package */ 61 | #undef PACKAGE 62 | 63 | /* Define to the address where bug reports for this package should be sent. */ 64 | #undef PACKAGE_BUGREPORT 65 | 66 | /* Define to the full name of this package. */ 67 | #undef PACKAGE_NAME 68 | 69 | /* Define to the full name and version of this package. */ 70 | #undef PACKAGE_STRING 71 | 72 | /* Define to the one symbol short name of this package. */ 73 | #undef PACKAGE_TARNAME 74 | 75 | /* Define to the home page for this package. */ 76 | #undef PACKAGE_URL 77 | 78 | /* Define to the version of this package. */ 79 | #undef PACKAGE_VERSION 80 | 81 | /* Define to 1 if you have the ANSI C header files. */ 82 | #undef STDC_HEADERS 83 | 84 | /* Version number of package */ 85 | #undef VERSION 86 | 87 | /* Define to `long int' if does not define. */ 88 | #undef off_t 89 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | AC_INIT([zxcc],[0.5.7]) 3 | AC_CONFIG_SRCDIR([bin/zxcc.c]) 4 | AC_CONFIG_AUX_DIR(config) 5 | AC_CONFIG_MACRO_DIR([m4]) 6 | UPDATED='December 28, 2013' 7 | AC_CONFIG_HEADERS([config.h]) 8 | AM_INIT_AUTOMAKE 9 | LT_INIT 10 | 11 | dnl Get an absolute version of $srcdir and . 12 | 13 | LSUBDIRS="" 14 | DSTROOT=`pwd` 15 | if test x"$srcdir" = x 16 | then 17 | SRCROOT=`pwd` 18 | else 19 | cd $srcdir 20 | SRCROOT=`pwd` 21 | cd $DSTROOT 22 | fi 23 | 24 | 25 | AC_ARG_WITH(readline, [ --with-readline Use GNU Readline for line input (no)]) 26 | AC_ARG_WITH(cpmio, [ --with-cpmio Use CPMIO library for output (yes)]) 27 | 28 | dnl Checks for programs. 29 | AC_PROG_CC 30 | 31 | if test x"$with_readline" = xyes 32 | then 33 | CPPFLAGS="$CPPFLAGS -DUSE_READLINE" 34 | AC_CHECK_LIB(readline, readline) 35 | fi 36 | 37 | dnl If using CPMIO, add it to libs. Can't use AC_CHECK_LIB because 38 | dnl CPMIO hasn't been built yet. 39 | if test x"$with_cpmio" != xno 40 | then 41 | AC_CHECK_LIB(ncurses, printw) 42 | AC_CHECK_LIB(curses, printw) 43 | CPPFLAGS="$CPPFLAGS -I$SRCROOT/cpmio/include -DUSE_CPMIO" 44 | LDFLAGS="$LDFLAGS -L$DSTROOT/cpmio/lib" 45 | LSUBDIRS="$LSUBDIRS cpmio" 46 | fi 47 | 48 | dnl CPMREDIR isn't conditional, so just add it 49 | CPPFLAGS="$CPPFLAGS -I$SRCROOT/cpmredir/include" 50 | LDFLAGS="$LDFLAGS -L$DSTROOT/cpmredir/lib" 51 | LSUBDIRS="$LSUBDIRS cpmredir" 52 | 53 | dnl General preprocessor symbols 54 | CPPFLAGS="$CPPFLAGS -DZXCC" 55 | 56 | dnl Checks for libraries. 57 | dnl 58 | dnl Actually, we can't, because the libraries haven't been built yet. 59 | dnl 60 | dnl AC_CHECK_LIB(cpmio, cpm_const) 61 | dnl AC_CHECK_LIB(cpmredir, fcb_drive) 62 | 63 | dnl Checks for header files. 64 | AC_CHECK_HEADERS(fcntl.h unistd.h sys/param.h) 65 | 66 | dnl Checks for typedefs, structures, and compiler characteristics. 67 | AC_TYPE_OFF_T 68 | 69 | dnl Checks for library functions. 70 | AC_FUNC_VPRINTF 71 | AC_CHECK_FUNCS(strstr) 72 | 73 | 74 | AC_SUBST(LSUBDIRS) 75 | AC_CONFIG_SUBDIRS([cpmio cpmredir]) 76 | 77 | dnl Location of the ZXCC library directories 78 | dnl CPPFLAGS="$CPPFLAGS -DLIBROOT=\"$libdir/cpm/\"" 79 | CPPFLAGS="$CPPFLAGS -DBINDIR80=\\\"$libdir/cpm/bin80/\\\"" 80 | CPPFLAGS="$CPPFLAGS -DLIBDIR80=\\\"$libdir/cpm/lib80/\\\"" 81 | CPPFLAGS="$CPPFLAGS -DINCDIR80=\\\"$libdir/cpm/include80/\\\"" 82 | 83 | dnl Do this last, because adding "-lcpmio" to libraries when there isn't 84 | dnl in fact a CPMIO library built yet will make other tests go funny. 85 | if test x"$with_cpmio" != xno 86 | then 87 | LIBS="-lcpmio $LIBS" 88 | fi 89 | LIBS="-lcpmredir $LIBS" 90 | 91 | AC_CONFIG_FILES([Makefile bin/Makefile Z80/Makefile ]) 92 | AC_OUTPUT 93 | 94 | -------------------------------------------------------------------------------- /cpmio/AUTHORS: -------------------------------------------------------------------------------- 1 | 2 | * John Elliott 3 | Original Author. 4 | 5 | * Tony Nicholson (agn453) 6 | * Mark Ogden (ogdenpm) 7 | -------------------------------------------------------------------------------- /cpmio/ChangeLog: -------------------------------------------------------------------------------- 1 | 2 | 2012-08-01 John Elliott 3 | 4 | * zxcc-0.5.7 release. 5 | 6 | -------------------------------------------------------------------------------- /cpmio/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | SUBDIRS= . include lib check 4 | 5 | EXTRA_DIST= $(srcdir)/config/* 6 | 7 | ACLOCAL_AMFLAGS=-I m4 8 | -------------------------------------------------------------------------------- /cpmio/NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/cpmio/NEWS -------------------------------------------------------------------------------- /cpmio/check/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | AM_CPPFLAGS=-I$(top_srcdir)/include 4 | LDADD=../lib/libcpmio.a 5 | 6 | check_PROGRAMS = testio 7 | testio_SOURCES = testio.c 8 | 9 | -------------------------------------------------------------------------------- /cpmio/check/testio.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CPMIO: CP/M console emulation library 4 | Copyright (C) 1998 - 1999, John Elliott 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public 17 | License along with this library; if not, write to the Free 18 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | 20 | */ 21 | 22 | /* This program is not part of the library itself; it tests some features 23 | of the VT52 emulation. 24 | */ 25 | 26 | #include 27 | #include 28 | #include "cpmio.h" 29 | 30 | static int native = 0, termios = 0; 31 | 32 | void conout(char c) 33 | { 34 | if (native) putchar(c); 35 | else cpm_conout(c); 36 | } 37 | 38 | 39 | char conin(void) 40 | { 41 | if (native) return getchar(); 42 | else return cpm_conin(); 43 | } 44 | 45 | 46 | void vt52_move(int y, int x) 47 | { 48 | conout(27); 49 | conout('Y'); 50 | conout(y+32); 51 | conout(x+32); 52 | } 53 | 54 | void cpm_print(char *s) 55 | { 56 | while (*s) conout(*s++); 57 | } 58 | 59 | 60 | void esc(char c) 61 | { 62 | conout(27); conout(c); 63 | } 64 | 65 | 66 | void compass(void) 67 | { 68 | esc('E'); 69 | vt52_move(0,30); cpm_print("NW N NE"); 70 | vt52_move(1,30); cpm_print(" \\ | / "); 71 | vt52_move(2,30); cpm_print(" \\ | / "); 72 | vt52_move(3,30); cpm_print(" \\ | / "); 73 | vt52_move(4,30); cpm_print(" \\|/ "); 74 | vt52_move(5,30); cpm_print("W----O----E"); 75 | vt52_move(6,30); cpm_print(" /|\\ "); 76 | vt52_move(7,30); cpm_print(" / | \\ "); 77 | vt52_move(8,30); cpm_print(" / | \\ "); 78 | vt52_move(9,30); cpm_print(" / | \\ "); 79 | vt52_move(10,30);cpm_print("SW S SE"); 80 | 81 | esc('p'); 82 | vt52_move(5,35); conout('*'); 83 | esc('q'); 84 | vt52_move(15,0); 85 | } 86 | 87 | void compass_tests(void) 88 | { 89 | compass(); 90 | cpm_print("Cursor positioning"); 91 | conin(); 92 | compass(); 93 | vt52_move(5,36); esc('K'); 94 | vt52_move(15,0); cpm_print("Delete to EOL"); 95 | conin(); 96 | compass(); 97 | vt52_move(5,36); esc('J'); 98 | vt52_move(15,0); cpm_print("Delete to EOS"); 99 | conin(); 100 | compass(); 101 | vt52_move(5,35); esc('o'); 102 | vt52_move(15,0); cpm_print("Delete to BOL"); 103 | conin(); 104 | compass(); 105 | vt52_move(5,35); esc('d'); 106 | vt52_move(15,0); cpm_print("Delete to BOS"); 107 | cpm_print("\r\nPress SPACE for scrolling tests"); 108 | conin(); 109 | esc('E'); 110 | } 111 | 112 | void scrolling_tests() 113 | { 114 | char s[20]; 115 | int n; 116 | 117 | esc('H'); 118 | for (n = 0; n < 30; n++) 119 | { 120 | if (n > 23) conin(); 121 | sprintf(s, "%d\r\n", n); 122 | cpm_print(s); 123 | } 124 | conin(); 125 | } 126 | 127 | 128 | 129 | int main(int argc, char **argv) 130 | { 131 | char c; 132 | 133 | if (argc > 1 && (!strcmp(argv[1], "-native"))) native = 1; 134 | if (argc > 1 && (!strcmp(argv[1], "-termios"))) termios = 1; 135 | 136 | if (!native) 137 | { 138 | cpm_scr_init(); 139 | if (termios) cpm_set_terminal("TERMIOS"); 140 | else cpm_set_terminal("VT52"); 141 | } 142 | cpm_print("Press SPACE to do the compass rose tests"); 143 | conin(); 144 | compass_tests(); 145 | scrolling_tests(); 146 | 147 | cpm_print("Hello "); 148 | esc('p'); 149 | cpm_print("World"); 150 | esc('q'); 151 | cpm_print("!"); 152 | esc('Y'); 153 | cpm_print("$*"); 154 | esc('r'); 155 | cpm_print("<<-->>"); 156 | esc('u'); 157 | esc('s'); 158 | cpm_print("@@@@@"); 159 | esc('t'); 160 | 161 | esc('('); 162 | cpm_print("*****"); 163 | esc(')'); 164 | 165 | cpm_print("Press SPACE to do keyboard input tests"); 166 | 167 | conin(); 168 | 169 | esc('E'); 170 | esc('H'); 171 | cpm_print("Press keypad keys to see the characters they produce. SPACE" 172 | " finishes.\r\n"); 173 | while((c = conin()) != ' ') 174 | { 175 | if (c < 32) { conout('^'); conout(c + '@'); } 176 | else conout(c); 177 | } 178 | 179 | if (!native) cpm_scr_unit(); 180 | return 0; 181 | } 182 | -------------------------------------------------------------------------------- /cpmio/config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_CURSES_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_DLFCN_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #undef HAVE_INTTYPES_H 11 | 12 | /* Define to 1 if you have the `readline' library (-lreadline). */ 13 | #undef HAVE_LIBREADLINE 14 | 15 | /* Define to 1 if you have the header file. */ 16 | #undef HAVE_MEMORY_H 17 | 18 | /* Define to 1 if you have the header file. */ 19 | #undef HAVE_NCURSES_H 20 | 21 | /* Define to 1 if you have the `select' function. */ 22 | #undef HAVE_SELECT 23 | 24 | /* Define to 1 if you have the header file. */ 25 | #undef HAVE_STDINT_H 26 | 27 | /* Define to 1 if you have the header file. */ 28 | #undef HAVE_STDLIB_H 29 | 30 | /* Define to 1 if you have the header file. */ 31 | #undef HAVE_STRINGS_H 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_STRING_H 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #undef HAVE_SYS_STAT_H 38 | 39 | /* Define to 1 if you have the header file. */ 40 | #undef HAVE_SYS_TIME_H 41 | 42 | /* Define to 1 if you have the header file. */ 43 | #undef HAVE_SYS_TYPES_H 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #undef HAVE_UNISTD_H 47 | 48 | /* Define to the sub-directory where libtool stores uninstalled libraries. */ 49 | #undef LT_OBJDIR 50 | 51 | /* Name of package */ 52 | #undef PACKAGE 53 | 54 | /* Define to the address where bug reports for this package should be sent. */ 55 | #undef PACKAGE_BUGREPORT 56 | 57 | /* Define to the full name of this package. */ 58 | #undef PACKAGE_NAME 59 | 60 | /* Define to the full name and version of this package. */ 61 | #undef PACKAGE_STRING 62 | 63 | /* Define to the one symbol short name of this package. */ 64 | #undef PACKAGE_TARNAME 65 | 66 | /* Define to the home page for this package. */ 67 | #undef PACKAGE_URL 68 | 69 | /* Define to the version of this package. */ 70 | #undef PACKAGE_VERSION 71 | 72 | /* Define to 1 if you have the ANSI C header files. */ 73 | #undef STDC_HEADERS 74 | 75 | /* Version number of package */ 76 | #undef VERSION 77 | -------------------------------------------------------------------------------- /cpmio/configure.ac: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | AC_INIT([cpmio],[1.1.1]) 3 | AC_CONFIG_SRCDIR([lib/cpmio.c]) 4 | AC_CONFIG_AUX_DIR(config) 5 | AC_CONFIG_MACRO_DIR(m4) 6 | LT_INIT 7 | VERSION=1.1.1 8 | UPDATED='March 28, 2001' 9 | AM_INIT_AUTOMAKE 10 | AC_CONFIG_HEADERS([config.h]) 11 | 12 | AC_ARG_WITH(readline, 13 | [ --with-readline Use GNU readline for line input (no)]) 14 | 15 | dnl Checks for programs. 16 | AC_PROG_CC 17 | AC_PROG_CPP 18 | AC_PROG_INSTALL 19 | AC_PROG_MAKE_SET 20 | 21 | dnl Checks for libraries. 22 | AC_CHECK_LIB(ncurses, printw, LIBS="-lncurses $LIBS") 23 | AC_CHECK_LIB(curses, printw, LIBS="-lcurses $LIBS") 24 | if test x"$with_readline" = x"yes"; then 25 | CFLAGS="$CFLAGS -DUSE_READLINE" 26 | AC_CHECK_LIB(readline, readline) 27 | fi 28 | 29 | dnl Checks for header files. 30 | AC_CHECK_HEADERS(sys/time.h unistd.h) 31 | AC_CHECK_HEADERS([ncurses.h curses.h], break, AC_MSG_ERROR([either ncurses.h or curses.h is required])) 32 | 33 | dnl Checks for typedefs, structures, and compiler characteristics. 34 | 35 | dnl Checks for library functions. 36 | AC_CHECK_FUNCS(select) 37 | 38 | AC_CONFIG_FILES([Makefile lib/Makefile include/Makefile check/Makefile]) 39 | AC_OUTPUT 40 | -------------------------------------------------------------------------------- /cpmio/include/Makefile.am: -------------------------------------------------------------------------------- 1 | include_HEADERS = cpmio.h 2 | 3 | -------------------------------------------------------------------------------- /cpmio/include/cpmio.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CPMIO: CP/M console emulation library 4 | Copyright (C) 1998 - 1999, John Elliott 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public 17 | License along with this library; if not, write to the Free 18 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | 20 | */ 21 | 22 | /* CPMIO: Public interface - client programs should include this */ 23 | 24 | void cpm_scr_init(void); /* Initialise */ 25 | void cpm_scr_unit(void); /* Terminate */ 26 | 27 | /* BIOS functions */ 28 | char cpm_const(void); /* Console status */ 29 | char cpm_conin(void); /* Console input */ 30 | void cpm_conout(char c); /* Console output */ 31 | 32 | /* BDOS functions */ 33 | int cpm_bdos_1(void); /* Console input with echo 34 | * Returns -1 for break, 35 | * else character */ 36 | int cpm_bdos_2(char c); /* Console output. 37 | * Returns -1 for break, 38 | * else 0 */ 39 | int cpm_bdos_6(unsigned char c); /* Direct console access 40 | * Returns -1 for break, 41 | * else E-value */ 42 | int cpm_bdos_9(char *buf); /* Print a string. Returns 43 | * -1 for break, else 0 */ 44 | unsigned cpm_bdos_10(unsigned char *buf); /* Read a line. 45 | * Note: Calling program has to 46 | * deal with DE=0 parameter, and set 47 | * the "current length" to 0 if DE is 48 | * nonzero. Returns 0 normally, -1 if 49 | * Control-C was pressed. */ 50 | int cpm_bdos_11(void); /* Poll console. Returns 51 | * -1 for break, else 0 or 1 */ 52 | unsigned int cpm_bdos_109(unsigned int de); /* Console mode set/get */ 53 | unsigned char cpm_bdos_110(unsigned int de); /* String delimiter set/get */ 54 | int cpm_bdos_111(char *buf, unsigned int len); 55 | /* Output fixed-length string */ 56 | /* Returns -1 for break, 0 if 57 | * OK */ 58 | 59 | int cpm_bdos_set_get_typeahead(int flag); /* Set or get Typeahead flag */ 60 | 61 | 62 | char *cpm_get_terminal(void); /* Gets terminal ID */ 63 | int cpm_set_terminal(char *s); /* Sets terminal ID, eg "RAW" "VT52" */ 64 | void cpm_enum_terminals(char *s); /* List all terminal IDs */ 65 | 66 | int cpm_term_direct(int function, int param); /* Direct control of terminal */ 67 | 68 | /* Functions for term_direct: */ 69 | 70 | #define CPM_TERM_INIT 0 /* Initialise a terminal */ 71 | #define CPM_TERM_GETATTR 1 /* Get bold/reverse etc */ 72 | #define CPM_TERM_SETATTR 2 /* Set bold/reverse etc */ 73 | #define CPM_TERM_GETCOLOUR 3 /* Get screen colour as byte */ 74 | #define CPM_TERM_SETCOLOUR 4 /* Set screen colour as byte */ 75 | #define CPM_TERM_CLEAR 5 /* Clear screen */ 76 | #define CPM_TERM_MOVE 6 /* Move cursor */ 77 | #define CPM_TERM_IFCOLOUR 7 /* Is this a colour screen? */ 78 | #define CPM_TERM_CHAR 20 /* Write character */ 79 | #define CPM_TERM_HEIGHT 60 /* Get/set terminal height */ 80 | #define CPM_TERM_WRAP 61 /* Get/set wrap mode */ 81 | #define CPM_TERM_WIDTH 62 /* Get/set terminal width */ 82 | 83 | -------------------------------------------------------------------------------- /cpmio/install-sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # install - install a program, script, or datafile 4 | # This comes from X11R5 (mit/util/scripts/install.sh). 5 | # 6 | # Copyright 1991 by the Massachusetts Institute of Technology 7 | # 8 | # Permission to use, copy, modify, distribute, and sell this software and its 9 | # documentation for any purpose is hereby granted without fee, provided that 10 | # the above copyright notice appear in all copies and that both that 11 | # copyright notice and this permission notice appear in supporting 12 | # documentation, and that the name of M.I.T. not be used in advertising or 13 | # publicity pertaining to distribution of the software without specific, 14 | # written prior permission. M.I.T. makes no representations about the 15 | # suitability of this software for any purpose. It is provided "as is" 16 | # without express or implied warranty. 17 | # 18 | # Calling this script install-sh is preferred over install.sh, to prevent 19 | # `make' implicit rules from creating a file called install from it 20 | # when there is no Makefile. 21 | # 22 | # This script is compatible with the BSD install script, but was written 23 | # from scratch. It can only install one file at a time, a restriction 24 | # shared with many OS's install programs. 25 | 26 | 27 | # set DOITPROG to echo to test this script 28 | 29 | # Don't use :- since 4.3BSD and earlier shells don't like it. 30 | doit="${DOITPROG-}" 31 | 32 | 33 | # put in absolute paths if you don't have them in your path; or use env. vars. 34 | 35 | mvprog="${MVPROG-mv}" 36 | cpprog="${CPPROG-cp}" 37 | chmodprog="${CHMODPROG-chmod}" 38 | chownprog="${CHOWNPROG-chown}" 39 | chgrpprog="${CHGRPPROG-chgrp}" 40 | stripprog="${STRIPPROG-strip}" 41 | rmprog="${RMPROG-rm}" 42 | mkdirprog="${MKDIRPROG-mkdir}" 43 | 44 | transformbasename="" 45 | transform_arg="" 46 | instcmd="$mvprog" 47 | chmodcmd="$chmodprog 0755" 48 | chowncmd="" 49 | chgrpcmd="" 50 | stripcmd="" 51 | rmcmd="$rmprog -f" 52 | mvcmd="$mvprog" 53 | src="" 54 | dst="" 55 | dir_arg="" 56 | 57 | while [ x"$1" != x ]; do 58 | case $1 in 59 | -c) instcmd="$cpprog" 60 | shift 61 | continue;; 62 | 63 | -d) dir_arg=true 64 | shift 65 | continue;; 66 | 67 | -m) chmodcmd="$chmodprog $2" 68 | shift 69 | shift 70 | continue;; 71 | 72 | -o) chowncmd="$chownprog $2" 73 | shift 74 | shift 75 | continue;; 76 | 77 | -g) chgrpcmd="$chgrpprog $2" 78 | shift 79 | shift 80 | continue;; 81 | 82 | -s) stripcmd="$stripprog" 83 | shift 84 | continue;; 85 | 86 | -t=*) transformarg=`echo $1 | sed 's/-t=//'` 87 | shift 88 | continue;; 89 | 90 | -b=*) transformbasename=`echo $1 | sed 's/-b=//'` 91 | shift 92 | continue;; 93 | 94 | *) if [ x"$src" = x ] 95 | then 96 | src=$1 97 | else 98 | # this colon is to work around a 386BSD /bin/sh bug 99 | : 100 | dst=$1 101 | fi 102 | shift 103 | continue;; 104 | esac 105 | done 106 | 107 | if [ x"$src" = x ] 108 | then 109 | echo "install: no input file specified" 110 | exit 1 111 | else 112 | true 113 | fi 114 | 115 | if [ x"$dir_arg" != x ]; then 116 | dst=$src 117 | src="" 118 | 119 | if [ -d $dst ]; then 120 | instcmd=: 121 | chmodcmd="" 122 | else 123 | instcmd=mkdir 124 | fi 125 | else 126 | 127 | # Waiting for this to be detected by the "$instcmd $src $dsttmp" command 128 | # might cause directories to be created, which would be especially bad 129 | # if $src (and thus $dsttmp) contains '*'. 130 | 131 | if [ -f $src -o -d $src ] 132 | then 133 | true 134 | else 135 | echo "install: $src does not exist" 136 | exit 1 137 | fi 138 | 139 | if [ x"$dst" = x ] 140 | then 141 | echo "install: no destination specified" 142 | exit 1 143 | else 144 | true 145 | fi 146 | 147 | # If destination is a directory, append the input filename; if your system 148 | # does not like double slashes in filenames, you may need to add some logic 149 | 150 | if [ -d $dst ] 151 | then 152 | dst="$dst"/`basename $src` 153 | else 154 | true 155 | fi 156 | fi 157 | 158 | ## this sed command emulates the dirname command 159 | dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` 160 | 161 | # Make sure that the destination directory exists. 162 | # this part is taken from Noah Friedman's mkinstalldirs script 163 | 164 | # Skip lots of stat calls in the usual case. 165 | if [ ! -d "$dstdir" ]; then 166 | defaultIFS=' 167 | ' 168 | IFS="${IFS-${defaultIFS}}" 169 | 170 | oIFS="${IFS}" 171 | # Some sh's can't handle IFS=/ for some reason. 172 | IFS='%' 173 | set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` 174 | IFS="${oIFS}" 175 | 176 | pathcomp='' 177 | 178 | while [ $# -ne 0 ] ; do 179 | pathcomp="${pathcomp}${1}" 180 | shift 181 | 182 | if [ ! -d "${pathcomp}" ] ; 183 | then 184 | $mkdirprog "${pathcomp}" 185 | else 186 | true 187 | fi 188 | 189 | pathcomp="${pathcomp}/" 190 | done 191 | fi 192 | 193 | if [ x"$dir_arg" != x ] 194 | then 195 | $doit $instcmd $dst && 196 | 197 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && 198 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && 199 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && 200 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi 201 | else 202 | 203 | # If we're going to rename the final executable, determine the name now. 204 | 205 | if [ x"$transformarg" = x ] 206 | then 207 | dstfile=`basename $dst` 208 | else 209 | dstfile=`basename $dst $transformbasename | 210 | sed $transformarg`$transformbasename 211 | fi 212 | 213 | # don't allow the sed command to completely eliminate the filename 214 | 215 | if [ x"$dstfile" = x ] 216 | then 217 | dstfile=`basename $dst` 218 | else 219 | true 220 | fi 221 | 222 | # Make a temp file name in the proper directory. 223 | 224 | dsttmp=$dstdir/#inst.$$# 225 | 226 | # Move or copy the file name to the temp name 227 | 228 | $doit $instcmd $src $dsttmp && 229 | 230 | trap "rm -f ${dsttmp}" 0 && 231 | 232 | # and set any options; do chmod last to preserve setuid bits 233 | 234 | # If any of these fail, we abort the whole thing. If we want to 235 | # ignore errors from any of these, just make sure not to ignore 236 | # errors from the above "$doit $instcmd $src $dsttmp" command. 237 | 238 | if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && 239 | if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && 240 | if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && 241 | if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && 242 | 243 | # Now rename the file to the real destination. 244 | 245 | $doit $rmcmd -f $dstdir/$dstfile && 246 | $doit $mvcmd $dsttmp $dstdir/$dstfile 247 | 248 | fi && 249 | 250 | 251 | exit 0 252 | -------------------------------------------------------------------------------- /cpmio/lib/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | AM_CPPFLAGS=-I$(top_srcdir)/include 4 | 5 | lib_LIBRARIES=libcpmio.a 6 | libcpmio_a_SOURCES = conbdos.c cpmio_i.h termansi.c termcore.h \ 7 | cpmio.c iosig.c termcore.c termvt52.c 8 | -------------------------------------------------------------------------------- /cpmio/lib/cpmio_i.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CPMIO: CP/M console emulation library 4 | Copyright (C) 1998 - 1999, John Elliott 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public 17 | License along with this library; if not, write to the Free 18 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | 20 | */ 21 | 22 | /* CPMIO: Internal declarations */ 23 | #ifndef _MSC_VER 24 | #include "config.h" 25 | #include 26 | #else 27 | #include "config-win.h" 28 | // conio.h moved before curses as PDCurses has macros 29 | // that conflict with conio.h 30 | #include 31 | #include 32 | #include 33 | #undef MOUSE_MOVED /* causes conflict with PDcurses */ 34 | #define PDC_DLL_BUILD /* use the dll build of PDCurses */ 35 | #endif 36 | 37 | #ifdef HAVE_NCURSES_H 38 | #include 39 | #endif 40 | 41 | #ifdef HAVE_CURSES_H 42 | #include 43 | #endif 44 | #include 45 | #ifdef HAVE_UNISTD_H 46 | #include 47 | #endif 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | 54 | 55 | #include "cpmio.h" /* The public declarations */ 56 | 57 | #ifndef RETSIGTYPE 58 | #define RETSIGTYPE void 59 | #endif 60 | 61 | RETSIGTYPE on_sigint(int a); 62 | 63 | void cpm_console_bdos_init(void); 64 | 65 | /* Terminal emulations */ 66 | 67 | int raw_term (int func, int param); 68 | int vt52_term (int func, int param); 69 | int ansi_term (int func, int param); 70 | int generic_term(int func, int param); 71 | int termios_term(int func, int param); 72 | 73 | #define CPM_HI(x) ((x >> 8) & 0xFF) 74 | #define CPM_LO(x) (x & 0xFF) 75 | 76 | #define AT_BRIGHT 1 77 | #define AT_UNDERSCORE 2 78 | #define AT_BLINK 4 79 | #define AT_REVERSE 8 80 | 81 | #define CTL_C ('C' - '@') 82 | #define CTL_P ('P' - '@') 83 | #define CTL_Q ('Q' - '@') 84 | #define CTL_S ('S' - '@') 85 | 86 | -------------------------------------------------------------------------------- /cpmio/lib/iosig.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CPMIO: CP/M console emulation library 4 | Copyright (C) 1998 - 1999, John Elliott 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public 17 | License along with this library; if not, write to the Free 18 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | 20 | */ 21 | 22 | #include 23 | #include 24 | #include "cpmio_i.h" 25 | 26 | 27 | RETSIGTYPE on_sigint(int s) /* Called if there's a fatal signal */ 28 | { 29 | cpm_scr_unit(); /* Clear screen, end ncurses */ 30 | signal(s, SIG_DFL); 31 | raise(s); /* Re-throw */ 32 | } 33 | 34 | -------------------------------------------------------------------------------- /cpmio/lib/termcore.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CPMIO: CP/M console emulation library 4 | Copyright (C) 1998 - 1999, John Elliott 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public 17 | License along with this library; if not, write to the Free 18 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | 20 | */ 21 | 22 | /* General terminal emulation library: Declarations */ 23 | 24 | #ifdef TERM_CORE_C 25 | int core_x, core_y, core_wx, core_wy, core_ww, core_wh; 26 | int core_attr, core_fg, core_bg, core_pair, core_wrap; 27 | int core_ansi_buf[20]; 28 | int core_ansi_count; 29 | char core_ansi_char; 30 | #else 31 | extern int core_x, core_y, core_wx, core_wy, core_ww, core_wh; 32 | extern int core_attr, core_fg, core_bg, core_pair, core_wrap; 33 | extern int core_ansi_buf[20]; 34 | extern int core_ansi_count; 35 | extern char core_ansi_char; 36 | #endif 37 | 38 | 39 | void core_scroll_down(void); 40 | void core_scroll_up(void); 41 | void core_up(int scrl); 42 | void core_down(int scrl); 43 | void core_left(int wrap); 44 | void core_right(int wrap); 45 | void core_addch(char c); 46 | void core_tab(void); 47 | void core_cr(void); 48 | void core_move(int x, int y); 49 | void core_save_pos(int restore); 50 | void core_win(int tr, int lc, int h, int w); 51 | void core_24x80(void); 52 | void core_fullscr(void); 53 | void core_clrtobol(void); 54 | void core_clrline(int row); 55 | void core_clrtobos(void); 56 | void core_clrtoeol(void); 57 | void core_clrtoeos(void); 58 | void core_init(void); 59 | void core_setattr(int attr); 60 | void core_clearattr(int attr); 61 | void core_setfg(int fg); 62 | void core_setbg(int bg); 63 | void core_cursor(int type); /* 0 = none 1 = block 2 = underline */ 64 | int core_term(int func, int param); 65 | int core_ansi(char c); 66 | void core_ansi_begin(void); 67 | -------------------------------------------------------------------------------- /cpmio/lib/termvt52.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CPMIO: CP/M console emulation library 4 | Copyright (C) 1998 - 1999, John Elliott 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public 17 | License along with this library; if not, write to the Free 18 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | 20 | */ 21 | 22 | #include "cpmio_i.h" 23 | #include "termcore.h" 24 | 25 | /* VT52 Terminal emulation library. 26 | 27 | This interprets the escape codes and implements them as operations for the 28 | terminal core library. 29 | 30 | */ 31 | 32 | 33 | static int esc = 0; 34 | static int escm = 0; 35 | 36 | static char escode[10]; 37 | static char *mptr; 38 | 39 | static void vt52_win(char *s) 40 | { 41 | core_win(s[0] - 32, s[1] - 32, s[2] - 31, s[3] - 31); 42 | } 43 | 44 | 45 | 46 | static int vt52_colour(char c) 47 | { 48 | int nc = (c - 32); 49 | int r, g, b; 50 | 51 | static int colours[] = {COLOR_BLACK, COLOR_BLUE, COLOR_RED, 52 | COLOR_MAGENTA, COLOR_GREEN, COLOR_CYAN, 53 | COLOR_YELLOW, COLOR_WHITE }; 54 | 55 | /* nc is a 6-bit "Amstrad VT52" colour. */ 56 | 57 | b = (nc & 3 ) ? 1 : 0; 58 | g = (nc & 12) ? 2 : 0; 59 | r = (nc & 48) ? 4 : 0; 60 | 61 | return colours[r|g|b]; 62 | } 63 | 64 | 65 | static void multi(char ch, int n) 66 | { 67 | mptr = escode; 68 | escm = n; 69 | esc = ch; 70 | } 71 | 72 | static int do_esc(char c) 73 | { 74 | int esc1 = esc; 75 | esc = 0; 76 | 77 | if (esc1 == 27) switch(c) /* 1st char of escape code */ 78 | { 79 | case '(': core_setattr(AT_BRIGHT); return 0; 80 | case ')': core_clearattr(AT_BRIGHT); return 0; 81 | 82 | case 'A': core_up(0); return 1; 83 | case 'B': core_down(0); return 1; 84 | case 'C': core_right(0); return 1; 85 | case 'D': core_left(0); return 1; 86 | case '*': case '+': case ',': case ':': case ';': 87 | case 'E': clear(); return 1; 88 | case 'H': core_move (0,0); return 1; 89 | case 'I': core_up(1); return 1; 90 | case 'J': core_clrtoeos(); return 1; 91 | case 'K': core_clrtoeol(); return 1; 92 | case 'L': insertln(); return 1; 93 | case 'M': deleteln(); return 1; 94 | case 'N': delch(); return 1; 95 | case 'R': deleteln(); return 1; 96 | case 'X': multi('X', 4); return 0; 97 | case 'Y': multi('Y', 2); return 0; 98 | case 'b': multi('b', 1); return 0; 99 | case 'c': multi('c', 1); return 0; 100 | case 'd': core_clrtobos(); return 1; 101 | case 'e': core_cursor(1); return 0; 102 | case 'f': core_cursor(0); return 0; 103 | case 'j': core_save_pos(0); return 0; 104 | case 'k': core_save_pos(1); return 1; 105 | case 'l': core_clrline(core_y); return 1; 106 | case 'o': core_clrtobol(); return 1; 107 | case 'p': core_setattr( AT_REVERSE); return 0; 108 | case 'q': core_clearattr(AT_REVERSE); return 0; 109 | case 'r': core_setattr( AT_UNDERSCORE); return 0; 110 | case 's': core_setattr( AT_BLINK); return 0; 111 | case 't': core_clearattr(AT_BLINK); return 0; 112 | case 'u': core_clearattr(AT_UNDERSCORE); return 0; 113 | case 'w': core_wrap = 1; return 0; 114 | case 'v': core_wrap = 0; return 0; 115 | case 'x': core_24x80(); return 1; 116 | case 'y': core_fullscr(); return 1; 117 | default: core_addch(c); return 1; /* Unknown */ 118 | } 119 | else if (escm) /* 2nd, 3rd char etc. of escape code */ 120 | { 121 | esc = esc1; /* Assume more to come */ 122 | mptr[0] = c; 123 | ++mptr; 124 | --escm; 125 | if (escm) return 0; 126 | 127 | /* Multi-byte code read in */ 128 | esc = 0; 129 | switch(esc1) 130 | { 131 | case 'b': core_setfg(vt52_colour(escode[0])); return 1; 132 | case 'c': core_setbg(vt52_colour(escode[0])); return 1; 133 | case 'X': vt52_win(escode); return 1; 134 | case 'Y': core_move(escode[1] - 32, escode[0] - 32); 135 | return 1; 136 | } 137 | 138 | } 139 | core_addch(c); 140 | return 1; /* Character not processed */ 141 | } 142 | 143 | 144 | static void vt52_init(void) 145 | { 146 | core_init(); 147 | } 148 | 149 | 150 | static int vt52_char(char c) 151 | { 152 | if (esc) return do_esc(c); 153 | 154 | switch(c) 155 | { 156 | case 1: core_move(0,0); return 1; 157 | case 2: core_clearattr(AT_BRIGHT); return 0; 158 | case 26: 159 | case 4: clear(); core_move(0,0); return 1; 160 | case 8: core_left(core_wrap); return 1; 161 | case 9: core_tab(); return 1; 162 | case 10: core_down(1); return 1; 163 | case 11: core_up(0); return 1; 164 | case 12: clear(); return 1; 165 | case 13: core_cr(); return 1; 166 | case 24: core_clrtoeol(); return 1; 167 | case 27: esc = c; return 0; 168 | case 30: core_move(0,0); return 1; 169 | case 31: core_cr(); core_down(1); return 1; 170 | default: core_addch(c); return 1; 171 | } 172 | return 0; 173 | } 174 | 175 | int vt52_term(int func, int param) 176 | { 177 | switch(func) 178 | { 179 | case CPM_TERM_INIT: vt52_init(); return 1; 180 | case CPM_TERM_CHAR: return vt52_char(param); 181 | default: return core_term(func, param); 182 | } 183 | return 0; 184 | } 185 | 186 | 187 | -------------------------------------------------------------------------------- /cpmio/m4/ltsugar.m4: -------------------------------------------------------------------------------- 1 | # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- 2 | # 3 | # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. 4 | # Written by Gary V. Vaughan, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # serial 6 ltsugar.m4 11 | 12 | # This is to help aclocal find these macros, as it can't see m4_define. 13 | AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) 14 | 15 | 16 | # lt_join(SEP, ARG1, [ARG2...]) 17 | # ----------------------------- 18 | # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their 19 | # associated separator. 20 | # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier 21 | # versions in m4sugar had bugs. 22 | m4_define([lt_join], 23 | [m4_if([$#], [1], [], 24 | [$#], [2], [[$2]], 25 | [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) 26 | m4_define([_lt_join], 27 | [m4_if([$#$2], [2], [], 28 | [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) 29 | 30 | 31 | # lt_car(LIST) 32 | # lt_cdr(LIST) 33 | # ------------ 34 | # Manipulate m4 lists. 35 | # These macros are necessary as long as will still need to support 36 | # Autoconf-2.59 which quotes differently. 37 | m4_define([lt_car], [[$1]]) 38 | m4_define([lt_cdr], 39 | [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], 40 | [$#], 1, [], 41 | [m4_dquote(m4_shift($@))])]) 42 | m4_define([lt_unquote], $1) 43 | 44 | 45 | # lt_append(MACRO-NAME, STRING, [SEPARATOR]) 46 | # ------------------------------------------ 47 | # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. 48 | # Note that neither SEPARATOR nor STRING are expanded; they are appended 49 | # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). 50 | # No SEPARATOR is output if MACRO-NAME was previously undefined (different 51 | # than defined and empty). 52 | # 53 | # This macro is needed until we can rely on Autoconf 2.62, since earlier 54 | # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. 55 | m4_define([lt_append], 56 | [m4_define([$1], 57 | m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) 58 | 59 | 60 | 61 | # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) 62 | # ---------------------------------------------------------- 63 | # Produce a SEP delimited list of all paired combinations of elements of 64 | # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list 65 | # has the form PREFIXmINFIXSUFFIXn. 66 | # Needed until we can rely on m4_combine added in Autoconf 2.62. 67 | m4_define([lt_combine], 68 | [m4_if(m4_eval([$# > 3]), [1], 69 | [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl 70 | [[m4_foreach([_Lt_prefix], [$2], 71 | [m4_foreach([_Lt_suffix], 72 | ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, 73 | [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) 74 | 75 | 76 | # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) 77 | # ----------------------------------------------------------------------- 78 | # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited 79 | # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. 80 | m4_define([lt_if_append_uniq], 81 | [m4_ifdef([$1], 82 | [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], 83 | [lt_append([$1], [$2], [$3])$4], 84 | [$5])], 85 | [lt_append([$1], [$2], [$3])$4])]) 86 | 87 | 88 | # lt_dict_add(DICT, KEY, VALUE) 89 | # ----------------------------- 90 | m4_define([lt_dict_add], 91 | [m4_define([$1($2)], [$3])]) 92 | 93 | 94 | # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) 95 | # -------------------------------------------- 96 | m4_define([lt_dict_add_subkey], 97 | [m4_define([$1($2:$3)], [$4])]) 98 | 99 | 100 | # lt_dict_fetch(DICT, KEY, [SUBKEY]) 101 | # ---------------------------------- 102 | m4_define([lt_dict_fetch], 103 | [m4_ifval([$3], 104 | m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), 105 | m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) 106 | 107 | 108 | # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) 109 | # ----------------------------------------------------------------- 110 | m4_define([lt_if_dict_fetch], 111 | [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], 112 | [$5], 113 | [$6])]) 114 | 115 | 116 | # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) 117 | # -------------------------------------------------------------- 118 | m4_define([lt_dict_filter], 119 | [m4_if([$5], [], [], 120 | [lt_join(m4_quote(m4_default([$4], [[, ]])), 121 | lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), 122 | [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl 123 | ]) 124 | -------------------------------------------------------------------------------- /cpmio/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, 4 | # Inc. 5 | # Written by Scott James Remnant, 2004 6 | # 7 | # This file is free software; the Free Software Foundation gives 8 | # unlimited permission to copy and/or distribute it, with or without 9 | # modifications, as long as this notice is preserved. 10 | 11 | # @configure_input@ 12 | 13 | # serial 4245 ltversion.m4 14 | # This file is part of GNU Libtool 15 | 16 | m4_define([LT_PACKAGE_VERSION], [2.4.7]) 17 | m4_define([LT_PACKAGE_REVISION], [2.4.7]) 18 | 19 | AC_DEFUN([LTVERSION_VERSION], 20 | [macro_version='2.4.7' 21 | macro_revision='2.4.7' 22 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 23 | _LT_DECL(, macro_revision, 0) 24 | ]) 25 | -------------------------------------------------------------------------------- /cpmio/m4/lt~obsolete.m4: -------------------------------------------------------------------------------- 1 | # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- 2 | # 3 | # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004. 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # serial 5 lt~obsolete.m4 11 | 12 | # These exist entirely to fool aclocal when bootstrapping libtool. 13 | # 14 | # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) 15 | # which have later been changed to m4_define as they aren't part of the 16 | # exported API, or moved to Autoconf or Automake where they belong. 17 | # 18 | # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN 19 | # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us 20 | # using a macro with the same name in our local m4/libtool.m4 it'll 21 | # pull the old libtool.m4 in (it doesn't see our shiny new m4_define 22 | # and doesn't know about Autoconf macros at all.) 23 | # 24 | # So we provide this file, which has a silly filename so it's always 25 | # included after everything else. This provides aclocal with the 26 | # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything 27 | # because those macros already exist, or will be overwritten later. 28 | # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 29 | # 30 | # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. 31 | # Yes, that means every name once taken will need to remain here until 32 | # we give up compatibility with versions before 1.7, at which point 33 | # we need to keep only those names which we still refer to. 34 | 35 | # This is to help aclocal find these macros, as it can't see m4_define. 36 | AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) 37 | 38 | m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) 39 | m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) 40 | m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) 41 | m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) 42 | m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) 43 | m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) 44 | m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) 45 | m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) 46 | m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) 47 | m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) 48 | m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) 49 | m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) 50 | m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) 51 | m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) 52 | m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) 53 | m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) 54 | m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) 55 | m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) 56 | m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) 57 | m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) 58 | m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) 59 | m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) 60 | m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) 61 | m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) 62 | m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) 63 | m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) 64 | m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) 65 | m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) 66 | m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) 67 | m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) 68 | m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) 69 | m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) 70 | m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) 71 | m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) 72 | m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) 73 | m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) 74 | m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) 75 | m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) 76 | m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) 77 | m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) 78 | m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) 79 | m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) 80 | m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) 81 | m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) 82 | m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) 83 | m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) 84 | m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) 85 | m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) 86 | m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) 87 | m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) 88 | m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) 89 | m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) 90 | m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) 91 | m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) 92 | m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) 93 | m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) 94 | m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) 95 | m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) 96 | m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) 97 | m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) 98 | m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) 99 | -------------------------------------------------------------------------------- /cpmio/missing: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # Common stub for a few missing GNU programs while installing. 3 | # Copyright (C) 1996, 1997 Free Software Foundation, Inc. 4 | # Franc,ois Pinard , 1996. 5 | 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published by 8 | # the Free Software Foundation; either version 2, or (at your option) 9 | # any later version. 10 | 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | # You should have received a copy of the GNU General Public License 17 | # along with this program; if not, write to the Free Software 18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 19 | # 02111-1307, USA. 20 | 21 | if test $# -eq 0; then 22 | echo 1>&2 "Try \`$0 --help' for more information" 23 | exit 1 24 | fi 25 | 26 | case "$1" in 27 | 28 | -h|--h|--he|--hel|--help) 29 | echo "\ 30 | $0 [OPTION]... PROGRAM [ARGUMENT]... 31 | 32 | Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an 33 | error status if there is no known handling for PROGRAM. 34 | 35 | Options: 36 | -h, --help display this help and exit 37 | -v, --version output version information and exit 38 | 39 | Supported PROGRAM values: 40 | aclocal touch file \`aclocal.m4' 41 | autoconf touch file \`configure' 42 | autoheader touch file \`config.h.in' 43 | automake touch all \`Makefile.in' files 44 | bison create \`y.tab.[ch]', if possible, from existing .[ch] 45 | flex create \`lex.yy.c', if possible, from existing .c 46 | lex create \`lex.yy.c', if possible, from existing .c 47 | makeinfo touch the output file 48 | yacc create \`y.tab.[ch]', if possible, from existing .[ch]" 49 | ;; 50 | 51 | -v|--v|--ve|--ver|--vers|--versi|--versio|--version) 52 | echo "missing - GNU libit 0.0" 53 | ;; 54 | 55 | -*) 56 | echo 1>&2 "$0: Unknown \`$1' option" 57 | echo 1>&2 "Try \`$0 --help' for more information" 58 | exit 1 59 | ;; 60 | 61 | aclocal) 62 | echo 1>&2 "\ 63 | WARNING: \`$1' is missing on your system. You should only need it if 64 | you modified \`acinclude.m4' or \`configure.in'. You might want 65 | to install the \`Automake' and \`Perl' packages. Grab them from 66 | any GNU archive site." 67 | touch aclocal.m4 68 | ;; 69 | 70 | autoconf) 71 | echo 1>&2 "\ 72 | WARNING: \`$1' is missing on your system. You should only need it if 73 | you modified \`configure.in'. You might want to install the 74 | \`Autoconf' and \`GNU m4' packages. Grab them from any GNU 75 | archive site." 76 | touch configure 77 | ;; 78 | 79 | autoheader) 80 | echo 1>&2 "\ 81 | WARNING: \`$1' is missing on your system. You should only need it if 82 | you modified \`acconfig.h' or \`configure.in'. You might want 83 | to install the \`Autoconf' and \`GNU m4' packages. Grab them 84 | from any GNU archive site." 85 | files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in` 86 | test -z "$files" && files="config.h" 87 | touch_files= 88 | for f in $files; do 89 | case "$f" in 90 | *:*) touch_files="$touch_files "`echo "$f" | 91 | sed -e 's/^[^:]*://' -e 's/:.*//'`;; 92 | *) touch_files="$touch_files $f.in";; 93 | esac 94 | done 95 | touch $touch_files 96 | ;; 97 | 98 | automake) 99 | echo 1>&2 "\ 100 | WARNING: \`$1' is missing on your system. You should only need it if 101 | you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. 102 | You might want to install the \`Automake' and \`Perl' packages. 103 | Grab them from any GNU archive site." 104 | find . -type f -name Makefile.am -print | 105 | sed 's/\.am$/.in/' | 106 | while read f; do touch "$f"; done 107 | ;; 108 | 109 | bison|yacc) 110 | echo 1>&2 "\ 111 | WARNING: \`$1' is missing on your system. You should only need it if 112 | you modified a \`.y' file. You may need the \`Bison' package 113 | in order for those modifications to take effect. You can get 114 | \`Bison' from any GNU archive site." 115 | rm -f y.tab.c y.tab.h 116 | if [ $# -ne 1 ]; then 117 | eval LASTARG="\${$#}" 118 | case "$LASTARG" in 119 | *.y) 120 | SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` 121 | if [ -f "$SRCFILE" ]; then 122 | cp "$SRCFILE" y.tab.c 123 | fi 124 | SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` 125 | if [ -f "$SRCFILE" ]; then 126 | cp "$SRCFILE" y.tab.h 127 | fi 128 | ;; 129 | esac 130 | fi 131 | if [ ! -f y.tab.h ]; then 132 | echo >y.tab.h 133 | fi 134 | if [ ! -f y.tab.c ]; then 135 | echo 'main() { return 0; }' >y.tab.c 136 | fi 137 | ;; 138 | 139 | lex|flex) 140 | echo 1>&2 "\ 141 | WARNING: \`$1' is missing on your system. You should only need it if 142 | you modified a \`.l' file. You may need the \`Flex' package 143 | in order for those modifications to take effect. You can get 144 | \`Flex' from any GNU archive site." 145 | rm -f lex.yy.c 146 | if [ $# -ne 1 ]; then 147 | eval LASTARG="\${$#}" 148 | case "$LASTARG" in 149 | *.l) 150 | SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` 151 | if [ -f "$SRCFILE" ]; then 152 | cp "$SRCFILE" lex.yy.c 153 | fi 154 | ;; 155 | esac 156 | fi 157 | if [ ! -f lex.yy.c ]; then 158 | echo 'main() { return 0; }' >lex.yy.c 159 | fi 160 | ;; 161 | 162 | makeinfo) 163 | echo 1>&2 "\ 164 | WARNING: \`$1' is missing on your system. You should only need it if 165 | you modified a \`.texi' or \`.texinfo' file, or any other file 166 | indirectly affecting the aspect of the manual. The spurious 167 | call might also be the consequence of using a buggy \`make' (AIX, 168 | DU, IRIX). You might want to install the \`Texinfo' package or 169 | the \`GNU make' package. Grab either from any GNU archive site." 170 | file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` 171 | if test -z "$file"; then 172 | file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` 173 | file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` 174 | fi 175 | touch $file 176 | ;; 177 | 178 | *) 179 | echo 1>&2 "\ 180 | WARNING: \`$1' is needed, and you do not seem to have it handy on your 181 | system. You might have modified some files without having the 182 | proper tools for further handling them. Check the \`README' file, 183 | it often tells you about the needed prerequirements for installing 184 | this package. You may also peek at any GNU archive site, in case 185 | some other package would contain this missing \`$1' program." 186 | exit 1 187 | ;; 188 | esac 189 | 190 | exit 0 191 | -------------------------------------------------------------------------------- /cpmio/mkinstalldirs: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # mkinstalldirs --- make directory hierarchy 3 | # Author: Noah Friedman 4 | # Created: 1993-05-16 5 | # Public domain 6 | 7 | # $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ 8 | 9 | errstatus=0 10 | 11 | for file 12 | do 13 | set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` 14 | shift 15 | 16 | pathcomp= 17 | for d 18 | do 19 | pathcomp="$pathcomp$d" 20 | case "$pathcomp" in 21 | -* ) pathcomp=./$pathcomp ;; 22 | esac 23 | 24 | if test ! -d "$pathcomp"; then 25 | echo "mkdir $pathcomp" 26 | 27 | mkdir "$pathcomp" || lasterr=$? 28 | 29 | if test ! -d "$pathcomp"; then 30 | errstatus=$lasterr 31 | fi 32 | fi 33 | 34 | pathcomp="$pathcomp/" 35 | done 36 | done 37 | 38 | exit $errstatus 39 | 40 | # mkinstalldirs ends here 41 | -------------------------------------------------------------------------------- /cpmredir/AUTHORS: -------------------------------------------------------------------------------- 1 | 2 | * John Elliott 3 | Original Author. 4 | 5 | * Tony Nicholson (agn453) 6 | * Mark Ogden (ogdenpm) 7 | * Michal Tomek (mtdev79) 8 | -------------------------------------------------------------------------------- /cpmredir/ChangeLog: -------------------------------------------------------------------------------- 1 | 2 | 2012-08-01 John Elliott 3 | 4 | * zxcc-0.5.7 release. 5 | 6 | -------------------------------------------------------------------------------- /cpmredir/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | SUBDIRS= . include lib 4 | 5 | EXTRA_DIST= $(srcdir)/config/* $(srcdir)/doc/* $(srcdir)/Z80/* 6 | 7 | ACLOCAL_AMFLAGS=-I m4 8 | -------------------------------------------------------------------------------- /cpmredir/NEWS: -------------------------------------------------------------------------------- 1 | 2 | Current development occurs on Github 3 | 4 | 2012-08-01 John Elliott 5 | 6 | * zxcc-0.5.7 release. 7 | 8 | -------------------------------------------------------------------------------- /cpmredir/README: -------------------------------------------------------------------------------- 1 | All documentation is in the "doc" directory. 2 | -------------------------------------------------------------------------------- /cpmredir/Z80/chdir.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/cpmredir/Z80/chdir.com -------------------------------------------------------------------------------- /cpmredir/Z80/chdir.z80: -------------------------------------------------------------------------------- 1 | ; 2 | ; CPMREDIR: CP/M filesystem redirector 3 | ; Copyright (C) 1998, John Elliott 4 | ; 5 | ; This library is free software; you can redistribute it and/or 6 | ; modify it under the terms of the GNU Library General Public 7 | ; License as published by the Free Software Foundation; either 8 | ; version 2 of the License, or (at your option) any later version. 9 | ; 10 | ; This library is distributed in the hope that it will be useful, 11 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | ; Library General Public License for more details. 14 | ; 15 | ; You should have received a copy of the GNU Library General Public 16 | ; License along with this library; if not, write to the Free 17 | ; Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | ; 19 | ; This file is an example of the use of the CP/M 4 BDOS function 20 | ; "open directory", implemented by CPMREDIR. 21 | 22 | .z80 23 | cseg 24 | ; 25 | FCB EQU 005Ch 26 | FDOS EQU 5 27 | CR EQU 0Dh 28 | LF EQU 0Ah 29 | EOF EQU 1Ah 30 | ; 31 | ;Standard prelude to check CPU type and CP/M version 32 | ; 33 | BASE: DEFB 0EBh,04h ;DOS protection... JMPS LABE 34 | EX DE,HL 35 | JP BEGIN 36 | DEFB 0B4h,09h ;DOS protection... MOV AH,9 37 | DEFB 0BAh 38 | DEFW BVMES ;DOS protection... MOV DX,OFFSET BVMES 39 | DEFB 0CDh,021h ;DOS protection... INT 21h. 40 | DEFB 0CDh,020h ;DOS protection... INT 20h. 41 | 42 | DEFB cr,'CHDIR v1.00 (c) John Elliott',cr,lf 43 | DEFB 'Date: 05/12/98',cr,lf,eof 44 | ; 45 | DSEG 46 | BVMES: DEFB 'This program requires CP/M 3+ and a Z80 processor.',cr,lf,'$' 47 | CSEG 48 | 49 | BEGIN: SUB A 50 | JP PE,BADVER ;Weed out 8080 CPUs 51 | LD C,0Ch 52 | CALL FDOS 53 | CP 30h ;Weed out non-CP/M 3 versions 54 | JR NC,MAIN 55 | BADVER: LD DE,BVMES 56 | LD C,9 57 | JP FDOS 58 | ; 59 | ext dpcmd, dfcb, fstype 60 | 61 | main: 62 | ld hl,80h ;Parse command tail, see DPCMD.Z80 63 | call dpcmd 64 | ld a,h 65 | and l 66 | inc a 67 | jr z,badcmd ;No filename found 68 | 69 | call fstype ;Check for CP/M FS, see FSTYPE.Z80 70 | jr z,badfs 71 | 72 | ld hl,dfcb 73 | ld (hl),80h ;Set FCB "drive" byte to indicate directory on 74 | ;current drive 75 | ex de,hl 76 | ld c,0fh 77 | call 5 ;"Open directory" call 78 | cp 4 79 | jr nc,failed 80 | rst 0 81 | ; 82 | failed: ld de,fail$ 83 | jr errpr 84 | ; 85 | badfs: ld de,badfs$ 86 | jr errpr 87 | ; 88 | badcmd: ld de,badcmd$ 89 | errpr: ld c,9 ;Print error and return "failed" code to CP/M. 90 | call 5 91 | ld de,0FF00h 92 | ld c,6Ch 93 | call 5 94 | rst 0 95 | ; 96 | dseg 97 | fail$: defb 'Unable to select directory.',13,10,'$' 98 | badfs$: defb 'This operation will not work on a CP/M format drive.',13,10,'$' 99 | badcmd$: 100 | defb 'Syntax: CHDIR or CHDIR .. ',13,10,'$' 101 | 102 | END 103 | 104 | 105 | -------------------------------------------------------------------------------- /cpmredir/Z80/cpmredir.rsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/cpmredir/Z80/cpmredir.rsx -------------------------------------------------------------------------------- /cpmredir/Z80/cpmredir.z80: -------------------------------------------------------------------------------- 1 | ; 2 | ; CPMREDIR: CP/M filesystem redirector 3 | ; Copyright (C) 1998, John Elliott 4 | ; 5 | ; This library is free software; you can redistribute it and/or 6 | ; modify it under the terms of the GNU Library General Public 7 | ; License as published by the Free Software Foundation; either 8 | ; version 2 of the License, or (at your option) any later version. 9 | ; 10 | ; This library is distributed in the hope that it will be useful, 11 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | ; Library General Public License for more details. 14 | ; 15 | ; You should have received a copy of the GNU Library General Public 16 | ; License along with this library; if not, write to the Free 17 | ; Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | ; 19 | ; This file is source for an example RSX showing how CPMREDIR can be 20 | ; called from a CP/M 3 emulator with a Z80 BDOS. 21 | 22 | ; 23 | ; RSX header 24 | ; 25 | .z80 26 | cseg 27 | 28 | base: defs 6 ;Serial number 29 | jp catch ;Entry point 30 | fdos: jp 0 ;Link to next RSX 31 | prev: defw 0 ;Link to previous RSX 32 | delete: defw 0 ;Set to 0FFh to delete this RSX 33 | rname: defb 'REDIRECT' ;RSX name 34 | defb 0,0,0 ;Reserved 35 | ; 36 | ;Data used by CPMREDIR. 37 | ; 38 | drives: defb 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 39 | dpbs: defs 0110h 40 | dname: defs 40 ;Buffer for directory name 41 | 42 | catch: ld a,c ;BDOS function ID 43 | cp 03Ch ;"Communicate with RSX" 44 | jp z,rsxctl 45 | ; 46 | ;When this RSX is first loaded, it is inactive. The following instruction 47 | ;will be NOPped out when the RSX is initialised. 48 | ; 49 | block: jp fdos 50 | ; 51 | ;Emulator "trap" routine. It should return Carry set to pass the call 52 | ;through to the BDOS, or Carry clear to return. 53 | ; 54 | scf 55 | ld a,0FCh 56 | ld hl,base ;This RSX 57 | defb 0EDh,0FEh 58 | ; 59 | jp c,fdos 60 | ret 61 | ; 62 | ;"Communicate with RSX" call - code to delete this RSX. This is 8-bit code 63 | ;so that even if the RSX isn't run in an emulator, it can be deleted. 64 | ; 65 | rsxctl: push de ;DE -> RSXPB 66 | ld h,d 67 | ld l,e ;Hl -> function number 68 | inc hl 69 | ld a,(hl) ;HL -> No. of parameters 70 | cp 1 ;Must only take 1 parameter 71 | jp nz,pdfdos 72 | inc hl 73 | ld e,(hl) 74 | inc hl 75 | ld d,(hl) ;DE = parameter 1 (should be the RSX name) 76 | ld hl,rname 77 | ld b,8 78 | idrlp: ld a,(de) 79 | cp (hl) ;Is it the RSX name? 80 | jr nz,pdfdos 81 | inc de 82 | inc hl 83 | djnz idrlp 84 | ; 85 | ;This call is for this RSX. 86 | ; 87 | pop de 88 | ld a,(de) ;Function number 89 | cp 79h 90 | jr z,initme ;79h: Initialise RSX 91 | cp 7Eh 92 | jr z,delme ;7Eh: Delete this copy of this RSX 93 | cp 7Fh 94 | jr z,delall ;7Fh: Delete all copies of this RSX 95 | jp block 96 | ; 97 | pdfdos: pop de 98 | jp block 99 | ; 100 | delme: ld a,0FFh ;Delete this RSX. 101 | ld (delete),a 102 | ret0: xor a 103 | ld l,a 104 | ld h,a 105 | ld b,a 106 | ret 107 | ; 108 | delall: ld a,0FFh ;Delete all copies of this RSX. 109 | ld (delete),a 110 | call fdos 111 | jr ret0 112 | ; 113 | initme: push de 114 | call fdos ;Returns A=0 if there's another RSX like this 115 | pop de ;Higher Up. 116 | or a 117 | jr z,delme ;Prevent multiple loads of this RSX. 118 | 119 | ld c,3Ch 120 | ld a,0FCh ;Initialise the emulation library. 121 | ld hl,base ;This RSX 122 | defb 0EDh,0FEh 123 | 124 | xor a 125 | ld h,a 126 | ld l,a ;Return 0. 127 | ld b,a 128 | ld (block),hl ;Remove the "block" instruction 129 | ld (block+2),a 130 | ret 131 | ; 132 | 133 | end 134 | 135 |  -------------------------------------------------------------------------------- /cpmredir/Z80/dparse.z80: -------------------------------------------------------------------------------- 1 | ; 2 | ; CPMREDIR: CP/M filesystem redirector 3 | ; Copyright (C) 1998, John Elliott 4 | ; 5 | ; This library is free software; you can redistribute it and/or 6 | ; modify it under the terms of the GNU Library General Public 7 | ; License as published by the Free Software Foundation; either 8 | ; version 2 of the License, or (at your option) any later version. 9 | ; 10 | ; This library is distributed in the hope that it will be useful, 11 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | ; Library General Public License for more details. 14 | ; 15 | ; You should have received a copy of the GNU Library General Public 16 | ; License along with this library; if not, write to the Free 17 | ; Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | ; 19 | ; Parse a filename. Works like the usual function 152 but also accepts "." 20 | ; and "..". Enter with DE->PFCB. 21 | 22 | .z80 23 | cseg 24 | 25 | dparse:: 26 | ld a,(de) ;DE -> DW filename DW fcb_destination 27 | ld l,a 28 | inc de 29 | ld a,(de) 30 | ld h,a ;HL = address of ASCII filename 31 | dec de 32 | ld a,(hl) ;Does it start "."? 33 | cp '.' 34 | jr nz,func152 35 | inc hl 36 | ld a,(hl) 37 | call echar ;Is it "." ? 38 | jr z,onedot 39 | cp '.' 40 | jr nz,func152 41 | inc hl 42 | ld a,(hl) ;Is it ".."? 43 | call echar 44 | jr z,twodots 45 | ld hl,0ffffh ;Invalid 46 | ret 47 | ; 48 | onedot: call zfcb ;Empty the FCB 49 | call getfcb ;BC -> FCB 50 | inc bc 51 | push af 52 | ld a,'.' ;Set name to "." 53 | ld (bc),a 54 | jr endp 55 | ; 56 | twodots: 57 | call zfcb ;Empty the FCB 58 | call getfcb 59 | inc bc 60 | push af ;Set name to ".." 61 | ld a,'.' 62 | ld (bc),a 63 | inc bc 64 | ld (bc),a 65 | endp: pop af ;If EOL encountered, return 0. Else 66 | cp 0Dh ;return pointer to next character in line. 67 | jr z,eol 68 | cp 0 69 | jr z,eol 70 | ret ;HL = correct return value 71 | ; 72 | eol: ld hl,0 73 | ret 74 | ; 75 | zfcb: push af ;Reset FCB to "empty" values 76 | push hl 77 | push de 78 | ex de,hl 79 | inc hl 80 | inc hl 81 | ld e,(hl) 82 | inc hl 83 | ld d,(hl) ;DE->FCB 84 | ld h,d 85 | ld l,e 86 | inc de 87 | push de ;Fill FCB with zeroes 88 | ld bc,35 89 | ld (hl),b 90 | ldir 91 | pop hl 92 | ld d,h ;Fill 'name' field with spaces 93 | ld e,l 94 | inc de 95 | ld bc,10 96 | ld (hl),' ' 97 | ldir 98 | pop de 99 | pop hl 100 | pop af 101 | ret 102 | ; 103 | getfcb: push af ;LD BC, (DE+2) 104 | push de 105 | ex de,hl 106 | inc hl 107 | inc hl 108 | ld c,(hl) 109 | inc hl 110 | ld b,(hl) ;BC->FCB 111 | pop de 112 | pop af 113 | ret 114 | ; 115 | func152: 116 | ld c,152 117 | jp 5 118 | ; 119 | echar: push hl ;Is character in A such a character as to 120 | ld hl,echs ;terminate a filename? 121 | ld b,eche-echs 122 | echlp: cp (hl) 123 | jr z,retz 124 | inc hl 125 | djnz echlp 126 | pop hl 127 | and a ;NZ 128 | ret 129 | ; 130 | retz: pop hl 131 | ret 132 | ; 133 | dseg 134 | ; 135 | echs: defb '[]/=|<> ',9,0Dh,0 ;Separators. 136 | eche: 137 | END 138 | 139 | -------------------------------------------------------------------------------- /cpmredir/Z80/dpcmd.z80: -------------------------------------------------------------------------------- 1 | ; 2 | ; CPMREDIR: CP/M filesystem redirector 3 | ; Copyright (C) 1998, John Elliott 4 | ; 5 | ; This library is free software; you can redistribute it and/or 6 | ; modify it under the terms of the GNU Library General Public 7 | ; License as published by the Free Software Foundation; either 8 | ; version 2 of the License, or (at your option) any later version. 9 | ; 10 | ; This library is distributed in the hope that it will be useful, 11 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | ; Library General Public License for more details. 14 | ; 15 | ; You should have received a copy of the GNU Library General Public 16 | ; License along with this library; if not, write to the Free 17 | ; Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | ; 19 | ; This file parses a command line containing one file or directory 20 | ; name (including "." and "..") 21 | 22 | .z80 23 | dseg 24 | 25 | dfcb:: defs 36 ;FCB the command is parsed into. 26 | 27 | pfcb: defw 0 28 | defw dfcb 29 | ; 30 | cseg 31 | 32 | ext dparse 33 | 34 | dpcmd:: ld e,(hl) 35 | ld d,0 36 | ex de,hl ;DE->command line, HL = length 37 | inc de 38 | add hl,de 39 | ld (hl),0 ;0-terminate command line. 40 | dpcmde:: 41 | ld a,(de) 42 | inc de 43 | cp ' ' ;Skip over spaces 44 | jr z,dpcmde 45 | cp 9 ;Skip over tabs 46 | jr z,dpcmde 47 | or a 48 | ld hl,0ffffh ;EOL and no FCB was found 49 | ret z 50 | dec de 51 | ld (pfcb),de 52 | ld de,pfcb ;Parse first token in the line. 53 | jp dparse 54 | ; 55 | END 56 | 57 | 58 |  -------------------------------------------------------------------------------- /cpmredir/Z80/fstype.z80: -------------------------------------------------------------------------------- 1 | ; 2 | ; CPMREDIR: CP/M filesystem redirector 3 | ; Copyright (C) 1998, John Elliott 4 | ; 5 | ; This library is free software; you can redistribute it and/or 6 | ; modify it under the terms of the GNU Library General Public 7 | ; License as published by the Free Software Foundation; either 8 | ; version 2 of the License, or (at your option) any later version. 9 | ; 10 | ; This library is distributed in the hope that it will be useful, 11 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | ; Library General Public License for more details. 14 | ; 15 | ; You should have received a copy of the GNU Library General Public 16 | ; License along with this library; if not, write to the Free 17 | ; Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | ; 19 | ; Return A=0 on a CP/M FS, else nonzero - Z and NZ set accordingly. 20 | ; 21 | 22 | .z80 23 | cseg 24 | 25 | fstype:: 26 | push hl 27 | push de 28 | push bc 29 | ld de,80h ;Set DMA to 80h 30 | ld c,1Ah 31 | call 5 32 | ld de,dmfcb ;Search for first directory entry. On an 33 | ld c,11h ;alien disc, this will always be the disc 34 | call 5 ;label. 35 | or a 36 | jr nz,fscpm ;Error. Assume CP/M format. 37 | ld a,(80h) 38 | cp 20h ;Is the first entry a disc label? 39 | jr nz,fscpm ;If not, assume CP/M format. 40 | ld a,(8Fh) ;Get FS type byte 41 | or a ;0 => CP/M, otherwise heirarchical. 42 | jr nz,popret 43 | fscpm: xor a 44 | popret: pop bc 45 | pop de 46 | pop hl 47 | ret 48 | ; 49 | dseg 50 | dmfcb: defb '?????????????',0,0 51 | defs 14h 52 | 53 | END 54 | 55 | 56 | -------------------------------------------------------------------------------- /cpmredir/Z80/lsdir.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/cpmredir/Z80/lsdir.com -------------------------------------------------------------------------------- /cpmredir/Z80/lsdir.z80: -------------------------------------------------------------------------------- 1 | .z80 2 | cseg 3 | ; 4 | FCB EQU 005Ch 5 | FDOS EQU 5 6 | CR EQU 0Dh 7 | LF EQU 0Ah 8 | EOF EQU 1Ah 9 | ; 10 | BASE: DEFB 0EBh,04h ;DOS protection... JMPS LABE 11 | EX DE,HL 12 | JP BEGIN 13 | DEFB 0B4h,09h ;DOS protection... MOV AH,9 14 | DEFB 0BAh 15 | DEFW BVMES ;DOS protection... MOV DX,OFFSET BVMES 16 | DEFB 0CDh,021h ;DOS protection... INT 21h. 17 | DEFB 0CDh,020h ;DOS protection... INT 20h. 18 | 19 | DEFB cr,'LSDIR v1.00 (c) John Elliott',cr,lf 20 | DEFB 'Date: 05/12/1998',cr,lf,eof 21 | ; 22 | DSEG 23 | BVMES: DEFB 'This program requires CP/M 3+ and a Z80 processor.',cr,lf,'$' 24 | CSEG 25 | 26 | BEGIN: SUB A 27 | JP PE,BADVER ;Weed out 8080 CPUs 28 | LD C,0Ch 29 | CALL FDOS 30 | CP 30h ;Weed out non-CP/M 3 versions 31 | JR NC,MAIN 32 | BADVER: LD DE,BVMES 33 | LD C,9 34 | JP FDOS 35 | ; 36 | 37 | ext fstype 38 | 39 | main: ld de,scbpb 40 | ld c,31h 41 | call fdos ;Get screen height 42 | ld (scrh),a 43 | ld de,scbpb2 44 | ld c,31h 45 | call fdos 46 | ld (page),a 47 | ld a,(5ch) 48 | or a 49 | jr z,curdrv 50 | dec a 51 | ld e,a 52 | ld c,0Eh 53 | call fdos 54 | curdrv: ld c,19h 55 | call fdos 56 | add a,'A' 57 | ld (drvn),a 58 | call fstype 59 | or a 60 | jr z,fst1 61 | ld a,0ffh 62 | fst1: ld (fs),a 63 | ld a,(5dh) 64 | cp ' ' 65 | jr nz,fcbok 66 | ld hl,5dh 67 | ld d,h 68 | ld e,l 69 | inc de 70 | ld bc,10 71 | ld (hl),'?' 72 | ldir 73 | fcbok: ld de,buf 74 | ld c,1Ah 75 | call fdos 76 | call getlabel 77 | ld hl,5ch 78 | ld a,(fs) 79 | or a 80 | jr z,srccpm 81 | set 7,(hl) 82 | srccpm: ex de,hl 83 | ld hl,0 ;Count 84 | ld c,11h 85 | findl: push hl 86 | call fdos 87 | pop hl 88 | cp 4 89 | jp nc,endl 90 | push hl 91 | ld l,a 92 | ld h,0 93 | add hl,hl ;*2 94 | add hl,hl ;*4 95 | add hl,hl ;*8 96 | add hl,hl ;*16 97 | add hl,hl ;*32 98 | ld de,buf 99 | add hl,de 100 | ld a,(ldone) 101 | or a 102 | call z,showlbl 103 | call showfcb 104 | call extinf 105 | call crlf 106 | pop hl 107 | inc hl 108 | ld c,12h 109 | jr findl 110 | ; 111 | endl: ld a,h 112 | or l 113 | jp nz,0 114 | ld de,nofil$ 115 | ld c,9 116 | call fdos 117 | rst 0 118 | ; 119 | getlabel: 120 | ld c,11h 121 | labelp: ld de,qfcb 122 | call fdos 123 | cp 4 124 | ret nc 125 | ld h,0 ;HL=file no. 126 | add hl,hl ;*2 127 | add hl,hl ;*4 128 | add hl,hl ;*8 129 | add hl,hl ;*16 130 | add hl,hl ;*32 131 | ld de,buf 132 | add hl,de 133 | ld a,(hl) 134 | cp 20h ;Label? 135 | ld c,12h 136 | jr nz,labelp 137 | ld de,label 138 | ld bc,32 139 | ldir 140 | scf 141 | ret 142 | ; 143 | showlbl: 144 | push af 145 | push bc 146 | push de 147 | push hl 148 | ld de,lb1$ 149 | ld c,9 150 | call fdos 151 | ld a,(label) 152 | cp 20h 153 | jr nz,nolb 154 | ld hl,label 155 | call showfcb 156 | jr prlb1 157 | 158 | nolb: ld de,nolb$ 159 | ld c,9 160 | call fdos 161 | prlb1: ld a,(fs) 162 | or a 163 | ld de,cpmm 164 | jr z,prlb2 165 | ld de,dosm 166 | prlb2: ld c,9 167 | call fdos 168 | call crlf 169 | call crlf 170 | ld a,1 171 | ld (ldone),a 172 | pop hl 173 | pop de 174 | pop bc 175 | pop af 176 | ret 177 | ; 178 | dseg 179 | lb1$: defb 'The disc in drive ' 180 | drvn: defb 'X: is $' 181 | nolb$: defb 'untitled$' 182 | cpmm: defb ' (CP/M filesystem)$' 183 | dosm: defb ' (host filesystem)$' 184 | cseg 185 | ; 186 | showfcb: 187 | push af 188 | push bc 189 | push de 190 | push hl 191 | ld b,11 192 | sflp: inc hl 193 | ld e,(hl) 194 | res 7,e 195 | push hl 196 | push bc 197 | ld c,2 198 | call fdos 199 | pop bc 200 | ld a,b 201 | cp 4 202 | jr nz,sflp2 203 | push bc 204 | ld c,2 205 | ld e,' ' 206 | call fdos 207 | pop bc 208 | sflp2: pop hl 209 | djnz sflp 210 | pop hl 211 | pop de 212 | pop bc 213 | pop af 214 | ret 215 | ; 216 | crlf: ld c,2 217 | ld e,0Dh 218 | call fdos 219 | ld c,2 220 | ld e,0Ah 221 | call fdos 222 | ld a,(line) 223 | inc a 224 | ld (line),a 225 | ld hl,scrh 226 | cp (hl) 227 | ret c 228 | xor a 229 | ld (line),a 230 | ld de,more$ 231 | ld c,9 232 | call fdos 233 | ld e,0FDh 234 | ld c,6 235 | call fdos 236 | push af 237 | ld de,morec 238 | ld c,9 239 | call fdos 240 | pop af 241 | cp 3 242 | jp z,0 243 | ret 244 | ; 245 | extinf: push af 246 | push bc 247 | push de 248 | push hl ;HL->FCB 249 | pop ix ;IX->FCB 250 | push hl 251 | ld bc,fs ;Filesystem type 252 | ld de,dir 253 | ld hl,ndir 254 | ld a,(bc) 255 | and (ix+16) 256 | bit 6,a 257 | call cprint 258 | ld de,ro 259 | ld hl,nro 260 | bit 7,(ix+9) 261 | call cprint 262 | ld de,sys 263 | bit 7,(ix+10) 264 | call cprint 265 | ld de,arc 266 | bit 7,(ix+11) 267 | call cprint 268 | ld a,(bc) 269 | and (ix+16) 270 | bit 5,a 271 | ld de,hid 272 | call cprint 273 | ld de,f1 274 | ld hl,nf1 275 | bit 7,(ix+1) 276 | call cprint 277 | ld de,f2 278 | bit 7,(ix+2) 279 | call cprint 280 | ld de,f3 281 | bit 7,(ix+3) 282 | call cprint 283 | ld de,f4 284 | bit 7,(ix+4) 285 | call cprint 286 | pop hl 287 | pop de 288 | pop bc 289 | pop af 290 | ret 291 | 292 | cprint: push bc 293 | push hl 294 | push ix 295 | push af 296 | push hl 297 | ld c,9 298 | call nz,fdos 299 | pop de 300 | pop af 301 | call z,fdos 302 | pop ix 303 | pop hl 304 | pop bc 305 | ret 306 | ; 307 | dseg 308 | dir: defb ' $' 309 | ndir: defb ' $' 310 | ro: defb ' R/O$' 311 | sys: defb ' SYS$' 312 | narc: 313 | nro: 314 | nhid: 315 | nsys: defb ' $' 316 | arc: defb ' ARC$' 317 | hid: defb ' HID$' 318 | f1: defb ' F1$' 319 | f2: defb ' F2$' 320 | f3: defb ' F3$' 321 | f4: defb ' F4$' 322 | nf1: defb ' $' 323 | fs: defb 0 324 | buf: defs 80h 325 | qfcb: defb '?????????????' 326 | defs 17h 327 | label: defs 20h 328 | ldone: defb 0 329 | nofil$: defb 'No file.',0Dh,0Ah,'$' 330 | scrh: defb 0 331 | page: defb 0 332 | line: defb 0 333 | scbpb: defw 001Ch ;Screen height 334 | scbpb2: defw 002Ch ;Page mode 335 | more$: defb '[More]$' 336 | morec: defb 8,8,8,8,8,8,' ',8,8,8,8,8,8,'$' 337 | cseg 338 | 339 | END 340 |  -------------------------------------------------------------------------------- /cpmredir/Z80/make.sub: -------------------------------------------------------------------------------- 1 | m80g =lsdir.z80 2 | m80g =mount.z80 3 | m80g =umount.z80 4 | m80g =chdir.z80 5 | m80g =mkdir.z80 6 | m80g =rmdir.z80 7 | m80g =dparse.z80 8 | m80g =dpcmd.z80 9 | m80g =fstype.z80 10 | link chdir,fstype,dpcmd,dparse 11 | link mkdir,fstype,dpcmd,dparse 12 | link rmdir,fstype,dpcmd,dparse 13 | link lsdir,fstype 14 | link mount 15 | link umount 16 |  -------------------------------------------------------------------------------- /cpmredir/Z80/mkdir.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/cpmredir/Z80/mkdir.com -------------------------------------------------------------------------------- /cpmredir/Z80/mkdir.z80: -------------------------------------------------------------------------------- 1 | 2 | ; 3 | ; CPMREDIR: CP/M filesystem redirector 4 | ; Copyright (C) 1998, John Elliott 5 | ; 6 | ; This library is free software; you can redistribute it and/or 7 | ; modify it under the terms of the GNU Library General Public 8 | ; License as published by the Free Software Foundation; either 9 | ; version 2 of the License, or (at your option) any later version. 10 | ; 11 | ; This library is distributed in the hope that it will be useful, 12 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | ; Library General Public License for more details. 15 | ; 16 | ; You should have received a copy of the GNU Library General Public 17 | ; License along with this library; if not, write to the Free 18 | ; Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | ; 20 | ; This file is an example of using the CP/M 4 BDOS call "create directory", 21 | ; which is supported by CPMREDIR. 22 | ; 23 | ; Standard prelude to detect CPU and operating system version: 24 | ; 25 | .z80 26 | cseg 27 | ; 28 | FCB EQU 005Ch 29 | FDOS EQU 5 30 | CR EQU 0Dh 31 | LF EQU 0Ah 32 | EOF EQU 1Ah 33 | ; 34 | BASE: DEFB 0EBh,04h ;DOS protection... JMPS LABE 35 | EX DE,HL 36 | JP BEGIN 37 | DEFB 0B4h,09h ;DOS protection... MOV AH,9 38 | DEFB 0BAh 39 | DEFW BVMES ;DOS protection... MOV DX,OFFSET BVMES 40 | DEFB 0CDh,021h ;DOS protection... INT 21h. 41 | DEFB 0CDh,020h ;DOS protection... INT 20h. 42 | 43 | DEFB cr,'MKDIR v1.00 (c) John Elliott',cr,lf 44 | DEFB 'Date: 05/12/1998',cr,lf,eof 45 | ; 46 | DSEG 47 | BVMES: DEFB 'This program requires CP/M 3+ and a Z80 processor.',cr,lf,'$' 48 | CSEG 49 | 50 | BEGIN: SUB A 51 | JP PE,BADVER ;Weed out 8080 CPUs 52 | LD C,0Ch 53 | CALL FDOS 54 | CP 30h ;Weed out non-CP/M 3 versions 55 | JR NC,MAIN 56 | BADVER: LD DE,BVMES 57 | LD C,9 58 | JP FDOS 59 | ; 60 | 61 | ext dpcmd, dfcb, fstype 62 | 63 | main: 64 | ld hl,80h ;Parse 1st argument into FCB 65 | call dpcmd 66 | ld a,h 67 | and l 68 | inc a 69 | jr z,badcmd 70 | 71 | ld a,(dfcb+1) ;Can't MKDIR "." or ".." 72 | cp '.' 73 | jr z,badcmd 74 | 75 | call fstype ;Can't MKDIR on CP/M drive 76 | jr z,badfs 77 | 78 | ld hl,dfcb 79 | ld (hl),80h ;Directory on current drive 80 | ex de,hl 81 | ld c,16h 82 | call 5 ;Do the deed 83 | cp 4 84 | jr nc,failed 85 | rst 0 86 | ; 87 | failed: ld de,fail$ 88 | jr errpr 89 | ; 90 | badfs: ld de,badfs$ 91 | jr errpr 92 | ; 93 | badcmd: ld de,badcmd$ 94 | errpr: ld c,9 95 | call 5 96 | ld de,0FF00h 97 | ld c,6Ch 98 | call 5 99 | rst 0 100 | ; 101 | dseg 102 | fail$: defb 'Unable to create directory.',13,10,'$' 103 | badfs$: defb 'This operation will not work on a CP/M format drive.',13,10,'$' 104 | badcmd$: 105 | defb 'Syntax: MKDIR ',13,10,'$' 106 | 107 | END 108 | 109 | 110 |  -------------------------------------------------------------------------------- /cpmredir/Z80/mount.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/cpmredir/Z80/mount.com -------------------------------------------------------------------------------- /cpmredir/Z80/mount.z80: -------------------------------------------------------------------------------- 1 | .z80 2 | cseg 3 | ; 4 | FCB EQU 005Ch 5 | FDOS EQU 5 6 | CR EQU 0Dh 7 | LF EQU 0Ah 8 | EOF EQU 1Ah 9 | ; 10 | BASE: DEFB 0EBh,04h ;DOS protection... JMPS LABE 11 | EX DE,HL 12 | JP BEGIN 13 | DEFB 0B4h,09h ;DOS protection... MOV AH,9 14 | DEFB 0BAh 15 | DEFW BVMES ;DOS protection... MOV DX,OFFSET BVMES 16 | DEFB 0CDh,021h ;DOS protection... INT 21h. 17 | DEFB 0CDh,020h ;DOS protection... INT 20h. 18 | 19 | DEFB cr,'MOUNT v1.01 (c) John Elliott',cr,lf 20 | DEFB 'Date: 16/02/1999',cr,lf,eof 21 | ; 22 | DSEG 23 | BVMES: DEFB 'This program requires CP/M 3+ and a Z80 processor.',cr,lf,'$' 24 | CSEG 25 | 26 | BEGIN: SUB A 27 | JP PE,BADVER ;Weed out 8080 CPUs 28 | LD C,0Ch 29 | CALL FDOS 30 | CP 30h ;Weed out non-CP/M 3 versions 31 | JR NC,MAIN 32 | BADVER: LD DE,BVMES 33 | LD C,9 34 | JP FDOS 35 | ; 36 | ; 37 | ; Syntax: MOUNT C:=D:/FOO/BAR/ 38 | ; 39 | 40 | main: ld de,80h 41 | ld a,(de) 42 | ld l,a 43 | ld h,d 44 | inc de 45 | add hl,de 46 | ld (hl),0 47 | dec hl ;See if there's a \ on the end of the line 48 | ld a,(hl) 49 | cp '\' 50 | jr nz,fdrv 51 | ld (hl),0 52 | ld a,1 53 | ld (bslash),a 54 | fdrv: ld a,(de) 55 | inc de 56 | or a 57 | jp z,badcmd 58 | cp '=' 59 | jr nz,fdrv 60 | call decde 61 | call decde 62 | ld a,(de) 63 | cp ':' 64 | jp nz,badcmd 65 | call decde 66 | ld a,(de) 67 | cp 'A' 68 | jp c,badcmd 69 | cp 'q' ;A:-P: 70 | jp nc,badcmd 71 | cp 'Q' ;or a: - p: 72 | jr c,nbcmd 73 | cp 'a' 74 | jp c,badcmd 75 | nbcmd: sub 'A' 76 | and 0Fh 77 | ld (mdrive),a 78 | inc de ;->: 79 | inc de ;->= 80 | inc de 81 | ld (mpath),de 82 | rtrim: ld a,(de) 83 | inc de 84 | or a 85 | jr z,rtrime 86 | cp ' ' 87 | jr z,rtrime 88 | cp 9 89 | jr nz,rtrim 90 | rtrime: call decde ;->terminator 91 | xor a 92 | ld (de),a 93 | call decde ;->last character in path 94 | ld a,(de) 95 | cp '/' 96 | jr z,term1 97 | cp '\' 98 | jr z,term1 99 | inc de 100 | ld a,'/' 101 | ld (de),a 102 | inc de 103 | xor a 104 | ld (de),a 105 | term1: ld de,rsxpb 106 | ld c,3Ch 107 | call 5 ;Do the "mount" call. 108 | cp 0FFh ;No RSX 109 | ld de,norsx 110 | jr z,errpr 111 | or a 112 | ld de,mtfail 113 | jr z,errpr 114 | ld de,ok$ 115 | ld c,9 116 | call 5 117 | ld a,(bslash) 118 | or a 119 | jr nz,nextb 120 | rst 0 121 | 122 | decde: dec de 123 | ld a,e 124 | cp 81h 125 | ret nc 126 | badcmd: ld a,(bslash) 127 | or a 128 | jr nz,nextb 129 | ld de,badc$ 130 | errpr: ld c,9 131 | call 5 132 | ld de,0FF00h 133 | ld c,6Ch 134 | call 5 135 | rst 0 136 | ; 137 | nextb: xor a ;Ask for another command line 138 | ld (bslash),a 139 | ld c,9 140 | ld de,prmpt 141 | call 5 142 | ld hl,7Fh 143 | ld (hl),l 144 | inc hl 145 | ld (hl),h 146 | dec hl 147 | ex de,hl 148 | ld c,10 149 | call 5 ;Get the new command line. Deliberately don't 150 | ld de,crlf ;make it uppercase. 151 | ld c,9 152 | call 5 153 | jp main 154 | 155 | dseg 156 | prmpt: defb 'MOUNT>$' 157 | bslash: defb 0 158 | badc$: defb 'Syntax: MOUNT x:=y:/dir1/dir2/ { \ }',13,10,'$' 159 | rsxpb: defb 78h,3 160 | defw rname 161 | mdrive: defw 0 162 | mpath: defw 0 163 | rname: defb 'REDIRECT' 164 | 165 | norsx: defb 'REDIR is not loaded.',13,10,'$' 166 | mtfail: defb 'That drive is already mounted.',13,10,'$' 167 | ok$: defb 'The operation succeeded.' 168 | crlf: defb 13,10,'$' 169 | 170 | END 171 |  -------------------------------------------------------------------------------- /cpmredir/Z80/redir.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/cpmredir/Z80/redir.com -------------------------------------------------------------------------------- /cpmredir/Z80/redir.z80: -------------------------------------------------------------------------------- 1 | .z80 2 | cseg 3 | 4 | FCB EQU 005Ch 5 | FDOS EQU 5 6 | CR EQU 0Dh 7 | LF EQU 0Ah 8 | EOF EQU 1Ah 9 | 10 | DEFB 0EBh,04h ;DOS protection... JMPS LABE 11 | EX DE,HL 12 | JP BEGIN 13 | DEFB 0B4h,09h ;DOS protection... MOV AH,9 14 | DEFB 0BAh 15 | DEFW BVMES ;DOS protection... MOV DX,OFFSET BVMES 16 | DEFB 0CDh,021h ;DOS protection... INT 21h. 17 | DEFB 0CDh,020h ;DOS protection... INT 20h. 18 | 19 | DEFB cr,'REDIR v1.00 (c) John Elliott',cr,lf 20 | DEFB 'Date: 00/00/00',cr,lf,eof 21 | ; 22 | DSEG 23 | BVMES: DEFB 'This program requires CP/M 3 and a Z80 processor',cr,lf,'$' 24 | CSEG 25 | 26 | BEGIN: SUB A 27 | JP PE,BADVER 28 | LD C,0Ch 29 | CALL FDOS 30 | CP 30h 31 | JR NC,MAIN 32 | BADVER: LD DE,BVMES 33 | LD C,9 34 | JP FDOS 35 | ; 36 | extrn CPMOPT, PRINT 37 | 38 | MAIN: ld hl,80h 39 | ld e,(hl) 40 | ld d,h 41 | inc hl 42 | ex de,hl ;DE=81h 43 | add hl,de 44 | ld (hl),0 45 | ex de,hl ;HL=81h 46 | ld de,opts 47 | ld iy,optr 48 | call CPMOPT 49 | ld de,initrs 50 | ld c,3Ch 51 | call FDOS 52 | cp 0FFh 53 | jr nz,ldok 54 | ld de,initf 55 | call print 56 | ld c,6Ch 57 | ld de,0FF00h 58 | call FDOS 59 | rst 0 60 | ; 61 | ldok: ld de,lded$ 62 | call print 63 | rst 0 64 | 65 | 66 | help: ld de,help$ 67 | call print 68 | exit: ld de,delrsx 69 | ld c,3Ch 70 | call FDOS 71 | rst 0 72 | ; 73 | unload: ld de,delall 74 | ld c,3Ch 75 | call FDOS 76 | ld de,deled$ 77 | call print 78 | rst 0 79 | 80 | dseg 81 | lded$: defb 'REDIR has loaded.',cr,lf,'$' 82 | initf: defb 'REDIR has failed to initialise properly.',cr,lf,'$' 83 | deled$: defb 'REDIR has unloaded.',cr,lf,'$' 84 | 85 | help$: defb 'REDIR loads the redirection module.',cr,lf 86 | defb 'REDIR [U] unloads it and reclaims the memory it used.',cr,lf,'$' 87 | 88 | opts: defb 4,'HELP', 1,'H', 1,'?' 89 | defb 1,'U',0 90 | optr: defw help,help,help 91 | defw unload 92 | 93 | delall: defb 7Fh,1 94 | defw magic 95 | 96 | delrsx: defb 7Eh,1 97 | defw magic 98 | 99 | initrs: defb 79h,1 100 | defw magic 101 | ; 102 | magic: defb 'REDIRECT' 103 | 104 | cseg 105 | 106 | 107 |  -------------------------------------------------------------------------------- /cpmredir/Z80/redirect.doc: -------------------------------------------------------------------------------- 1 | Redirection tools for CP/M emulators John Elliott, 16 February 1999 2 | ============================================================================== 3 | 4 | The Redirection tools are a set of programs allowing you to use a DOS 5 | or UNIX directory as a CP/M drive. They are designed to be used inside a CP/M 3 6 | emulator. 7 | 8 | * REDIR.COM is the Z80 end of SAMPLE.C; it is an example of how to use 9 | CPMREDIR as an additional filesystem in an existing emulator. 10 | 11 | REDIR - to turn redirection on. 12 | REDIR [U] - to turn redirection off. 13 | 14 | * MOUNT.COM will connect a CP/M drive to a DOS directory: 15 | 16 | MOUNT N:=C:/TEXT/ 17 | 18 | makes CP/M able to access the directory C:/TEXT as CP/M drive N:. 19 | 20 | Since CP/M automatically converts the command line to upper case, 21 | MOUNT can't really access lower-case directories like this. 22 | Therefore, if you type 23 | 24 | MOUNT \ 25 | 26 | you will be able to append the command line as required: 27 | 28 | A>MOUNT \ 29 | MOUNT>L:=/usr/src/linux/ 30 | 31 | * UMOUNT.COM disconnects a CP/M drive: 32 | 33 | UMOUNT N: 34 | 35 | will stop drive N: from being a DOS directory. If you find that 36 | MOUNT.COM reports that a drive is already in use, then use UMOUNT 37 | to disconnect it and the MOUNT to reconnect it. 38 | 39 | * LSDIR.COM can be used as an alternative to DIR; it includes subdirectories 40 | in its listing. 41 | 42 | * CHDIR.COM is used to select a new directory on the current drive. Examples: 43 | 44 | CHDIR TEXT 45 | CHDIR .. 46 | 47 | Note: a command like CHDIR C:\DATA\PCW is not acceptable. You 48 | would have to use two commands: 49 | 50 | CHDIR DATA 51 | CHDIR PCW 52 | 53 | * MKDIR.COM is used to create a new subdirectory in the current directory. 54 | * RMDIR.COM is used to delete an empty subdirectory in the current directory. 55 | 56 | 57 | General points 58 | ============== 59 | 60 | Most CP/M programs will work with a redirected drive. Disc editors and 61 | unerase programs will not. 62 | 63 | Under DRDOS, password protection will work. Under MSDOS, it won't. 64 | 65 | 66 |  67 | -------------------------------------------------------------------------------- /cpmredir/Z80/rmdir.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/cpmredir/Z80/rmdir.com -------------------------------------------------------------------------------- /cpmredir/Z80/rmdir.z80: -------------------------------------------------------------------------------- 1 | ; 2 | ; CPMREDIR: CP/M filesystem redirector 3 | ; Copyright (C) 1998, John Elliott 4 | ; 5 | ; This library is free software; you can redistribute it and/or 6 | ; modify it under the terms of the GNU Library General Public 7 | ; License as published by the Free Software Foundation; either 8 | ; version 2 of the License, or (at your option) any later version. 9 | ; 10 | ; This library is distributed in the hope that it will be useful, 11 | ; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | ; Library General Public License for more details. 14 | ; 15 | ; You should have received a copy of the GNU Library General Public 16 | ; License along with this library; if not, write to the Free 17 | ; Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | ; 19 | ; This file is an example of using the CP/M 4 BDOS call "erase directory", 20 | ; which is supported by CPMREDIR. 21 | ; 22 | ; Standard prelude to detect CPU and operating system version: 23 | ; 24 | .z80 25 | cseg 26 | ; 27 | FCB EQU 005Ch 28 | FDOS EQU 5 29 | CR EQU 0Dh 30 | LF EQU 0Ah 31 | EOF EQU 1Ah 32 | ; 33 | BASE: DEFB 0EBh,04h ;DOS protection... JMPS LABE 34 | EX DE,HL 35 | JP BEGIN 36 | DEFB 0B4h,09h ;DOS protection... MOV AH,9 37 | DEFB 0BAh 38 | DEFW BVMES ;DOS protection... MOV DX,OFFSET BVMES 39 | DEFB 0CDh,021h ;DOS protection... INT 21h. 40 | DEFB 0CDh,020h ;DOS protection... INT 20h. 41 | 42 | DEFB cr,'RMDIR v1.00 (c) John Elliott',cr,lf 43 | DEFB 'Date: 05/12/98',cr,lf,eof 44 | ; 45 | DSEG 46 | BVMES: DEFB 'This program requires CP/M 3+ and a Z80 processor.',cr,lf,'$' 47 | CSEG 48 | 49 | BEGIN: SUB A 50 | JP PE,BADVER ;Weed out 8080 CPUs 51 | LD C,0Ch 52 | CALL FDOS 53 | CP 30h ;Weed out non-CP/M 3 versions 54 | JR NC,MAIN 55 | BADVER: LD DE,BVMES 56 | LD C,9 57 | JP FDOS 58 | ; 59 | 60 | ext dpcmd, dfcb, fstype 61 | 62 | main: 63 | ld hl,80h ;Parse 1st argument to FCB 64 | call dpcmd 65 | ld a,h 66 | and l 67 | inc a 68 | jr z,badcmd 69 | 70 | ld a,(dfcb+1) ;Can't RMDIR "." or ".." 71 | cp '.' 72 | jr z,badcmd 73 | 74 | call fstype ;Can't RMDIR on CP/M filesystem 75 | jr z,badfs 76 | 77 | ld hl,dfcb 78 | ld (hl),80h ;Remove directory on current drive 79 | ex de,hl 80 | ld c,13h ;Do the deed 81 | call 5 82 | cp 4 83 | jr nc,failed 84 | rst 0 85 | ; 86 | failed: ld de,fail$ 87 | jr errpr 88 | ; 89 | badfs: ld de,badfs$ 90 | jr errpr 91 | ; 92 | badcmd: ld de,badcmd$ 93 | errpr: ld c,9 94 | call 5 ;Quit with error code 95 | ld de,0FF00h 96 | ld c,6Ch 97 | call 5 98 | rst 0 99 | ; 100 | dseg 101 | fail$: defb 'Unable to remove directory.',13,10,'$' 102 | badfs$: defb 'This operation will not work on a CP/M format drive.',13,10,'$' 103 | badcmd$: 104 | defb 'Syntax: RMDIR ',13,10,'$' 105 | 106 | END 107 | 108 | 109 | -------------------------------------------------------------------------------- /cpmredir/Z80/umount.com: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/cpmredir/Z80/umount.com -------------------------------------------------------------------------------- /cpmredir/Z80/umount.z80: -------------------------------------------------------------------------------- 1 | .z80 2 | cseg 3 | ; 4 | FCB EQU 005Ch 5 | FDOS EQU 5 6 | CR EQU 0Dh 7 | LF EQU 0Ah 8 | EOF EQU 1Ah 9 | ; 10 | BASE: DEFB 0EBh,04h ;DOS protection... JMPS LABE 11 | EX DE,HL 12 | JP BEGIN 13 | DEFB 0B4h,09h ;DOS protection... MOV AH,9 14 | DEFB 0BAh 15 | DEFW BVMES ;DOS protection... MOV DX,OFFSET BVMES 16 | DEFB 0CDh,021h ;DOS protection... INT 21h. 17 | DEFB 0CDh,020h ;DOS protection... INT 20h. 18 | 19 | DEFB cr,'UMOUNT v1.00 (c) John Elliott',cr,lf 20 | DEFB 'Date: 05/12/1998',cr,lf,eof 21 | ; 22 | DSEG 23 | BVMES: DEFB 'This program requires CP/M 3+ and a Z80 processor.',cr,lf,'$' 24 | CSEG 25 | 26 | BEGIN: SUB A 27 | JP PE,BADVER ;Weed out 8080 CPUs 28 | LD C,0Ch 29 | CALL FDOS 30 | CP 30h ;Weed out non-CP/M 3 versions 31 | JR NC,MAIN 32 | BADVER: LD DE,BVMES 33 | LD C,9 34 | JP FDOS 35 | ; 36 | main: ld a,(FCB) 37 | or a 38 | jp z,help 39 | dec a 40 | ld (rsxp1),a 41 | ld c,3Ch 42 | ld de,rsxpb 43 | call fdos 44 | cp 0ffh 45 | ld de,norsx 46 | jr z,errpr 47 | or a 48 | ld de,nomnt 49 | jr z,errpr 50 | ld de,ok$ 51 | jr pr$ 52 | ; 53 | errpr: ld c,9 54 | call fdos 55 | ld c,6Ch 56 | ld de,0FF00h 57 | call fdos 58 | rst 0 59 | ; 60 | help: ld de,help$ 61 | pr$: ld c,9 62 | call fdos 63 | rst 0 64 | ; 65 | dseg 66 | ok$: defb 'Drive removed.',cr,lf,'$' 67 | norsx: defb 'REDIR is not loaded.',cr,lf,'$' 68 | nomnt: defb 'That is not a redirected drive.',cr,lf,'$' 69 | help$: defb 'Syntax: UMOUNT x:',cr,lf,'$' 70 | rsxpb: defb 77h,2 71 | defw redir 72 | rsxp1: defw 0 73 | 74 | redir: defb 'REDIRECT' 75 | cseg 76 | 77 | 78 | end 79 | ; -------------------------------------------------------------------------------- /cpmredir/config.h.in: -------------------------------------------------------------------------------- 1 | /* config.h.in. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file, and it defines `DIR'. 4 | */ 5 | #undef HAVE_DIRENT_H 6 | 7 | /* Define to 1 if you have the header file. */ 8 | #undef HAVE_DLFCN_H 9 | 10 | /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ 11 | #undef HAVE_DOPRNT 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #undef HAVE_FCNTL_H 15 | 16 | /* Define to 1 if you have the header file. */ 17 | #undef HAVE_INTTYPES_H 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #undef HAVE_MEMORY_H 21 | 22 | /* Define to 1 if you have the `mkdir' function. */ 23 | #undef HAVE_MKDIR 24 | 25 | /* Define to 1 if you have the header file, and it defines `DIR'. */ 26 | #undef HAVE_NDIR_H 27 | 28 | /* Define to 1 if you have the `rmdir' function. */ 29 | #undef HAVE_RMDIR 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #undef HAVE_STDINT_H 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #undef HAVE_STDLIB_H 36 | 37 | /* Define to 1 if you have the header file. */ 38 | #undef HAVE_STRINGS_H 39 | 40 | /* Define to 1 if you have the header file. */ 41 | #undef HAVE_STRING_H 42 | 43 | /* Define to 1 if you have the header file, and it defines `DIR'. 44 | */ 45 | #undef HAVE_SYS_DIR_H 46 | 47 | /* Define to 1 if you have the header file, and it defines `DIR'. 48 | */ 49 | #undef HAVE_SYS_NDIR_H 50 | 51 | /* Define to 1 if you have the header file. */ 52 | #undef HAVE_SYS_STAT_H 53 | 54 | /* Define to 1 if you have the header file. */ 55 | #undef HAVE_SYS_TYPES_H 56 | 57 | /* Define to 1 if you have the header file. */ 58 | #undef HAVE_SYS_VFS_H 59 | 60 | /* Define to 1 if you have the header file. */ 61 | #undef HAVE_UNISTD_H 62 | 63 | /* Define to 1 if you have the header file. */ 64 | #undef HAVE_UTIME_H 65 | 66 | /* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */ 67 | #undef HAVE_UTIME_NULL 68 | 69 | /* Define to 1 if you have the `vprintf' function. */ 70 | #undef HAVE_VPRINTF 71 | 72 | /* Define to 1 if you have the header file. */ 73 | #undef HAVE_WINDOWS_H 74 | 75 | /* Define to 1 if you have the header file. */ 76 | #undef HAVE_WINNT_H 77 | 78 | /* Define to the sub-directory where libtool stores uninstalled libraries. */ 79 | #undef LT_OBJDIR 80 | 81 | /* Name of package */ 82 | #undef PACKAGE 83 | 84 | /* Define to the address where bug reports for this package should be sent. */ 85 | #undef PACKAGE_BUGREPORT 86 | 87 | /* Define to the full name of this package. */ 88 | #undef PACKAGE_NAME 89 | 90 | /* Define to the full name and version of this package. */ 91 | #undef PACKAGE_STRING 92 | 93 | /* Define to the one symbol short name of this package. */ 94 | #undef PACKAGE_TARNAME 95 | 96 | /* Define to the home page for this package. */ 97 | #undef PACKAGE_URL 98 | 99 | /* Define to the version of this package. */ 100 | #undef PACKAGE_VERSION 101 | 102 | /* Define to 1 if you have the ANSI C header files. */ 103 | #undef STDC_HEADERS 104 | 105 | /* Version number of package */ 106 | #undef VERSION 107 | 108 | /* Define to `long int' if does not define. */ 109 | #undef off_t 110 | -------------------------------------------------------------------------------- /cpmredir/configure.ac: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | AC_INIT([cpmredir],[1.1.4]) 3 | AC_CONFIG_SRCDIR([lib/cpmredir.c]) 4 | AC_CONFIG_AUX_DIR(config) 5 | AC_CONFIG_MACRO_DIR(m4) 6 | VERSION=1.1.4 7 | UPDATED='December 28, 2013' 8 | AM_INIT_AUTOMAKE 9 | AC_CONFIG_HEADERS([config.h]) 10 | LT_INIT 11 | 12 | dnl Checks for programs. 13 | AC_PROG_CC 14 | 15 | dnl Checks for libraries. 16 | 17 | dnl Checks for header files. 18 | AC_HEADER_DIRENT 19 | AC_CHECK_HEADERS(fcntl.h unistd.h sys/vfs.h windows.h winnt.h utime.h) 20 | 21 | dnl Checks for typedefs, structures, and compiler characteristics. 22 | AC_TYPE_OFF_T 23 | 24 | dnl Checks for library functions. 25 | AC_FUNC_MEMCMP 26 | AC_FUNC_UTIME_NULL 27 | AC_FUNC_VPRINTF 28 | AC_CHECK_FUNCS(mkdir rmdir) 29 | 30 | AC_CONFIG_FILES([Makefile include/Makefile lib/Makefile]) 31 | AC_OUTPUT 32 | 33 | -------------------------------------------------------------------------------- /cpmredir/include/Makefile.am: -------------------------------------------------------------------------------- 1 | include_HEADERS = cpmredir.h 2 | 3 | -------------------------------------------------------------------------------- /cpmredir/include/cpmredir.h: -------------------------------------------------------------------------------- 1 | /* 2 | CPMREDIR: CP/M filesystem redirector 3 | Copyright (C) 1998, John Elliott 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Library General Public 7 | License as published by the Free Software Foundation; either 8 | version 2 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Library General Public License for more details. 14 | 15 | You should have received a copy of the GNU Library General Public 16 | License along with this library; if not, write to the Free 17 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 | 19 | This file holds the public interface to CPMREDIR. 20 | */ 21 | 22 | #ifndef CPMREDIR_H_INCLUDED 23 | 24 | #define CPMREDIR_H_INCLUDED 16-11-1998 25 | 26 | /* The "cpm_byte" must be exactly 8 bits. 27 | The "cpm_word" must be exactly 16 bits. */ 28 | 29 | typedef unsigned char cpm_byte; 30 | typedef unsigned short cpm_word; 31 | 32 | /* Maximum length of a directory path */ 33 | #ifdef _POSIX_PATH_MAX 34 | #define CPM_MAXPATH _POSIX_PATH_MAX 35 | #else 36 | #ifdef _MAX_PATH 37 | #define CPM_MAXPATH _MAX_PATH 38 | #else 39 | #define CPM_MAXPATH 260 40 | #endif 41 | #endif 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | #ifdef __APPLE__ 48 | #include 49 | #include 50 | #endif 51 | 52 | /* Initialise this library. Call this function first. 53 | * 54 | * Returns 0 if failed to initialise. 55 | */ 56 | int fcb_init(void); 57 | 58 | /* Deinitialise the library. */ 59 | 60 | void fcb_deinit(void); 61 | 62 | /* Translate a name from the host FS to a CP/M name. This will (if necessary) 63 | * create a mapping between a CP/M drive and a host directory path. 64 | * 65 | * CP/M drives A: to O: can be mapped in this way. P: is always the current 66 | * drive. 67 | * 68 | */ 69 | 70 | void xlt_name(char *localname, char *cpmname); 71 | 72 | /* It is sometimes convenient to set some fixed mappings. This will create 73 | * a mapping for a given directory. 74 | * Pass drive = -1 for "first available", or 0-15 for A: to P: 75 | * Returns 1 if OK, 0 if requested drive not available. 76 | * 77 | * NB: It is important that the localname should have a trailing 78 | * directory separator! 79 | */ 80 | 81 | int xlt_map(int drive, char *localdir); 82 | 83 | /* 84 | * This revokes a mapping. No check is made whether CP/M has files open 85 | * on the drive or not. 86 | */ 87 | 88 | int xlt_umap(int drive); 89 | 90 | /* Find out if a drive is mapped, and if so to what directory */ 91 | 92 | char *xlt_getcwd(int drive); 93 | 94 | 95 | /* BDOS functions. Eventually this should handle all disc-related BDOS 96 | * functions. 97 | * 98 | * I am assuming that your emulator has the CP/M RAM in its normal address 99 | * space, accessible as a range 0-64k. If this is not the case 100 | * (eg: you are emulating banked memory, or using a segmented architecture) 101 | * you will have to use "copy in and copy out" techniques. The "fcb" area 102 | * must be 36 bytes long; the "dma" area should be 128 * the value set 103 | * in fcb_multirec() [default is 1, so 128 bytes]. 104 | * 105 | */ 106 | 107 | cpm_byte fcb_reset (void); /* 0x0D */ 108 | cpm_word fcb_drive (cpm_byte drv); /* 0x0E */ 109 | cpm_word fcb_open (cpm_byte *fcb, cpm_byte *dma); /* 0x0F */ 110 | cpm_word fcb_close (cpm_byte *fcb); /* 0x10 */ 111 | cpm_word fcb_find1 (cpm_byte *fcb, cpm_byte *dma); /* 0x11 */ 112 | cpm_word fcb_find2 (cpm_byte *fcb, cpm_byte *dma); /* 0x12 */ 113 | cpm_word fcb_unlink(cpm_byte *fcb, cpm_byte *dma); /* 0x13 */ 114 | cpm_word fcb_read (cpm_byte *fcb, cpm_byte *dma); /* 0x14 */ 115 | cpm_word fcb_write (cpm_byte *fcb, cpm_byte *dma); /* 0x15 */ 116 | cpm_word fcb_creat (cpm_byte *fcb, cpm_byte *dma); /* 0x16 */ 117 | cpm_word fcb_rename(cpm_byte *fcb, cpm_byte *dma); /* 0x17 */ 118 | cpm_word fcb_logvec(void); /* 0x18 */ 119 | cpm_byte fcb_getdrv(void); /* 0x19 */ 120 | /* DMA is a parameter to routines, not a separate call */ 121 | cpm_word fcb_getalv(cpm_byte *alv, cpm_word max); /* 0x1B */ 122 | /* Get alloc vector: caller must provide space and say how big it is. */ 123 | cpm_word fcb_rodisk(void); /* 0x1C */ 124 | cpm_word fcb_rovec (void); /* 0x1D */ 125 | cpm_word fcb_chmod (cpm_byte *fcb, cpm_byte *dma); /* 0x1E */ 126 | cpm_word fcb_getdpb(cpm_byte *dpb); /* 0x1F */ 127 | cpm_byte fcb_user (cpm_byte usr); /* 0x20 */ 128 | cpm_word fcb_randrd(cpm_byte *fcb, cpm_byte *dma); /* 0x21 */ 129 | cpm_word fcb_randwr(cpm_byte *fcb, cpm_byte *dma); /* 0x22 */ 130 | cpm_word fcb_stat (cpm_byte *fcb); /* 0x23 */ 131 | cpm_word fcb_tell (cpm_byte *fcb); /* 0x24 */ 132 | cpm_word fcb_resro (cpm_word bitmap); /* 0x25 */ 133 | /* Access Drives and Free Drives are not supported. */ 134 | cpm_word fcb_randwz(cpm_byte *fcb, cpm_byte *dma); /* 0x28 */ 135 | /* Record locking calls not supported (though they could be) */ 136 | cpm_word fcb_multirec(cpm_byte rc); /* 0x2C */ 137 | /* Set hardware error action must be done by caller */ 138 | cpm_word fcb_dfree (cpm_byte drive, cpm_byte *dma);/* 0x2E */ 139 | cpm_word fcb_sync (cpm_byte flag); /* 0x30 */ 140 | cpm_word fcb_purge (void); /* 0x62 */ 141 | cpm_word fcb_trunc (cpm_byte *fcb, cpm_byte *dma); /* 0x63 */ 142 | cpm_word fcb_setlbl(cpm_byte *fcb, cpm_byte *dma); /* 0x64 */ 143 | cpm_word fcb_getlbl(cpm_byte drive); /* 0x65 */ 144 | cpm_word fcb_date (cpm_byte *fcb); /* 0x66 */ 145 | cpm_word fcb_setpwd(cpm_byte *fcb, cpm_byte *dma); /* 0x67 */ 146 | cpm_word fcb_defpwd(cpm_byte *pwd); /* 0x6A */ 147 | cpm_word fcb_sdate (cpm_byte *fcb, cpm_byte *dma); /* 0x74 */ 148 | cpm_word fcb_parse (char *txt, cpm_byte *fcb); /* 0x98 */ 149 | 150 | /* fcb_parse returns length of filename parsed, 0 if EOL, 0xFFFF if error */ 151 | #ifdef __cplusplus 152 | } 153 | #endif 154 | 155 | 156 | #endif /* def CPMREDIR_H_INCLUDED */ 157 | -------------------------------------------------------------------------------- /cpmredir/lib/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | 3 | AM_CPPFLAGS=-I$(top_srcdir)/include 4 | 5 | lib_LIBRARIES=libcpmredir.a 6 | libcpmredir_a_SOURCES = cpmdrv.c cpmint.h cpmredir.c util.c \ 7 | cpmglob.c cpmparse.c drdos.c xlt.c 8 | 9 | -------------------------------------------------------------------------------- /cpmredir/lib/cpmparse.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CPMREDIR: CP/M filesystem redirector 4 | Copyright (C) 1998, John Elliott 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public 17 | License along with this library; if not, write to the Free 18 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | 20 | This file parses filenames to FCBs. 21 | */ 22 | 23 | #include "cpmint.h" 24 | 25 | #define is_num(c) ((c >= '0') && (c <= '9')) 26 | 27 | static int parse_drive_user(char *txt, cpm_byte *fcb) 28 | { 29 | char uid[4], drvid[4]; 30 | int up, dp; 31 | 32 | for (up = dp = 0; *txt != ':'; ++txt) 33 | { 34 | if (is_num (*txt)) uid [up++] = *txt; 35 | if (isalpha(*txt)) drvid[dp++] = *txt; 36 | if (!is_num(*txt) && !isalpha(*txt)) return -1; 37 | } 38 | uid[up] = 0; drvid[dp] = 0; 39 | 40 | if (dp > 1) return -1; /* Invalid driveletter */ 41 | if (up > 2) return -1; /* Invalid uid */ 42 | 43 | fcb[0x0d] = atoi(uid) + 1; if (fcb[0x0d] > 16) return -1; 44 | 45 | if (islower(drvid[0])) drvid[0] = toupper(drvid[0]); 46 | 47 | if (drvid[0] < 'A' || drvid[0] > 'P') return -1; 48 | 49 | fcb[0] = drvid[0] - '@'; 50 | return 0; 51 | } 52 | 53 | 54 | 55 | cpm_word fcb_parse(char *txt, cpm_byte *fcb) 56 | { 57 | int nl = 0, tl = 0, pl = 0, phase = 0; 58 | char *ntxt, ch; 59 | 60 | memset(fcb, 0, 0x24); 61 | 62 | if (txt[1] == ':' || txt[2] == ':' || txt[3] == ':') 63 | { 64 | if (parse_drive_user(txt, fcb)) return 0xFFFF; 65 | /* Move past the colon */ 66 | ntxt = strchr(txt, ':') + 1; 67 | } 68 | else ntxt = txt; 69 | while (phase < 3) 70 | { 71 | ch = *ntxt; 72 | if (islower(ch)) ch = toupper(ch); 73 | 74 | switch(ch) 75 | { 76 | case 0: 77 | case '\r': /* EOL */ 78 | phase = 4; 79 | break; 80 | 81 | case '.': /* file.typ */ 82 | if (!phase) ++phase; 83 | else phase = 3; 84 | break; 85 | 86 | case ';': /* Password */ 87 | if (phase < 2) phase = 2; 88 | else phase = 3; 89 | break; 90 | 91 | case '[': case ']': case '=': case 9: case ' ': 92 | case '>': case '<': case ':': case ',': case '/': 93 | case '|': /* Terminator */ 94 | phase = 3; 95 | 96 | default: 97 | switch(phase) 98 | { 99 | case 0: 100 | if (nl >= 8) return 0xFFFF; 101 | fcb[++nl] = ch; 102 | break; 103 | 104 | case 1: 105 | if (tl >= 3) return 0xFFFF; 106 | fcb[tl + 9] = ch; 107 | ++tl; 108 | break; 109 | 110 | case 2: 111 | if (pl >= 8) return 0xFFFF; 112 | fcb[pl + 0x10] = ch; 113 | ++pl; 114 | break; 115 | } 116 | break; 117 | } 118 | } 119 | if (!nl) return 0xFFFF; 120 | 121 | fcb[0x1A] = pl; 122 | 123 | if (phase == 4) return 0; 124 | 125 | return (cpm_word)(ntxt - txt); 126 | } 127 | -------------------------------------------------------------------------------- /cpmredir/lib/drdos.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CPMREDIR: CP/M filesystem redirector 4 | Copyright (C) 1998, John Elliott 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Library General Public 8 | License as published by the Free Software Foundation; either 9 | version 2 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Library General Public License for more details. 15 | 16 | You should have received a copy of the GNU Library General Public 17 | License along with this library; if not, write to the Free 18 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | 20 | This file holds DRDOS-specific password code. 21 | */ 22 | 23 | #include "cpmint.h" 24 | 25 | cpm_word redir_drdos_pwmode(cpm_byte b) 26 | { 27 | cpm_word mode = 0; 28 | 29 | if (b & 0x80) mode |= 0xddd; 30 | if (b & 0x40) mode |= 0x555; 31 | if (b & 0x20) mode |= 0x111; 32 | 33 | return mode; 34 | } 35 | 36 | cpm_byte redir_cpm_pwmode(cpm_word w) 37 | { 38 | cpm_byte mode = 0; 39 | 40 | if (w & 0x8) mode |= 0x80; 41 | if (w & 0x4) mode |= 0x40; 42 | if (w & 0x1) mode |= 0x20; 43 | 44 | return mode; 45 | } 46 | 47 | #ifdef __MSDOS__ 48 | #ifdef __GO32__ /* The GO32 extender doesn't understand DRDOS password 49 | * functions, so these are done with __dpmi_int() rather 50 | * than intdos() */ 51 | 52 | cpm_word redir_drdos_get_rights(char *path) 53 | { 54 | __dpmi_regs r; 55 | 56 | if (!redir_drdos) return 0; 57 | 58 | redir_Msg("Rights for file %s: \n\r", path); 59 | 60 | dosmemput(path, strlen(path) + 1, __tb); 61 | r.x.ax = 0x4302; 62 | r.x.dx = __tb & 0x0F; 63 | r.x.ds = (__tb) >> 4; 64 | 65 | __dpmi_int(0x21, &r); 66 | 67 | redir_Msg(" %04x \n\r", r.x.cx); 68 | 69 | if (r.x.flags & 1) return 0; 70 | return r.x.cx; 71 | } 72 | 73 | 74 | cpm_word redir_drdos_put_rights(char *path, cpm_byte *dma, cpm_word rights) 75 | { 76 | __dpmi_regs r; 77 | 78 | if (!redir_drdos) return 0; 79 | 80 | redir_Msg("Put rights for file %s: %04x %-8.8s %-8.8s\n\r", path, rights, dma, dma + 8); 81 | 82 | dosmemput(dma+8, 8, __tb); /* Point DTA at password */ 83 | r.x.ax = 0x1A00; 84 | r.x.dx = (__tb & 0x0F); 85 | r.x.ds = (__tb) >> 4; 86 | __dpmi_int(0x21, &r); 87 | 88 | dosmemput(path, strlen(path) + 1, __tb + 0x10); 89 | r.x.ax = 0x4303; /* Set rights */ 90 | r.x.cx = rights; 91 | r.x.dx = (__tb & 0x0F) + 0x10; 92 | r.x.ds = (__tb) >> 4; 93 | 94 | __dpmi_int(0x21, &r); 95 | 96 | if (r.x.flags & 1) 97 | { 98 | redir_Msg(" Try 1 failed. Error %04x\n\r", r.x.ax); 99 | if (redir_password_error()) 100 | { 101 | redir_password_append(path, dma); 102 | 103 | dosmemput(path, strlen(path) + 1, __tb + 0x10); 104 | r.x.ax = 0x4303; /* Set rights */ 105 | r.x.cx = rights; 106 | r.x.dx = (__tb & 0x0F) + 0x10; 107 | r.x.ds = (__tb) >> 4; 108 | 109 | __dpmi_int(0x21, &r); 110 | if (!r.x.flags & 1) return 0; 111 | if (redir_password_error()) return 0x7FF; 112 | } 113 | return 0xFF; 114 | } 115 | return 0; 116 | } 117 | 118 | #else /* __GO32__ */ 119 | 120 | cpm_word redir_drdos_get_rights(char *path) 121 | { 122 | union REGS r; 123 | struct SREGS s; 124 | 125 | if (!redir_drdos) return 0; 126 | 127 | redir_Msg("Rights for file %s: \n\r", path); 128 | 129 | dosmemput(path, strlen(path) + 1, __tb); 130 | r.w.ax = 0x4302; 131 | r.w.dx = __tb & 0x0F; 132 | s.ds = (__tb) >> 4; 133 | 134 | intdosx(&r, &r, &s); 135 | 136 | redir_Msg(" %04x \n\r", r.w.cx); 137 | 138 | if (r.w.cflag) return 0; 139 | return r.w.cx; 140 | } 141 | 142 | 143 | cpm_word redir_drdos_put_rights(char *path, cpm_byte *dma, cpm_word rights) 144 | { 145 | union REGS r; 146 | struct SREGS s; 147 | 148 | if (!redir_drdos) return 0; 149 | 150 | redir_Msg("Put rights for file %s: %04x\n\r", path, rights); 151 | 152 | dosmemput(dma, 8, __tb); /* Point DTA at password */ 153 | r.w.ax = 0x1A00; 154 | r.w.dx = (__tb & 0x0F); 155 | s.ds = (__tb) >> 4; 156 | intdosx(&r, &r, &s); 157 | 158 | dosmemput(path, strlen(path) + 1, __tb + 0x10); 159 | r.w.ax = 0x4303; /* Set rights */ 160 | r.w.cx = rights; 161 | r.w.dx = (__tb & 0x0F) + 0x10; 162 | s.ds = (__tb) >> 4; 163 | 164 | intdosx(&r, &r, &s); 165 | 166 | if (r.w.cflag) 167 | { 168 | redir_Msg(" Try 1 failed. Error %04x \n\r", r.w.ax); 169 | if (redir_password_error()) 170 | { 171 | redir_password_append(path, dma); 172 | 173 | dosmemput(path, strlen(path) + 1, __tb + 0x10); 174 | r.w.ax = 0x4303; /* Set rights */ 175 | r.w.cx = rights; 176 | r.w.dx = (__tb & 0x0F) + 0x10; 177 | s.ds = (__tb) >> 4; 178 | 179 | intdosx(&r, &r, &s); 180 | if (!r.w.cflag) return 0; 181 | } 182 | return 0xFF; 183 | } 184 | return 0; 185 | } 186 | 187 | #endif /* __GO32__ */ 188 | 189 | 190 | cpm_word redir_password_error(void) 191 | { 192 | union REGS r; 193 | 194 | if (!redir_drdos) return 0; 195 | 196 | r.w.ax = 0x5900; 197 | r.w.bx = 0x0000; 198 | 199 | intdos(&r, &r); 200 | 201 | redir_Msg("Last error was: %04x\r\n", r.w.ax); 202 | 203 | if (r.w.ax == 0x56) return 1; /* Bad password */ 204 | return 0; 205 | } 206 | 207 | 208 | void redir_password_append(char *s, cpm_byte *dma) 209 | { 210 | int n, m; 211 | 212 | if (!redir_drdos) return; 213 | 214 | if (dma[0] == 0 || dma[0] == 0x20) return; 215 | 216 | strcat(s, ";"); 217 | m = strlen(s); 218 | 219 | for (n = 0; n < 8; n++) 220 | { 221 | if (dma[n] == ' ') s[m] = 0; 222 | else s[m] = dma[n]; 223 | ++m; 224 | } 225 | s[m] = 0; 226 | 227 | } 228 | #else /* __MSDOS__ */ 229 | void redir_password_append(char *s, cpm_byte *dma) {} 230 | cpm_word redir_password_error(void) { return 0; } 231 | cpm_word redir_drdos_put_rights(char *path, cpm_byte *dma, cpm_word rights) 232 | { return 0; } 233 | cpm_word redir_drdos_get_rights(char *path) { return 0; } 234 | #endif /* __MSDOS__ */ 235 | 236 | 237 | -------------------------------------------------------------------------------- /cpmredir/lib/track.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | CPMREDIR: CP/M filesystem redirector 4 | Optional Open file tracker 5 | Copyright (C) 2021, Mark Ogden 6 | 7 | This is an addition to the CPMREDIR 8 | Copyright (C) 1998, John Elliott 9 | 10 | This library is free software; you can redistribute it and/or 11 | modify it under the terms of the GNU Library General Public 12 | License as published by the Free Software Foundation; either 13 | version 2 of the License, or (at your option) any later version. 14 | 15 | This library is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 18 | Library General Public License for more details. 19 | 20 | You should have received a copy of the GNU Library General Public 21 | License along with this library; if not, write to the Free 22 | Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 | 24 | */ 25 | #include "cpmint.h" 26 | 27 | /* CP/M does not require that files opened for reading need to be closed, 28 | * this has two impacts 29 | * 1) a lot of file handles can remain opened even when the file is no 30 | * longer used. For modern OS builds this isn't a major problem as 31 | * the system limits are quite high. It is however wasteful 32 | * 2) for windows it can lead to issues when trying to delete / rename a file 33 | * as normally windows will not allow files to be deleted/renamed if the 34 | * file is currently open. Unix variants don't have this restriction. 35 | * 36 | * As an example the build of cgen.com using my decompiled sources 37 | * the linq phase without tracking left 42 open files 38 | * with tracking this was reduced to 2 39 | * 40 | * This code keeps track of files that are opened until they are explicitly 41 | * closed or the FCB used to open the file is reused, or the file needs to be 42 | * renamed or deleted. 43 | * To do this it keeps track of the expanded filename, fcb location and allocated 44 | * file handle 45 | * 46 | * Two public functions are used to manage the file list, and are called from 47 | * within the bdos emulation 48 | * 49 | * trackFile(char *fname, void *fcb, int fd) 50 | * removes existing tracking with matchin fcb or fd and 51 | * if (fname != NULL) - add the info to the head of the open files list 52 | * it returns fd 53 | * 54 | * the function is called in the following circumstances 55 | * 1) before closing a file (fname is NULL) 56 | * 2) just after the file has been opened/created. 57 | * 3) to remove association with a given fcb trackFile(NULL, fcb, -1) 58 | * 59 | * note a helper macro releaseFCB(fcb) can be used for (3) above 60 | * 61 | * releaseFile(char *fname) 62 | * this scans through the list of open files and for each open file 63 | * with a matching fname, the file is closed 64 | * 65 | * the function is called before deleting a file or renaming a file 66 | * 67 | * 68 | * there is a helper function that removes the info from the list 69 | * 70 | * Notes: 71 | * For most applications the tracker could in principle automatically 72 | * close existing open files at the start of a new executable invocation. 73 | * Unfortunately this does not support the case where there is a scripting 74 | * engine intercepting the warm reboots, as it may need to keep the script 75 | * source file open. 76 | * 77 | * Note in theory it would be possible for a CP/M program to open a file 78 | * with a given fcb, move the fcb internally and then open another file 79 | * with the original fcb. If this happens the FCB tracking could cause 80 | * a problem. I am not aware of any real programs that do this. 81 | * Please let me know if the situation arises. 82 | */ 83 | /* windows needs to use file tracking, for unix/linux it is optional */ 84 | #if defined(_WIN32) || defined(FILETRACKER) 85 | typedef struct _track { 86 | struct _track* next; 87 | int handle; 88 | void* fcb; 89 | char* fname; 90 | } track_t; 91 | 92 | track_t* openFiles; 93 | 94 | static track_t* rmHandle(track_t* s) { 95 | track_t* next = s->next; 96 | free(s->fname); 97 | free(s); 98 | return next; 99 | } 100 | 101 | void releaseFile(char* fname) { 102 | track_t* s = (track_t*)&openFiles; 103 | while (s->next) 104 | if (strcmp(s->next->fname, fname) == 0) { 105 | close(s->next->handle); 106 | s->next = rmHandle(s->next); 107 | } 108 | else 109 | s = s->next; 110 | } 111 | 112 | 113 | int trackFile(char* fname, void* fcb, int fd) { 114 | track_t* s = (track_t*)&openFiles; 115 | while (s->next) { /* find any existing fcb or fd */ 116 | if (s->next->fcb == fcb || s->next->handle == fd) { 117 | if (s->next->handle != fd) 118 | close(s->next->handle); 119 | s->next = rmHandle(s->next); /* release the tracker */ 120 | } 121 | else 122 | s = s->next; 123 | } 124 | if (fname && fd >= 0) { 125 | if ((s = malloc(sizeof(track_t))) == NULL) { 126 | fprintf(stderr, "out of memory\n"); 127 | exit(1); 128 | } 129 | s->next = openFiles; 130 | s->fname = strdup(fname); 131 | s->fcb = fcb; 132 | s->handle = fd; 133 | openFiles = s; 134 | } 135 | return fd; 136 | 137 | 138 | } 139 | #endif 140 | 141 | -------------------------------------------------------------------------------- /cpmredir/m4/ltsugar.m4: -------------------------------------------------------------------------------- 1 | # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- 2 | # 3 | # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. 4 | # Written by Gary V. Vaughan, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # serial 6 ltsugar.m4 11 | 12 | # This is to help aclocal find these macros, as it can't see m4_define. 13 | AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) 14 | 15 | 16 | # lt_join(SEP, ARG1, [ARG2...]) 17 | # ----------------------------- 18 | # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their 19 | # associated separator. 20 | # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier 21 | # versions in m4sugar had bugs. 22 | m4_define([lt_join], 23 | [m4_if([$#], [1], [], 24 | [$#], [2], [[$2]], 25 | [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) 26 | m4_define([_lt_join], 27 | [m4_if([$#$2], [2], [], 28 | [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) 29 | 30 | 31 | # lt_car(LIST) 32 | # lt_cdr(LIST) 33 | # ------------ 34 | # Manipulate m4 lists. 35 | # These macros are necessary as long as will still need to support 36 | # Autoconf-2.59 which quotes differently. 37 | m4_define([lt_car], [[$1]]) 38 | m4_define([lt_cdr], 39 | [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], 40 | [$#], 1, [], 41 | [m4_dquote(m4_shift($@))])]) 42 | m4_define([lt_unquote], $1) 43 | 44 | 45 | # lt_append(MACRO-NAME, STRING, [SEPARATOR]) 46 | # ------------------------------------------ 47 | # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. 48 | # Note that neither SEPARATOR nor STRING are expanded; they are appended 49 | # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). 50 | # No SEPARATOR is output if MACRO-NAME was previously undefined (different 51 | # than defined and empty). 52 | # 53 | # This macro is needed until we can rely on Autoconf 2.62, since earlier 54 | # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. 55 | m4_define([lt_append], 56 | [m4_define([$1], 57 | m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) 58 | 59 | 60 | 61 | # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) 62 | # ---------------------------------------------------------- 63 | # Produce a SEP delimited list of all paired combinations of elements of 64 | # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list 65 | # has the form PREFIXmINFIXSUFFIXn. 66 | # Needed until we can rely on m4_combine added in Autoconf 2.62. 67 | m4_define([lt_combine], 68 | [m4_if(m4_eval([$# > 3]), [1], 69 | [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl 70 | [[m4_foreach([_Lt_prefix], [$2], 71 | [m4_foreach([_Lt_suffix], 72 | ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, 73 | [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) 74 | 75 | 76 | # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) 77 | # ----------------------------------------------------------------------- 78 | # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited 79 | # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. 80 | m4_define([lt_if_append_uniq], 81 | [m4_ifdef([$1], 82 | [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], 83 | [lt_append([$1], [$2], [$3])$4], 84 | [$5])], 85 | [lt_append([$1], [$2], [$3])$4])]) 86 | 87 | 88 | # lt_dict_add(DICT, KEY, VALUE) 89 | # ----------------------------- 90 | m4_define([lt_dict_add], 91 | [m4_define([$1($2)], [$3])]) 92 | 93 | 94 | # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) 95 | # -------------------------------------------- 96 | m4_define([lt_dict_add_subkey], 97 | [m4_define([$1($2:$3)], [$4])]) 98 | 99 | 100 | # lt_dict_fetch(DICT, KEY, [SUBKEY]) 101 | # ---------------------------------- 102 | m4_define([lt_dict_fetch], 103 | [m4_ifval([$3], 104 | m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), 105 | m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) 106 | 107 | 108 | # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) 109 | # ----------------------------------------------------------------- 110 | m4_define([lt_if_dict_fetch], 111 | [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], 112 | [$5], 113 | [$6])]) 114 | 115 | 116 | # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) 117 | # -------------------------------------------------------------- 118 | m4_define([lt_dict_filter], 119 | [m4_if([$5], [], [], 120 | [lt_join(m4_quote(m4_default([$4], [[, ]])), 121 | lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), 122 | [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl 123 | ]) 124 | -------------------------------------------------------------------------------- /cpmredir/m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, 4 | # Inc. 5 | # Written by Scott James Remnant, 2004 6 | # 7 | # This file is free software; the Free Software Foundation gives 8 | # unlimited permission to copy and/or distribute it, with or without 9 | # modifications, as long as this notice is preserved. 10 | 11 | # @configure_input@ 12 | 13 | # serial 4245 ltversion.m4 14 | # This file is part of GNU Libtool 15 | 16 | m4_define([LT_PACKAGE_VERSION], [2.4.7]) 17 | m4_define([LT_PACKAGE_REVISION], [2.4.7]) 18 | 19 | AC_DEFUN([LTVERSION_VERSION], 20 | [macro_version='2.4.7' 21 | macro_revision='2.4.7' 22 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 23 | _LT_DECL(, macro_revision, 0) 24 | ]) 25 | -------------------------------------------------------------------------------- /cpmredir/m4/lt~obsolete.m4: -------------------------------------------------------------------------------- 1 | # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- 2 | # 3 | # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004. 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # serial 5 lt~obsolete.m4 11 | 12 | # These exist entirely to fool aclocal when bootstrapping libtool. 13 | # 14 | # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) 15 | # which have later been changed to m4_define as they aren't part of the 16 | # exported API, or moved to Autoconf or Automake where they belong. 17 | # 18 | # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN 19 | # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us 20 | # using a macro with the same name in our local m4/libtool.m4 it'll 21 | # pull the old libtool.m4 in (it doesn't see our shiny new m4_define 22 | # and doesn't know about Autoconf macros at all.) 23 | # 24 | # So we provide this file, which has a silly filename so it's always 25 | # included after everything else. This provides aclocal with the 26 | # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything 27 | # because those macros already exist, or will be overwritten later. 28 | # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 29 | # 30 | # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. 31 | # Yes, that means every name once taken will need to remain here until 32 | # we give up compatibility with versions before 1.7, at which point 33 | # we need to keep only those names which we still refer to. 34 | 35 | # This is to help aclocal find these macros, as it can't see m4_define. 36 | AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) 37 | 38 | m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) 39 | m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) 40 | m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) 41 | m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) 42 | m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) 43 | m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) 44 | m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) 45 | m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) 46 | m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) 47 | m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) 48 | m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) 49 | m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) 50 | m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) 51 | m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) 52 | m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) 53 | m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) 54 | m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) 55 | m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) 56 | m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) 57 | m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) 58 | m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) 59 | m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) 60 | m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) 61 | m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) 62 | m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) 63 | m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) 64 | m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) 65 | m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) 66 | m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) 67 | m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) 68 | m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) 69 | m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) 70 | m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) 71 | m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) 72 | m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) 73 | m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) 74 | m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) 75 | m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) 76 | m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) 77 | m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) 78 | m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) 79 | m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) 80 | m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) 81 | m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) 82 | m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) 83 | m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) 84 | m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) 85 | m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) 86 | m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) 87 | m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) 88 | m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) 89 | m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) 90 | m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) 91 | m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) 92 | m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) 93 | m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) 94 | m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) 95 | m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) 96 | m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) 97 | m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) 98 | m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) 99 | -------------------------------------------------------------------------------- /m4/ltsugar.m4: -------------------------------------------------------------------------------- 1 | # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- 2 | # 3 | # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. 4 | # Written by Gary V. Vaughan, 2004 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # serial 6 ltsugar.m4 11 | 12 | # This is to help aclocal find these macros, as it can't see m4_define. 13 | AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) 14 | 15 | 16 | # lt_join(SEP, ARG1, [ARG2...]) 17 | # ----------------------------- 18 | # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their 19 | # associated separator. 20 | # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier 21 | # versions in m4sugar had bugs. 22 | m4_define([lt_join], 23 | [m4_if([$#], [1], [], 24 | [$#], [2], [[$2]], 25 | [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) 26 | m4_define([_lt_join], 27 | [m4_if([$#$2], [2], [], 28 | [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) 29 | 30 | 31 | # lt_car(LIST) 32 | # lt_cdr(LIST) 33 | # ------------ 34 | # Manipulate m4 lists. 35 | # These macros are necessary as long as will still need to support 36 | # Autoconf-2.59 which quotes differently. 37 | m4_define([lt_car], [[$1]]) 38 | m4_define([lt_cdr], 39 | [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], 40 | [$#], 1, [], 41 | [m4_dquote(m4_shift($@))])]) 42 | m4_define([lt_unquote], $1) 43 | 44 | 45 | # lt_append(MACRO-NAME, STRING, [SEPARATOR]) 46 | # ------------------------------------------ 47 | # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. 48 | # Note that neither SEPARATOR nor STRING are expanded; they are appended 49 | # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). 50 | # No SEPARATOR is output if MACRO-NAME was previously undefined (different 51 | # than defined and empty). 52 | # 53 | # This macro is needed until we can rely on Autoconf 2.62, since earlier 54 | # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. 55 | m4_define([lt_append], 56 | [m4_define([$1], 57 | m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) 58 | 59 | 60 | 61 | # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) 62 | # ---------------------------------------------------------- 63 | # Produce a SEP delimited list of all paired combinations of elements of 64 | # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list 65 | # has the form PREFIXmINFIXSUFFIXn. 66 | # Needed until we can rely on m4_combine added in Autoconf 2.62. 67 | m4_define([lt_combine], 68 | [m4_if(m4_eval([$# > 3]), [1], 69 | [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl 70 | [[m4_foreach([_Lt_prefix], [$2], 71 | [m4_foreach([_Lt_suffix], 72 | ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, 73 | [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) 74 | 75 | 76 | # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) 77 | # ----------------------------------------------------------------------- 78 | # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited 79 | # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. 80 | m4_define([lt_if_append_uniq], 81 | [m4_ifdef([$1], 82 | [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], 83 | [lt_append([$1], [$2], [$3])$4], 84 | [$5])], 85 | [lt_append([$1], [$2], [$3])$4])]) 86 | 87 | 88 | # lt_dict_add(DICT, KEY, VALUE) 89 | # ----------------------------- 90 | m4_define([lt_dict_add], 91 | [m4_define([$1($2)], [$3])]) 92 | 93 | 94 | # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) 95 | # -------------------------------------------- 96 | m4_define([lt_dict_add_subkey], 97 | [m4_define([$1($2:$3)], [$4])]) 98 | 99 | 100 | # lt_dict_fetch(DICT, KEY, [SUBKEY]) 101 | # ---------------------------------- 102 | m4_define([lt_dict_fetch], 103 | [m4_ifval([$3], 104 | m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), 105 | m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) 106 | 107 | 108 | # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) 109 | # ----------------------------------------------------------------- 110 | m4_define([lt_if_dict_fetch], 111 | [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], 112 | [$5], 113 | [$6])]) 114 | 115 | 116 | # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) 117 | # -------------------------------------------------------------- 118 | m4_define([lt_dict_filter], 119 | [m4_if([$5], [], [], 120 | [lt_join(m4_quote(m4_default([$4], [[, ]])), 121 | lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), 122 | [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl 123 | ]) 124 | -------------------------------------------------------------------------------- /m4/ltversion.m4: -------------------------------------------------------------------------------- 1 | # ltversion.m4 -- version numbers -*- Autoconf -*- 2 | # 3 | # Copyright (C) 2004, 2011-2019, 2021-2022 Free Software Foundation, 4 | # Inc. 5 | # Written by Scott James Remnant, 2004 6 | # 7 | # This file is free software; the Free Software Foundation gives 8 | # unlimited permission to copy and/or distribute it, with or without 9 | # modifications, as long as this notice is preserved. 10 | 11 | # @configure_input@ 12 | 13 | # serial 4245 ltversion.m4 14 | # This file is part of GNU Libtool 15 | 16 | m4_define([LT_PACKAGE_VERSION], [2.4.7]) 17 | m4_define([LT_PACKAGE_REVISION], [2.4.7]) 18 | 19 | AC_DEFUN([LTVERSION_VERSION], 20 | [macro_version='2.4.7' 21 | macro_revision='2.4.7' 22 | _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) 23 | _LT_DECL(, macro_revision, 0) 24 | ]) 25 | -------------------------------------------------------------------------------- /m4/lt~obsolete.m4: -------------------------------------------------------------------------------- 1 | # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- 2 | # 3 | # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. 4 | # Written by Scott James Remnant, 2004. 5 | # 6 | # This file is free software; the Free Software Foundation gives 7 | # unlimited permission to copy and/or distribute it, with or without 8 | # modifications, as long as this notice is preserved. 9 | 10 | # serial 5 lt~obsolete.m4 11 | 12 | # These exist entirely to fool aclocal when bootstrapping libtool. 13 | # 14 | # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) 15 | # which have later been changed to m4_define as they aren't part of the 16 | # exported API, or moved to Autoconf or Automake where they belong. 17 | # 18 | # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN 19 | # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us 20 | # using a macro with the same name in our local m4/libtool.m4 it'll 21 | # pull the old libtool.m4 in (it doesn't see our shiny new m4_define 22 | # and doesn't know about Autoconf macros at all.) 23 | # 24 | # So we provide this file, which has a silly filename so it's always 25 | # included after everything else. This provides aclocal with the 26 | # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything 27 | # because those macros already exist, or will be overwritten later. 28 | # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 29 | # 30 | # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. 31 | # Yes, that means every name once taken will need to remain here until 32 | # we give up compatibility with versions before 1.7, at which point 33 | # we need to keep only those names which we still refer to. 34 | 35 | # This is to help aclocal find these macros, as it can't see m4_define. 36 | AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) 37 | 38 | m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) 39 | m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) 40 | m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) 41 | m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) 42 | m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) 43 | m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) 44 | m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) 45 | m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) 46 | m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) 47 | m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) 48 | m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) 49 | m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) 50 | m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) 51 | m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) 52 | m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) 53 | m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) 54 | m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) 55 | m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) 56 | m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) 57 | m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) 58 | m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) 59 | m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) 60 | m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) 61 | m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) 62 | m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) 63 | m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) 64 | m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) 65 | m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) 66 | m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) 67 | m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) 68 | m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) 69 | m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) 70 | m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) 71 | m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) 72 | m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) 73 | m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) 74 | m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) 75 | m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) 76 | m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) 77 | m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) 78 | m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) 79 | m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) 80 | m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) 81 | m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) 82 | m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) 83 | m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) 84 | m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) 85 | m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) 86 | m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) 87 | m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) 88 | m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) 89 | m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) 90 | m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) 91 | m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) 92 | m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) 93 | m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) 94 | m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) 95 | m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) 96 | m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) 97 | m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) 98 | m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) 99 | -------------------------------------------------------------------------------- /update-configure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Update the configure files if you get an error about a missing 4 | # file (like WARNING: "'aclocal-1.11' is missing on your system.") 5 | # because you have a later version installed. Requires that the 6 | # automake package (and prerequisites) are installed. 7 | # 8 | aclocal 9 | autoconf 10 | automake --add-missing 11 | for dir in cpmio cpmredir ; do 12 | cd $dir 13 | aclocal 14 | autoconf 15 | automake --add-missing 16 | cd .. 17 | done 18 | -------------------------------------------------------------------------------- /winbuild/README.md: -------------------------------------------------------------------------------- 1 | # ZXCC build for Windows 2 | 3 | The core zxcc files have been modified to build under windows using visual studio. It may build using different windows build tools but this hasn't been tested. 4 | 5 | This folder includes a Visual Studio solution file to build **zxcc** windows, supporting x86, x64 debug and release configurations. 6 | Intermediate files are built in a **Build** folder, under which there is a folder for each sub project, each containing sub folders for the different configurations e.g. debug/release x86/x64. 7 | 8 | Final files are created in an **Install** folder, with sub folders for the different configurations. 9 | 10 | In addition, the solution file can optionally install files in any desired location. The configuration script install.cfg should be modified to reflect your own requirements, or removed if you don't want to auto install. 11 | 12 | It also includes precompiled dll files for PDCurses along with the required curses.h file in the **external** folder. Due to searching for pdcurses.dll, it is not recommended to install different configurations of the built files in the same directory. 13 | 14 | Note I personally use Visual Studio 2022, however if you have earlier or later versions you should be able to change the build tools in the solution file to match your own setup. 15 | 16 | Mark Ogden 17 | 18 | 26-Dec-2021 19 | 20 | mark.pm.ogden@btinternet.com -------------------------------------------------------------------------------- /winbuild/Scripts/install.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal enabledelayedexpansion 3 | rem locally install applications 4 | if /I "%~1" == "-v" (echo %0: Rev 11 -- 5eb32b3 [2020-09-20]) & goto :EOF 5 | if "%~1" == "" goto usage 6 | if "%~2" neq "" goto start 7 | :usage 8 | echo usage: %0 file installRoot [configFile] 9 | echo configFile defaults to installRoot\install.cfg 10 | echo. 11 | echo install.cfg contains lines of the form type,dir[,suffix] 12 | echo Where type is the first parent directory name of the file to copy 13 | echo which ends in Release or Debug. 14 | echo dir is the directory to install to; a leading + is replaced by installRoot 15 | echo suffix is inserted into the installed filename just before the .exe extension 16 | echo In both dir ^& suffix a $d is replaced by the current local date string in format yyyymmdd 17 | echo and a $t is replaced by the current local time string in format hhmmss 18 | echo All lines where type matches the input file's directory name are processed 19 | echo. 20 | echo Example with install.cfg in the current directory containing the line 21 | echo x86-Release,+prebuilt 22 | echo x86-Release,d:\bin,_32 23 | echo. 24 | echo install . path\x86-Release\myfile.exe 25 | echo copies myfile to .\prebuilt\myfile.exe and d:\bin\myfile_32.exe 26 | echo. 27 | echo Control lines are also supported and they change what files the control lines apply to 28 | echo Each control line's impact continue until the next control line 29 | echo A control line starting with a + enables processing only for the list of files after the + 30 | echo One starting with a - only enables processing for files not in the list 31 | echo a file name of * matches all files so +* renables processing for all files 32 | echo -* stops all processing until the next control line (of limited use) 33 | exit /b 1 34 | 35 | :start 36 | :: basic filename 37 | set FILE="%~nx1" 38 | :: find the path to the target file 39 | set PATHTO=%~p1 40 | :getType 41 | :: get the directory as a filename by removing trailing \ 42 | for %%I in ("%PATHTO:~,-1%") do ( 43 | set PARENT=%%~nxI 44 | set PATHTO="%%~pI" 45 | ) 46 | if /I [%PARENT:~-5,5%] == [Debug] goto gotparent 47 | if /I [%PARENT:~-7,7%] == [Release] goto gotparent 48 | if [%PARENT%] neq [\] goto getType 49 | echo Cannot find Release or Debug component in "%~1" 50 | goto usage 51 | 52 | :gotparent 53 | 54 | if [%3] == [] ( 55 | set CONFIGFILE="%~2\install.cfg" 56 | ) else ( 57 | set CONFIGFILE="%~3" 58 | ) 59 | set CONFIGFILE=%CONFIGFILE:\\=\% 60 | 61 | if not exist %CONFIGFILE% ( 62 | echo cannot find %CONFIGFILE% 63 | echo. 64 | goto :eof 65 | ) 66 | :: get the current time for date/time modified dir or suffix 67 | for /f "tokens=2 delims==." %%A in ('wmic os get LocalDateTime /format:list') do set NOW=%%A 68 | :: process the intall config file 69 | set INCLUDE=Y 70 | for /f "usebackq tokens=*" %%A in (%CONFIGFILE%) do ( 71 | :: cannot set LINE with a comma in the text so convert comma to colon. Need to quote/unquote to do this 72 | call :setSkipping ACTION "%%A" 73 | if [!ACTION!] == [COPY] ( 74 | if [!INCLUDE!] == [Y] ( 75 | for /f "tokens=1,2,* delims=," %%B in ("%%A") do ( 76 | if /I [%PARENT%] == [%%B] ( 77 | call :copy "%~1" "%~2" "%%C" "%%D" 78 | ) 79 | ) 80 | ) 81 | ) else ( 82 | call :updateSkipping INCLUDE !ACTION! %FILE% "%%A" 83 | ) 84 | ) 85 | goto :eof 86 | 87 | :setSkipping result line 88 | setlocal 89 | set LINE=%~2 90 | set RESULT=COPY 91 | if "%~2" neq "" ( 92 | :: doesn't matter here if line has spaces 93 | if [%LINE:~,1%] == [-] ( 94 | set RESULT=EXCLUDE 95 | ) else ( 96 | if [%LINE:~,1%] == [+] set RESULT=INCLUDE 97 | ) 98 | ) 99 | endlocal & set %1=%RESULT% 100 | goto :eof 101 | 102 | 103 | :: the core code to copy the file to the desired location 104 | :copy root src dir suffix 105 | setlocal enabledelayedexpansion 106 | :: work out install directory 107 | :: replacing + with installRoot, replacing any \\ with \ and remove any trailing \ 108 | set DIR=%~3 109 | :: substitute any date / time 110 | call set DIR=!DIR:$d=%NOW:~,8%! 111 | call set DIR=!DIR:$t=%NOW:~8,6%! 112 | 113 | if [%DIR:~0,1%]==[+] set DIR=%~2\%DIR:~1% 114 | set DIR=%DIR:\\=\% 115 | if [%DIR:~-1%] == [\] set DIR=%DIR:~0,-1% 116 | :: make sure we have a directory 117 | if not exist %DIR%\NUL mkdir %DIR% 118 | set SUFFIX=%~4 119 | if [%SUFFIX%] neq [] ( 120 | :: map @ to local time in suffix 121 | call set SUFFIX=!SUFFIX:$d=%NOW:~,8%! 122 | call set SUFFIX=!SUFFIX:$t=%NOW:~8,6%! 123 | ) 124 | :: finalise the filename to use, adding in any suffix 125 | set FILE=%DIR%\%~n1%SUFFIX%%~x1 126 | echo Installing %~1 to %FILE% 127 | copy /b /y "%~1" "%FILE%" 128 | goto :eof 129 | 130 | :updateSkipping var val file match 131 | setlocal enabledelayedexpansion 132 | :: because setting a variable with a comma in it isn't supported in windows 133 | :: modify the input so that that each file is enclosed in [] 134 | set match=%4 135 | set match=%match:,=][% 136 | set match=%match:"=% 137 | set match=[%match:~1%] 138 | :: now enclose the current file name in [] 139 | set file=[%~3] 140 | :: try removing from the list (also allow * as a wild card) 141 | call set removed=!match:%file%=! 142 | if [%removed%] neq [] set removed=%removed:[*]=% 143 | if [%removed%] neq [%match%] ( 144 | if [%2] == [INCLUDE] (set result=Y) else (set result=N) 145 | ) else ( 146 | if [%2] == [INCLUDE] (set result=N) else (set result=Y) 147 | ) 148 | 149 | endlocal & if [%removed%] neq [%match%] set %1=%result% 150 | goto :eof 151 | 152 | 153 | 154 | 155 | -------------------------------------------------------------------------------- /winbuild/cpmio/cpmio.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | -------------------------------------------------------------------------------- /winbuild/cpmredir/cpmredir.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Header Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | Source Files 34 | 35 | 36 | Source Files 37 | 38 | 39 | Source Files 40 | 41 | 42 | Source Files 43 | 44 | 45 | Source Files 46 | 47 | 48 | Source Files 49 | 50 | 51 | Source Files 52 | 53 | 54 | Source Files 55 | 56 | 57 | -------------------------------------------------------------------------------- /winbuild/cpmredir/dirent.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Implementation of POSIX directory browsing functions and types for Win32. 4 | 5 | Author: Kevlin Henney (kevlin@acm.org, kevlin@curbralan.com) 6 | History: Created March 1997. Updated June 2003 and July 2012. 7 | Rights: See end of file. 8 | 9 | */ 10 | #pragma warning(disable : 4996) 11 | #include "dirent.h" 12 | #include 13 | #include 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" 18 | { 19 | #endif 20 | 21 | DIR *opendir(const char *name) { 22 | DIR *dir = 0; 23 | 24 | if (name && name[0]) { 25 | size_t base_length = strlen(name); 26 | const char *all = /* search pattern must end with suitable wildcard */ 27 | strchr("/\\", name[base_length - 1]) ? "*" : "/*"; 28 | 29 | if ((dir = (DIR *)malloc(sizeof * dir)) != 0 && 30 | (dir->name = (char *)malloc(base_length + strlen(all) + 1)) != 0) { 31 | strcat(strcpy(dir->name, name), all); 32 | 33 | if ((dir->handle = 34 | (handle_type)_findfirst(dir->name, &dir->info)) != -1) { 35 | dir->result.d_name = 0; 36 | } else /* rollback */ 37 | { 38 | free(dir->name); 39 | free(dir); 40 | dir = 0; 41 | } 42 | } else /* rollback */ 43 | { 44 | free(dir); 45 | dir = 0; 46 | errno = ENOMEM; 47 | } 48 | } else { 49 | errno = EINVAL; 50 | } 51 | 52 | return dir; 53 | } 54 | 55 | int closedir(DIR *dir) { 56 | int result = -1; 57 | 58 | if (dir) { 59 | if (dir->handle != -1) { 60 | result = _findclose(dir->handle); 61 | } 62 | 63 | free(dir->name); 64 | free(dir); 65 | } 66 | 67 | if (result == -1) /* map all errors to EBADF */ 68 | { 69 | errno = EBADF; 70 | } 71 | 72 | return result; 73 | } 74 | 75 | struct dirent *readdir(DIR *dir) { 76 | struct dirent *result = 0; 77 | 78 | if (dir && dir->handle != -1) { 79 | if (!dir->result.d_name || _findnext(dir->handle, &dir->info) != -1) { 80 | result = &dir->result; 81 | result->d_name = dir->info.name; 82 | } 83 | } else { 84 | errno = EBADF; 85 | } 86 | 87 | return result; 88 | } 89 | 90 | void rewinddir(DIR *dir) { 91 | if (dir && dir->handle != -1) { 92 | _findclose(dir->handle); 93 | dir->handle = (handle_type)_findfirst(dir->name, &dir->info); 94 | dir->result.d_name = 0; 95 | } else { 96 | errno = EBADF; 97 | } 98 | } 99 | 100 | #ifdef __cplusplus 101 | } 102 | #endif 103 | 104 | /* 105 | 106 | Copyright Kevlin Henney, 1997, 2003, 2012. All rights reserved. 107 | 108 | Permission to use, copy, modify, and distribute this software and its 109 | documentation for any purpose is hereby granted without fee, provided 110 | that this copyright and permissions notice appear in all copies and 111 | derivatives. 112 | 113 | This software is supplied "as is" without express or implied warranty. 114 | 115 | But that said, if there are any problems please get in touch. 116 | 117 | */ -------------------------------------------------------------------------------- /winbuild/external/x64-Debug/pdcurses.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/winbuild/external/x64-Debug/pdcurses.dll -------------------------------------------------------------------------------- /winbuild/external/x64-Debug/pdcurses.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/winbuild/external/x64-Debug/pdcurses.lib -------------------------------------------------------------------------------- /winbuild/external/x64-Release/pdcurses.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/winbuild/external/x64-Release/pdcurses.dll -------------------------------------------------------------------------------- /winbuild/external/x64-Release/pdcurses.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/winbuild/external/x64-Release/pdcurses.lib -------------------------------------------------------------------------------- /winbuild/external/x86-Debug/pdcurses.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/winbuild/external/x86-Debug/pdcurses.dll -------------------------------------------------------------------------------- /winbuild/external/x86-Debug/pdcurses.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/winbuild/external/x86-Debug/pdcurses.lib -------------------------------------------------------------------------------- /winbuild/external/x86-Release/pdcurses.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/winbuild/external/x86-Release/pdcurses.dll -------------------------------------------------------------------------------- /winbuild/external/x86-Release/pdcurses.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/agn453/ZXCC/94d1e9cad16325576ec642a19a27148a62f91731/winbuild/external/x86-Release/pdcurses.lib -------------------------------------------------------------------------------- /winbuild/include/config-win.h: -------------------------------------------------------------------------------- 1 | /* config-win.h. Hand modified version for windows */ 2 | #define WIN32_LEAN_AND_MEAN /* remove bloat */ 3 | #define _CRT_SECURE_NO_WARNINGS /* VC is picky about some potentially unsafe functions */ 4 | #define _CRT_NONSTDC_NO_WARNINGS /* VC renames some POSIX functions */ 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #define HAVE_FCNTL_H 1 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #define HAVE_INTTYPES_H 1 11 | 12 | /* Define to 1 if you have the `PDcurses' library pdcurses.lib. */ 13 | #define HAVE_LIBCURSES 1 14 | #define HAVE_CURSES_H 1 15 | 16 | /* Define to 1 if you have the header file. */ 17 | #define HAVE_STDLIB_H 1 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #define HAVE_STRING_H 1 21 | 22 | /* Define to 1 if you have the header file. */ 23 | //#define HAVE_SYS_PARAM_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #define HAVE_SYS_STAT_H 1 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_SYS_TYPES_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | // #define HAVE_UNISTD_H 1 33 | 34 | 35 | /* Define to 1 if you are using the tracker functions to track open files*/ 36 | /* needed for Windows */ 37 | #define FILETRACKER 1 38 | 39 | /* windows include files */ 40 | #define HAVE_WINDOWS_H 1 41 | #define HAVE_DIRENT_H 1 42 | #define HAVE_DIRECT_H 1 43 | #define HAVE_IO_H 1 44 | 45 | /* Name of package */ 46 | #define PACKAGE "zxcc" 47 | 48 | /* Define to the address where bug reports for this package should be sent. */ 49 | #define PACKAGE_BUGREPORT "" 50 | 51 | /* Define to the full name of this package. */ 52 | #define PACKAGE_NAME "" 53 | 54 | /* Define to the full name and version of this package. */ 55 | #define PACKAGE_STRING "" 56 | 57 | /* Define to the one symbol short name of this package. */ 58 | #define PACKAGE_TARNAME "" 59 | 60 | /* Define to the home page for this package. */ 61 | #define PACKAGE_URL "" 62 | 63 | /* Define to the version of this package. */ 64 | #define PACKAGE_VERSION "" 65 | 66 | /* Define to 1 if you have the ANSI C header files. */ 67 | #define STDC_HEADERS 1 68 | 69 | /* Version number of package */ 70 | #define VERSION "0.5.7" 71 | 72 | -------------------------------------------------------------------------------- /winbuild/include/dirent.h: -------------------------------------------------------------------------------- 1 | #ifndef DIRENT_INCLUDED 2 | #define DIRENT_INCLUDED 3 | 4 | /* 5 | 6 | Declaration of POSIX directory browsing functions and types for Win32. 7 | 8 | Author: Kevlin Henney (kevlin@acm.org, kevlin@curbralan.com) 9 | History: Created March 1997. Updated June 2003. 10 | Rights: See end of file. 11 | 12 | */ 13 | 14 | #include /* _findfirst and _findnext set errno iff they return -1 */ 15 | 16 | #ifdef __cplusplus 17 | extern "C" 18 | { 19 | #endif 20 | 21 | struct dirent { 22 | char *d_name; 23 | }; 24 | 25 | typedef ptrdiff_t handle_type; /* C99's intptr_t not sufficiently portable */ 26 | 27 | typedef struct { 28 | handle_type handle; /* -1 for failed rewind */ 29 | struct _finddata_t info; 30 | struct dirent result; /* d_name null iff first time */ 31 | char *name; /* null-terminated char string */ 32 | } DIR; 33 | 34 | DIR *opendir(const char *); 35 | int closedir(DIR *); 36 | struct dirent *readdir(DIR *); 37 | void rewinddir(DIR *); 38 | 39 | /* 40 | 41 | Copyright Kevlin Henney, 1997, 2003. All rights reserved. 42 | 43 | Permission to use, copy, modify, and distribute this software and its 44 | documentation for any purpose is hereby granted without fee, provided 45 | that this copyright and permissions notice appear in all copies and 46 | derivatives. 47 | 48 | This software is supplied "as is" without express or implied warranty. 49 | 50 | But that said, if there are any problems please get in touch. 51 | 52 | */ 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /winbuild/install.cfg: -------------------------------------------------------------------------------- 1 | # modify the line below to reflect your own local usage 2 | # first field can be x86-Release for 32bit builds 3 | # second field is where to install the file 4 | # run the Scripts\install without arguments for more options 5 | # or visit https://github.com/ogdenpm/versionTools for more information 6 | x64-Release,d:\bin 7 | -------------------------------------------------------------------------------- /winbuild/wzxcc.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.0.32002.185 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpmio", "cpmio\cpmio.vcxproj", "{ABD2A54C-A592-4B8C-A4C9-5EBB17563C82}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cpmredir", "cpmredir\cpmredir.vcxproj", "{1B81A11B-0AE7-4293-9058-B43472089681}" 9 | EndProject 10 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zxas", "zxas\zxas.vcxproj", "{851B22C8-8FC7-42A9-9CD5-9C4E7900CED8}" 11 | EndProject 12 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zxc", "zxc\zxc.vcxproj", "{B2119DC6-2293-4D13-A283-8B3706642408}" 13 | EndProject 14 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zxlink", "zxlink\zxlink.vcxproj", "{5AE55866-C465-4B68-AFCB-2E4E1E269FA1}" 15 | EndProject 16 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zxlibr", "zxlibr\zxlibr.vcxproj", "{F6FF14D5-3259-48E5-AAA2-F5BF68E33707}" 17 | EndProject 18 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zxcc", "zxcc\zxcc.vcxproj", "{157A15BF-1E48-4B2F-80DB-65D97D45E67B}" 19 | ProjectSection(ProjectDependencies) = postProject 20 | {1B81A11B-0AE7-4293-9058-B43472089681} = {1B81A11B-0AE7-4293-9058-B43472089681} 21 | {ABD2A54C-A592-4B8C-A4C9-5EBB17563C82} = {ABD2A54C-A592-4B8C-A4C9-5EBB17563C82} 22 | EndProjectSection 23 | EndProject 24 | Global 25 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 26 | Debug|x64 = Debug|x64 27 | Debug|x86 = Debug|x86 28 | Release|x64 = Release|x64 29 | Release|x86 = Release|x86 30 | EndGlobalSection 31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 32 | {ABD2A54C-A592-4B8C-A4C9-5EBB17563C82}.Debug|x64.ActiveCfg = Debug|x64 33 | {ABD2A54C-A592-4B8C-A4C9-5EBB17563C82}.Debug|x64.Build.0 = Debug|x64 34 | {ABD2A54C-A592-4B8C-A4C9-5EBB17563C82}.Debug|x86.ActiveCfg = Debug|Win32 35 | {ABD2A54C-A592-4B8C-A4C9-5EBB17563C82}.Debug|x86.Build.0 = Debug|Win32 36 | {ABD2A54C-A592-4B8C-A4C9-5EBB17563C82}.Release|x64.ActiveCfg = Release|x64 37 | {ABD2A54C-A592-4B8C-A4C9-5EBB17563C82}.Release|x64.Build.0 = Release|x64 38 | {ABD2A54C-A592-4B8C-A4C9-5EBB17563C82}.Release|x86.ActiveCfg = Release|Win32 39 | {ABD2A54C-A592-4B8C-A4C9-5EBB17563C82}.Release|x86.Build.0 = Release|Win32 40 | {1B81A11B-0AE7-4293-9058-B43472089681}.Debug|x64.ActiveCfg = Debug|x64 41 | {1B81A11B-0AE7-4293-9058-B43472089681}.Debug|x64.Build.0 = Debug|x64 42 | {1B81A11B-0AE7-4293-9058-B43472089681}.Debug|x86.ActiveCfg = Debug|Win32 43 | {1B81A11B-0AE7-4293-9058-B43472089681}.Debug|x86.Build.0 = Debug|Win32 44 | {1B81A11B-0AE7-4293-9058-B43472089681}.Release|x64.ActiveCfg = Release|x64 45 | {1B81A11B-0AE7-4293-9058-B43472089681}.Release|x64.Build.0 = Release|x64 46 | {1B81A11B-0AE7-4293-9058-B43472089681}.Release|x86.ActiveCfg = Release|Win32 47 | {1B81A11B-0AE7-4293-9058-B43472089681}.Release|x86.Build.0 = Release|Win32 48 | {851B22C8-8FC7-42A9-9CD5-9C4E7900CED8}.Debug|x64.ActiveCfg = Debug|x64 49 | {851B22C8-8FC7-42A9-9CD5-9C4E7900CED8}.Debug|x64.Build.0 = Debug|x64 50 | {851B22C8-8FC7-42A9-9CD5-9C4E7900CED8}.Debug|x86.ActiveCfg = Debug|Win32 51 | {851B22C8-8FC7-42A9-9CD5-9C4E7900CED8}.Debug|x86.Build.0 = Debug|Win32 52 | {851B22C8-8FC7-42A9-9CD5-9C4E7900CED8}.Release|x64.ActiveCfg = Release|x64 53 | {851B22C8-8FC7-42A9-9CD5-9C4E7900CED8}.Release|x64.Build.0 = Release|x64 54 | {851B22C8-8FC7-42A9-9CD5-9C4E7900CED8}.Release|x86.ActiveCfg = Release|Win32 55 | {851B22C8-8FC7-42A9-9CD5-9C4E7900CED8}.Release|x86.Build.0 = Release|Win32 56 | {B2119DC6-2293-4D13-A283-8B3706642408}.Debug|x64.ActiveCfg = Debug|x64 57 | {B2119DC6-2293-4D13-A283-8B3706642408}.Debug|x64.Build.0 = Debug|x64 58 | {B2119DC6-2293-4D13-A283-8B3706642408}.Debug|x86.ActiveCfg = Debug|Win32 59 | {B2119DC6-2293-4D13-A283-8B3706642408}.Debug|x86.Build.0 = Debug|Win32 60 | {B2119DC6-2293-4D13-A283-8B3706642408}.Release|x64.ActiveCfg = Release|x64 61 | {B2119DC6-2293-4D13-A283-8B3706642408}.Release|x64.Build.0 = Release|x64 62 | {B2119DC6-2293-4D13-A283-8B3706642408}.Release|x86.ActiveCfg = Release|Win32 63 | {B2119DC6-2293-4D13-A283-8B3706642408}.Release|x86.Build.0 = Release|Win32 64 | {5AE55866-C465-4B68-AFCB-2E4E1E269FA1}.Debug|x64.ActiveCfg = Debug|x64 65 | {5AE55866-C465-4B68-AFCB-2E4E1E269FA1}.Debug|x64.Build.0 = Debug|x64 66 | {5AE55866-C465-4B68-AFCB-2E4E1E269FA1}.Debug|x86.ActiveCfg = Debug|Win32 67 | {5AE55866-C465-4B68-AFCB-2E4E1E269FA1}.Debug|x86.Build.0 = Debug|Win32 68 | {5AE55866-C465-4B68-AFCB-2E4E1E269FA1}.Release|x64.ActiveCfg = Release|x64 69 | {5AE55866-C465-4B68-AFCB-2E4E1E269FA1}.Release|x64.Build.0 = Release|x64 70 | {5AE55866-C465-4B68-AFCB-2E4E1E269FA1}.Release|x86.ActiveCfg = Release|Win32 71 | {5AE55866-C465-4B68-AFCB-2E4E1E269FA1}.Release|x86.Build.0 = Release|Win32 72 | {F6FF14D5-3259-48E5-AAA2-F5BF68E33707}.Debug|x64.ActiveCfg = Debug|x64 73 | {F6FF14D5-3259-48E5-AAA2-F5BF68E33707}.Debug|x64.Build.0 = Debug|x64 74 | {F6FF14D5-3259-48E5-AAA2-F5BF68E33707}.Debug|x86.ActiveCfg = Debug|Win32 75 | {F6FF14D5-3259-48E5-AAA2-F5BF68E33707}.Debug|x86.Build.0 = Debug|Win32 76 | {F6FF14D5-3259-48E5-AAA2-F5BF68E33707}.Release|x64.ActiveCfg = Release|x64 77 | {F6FF14D5-3259-48E5-AAA2-F5BF68E33707}.Release|x64.Build.0 = Release|x64 78 | {F6FF14D5-3259-48E5-AAA2-F5BF68E33707}.Release|x86.ActiveCfg = Release|Win32 79 | {F6FF14D5-3259-48E5-AAA2-F5BF68E33707}.Release|x86.Build.0 = Release|Win32 80 | {157A15BF-1E48-4B2F-80DB-65D97D45E67B}.Debug|x64.ActiveCfg = Debug|x64 81 | {157A15BF-1E48-4B2F-80DB-65D97D45E67B}.Debug|x64.Build.0 = Debug|x64 82 | {157A15BF-1E48-4B2F-80DB-65D97D45E67B}.Debug|x86.ActiveCfg = Debug|Win32 83 | {157A15BF-1E48-4B2F-80DB-65D97D45E67B}.Debug|x86.Build.0 = Debug|Win32 84 | {157A15BF-1E48-4B2F-80DB-65D97D45E67B}.Release|x64.ActiveCfg = Release|x64 85 | {157A15BF-1E48-4B2F-80DB-65D97D45E67B}.Release|x64.Build.0 = Release|x64 86 | {157A15BF-1E48-4B2F-80DB-65D97D45E67B}.Release|x86.ActiveCfg = Release|Win32 87 | {157A15BF-1E48-4B2F-80DB-65D97D45E67B}.Release|x86.Build.0 = Release|Win32 88 | EndGlobalSection 89 | GlobalSection(SolutionProperties) = preSolution 90 | HideSolutionNode = FALSE 91 | EndGlobalSection 92 | GlobalSection(ExtensibilityGlobals) = postSolution 93 | SolutionGuid = {04BD4CA7-FC59-49F6-8D45-782E9DF29EF4} 94 | EndGlobalSection 95 | EndGlobal 96 | -------------------------------------------------------------------------------- /winbuild/zxas/zxas.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /winbuild/zxc/zxc.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /winbuild/zxcc/zxcc.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | Source Files 29 | 30 | 31 | Source Files 32 | 33 | 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | Header Files 55 | 56 | 57 | Header Files 58 | 59 | 60 | Header Files 61 | 62 | 63 | Header Files 64 | 65 | 66 | -------------------------------------------------------------------------------- /winbuild/zxlibr/zxlibr.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /winbuild/zxlink/zxlink.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | --------------------------------------------------------------------------------