Browse Source

Finished Windows port (but no video)

main
Blake McBride 6 years ago
parent
commit
d2024d1a02
  1. 6
      src/genclp.c
  2. 44
      src/win/clpars.tec
  3. 86
      src/win/clpars.tes
  4. 6
      src/zport.h
  5. 2
      src/zwin32.c

6
src/genclp.c

@ -36,8 +36,8 @@ open_clpars_tec(ifile)
FILE **ifile;
#endif
{
#ifdef MSDOS
*ifile = fopen("clpars.tec","rb");
#if defined(MSDOS) || defined(WIN32)
*ifile = fopen("win\\clpars.tec","rt");
#else
*ifile = fopen("clpars.tec","r");
#endif
@ -56,7 +56,7 @@ open_clpars_h(ofile)
FILE **ofile;
#endif
{
#ifdef MSDOS
#if defined(MSDOS) || defined(WIN32)
*ofile = fopen("clpars.h","wt");
#else
*ofile = fopen("clpars.h","w");

44
src/win/clpars.tec

@ -1,6 +1,6 @@
!CLPARS.TEC V2.2 5-June-1991 Pete Siemsen and Mark Henderson![F0,0XF
!CLPARS.TEC V2.1 5-May-1991 Pete Siemsen and Mark Henderson![F0,0XF
[90,0X9[00,0X0[20,0X210U0[0U0[00EDU0[0ED&4EDEUU0[0-1EUESU0[00ES
ETU0[032768#32#8#1,0ETQ1U00U1[10,0X10U4-1EJ-25600"E-UY|/UY'@.T/
ETU0[032768#32#8#1,0ETQ1U00U1[10,0X1-1EJ-25600"E0U4-UY|/UY'@.T/
:QF"E.U.1Iteco0EJ\.-Q1U.LQ.L-8"GQ.1+4JQ.L-8D4C'I.tmpQ.1,.XFQ.1,.D'/
27:.TQ0+1"E32768U0'32768"E:EITECO"S]1Q0#32768U1[1JODONE''
Z"EGZ0,0XZ'J::S^ES"SD'::STECO32"S-2D'ZJ-:S^ES"S.-Z"EFR''
@ -22,9 +22,7 @@ J:S^EUYNOC"FONONOCREATE'!NOCREATE!
D::SR"S-D::SE"S-D::SA"S-D::ST"S-D::SE"S-D'''''
::S^ES"SD0A"AI ''Q1#256U1!NONOCREATE!J:S^ES^EUYNOP"SONOPAGE'
J:S^EUYNOP"FONONOPAGE'!NOPAGE!D::SA"S-D::SG"S-D::SE"S-D'''
::S^ES"SD0A"AI ''Q1#64U1!NONOPAGE!J:S^ES^EUYNOR"SONORENAME'
J:S^EUYNOR"FONONORENAME'!NORENAME!D::SA"S-D::SG"S-D::SE"S-D'''
::S^ES"SD0A"AI ''Q1#512U1!NONORENAME!
::S^ES"SD0A"AI ''Q1#64U1!NONOPAGE!
J::STE"S<0A"AC|1;'>::S^ES@"S0KIMUNG ''J::SMU"S-2D<0A"AD|1;'>
::S^ES"SD'(-1EJ-5)*(-1EJ-1024)"EJ::S""S-D::S^ES"SD'''ZU0
-1EJ-25600"EJ:S-"SR.-Q0"L.U0''|J:S/"SR.-Q0"L.U0'''
@ -34,7 +32,7 @@ Q1-1J.-1-Q0"LD.U0'0;>Q0J<-.;-1A-32"N-1A-9"N0;''-D>0,.X.0
:Q.0"E?How can I MUNG nothing?1310'::S^ES 0,.K0U0EI^EQ.0
JODONE'J:S^ES^EUYVT"SOVTEDIT'J:S^EUYVT"FONOVTEDIT'!VTEDIT!
The VTEDIT command line option is not supported by TECOC1310
!NOVTEDIT!J:S^ES+"SD\U40,128EZD::Ss"SD0A"AI '''Q1&64"N0,128EZ'
!NOVTEDIT!-1EJ-25600"EJ:S^ES+"SD\U40,128EZD::Ss"SD0A"AI ''''
J:S^ES^EUYSC"SOSCROLL'J:S^EUYSC"FONOSCROLL'!SCROLL!
D::SR"S-D::SO"S-D::SL"S-D::SL"S-D''''::S:^ED"SR-D\U2FR|0U2'
::S:S"S-2D::SE"S-D::SE"S-D::SA"S-D::SL"S-D::SL"S-D'''''Q1#16U1'
@ -44,28 +42,26 @@ J:S^ES^EUYSC"SOSCROLL'J:S^EUYSC"FONOSCROLL'!SCROLL!
::S^ES"SD0A"AI ''Q1#2U1!NOINSPECT!J:S^ES^EUYFI"SOFIND'
J:S^EUYFI"FONOFIND'!FIND!
The /FIND command line option is not supported by TECOC1310
!NOFIND!J<.-Z;0A-9"EDF<'0A-32"EDF<'C-1A-""E:S""S-1EJ-25857"E
0J2<@FS/"//>ZJ'|ZJ''>Q1&4#Z"E:EGMEM"SG*J::S$"SD|OGOTIT'|M.TGF'
HX0HKEPEAEF:ER^EQ0"SYL."N-1A-10"E-D''."N-1A-13"E-D''ZKHX0HKECG0'
EREW0,0X0!GOTIT!ZJZ"NQ1#32768#16384U1''Q1&16384"NQ1&2"EEdi|
Inspec'ting file "HT"1310'Z"EQ1&2"EOSCOPES'
!NOFIND!J<.-Z;0A-9"EDF<'0A-32"EDF<'C-1A-""E:S""UZJ''>Q1&4#Z"E
:EGMEM"SG*J::S$"SDF|'|M.TGFHX0HKEPEAEF:ER^EQ0"SYL."N-1A-10"E-D''
."N-1A-13"E-D''ZKHX0HKECG0'EREW0,0X0'J<.-Z;0A-9"EDF<'0A-32"EDF<'C
-1A-""E:S""UZJ''>Z"NQ1#32768#16384U1''Q1&16384"NQ1&2"EEdi|Inspec
'ting file "HT"1310'Z"EQ1&2"EOSCOPES'
?How can I inspect nothing?1310'Q1&2"EJ:S="S0,.-1X00,.KZU0HX2HK
:Q2"N:ER^EQ2"UG2HX0HKONOTFND'':Q0"NEW^EQ0'Q0"NQ1#2048U1'OREMEM''
HX0HKQ1&2"E:EB^EQ0"SQ1#2048U1OREMEM':ERQ0"SQ1#2048U1
%Can't write to file -- opening for input only1310OREMEM'Q1&256"N
Q1&32768"EONOTFND''%Can't find file ":G0"1310Q1&32768"E
%Creating new file1310OCREATE|%Ignoring TECO's memory1310
Q1#8192U10,0X0OREMEM'':ER^EQ0"SQ1#2048U1OSCOPES'!NOTFND!
?Can't find file ":G0"?1310'J::SMA"S-2D<0A"AD|1;'>
::S^ES"SD'J<.-Z;0A-9"EDF<'0A-32"EDF<'C-1A-""E:S""S-1EJ-25857"E
0J2<@FS/"//>ZJ'|ZJ''>Z"E?How can I MAKE nothing?1310'
HX0HKQ1&2"E:EB^EQ0"SQ1#2048U1OREMEM'Q1&256"NQ1&32768"EONOTFND''
%Can't find file ":G0"1310Q1&32768"E%Creating new file1310
OCREATE|%Ignoring TECO's memory1310Q1#8192U10,0X0OREMEM''
:ER^EQ0"SQ1#2048U1OSCOPES'!NOTFND!?Can't find file ":G0"?1310
'J::SMA"S-2D<0A"AD|1;'>::S^ES"SD'J<.-Z;0A-9"EDF<'0A-32"EDF<'C
-1A-""E:S""UZJ''>Z"E?How can I MAKE nothing?1310'
Z-4"EJ::SLOVE"SNot war?1310''HX0HK!CREATE!EW^EQ0OREMEM'
%Unrecognized command "HTHK"1310OSCOPES!REMEM!Q1&8192"E
Q1&(32768#4)"NOSCOPES':Q0"EOSCOPES'':EGMEM"SZJG*C::S$"U
ZK:EGMEM ^EQ0OSCOPES|-1DZXFZK'|M.T'EA:EW^EQF"SG0HPWHKEF'EW!SCOPES!
!YANK!Q1&2048"NY'JQ1&128"NET&512"E
Q1&(32768#4)"NOSCOPES':Q0"EOSCOPES'':EGMEM"SZJG*CZK:EGMEM ^EQ0|EA
:EW^EQF"SG0HPWHKEF'EW'!SCOPES!!YANK!Q1&2048"NY'JQ1&128"NET&512"E
%Your terminal is not an interactive scope1310|Q2"E2:W-4U2'0,3:W
Q1&16"N1,3:W'0,5:WQ1&32"N1,5:W'Q2,7:W-Q2"N
%Your terminal doesn't support scrolling1310'''!DONE!Q4-1"G
Q4-1:S^J"U0J''Q1&64"N0,128EZ'Q1&512"N0,2EZ']1]0Q0ET]0Q0ES]0Q0EU]0Q0ED
]0Q0]0Q0]2]0]9]F0U.10U.L0U40UY0,0X.T
Q4-1:S^J"U0J''Q1&64"N1U8|0U8']1]0Q0ET]0Q0ES]0Q0EU]0Q0ED]0Q0]0Q0]2]0
]9]FQ8"N0,128EZ'

86
src/win/clpars.tes

@ -29,7 +29,7 @@
64 /NOPAGE
128 /SCROLL
256 /NOCREATE
512 /NORENAME
512 unused
1024 unused
2048 input file is open
4096 /NOINI
@ -48,8 +48,6 @@
6. Q-register F holds the name of the file used to save file names.
7. Q-register 4 holds the line number to go to.
****************************************************************************!
!+ save the q-registers that we'll be changing !
@ -66,8 +64,8 @@ ETU0[032768#32#8#1,0ET !+ ^C trap, read nowait and noecho, image typeout !
Q1U0 !+ Q0 = Q1 !
0U1[1
0,0X1
0U4
-1EJ-25600"E !+ if Unix !
0u4
^^-UY !+ Unix command lines delimit options with '-' !
|
^^/UY !+ VMS command lines delimit options with '/' !
@ -277,20 +275,6 @@ Q1#64U1
!NONOPAGE!
!+***************************************************************************
If there's a /NORENAME switch, (-NORENAME under Unix), delete it, compact
any trailing whitespace, and set the 512 bit of q-register 1.
****************************************************************************!
J:S^ES^EUYNOR"SONORENAME'
J:S^EUYNOR"FONONORENAME'
!NORENAME!
^SD::SA"S-D::SG"S-D::SE"S-D'''
::S^ES"S^SD0A"AI ''
Q1#512U1
!NONORENAME!
!+***************************************************************************
If we're not under RSTS/E, and the command is "TECO @file", then change
it to "MUNG file".
@ -380,13 +364,11 @@ J:S^EUYVT"FONOVTEDIT'
feeds) and put the number in Q-register 4.
****************************************************************************!
!+ -1EJ-25600"E if Unix !
-1EJ-25600"E !+ if Unix !
J:S^ES+"S
^SD\U40,128EZ^sd::ss"S^sD0A"AI ''
'
!+ ' !
!+Set EZ flag if nopage!
Q1&64"N0,128ez'
'
!+***************************************************************************
If there's a /SCROLL switch (-SCROLL under Unix), delete it, get the
@ -455,10 +437,7 @@ J::STE"S-2D !+ if it's a TE command !
0A-9"EDF<'
0A-32"EDF<'
C
-1A-""E:S""S
-1EJ-25857"E !+ If OS/2 then delete quotes !
0J2<@FS/"//>ZJ'|
ZJ'' !+ if no second quote, go to end !
-1A-""E:S""UZJ''
>
!+ Get the remembered file specification into the edit buffer. !
@ -467,11 +446,11 @@ J::STE"S-2D !+ if it's a TE command !
:EGMEM"S !+ if :EGMEM is supported !
G*J !+ get it into the edit buffer !
::S$"S^SD !+ if leading dollar sign, delete and... !
|OGOTIT' !+ otherwise got it and get outa here !
F| !+ ??? !
'
| !+ else :EGMEM isn't supported !
M.T !+ generate file name in F !
GF !+ and get it !
'
GF
HX0HK !+ save filename in Q0 and clear buffer !
EPEA !+ select secondary I-O streams !
EF !+ close current output file !
@ -487,12 +466,12 @@ J::STE"S-2D !+ if it's a TE command !
'
EREW !+ select primary I-O streams !
0,0X0
!GOTIT!
'
!+ If there's a file specification, then delete preceding whitespace and
if the remainder of the filespec contains a quoted string, do a ZJ. !
!+ However there shouldn't be any whitespace -- don't do this step
because it messes up names with embedded spaces
J
<
.-Z;
@ -501,7 +480,7 @@ J::STE"S-2D !+ if it's a TE command !
C
-1A-""E:S""UZJ''
>
! ZJ !+ but move to end just in case !
Z"N
Q1#32768#16384U1
'
@ -548,11 +527,6 @@ J::STE"S-2D !+ if it's a TE command !
Q1#2048U1 !+ remember: input file is open !
OREMEM
'
:ERQ0"S !+ TAA Added -- try to open for read !
Q1#2048U1
%Can't write to file -- opening for input only1310
OREMEM
'
Q1&256"N !+ EB failed, so if -NOCREATE !
Q1&32768"E
ONOTFND
@ -594,10 +568,7 @@ J::SMA"S-2D
0A-9"EDF<'
0A-32"EDF<'
C
-1A-""E:S""S
-1EJ-25857"E !+ If OS/2 then delete quotes !
0J2<@FS/"//>ZJ'|
ZJ'' !+ if no second quote, go to end !
-1A-""E:S""UZJ''
>
Z"E?How can I MAKE nothing?1310'
@ -627,22 +598,14 @@ Q1&8192"E !+ if 8192 bit is off in Q1 !
:EGMEM"S !+ if :EGMEM is supported !
ZJG*C !+ append remembered spec to buffer !
::S$"U !+ no leading $ !
ZK:EGMEM ^EQ0 !+ set remembered filespec to Q0 !
OSCOPES !+ Goto SCOPES !
|
-1D !+ delete dollar !
ZXFZK !+ Save in q reg F !
ZK:EGMEM ^EQ0 !+ set remembered filespec to Q0 !
| !+ else (:EGMEM is not supported) !
EA !+ switch to secondary output stream !
:EW^EQF"S !+ open the file !
G0 HPW HK EF !+ and write the filespec into it !
'
|
M.T !+ Generate file name !
EW !+ switch to primary output stream !
'
EA !+ switch to secondary output stream !
:EW^EQF"S !+ open the file !
G0 HPW HK EF !+ and write the filespec into it !
'
EW !+ switch to primary output stream !
!+***************************************************************************
****************************************************************************!
@ -787,11 +750,10 @@ Q1&128"N !+ if -SCROLL !
q4-1"G !+ if q4 greater than 1 !
q4-1:s^J"U0J' !+ search for q4th line feed !
'
q1&64"N !+ NOPAGE switch? !
0,128EZ
'
q1&512"N !+ NORENAME switch? !
0,2EZ
q1&64"N !+ no NOPAGE switch? !
1u8
|
0u8
'
]1
]0Q0ET
@ -804,5 +766,5 @@ q1&512"N !+ NORENAME switch? !
]0
]9
]F
0U.10U.L0U40UY0,0X.T !+ reset q registers !
q8"N0,128ez'


6
src/zport.h

@ -206,7 +206,7 @@ Power C v1.3.0 compiler, for example, supports ANSI string concatenation, but
does not like the 3 Kbyte clpars[] string.
****************************************************************************/
#if defined(__TURBOC__) || defined(__GNUC__)
#if defined(__TURBOC__) || defined(__GNUC__) || defined(WIN32)
#define USE_ANSI_CLPARS TRUE
#else
#define USE_ANSI_CLPARS FALSE
@ -337,7 +337,7 @@ ZBFMIN minimum size of the EI file buffer before it is expanded.
#define MCS_SIZE 32 /* size of macro stack */
#define QRS_SIZE 32 /* size of q-register stack */
#elif defined(__TURBOC__) || defined(__POWERC) || defined(unix) || defined(AMIGA) || defined(OSX)
#elif defined(__TURBOC__) || defined(__POWERC) || defined(unix) || defined(AMIGA) || defined(OSX) || defined(WIN32)
#define EXTERN extern /* to reference an external symbol */
#define GLOBAL /**/ /* to define an external symbol */
@ -349,7 +349,7 @@ ZBFMIN minimum size of the EI file buffer before it is expanded.
#define GLOBALV volatile /* to define an external volatile symbol */
#endif
#if defined(__TURBOC__) || defined(__POWERC) || defined(__GNUC__) || defined(AMIGA) || defined(OSX)
#if defined(__TURBOC__) || defined(__POWERC) || defined(__GNUC__) || defined(AMIGA) || defined(OSX) || defined(WIN32)
#define VVOID void /* Void function return */
#else
#define VVOID /**/ /* Void function return */

2
src/zwin32.c

@ -32,9 +32,7 @@
#include "deferr.h" /* define identifiers for error messages */
#include "dchars.h" /* define identifiers for characters */
#include "dscren.h" /* define identifiers for screen i/o */
#if USE_PROTOTYPES
static void CntrlC(int sig);
#endif
#if VIDEO
static HANDLE PrevScreen, Screen;
static COORD Cursor;

Loading…
Cancel
Save