├── ADVANCE.PAS ├── ARCHIVER.PAS ├── ARCVIEW.PAS ├── ARVID.PAS ├── ASCIITAB.PAS ├── BPC.CFG ├── BUILD.BAT ├── BUILDDN.BAT ├── CALC.PAS ├── CCALC.PAS ├── CDPLAYER.PAS ├── CDUTIL.PAS ├── CELLSCOL.PAS ├── CMDLINE.PAS ├── COLORS.PAS ├── COLORSEL.PAS ├── COLORVGA.PAS ├── COMLNK.PAS ├── COMLNKIO.PAS ├── COMMANDS.PAS ├── COPY.PAS ├── CPUTYPE.ASM ├── DBLWND.PAS ├── DBVIEW.PAS ├── DBWATCH.PAS ├── DIALOGS.PAS ├── DISKIMG.PAS ├── DISKINFO.PAS ├── DISKTOOL.PAS ├── DN.ASM ├── DN.DEF ├── DN.PAS ├── DNAPP.PAS ├── DNFORMAT.PAS ├── DNHELP.PAS ├── DNSTDDLG.PAS ├── DNUTIL.PAS ├── DRIVERS.PAS ├── DRIVES.PAS ├── EDITOR.PAS ├── ERASER.PAS ├── EXTRAMEM.PAS ├── FBB.PAS ├── FILECOPY.PAS ├── FILEFIND.PAS ├── FILELIST.PAS ├── FILESCOL.PAS ├── FIXER.PAS ├── FLPANEL.PAS ├── FLPANELX.PAS ├── FLTOOLS.PAS ├── FMTUNIT.PAS ├── FORMAT.ASM ├── FORMAT.PAS ├── FSTORAGE.PAS ├── FVIEWER.PAS ├── GAUGE.PAS ├── GAUGES.PAS ├── GETCONST.PAS ├── GETCPU.ASM ├── HELPFILE.PAS ├── HELPKERN.PAS ├── HIDEVIEW.PAS ├── HISTLIST.PAS ├── HISTRIES.PAS ├── IDLERS.PAS ├── INIFILES.PAS ├── LINK.INC ├── LINKTYP.PAS ├── LINKUTIL.PAS ├── LZWC2.ASM ├── LZWD2.ASM ├── MACRO.PAS ├── MEMINFO.PAS ├── MEMORY.PAS ├── MENUS.PAS ├── MESSAGES.PAS ├── MICROED.PAS ├── MODEMIO.PAS ├── NAVYLINK.PAS ├── OBJECTS.PAS ├── OBJTYPE.PAS ├── OVERLAYS.PAS ├── PAR.PAS ├── PHONES.PAS ├── PRINTMAN.PAS ├── RCP.INI ├── RCP.PAS ├── README.TXT ├── REANIMAT.PAS ├── RESOURCE ├── ENGLISH │ ├── DN.DNL │ ├── DN.DNR │ └── DNHELP.HTX └── RUSSIAN │ ├── DN.DNL │ ├── DN.DNR │ └── DNHELP.HTX ├── RSR.BAT ├── RSTRINGS.PAS ├── RUNCMD.INC ├── SBLOCKS.PAS ├── SCROLLBK.PAS ├── SCROLLER.PAS ├── SETUPS.PAS ├── STARSKY.PAS ├── STARTUP.PAS ├── STDEFINE.INC ├── STRINGS.PAS ├── SWE.PAS ├── SYSINT.ASM ├── TERMINAL.PAS ├── TETRIS.PAS ├── TREE.PAS ├── TVHC.PAS ├── UNIWIN.PAS ├── USERMENU.PAS ├── UUCODE.PAS ├── UUE2INC.ASM ├── VALIDATE.PAS ├── VERSION.INC ├── VERSION.PAS ├── VGA33.ASM ├── VIEWS.PAS ├── WINCLP.PAS ├── XDBLWND.PAS ├── XMSSTRM.INC ├── XTIME.PAS └── _MHZ.ASM /ADVANCE.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/ADVANCE.PAS -------------------------------------------------------------------------------- /ARCHIVER.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/ARCHIVER.PAS -------------------------------------------------------------------------------- /ASCIITAB.PAS: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on Dos Navigator by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | unit ASCIITab; 48 | 49 | interface 50 | 51 | uses Objects, DNApp, Views, Drivers, RStrings, ObjType; 52 | 53 | type 54 | PTable = ^TTable; 55 | TTable = object(TView) 56 | procedure Draw; virtual; 57 | procedure HandleEvent(var Event:TEvent); virtual; 58 | function DataSize: Word; virtual; 59 | procedure GetData(var Data); virtual; 60 | procedure SetData(var Data); virtual; 61 | end; 62 | 63 | PReport = ^TReport; 64 | TReport = object(TView) 65 | ASCIIChar: LongInt; 66 | constructor Load(var S: TStream); 67 | procedure Draw; virtual; 68 | procedure HandleEvent(var Event:TEvent); virtual; 69 | procedure Store(var S: TStream); 70 | end; 71 | 72 | PASCIIChart = ^TASCIIChart; 73 | TASCIIChart = object(TWindow) 74 | constructor Init(var R: TRect); 75 | function Execute: Word; virtual; 76 | end; 77 | 78 | const 79 | AsciiTableCommandBase: Word = 910; 80 | 81 | RTable: TStreamRec = ( 82 | ObjType: otTable; 83 | VmtLink: Ofs(TypeOf(TTable)^); 84 | Load: @TTable.Load; 85 | Store: @TTable.Store 86 | ); 87 | RReport: TStreamRec = ( 88 | ObjType: otReport; 89 | VmtLink: Ofs(TypeOf(TReport)^); 90 | Load: @TReport.Load; 91 | Store: @TReport.Store 92 | ); 93 | RASCIIChart: TStreamRec = ( 94 | ObjType: otASCIIChart; 95 | VmtLink: Ofs(TypeOf(TASCIIChart)^); 96 | Load: @TASCIIChart.Load; 97 | Store: @TASCIIChart.Store 98 | ); 99 | 100 | procedure RegisterASCIITab; 101 | 102 | function InputASCIIChar(var R: TRect; var C: Char): Boolean; 103 | 104 | implementation 105 | 106 | uses 107 | Commands, DNHelp; 108 | 109 | const 110 | cmCharacterFocused = 0; 111 | 112 | function InputASCIIChar(var R: TRect; var C: Char): Boolean; 113 | const QQQChar: Char = #115; 114 | var P: PWindow; 115 | W: Word; 116 | E: TEvent; 117 | RR: TRect; 118 | begin 119 | C := QQQChar; 120 | P := New(PASCIIChart, Init(RR)); 121 | R.B.X := R.A.X + P^.Size.X; 122 | R.B.Y := R.A.Y + P^.Size.Y; 123 | if R.A.Y < 0 then R.Move(0,-R.A.Y); 124 | if R.A.X < 0 then R.Move(-R.A.X,0); 125 | if R.B.X > Desktop^.Size.X-3 then R.Move(Desktop^.Size.X-3-R.B.X, 0); 126 | if R.B.Y > Desktop^.Size.Y-1 then R.Move(0,Desktop^.Size.Y-1-R.B.Y); 127 | P^.MoveTo(R.A.X, R.A.Y); 128 | {P^.Options := P^.Options and not ofSelectable;} 129 | P^.SetData(C); 130 | {InsertWindow(P);} 131 | InputASCIIChar := Desktop^.ExecView(P) = cmOK; 132 | P^.GetData(C); 133 | QQQChar := C; 134 | Dispose(P, Done); 135 | end; 136 | 137 | 138 | 139 | procedure TTable.Draw; 140 | var 141 | Buf: TDrawBuffer; 142 | X, Y: Integer; 143 | Color: Byte; 144 | begin 145 | Color := GetColor(6); 146 | for Y := 0 to Size.Y - 1 do 147 | begin 148 | MoveChar(Buf, ' ', Color, Size.X); 149 | for X := 0 to Size.X - 1 do 150 | MoveChar(Buf[x], Chr(32 * y + x), Color, 1); 151 | WriteLine(0, y, Size.X, 1, Buf); 152 | end; 153 | ShowCursor; 154 | end; 155 | 156 | procedure TTable.HandleEvent(var Event:TEvent); 157 | var 158 | CurrentSpot: TPoint; 159 | C: Char; 160 | 161 | procedure CharFocused; 162 | begin 163 | Message(Owner, evBroadcast, AsciiTableCommandBase + cmCharacterFocused, 164 | Pointer(Cursor.X + 32 * Cursor.Y)); 165 | end; 166 | 167 | begin 168 | if Event.What = evMouseDown then 169 | begin 170 | if Event.Double then 171 | begin 172 | Event.What := evKeyDown; 173 | {Event.KeyCode := kbEnter;} 174 | GetData(C); 175 | Event.CharCode := C; 176 | Event.ScanCode := 0; 177 | PutEvent(Event); 178 | ClearEvent(Event); 179 | Exit; 180 | end; 181 | repeat 182 | if MouseInView(Event.Where) then 183 | begin 184 | MakeLocal(Event.Where, CurrentSpot); 185 | SetCursor(CurrentSpot.X, CurrentSpot.Y); 186 | CharFocused; 187 | end; 188 | until not MouseEvent(Event, evMouseMove); 189 | ClearEvent(Event); 190 | end 191 | else if Event.What = evKeyDown then 192 | with Cursor do begin 193 | case Event.KeyCode of 194 | kbHome: SetCursor(0,0); 195 | kbEnd: SetCursor(Size.X - 1, Size.Y - 1); 196 | kbUp: if Y > 0 then SetCursor(X, Y - 1); 197 | kbDown: if Y < Size.Y - 1 then SetCursor(X, Y + 1); 198 | kbLeft: if X > 0 then SetCursor(X - 1, Y); 199 | kbRight: if X < Size.X - 1 then SetCursor(X + 1, Y); 200 | else 201 | SetCursor(ord(Event.CharCode) mod 32, ord(Event.CharCode) div 32); 202 | end; 203 | CharFocused; 204 | ClearEvent(Event); 205 | end; 206 | TView.HandleEvent(Event); 207 | end; 208 | 209 | { TReport } 210 | 211 | constructor TReport.Load(var S: TStream); 212 | begin 213 | TView.Load(S); 214 | S.Read(ASCIIChar, SizeOf(ASCIIChar)); 215 | end; 216 | 217 | procedure TReport.Draw; 218 | var 219 | Ch: LongInt; 220 | Color: Byte; 221 | Buf: TDrawBuffer; 222 | TempStr: string; 223 | begin 224 | FormatStr(TempStr, ' Char: %c Decimal: %0#%3d Hex: %0#%02x ', ASCIIChar); 225 | WriteStr(0, 0, TempStr, 6); 226 | end; 227 | 228 | procedure TReport.HandleEvent(var Event: TEvent); 229 | var 230 | Table: PTable; 231 | begin 232 | TView.HandleEvent(Event); 233 | if Event.What = evBroadcast then 234 | if Event.Command = AsciiTableCommandBase + cmCharacterFocused then 235 | begin 236 | ASCIIChar := Event.InfoLong; 237 | DrawView; 238 | end; 239 | end; 240 | 241 | procedure TReport.Store(var S: TStream); 242 | begin 243 | TView.Store(S); 244 | S.Write(ASCIIChar, SizeOf(ASCIIChar)); 245 | end; 246 | 247 | function TTable.DataSize; 248 | begin 249 | DataSize := 1; 250 | end; 251 | 252 | procedure TTable.GetData; 253 | begin 254 | Byte(Data) := Cursor.Y*32 + Cursor.X; 255 | end; 256 | 257 | procedure TTable.SetData; 258 | begin 259 | SetCursor(Byte(Data) mod 32, Byte(Data) div 32); 260 | Message(Owner, evBroadcast, AsciiTableCommandBase + cmCharacterFocused, 261 | Pointer(Cursor.X + 32 * Cursor.Y)); 262 | Owner^.ReDraw; 263 | end; 264 | 265 | constructor TASCIIChart.Init; 266 | var 267 | Control: PVIew; 268 | begin 269 | R.Assign(0, 0, 34, 12); 270 | TWindow.Init(R, GetString(dlASCIIChart), wnNoNumber); 271 | Flags := Flags and not (wfGrow + wfZoom); 272 | HelpCtx := hcAsciiChart; 273 | Palette := wpGrayWindow; 274 | 275 | R.Grow(-1,-1); 276 | R.A.Y := R.B.Y - 1; 277 | Control := New(PReport, Init(R)); 278 | with Control^ do 279 | begin 280 | Options := Options or ofFramed; 281 | EventMask := EventMask or evBroadcast; 282 | end; 283 | Insert(Control); 284 | 285 | GetExtent(R); 286 | R.Grow(-1,-1); 287 | R.B.Y := R.B.Y - 2; 288 | Control := New(PTable, Init(R)); 289 | with Control^ do 290 | begin 291 | Options := Options or ofFramed or ofSelectable; 292 | EventMask := $FFFF; 293 | BlockCursor; 294 | end; 295 | Insert(Control); 296 | Control^.Select; 297 | end; 298 | 299 | function TASCIIChart.Execute: Word; 300 | var Event : TEvent; 301 | begin 302 | repeat 303 | GetEvent(Event); 304 | case Event.What of 305 | evKeyDown: case Event.KeyCode of 306 | kbESC: begin Event.What := evCommand; Event.Command := cmCancel; end; 307 | kbEnter, kbCtrlB, kbCtrlP: begin Event.What := evCommand; Event.Command := cmOK; end; 308 | else if Event.CharCode > #0 then 309 | begin SetData(Event.CharCode); Event.What := evCommand; Event.Command := cmOK; end; 310 | end; 311 | end; 312 | If Event.What<>evNothing then HandleEvent(Event); 313 | until (Event.What = evCommand) and ((Event.Command < 255) and 314 | (Event.Command in [cmOK, cmCancel, cmClose])); 315 | Execute := Event.Command; 316 | end; 317 | 318 | procedure RegisterASCIITab; 319 | begin 320 | RegisterType(RTable); 321 | RegisterType(RReport); 322 | RegisterType(RASCIIChart); 323 | end; 324 | 325 | end. 326 | 327 | -------------------------------------------------------------------------------- /BPC.CFG: -------------------------------------------------------------------------------- 1 | /EEXE 2 | /M 3 | /$A+ 4 | /$B- 5 | /$D+ 6 | /$E+ 7 | /$F+ 8 | /$G+ 9 | /$I- 10 | /$K- 11 | /$L+ 12 | /$N+ 13 | /$O+ 14 | /$P- 15 | /$Q- 16 | /$R- 17 | /$S- 18 | /$T- 19 | /$V- 20 | /$W- 21 | /$X+ 22 | /$Y+ 23 | /DDN -------------------------------------------------------------------------------- /BUILD.BAT: -------------------------------------------------------------------------------- 1 | builddn.bat asm ver help resource 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /BUILDDN.BAT: -------------------------------------------------------------------------------- 1 | @echo off 2 | set tvar= 3 | 4 | set multi=Y 5 | set bppath=\bp\bin\ 6 | set outpath=out 7 | 8 | rem ------------------------------------------------------------------ 9 | rem BUILDDN [help] [resource] [asm] [nobpc] [nolite] [ver] 10 | rem ------------------------------------------------------------------ 11 | rem ctty con 12 | if .%1.==.. builddn help resource nolite 13 | 14 | :Loop 15 | if .%1.==.asm. goto asm 16 | if .%1.==.ver. goto cmpver 17 | if .%1.==.resource. goto resource 18 | if .%1.==.help. goto help 19 | if .%1.==.nolite. set lite=off 20 | if .%1.==.nolite. shift 21 | 22 | :Done 23 | if .%1.==.nobpc. goto SkipBPC 24 | %bppath%bpc dn /dDN /GP /Q /B %1 %2 %3 %4 %5 %6 %7 %8 %9 25 | if errorlevel 1 goto Quit 26 | 27 | if .%lite%.==.off. goto SkipLite 28 | pklite exe\dn.exe 29 | if errorlevel 1 goto Quit 30 | :SkipLite 31 | copy exe\dn.ovr %outpath% 32 | copy exe\dn.exe %outpath%\*.PRG 33 | 34 | :SkipBPC 35 | goto Quit 36 | 37 | :resource 38 | if not .%Q%.==.. %bppath%bpc rcp /q 39 | if not .%Q%.==.. goto :r 40 | if not exist exe\rcp.exe %bppath%bpc rcp /q 41 | :r 42 | if errorlevel 1 goto Quit 43 | if not exist exe\rcp.exe goto Quit 44 | shift 45 | exe\rcp 46 | if errorlevel 1 goto Quit 47 | 48 | copy exe\dn*.lng %outpath% 49 | copy exe\dn*.dlg %outpath% 50 | set Q= 51 | goto Loop 52 | 53 | :help 54 | shift 55 | %bppath%bpc tvhc /q 56 | if errorlevel 1 goto Quit 57 | if not exist exe\tvhc.exe goto Quit 58 | 59 | exe\tvhc resource\english\dnhelp.htx exe\dn.hlp dnhelp.pas 60 | if errorlevel 1 goto Quit 61 | copy exe\dn.hlp %outpath% 62 | 63 | exe\tvhc resource\russian\dnhelp.htx exe\dnrus.hlp dnhelp.pas 64 | if errorlevel 1 goto Quit 65 | copy exe\dnrus.hlp %outpath% 66 | 67 | set Q=Y 68 | goto Loop 69 | 70 | :asm 71 | shift 72 | %bppath%tasm /t /x /m /q *.asm 73 | if errorlevel 1 goto Quit 74 | %bppath%tlink /t /x dn.obj, exe\dn.com 75 | if errorlevel 1 goto Quit 76 | del dn.obj 77 | copy exe\dn.com %outpath% 78 | goto Loop 79 | 80 | :cmpver 81 | shift 82 | %bppath%bpc version 83 | exe\version 84 | goto Loop 85 | 86 | :Quit 87 | -------------------------------------------------------------------------------- /CALC.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/CALC.PAS -------------------------------------------------------------------------------- /CDPLAYER.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/CDPLAYER.PAS -------------------------------------------------------------------------------- /CDUTIL.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/CDUTIL.PAS -------------------------------------------------------------------------------- /CELLSCOL.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/CELLSCOL.PAS -------------------------------------------------------------------------------- /COLORS.PAS: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on Dos Navigator by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | unit Colors; 48 | interface 49 | uses Objects, {ColorSel,} DNApp, Dialogs, Drivers, Views, Memory, 50 | Commands, DNStdDlg, Advance,DNHelp; 51 | 52 | procedure ChangeColors; 53 | procedure WindowManager; 54 | procedure SetHighlightGroups; 55 | 56 | type 57 | 58 | PWindowList = ^TWindowList; 59 | TWindowList = object(TListBox) 60 | function GetText(Item: Integer; MaxLen: Integer): String; virtual; 61 | end; 62 | 63 | PWindowCol = ^TWindowCol; 64 | TWindowCol = object(TCollection) 65 | procedure FreeItem(Item: Pointer); virtual; 66 | end; 67 | 68 | 69 | implementation uses Messages, RStrings, Drives, Startup; 70 | 71 | procedure SetHighlightGroups; 72 | var D: Record S1, S2, S3, S4, S5: String[250]; end; 73 | begin 74 | With D do 75 | begin 76 | S1 := CustomMask1; Replace(#0, ';', S1); DelFC(S1); Dec(S1[0]); 77 | S2 := CustomMask2; Replace(#0, ';', S2); DelFC(S2); Dec(S2[0]); 78 | S3 := CustomMask3; Replace(#0, ';', S3); DelFC(S3); Dec(S3[0]); 79 | S4 := CustomMask4; Replace(#0, ';', S4); DelFC(S4); Dec(S4[0]); 80 | S5 := CustomMask5; Replace(#0, ';', S5); DelFC(S5); Dec(S5[0]); 81 | if ExecResource(dlgHighlightGroups, D) <> cmOK then Exit; 82 | LowStr(S1); LowStr(S2); LowStr(S3); LowStr(S4); LowStr(S5); 83 | While S1[Length(S1)] in [' ', ';'] do Dec(S1[0]); Replace(';', #0,S1); CustomMask1 := #0+DelSpaces(S1)+#0; 84 | While S2[Length(S2)] in [' ', ';'] do Dec(S2[0]); Replace(';', #0,S2); CustomMask2 := #0+DelSpaces(S2)+#0; 85 | While S3[Length(S3)] in [' ', ';'] do Dec(S3[0]); Replace(';', #0,S3); CustomMask3 := #0+DelSpaces(S3)+#0; 86 | While S4[Length(S4)] in [' ', ';'] do Dec(S4[0]); Replace(';', #0,S4); CustomMask4 := #0+DelSpaces(S4)+#0; 87 | While S5[Length(S5)] in [' ', ';'] do Dec(S5[0]); Replace(';', #0,S5); CustomMask5 := #0+DelSpaces(S5)+#0; 88 | end; 89 | Message(Application, evCommand, cmUpdateConfig, nil); 90 | GlobalMessage(evCommand, cmPanelReread, nil); 91 | end; 92 | 93 | procedure ChangeColors; 94 | var D: PDialog; 95 | begin 96 | D := PDialog(LoadResource(dlgColors)); 97 | if Application^.ExecuteDialog(D, Application^.GetPalette) <> cmCancel then 98 | begin 99 | DoneMemory; { Dispose all group buffers } 100 | Application^.ReDraw; { Redraw application with new palette } 101 | end; 102 | if VGASystem then GetPalette(VGA_Palette); 103 | end; 104 | 105 | procedure TWindowCol.FreeItem; 106 | begin 107 | end; 108 | 109 | function TWindowList.GetText; 110 | var S: String; 111 | P: PView; 112 | begin 113 | P := List^.At(Item); 114 | S := GetString(dlUnknownWindowType); 115 | Message(P, evCommand, cmGetName, @S); 116 | GetText := S; 117 | end; 118 | 119 | procedure WindowManager; 120 | label 1; 121 | var D: PDialog; 122 | R: TRect; 123 | PC: PWindowCol; 124 | PV: PView; 125 | S: String; 126 | DT: record P: PCollection; N: Word; end; 127 | 128 | procedure InsView(P: PView); far; 129 | begin 130 | if P = nil then Exit; 131 | S := ''; 132 | if (P^.GetState(sfVisible)) then begin 133 | Message(P, evCommand, cmGetName, @S); 134 | if (S <> '') then PC^.Insert(P); 135 | end; 136 | end; 137 | 138 | begin 139 | New(PC, Init(10,10)); 140 | Desktop^.ForEach(@InsView); 141 | if PC^.Count = 0 then begin Dispose(PC, Done); Exit end; 142 | 143 | D := PDialog( LoadResource( dlgWindowManager )); 144 | 145 | R.Assign(D^.Size.X-13,3,D^.Size.X-12,D^.Size.Y-2); 146 | PV := New(PScrollBar, Init(R)); 147 | PV^.Options := PV^.Options or ofPostProcess or ofSecurity; 148 | D^.Insert(PV); 149 | 150 | R.Assign(2,3,D^.Size.X-13,D^.Size.Y-2); 151 | PV := New(PWindowList, Init(R,1,PScrollBar(PV))); 152 | PV^.Options := PV^.Options or ofPostProcess or ofSecurity; 153 | PListBox(PV)^.NewList(PC); 154 | D^.Insert(PV); 155 | 156 | R.Assign(2,2,45,3); 157 | PV := New(PLabel, Init(R, GetString(dlWindowsLabel), PV)); 158 | D^.Insert(PV); 159 | 160 | 1: 161 | R.A.X := Desktop^.ExecView(D); 162 | D^.GetData(DT); 163 | if PC^.Count > 0 then begin 164 | if R.A.X = cmNo then begin 165 | if PView(DT.P^.At(DT.N))^.Valid( cmClose ) then begin 166 | PView(DT.P^.At(DT.N))^.Free; 167 | New(PC, Init(10,10)); 168 | Desktop^.ForEach(@InsView); 169 | if PC^.Count > 0 then begin 170 | DT.P^.AtDelete(DT.N); 171 | DT.P := NIL; 172 | D^.SetData( DT ); 173 | If ( DT.N > 0 ) and ( DT.N >= PC^.Count ) then Dec( DT.N ); 174 | DT.P := PC; 175 | D^.SetData( DT ); 176 | goto 1 177 | end 178 | end 179 | end; 180 | if R.A.X = cmOK then PView(DT.P^.At(DT.N))^.Select; 181 | end; 182 | Dispose(D, Done); 183 | Dispose(PC, Done); 184 | end; 185 | 186 | end. -------------------------------------------------------------------------------- /COLORSEL.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/COLORSEL.PAS -------------------------------------------------------------------------------- /COMLNKIO.PAS: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on Dos Navigator by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | unit ComLnkIO; 48 | 49 | {$I LINK.INC} interface 50 | 51 | const 52 | TCL_TimerSz = 8; 53 | 54 | type 55 | TCL_Timer = array[1..TCL_TimerSz] of byte; 56 | 57 | function CL_OutBuffFree(APort: Pointer): Word; 58 | function CL_OutBuffUsed(APort: Pointer): Word; 59 | function CL_GetBlock(APort: Pointer; var Buf; Size: Word): Word; 60 | procedure CL_PutBlock(APort: Pointer; const Buf; Size: Word); 61 | function CL_InitCOM: Pointer; 62 | procedure CL_DoneCOM(APort: Pointer); 63 | function CL_DCD(APort: Pointer): Boolean; 64 | 65 | procedure CL_NewTimer(var Timer: TCL_Timer; Tics : LongInt); 66 | procedure CL_ClearTimer(var Timer: TCL_Timer); 67 | function CL_TimerExpired(const Timer: TCL_Timer): Boolean; 68 | function CL_TimerInstalled(const Timer: TCL_Timer): Boolean; 69 | 70 | function CL_GetCRC32ofs: Word; 71 | 72 | {$IFDEF NLSLAVE} 73 | var 74 | _Speed: LongInt; 75 | _ComNum: Byte; 76 | {$ENDIF} 77 | 78 | 79 | implementation uses 80 | {$IFDEF DN} ModemIO, {$ENDIF} 81 | {$IFDEF OS2} 82 | CrtOS2, 83 | OS2Def, 84 | DosTypes, 85 | DosProcs, 86 | OS2Timer 87 | {$ELSE} 88 | apFossil, 89 | ooCOM, 90 | apPort, 91 | apMisc, 92 | xTime 93 | {$ENDIF} ; 94 | 95 | {$IFDEF OS2} {$I OS2IO.INC} {$ENDIF} 96 | 97 | function CL_GetCRC32ofs: Word; 98 | begin 99 | CL_GetCRC32ofs := {$IFDEF OS2} Ofs(CRC32Table) 100 | {$ELSE} CRC32TableOfs {$ENDIF}; 101 | end; 102 | 103 | function CL_OutBuffFree; 104 | 105 | {$IFDEF OS2} 106 | var 107 | StatStruc : record NumBytes, BufSize: Word end; 108 | begin 109 | rc := DosDevIOctl(StatStruc, (nil)^, ASYNC_GETOUTQUECOUNT, IOCTL_ASYNC, hfCOM); 110 | if rc <> NO_ERROR then Usage; 111 | with StatStruc do 112 | begin 113 | {WriteLn('NumBytes = ', NumBytes,', BufSize = ',BufSize);} 114 | CL_OutBuffFree := BufSize - NumBytes; 115 | end; 116 | end; 117 | {$ELSE} 118 | begin CL_OutBuffFree := AbstractPortPtr(APort)^.OutBuffFree end; 119 | {$ENDIF} 120 | 121 | function CL_OutBuffUsed; 122 | 123 | {$IFDEF OS2} 124 | var 125 | StatStruc : record NumBytes, BufSize: Word end; 126 | begin 127 | rc := DosDevIOctl(StatStruc, (nil)^, ASYNC_GETOUTQUECOUNT, IOCTL_ASYNC, hfCOM); 128 | if rc <> NO_ERROR then Usage; 129 | CL_OutBuffUsed := StatStruc.NumBytes; 130 | end; 131 | {$ELSE} 132 | begin CL_OutBuffUsed := AbstractPortPtr(APort)^.OutBuffUsed end; 133 | {$ENDIF} 134 | 135 | procedure CL_PutBlock; 136 | 137 | {$IFDEF OS2} 138 | var 139 | Actually: Word; 140 | begin 141 | DosWrite(hfCOM, (@Buf)^, Size, Actually); 142 | end; 143 | {$ELSE} 144 | var Dummy : Word; 145 | begin 146 | AbstractPortPtr(APort)^.PutBlockDirect(Addr(Buf)^, Size, Dummy); 147 | end; 148 | {$ENDIF} 149 | 150 | function CL_GetBlock; 151 | {$IFDEF OS2} 152 | var Actual: Word; 153 | begin 154 | DosRead(hfCOM, Buf, Size, Actual); 155 | CL_GetBlock := Actual; 156 | end; 157 | {$ELSE} 158 | var Actual : Word; 159 | begin 160 | AbstractPortPtr(APort)^.GetBlockDirect(Buf, Size, Actual, []); 161 | CL_GetBlock := Actual; 162 | end; 163 | {$ENDIF} 164 | 165 | {$IFNDEF DN} 166 | 167 | procedure Usage; 168 | begin 169 | WriteLn('Usage: NLslave [115200] [FOSSIL]'); 170 | WriteLn(' valid ports are COM1-COM8'); 171 | WriteLn(' valid BPS are 300, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600,'); 172 | WriteLn(' and 115200 for Registered Users Only'); 173 | WriteLn(' valid interfaces are DEFAULT, FOSSIL and DIGI14'); 174 | Halt; 175 | end; 176 | 177 | {$ENDIF} 178 | 179 | function CL_DCD; 180 | begin 181 | CL_DCD := AbstractPortPtr(APort)^.CheckDCD; 182 | end; 183 | 184 | function CL_InitCOM; 185 | 186 | {$IFDEF DN} 187 | begin 188 | CL_InitCOM := COMport; 189 | end; 190 | 191 | {$ELSE} 192 | 193 | {$IFDEF OS2} 194 | 195 | { ------------------------------ OS/2 ------------------------------ } 196 | var 197 | ctrl: packed record 198 | D, P, S: Byte; 199 | end; 200 | var 201 | s: string; 202 | sp: LongInt; 203 | er: Integer; 204 | procedure UpStr;var I:Byte;begin for I:=1 to Length(S) do S[I] := UpCase(S[I]) end; 205 | 206 | begin 207 | 208 | CL_InitCOM := nil; 209 | 210 | s := ParamStr(1); UpStr; 211 | if (Length(s)<>4) or (Copy(s,1,3)<>'COM') or (not (s[4] in ['1'..'8'])) then 212 | begin 213 | WriteLn('Illegal COM Port - '+s); Usage; 214 | end; 215 | s[Length(s)+1] := #0; 216 | rc := DosOpen(@s[1], hfCOM, ComAction, 0, FILE_NORMAL, FILE_OPEN, 217 | OPEN_ACCESS_READWRITE or OPEN_SHARE_DENYNONE, 0); 218 | if rc = NO_ERROR then CL_InitCOM := @hfCOM else 219 | begin 220 | WriteLn('Failed to open '+s); Usage; 221 | end; 222 | 223 | s := ParamStr(2); 224 | Val(s, sp, er); 225 | if er>0 then 226 | begin 227 | WriteLn('Illegal COM Speed - '+s); Usage; 228 | end; 229 | WriteLn('Initializing ',s); 230 | rc := DosDevIOctl((nil)^, sp, ASYNC_SETBAUDRATE, IOCTL_ASYNC, hfCOM); 231 | if rc <> NO_ERROR then 232 | begin 233 | WriteLn('Failed to set baudrate '+s); Usage; 234 | end; 235 | 236 | with ctrl do begin D:=8;P:=0;S:=0 end; 237 | rc := DosDevIOctl((nil)^, ctrl, ASYNC_SETLINECTRL, IOCTL_ASYNC, hfCOM); 238 | if rc <> NO_ERROR then 239 | begin 240 | WriteLn('Failed to port characteristics of '+s); Usage; 241 | end; 242 | 243 | end; 244 | 245 | 246 | {$ELSE} 247 | 248 | { ------------------------------ DOS ------------------------------ } 249 | 250 | type 251 | Tp = (tDefault, tFossil, tDigi); 252 | 253 | const 254 | bs = 16384; 255 | 256 | var 257 | s: string; 258 | er: Integer; 259 | p: Pointer; 260 | optn : Word; 261 | t: tp; 262 | 263 | procedure UpStr;var I:Byte;begin for I:=1 to Length(S) do S[I] := UpCase(S[I]) end; 264 | 265 | begin 266 | if ParamCount < 1 then Usage; 267 | InitApMisc; 268 | s := ParamStr(1); UpStr; 269 | if (Length(s)<>4) or (Copy(s,1,3)<>'COM') or (not (s[4] in ['1'..'8'])) then 270 | begin 271 | WriteLn('Illegal COM Port - '+s); Usage; 272 | end; 273 | _ComNum := byte(s[4])-byte('0'); 274 | 275 | if ParamCount > 1 then 276 | begin 277 | s := ParamStr(2); 278 | Val(s, _Speed, er); 279 | if er>0 then 280 | begin 281 | WriteLn('Illegal COM Speed - '+s); Usage; 282 | end; 283 | end else _Speed := 115200; 284 | 285 | 286 | {FossilPortPtr} 287 | 288 | if ParamCount = 3 then 289 | begin 290 | s := ParamStr(3); UpStr; 291 | if s = 'DEFAULT' then t := tDefault else 292 | if s = 'FOSSIL' then t := tFossil else 293 | if s = 'DIGI14' then t := tDigi else 294 | begin 295 | WriteLn('Illegal interface - '+s); Usage; 296 | end; 297 | end else t := tDefault; 298 | 299 | optn := ptReturnPartialGets + 300 | ptExecutePartialPuts + 301 | ptReturnDelimiter + 302 | ptDropModemOnClose + 303 | ptRaiseModemOnOpen + 304 | ptTrueOutBuffFree + 305 | ptRestoreOnClose; 306 | 307 | 308 | case t of 309 | tDefault : p := New(UARTPortPtr, InitCustom(ComNameType(_ComNum-1), _Speed, NoParity, 8, 1, bs, bs, optn)); 310 | tFossil : p := New(FossilPortPtr, InitCustom(ComNameType(_ComNum-1), _Speed, NoParity, 8, 1, bs, bs, optn)); 311 | tDigi : p := New(Digi14PortPtr, InitCustom(ComNameType(_ComNum-1), _Speed, NoParity, 8, 1, bs, bs, optn)); 312 | end; 313 | 314 | if p = nil then 315 | begin 316 | WriteLn('Can''t initialize COM port!!!'); 317 | end; 318 | CL_InitCOM := p; 319 | end; 320 | 321 | {$ENDIF} {-NLSLAVE-} 322 | 323 | {$ENDIF DN} 324 | 325 | 326 | { ================================================================= } 327 | 328 | procedure CL_DoneCOM; 329 | 330 | {$IFDEF DN} 331 | begin end; 332 | {$ELSE} 333 | 334 | {$IFDEF OS2} 335 | begin 336 | rc := DosClose(HFILE(APort^)); 337 | end; 338 | {$ELSE} 339 | begin 340 | Dispose(AbstractPortPtr(APort), Done); 341 | end; 342 | {$ENDIF} 343 | 344 | {$ENDIF DN} 345 | 346 | procedure CL_NewTimer; 347 | begin 348 | NewTimer(TEventTimer(Timer), Tics); 349 | end; 350 | 351 | function CL_TimerExpired; 352 | begin 353 | CL_TimerExpired := TimerExpired(TEventTimer(Timer)); 354 | end; 355 | 356 | procedure CL_ClearTimer; 357 | begin 358 | FillChar(Timer, TCL_TimerSz, 0); 359 | end; 360 | 361 | function CL_TimerInstalled; 362 | var 363 | ET : TEventTimer absolute Timer; 364 | begin 365 | CL_TimerInstalled := (ET.StartTics<>0) or (ET.ExpireTics<>0); 366 | end; 367 | 368 | 369 | end. 370 | 371 | aptimer 372 | dosprocs 373 | dostypess -------------------------------------------------------------------------------- /COMMANDS.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/COMMANDS.PAS -------------------------------------------------------------------------------- /CPUTYPE.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; Function: determines CPU & NDP type. 3 | ; 4 | ; Caller: Turbo C: 5 | ; int processors(void); 6 | ; 7 | ; Returns: AL = central processor type (see below) and 8 | ; AL bit 7 set if protected mode (AL & 80h != 0) 9 | ; AH = coprocessor type (if any - see below) 10 | ; 11 | ; References: 12 | ; 1) Source algorithm by Bob Felts, PC Tech Journal, November 1987 13 | ; Printed: "Dr.Dobb's Tollbook of 80286/80386 programming, 14 | ; M&T publishing, Inc. Redwood City, California 15 | ; 2) SI-System Information, Advanced Edition 4.50, (C) 1987-88, Peter Norton 16 | ; 3) PC Tools Deluxe R4.21 17 | ; (C)Copyright 1985,1986,1987,1988 Central Point Software, Inc. 18 | ; 4) CHKCOP, Intel's Math CoProcessor Test Program ver 2.10 19 | ; Copyright(c) Intel Corp. 1987-1990. 20 | ; 5) HelpPC 2.10 Quick Reference Utility Copyright (c) 1991, David Jurgens 21 | ; 22 | ; Adapted & enhanced R.I.Akhmarov & T.V.Shaporev 23 | ; Computer Center MTO MFTI 24 | ; 25 | ; Added CPUID detectiion 26 | ; Pentium and higher detection by Slava Filimonov 27 | ; 28 | 29 | CPU8086 EQU 0 30 | CPU8088 EQU 1 31 | CPUNEC20 EQU 2 32 | CPUNEC30 EQU 3 33 | CPU186 EQU 4 34 | CPU188 EQU 5 35 | CPU286 EQU 6 36 | CPU386 EQU 7 37 | CPU386SX EQU 8 38 | CPU386DX EQU 9 39 | CPU486 EQU 10 40 | CPU486SX EQU 11 41 | CPU586 EQU 12 42 | 43 | 44 | NDPNONE EQU 0 45 | NDP8087 EQU 1 46 | NDP287 EQU 2 47 | NDP287XL EQU 3 48 | NDP387 EQU 4 49 | NDP387SX EQU 5 50 | NDP387DX EQU 6 51 | 52 | OPND32 MACRO op_code, op_erand 53 | db 66h ; Force 32-bit operand size 54 | IFNB 55 | db op_code 56 | IFNB 57 | dd op_erand; 32-bit immediate value 58 | ENDIF 59 | ENDIF 60 | ENDM 61 | 62 | CPUID MACRO 63 | db 0fh ; Hardcoded opcode for CPUID instruction 64 | db 0a2h 65 | ENDM 66 | 67 | 68 | .486p 69 | 70 | _TEXT SEGMENT byte use16 public 'CODE' 71 | ASSUME cs:_TEXT 72 | 73 | PUBLIC _processors 74 | _processors PROC far 75 | 76 | push bp 77 | mov bp,sp 78 | 79 | ; At first determine central processor type 80 | mov ax,sp ; 86/186 or 286/386 81 | push sp ; 86/186 will push sp-2 82 | pop cx ; others will push sp 83 | cmp ax,cx 84 | je short cpu_2386 ; if 80286/80386 85 | 86 | ; Place 'inc ax' command to make the code re-enterable 87 | mov byte ptr cs:critical,40h 88 | 89 | mov dl,CPU186 ; Prepare to 8018x 90 | mov ax,0FFFFh ; distinguish between 86 and 186 91 | mov cl,33 ; 8086 will shift 32 bits 92 | shl ax,cl ; 80186 will shift 0 bits 93 | jnz short cpu_x808x ; NZ implies 186 94 | ; Now distinguish Intel from NEC. 95 | mov dl,CPUNEC20 96 | mov cx,0FFFFh 97 | push si 98 | xor si,si 99 | mov es,si ; for the God's sake 100 | sti 101 | db 0F3h,026h,0ACh ; LODSB REP ES: 102 | pop si 103 | jcxz short cpu_x808x 104 | mov dl,CPU8086 105 | 106 | cpu_x808x: push di 107 | push es 108 | push cs 109 | pop es 110 | lea di,lenconv 111 | mov ax,90h ; nop code 112 | mov cx,4 113 | std 114 | cli 115 | rep stosb 116 | cld 117 | nop 118 | nop 119 | nop 120 | critical: inc ax 121 | nop 122 | nop 123 | lenconv: nop 124 | sti 125 | pop es 126 | pop di 127 | cmp al,90h 128 | jne short jump_cpu_ok 129 | add dl,CPU8088-CPU8086 130 | jump_cpu_ok: jmp cpu_ok 131 | 132 | cpu_2386: mov dl,CPU286 133 | pushf ; 286/386 - 32 or 16 bit operand? 134 | mov cx,sp ; if pushf pushed 2 bytes 135 | mov sp,bp ; then 16 bit operand size 136 | inc cx ; assume 2 bytes 137 | inc cx 138 | sub cx,ax 139 | jnz short generic_386 140 | ; Either 286 or 386 with 16 bit oper 141 | db 83h,0C4h,0FAh ; add sp,-6 = allocate room for SGDT 142 | sgdt [bp-6] 143 | inc byte ptr [bp-1] ; 286 stores -1, 144 | mov sp,bp ; 386 stores 0 or 1 145 | jz short cpu_ok ; go check for protected mode 146 | generic_386: ; 386 in 16 or 32 bit code segment 147 | mov dl,CPU386 148 | smsw ax ; check for protected mode 149 | test al,1 ; if protection enable, 150 | ; jnz short cpu_ok ; the following is impossible 151 | mov dl,CPU486 ; now check for i486 152 | db 83h,0E4h,0FCh ; and sp,-4 = align to 4-byte boundary 153 | jcxz cpu_16_bit 154 | ; 386 in 32 bit code segment 155 | pushf ; 32-bit flags 156 | pop ax ; pop eax 157 | mov cx,ax ; mov ecx,eax = save original flags 158 | btc ax,18 ; btc eax,18 = toggle bit 18 159 | push ax ; push eax 160 | popf ; 32-bit flags 161 | pushf ; 32-bit flags 162 | pop ax ; pop eax 163 | push cx ; push ecx 164 | popf ; restore original eflags 165 | mov sp,bp ; restore stack pointer 166 | cmp ax,cx ; can 18th bit be changed? 167 | jne short cpu_ok ; yes, it's i486 168 | jmp short test_SX_cpu 169 | cpu_16_bit: ; 386 in 16 bit code segment 170 | pushfd 171 | pop eax 172 | mov ecx,eax ; save original flags 173 | btc eax,18 ; toggle bit 18 174 | push eax 175 | popfd 176 | pushfd 177 | pop eax 178 | push ecx 179 | popfd ; restore original flags 180 | mov sp,bp ; restore stack pointer 181 | cmp eax,ecx ; can 18th bit be changed? 182 | jne short cpu_ok ; yes, it's i486 183 | test_SX_cpu: ; let's distinguish SX and DX 184 | mov dl,CPU386SX 185 | mov eax,cr0 186 | test al,10h ; coprocessor type flag 187 | jz short cpu_is_DX 188 | xor al,10h ; clear flag 189 | mov cr0,eax 190 | mov eax,cr0 191 | test al,10h ; if the flag can be cleared, it is DX 192 | jnz short cpu_ok 193 | re_cop_flag: xor al,10h 194 | mov cr0,eax ; restore the flag 195 | cpu_is_DX: mov dl,CPU386DX 196 | jmp short cpu_ok 197 | cpu_ok: cmp dl,CPU486 198 | jb test_fpu 199 | 200 | check_80486: 201 | 202 | db 83h,0E4h,0FCh ; and sp,-4 = align to 4-byte boundary 203 | push ecx 204 | popfd 205 | mov eax,ecx 206 | xor eax,00200000h 207 | push eax 208 | popfd 209 | pushfd 210 | pop eax 211 | mov sp,bp 212 | cmp eax,ecx 213 | jz test_fpu 214 | 215 | push dx 216 | xor eax, eax ; otherwise, use as input to CPUID 217 | CPUID 218 | nop 219 | nop 220 | cmp al,1 221 | jne go_tfpu 222 | CPUID 223 | nop 224 | nop 225 | ;jc go_tfpu 226 | and ah,0fh ; cpu family 227 | cmp ah,5 228 | jb go_tfpu 229 | pop cx 230 | mov dl,ah ; set cpu_type with family 231 | add dl,CPU586 - 5 232 | jmp test_fpu 233 | go_tfpu: pop dx 234 | test_fpu: 235 | ; At second determine numeric coprocessor generic type 236 | push cx ; reserve stack 237 | mov dh,NDPNONE 238 | db 0DBh,0E3h ; fninit; Initialize math uP 239 | mov byte ptr [bp-1],0 240 | db 0D9h,07Eh,0FEh ; fnstcw word ptr [bp-2] 241 | cmp byte ptr [bp-1],3 242 | jne short ndp_done 243 | mov dh,NDP8087 244 | and byte ptr [bp-2],7Fh 245 | db 09Bh,0D9h,06Eh,0FEh ; fldcw word ptr [bp-2] 246 | db 09Bh,0DBh,0E1h ; fdisi ; Disable Interrupts 247 | db 09Bh,0D9h,07Eh,0FEh ; fstcw word ptr [bp-2] 248 | test byte ptr [bp-2],80h 249 | jnz short ndp_done 250 | mov dh,NDP287 251 | db 09Bh,0DBh,0E3h ; finit ; Initialize math uP 252 | db 09Bh,0D9h,0E8h ; fld1 ; Push +1.0 to stack 253 | db 09Bh,0D9h,0EEh ; fldz ; Push +0.0 to stack 254 | db 09Bh,0DEh,0F9h ; fdivp st(1),st; st(#)=st(#)/st, pop 255 | db 09Bh,0D9h,0C0h ; fld st ; Push onto stack 256 | db 09Bh,0D9h,0E0h ; fchs ; Change sign in st 257 | db 09Bh,0DEh,0D9h ; fcompp ; Compare st & pop 2 258 | db 09Bh,0DDh,07Eh,0FEh ; fstsw word ptr [bp-2] 259 | wait 260 | mov ah,[bp-1] 261 | sahf 262 | jz short ndp_done 263 | mov dh,NDP387 264 | ndp_done: 265 | pop cx ; restore stack 266 | 267 | ; At last analyse main and co-processor combination 268 | cmp dh,NDP387 269 | jnb short analyse_hi 270 | cmp dl,CPU486 271 | jb short cpu_prot 272 | mov dl,CPU486SX 273 | jmp short cpu_prot 274 | analyse_hi: ; i387 detected 275 | cmp dl,CPUNEC30 276 | jnz No_V30 277 | pop bp 278 | jmp CPU_2386 279 | No_V30: 280 | cmp dl,CPU286 281 | ja short analyse_386 282 | je short set_287XL 283 | jmp short cpu_prot ; 387 at 8088? Wonderful! 284 | analyse_386: 285 | smsw ax 286 | test al,10h ; coprocessor type flag 287 | jnz short test_SX_DX 288 | set_287XL: mov dh,NDP287XL 289 | jmp short cpu_prot 290 | test_SX_DX: cmp dl,CPU386SX 291 | jne short no_SX 292 | mov dh,NDP387SX 293 | jmp short cpu_prot 294 | no_SX: cmp dl,CPU386DX 295 | jne short cpu_prot 296 | mov dh,NDP387DX 297 | cpu_prot: cmp dl,CPU286 298 | jb short return 299 | smsw ax ; check for protected mode 300 | shl al,7 ; if PE = 0 then real mode 301 | or dl,al ; else indicate protected mode 302 | return: mov ax,dx 303 | pop bp 304 | retf 305 | _processors ENDP 306 | 307 | _TEXT ENDS 308 | 309 | END 310 | -------------------------------------------------------------------------------- /DBLWND.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/DBLWND.PAS -------------------------------------------------------------------------------- /DBWATCH.PAS: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on Dos Navigator by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | unit DBWatch; 48 | 49 | interface 50 | 51 | uses Objects,Dos,Advance; 52 | 53 | type 54 | PFieldRec = ^Fieldrec; 55 | FieldRec = record 56 | Name: String[10]; 57 | Who: Char; 58 | Ln: Word; 59 | Len, Dec: Word; 60 | Pos: Word; 61 | end; 62 | 63 | PFieldCollection = ^TFieldCollection; 64 | TFieldCollection = object(TCollection) 65 | procedure FreeItem( P : Pointer); virtual; 66 | end; 67 | 68 | PDBFile = ^TDBFile; 69 | TDBFile = object(TObject) 70 | WriteMode: Byte; 71 | BaseName: PathStr; 72 | BaseFile: TBufStream; 73 | Date, NumRec: LongInt; 74 | HeaderLen, RecLen: Word; 75 | Unused: Array [0..31] of Byte; 76 | NumFields: Integer; 77 | Loc: LongInt; 78 | Fields: PCollection; 79 | constructor Init(FileName : PathStr); 80 | destructor Done; virtual; 81 | procedure Read(var Buf; Num: Word); 82 | procedure Seek(NewLoc: LongInt); 83 | function GetField(Name: String;var Buf) : String; 84 | function GetNField(N: Word;var Buf) : String; 85 | function GetFieldRec(N : Integer) : PFieldRec; 86 | procedure OpenMode(Mode: Word); 87 | end; 88 | 89 | implementation 90 | 91 | procedure TFieldCollection.FreeItem; 92 | begin 93 | Dispose(PFieldRec(P)); 94 | end; 95 | 96 | function NewField(Name: String; Who: Char; Len, Dec: Byte;Pos: Word) : PFieldRec; 97 | var P: PFieldRec; 98 | begin 99 | New(P); 100 | P^.Name := Name; 101 | while Name[Length(Name)] = ' ' do System.Dec(Name[0]); 102 | if Length(Name) > Len then P^.Ln := Length(Name) else P^.Ln := Len; 103 | P^.Who := Who; 104 | P^.Len := Len; 105 | P^.Dec := Dec; 106 | P^.Pos := Pos; 107 | NewField := P; 108 | end; 109 | 110 | procedure TDBFile.OpenMode(Mode: Word); 111 | begin 112 | BaseFile.Init(BaseName, Mode, 16384); 113 | end; 114 | 115 | constructor TDBFile.Init; 116 | 117 | type 118 | frec = record 119 | Name: Array [0..10] of Char; 120 | Who: Char; 121 | Info1: Array [0..3] of Char; 122 | Len,Dec: Byte; 123 | Info2: Array [0..13] of Char; 124 | end; 125 | 126 | var FBuf: FRec; 127 | I, J, RL: Integer; 128 | S: String; 129 | 130 | begin 131 | inherited Init; 132 | BaseName := DelSpaces(FExpand(FileName)); 133 | OpenMode(stOpenRead); 134 | if BaseFile.Status <> stOk then begin BaseFile.Done;Fail;end; 135 | BaseFile.Read(Date, 32); 136 | if BaseFile.Status <> stOk then begin BaseFile.Done;Fail;end; 137 | NumFields := (HeaderLen div 32) - 1; 138 | if NumFields = 0 then begin BaseFile.Done;Fail;end; 139 | Fields := New(PFieldCollection, Init(NumFields, NumFields)); 140 | RL := 1; 141 | for I := 1 to NumFields do 142 | begin 143 | BaseFile.Read(FBuf, 32); 144 | Inc(RL, FBuf.Len); 145 | S := ''; J := 0; 146 | While FBuf.Name[J] >= #32 do 147 | begin 148 | S := S + FBuf.Name[J]; 149 | Inc(J); 150 | end; 151 | S[0] := Char(J); 152 | if (J = 0) or (BaseFile.Status <> stOk) then 153 | begin Dispose(Fields, Done);BaseFile.Done;Fail;end; 154 | with FBuf do Fields^.Insert(NewField(S, Who, Len, Dec, RL - Len)); 155 | end; 156 | if RL <> RecLen then 157 | begin Dispose(Fields, Done);BaseFile.Done;Fail;end; 158 | Loc := 0; 159 | BaseFile.Seek(HeaderLen); 160 | end; 161 | 162 | procedure TDBFile.Read; 163 | var I: LongInt; 164 | begin 165 | if Loc + Num >= NumRec then Num := NumRec - Loc; 166 | I := LongInt(RecLen)*LongInt(Num); 167 | if I > 65520 then I := 65520; 168 | BaseFile.Read(Buf, I); 169 | Inc(Loc, Num); 170 | end; 171 | 172 | procedure TDBFile.Seek; 173 | begin 174 | BaseFile.Seek(NewLoc * RecLen + HeaderLen); 175 | Loc := NewLoc; 176 | end; 177 | 178 | function TDBFile.GetFieldRec; 179 | begin 180 | GetFieldRec := Fields^.At(N); 181 | end; 182 | 183 | function TDBFile.GetField; 184 | var I, K, N: Integer; 185 | B: Array [0..65000] of Char Absolute Buf; 186 | S: String; 187 | L: Word; 188 | begin 189 | I := 0; K := 1; 190 | While (I < NumFields) and (GetFieldRec(I)^.Name <> Name) do Inc(I); 191 | K := GetFieldRec(I)^.Pos; 192 | S := ''; N := I; 193 | for I := K to K + GetFieldRec(N)^.Len - 1 do S[I - K] := B[I]; 194 | S[0] := Char(GetFieldRec(N)^.Len); 195 | GetField := S; 196 | end; 197 | 198 | function TDBFile.GetNField; 199 | var I, K, J: Integer; 200 | B: Array [0..65000] of Char Absolute Buf; 201 | S: String; 202 | L: Word; 203 | begin 204 | K := GetFieldRec(N)^.Pos; 205 | S := ''; 206 | for I := K to K + GetFieldRec(N)^.Len - 1 do S[I - K + 1] := B[I]; 207 | S[0] := Char(GetFieldRec(N)^.Len); 208 | GetNField := S; 209 | end; 210 | 211 | destructor TDBFile.Done; 212 | begin 213 | Dispose(Fields, Done); 214 | BaseFile.Done; 215 | end; 216 | 217 | {begin 218 | New(P, Open('marrec.dbf')); 219 | if P = Nil then 220 | begin 221 | Write('Cann''t open file'); 222 | Halt; 223 | end; 224 | WriteLn('File : ', P^.BaseName); 225 | WriteLn('Field :'); 226 | for I := 1 to P^.NumFields do 227 | begin 228 | F := P^.Fields^.At(I - 1); 229 | WriteLn(F^.Name : 11, F^.Who : 2, F^.Len : 4, F^.Dec : 4); 230 | end; 231 | Assign(t,'output'); 232 | Rewrite(t); 233 | for I := 1 to P^.NumRec do 234 | begin 235 | P^.Read(B); 236 | for j:=0 to P^.NumFields - 1 do 237 | Write(P^.GetNField(j, B),' '); 238 | WriteLn; 239 | end; 240 | close(t);} 241 | end. -------------------------------------------------------------------------------- /DIALOGS.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/DIALOGS.PAS -------------------------------------------------------------------------------- /DISKIMG.PAS: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on Dos Navigator by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | unit DiskImg; 48 | 49 | interface uses FilesCol; 50 | 51 | procedure UnpackDiskImages(AOwner: Pointer; Files: PFilesCollection); 52 | 53 | implementation 54 | 55 | uses Dos, Messages, Views, Commands, Objects, DnApp, Drivers, 56 | Advance, FileCopy, DiskTool, Gauge, xTime; 57 | 58 | 59 | function UnpackImage(const FName, DestDir: PathStr; PInfo: PWhileView): Boolean; 60 | var 61 | F: PBufStream; 62 | Error, Cancel : Boolean; 63 | Tmr: TEventTimer; 64 | 65 | procedure CheckCancel; 66 | begin 67 | if Cancel then Exit; 68 | if TimerExpired(Tmr) then 69 | begin 70 | DispatchEvents(PInfo, Cancel); 71 | Cancel := (Cancel or CtrlBreakHit) and (MessageBox(GetString(dlQueryAbort), nil, mfYesNoConfirm) = cmYes); 72 | CtrlBreakHit := Off; 73 | NewTimer(Tmr, 1); 74 | end; 75 | end; 76 | 77 | 78 | procedure DoIt; 79 | var 80 | BRec: PBootRec; 81 | FAT: PByteArray absolute BRec; 82 | 83 | Reserved : Word; 84 | FatCopies : Byte; 85 | SectPerClust: Byte; 86 | BytesPerClu : Word; 87 | SectPerFAT : Word; 88 | SectLen : Word; 89 | FirstClust : Word; 90 | RootEntries : Word; 91 | TotalClu : Word; 92 | FATSize : LongInt; 93 | NumSectors : Longint; 94 | 95 | VolumeLabel : string[13]; 96 | fPos : LongInt; 97 | 98 | procedure fSeek(Pos: LongInt); 99 | begin 100 | if fPos = Pos then Exit; 101 | fPos := Pos; 102 | F^.Seek(Pos); 103 | end; 104 | 105 | procedure fRead(var Buf; Count: word); 106 | begin 107 | F^.Read(Buf, Count); Inc(fPos, Count); 108 | end; 109 | 110 | function NextFAT(N: Word): Word; 111 | var 112 | D: Word; 113 | begin 114 | if Error or (N<2) or (n>TotalClu+2) then begin Error := True; Exit end; 115 | d:=(n*3) shr 1; 116 | d:=FAT^[d]+FAT^[d+1] shl 8; 117 | if N and 1=0 then d:=d and $FFF 118 | else d:=d shr 4; 119 | NextFAT := D; 120 | end; 121 | 122 | function Fat2Sec(W: Word): LongInt; 123 | begin 124 | Fat2Sec := LongInt(FirstClust+(W-2)*SectPerClust); 125 | end; 126 | 127 | procedure WriteFile(const ADir: PathStr; const ANm: Str12; Clus: Word; 128 | Len, Date: LongInt; Attr: Byte); 129 | var 130 | B: PBufStream; 131 | Dir, FName: string; 132 | 133 | procedure Try; 134 | begin 135 | B := New(PBufStream, Init(FName, stCreate, $8000)); 136 | if B^.Status <> stOK then FreeObject(B); 137 | end; 138 | 139 | var 140 | CpyBuf: PByteArray; 141 | 142 | procedure Cpy; 143 | var 144 | A: Word; 145 | LocErr: Boolean; 146 | begin 147 | if Error or Cancel then Exit; 148 | LocErr := True; 149 | repeat 150 | CheckCancel; 151 | if Cancel then Break; 152 | if F^.Status <> stOK then Exit; 153 | fSeek(Fat2Sec(Clus)*SectLen); 154 | if F^.Status <> stOK then Exit; 155 | A := Min(Len, BytesPerClu); Dec(Len, A); 156 | fRead(CpyBuf^, A); if F^.Status <> stOK then Exit; 157 | B^.Write(CpyBuf^, A); if B^.Status <> stOK then Exit; 158 | if Len = 0 then 159 | begin 160 | LocErr := False; 161 | Break; 162 | end; 163 | Clus := NextFAT(Clus); 164 | until Error; 165 | Error := Error or LocErr; 166 | end; 167 | 168 | procedure SetFData; 169 | var 170 | F: file; 171 | begin 172 | Assign(F, FName); FileMode := $40; Reset(F, 1); 173 | SetFTime(F, Date); 174 | Close(F); 175 | if Attr <> Archive then SetFAttr(F, Attr); 176 | end; 177 | 178 | begin 179 | if Error then Exit; 180 | Dir := FmtStr(ADir, VolumeLabel); 181 | FName := MakeNormName(Dir, ANm); 182 | PInfo^.Write(3, LowStrg(GetName(FName))); 183 | Try; 184 | if B = nil then 185 | begin 186 | CreateDirInheritance(Dir, Off); 187 | Try; 188 | if B = nil then Exit; 189 | end; 190 | GetMem(CpyBuf, BytesPerClu); 191 | Cpy; 192 | FreeMem(CpyBuf, BytesPerClu); 193 | FreeObject(B); 194 | if Error then EraseFile(FName) else SetFData; 195 | end; 196 | 197 | 198 | procedure ProcessDir(const Dir: PathStr; Ofst: Word); 199 | var 200 | _Dir : PByteArray; 201 | DR : DirRec; 202 | I : Integer; 203 | Nm : Str12; 204 | 205 | 206 | begin 207 | fSeek(LongInt(Ofst)*SectLen); 208 | if (F^.Status <> stOK) then Exit; 209 | GetMem(_Dir,RootEntries*32); 210 | fRead(_Dir^,RootEntries*32); 211 | for I := 0 to RootEntries-1 do 212 | begin 213 | CheckCancel; 214 | if Error or Cancel then Break; 215 | Move(_Dir^[I*SizeOf(DR)], DR, SizeOf(DR)); 216 | case DR.Name[0] of 217 | #$E5 : Continue; 218 | #0..' ' : Break; 219 | end; 220 | Nm[0] := #12; 221 | Nm[9] := '.'; 222 | Move(DR.Name[0], Nm[1], 8); 223 | Move(DR.Name[8], Nm[10], 3); 224 | Nm := MakeFileName(Nm); 225 | if DR.Attr and VolumeID <> 0 then 226 | begin 227 | Replace(' ','_',Nm); 228 | VolumeLabel := Nm+'\'; 229 | Continue; 230 | end; 231 | if DR.Attr and Directory <> 0 then 232 | begin 233 | if Nm[1]<>'.' then ProcessDir(Dir+Nm+'\', Fat2Sec(DR.Clus)); 234 | Continue; 235 | end; 236 | WriteFile(Dir, Nm, DR.Clus, DR.Len, DR.Date, DR.Attr); 237 | end; 238 | FreeMem(_Dir,RootEntries*32); 239 | end; 240 | 241 | procedure ChkValid; 242 | begin 243 | if Error then Exit; 244 | Error := True; 245 | case SectLen of 128, 256, 512, 1024, 2048, 4096:; else Exit end; 246 | case FatCopies of 1, 2:; else Exit end; 247 | Error := False; 248 | end; 249 | 250 | 251 | begin 252 | VolumeLabel := ''; fPos := 0; 253 | if F^.Status <> stOK then Exit; 254 | GetMem(BRec, 4096); 255 | fRead(BRec^, 4096); 256 | SectPerFAT := BRec^.SecFAT; 257 | SectLen := BRec^.ByteSec; 258 | FatCopies := BRec^.FATCps; 259 | Reserved := BRec^.ResSect; 260 | RootEntries := BRec^.RootEnt; 261 | SectPerClust:= BRec^.SecClu; 262 | if BRec^.TotalSc = 0 then NumSectors := BRec^.NumSec 263 | else NumSectors := BRec^.TotalSc; 264 | FreeMem(BRec, 4096); BRec := nil; 265 | if F^.Status <> stOK then Exit; 266 | 267 | ChkValid; if Error then Exit; 268 | 269 | FATSize := LongInt(SectPerFAT) * SectLen; 270 | 271 | FirstClust := (SectPerFAT * FatCopies) + Reserved 272 | + ((LongInt(ROOTentries) * 32) div SectLen); 273 | 274 | BytesPerClu := SectPerClust * SectLen; 275 | TotalClu := LongInt(NumSectors - FirstClust + 1) div SectPerClust; 276 | if FATSize > $8000 then Exit; 277 | 278 | fSeek(Reserved*SectLen); 279 | if F^.Status <> stOK then Exit; 280 | 281 | GetMem(FAT, FatSize); 282 | fRead(FAT^, FatSize); 283 | if F^.Status = stOK then ProcessDir(DestDir+'%s',SectPerFAT * FatCopies + Reserved); 284 | FreeMem(FAT, FatSize); 285 | 286 | end; 287 | 288 | 289 | begin 290 | PInfo^.Write(1, GetName(FName)); 291 | Error := False; Cancel := False; 292 | NewTimer(Tmr, 0); 293 | F := New(PBufStream, Init(FName, stOpenRead, $8000)); 294 | DoIt; 295 | Error := Error or (F^.Status <> stOK); 296 | FreeObject(F); 297 | if Error then MessageBox('Error in image file '+Cut(FName,40), nil, mfError+mfOkButton); 298 | UnpackImage := not (Error or Cancel); 299 | end; 300 | 301 | procedure RereadGlobal(const OutputDir:PathStr); 302 | begin 303 | GlobalMessage(evCommand, cmPanelReread, @OutputDir); 304 | GlobalMessage(evCommand, cmRereadTree, @OutputDir); 305 | end; 306 | 307 | 308 | procedure DoIt(AOwner: Pointer; AFiles: PFilesCollection; var ADestPath: string); 309 | var 310 | I: Integer; 311 | PF: PFileRec; 312 | PInfo: PWhileView; 313 | R: TRect; 314 | begin 315 | if ADestPath = '' then GetDir(0, ADestPath); 316 | ADestPath := MakeNormName(ADestPath, ''); 317 | 318 | R.Assign(1,1,26,10); 319 | New(PInfo, Init(R)); 320 | PInfo^.Top := 'Image'; 321 | Desktop^.Insert(PInfo); 322 | 323 | CreateDirInheritance(ADestPath, False); 324 | for I := 0 to AFiles^.Count-1 do 325 | begin 326 | PF := AFiles^.At(I); 327 | if not UnpackImage(MakeNormName(CnvString(PF^.Owner), MakeFileName(PF^.Name)), ADestPath, PInfo) then Break; 328 | if AOwner <> nil then Message(AOwner, evCommand, cmCopyUnselect, PF); 329 | end; 330 | 331 | FreeObject(PInfo); 332 | RereadGlobal(ADestPath); 333 | end; 334 | 335 | 336 | procedure UnpackDiskImages; 337 | var 338 | DestPath: string; 339 | begin 340 | if (Files = nil) or (Files^.Count = 0) then Exit; 341 | DestPath := ''; 342 | Message(Application, evCommand, cmPushFullName, @DestPath); 343 | if InputBox('Unpack Diskette Images', '~T~arget directory',DestPath, 78, 0) 344 | = cmOK then DoIt(AOwner, Files, DestPath); 345 | Files^.DeleteAll; FreeObject(Files); 346 | end; 347 | 348 | end. -------------------------------------------------------------------------------- /DISKINFO.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/DISKINFO.PAS -------------------------------------------------------------------------------- /DN.ASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/DN.ASM -------------------------------------------------------------------------------- /DN.DEF: -------------------------------------------------------------------------------- 1 | {$DEFINE DN} 2 | 3 | -------------------------------------------------------------------------------- /DNHELP.PAS: -------------------------------------------------------------------------------- 1 | unit DNHELP; 2 | 3 | interface 4 | 5 | const 6 | 7 | hcAboutDialog = 16553; 8 | hcAdvancedFilter = 48029; 9 | hcAdvancedFloppyFormat = 48042; 10 | hcAdvanceSearch = 21002; 11 | hcAdvPortSetup = 11013; 12 | hcAllContainingDialog = 48000; 13 | hcAppendFiles = 31; 14 | hcAppendPhoneDirectory = 16570; 15 | hcAppendPhoneNumber = 16568; 16 | hcArchiveFiles = 48031; 17 | hcArchives = 11014; 18 | hcArcSetup = 11019; 19 | hcArvidFindResults = 48076; 20 | hcAsciiChart = 16593; 21 | hcBlockCommands = 10002; 22 | hcCalculator = 11016; 23 | hcCDplayer = 16554; 24 | hcCDplayerOptions = 16555; 25 | hcCDplayerTitle = 16556; 26 | hcClipboard = 11023; 27 | hcCmdHistory = 16584; 28 | hcColorDialog = 48045; 29 | hcColumnsDefaults = 16564; 30 | hcColumnsSetup = 48034; 31 | hcCombineDialog = 27; 32 | hcCommonInfo = 4; 33 | hcCommunication = 11012; 34 | hcCompareDirs = 48027; 35 | hcConfiguration = 48009; 36 | hcConfirmationDialog = 48006; 37 | hcConfirmations = 16561; 38 | hcCopyDialog = 30; 39 | hcCopyFiles = 29; 40 | hcCountrySetup = 16562; 41 | hcCustomVideo = 48059; 42 | hcDBSearch = 16574; 43 | hcDBView = 48048; 44 | hcDeleteFiles = 25; 45 | hcDesktop = 48050; 46 | hcDialogButton = 48054; 47 | hcDialogCase = 48055; 48 | hcDialogHistory = 48053; 49 | hcDialogInput = 48052; 50 | hcDialogMessage = 48056; 51 | hcDialogWindow = 48051; 52 | hcDirectAccessDenied = 16592; 53 | hcDirectDiskAccess = 16591; 54 | hcDirHistory = 48073; 55 | hcDirTree = 11007; 56 | hcDiskEditor = 11011; 57 | hcDiskError = 16577; 58 | hcDiskInfo = 16559; 59 | hcDiskMenu = 14; 60 | hcDiskOperations = 10006; 61 | hcDriveInfoSetup = 11004; 62 | hcDrivesSetup = 48035; 63 | hcedEdit = 48021; 64 | hcedFile = 48020; 65 | hcEditHistory = 48074; 66 | hcEditor = 1102; 67 | hcEditorCommands = 10001; 68 | hcEditorDefaults = 48040; 69 | hcEditorFeature = 8; 70 | hcEditorFind = 48071; 71 | hcEditorHilite = 48044; 72 | hcEditorReplace = 48072; 73 | hcEditorWindow = 10000; 74 | hcEditPhoneDirectory = 16571; 75 | hcEditPhoneNumber = 16569; 76 | hcedOptions = 48024; 77 | hcedParagraph = 48023; 78 | hcedSearch = 48022; 79 | hcEnvEditor = 16558; 80 | hcErrorDialog = 48004; 81 | hcExtEditors = 48033; 82 | hcExtendedFileMask = 16586; 83 | hcExtendedVideo = 11; 84 | hcExtFile = 11005; 85 | hcExtMacros = 16552; 86 | hcExtract = 48030; 87 | hcExtViewers = 48032; 88 | hcFeaturesOverview = 5; 89 | hcFileAttr = 16581; 90 | hcFileFind = 21003; 91 | hcFileManager = 20; 92 | hcFileMask = 16585; 93 | hcFileMenu = 12; 94 | hcFileMgrSetup = 48036; 95 | hcFilePanel = 1100; 96 | hcFiles = 24; 97 | hcFilesAttr = 16582; 98 | hcFilesBBS = 48061; 99 | hcFindCell = 48067; 100 | hcFloppyFormat = 48041; 101 | hcFormat = 11009; 102 | hcFormatMargins = 48070; 103 | hcGame = 21005; 104 | hcGameSetup = 16573; 105 | hcGotoAddress = 16576; 106 | hcGotoCellNumber = 48068; 107 | hcGotoLine = 16575; 108 | hcGUserMenu = 16547; 109 | hcHelp = 48049; 110 | hcHelpOnHelp = 3; 111 | hcHighlight = 11022; 112 | hcHotOverview = 7; 113 | hcIndex = 2; 114 | hcInformationDialog = 48005; 115 | hcInputBox = 48008; 116 | hcInsDelCommands = 10004; 117 | hcInterface = 11006; 118 | hcInterfaceSetup = 16566; 119 | hcLinkPanel = 1101; 120 | hcLinkStatusWnd = 48062; 121 | hcLUserMenu = 16546; 122 | hcMainMenu = 9; 123 | hcMakeListFile = 48028; 124 | hcManagerCommands = 21; 125 | hcManualDial = 48014; 126 | hcMemoryInfo = 16589; 127 | hcMenuBox = 10; 128 | hcMenuEdit = 16550; 129 | hcMenuExample = 16549; 130 | hcMenuFormat = 16551; 131 | hcMenuTips = 16548; 132 | hcMiscCommands = 10005; 133 | hcMkDir = 48017; 134 | hcMouseSetup = 16565; 135 | hcMovementCommands = 10003; 136 | hcNavigatorsWindows = 19; 137 | hcNavyLink = 48063; 138 | hcNoContext = 0; 139 | hcOpenFileDialog = 48012; 140 | hcOptionsMenu = 18; 141 | hcOptionsStartup = 48038; 142 | hcOS2Support = 48060; 143 | hcOverwriteQuery = 48046; 144 | hcPanelDefaults = 11002; 145 | hcPanelHotKeys = 11003; 146 | hcPanelMenu = 16; 147 | hcPanelSetup = 11001; 148 | hcPanelWide = 11000; 149 | hcPentix = 16544; 150 | hcPhone = 11020; 151 | hcPrinterSetup = 16572; 152 | hcPrintManager = 16560; 153 | hcQueryDialog = 48007; 154 | hcQuickDirs = 48019; 155 | hcQuickRun = 17; 156 | hcReanimator = 11008; 157 | hcReenterPassword = 16563; 158 | hcRenameMove = 13; 159 | hcReplaceCell = 48066; 160 | hcSavers = 48039; 161 | hcScreenGrabber = 11024; 162 | hcScrollBack = 48043; 163 | hcSelect = 16587; 164 | hcSelectDrive = 21000; 165 | hcSelectDriveExtended = 21001; 166 | hcSelectFileDialog = 48013; 167 | hcSerialInterface = 48064; 168 | hcSetCellFormat = 48069; 169 | hcSetPassword = 16583; 170 | hcSetupArcColumns = 16579; 171 | hcSetupDiskColumns = 16578; 172 | hcSetupFindColumns = 16580; 173 | hcSetupTerminal = 16567; 174 | hcSortBy = 48018; 175 | hcSplitDialog = 28; 176 | hcSplitFiles = 26; 177 | hcSpreadSheet = 11015; 178 | hcSubMenuConfig = 48010; 179 | hcSubMenuFileMgr = 48011; 180 | hcSystemInfo = 16590; 181 | hcSystemSetup = 48037; 182 | hcTempList = 11017; 183 | hcTerminal = 11018; 184 | hcTetris = 16543; 185 | hcTetrisScore = 48015; 186 | hcTetrisWinner = 48016; 187 | hcTreeDialog = 16557; 188 | hcUnpackDiskImg = 48065; 189 | hcUnselect = 16588; 190 | hcUserMenu = 16545; 191 | hcUtilMenu = 15; 192 | hcUUDecode = 48026; 193 | hcUUEncode = 48025; 194 | hcView = 11021; 195 | hcViewerFind = 48047; 196 | hcViewFile = 48057; 197 | hcViewHistory = 48075; 198 | hcVolLabel = 11010; 199 | hcWarningDialog = 48003; 200 | hcWildcards = 48058; 201 | hcWindows = 22; 202 | hcWindowsFeature = 6; 203 | hcWindowsType = 23; 204 | hcWinMan = 21004; 205 | hcYesNoCancelDialog = 48002; 206 | hcYesNoDialog = 48001; 207 | hc_ = 65535; 208 | 209 | implementation 210 | 211 | end. 212 | -------------------------------------------------------------------------------- /DNSTDDLG.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/DNSTDDLG.PAS -------------------------------------------------------------------------------- /DRIVERS.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/DRIVERS.PAS -------------------------------------------------------------------------------- /FILEFIND.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/FILEFIND.PAS -------------------------------------------------------------------------------- /FILELIST.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/FILELIST.PAS -------------------------------------------------------------------------------- /FILESCOL.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/FILESCOL.PAS -------------------------------------------------------------------------------- /FLPANEL.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/FLPANEL.PAS -------------------------------------------------------------------------------- /FLTOOLS.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/FLTOOLS.PAS -------------------------------------------------------------------------------- /FORMAT.ASM: -------------------------------------------------------------------------------- 1 | TITLE FORMAT 2 | 3 | LOCALS @@ 4 | 5 | FORMAT_TEXT SEGMENT BYTE PUBLIC 'CODE' 6 | 7 | ASSUME CS:FORMAT_TEXT,DS:NOTHING 8 | 9 | PUBLIC Format_Str 10 | 11 | ; function FormatStr(var Result: String; Format: String; var Params) 12 | 13 | Format_Str: 14 | 15 | Result EQU (DWORD PTR [BP+14]) 16 | Format EQU (DWORD PTR [BP+10]) 17 | Params EQU (DWORD PTR [BP+6]) 18 | ParOfs EQU (WORD PTR [BP-2]) 19 | Buffer EQU (BYTE PTR [BP-14]) 20 | 21 | PUSH BP 22 | MOV BP,SP 23 | PUSH WORD PTR Params 24 | SUB SP,12 25 | PUSH DS 26 | LDS SI,Format 27 | LES DI,Result 28 | INC DI 29 | CLD 30 | LODSB 31 | XOR AH,AH 32 | XCHG AX,CX 33 | @@1: JCXZ @@9 34 | LODSB 35 | DEC CX 36 | CMP AL,'%' 37 | JE @@3 38 | @@2: STOSB 39 | JMP @@1 40 | @@3: JCXZ @@9 41 | LODSB 42 | DEC CX 43 | CMP AL,'%' 44 | JE @@2 45 | MOV BX,' ' 46 | XOR DX,DX 47 | CMP AL,'0' 48 | JNE @@4 49 | MOV BL,AL 50 | @@4: CMP AL,'-' 51 | JNE @@5 52 | INC BH 53 | JCXZ @@9 54 | LODSB 55 | DEC CX 56 | @@5: CMP AL,'0' 57 | JB @@6 58 | CMP AL,'9' 59 | JA @@6 60 | SUB AL,'0' 61 | XCHG AX,DX 62 | MOV AH,10 63 | MUL AH 64 | ADD AL,DL 65 | XCHG AX,DX 66 | JCXZ @@9 67 | LODSB 68 | DEC CX 69 | JMP @@5 70 | @@6: CMP AL,'#' 71 | JNE @@10 72 | SHL DX,1 73 | SHL DX,1 74 | ADD DX,ParOfs 75 | MOV WORD PTR Params,DX 76 | JMP @@1 77 | @@9: XCHG AX,DI 78 | LES DI,Result 79 | SUB AX,DI 80 | DEC AX 81 | STOSB 82 | POP DS 83 | MOV SP,BP 84 | POP BP 85 | RETF 12 86 | @@10: PUSH DS 87 | PUSH SI 88 | PUSH CX 89 | PUSH DX 90 | PUSH BX 91 | CALL Convert 92 | POP BX 93 | POP DX 94 | OR DX,DX 95 | JE @@12 96 | SUB DX,CX 97 | JAE @@12 98 | OR BH,BH 99 | JNE @@11 100 | SUB SI,DX 101 | @@11: ADD CX,DX 102 | XOR DX,DX 103 | @@12: OR BH,BH 104 | JE @@13 105 | REP MOVSB 106 | @@13: XCHG CX,DX 107 | MOV AL,BL 108 | REP STOSB 109 | XCHG CX,DX 110 | REP MOVSB 111 | POP CX 112 | POP SI 113 | POP DS 114 | JMP @@1 115 | 116 | ; Convert next parameter to string 117 | ; In AL = Conversion character 118 | ; Out DS:SI = Pointer to string 119 | ; CX = String length 120 | 121 | Convert: 122 | 123 | XCHG AX,DX 124 | LDS SI,Params 125 | LODSW 126 | XCHG AX,BX 127 | LODSW 128 | XCHG AX,BX 129 | MOV WORD PTR Params,SI 130 | XOR CX,CX 131 | LEA SI,Buffer[12] 132 | PUSH SS 133 | POP DS 134 | AND DL,0DFH 135 | CMP DL,'C' 136 | JE ConvertChar 137 | CMP DL,'S' 138 | JE ConvertStr 139 | CMP DL,'D' 140 | JE ConvertDec 141 | CMP DL,'X' 142 | JE ConvertHex 143 | RET 144 | 145 | ConvertStr: 146 | 147 | MOV DX,AX 148 | OR DX,BX 149 | JE @@1 150 | MOV SI,AX 151 | MOV DS,BX 152 | LODSB 153 | MOV CL,AL 154 | @@1: RET 155 | 156 | ConvertHex: 157 | 158 | MOV CL,16 159 | JMP SHORT ConvertNum 160 | 161 | ConvertDec: 162 | 163 | MOV CL,10 164 | OR BX,BX 165 | JNS ConvertNum 166 | NEG BX 167 | NEG AX 168 | SBB BX,0 169 | CALL ConvertNum 170 | MOV AL,'-' 171 | 172 | ConvertChar: 173 | 174 | INC CX 175 | DEC SI 176 | MOV [SI],AL 177 | RET 178 | 179 | ConvertNum: 180 | 181 | PUSH SI 182 | @@1: XOR DX,DX 183 | XCHG AX,BX 184 | DIV CX 185 | XCHG AX,BX 186 | DIV CX 187 | ADD DL,'0' 188 | CMP DL,'0'+10 189 | JB @@2 190 | ADD DL,'A'-'0'-10 191 | @@2: DEC SI 192 | MOV [SI],DL 193 | MOV DX,AX 194 | OR DX,BX 195 | JNE @@1 196 | POP CX 197 | SUB CX,SI 198 | RET 199 | 200 | FORMAT_TEXT ENDS 201 | 202 | END 203 | -------------------------------------------------------------------------------- /FORMAT.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/FORMAT.PAS -------------------------------------------------------------------------------- /FVIEWER.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/FVIEWER.PAS -------------------------------------------------------------------------------- /GAUGE.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/GAUGE.PAS -------------------------------------------------------------------------------- /GETCONST.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/GETCONST.PAS -------------------------------------------------------------------------------- /GETCPU.ASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/GETCPU.ASM -------------------------------------------------------------------------------- /HIDEVIEW.PAS: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on Dos Navigator by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | unit HideView; 48 | 49 | interface 50 | uses Menus, Objects, Views, Drivers; 51 | 52 | type PHideView = ^THideView; 53 | THideView = object(TView) 54 | OldSizeX: Integer; 55 | procedure HideView; virtual; 56 | procedure ShowView; virtual; 57 | end; 58 | 59 | PStdWindow = ^TStdWindow; 60 | TStdWindow = object(TWindow) 61 | constructor Init(var R: TRect; ATitle: TTitleStr; ANumber: Integer); 62 | procedure HandleEvent(var Event: TEvent); virtual; 63 | procedure ExecWindowMenu; virtual; 64 | function GetWindowMenu(var N, W: Word): PMenu; virtual; 65 | end; 66 | 67 | implementation 68 | uses DNApp, Dialogs, Advance, Commands; 69 | 70 | constructor TStdWindow.Init; 71 | begin 72 | inherited Init(R, ATitle, ANumber); 73 | {Flags := Flags or wfMenu;} 74 | end; 75 | 76 | procedure TStdWindow.HandleEvent; 77 | begin 78 | inherited HandleEvent(Event); 79 | { if (Event.What = evCommand) and (Event.Command = cmWindowMenu) then 80 | begin ExecWindowMenu; ClearEvent(Event) end; 81 | if (Event.What = evKeyDown) and (Event.KeyCode = kbAltSpace) 82 | then begin Message(@Self, evCommand, cmWindowMenu, nil); ClearEvent(Event) end; 83 | } 84 | end; 85 | 86 | function TStdWindow.GetWindowMenu; 87 | begin 88 | GetWindowMenu := NewMenu( 89 | NewItem('~S~ize/move' ,'',kbNoKey,cmResize,hcResize, 90 | NewItem('~Z~oom' ,'',kbNoKey,cmZoom,hcZoom, 91 | NewItem('~N~ext' ,'',kbNoKey,cmNext,hcNext, 92 | NewItem('~P~revious' ,'',kbNoKey,cmPrev,hcPrev, 93 | NewItem('~C~lose' ,'',kbNoKey,cmClose,hcClose, 94 | nil)))))); 95 | N := 5; W := 15; 96 | end; 97 | 98 | procedure TStdWindow.ExecWindowMenu; 99 | var Menu: PMenu; 100 | N, W: Word; 101 | R: TRect; 102 | P: PView; 103 | begin 104 | Menu := GetWindowMenu(N, W); 105 | DeskTop^.GetExtent(R); 106 | R.A := Origin; 107 | if R.A.X < 0 then R.A.X := 0 else if R.A.X + W > R.B.X then R.A.X := R.B.X - W; 108 | if R.A.Y < 0 then R.A.Y := 0 else if R.A.Y + N + 2 > R.B.Y then R.A.Y := R.B.Y - N - 2; 109 | R.B.X := R.A.X + W; R.B.Y := R.A.Y + N + 2; 110 | P := New(PMenuBox, Init(R, Menu, nil)); 111 | N := DeskTop^.ExecView(P); 112 | Dispose(P, Done); 113 | DisposeMenu(Menu); 114 | if N <> cmCancel then Message(@Self, evCommand, N, nil); 115 | end; 116 | 117 | procedure THideView.HideView; 118 | begin 119 | OldSizeX := Size.X; GrowTo(0, Size.Y); 120 | EventMask := 0; 121 | TView.Hide; 122 | end; 123 | 124 | procedure THideView.ShowView; 125 | begin 126 | EventMask := $FFFF; 127 | TView.Show; 128 | end; 129 | 130 | end. 131 | 132 | -------------------------------------------------------------------------------- /HISTLIST.PAS: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on Dos Navigator by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | unit HistList; 48 | 49 | {-----------------------------------------------------} 50 | { This module is based on Turbo Vision HistList Unit } 51 | { Copyright (c) 1990 by Borland International } 52 | {-----------------------------------------------------} 53 | 54 | 55 | {$O+,F+,X+,I-,S-} 56 | 57 | {**************************************************************************** 58 | History buffer structure: 59 | 60 | Byte Byte String Byte Byte String 61 | +-------------------------+-------------------------+--...--+ 62 | | 0 | Id | History string | 0 | Id | History string | | 63 | +-------------------------+-------------------------+--...--+ 64 | 65 | ***************************************************************************} 66 | 67 | interface 68 | 69 | uses Objects; 70 | 71 | const 72 | HistoryBlock: Pointer = nil; 73 | HistorySize: Word = 2048; 74 | HistoryUsed: Word = 0; 75 | MaxHistorySize: Word = 20; 76 | 77 | procedure HistoryAdd(Id: Byte; const Str: String); 78 | function HistoryCount(Id: Byte): Word; 79 | function HistoryStr(Id: Byte; Index: Integer): String; 80 | procedure DeleteHistoryStr(Id: Byte; Index: Integer); 81 | procedure ClearHistory; 82 | 83 | procedure InitHistory; 84 | procedure DoneHistory; 85 | 86 | procedure StoreHistory(var S: TStream); 87 | procedure LoadHistory(var S: TStream); 88 | 89 | var 90 | CurId: Byte; 91 | CurString: PString; 92 | 93 | implementation 94 | uses Memory; 95 | 96 | { Advance CurString to next string with an ID of CurId } 97 | 98 | procedure AdvanceStringPointer; near; assembler; 99 | asm 100 | PUSH DS 101 | MOV CX,HistoryUsed 102 | MOV BL,CurId 103 | LDS SI,CurString 104 | MOV DX,DS 105 | MOV AX,DS 106 | OR AX,SI 107 | JZ @@3 108 | CLD 109 | JMP @@2 110 | @@1: LODSW 111 | CMP AH,BL { BL = CurId } 112 | JE @@3 113 | @@2: LODSB 114 | XOR AH,AH 115 | ADD SI,AX 116 | CMP SI,CX { CX = HistoryUsed } 117 | JB @@1 118 | XOR SI,SI 119 | MOV DX,SI 120 | @@3: POP DS 121 | MOV CurString.Word[0],SI 122 | MOV CurString.Word[2],DX 123 | end; 124 | 125 | { Deletes the current string from the table } 126 | 127 | procedure DeleteString; near; assembler; 128 | asm 129 | PUSH DS 130 | MOV CX,HistoryUsed 131 | CLD 132 | LES DI,CurString 133 | MOV SI,DI 134 | DEC DI 135 | DEC DI 136 | PUSH ES 137 | POP DS 138 | MOV AL,BYTE PTR [SI] 139 | XOR AH,AH 140 | INC AX 141 | ADD SI,AX 142 | SUB CX,SI 143 | REP MOVSB 144 | POP DS 145 | MOV HistoryUsed,DI 146 | end; 147 | 148 | { Insert a string into the table } 149 | 150 | procedure InsertString(Id: Byte; const Str: String); near; assembler; 151 | asm 152 | PUSH DS 153 | STD 154 | 155 | { Position ES:DI to the end the buffer } 156 | { ES:DX to beginning of buffer } 157 | LES DX,HistoryBlock 158 | MOV DI,HistoryUsed 159 | LDS SI,Str 160 | MOV BL,[SI] 161 | INC BL 162 | INC BL 163 | INC BL 164 | XOR BH,BH 165 | POP DS 166 | PUSH DS 167 | @@1: MOV AX,DI 168 | ADD AX,BX 169 | SUB AX,DX { DX = HistoryBlock.Word[0] } 170 | CMP AX,HistorySize 171 | JB @@2 172 | 173 | { Drop the last string off the end of the list } 174 | DEC DI 175 | XOR AL,AL 176 | MOV CX,0FFFFH 177 | REPNE SCASB 178 | INC DI 179 | JMP @@1 180 | 181 | { Move the table down the size of the string } 182 | @@2: MOV SI,DI 183 | ADD DI,BX 184 | MOV HistoryUsed,DI 185 | PUSH ES 186 | POP DS 187 | MOV CX,SI 188 | SUB CX,DX { DX = HistoryBlock.Word[0] } 189 | REP MOVSB 190 | 191 | { Copy the string into the position } 192 | CLD 193 | MOV DI,DX { DX = HistoryBlock.Word[0] } 194 | INC DI 195 | MOV AH,Id 196 | XOR AL,AL 197 | STOSW 198 | LDS SI,Str 199 | LODSB 200 | STOSB 201 | MOV CL,AL 202 | XOR CH,CH 203 | REP MOVSB 204 | 205 | POP DS 206 | end; 207 | 208 | procedure StartId(Id: Byte); near; 209 | begin 210 | CurId := Id; 211 | CurString := HistoryBlock; 212 | end; 213 | 214 | function HistoryCount(Id: Byte): Word; 215 | var 216 | Count: Word; 217 | begin 218 | StartId(Id); 219 | Count := 0; 220 | AdvanceStringPointer; 221 | while CurString <> nil do 222 | begin 223 | Inc(Count); 224 | AdvanceStringPointer; 225 | end; 226 | HistoryCount := Count; 227 | end; 228 | 229 | procedure HistoryAdd(Id: Byte; const Str: String); 230 | var C: Char; 231 | I,J: Integer; 232 | begin 233 | if Str = '' then Exit; 234 | if HistoryUsed < 3 then HistoryUsed := 1; 235 | 236 | I := 0; 237 | StartId(Id); 238 | 239 | C := ' '; 240 | { Delete duplicates } 241 | AdvanceStringPointer; 242 | while CurString <> nil do 243 | begin 244 | if Str = Copy(CurString^, 1, Length(CurString^)-1) then 245 | begin 246 | C := CurString^[Length(CurString^)]; 247 | DeleteString; 248 | Dec(I); 249 | end; 250 | Inc(I); 251 | AdvanceStringPointer; 252 | end; 253 | 254 | if I > MaxHistorySize - 1 then 255 | for J := I-1 downto 0 do 256 | begin 257 | HistoryStr(ID, J); 258 | if CurString = nil then Break; 259 | if CurString^[Length(CurString^)] <> '+' then 260 | begin 261 | DeleteString; Dec(I); Inc(J); 262 | if I < MaxHistorySize then Break; 263 | end; 264 | end; 265 | { 266 | if HistoryUsed < Length(Str) + 4 then 267 | begin 268 | CurString := HistoryBlock; 269 | Inc(LongInt(CurString), PtrRec(HistoryBlock).Ofs+1); 270 | while (LongInt(CurString)-LongInt(HistoryBlock) < HistoryUsed) 271 | and (HistoryUsed < Length(Str) + 4) do 272 | begin 273 | if CurString^[Length(CurString^)] <> '+' then DeleteString; 274 | Inc(LongInt(CurString), Length(CurString^)+3); 275 | end; 276 | 277 | end; 278 | } 279 | CurString := nil; 280 | 281 | InsertString(Id, Str + C); 282 | end; 283 | 284 | function HistoryStr(Id: Byte; Index: Integer): String; 285 | var 286 | I: Integer; 287 | begin 288 | StartId(Id); 289 | for I := 0 to Index do AdvanceStringPointer; 290 | if CurString <> nil then 291 | HistoryStr := Copy(CurString^, 1, Length(CurString^)-1) else 292 | HistoryStr := ''; 293 | end; 294 | 295 | procedure ClearHistory; 296 | begin 297 | FillChar(HistoryBlock^, HistorySize, 0); 298 | PChar(HistoryBlock)^ := #0; 299 | HistoryUsed := PtrRec(HistoryBlock).Ofs + 1; 300 | end; 301 | 302 | procedure StoreHistory(var S: TStream); 303 | var 304 | Size: Word; 305 | begin 306 | Size := HistoryUsed - PtrRec(HistoryBlock).Ofs; 307 | S.Write(Size, SizeOf(Word)); 308 | S.Write(HistoryBlock^, Size); 309 | end; 310 | 311 | procedure LoadHistory(var S: TStream); 312 | var 313 | Size, I: Word; 314 | begin 315 | S.Read(Size, SizeOf(Word)); 316 | if HistoryBlock = nil then InitHistory; 317 | if HistorySize < Size then I := Size - HistorySize else I := 0; 318 | S.Read(HistoryBlock^, Size - I); 319 | S.Seek(S.GetPos + I); 320 | HistoryUsed := PtrRec(HistoryBlock).Ofs + Size; 321 | end; 322 | 323 | procedure InitHistory; 324 | begin 325 | HistoryBlock := MemAllocSeg(HistorySize); 326 | ClearHistory; 327 | end; 328 | 329 | procedure DoneHistory; 330 | begin 331 | FreeMem(HistoryBlock, HistorySize); 332 | end; 333 | 334 | procedure DeleteHistoryStr(Id: Byte; Index: Integer); 335 | begin 336 | HistoryStr(ID, Index); 337 | if CurString <> nil then DeleteString; 338 | end; 339 | 340 | end. 341 | 342 | -------------------------------------------------------------------------------- /HISTRIES.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/HISTRIES.PAS -------------------------------------------------------------------------------- /IDLERS.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/IDLERS.PAS -------------------------------------------------------------------------------- /INIFILES.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/INIFILES.PAS -------------------------------------------------------------------------------- /LINK.INC: -------------------------------------------------------------------------------- 1 | {$IFDEF DN} 2 | 3 | {$DEFINE CL_MASTER} 4 | 5 | {$ENDIF} 6 | 7 | 8 | {$IFDEF NLCLIENT} 9 | 10 | {$DEFINE CL_MASTER} 11 | 12 | {$ENDIF} 13 | 14 | -------------------------------------------------------------------------------- /LINKTYP.PAS: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on Dos Navigator by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | unit LinkTyp; 48 | 49 | {$A+} 50 | 51 | {$I LINK.INC} interface uses {$IFDEF OS2} ObjOS2 {$ELSE} Objects {$ENDIF}; 52 | 53 | 54 | type 55 | 56 | {$IFDEF CL_MASTER} 57 | TInDatTyp = (id_Nothing, id_Drives, 58 | id_FileNfo, id_FileBlk, 59 | id_IOstat, 60 | id_DirNfo, id_Dir); 61 | {$ENDIF} 62 | 63 | TInCmdTyp = (ic_Nothing, ic_GetDrives, 64 | ic_FileNfo, ic_FileBlk, ic_GetFile, 65 | ic_GetDirNfo, ic_GetDirValid, ic_GetDir, 66 | ic_EraseFile, ic_EraseDir, ic_MkDir); 67 | 68 | TCL_File = record 69 | TotSize : LongInt; 70 | CurPos : LongInt; 71 | Handle : file; 72 | Error : Word; 73 | Id : Byte 74 | end; 75 | 76 | TCL_IOstatus = (CL_stUnk, CL_stError, CL_stOK); 77 | 78 | TCL_IOstat = packed record 79 | Status : TCL_IOstatus; 80 | Error : Word; 81 | Id : Byte; 82 | end; 83 | 84 | TCL_FileNfo = packed record 85 | Size : LongInt; 86 | Time : LongInt; 87 | Attr : Byte; 88 | Id : Byte; 89 | end; 90 | 91 | 92 | TCL_DirEntry = packed record 93 | Name : array[1..8] of char; 94 | Ext : array[1..3] of char; 95 | Attr : Byte; 96 | Time : LongInt; 97 | Size : LongInt; 98 | end; 99 | 100 | PCL_DirNfo = ^TCL_DirNfo; 101 | TCL_DirNfo = packed record 102 | VolNm : array[1..8] of char; 103 | VolXt : array[1..3] of char; 104 | DrvTotal : LongInt; 105 | DrvFree : LongInt; 106 | DirLen : LongInt; 107 | NumFiles : Word; 108 | DifNfoSz : Word; 109 | DirNfo : Char; {Last} 110 | end; 111 | 112 | PCL_DirPrefix = ^TCL_DirPrefix; 113 | TCL_DirPrefix = packed record 114 | TotalLen : LongInt; 115 | DrvFree : LongInt; 116 | NumFiles : Word; 117 | end; 118 | 119 | TCL_DirReq = packed record 120 | PanelFlags: Integer; 121 | SortMode: Integer; 122 | end; 123 | 124 | const 125 | CL_DirRecSz = SizeOf(TCL_DirEntry); 126 | CL_MaxDirEntries = 1500; 127 | 128 | CL_MaxInBufStorage = $A000; 129 | CL_MaxBackOutBuf = $8000; { for LinkUtil } 130 | CL_NormBackOutBuf = $4000; { for LinkUtil } 131 | CL_FileBuf = $2000; { for LinkUtil } 132 | CL_MaxBlockSize = $1000; { for ComLnk } 133 | CL_StartBlockSize = $0800; { for ComLnk } 134 | 135 | CL_StatusStrWdth = 36; 136 | 137 | 138 | type 139 | TCL_StatusStr = string[CL_StatusStrWdth]; 140 | 141 | TCL_StatusInfo = record 142 | ConnectOK: Boolean; 143 | Speed: LongInt; 144 | ComNum, DataBits, StopBits, Parity: Byte; 145 | PortStr : TCL_StatusStr; 146 | ErrStr : TCL_StatusStr; 147 | end; 148 | 149 | var 150 | CL_InCmd, 151 | CL_InData : PCollection; 152 | 153 | implementation 154 | 155 | end. -------------------------------------------------------------------------------- /LZWC2.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; Lempel-Ziv Welch Compression routine 3 | ; 4 | ; Copyright (C) 1994 by Roman Cramar 5 | ; 6 | ideal 7 | jumps 8 | 9 | segment DATA 'DATA' 10 | extrn MaxCode : word 11 | extrn RunCode : word 12 | extrn RunningBits : word 13 | extrn CodeBuffer : dword 14 | extrn CurCode : word 15 | extrn OldCode : word 16 | extrn CurBuffShift : word 17 | extrn InputOffs : word 18 | extrn InputSeg : word 19 | extrn OutPutOffs : word 20 | extrn OutPutSeg : word 21 | extrn Temp : word 22 | extrn DataSize : word 23 | extrn OutPutOffs2 : word 24 | extrn CodeTable : dword 25 | extrn PrefixTable : dword 26 | extrn SymbolTable : dword 27 | ends DATA 28 | 29 | 30 | 31 | segment CODE 32 | assume cs:CODE, ds:DATA 33 | 34 | public LZWCompr 35 | 36 | p386 37 | 38 | macro _GetByte 39 | dec [DataSize] 40 | jz LZWComprEnd 41 | les si, [dword ptr InputOffs] 42 | mov al, [es:si] 43 | mov ah, 0 44 | inc [InputOffs] 45 | endm 46 | 47 | macro _ComprCode 48 | local Rotate2,NoRotate2,CheckFull,NoIncBits 49 | xor bx,bx 50 | mov cx,[CurBuffShift] 51 | or cx,cx 52 | jz NoRotate2 53 | Rotate2: shl ax,1 54 | rcl bx,1 55 | loop Rotate2 56 | NoRotate2: or [word ptr CodeBuffer+0],ax 57 | or [word ptr CodeBuffer+2],bx 58 | mov ax,[RunningBits] 59 | add [CurBuffShift],ax 60 | CheckFull: cmp [CurBuffShift],8 61 | jc NoIncBits 62 | les di,[dword ptr OutputOffs] 63 | mov ax,[word ptr CodeBuffer] 64 | mov [es:di],al 65 | inc [OutPutOffs] 66 | rept 8 67 | shr [word ptr CodeBuffer+2],1 68 | rcr [word ptr CodeBuffer+0],1 69 | endm 70 | sub [CurBuffShift],8 71 | jmp CheckFull 72 | NoIncBits: 73 | endm 74 | 75 | macro _InitCodeTable 76 | les di,[CodeTable] 77 | mov cx,LZMax 78 | xor ax,ax 79 | cld 80 | rep stosw 81 | endm 82 | 83 | macro _ResetCodeBuffer 84 | local Again 85 | 86 | Again: 87 | les di,[dword ptr OutPutOffs] 88 | mov ax,[word ptr CodeBuffer] 89 | mov [es:di],al 90 | inc [OutPutOffs] 91 | rept 8 92 | shr [word ptr CodeBuffer+2],1 93 | rcr [word ptr CodeBuffer+0],1 94 | endm 95 | sub [CurBuffShift],8 96 | jnc Again 97 | ResetBuffEnd: mov [CurBuffShift],0 98 | endm 99 | 100 | ;Constants 101 | ClearCode equ 100h 102 | EOICode equ 101h 103 | LZMax equ 4096 104 | 105 | ;Pointers 106 | cCodeTable equ 20h 107 | cPrefixTable equ 2020h 108 | cSymbolTable equ 4020h 109 | 110 | ;Compress - compresses data using Lempel-Ziv Welch method. 111 | ; BX:AX - Pointer to temporary buffer (21K min.) 112 | ; DX:CX - Pointer to compressed data. 113 | ; DI:SI - Pointer to buffer to decompress. 114 | ; Exit: AX - size of compressed data. 115 | 116 | proc LZWCompr near 117 | 118 | push bp 119 | 120 | mov [InputOffs], cx 121 | mov [InputSeg], dx 122 | mov [OutPutOffs], si 123 | mov [OutPutOffs2],si 124 | mov [OutputSeg], di 125 | 126 | mov [word ptr CodeTable+2],bx 127 | mov [word ptr PrefixTable+2],bx 128 | mov [word ptr SymbolTable+2],bx 129 | 130 | mov bx, ax 131 | lea ax, [cCodeTable+bx] 132 | mov [word ptr CodeTable], ax 133 | lea ax, [cPrefixTable+bx] 134 | mov [word ptr PrefixTable], ax 135 | lea ax, [cSymbolTable+bx] 136 | mov [word ptr SymbolTable], ax 137 | 138 | inc [DataSize] 139 | 140 | call LZWCompress 141 | mov ax,[OutPutOffs] 142 | sub ax,[OutPutOffs2] 143 | pop bp 144 | ret 145 | 146 | endp LZWCompr 147 | 148 | proc LZWCompress near 149 | _InitCodeTable 150 | mov [RunCode],102h 151 | mov [RunningBits],9 152 | mov [MaxCode],200h 153 | xor ax,ax 154 | mov [CurBuffShift],ax 155 | mov [CurCode],ax 156 | mov [word ptr CodeBuffer+0],ax 157 | mov [word ptr CodeBuffer+2],ax 158 | mov ax,ClearCode 159 | _ComprCode 160 | _GetByte 161 | mov [OldCode],ax 162 | NextByte: _GetByte 163 | mov [CurCode],ax 164 | mov cl,5 165 | shl ax,cl 166 | xor ax,[OldCode] 167 | and ax,0FFFh 168 | mov si,ax 169 | mov [Temp],1 170 | SearchLoop: mov bx,si 171 | shl bx,1 172 | 173 | les bp, [CodeTable] 174 | add bp,bx 175 | cmp [word ptr es:bp],0 176 | 177 | jnz IsInTable 178 | mov ax,[OldCode] 179 | _ComprCode 180 | mov bx,si 181 | shl bx,1 182 | mov ax,[RunCode] 183 | mov [Temp],ax 184 | cmp ax,LZMax 185 | jnc CheckOverflow 186 | 187 | les bp, [CodeTable] 188 | add bp,bx 189 | mov [es:bp],ax 190 | 191 | mov ax,[OldCode] 192 | 193 | les bp,[PrefixTable] 194 | add bp,bx 195 | 196 | mov [es:bp],ax 197 | 198 | mov al,[byte ptr ds:CurCode] 199 | 200 | les bp, [SymbolTable] 201 | mov [byte ptr es:bp+si],al 202 | 203 | inc [RunCode] 204 | CheckOverflow: mov ax,[Temp] 205 | cmp ax,[MaxCode] 206 | jnz ChangeOldCode 207 | cmp [byte ptr ds:RunningBits],12 208 | jnc SendClearCode 209 | inc [byte ptr ds:RunningBits] 210 | shl [MaxCode],1 211 | jmp ChangeOldCode 212 | SendClearCode: mov ax,ClearCode 213 | _ComprCode 214 | mov [RunCode],102h 215 | mov [byte ptr ds:RunningBits],9 216 | mov [MaxCode],200h 217 | _InitCodeTable 218 | ChangeOldCode: mov al,[byte ptr ds:CurCode] 219 | mov ah,0 220 | mov [OldCode],ax 221 | jmp NextByte 222 | IsInTable: mov ax,[OldCode] 223 | 224 | les bp,[PrefixTable] 225 | add bp,bx 226 | 227 | cmp ax,[es:bp] 228 | 229 | jnz NotTheSame 230 | 231 | les bp, [SymbolTable] 232 | 233 | mov al,[byte ptr es:bp+si] 234 | cmp al,[byte ptr ds:CurCode] 235 | jnz NotTheSame 236 | 237 | les bp, [CodeTable] 238 | add bp,bx 239 | 240 | mov ax,[es:bp] 241 | 242 | mov [OldCode],ax 243 | jmp NextByte 244 | NotTheSame: add si,[Temp] 245 | add [Temp],2 246 | cmp si,LZMax 247 | jc NoOverflow 248 | sub si,LZMax 249 | NoOverflow: jmp SearchLoop 250 | LZWComprEnd: mov ax,[OldCode] 251 | _ComprCode 252 | mov ax,EOICode 253 | _ComprCode 254 | _ResetCodeBuffer 255 | ret 256 | endp LZWCompress 257 | 258 | 259 | ends CODE 260 | end 261 | -------------------------------------------------------------------------------- /LZWD2.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; Lempel-Ziv Welch Decompression routine 3 | ; 4 | ; Copyright (C) 1994 by Roman Cramar 5 | ; 6 | .186 7 | jumps 8 | 9 | 10 | OutByte macro 11 | mov es,OutputSeg 12 | mov byte ptr es:[bp],al 13 | inc bp 14 | endm 15 | 16 | DATA segment 'DATA' 17 | 18 | extrn InputOffs : word 19 | extrn InputSeg : word 20 | extrn Temp_offs : word 21 | extrn Temp_seg : word 22 | extrn OutPutSeg : word 23 | 24 | extrn le6A : word 25 | extrn le6C : word 26 | extrn le6E : word 27 | extrn le70 : word 28 | extrn le72 : word 29 | extrn le74 : word 30 | extrn le78 : word 31 | extrn le7A_0 : word 32 | extrn le7A_2 : word 33 | extrn le7A_4 : word 34 | extrn le7A_6 : word 35 | extrn le82a : word 36 | extrn le82b : word 37 | extrn OutPutOffs2: word 38 | 39 | extrn le76 : byte 40 | extrn le77 : byte 41 | 42 | DATA ends 43 | 44 | CODE segment 45 | assume cs:CODE, ds:DATA 46 | 47 | public LZWDecompr 48 | 49 | ;Decompress - decompresses data compressed by Lempel-Ziv Welch method. 50 | ; BX:AX - Pointer to temporary buffer (17K min.). 51 | ; DX:CX - Pointer to compressed data. 52 | ; DI:SI - Pointer to buffer to decompress. 53 | ; Exit: AX - size of decompressed data. 54 | 55 | LZWDecompr proc near 56 | push bp 57 | 58 | mov Temp_offs, ax 59 | mov Temp_seg, bx 60 | mov InputOffs, cx 61 | mov InputSeg, dx 62 | mov bp, si 63 | mov OutPutOffs2,si 64 | mov OutputSeg, di 65 | 66 | call LZWDecomp 67 | 68 | mov ax,bp 69 | sub ax,OutPutOffs2 70 | pop bp 71 | 72 | ret 73 | LZWDecompr endp 74 | 75 | LZWDecomp proc near 76 | push si 77 | push di 78 | mov le72,0 79 | mov le78,9 80 | mov le70,102h 81 | mov le74,200h 82 | xor ax,ax 83 | mov le6a,ax 84 | mov le6c,ax 85 | mov le6e,ax 86 | mov le76,al 87 | mov le77,al 88 | mov le82a,ax 89 | mov le82b,ax 90 | mov le7a_0,1FFh 91 | mov le7a_2,3FFh 92 | mov le7a_4,7FFh 93 | mov le7a_6,0FFFh 94 | le58b: call GetNextCode 95 | cmp ax,101h 96 | jnz le596 97 | jmp le63b 98 | le596: cmp ax,100h 99 | jnz le5b5 100 | call InitTable 101 | call GetNextCode 102 | mov le6a,ax 103 | mov le6c,ax 104 | mov le77,al 105 | mov le76,al 106 | mov al,le77 107 | OutByte 108 | jmp le58b 109 | le5b5: mov le6a,ax 110 | mov le6e,ax 111 | cmp ax,le70 112 | jb t2 113 | mov ax,le6c 114 | mov le6a,ax 115 | mov al,le76 116 | push ax 117 | inc le72 118 | t2: cmp le6a,0ffh 119 | jbe le5f6 120 | les si,dword ptr temp_offs 121 | mov bx,le6a 122 | shl bx,1 123 | add bx,le6a 124 | mov al,es:[bx+si+2] 125 | push ax 126 | inc le72 127 | mov ax,es:[bx+si] 128 | mov le6a,ax 129 | jmp t2 130 | le5f6: mov ax,le6a 131 | mov le76,al 132 | mov le77,al 133 | push ax 134 | inc le72 135 | mov cx,le72 136 | jcxz le610 137 | t1: pop ax 138 | OutByte 139 | loop t1 140 | le610: mov le72,0 141 | call AddInTable 142 | mov ax,le6e 143 | mov le6c,ax 144 | mov bx,le70 145 | cmp bx,le74 146 | jl le638 147 | cmp byte ptr ds:le78,0ch 148 | jz le638 149 | inc byte ptr ds:le78 150 | shl le74,1 151 | le638: jmp le58b 152 | le63b: pop di 153 | pop si 154 | ret 155 | 156 | InitTable proc near 157 | mov byte ptr ds:le78,9 158 | mov le74,200h 159 | mov le70,102h 160 | ret 161 | InitTable endp 162 | 163 | GetNextCode proc near 164 | mov bx,le82a 165 | mov ax,le82b 166 | add bx,le78 167 | adc ax,0 168 | xchg bx,le82a 169 | xchg ax,Le82b 170 | mov cx,bx 171 | and cx,7 ;!!!!! 172 | shr ax,1 173 | rcr bx,1 174 | shr ax,1 175 | rcr bx,1 176 | shr ax,1 177 | rcr bx,1 178 | les si,dword ptr InputOffs 179 | mov ax,es:[bx+si] 180 | mov dl,es:[bx+si+2] 181 | or cx,cx 182 | jz GetCode2 183 | GetCode1: shr dl,1 184 | rcr ax,1 185 | loop GetCode1 186 | GetCode2: mov bx,le78 187 | sub bx,9 188 | shl bx,1 189 | and ax,[bx+le7a_0] 190 | ret 191 | GetNextCode endp 192 | 193 | AddInTable proc near 194 | push si 195 | mov bx,le70 196 | shl bx,1 197 | add bx,le70 198 | les si,dword ptr temp_offs 199 | mov al,le77 200 | mov es:[bx+si+2],al 201 | mov ax,le6c 202 | mov es:[bx+si],ax 203 | inc le70 204 | pop si 205 | ret 206 | AddInTable endp 207 | 208 | LZWDecomp endp 209 | 210 | CODE ends 211 | end 212 | -------------------------------------------------------------------------------- /MEMINFO.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/MEMINFO.PAS -------------------------------------------------------------------------------- /MENUS.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/MENUS.PAS -------------------------------------------------------------------------------- /MICROED.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/MICROED.PAS -------------------------------------------------------------------------------- /MODEMIO.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/MODEMIO.PAS -------------------------------------------------------------------------------- /OBJTYPE.PAS: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on Dos Navigator by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | unit ObjType; 48 | 49 | interface 50 | 51 | const 52 | 53 | { --- Archiver } 54 | 55 | otARJArchiver = 9201; 56 | otZIPArchiver = 9202; 57 | otARCArchiver = 9203; 58 | otHYPArchiver = 9204; 59 | otRARArchiver = 9205; 60 | otHAPArchiver = 9206; 61 | otHAArchiver = 9207; 62 | otSQZArchiver = 9208; 63 | otBSAArchiver = 9209; 64 | otBS2Archiver = 9210; 65 | otCHZArchiver = 9211; 66 | otLHAArchiver = 9212; 67 | otZOOArchiver = 9213; 68 | otUC2Archiver = 9214; 69 | otLIMArchiver = 9215; 70 | otHPKArchiver = 9216; 71 | otTARArchiver = 9217; 72 | 73 | otArchiveCollection = 19221; 74 | 75 | 76 | { --- ArcView } 77 | 78 | otArcDrive = 4356; 79 | otFileInfo = 7339; 80 | otUserSaver = 7356; 81 | 82 | 83 | { --- Arvid } 84 | 85 | otArvidDrive = 4358; 86 | 87 | 88 | { --- ASCIITab } 89 | 90 | otTable = 910; 91 | otReport = 911; 92 | otASCIIChart = 912; 93 | 94 | 95 | { --- Calc } 96 | 97 | otCalcWindow = 6333; 98 | otCalcView = 6334; 99 | otCalcInfo = 6335; 100 | otInfoView = 16336; 101 | 102 | 103 | { --- CCalc } 104 | 105 | otCalcLine = 9301; 106 | otIndicator = 9302; 107 | 108 | 109 | { --- CDPlayer } 110 | 111 | otCdplayer = 15547; 112 | otCDCounter = 15548; 113 | 114 | 115 | { --- CellsCol } 116 | 117 | otCellCollection = 1060; 118 | 119 | 120 | { --- ColorSel } 121 | 122 | otColorSelector = 21; 123 | otMonoSelector = 22; 124 | otColorDisplay = 23; 125 | otColorGroupList = 24; 126 | otColorItemList = 25; 127 | otColorDialog = 26; 128 | otR_BWSelector = 28; 129 | 130 | 131 | { --- DBView } 132 | 133 | otDBWindow = 15549; 134 | otDBViewer = 15550; 135 | otDBIndicator = 15551; 136 | otFieldListBox = 15553; 137 | 138 | 139 | { --- Dialogs } 140 | 141 | otDialog = 10; 142 | otInputLine = 11; 143 | otButton = 12; 144 | otCluster = 13; 145 | otRadioButtons = 14; 146 | otCheckBoxes = 15; 147 | otListBox = 16; 148 | otStaticText = 17; 149 | otLabel = 18; 150 | otHistory = 19; 151 | otParamText = 20; 152 | otMultiCheckBoxes = 27; 153 | 154 | 155 | { --- DiskInfo } 156 | 157 | otDiskInfo = 3361; 158 | 159 | 160 | { --- DnApp } 161 | 162 | otBackground = 30; 163 | otDesktop = 31; 164 | otStringCache = 32; 165 | 166 | 167 | { --- DnStdDlg } 168 | 169 | otFileInputLine = 60; 170 | otFileCollection = 61; 171 | otFileList = 62; 172 | otFileInfoPane = 63; 173 | otFileDialog = 64; 174 | otSortedListBox = 68; 175 | 176 | 177 | 178 | { --- DnUtil } 179 | 180 | otDataSaver = 20300; 181 | 182 | 183 | { --- Drives } 184 | 185 | otDrive = 4354; 186 | 187 | 188 | { --- Editor } 189 | 190 | otXFileEditor = 6340; 191 | 192 | 193 | { --- FileFind } 194 | 195 | otFindDrive = 4355; 196 | otTempDrive = 4357; 197 | 198 | 199 | { --- FilesCol } 200 | 201 | otFilesCollection = 3360; 202 | 203 | 204 | { --- FlPanel } 205 | 206 | otFilePanel = 3350; 207 | otFlPInfoView = 3351; 208 | otTopView = 3352; 209 | otSeparator = 3353; 210 | otSpecScroll = 3354; 211 | otDriveLine = 14354; 212 | 213 | 214 | { --- FStorage } 215 | 216 | otDirStorage = 20303; 217 | 218 | 219 | { --- FViewer } 220 | 221 | otFileViewer = 3370; 222 | otFileWindow = 3371; 223 | otViewScroll = 3372; 224 | otHFileViewer = 3373; 225 | otViewInfo = 3570; 226 | 227 | 228 | { --- Gauges } 229 | 230 | otTrashCan = 4090; 231 | otKeyMacros = 4091; 232 | 233 | 234 | { --- HelpKern } 235 | 236 | otHelpTopic = 10000; 237 | otHelpIndex = 10001; 238 | 239 | 240 | { --- Histries } 241 | 242 | otEditHistoryCol = 17570; 243 | otViewHistoryCol = 17571; 244 | 245 | 246 | { --- Menus } 247 | 248 | otMenuBar = 40; 249 | otMenuBox = 41; 250 | otStatusLine = 42; 251 | otMenuPopup = 43; 252 | 253 | 254 | { --- MicroEd } 255 | 256 | otFileEditor = 6340; 257 | otInfoLine = 6341; 258 | otEditWindow = 6342; 259 | otEditScrollBar = 6343; 260 | otEditFrame = 6344; 261 | otLineCollection = 16344; 262 | 263 | 264 | { --- NavyLink } 265 | 266 | otLinker = 20301; 267 | otLinkDrive = 20302; 268 | 269 | 270 | { --- Objects } 271 | 272 | otCollection = 50; 273 | otStringCollection = 51; 274 | otStringList = 52; 275 | otStrListMaker = 52; 276 | otStrCollection = 69; 277 | 278 | 279 | { --- Phones } 280 | 281 | otAutoDialer = 7331; 282 | otDialBox = 8331; 283 | otDStringView = 8332; 284 | otPhone = 7330; 285 | otPhoneDir = 8330; 286 | otPhoneCollection = 5331; 287 | 288 | 289 | { --- PrintMan } 290 | 291 | otStringCol = 5356; 292 | otPrintManager = 5357; 293 | otPrintStatus = 5358; 294 | otPMWindow = 5359; 295 | 296 | 297 | { --- ScrollBk } 298 | 299 | otScrollBackWindow = 6353; 300 | otScrollBack = 6354; 301 | 302 | 303 | { --- Scroller } 304 | 305 | otScroller = 4; 306 | otListViewer = 5; 307 | 308 | 309 | { --- Setups } 310 | 311 | otSysDialog = 15001; 312 | otCurrDriveInfo = 15002; 313 | otMouseDialog = 15003; 314 | otMouseBar = 15004; 315 | otSaversDialog = 15005; 316 | otSaversListBox = 15006; 317 | otUpperTable = 15007; 318 | 319 | 320 | { --- Startup } 321 | 322 | otTextCollection = 17455; 323 | 324 | 325 | { --- Terminal } 326 | 327 | otTerminalWindow = 6351; 328 | otTerminal = 6352; 329 | otPortInfo = 6652; 330 | 331 | 332 | { --- Tetris } 333 | 334 | otGameWindow = 6371; 335 | otGameView = 6372; 336 | otGameInfo = 6373; 337 | 338 | 339 | { --- Tree } 340 | 341 | otTreeView = 3330; 342 | otTreeReader = 3331; 343 | otTreeWindow = 3332; 344 | otTreePanel = 3333; 345 | otTreeDialog = 3334; 346 | otTreeInfoView = 3335; 347 | otHTreeView = 3336; 348 | otDirCollection = 16336; 349 | 350 | 351 | { --- UserKey } 352 | 353 | otCover = 23323; 354 | otDCoder = 21831; 355 | otGCoder = 21830; 356 | otXCoder = 21832; 357 | otInfo = 21961; 358 | otInfo1 = 22005; 359 | otInfo2 = 29297; 360 | otInfo3 = 21922; 361 | otInfo4 = 21927; 362 | otInfo5 = 26034; 363 | otInfo6 = 54017; 364 | otInfo7 = 47029; 365 | otInfo8 = 47030; 366 | otInfo9 = 21769; 367 | otInfo10 = 21770; 368 | 369 | 370 | { --- UserMenu } 371 | 372 | otUserWindow = 6361; 373 | otUserView = 6362; 374 | 375 | 376 | { --- Validate } 377 | 378 | otFilterValidator = 81; 379 | otRangeValidator = 82; 380 | 381 | 382 | { --- Views } 383 | 384 | otView = 1; 385 | otFrame = 2; 386 | otScrollBar = 3; 387 | otGroup = 6; 388 | otWindow = 7; 389 | 390 | 391 | { --- XDblWnd } 392 | 393 | otDoubleWindow = 3340; 394 | 395 | 396 | 397 | implementation 398 | 399 | end. -------------------------------------------------------------------------------- /OVERLAYS.PAS: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on Dos Navigator by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | unit Overlays; 48 | 49 | interface 50 | uses Objects, Overlay; 51 | 52 | procedure OvrInitStream(S : PStream); 53 | { Copies overlay segment code to S as new segments are loaded, 54 | and does reloads from there. Allows multiple calls, to buffer 55 | different segments on different streams. } 56 | 57 | procedure OvrDetachStream(BadS : PStream); 58 | { Makes sure that the overlay system makes no references to BadS. } 59 | 60 | procedure OvrDisposeStreams; 61 | { Detaches and disposes of all streams being used by the overlay system } 62 | 63 | function OvrSizeNeeded : LongInt; 64 | { Returns the size required to load any segments which still haven't 65 | been loaded to a stream. } 66 | 67 | function OvrLoadAll : Boolean; 68 | { Forces all overlay segments to be copied into the stream; if successful 69 | (true) then no more references to the overlay file will be made. } 70 | 71 | procedure InitOverlay(const FileName: String); 72 | 73 | implementation 74 | uses ExtraMemory, Advance, Startup, Commands; 75 | 76 | { ****** Overlay stream code ****** } 77 | 78 | type 79 | { This is the structure at the start of each "thunk" segment } 80 | POvrhead = ^TOvrhead; 81 | TOvrhead = record 82 | Signature : Word; { CD 3F - INT 3F call used on returns } 83 | Ret_Ofs : Word; { The offset to jump to when a return triggers a 84 | reload } 85 | Offset : LongInt; { The offset to the segment in the .OVR file } 86 | Code_Bytes, { Size of the code image } 87 | Reloc_Bytes, { Number of relocation fixups times 2 } 88 | Entry_Count, { The number of entry points } 89 | NextSeg, { Next overlay segment - add prefixseg + $10 to find 90 | thunks. List starts with System.ovrcodelist. } 91 | LoadSeg, { The segment at which the overlay is loaded, or 0 } 92 | Reprieve, { Set to 1 to if overlay used while on probation } 93 | NextLoaded : Word; { The segment of the next loaded overlay. List starts 94 | with System.ovrloadlist. Updated *after* call to 95 | ovrreadbuf. } 96 | case Integer of 97 | 1 : (EMSPage, { The EMS page where this overlay is stored } 98 | EMSOffset : Word); { The offset within the EMS page } 99 | 2 : (S : PStream; { The stream holding this segment's code } 100 | Soffset : LongInt); { The offset within S } 101 | end; 102 | 103 | var 104 | OldReadFunc : OvrReadFunc; 105 | OvrOldExitProc : Pointer; 106 | OvrStream : PStream; 107 | const 108 | OvrStreamInstalled : Boolean = False; 109 | OvrExitHandler : Boolean = False; 110 | 111 | function OvrPtr(Seg : Word) : POvrhead; 112 | { Convert map style segment number, as used by overlay manager, to 113 | pointer } 114 | begin 115 | OvrPtr := Ptr(Seg+PrefixSeg+$10, 0); 116 | end; 117 | 118 | function StdPtr(Seg : Word) : POvrhead; 119 | { Convert straight segment number to a pointer } 120 | begin 121 | StdPtr := Ptr(Seg, 0); 122 | end; 123 | 124 | function NewReadFunc(OvrSeg : Word) : Integer; Far; 125 | var 126 | Result : Integer; 127 | begin 128 | with StdPtr(OvrSeg)^ do 129 | begin 130 | if S = nil then 131 | begin { Segment not yet loaded } 132 | Result := OldReadFunc(OvrSeg); 133 | if Result = 0 then 134 | begin 135 | { Now copy the loaded code to our stream } 136 | Soffset := OvrStream^.GetSize; 137 | OvrStream^.Seek(Soffset); 138 | OvrStream^.Write(Ptr(LoadSeg, 0)^, Code_Bytes); 139 | Result := OvrStream^.Status; 140 | if Result = stOK then 141 | S := OvrStream 142 | else 143 | OvrStream^.Reset; { Something failed; hope we haven't messed 144 | up the stream too much } 145 | end; 146 | end 147 | else 148 | begin { Segment has been loaded into the stream } 149 | S^.Seek(Soffset); 150 | S^.Read(Ptr(LoadSeg, 0)^, Code_Bytes); 151 | Result := S^.Status; 152 | if Result <> stOK then 153 | begin 154 | S^.Reset; { Fix the stream, and try a standard load } 155 | Result := OldReadFunc(OvrSeg); 156 | end; 157 | end; 158 | end; 159 | NewReadFunc := Result; 160 | end; 161 | 162 | procedure OvrExitProc; Far; 163 | { Installed exit procedure; disposes of any streams that are still 164 | handling overlays. } 165 | begin 166 | ExitProc := OvrOldExitProc; 167 | OvrDisposeStreams; 168 | end; 169 | 170 | procedure OvrInitStream(S : PStream); 171 | begin 172 | if not OvrStreamInstalled then 173 | begin 174 | OldReadFunc := OvrReadBuf; { Install our reader function } 175 | OvrReadBuf := NewReadFunc; 176 | OvrStreamInstalled := True; 177 | end; 178 | if not OvrExitHandler then 179 | begin 180 | OvrOldExitProc := ExitProc; 181 | ExitProc := @OvrExitProc; 182 | OvrExitHandler := True; 183 | end; 184 | OvrStream := S; { And set stream to use } 185 | end; 186 | 187 | procedure OvrDetachStream(BadS : PStream); 188 | var 189 | OvrSeg : Word; 190 | begin 191 | if OvrStreamInstalled then 192 | begin 193 | if OvrStream = BadS then 194 | OvrStream := nil; { Detach default stream } 195 | OvrSeg := OvrCodeList; 196 | while OvrSeg <> 0 do { Walk the overlay list } 197 | with OvrPtr(OvrSeg)^ do 198 | begin 199 | if S <> nil then 200 | begin 201 | if S <> BadS then 202 | begin 203 | if OvrStream = nil then 204 | OvrStream := S; { Set default stream to first found } 205 | end 206 | else 207 | S := nil; { Blank out BadS references } 208 | end; 209 | OvrSeg := NextSeg; 210 | end; 211 | if OvrStream = nil then 212 | begin 213 | OvrStreamInstalled := False; { If we don't have a stream, better 214 | uninstall. } 215 | OvrReadBuf := OldReadFunc; 216 | end; 217 | end; 218 | end; 219 | 220 | procedure OvrDisposeStreams; 221 | var 222 | S : PStream; 223 | begin 224 | while OvrStreamInstalled and (OvrStream <> nil) do 225 | begin 226 | S := OvrStream; 227 | OvrDetachStream(S); 228 | Dispose(S, Done); 229 | end; 230 | end; 231 | 232 | function OvrSizeNeeded : LongInt; 233 | var 234 | OvrSeg : Word; 235 | Result : LongInt; 236 | begin 237 | OvrSeg := OvrCodeList; 238 | Result := 0; 239 | while OvrSeg <> 0 do { Walk the overlay list } 240 | with OvrPtr(OvrSeg)^ do 241 | begin 242 | if S = nil then 243 | Inc(Result, Code_Bytes); 244 | OvrSeg := NextSeg; 245 | end; 246 | OvrSizeNeeded := Result; 247 | end; 248 | 249 | function OvrLoadAll : Boolean; 250 | var 251 | OvrSeg : Word; 252 | Junk : Integer; 253 | begin 254 | if not OvrStreamInstalled then 255 | OvrLoadAll := False 256 | else 257 | begin 258 | OvrClearBuf; 259 | OvrSeg := OvrCodeList; 260 | while OvrSeg <> 0 do { Walk the overlay list } 261 | with OvrPtr(OvrSeg)^ do 262 | begin 263 | if S = nil then 264 | begin 265 | LoadSeg := OvrHeapOrg; { load at start of overlay buffer } 266 | Junk := NewReadFunc(OvrSeg+PrefixSeg+$10); 267 | LoadSeg := 0; { Don't really want it loaded yet } 268 | end; 269 | OvrSeg := NextSeg; 270 | end; 271 | OvrLoadAll := OvrStream^.Status = stOK; 272 | end; 273 | end; 274 | 275 | procedure InitOverlay(const FileName: String); 276 | var S: PStream; 277 | LM,LL: LongInt; 278 | I : longint ; 279 | ST : string[8] ; 280 | begin 281 | 282 | { if FindParam('/NCF')=0 then 283 | if SystemFiles < 25 then 284 | begin 285 | Writeln(' Not enough files. Set at least FILES=25 in CONFIG.SYS'); 286 | Halt(250); 287 | end; 288 | } 289 | ClrIo; 290 | S := New(PDosStream, Init(FileName, stOpenRead)); 291 | if S^.Status <> stOK then 292 | begin 293 | Writeln('Could not initialize Overlays'); 294 | Halt(1); 295 | end; 296 | LL := S^.GetSize; 297 | Dispose(S, Done); 298 | ovrInit(FileName); 299 | 300 | I := FindParam('/BUF:'); 301 | if I > 0 then StartupData.OvrSize := Max( 64, StoI( Copy( ParamStr( I ), 6, 255 ))); 302 | 303 | ovrSetBuf( StartupData.OvrSize * LongInt( 1024 )); 304 | 305 | if (FindParam('/NOXMS') = 0) then 306 | begin 307 | if XMSfound and (StartupData.Load and osuOverlayXMS <> 0) then 308 | begin 309 | S := New(PXMSStream, Init(LL + $2000 , LL + $4000 )); 310 | PXMSStream(S)^.Size := 0; 311 | if S^.Status = stOK then 312 | begin 313 | {Writeln( OvrSizeNeeded );} 314 | OvrInitStream(S); 315 | {if not OvrLoadAll then 316 | begin 317 | OvrDisposeStreams; 318 | Exit ; 319 | end;} 320 | Exit ; 321 | end; 322 | Dispose(S, Done) ; 323 | end 324 | end else XMSfound := off ; 325 | 326 | if (FindParam('/NOEMS') = 0) then 327 | begin 328 | if EMSFound and (StartupData.Load and osuOverlayEMS <> 0) then 329 | begin OvrInitEMS; if ovrResult = ovrOK then Exit end 330 | end else EMSfound := off ; 331 | 332 | end; 333 | 334 | end. -------------------------------------------------------------------------------- /PAR.PAS: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on Dos Navigator by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | unit Par; 48 | 49 | interface 50 | 51 | var ErrOcc : Boolean; 52 | ErrStr : String; 53 | CellOccured: Boolean; 54 | 55 | type 56 | 57 | 58 | FPtr = ^FRec; 59 | FArray = Array[1..50] of FPtr; 60 | PFArray = ^FArray; 61 | OpType = (opCell,opFormula,opValue,opFunc,opSign,opSFunc); 62 | FRec = Record 63 | Owner: FPtr; 64 | Name: String; 65 | Tp: OpType; 66 | case OpType of 67 | opCell: (Left, Right: FPtr); 68 | opFunc: (ParamsNum: Byte; Params: PFArray); 69 | end; 70 | OpString = String[2]; 71 | 72 | 73 | Const 74 | Signs : Set of Char = ['+','-','*','/','^','=','|','\','&','%','#','~','>','<',':']; 75 | FSigns : Set of Char = ['+','-','*','/','^',':']; 76 | UnarySigns: Set of Char = ['+','-','~']; 77 | 78 | MaxOperations = 26; 79 | 80 | Prior : Array [1..MaxOperations] of OpString = 81 | ('||','&&','^^','~','=','<','>','==','>=','=>','<=','=<', 82 | '<>','><','\','|','+','-','^','>>','<<','&','%','*','/',':'); 83 | 84 | {procedure GetToken( St : String; Start : Byte; var O : String;var Tp : OpType); 85 | }procedure Error( Message : String); 86 | function IsPrior (c1,c2 : String) : Boolean; 87 | function GetFormulaTree(St : String) : FPtr; 88 | function GetFormula(const S: String): FPtr; 89 | 90 | 91 | implementation 92 | uses Advance; 93 | 94 | 95 | procedure GetToken( St : String; var Start : Integer; var O : String;var Tp : OpType); 96 | var I,L : Integer; 97 | S,S1 : String; 98 | B: Boolean; 99 | begin 100 | UpStr(St); 101 | O:=Copy(St,Start,250); 102 | if O[1]='(' then Tp:=opFormula 103 | else if (O[1]>='0') and (O[1]<='9') or (O[1] = '$') or (O[1] = '.') 104 | then Tp:=opValue 105 | else if (O[1]>='A') and (O[1]<='Z') or (O[1] = '@') 106 | then Tp:=opCell 107 | else if O[1] in signs 108 | then 109 | begin 110 | S:=O[1]; 111 | if (O[2] in signs) and not (O[1] in UnarySigns) 112 | and not (O[2] in UnarySigns) 113 | then S:=S+O[2]; 114 | O:=S; 115 | Tp:=opSign; 116 | Inc(Start, Length(S)); 117 | Exit; 118 | end 119 | else 120 | begin 121 | Error('Invalid expression was occurred'); 122 | Exit; 123 | end; 124 | L:=1; 125 | S:=''; 126 | Case Tp of 127 | opFormula : begin 128 | i:=1; 129 | S:=O[1]; 130 | repeat 131 | Inc(L); 132 | AddStr(S, O[L]); 133 | Inc(i,Byte(O[L]='(')-Byte(O[L]=')')); 134 | until ((i=0) and (O[L]=')')) or (L>Byte(O[0])); 135 | Inc(Start, Length(S)); 136 | end; 137 | opValue : begin 138 | B := On; 139 | repeat 140 | AddStr(S, O[L]); B := B and (O[L] in ['0'..'9','E','.']); 141 | if B and (L < Length(O)) and (O[L] = 'E') and (O[L+1] in ['+','-']) 142 | and (S[1] >= '0') and (S[1] <= '9') then 143 | begin S := S + O[L+1]; Inc(L); end; 144 | Inc(L); 145 | until not (O[L] in ['0'..'9','X','A'..'F','H','O','.']) or (L>Byte(O[0])); 146 | Inc(Start, Length(S)); 147 | if S[1] = '.' then Insert('0', S, 1); 148 | if PosChar('.', S) = 0 then 149 | if S[Length(S)] = 'H' then 150 | begin 151 | S := '@H'+Copy(S, 1, Length(S)-1); 152 | tp := opCell; 153 | end else 154 | if S[1] = '$' then 155 | begin 156 | S := '@H'+Copy(S, 2, Length(S)-1); 157 | tp := opCell; 158 | end else 159 | if (S[Length(S)] = 'B') and (S[2] in ['0'..'1']) then 160 | begin 161 | S := '@B'+Copy(S, 1, Length(S)-1); 162 | tp := opCell; 163 | end else 164 | if S[Length(S)] = 'O' then 165 | begin 166 | S := '@O'+Copy(S, 1, Length(S)-1); 167 | tp := opCell; 168 | end else 169 | if (S[1] = '0') and (S[0] > #1) then 170 | begin 171 | tp := opCell; 172 | case S[2] of 173 | 'X': S := '@H'+Copy(S,3,255); 174 | 'B': S := '@B'+Copy(S,3,255); 175 | else S := '@O'+Copy(S,2,255); 176 | end; 177 | end 178 | end; 179 | opCell : begin 180 | repeat 181 | AddStr(S, O[L]); 182 | Inc(L); 183 | if (O[L]='(') and (L <= Length(O)) then 184 | begin 185 | I := L; 186 | GetToken(O,L,S1,Tp); 187 | L := I; 188 | S:=S+S1; 189 | Tp:=opFunc; 190 | end; 191 | until (O[L] in Signs) or (Tp=opFunc) or (L>Byte(O[0])); 192 | Inc(Start, Length(S)); 193 | end; 194 | end; 195 | O:=S; 196 | ErrOcc:=False; 197 | end; 198 | 199 | procedure Error(Message : String); 200 | begin 201 | ErrStr:=Message; 202 | ErrOcc:=True 203 | end; 204 | 205 | function IsPrior; 206 | var i : Byte; 207 | begin 208 | i:=1; 209 | While (c1<>Prior[i]) and (c2<>Prior[i]) and (i<=MaxOperations) do Inc(i); 210 | IsPrior:=c1=Prior[i]; 211 | end; 212 | 213 | function GetFormulaTree(St : String) : FPtr; 214 | 215 | var LastOp,Root,p, 216 | CurPtr : FPtr; 217 | S,S1 : String; 218 | Tp : OpType; 219 | Count : Integer; 220 | 221 | Procedure NewOperand( S : String); 222 | var Q, Q1: String; 223 | A,I: Integer; 224 | begin 225 | if tp=opFormula then 226 | begin 227 | DelFC(s);Dec(Byte(s[0])); 228 | p:=GetFormulaTree(s); 229 | end 230 | else 231 | if tp=opFunc then 232 | begin 233 | New(p); 234 | p^.Owner := LastOp; 235 | p^.Name := Copy(s,1,Pos('(',s)-1); 236 | p^.Tp := Tp; 237 | New(p^.Params); 238 | p^.ParamsNum := 0; p^.Params^[1] := nil; 239 | Q := Copy(s,Pos('(',s) + 1,200); Dec(Q[0]); I := 1; A := 0; 240 | While (I <= Length(Q)) do 241 | begin 242 | Q1 := ''; 243 | While (I <= Length(Q)) and (Q[I] <> ',') do 244 | begin 245 | Q1 := Q1 + Q[I]; 246 | if Q[I] = '(' then Inc(A) else if Q[I] = ')' then Dec(A); 247 | if A < 0 then begin ErrOcc := True; Exit end; 248 | Inc(I); 249 | end; 250 | if A <> 0 then begin ErrOcc := True; Exit end; 251 | Inc(p^.ParamsNum); Inc(I); 252 | p^.Params^[p^.ParamsNum] := GetFormulaTree(Q1); 253 | end; 254 | end 255 | else 256 | begin 257 | New(p); 258 | p^.Owner:=LastOp; 259 | p^.Left:=Nil; 260 | p^.Right:=Nil; 261 | p^.Name:=s; 262 | p^.Tp:=Tp; CellOccured := CellOccured or (Tp = opCell); 263 | end; 264 | if LastOP<>Nil then LastOp^.Right:=p; 265 | CurPtr:=p; 266 | end; 267 | 268 | procedure NewSign(S : String); 269 | Label Loop; 270 | var q : FPtr; 271 | begin 272 | New(p); 273 | p^.Name:=S; 274 | p^.Tp:=opSign; 275 | q:=LastOp; 276 | Loop: 277 | if q=Nil then 278 | begin 279 | Root:=p; 280 | p^.Left:=CurPtr; 281 | p^.Right:=Nil; 282 | p^.Owner:=Nil; 283 | end 284 | else 285 | begin 286 | if isPrior(s,q^.Name) then 287 | begin 288 | While (q<>Nil) and isPrior(s,q^.Name) do q:=q^.Owner; 289 | CurPtr:=q; 290 | if q=Nil then CurPtr:=Root; 291 | GoTo Loop; 292 | end 293 | else 294 | begin 295 | p^.Owner:=q; 296 | p^.Left:=q^.Right; 297 | p^.Right:=Nil; 298 | q^.Right:=p; 299 | end 300 | end; 301 | LastOp:=p; 302 | CurPtr:=p; 303 | end; 304 | 305 | begin 306 | if ErrOcc then Exit; 307 | LastOp:=Nil;Root:=Nil;CurPtr:=Nil;GetFormulaTree:=Nil; 308 | Count:=1; 309 | repeat 310 | GetToken(St,Count,S,Tp); 311 | {Inc(Count,Byte(s[0]));} 312 | if not ErrOcc then 313 | if Tp=opSign then NewSign(S) else NewOperand(S); 314 | GetFormulaTree:=Root; 315 | until (Count>Byte(St[0])) or ErrOcc; 316 | if (Root=Nil) and not ErrOcc then GetFormulaTree:=CurPtr; 317 | 318 | end; 319 | 320 | function GetFormula(const S: String): FPtr; 321 | var A1, A2, I: Integer; 322 | begin 323 | CellOccured := False; GetFormula := nil; 324 | ErrOcc := False; A1 := 0; A2 := 0; 325 | For I := 1 to Length(S) do 326 | begin 327 | if S[I] = '(' then Inc(A1) else 328 | if S[I] = ')' then Dec(A1); 329 | if A1 < 0 then 330 | begin ErrOcc := True; Exit end; 331 | end; 332 | if A1 > 0 then 333 | begin ErrOcc := True; Exit end; 334 | GetFormula := GetFormulaTree(S); 335 | end; 336 | 337 | 338 | end. -------------------------------------------------------------------------------- /RCP.INI: -------------------------------------------------------------------------------- 1 | [Controls] 2 | ; Languages to compile, used as section names 3 | Languages=Russian English 4 | ;Languages=English 5 | ;Languages=Russian English Xtree 6 | ; PAS-files to get constants from 7 | Indexes=DNHELP.PAS COMMANDS.PAS 8 | 9 | [Parser] 10 | ; Specify prefixes of constants which are interest for us 11 | const=cm cd 12 | const=hs 13 | const=hc 14 | const=kb 15 | const=of 16 | ; Specify enums for same reason 17 | type=TStrIdx 18 | type=TDlgIdx 19 | 20 | ; Each language section should contain four filenames: 21 | ; source/destination for LNG/DLG files 22 | ; If you haven't LNG file sources set ProcessDLs to "No" 23 | ; In this case LngOutput should point to compiled .LNG 24 | 25 | [English] 26 | ProcessDLs=Yes 27 | LngInput=RESOURCE\ENGLISH\DN.DNL 28 | DlgInput=RESOURCE\ENGLISH\DN.DNR 29 | LngOutput=EXE\DN.LNG 30 | DlgOutput=EXE\DN.DLG 31 | 32 | [Russian] 33 | ProcessDLs=Yes 34 | LngInput=RESOURCE\RUSSIAN\DN.DNL 35 | DlgInput=RESOURCE\RUSSIAN\DN.DNR 36 | LngOutput=EXE\DNRUS.LNG 37 | DlgOutput=EXE\DNRUS.DLG 38 | 39 | ;[XTree] 40 | ;ProcessDLs=Yes 41 | ;LngInput=RESOURCE\XTree\DN.DNL 42 | ;DlgInput=RESOURCE\XTree\DN.DNR 43 | ;LngOutput=EXE\DNXTG.LNG 44 | ;DlgOutput=EXE\DNXTG.DLG 45 | -------------------------------------------------------------------------------- /RCP.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/RCP.PAS -------------------------------------------------------------------------------- /README.TXT: -------------------------------------------------------------------------------- 1 | Dos Navigator 1.51 2 | Copyright (c) 1991-99 RIT Research Labs. 3 | All rights reserved. 4 | 5 | This directory contains source code of Dos Navigator. 6 | 7 | Tools required to compile Dos Navigator are Borland Pascal 7.0, TASM & TLINK. 8 | 9 | To build Dos Navigator, run build.bat. 10 | 11 | The current version of Dos Navigator is available at http://www.ritlabs.com/dn/ 12 | 13 | This product is free for commercial and non-commercial use as long as 14 | the following conditions are aheared to. 15 | 16 | Copyright remains RIT Research Labs, and as such any Copyright notices 17 | in the code are not to be removed. If this package is used in a 18 | product, RIT Research Labs should be given attribution as the RIT Research 19 | Labs of the parts of the library used. This can be in the form of a textual 20 | message at program startup or in documentation (online or textual) 21 | provided with the package. 22 | 23 | Redistribution and use in source and binary forms, with or without 24 | modification, are permitted provided that the following conditions are 25 | met: 26 | 27 | 1. Redistributions of source code must retain the copyright 28 | notice, this list of conditions and the following disclaimer. 29 | 2. Redistributions in binary form must reproduce the above copyright 30 | notice, this list of conditions and the following disclaimer in the 31 | documentation and/or other materials provided with the distribution. 32 | 3. All advertising materials mentioning features or use of this software 33 | must display the following acknowledgement: 34 | "Based on Dos Navigator by RIT Research Labs." 35 | 36 | THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 37 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 38 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 39 | DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 40 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 41 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 42 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 43 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 44 | IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 45 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 46 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 47 | 48 | -------------------------------------------------------------------------------- /REANIMAT.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/REANIMAT.PAS -------------------------------------------------------------------------------- /RESOURCE/ENGLISH/DN.DNL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/RESOURCE/ENGLISH/DN.DNL -------------------------------------------------------------------------------- /RESOURCE/ENGLISH/DN.DNR: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/RESOURCE/ENGLISH/DN.DNR -------------------------------------------------------------------------------- /RESOURCE/ENGLISH/DNHELP.HTX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/RESOURCE/ENGLISH/DNHELP.HTX -------------------------------------------------------------------------------- /RESOURCE/RUSSIAN/DN.DNL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/RESOURCE/RUSSIAN/DN.DNL -------------------------------------------------------------------------------- /RESOURCE/RUSSIAN/DN.DNR: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/RESOURCE/RUSSIAN/DN.DNR -------------------------------------------------------------------------------- /RESOURCE/RUSSIAN/DNHELP.HTX: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/RESOURCE/RUSSIAN/DNHELP.HTX -------------------------------------------------------------------------------- /RSR.BAT: -------------------------------------------------------------------------------- 1 | call builddn resource nobpc -------------------------------------------------------------------------------- /RSTRINGS.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/RSTRINGS.PAS -------------------------------------------------------------------------------- /RUNCMD.INC: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on TinyWeb Server by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | procedure SaveDsk; 48 | begin 49 | if StartupData.Unload and osuAutosave = 0 then 50 | PDNApplication(Application)^.SaveDesktop(SwpDir+'DN'+ItoS(DNNumber)+'.SWP'); 51 | end; 52 | 53 | procedure ExecString(S: Str128); 54 | var F1: Text; 55 | I: Integer; 56 | M: String; 57 | DT: DateTime; 58 | label 1; 59 | begin 60 | DelRight(S); 61 | if not Chk4Dos and (Pos('||', S) <> 0) then 62 | begin 63 | Assign(F1, SwpDir+'$DN'+ItoS(DNNumber)+'$.BAT'); ClrIO; 64 | Rewrite(F1); if IOResult <> 0 then begin Close(F1); Exit; end; 65 | I := 0; 66 | repeat 67 | I := Pos('||', S); 68 | if I = 0 then I := Length(S)+1; 69 | WriteLn(F1, MakeCMDParams(Copy(S, 1, I-1), 70 | CnvString(CurFileActive), 71 | CnvString(CurFilePassive))); 72 | Delete(S, 1, I+1); 73 | until (S = ''); 74 | Close(F1); 75 | S := SwpDir+'$DN'+ItoS(DNNumber)+'$.BAT '; 76 | end else S := MakeCMDParams(S, CnvString(CurFileActive), CnvString(CurFilePassive)); 77 | 1: 78 | S := ' '+S+#13; Dec(S[0]); 79 | if (LoaderSeg <> 0) then Move(S, mem[LoaderSeg:CommandOfs], Length(S)+2); 80 | if (SystemData.Options and ossFastExec <> 0) or RunFrom2E then asm 81 | mov ax, 9903h 82 | mov cl, 1 83 | int 2Fh 84 | end; 85 | if TimerMark then DDTimer := Get100s 86 | else DDTimer := 0; 87 | asm 88 | mov ax, 9904h 89 | mov dx, word ptr DDTimer 90 | mov cx, word ptr DDTimer+2 91 | int 2Fh 92 | mov ax, 9902h 93 | mov cl, 1 94 | int 2Fh 95 | end; 96 | Halt(1); 97 | end; 98 | 99 | function SearchExt(Name: NameStr; Ext: ExtStr; var HS: String): Boolean; 100 | var 101 | AllRight : Boolean; 102 | f : PTextReader; 103 | f1 : Text; 104 | s,s1 : String; 105 | BgCh,EnCh: Char; 106 | EF, First: Boolean; 107 | I : Integer; 108 | Local: Boolean; 109 | label RL; 110 | 111 | function transl(var s: string): string; 112 | var i: integer; 113 | b: ExtStr; 114 | r: NameStr; 115 | ad: string; 116 | begin 117 | ad := ActiveDir; if ad[Length(ad)]<>'\' then ad := ad + '\'; 118 | B := Ext; LowStr(B); Insert('.', B, 1); 119 | R := Name; DelRight(R); LowStr(R); 120 | Replace('!!', #0, S); 121 | Replace('.!', B, S); 122 | Replace('!\', LowStrg(ad), S); 123 | Replace('!/', Copy(LowStrg(ad), 1, Length(ad)-1), S); 124 | Replace('!', R, S); 125 | Replace(#0, '!!', S); 126 | Transl:=S; 127 | end; 128 | 129 | function InFilter(const S: String): Boolean; 130 | var I: Integer; 131 | M: String[3]; 132 | begin 133 | InFilter := On; 134 | repeat 135 | I := PosChar(';', S1); 136 | if I = 0 then I := PosChar(',',S1); 137 | if I = 0 then I := Length(S1)+1; 138 | M := Copy(S1, 1, I-1); Delete(S1, 1, I); 139 | if M = '.' then M := ''; 140 | if InMask(S, Norm12('*.'+M)) then Exit; 141 | until (S1 = ''); 142 | InFilter := Off; 143 | end; 144 | 145 | 146 | begin 147 | First := True; 148 | GetDir(0, ActiveDir); 149 | SearchExt:=False; 150 | Local := On; 151 | f := New(PTextReader, Init('DN.EXT')); 152 | if f=nil then 153 | begin 154 | RL: 155 | Local := Off; 156 | f := New(PTextReader, Init(SourceDir+'DN.EXT')); 157 | end; 158 | if f=nil then Exit; AllRight:=False; 159 | BgCh:='{';EnCh:='}'; Abort := Off; EF:=Off; 160 | if PShootState and 8 > 0 then begin BgCh:='[';EnCh:=']';end else 161 | if PShootState and 3 > 0 then begin BgCh:='(';EnCh:=')';end; 162 | While (not f^.EOF) and (not AllRight) do begin 163 | S := f^.GetStr; 164 | if S[1] <> ' ' then 165 | begin 166 | I := PosChar(BgCh, S); if I = 0 then Continue; 167 | S1 := Copy(S, 1, I-1); UpStr(S1); 168 | if InFilter(Name+'.'+Ext) then 169 | begin 170 | Assign(f1, SwpDir+'$DN'+ItoS(DNNumber)+'$.BAT'); ClrIO; 171 | Rewrite(F1); if IOResult <> 0 then begin Dispose(F, Done); Exit; end; 172 | System.Delete(S, 1, PosChar(BgCh, S)); 173 | repeat 174 | Replace(']]', #0, S); Replace('))', #1, S); Replace('}}', #2, S); 175 | DelLeft(S); DelRight(S); 176 | if S[Length(S)] = EnCh then 177 | begin Dec(S[0]); EF := On; if S <> '' then 178 | begin S := Transl(S); HS := S; 179 | Replace(#0, ']', S); Replace(#1, ')', S); Replace(#2, '}', S); 180 | WriteLn(F1, S); Break 181 | end; 182 | end; 183 | if S <> '' then 184 | begin 185 | if (BgCh <> '[') then S := Transl(S); 186 | if First and (BgCh <> '[') then HS := S; 187 | Replace(#0, ']', S); Replace(#1, ')', S); Replace(#2, '}', S); 188 | WriteLn(F1, S); 189 | First := False; 190 | end; 191 | if (F^.EOF) then Break; 192 | if not EF then S := F^.GetStr; 193 | until (IOResult <> 0) or Abort or EF; 194 | Write(F1, '@echo off'); 195 | Close(F1); 196 | AllRight := On; 197 | end; 198 | end; 199 | end; 200 | Dispose(F, Done); 201 | if not EF and not Abort and Local then Goto RL; 202 | if EF and (BgCh = '[') then 203 | begin 204 | EraseFile( SwpDir+'$dn'+ItoS(DNNumber)+'$.mnu' ); 205 | Rename(F1, SwpDir+'$dn'+ItoS(DNNumber)+'$.mnu'); 206 | EF := ExecUserMenu(Off); 207 | if not EF then Erase(F1); 208 | end; 209 | SearchExt:=not Abort and EF; 210 | end; 211 | 212 | function ExecExtFile(const ExtFName, FName: PathStr; SIdx: TStrIdx): Boolean; 213 | var F: PTextReader; 214 | S: String; 215 | Mask, Nm: String[12]; 216 | Dr: PathStr; 217 | Xt: ExtStr; 218 | Event: TEvent; 219 | I,J: Integer; 220 | PP: PView; 221 | Success, CD: Boolean; 222 | Local: Boolean; 223 | label 1,1111, RepeatLocal; 224 | begin 225 | ExecExtFile := Off; 226 | FileMode := $40; 227 | Local := On; 228 | 229 | F := New(PTextReader, Init(ExtFName)); 230 | 231 | if F = nil then 232 | begin 233 | RepeatLocal: 234 | Local := Off; 235 | F := New(PTextReader, Init(SourceDir+ExtFName)); 236 | end; 237 | if F = nil then Exit; 238 | FSplit(FExpand(FName), Dr, Nm, Xt); 239 | Nm := Norm12(Nm+Xt); 240 | While not F^.EOF do 241 | begin 242 | S := F^.GetStr; 243 | DelLeft(S); 244 | if (S <> '') and (S[1] <> ';') then 245 | begin 246 | repeat 247 | J := PosChar(':', S); if J = 0 then Goto 1; 248 | I := PosChar(',', S); 249 | if (I <> 0) and (I < J) then 250 | begin 251 | Mask := Norm12('*.'+Copy(S,1,I-1)); 252 | if InMask(Nm, Mask) then 253 | begin 254 | Delete(S, 1, J); Goto 1111; 255 | end else Delete(S, 1, I); 256 | end else 257 | begin 258 | Mask := Norm12('*.'+Copy(S,1,J-1)); 259 | Delete(S, 1, J); 260 | if InMask(Nm, Mask) then Goto 1111; 261 | Break; 262 | end; 263 | until S=''; 264 | end; 265 | 1: 266 | end; 267 | ExecExtFile := Off; 268 | Dispose(F, Done); 269 | if Local then Goto RepeatLocal; 270 | Exit; 271 | 1111: 272 | Dispose(F,Done); 273 | if not Application^.Valid(cmQuit) then Exit; 274 | Replace('!!', #0, S); 275 | Success := PosChar('!', S) = 0; 276 | CD := Off; 277 | FSplit(FExpand(FName), Dr, Nm, Xt); 278 | if not Success then 279 | begin 280 | Replace('!', #0, Dr); 281 | Replace('!', #0, Nm); 282 | Replace('!', #0, Xt); 283 | CD := not Replace('!\', Copy(Dr, 3, 255), S); 284 | Replace('!:', Copy(Dr, 1, 2), S); 285 | Replace('.!', Xt, S); 286 | Replace('!', Nm, S); 287 | end else S := S + ' ' + Dr+Nm+Xt; 288 | Replace(#0, '!', S); 289 | ClrIO; 290 | if CD then 291 | begin 292 | GetDir(0, DirToChange); 293 | ChDir(Dr); 294 | end else DirToChange := ''; 295 | if Abort then Exit; 296 | if S[1] = '*' then DelFC(S); 297 | begin 298 | PP := _WriteMsg(' '+GetString(SIdx)); 299 | InsertUserSaver(Off); 300 | SaveDsk; 301 | Application^.Done; 302 | ExecString(S); 303 | end; 304 | end; 305 | 306 | procedure ExecFile(Name: PathStr); 307 | var S, M: String; 308 | 309 | procedure PutHistory(B: Boolean); 310 | begin 311 | if M = '' then Exit; 312 | CmdLine.Str := M; 313 | CmdLine.StrModified := On; 314 | CmdDisabled := B; 315 | Message(CommandLine, evKeyDown, kbDown, nil); 316 | Message(CommandLine, evKeyDown, kbUp, nil); 317 | end; 318 | 319 | procedure RunCommand(B: Boolean); 320 | var ST: SessionType; 321 | begin 322 | if (PCommandLine(CommandLine)^.LineType in [ltOS2Window,ltOS2FullScreen]) then 323 | begin 324 | if PCommandLine(CommandLine)^.LineType = ltOS2FullScreen then ST := stOS2FullScreen 325 | else ST := stOS2Windowed; 326 | RunOS2Command(M, Off, ST); 327 | CmdLine.StrModified := On; 328 | Message(CommandLine, evKeyDown, kbDown, nil); 329 | Exit; 330 | end; 331 | SaveDsk; 332 | Application^.Done; 333 | if B then begin WriteLn(#13#10, ActiveDir+'>', M); M := M + #13 end; 334 | ExecString(M); 335 | end; 336 | 337 | begin 338 | S := LowStrg(Norm12(Name)); 339 | FreeStr := ''; 340 | M := ''; 341 | if (ShiftState and (3 or kbAltShift) <> 0) or 342 | (Pos(#0+Copy(S, 10, 3)+#0, Executables) = 0) then 343 | begin 344 | if SearchExt(Copy(S, 1, 8), Copy(S, 10, 3), M) then 345 | begin 346 | PutHistory(On); 347 | M := SwpDir+'$DN'+ItoS(DNNumber)+'$.BAT ' + FreeStr; 348 | RunCommand(Off); 349 | end else Exit; 350 | end; 351 | M := LowStrg(MakeFileName(S)); 352 | PutHistory(Off); 353 | M := Name; 354 | RunCommand(On); 355 | end; -------------------------------------------------------------------------------- /SETUPS.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/SETUPS.PAS -------------------------------------------------------------------------------- /STARSKY.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/STARSKY.PAS -------------------------------------------------------------------------------- /STARTUP.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/STARTUP.PAS -------------------------------------------------------------------------------- /STDEFINE.INC: -------------------------------------------------------------------------------- 1 | {.$DEFINE POTEMKIN} 2 | 3 | {$DEFINE UUENCODE} 4 | {$DEFINE UUDECODE} 5 | {.$DEFINE Modem} 6 | {$DEFINE SpreadSheet} 7 | {$DEFINE DiskEdit} 8 | {$DEFINE DiskFormat} 9 | {$DEFINE DBView} 10 | {$DEFINE PrintManager} 11 | {$DEFINE Game} 12 | {$DEFINE CdPlayer} 13 | {.$DEFINE Demo} 14 | 15 | {.$DEFINE LITE} 16 | 17 | {$IFDEF LITE} 18 | {$UNDEF Modem} 19 | {$UNDEF SpreadSheet} 20 | {$UNDEF DiskEdit} 21 | {$UNDEF DiskFormat} 22 | {$UNDEF DBView} 23 | {$UNDEF PrintManager} 24 | {$UNDEF Game} 25 | {$ENDIF} 26 | 27 | { Only TPW uses "WObjects"; BP 7 calls the same unit "Objects" } 28 | {$ifdef windows} 29 | {$ifndef ver70} 30 | {$define wobjects} 31 | {$endif} 32 | {$endif} -------------------------------------------------------------------------------- /SWE.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/SWE.PAS -------------------------------------------------------------------------------- /TETRIS.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/TETRIS.PAS -------------------------------------------------------------------------------- /TREE.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/TREE.PAS -------------------------------------------------------------------------------- /TVHC.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/TVHC.PAS -------------------------------------------------------------------------------- /UNIWIN.PAS: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on TinyWeb Server by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | unit UniWin; 48 | 49 | interface 50 | uses Views, Drivers, Objects; 51 | 52 | type 53 | { TEditWindow } 54 | 55 | PUniWindow = ^TUniWindow; 56 | TUniWindow = object(TWindow) 57 | function GetPalette : PPalette;virtual; 58 | function MakeScrollBar(AOptions: Word): PScrollBar; 59 | procedure InitFrame;virtual; 60 | function ReactOnCmd: Boolean; virtual; 61 | end; 62 | 63 | { TEditScrollBar } 64 | PEditScrollBar = ^TEditScrollBar; 65 | TEditScrollBar = object(TScrollBar) 66 | function GetPalette : PPalette;virtual; 67 | end; 68 | 69 | PEditFrame = ^TEditFrame; 70 | TEditFrame = object(TFrame) 71 | function GetPalette : PPalette;virtual; 72 | end; 73 | 74 | const 75 | CUniWindow = #70#64#65#66#67#68#69#71#72#73#74#75#76#77#78#164#182#183+ 76 | #184#185#189#190#191; 77 | 78 | implementation 79 | 80 | function TUniWindow.GetPalette; 81 | const p : String[Length(CUniWindow)] = CUniWindow; 82 | begin 83 | GetPalette:=@P; 84 | end; 85 | 86 | function TEditFrame.GetPalette; 87 | const p : String[9] = #1#1#8#9#10#10#10#9#15; 88 | begin 89 | GetPalette:=@P; 90 | end; 91 | 92 | function TEditScrollBar.GetPalette; 93 | const p : String[3] = #11#12#12; 94 | begin 95 | GetPalette:=@P; 96 | end; 97 | 98 | procedure TUniWindow.InitFrame; 99 | var R : TRect; 100 | begin 101 | R.Assign(0,0,Size.X,Size.Y); 102 | Frame:=New(PEditFrame,Init(R)); 103 | end; 104 | 105 | function TUniWindow.MakeScrollBar; 106 | var P: PEditScrollBar; 107 | R: TRect; 108 | begin 109 | GetExtent(R); 110 | if AOptions and sbVertical<>0 111 | then 112 | begin 113 | Inc(R.A.Y); 114 | Dec(R.B.Y); 115 | R.A.X:=R.B.X-1; 116 | end 117 | else 118 | begin 119 | Inc(R.A.X,24); 120 | Dec(R.B.X,2); 121 | R.A.Y:=R.B.Y-1; 122 | end; 123 | New(p,Init(R)); 124 | if AOptions and sbVertical=0 then p^.GrowMode:=gfGrowLoY+gfGrowHiY+gfGrowHiX 125 | else {p^.GrowMode:=gfGrowHiY+gfGrowHiX}; 126 | p^.Options:=p^.Options or ofPostProcess; 127 | Insert(P); 128 | MakeScrollBar:=p; 129 | end; 130 | 131 | function TUniWindow.ReactOnCmd; begin ReactOnCmd := True end; 132 | 133 | end. -------------------------------------------------------------------------------- /UUCODE.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/UUCODE.PAS -------------------------------------------------------------------------------- /UUE2INC.ASM: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/UUE2INC.ASM -------------------------------------------------------------------------------- /VERSION.INC: -------------------------------------------------------------------------------- 1 | Const 2 | VersionName ='1.51'; 3 | VersionDate ='April 19, 1999'; 4 | VersionWord = $0133; 5 | -------------------------------------------------------------------------------- /VERSION.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/VERSION.PAS -------------------------------------------------------------------------------- /VGA33.ASM: -------------------------------------------------------------------------------- 1 | 2 | .model tiny 3 | .code 4 | outb macro v1,v2 5 | mov al,v1 6 | out dx,al 7 | mov al,v2 8 | inc dx 9 | out dx,al 10 | dec dx 11 | endm 12 | 13 | outv macro v 14 | mov al,v 15 | out dx,al 16 | endm 17 | 18 | org 100h 19 | b: cli 20 | mov dx,3C4h 21 | outb 0,1 22 | 23 | mov dx,3D4h 24 | outv 23 25 | inc dx 26 | in al,dx 27 | and al,127 28 | out dx,al 29 | dec dx 30 | 31 | outv 17 32 | inc dx 33 | in al,dx 34 | and al,127 35 | out dx,al 36 | 37 | mov dx,3CCh 38 | in al,dx 39 | or al,192 40 | mov dx,3C2h 41 | out dx,al 42 | 43 | mov dx,3D4h 44 | 45 | outb 6,11 46 | outb 7,62 47 | outb 9,79 48 | outb 16,234 49 | outb 17,140 50 | outb 18,223 51 | outb 21,231 52 | outb 22,4 53 | 54 | outv 17 55 | inc dx 56 | in al,dx 57 | or al,128 58 | out dx,al 59 | dec dx 60 | 61 | outv 23 62 | inc dx 63 | in al,dx 64 | or al,128 65 | out dx,al 66 | mov dx,3C4h 67 | outb 0,3 68 | 69 | sti 70 | mov ax,40h 71 | mov ds,ax 72 | mov byte ptr ds:[84h],29 73 | retn 74 | 75 | end b 76 | 77 | -------------------------------------------------------------------------------- /VIEWS.PAS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maximmasiutin/Dos-Navigator/b268678fad8a9ccb3fd6a9463e1e341ac73985ec/VIEWS.PAS -------------------------------------------------------------------------------- /WINCLP.PAS: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on TinyWeb Server by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | Unit WinClp ; 48 | 49 | interface 50 | 51 | Uses Objects , Advance ; 52 | 53 | Function SetWinClip( PC : PLineCollection ):boolean; 54 | Function GetWinClip( Var PC : PLineCollection ):boolean; 55 | Function GetWinClipSize : boolean ; 56 | procedure SyncClipIn; 57 | procedure SyncClipOut; 58 | 59 | Implementation 60 | uses MicroEd; 61 | 62 | function MaxAvail: LongInt; 63 | begin 64 | MaxAvail := MemAdjust(System.MaxAvail); 65 | end; 66 | 67 | procedure SyncClipIn; 68 | begin 69 | if Clipboard <> nil then 70 | SetWinClip(PLineCollection(Clipboard)); 71 | end; 72 | 73 | 74 | procedure SyncClipOut; 75 | begin 76 | GetWinClip(PLineCollection(Clipboard)); 77 | end; 78 | 79 | 80 | Function OpenClip : boolean ; assembler ; 81 | asm mov ax,1701h 82 | int 2fh 83 | or ax,ax 84 | jz @@1 85 | mov ax,1 86 | @@1: end; 87 | 88 | Function CloseClip : boolean ; assembler ; 89 | asm mov ax,1708h 90 | int 2fh 91 | or ax,ax 92 | jz @@1 93 | mov ax,1 94 | @@1: end; 95 | 96 | Function SetClip(var Buf; Size : word ) : boolean ; assembler ; 97 | asm 98 | les bx,Buf 99 | mov cx,size 100 | sub si,si 101 | mov dx, 7 { CF_OEMTEXT } 102 | mov ax,1703h 103 | int 2fh 104 | or ax,ax 105 | jz @@1 106 | mov ax,1 107 | @@1: end; 108 | 109 | Function GetClipSize : longint ; assembler ; 110 | asm 111 | mov dx, 7 { CF_OEMTEXT } 112 | mov ax,1704h 113 | int 2fh 114 | end; 115 | Function EmptyClip : boolean ; assembler ; 116 | asm 117 | mov ax,1702h 118 | int 2fh 119 | or ax,ax 120 | jz @@1 121 | mov ax,1 122 | @@1: end; 123 | Function CompactClip( Size : longint ) : longint ; assembler ; 124 | asm 125 | mov cx,Size.word 126 | mov si,[Size+2].word 127 | mov ax,1709h 128 | int 2fh 129 | end; 130 | Function GetClip(var Buf ) : boolean ; assembler ; 131 | asm 132 | les bx,Buf 133 | mov dx, 7 { CF_OEMTEXT } 134 | mov ax,1705h 135 | int 2fh 136 | or ax,ax 137 | jz @@1 138 | mov ax,1 139 | @@1: end; 140 | 141 | Type 142 | DA = array [0..$FFF0] of byte ; 143 | pDA = ^DA ; 144 | 145 | Function SetWinClip( PC : PLineCollection ):boolean; 146 | var Size : longint ; 147 | Buf : PDA; 148 | BufPos : Word ; 149 | TmStr : String ; 150 | Function CopyLine( Line : PString ):boolean; far; 151 | begin 152 | CopyLine := False ; 153 | TmStr := CnvString(Line) + #13#10 ; 154 | if BufPos + Length(TmStr) > Size then 155 | begin 156 | CopyLine := True ; 157 | Exit; 158 | end; 159 | Move(TmStr[1],Buf^[BufPos],Length(TmStr)); 160 | inc(BufPos,Length(TmStr)); 161 | end; 162 | begin 163 | SetWinClip := False ; 164 | if PC=nil then Exit; 165 | if PC^.Count=0 then Exit; 166 | if not OpenClip then Exit; 167 | if not EmptyClip then begin CloseClip; Exit; end; 168 | Size := $FFF0; 169 | if (Maxavail < Size ) then Size := (Maxavail - $FF0); 170 | GetMem(Buf,Size); 171 | BufPos := 0 ; 172 | PC^.FirstThat(@CopyLine); 173 | if BufPos = 0 then begin FreeMem(Buf,Size);CloseClip;Exit; end; 174 | if ( CompactClip( BufPos ) >= BufPos ) then 175 | SetWinClip := SetClip( Buf^ , BufPos ); 176 | FreeMem(Buf,Size); 177 | CloseClip; 178 | end; 179 | 180 | 181 | Function GetWinClip( Var PC : PLineCollection ):boolean; 182 | var 183 | Size : longint ; 184 | Buf : PDA; 185 | BufPos,SZ : Word ; 186 | TmStr : String ; 187 | begin 188 | GetWinClip := False; 189 | if not OpenClip then Exit; 190 | Size := GetClipSize ; 191 | if Size > $EF00 then begin CloseClip; Exit; end; 192 | if (Size + $800) > (MaxAvail div 2) then begin CloseClip; Exit; end; 193 | GetMem(Buf,Size); 194 | if not GetClip(Buf^) then begin FreeMem(Buf,Size); CloseClip; Exit; end; 195 | if PC = nil then New(PC,Init(10,10)); 196 | PC^.FreeAll; 197 | BufPos := 0 ; SZ := Size; 198 | TmStr := ''; 199 | while BufPos < SZ do 200 | begin 201 | case Buf^[BufPos] of 202 | 10: begin 203 | PC^.Insert(NewStr(TmStr)); 204 | TmStr:=''; 205 | end; 206 | {13: if Buf^[BufPos+1]=10 then} 207 | 13,0:; 208 | else 209 | begin 210 | if Length(TmStr)<200 then AddStr(TmStr,char(Buf^[BufPos])); 211 | end; 212 | end; { case } 213 | inc(BufPos); 214 | end; 215 | if TmStr<>'' then PC^.Insert(NewStr(TmStr)); 216 | FreeMem(Buf,Size); 217 | CloseClip; 218 | GetWinClip := PC^.Count>0; 219 | end; 220 | 221 | Function GetWinClipSize : boolean ; 222 | var SZ : longint ; 223 | begin 224 | GetWinClipSize := false ; 225 | if not OpenClip then Exit; 226 | SZ := GetClipSize ; 227 | GetWinClipSize := ((SZ<$EF00) and (SZ>0)); 228 | CloseClip ; 229 | end; 230 | 231 | end. -------------------------------------------------------------------------------- /XDBLWND.PAS: -------------------------------------------------------------------------------- 1 | {///////////////////////////////////////////////////////////////////////// 2 | // 3 | // Dos Navigator Version 1.51 Copyright (C) 1991-99 RIT Research Labs 4 | // 5 | // This programs is free for commercial and non-commercial use as long as 6 | // the following conditions are aheared to. 7 | // 8 | // Copyright remains RIT Research Labs, and as such any Copyright notices 9 | // in the code are not to be removed. If this package is used in a 10 | // product, RIT Research Labs should be given attribution as the RIT Research 11 | // Labs of the parts of the library used. This can be in the form of a textual 12 | // message at program startup or in documentation (online or textual) 13 | // provided with the package. 14 | // 15 | // Redistribution and use in source and binary forms, with or without 16 | // modification, are permitted provided that the following conditions are 17 | // met: 18 | // 19 | // 1. Redistributions of source code must retain the copyright 20 | // notice, this list of conditions and the following disclaimer. 21 | // 2. Redistributions in binary form must reproduce the above copyright 22 | // notice, this list of conditions and the following disclaimer in the 23 | // documentation and/or other materials provided with the distribution. 24 | // 3. All advertising materials mentioning features or use of this software 25 | // must display the following acknowledgement: 26 | // "Based on TinyWeb Server by RIT Research Labs." 27 | // 28 | // THIS SOFTWARE IS PROVIDED BY RIT RESEARCH LABS "AS IS" AND ANY EXPRESS 29 | // OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 30 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 31 | // DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 32 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 33 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 34 | // GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 35 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 36 | // IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 37 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 38 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | // 40 | // The licence and distribution terms for any publically available 41 | // version or derivative of this code cannot be changed. i.e. this code 42 | // cannot simply be copied and put under another distribution licence 43 | // (including the GNU Public Licence). 44 | // 45 | //////////////////////////////////////////////////////////////////////////} 46 | 47 | unit XDblWnd; 48 | 49 | interface 50 | uses DblWnd, Drivers, Views, Objects, ObjType; 51 | 52 | type 53 | 54 | PXDoubleWindow = ^TXDoubleWindow; 55 | TXDoubleWindow = object(TDoubleWindow) 56 | procedure SetState(AState: Word; Enable: Boolean); virtual; 57 | function GetPalette: PPalette; virtual; 58 | procedure HandleEvent(var Event: TEvent); virtual; 59 | end; 60 | 61 | const 62 | RDoubleWindow: TStreamRec = ( 63 | ObjType: otDoubleWindow; 64 | VmtLink: Ofs(TypeOf(TXDoubleWindow)^); 65 | Load: @TXDoubleWindow.Load; 66 | Store: @TXDoubleWindow.Store); 67 | 68 | 69 | implementation 70 | uses Commands, Advance, DNApp; 71 | 72 | function TXDoubleWindow.GetPalette; 73 | const S: String[Length(CDoubleWindow)] = CDoubleWindow; 74 | begin 75 | GetPalette := @S; 76 | end; 77 | 78 | 79 | procedure TXDoubleWindow.SetState(AState: Word; Enable: Boolean); 80 | var 81 | WindowCommands: TCommandSet; 82 | begin 83 | inherited SetState(AState, Enable); 84 | if (AState and sfDragging <> 0) or 85 | (AState and (sfSelected+sfActive) <> 0) then Separator^.Draw; 86 | if AState = sfSelected then 87 | begin 88 | SetState(sfActive, Enable); 89 | if Enable then EnableCommands(DblWndCommands) 90 | else DisableCommands(DblWndCommands); 91 | end; 92 | end; 93 | 94 | 95 | procedure TXDoubleWindow.HandleEvent; 96 | var CE: Boolean; 97 | LVisible, RVisible, LSelected: Boolean; 98 | EV: TEvent; 99 | begin 100 | RVisible := RightView^.GetState(sfVisible); 101 | LVisible := LeftView^.GetState(sfVisible); 102 | LSelected := LeftView^.GetState(sfSelected); 103 | CE := On; 104 | case Event.What of 105 | evKeyDown: case Event.KeyCode of 106 | {kbCtrlP,} 107 | kbCtrlLeft, 108 | kbCtrlRight, 109 | kbAlt1, kbAlt2, 110 | kbAlt3, kbAlt4, 111 | kbAlt5, kbAlt6, 112 | kbAlt7, kbAlt8, 113 | kbAlt9, kbAlt0, 114 | kbAltLeft, 115 | kbAltRight, 116 | $1A1B, 117 | $1B1D: begin HandleCommand(Event); CE := Off; end; 118 | end; 119 | evBroadcast: case Event.Command of 120 | cmLookForPanels, 121 | cmGetUserParams: begin HandleCommand(Event); CE := Off end; 122 | end; 123 | evCommand: case Event.Command of 124 | cmChangeDirectory: begin 125 | if LSelected then RightView^.HandleEvent(Event) 126 | else LeftView^.HandleEvent(Event); 127 | Exit; 128 | end; 129 | cmChangeTree: if LTree <> nil then LTree^.HandleEvent(Event); 130 | cmRereadInfo: begin 131 | if LeftView <> nil then LeftView^.HandleEvent(Event); 132 | if RightView <> nil then RightView^.HandleEvent(Event); 133 | Exit; 134 | end; 135 | cmCloseLinked, 136 | cmMakeForced, 137 | cmRereadForced, 138 | cmTotalReread, 139 | cmReboundPanel, 140 | cmRereadDir: begin 141 | EV := Event; 142 | LPanel^.HandleEvent(Event); 143 | Event := EV; 144 | RPanel^.HandleEvent(Event); 145 | ClearEvent(Event); 146 | end; 147 | cmPushName, 148 | cmGetDirName: begin 149 | if LType = dtPanel then LeftView^.HandleEvent(Event); 150 | if RType = dtPanel then RightView^.HandleEvent(Event); 151 | Exit 152 | end; 153 | cmGetDirInfo, 154 | cmZoom, 155 | cmGetName, 156 | cmPostHideRight, 157 | cmPostHideLeft, 158 | cmChangeInactive, 159 | cmGetDirName, 160 | cmPanelCompare, 161 | cmDiskInfo, 162 | cmChangeDirectory, 163 | cmLoadViewFile, 164 | cmGLoadViewFile, 165 | cmEnableView, 166 | cmDisableView, 167 | cmPushFullName, 168 | cmPushFirstName, 169 | cmFindTree, 170 | cmRereadTree, 171 | cmHideLeft, 172 | cmHideRight, 173 | cmChangeLeft, 174 | cmChangeRight, 175 | cmDirTree, 176 | cmQuickView, 177 | cmSwapPanels, 178 | cmSwitchOther: begin HandleCommand(Event); CE := Off end; 179 | end; 180 | end; 181 | 182 | if (Event.What <> evNothing) and CE then 183 | inherited HandleEvent(Event); 184 | end; 185 | 186 | 187 | 188 | end. -------------------------------------------------------------------------------- /XMSSTRM.INC: -------------------------------------------------------------------------------- 1 | { This include file is a slightly modified version of XMSSTRM.PAS, by Stefan 2 | Boether, included here with his kind permission. -djm } 3 | 4 | (*****************************************************************************) 5 | (* *) 6 | (* Filename : XMSSTRM.INC *) 7 | (* Autor : Stefan Boether / Compuserve Id : 100023,275 *) 8 | (* System : TURBO 6.00 / MS-DOS 3.2 / Netzwerk *) 9 | (* Aenderung : *) 10 | (* wann was wer *) 11 | (*---------------------------------------------------------------------------*) 12 | (* 22.03.92 Error fixed with NewBlock and UsedBlocks Stefc *) 13 | (* 28.04.92 Size field added, BlockSize made constant DJM *) 14 | (* 15.10.92 Off-by-one bug fixed in Seek method DJM *) 15 | (*****************************************************************************) 16 | (* Beschreibung: Object for an Stream in XMS-Memory *) 17 | (*****************************************************************************) 18 | {Header-End} 19 | 20 | {!!!!!!!!!!!!!!! 21 | program Test; 22 | 23 | uses objects, XmsStrm; 24 | 25 | var T : TXmsStream; 26 | P : PString; 27 | 28 | begin 29 | writeln( xms_MaxAvail, ' ', xms_MemAvail ); 30 | T.Init( 20, 20 ); 31 | T.WriteStr( NewStr( 'Hello' )); 32 | T.WriteStr( NewStr( 'World' )); 33 | T.Seek( 0 ); 34 | P := T.ReadStr; 35 | writeln( P^ ); 36 | P := T.ReadStr; 37 | writeln( P^ ); 38 | T.Done; 39 | end. 40 | 41 | !!!!!!!!!!!!!!!!} 42 | 43 | var xms_IOsts : Byte; 44 | xms_Addr : Pointer; 45 | 46 | const 47 | xms_Initialized : Boolean = False; 48 | { This allows us to avoid a unit initialization section } 49 | 50 | xms_BlockSize = 1024; 51 | 52 | { - Some Xms - Procedures that I need ! -} 53 | 54 | (* /////////////////////////////////////////////////////////////////////// *) 55 | 56 | procedure MoveMem(ToAddress : Pointer; ToHandle : Word; 57 | FromAddress : Pointer; FromHandle : Word; 58 | Size : LongInt); 59 | begin 60 | asm 61 | mov byte ptr xms_IOsts,0 62 | mov ah,$0B 63 | lea si,Size 64 | push ds 65 | pop es 66 | push ss 67 | pop ds 68 | call es:[xms_Addr] 69 | push es 70 | pop ds 71 | or ax,ax 72 | jnz @@1 73 | mov byte ptr xms_IOsts,bl 74 | @@1: 75 | end; 76 | end; 77 | 78 | (* /////////////////////////////////////////////////////////////////////// *) 79 | 80 | function GetByte(Handle : Word; FromAddress : LongInt) : Byte; 81 | var TempBuf : array[0..1] of Byte; 82 | begin 83 | MoveMem(@TempBuf, 0, Pointer(FromAddress and $FFFFFFFE), Handle, 2); 84 | GetByte := TempBuf[FromAddress and $00000001]; 85 | end; 86 | 87 | (* /////////////////////////////////////////////////////////////////////// *) 88 | 89 | procedure SetByte(Handle : Word; ToAddress : LongInt; Value : Byte); 90 | var TempBuf : array[0..1] of Byte; 91 | begin 92 | MoveMem(@TempBuf, 0, Pointer(ToAddress and $FFFFFFFE), Handle, 2); 93 | TempBuf[ToAddress and $00000001] := Value; 94 | MoveMem(Pointer(ToAddress and $FFFFFFFE), Handle, @TempBuf, 0, 2); 95 | end; 96 | 97 | (* /////////////////////////////////////////////////////////////////////// *) 98 | 99 | procedure xms_Init; 100 | begin 101 | if not xms_Initialized then 102 | begin 103 | xms_IOsts := 0; 104 | xms_Addr := nil; 105 | asm 106 | mov ax,$4300 107 | int $2F 108 | cmp al,$80 109 | jne @@1 110 | mov ax,$4310 111 | int $2F 112 | mov word ptr xms_Addr,bx 113 | mov word ptr xms_Addr+2,es 114 | jmp @@2 115 | @@1: 116 | mov byte ptr xms_IOsts,$80 117 | @@2: 118 | end; 119 | if xms_IOsts = 0 then 120 | xms_Initialized := True; 121 | end; 122 | end; 123 | 124 | (* /////////////////////////////////////////////////////////////////////// *) 125 | 126 | function xms_GetMem(KB : Word) : Word; Assembler; 127 | asm 128 | mov xms_IOsts,0 129 | mov ah,$09 130 | mov dx,word ptr KB 131 | call [xms_Addr] 132 | or ax,ax 133 | jz @@1 134 | mov ax,dx 135 | jmp @@2 136 | @@1: 137 | mov byte ptr xms_IOsts,bl 138 | @@2: 139 | end; 140 | 141 | (* /////////////////////////////////////////////////////////////////////// *) 142 | 143 | procedure xms_FreeMem(Handle : Word); 144 | begin 145 | asm 146 | mov xms_IOsts,0 147 | mov ah,$0A 148 | mov dx,word ptr Handle 149 | call [xms_Addr] 150 | or ax,ax 151 | jnz @@1 152 | mov byte ptr xms_IOsts,bl 153 | @@1: 154 | end; 155 | end; 156 | 157 | (* /////////////////////////////////////////////////////////////////////// *) 158 | 159 | procedure xms_ResizeMem(Size, Handle : Word); 160 | begin 161 | asm 162 | mov ah,$0F 163 | mov bx,word ptr Size 164 | mov dx,word ptr Handle 165 | call [xms_Addr] 166 | or ax,ax 167 | jnz @@1 168 | mov byte ptr xms_IOsts,bl 169 | @@1: 170 | end; 171 | end; 172 | 173 | (* /////////////////////////////////////////////////////////////////////// *) 174 | 175 | procedure xms_MoveFrom(Size, Handle : Word; FromAddress : LongInt; 176 | ToAddress : Pointer); 177 | type ByteArr = array[0..MaxInt] of Byte; 178 | BytePtr = ^ByteArr; 179 | begin 180 | if Size = 0 then Exit; 181 | if Odd(FromAddress) then begin 182 | BytePtr(ToAddress)^[0] := GetByte(Handle, FromAddress); 183 | if xms_IOsts <> 0 then Exit; 184 | Dec(Size); 185 | Inc(FromAddress); 186 | Inc(LongInt(ToAddress)); 187 | end; 188 | MoveMem(ToAddress, 0, Pointer(FromAddress), Handle, Size and $FFFE); 189 | if xms_IOsts <> 0 then Exit; 190 | if Odd(Size) 191 | then BytePtr(ToAddress)^[Size-1] := GetByte(Handle, FromAddress+Size-1); 192 | if xms_IOsts <> 0 then Exit; 193 | end; 194 | 195 | (* /////////////////////////////////////////////////////////////////////// *) 196 | 197 | procedure xms_MoveTo(Size, Handle : Word; FromAddress : Pointer; 198 | ToAddress : LongInt); 199 | type ByteArr = array[0..MaxInt] of Byte; 200 | BytePtr = ^ByteArr; 201 | begin 202 | if Size = 0 then Exit; 203 | if Odd(ToAddress) then begin 204 | SetByte(Handle, ToAddress, BytePtr(FromAddress)^[0]); 205 | if xms_IOsts <> 0 then Exit; 206 | Dec(Size); 207 | Inc(LongInt(FromAddress)); 208 | Inc(ToAddress); 209 | end; 210 | MoveMem(Pointer(ToAddress), Handle, FromAddress, 0, Size and $FFFE); 211 | if xms_IOsts <> 0 then Exit; 212 | if Odd(Size) 213 | then SetByte(Handle, ToAddress+Size-1, BytePtr(FromAddress)^[Size-1]); 214 | if xms_IOsts <> 0 then Exit; 215 | end; 216 | 217 | (* /////////////////////////////////////////////////////////////////////// *) 218 | 219 | constructor TXMSStream.Init(MinSize, MaxSize : longint); 220 | var 221 | MinBlocks,MaxBlocks : word; 222 | begin 223 | TStream.Init; 224 | xms_Init; 225 | BlocksUsed := 0; 226 | Size := 0; 227 | Position := 0; 228 | Handle := 0; 229 | MaxSize := MinLong(MaxSize,xms_Maxavail); 230 | MaxBlocks := (MaxSize + xms_Blocksize -1) div xms_Blocksize; 231 | MinBlocks := (MinSize + xms_Blocksize -1) div xms_Blocksize; 232 | if MinBlocks < 1 then 233 | MinBlocks := 1; 234 | if MaxBlocks < MinBlocks then 235 | MaxBlocks := MinBlocks; 236 | if xms_IOsts <> $00 then 237 | Error(stInitError, xms_IOsts) 238 | else 239 | begin 240 | Handle := xms_GetMem(MaxBlocks); 241 | if xms_IOsts <> $00 then 242 | Error(stInitError, xms_IOsts) 243 | else 244 | begin 245 | xms_ResizeMem(MinBlocks,Handle); 246 | BlocksUsed := MinBlocks; 247 | if xms_IOsts <> $00 then 248 | Error(stInitError, xms_IOsts); 249 | end; 250 | end; 251 | end; 252 | 253 | function TXMSStream.GetPos : LongInt; 254 | begin 255 | GetPos := Position; 256 | end; 257 | 258 | function TXMSStream.GetSize : LongInt; 259 | begin 260 | GetSize := Size; 261 | end; 262 | 263 | procedure TXMSStream.Read(var Buf; Count : Word); 264 | begin 265 | if Status = stOK then 266 | if Position+Count > Size then 267 | Error(stReaderror, 0) 268 | else 269 | begin 270 | xms_MoveFrom(Count, Handle, Position, @Buf); 271 | if xms_IOsts <> 0 then 272 | Error(stReaderror, xms_IOsts) 273 | else 274 | Inc(Position, Count); 275 | end; 276 | end; 277 | 278 | procedure TXMSStream.Seek(Pos : LongInt); 279 | begin 280 | if Status = stOK then 281 | if Pos > Size then { 1.4: bug fix } 282 | Error(stReaderror, Pos) 283 | else 284 | Position := Pos; 285 | end; 286 | 287 | procedure TXMSStream.Truncate; 288 | begin 289 | if Status = stOK then 290 | begin 291 | Size := Position; 292 | while (BlocksUsed > (Size div xms_BlockSize+1)) do FreeBlock; 293 | end; 294 | end; 295 | 296 | procedure TXMSStream.Write(var Buf; Count : Word); 297 | begin 298 | while (Status = stOK) 299 | and (Position+Count > LongMul(xms_BlockSize, BlocksUsed)) do 300 | NewBlock; 301 | if Status = stOK then 302 | begin 303 | xms_MoveTo(Count, Handle, @Buf, Position); 304 | if xms_IOsts <> 0 then 305 | Error(stWriteError, xms_IOsts) 306 | else 307 | Inc(Position, Count); 308 | if Position > Size then 309 | Size := Position; 310 | end; 311 | end; 312 | 313 | procedure TXMSStream.NewBlock; 314 | begin 315 | xms_ResizeMem(Succ(BlocksUsed), Handle); 316 | if xms_IOsts <> 0 then 317 | Error(stWriteError, xms_IOsts) 318 | else 319 | Inc(BlocksUsed); 320 | end; 321 | 322 | procedure TXMSStream.FreeBlock; 323 | begin 324 | Dec(BlocksUsed); 325 | xms_ResizeMem(BlocksUsed, Handle); 326 | end; 327 | 328 | function xms_MaxAvail : Longint; 329 | begin 330 | xms_Init; 331 | if xms_IOsts = 0 then 332 | asm 333 | xor bx, bx { for better error checking, since qemm 334 | 6.0 leaves bl unchanged on success } 335 | mov ah,$08 336 | call [xms_Addr] 337 | or bl, bl { extended error checking by MM 22.02.93 } 338 | jz @OK 339 | mov byte ptr xms_IOsts,bl 340 | xor ax,ax 341 | @OK: 342 | mov dx,xms_Blocksize 343 | mul dx 344 | mov word ptr @result,ax 345 | mov word ptr @result[2],dx 346 | end 347 | else 348 | xms_MaxAvail := 0; 349 | end; 350 | 351 | (* /////////////////////////////////////////////////////////////////////// *) 352 | 353 | function xms_MemAvail : Longint; 354 | begin 355 | xms_Init; 356 | if xms_IOsts = 0 then 357 | asm 358 | xor bx, bx { for better error checking, since qemm 359 | 6.0 leaves bl unchanged on success } 360 | mov ah,$08 361 | call [xms_Addr] 362 | or bl, bl { extended error checking by MM 22.02.93 } 363 | jz @OK 364 | mov byte ptr xms_IOsts,bl 365 | xor dx,dx 366 | @OK: 367 | mov ax,dx 368 | mov dx,xms_blocksize 369 | mul dx 370 | mov word ptr @result,ax 371 | mov word ptr @result[2],dx 372 | end 373 | else 374 | xms_MemAvail := 0; 375 | end; 376 | 377 | destructor TXMSStream.Done; 378 | begin 379 | { Seek(0); 380 | Truncate; } 381 | if xms_Initialized and (BlocksUsed > 0) then 382 | xms_FreeMem(Handle); 383 | end; 384 | 385 |  -------------------------------------------------------------------------------- /_MHZ.ASM: -------------------------------------------------------------------------------- 1 | ; 2 | ; CPU Frequency detection 3 | ; 4 | ;****************************************************************************** 5 | ;* HPL, Copyright (C) 1991,92 Sandy Company, ltd. * 6 | ;* All Right Reserved * 7 | ;****************************************************************************** 8 | ;File: _MHZ.ASM 9 | ;Comments: Sorry, it's my style :). 10 | 11 | Ideal 12 | Model Small 13 | CodeSeg 14 | P8086 ; For support Intel 8086 15 | 16 | i8886 EQU 0 ; Intel 8086/88 17 | V2030 EQU 1 ; NEC V20/V30 18 | i188186 EQU 2 ; Intel 80186/188 19 | i80286 EQU 3 ; Intel 80286 20 | i80386 EQU 4 ; Intel 80386/486 21 | 22 | Sprite EQU 08Bh,0C6h,0F7h,0F3h ; Mov Ax,Si / Div Bx 23 | 24 | Public _mhz ; Public name is _mhz 25 | 26 | Proc _mhz Far ; Is far procedure 27 | PushF ; Save Flags 28 | Push Di Si ; Save Di Si 29 | Call Processor ; Call Processor Procedure 30 | Call Speed ; Call Speed Procedure 31 | Pop Si Di ; Restore Si Di 32 | PopF ; Restore Flags 33 | Ret ; Return to Main Programm 34 | 35 | Proc Processor Near ; Checking for processors 36 | ;Jumps ; Directive for Jz,Jb,Ja e.t.c 37 | Push Sp ; Save Sp 38 | Pop Ax ; Restore Sp into Ax 39 | Cmp Sp,Ax ; If Sp!=Ax then Check Lower FPU 40 | Jnz @@Low ; Jump to @@Low 41 | Mov Ax,7000h ; Ax=7000h 42 | Push Ax ; Save Ax into Stack 43 | PopF ; Restore Ax into Flags 44 | Sti ; On Interrupt flag 45 | PushF ; Save Flags 46 | Pop Ax ; Restore Flags Into Ax 47 | And Ax,7000h ; If highers flags has non zero 48 | Jnz @@80386 ; Intel 386/486 is present 49 | Mov Dl,i80286 ; Dl=i80286 50 | Jmp @@Exit ; Jump to @@Exit 51 | @@80386: ; 52 | Mov Dl,i80386 ; Dl=80386/486/SXs 53 | Jmp @@Exit ; Jump to @@Exit 54 | 55 | P8086 ; For Support Intel 8086 56 | @@Low: 57 | Mov Cl,21h ; Test for lowest processors 58 | Mov Ax,-1 ; Ax=0FFFFh 59 | Shl Ax,Cl ; Shift lef on 21h bits 60 | Jz @@NEC ; If Zero jump to@@NEC 61 | Mov Dl,i188186 ; Else Dl=i80188/186 62 | Jmp @@Exit ; Jump to Exit 63 | @@NEC: 64 | Mov Al,40h ; Al=40h 65 | Mul Al ; Ax=Al*Al 66 | Jnz @@8088 ; If Zero then Jump to @@8088 67 | Mov Dl,V2030 ; Else Dl=NECv20/v30 68 | Jmp @@Exit ; Jump to Exit 69 | @@8088: 70 | Mov Dl,i8886 ; Dl=i8088/86 71 | @@Exit: 72 | Mov Al,Dl ; Al=Dl 73 | Xor Ah,Ah ; Ah=0 74 | Ret ; Return 75 | Endp Processor ; End Of Processors Procedure 76 | 77 | Proc SetTimer Near ; SetTimer procedure 78 | In Al,61h ; Get Al from 61th port 79 | And Al,0FCh ; Zero first bit 80 | Out 61h,Al ; Put Al on 61th port 81 | Mov Al,180 ; Al=Command 82 | Out 43h,Al ; Put AL to Command's port 83 | Xor Al,Al ; Al=0 84 | Out 42h,Al ; Put low Time to 42th port 85 | Jmp $+2 ; Wait 86 | Out 42h,Al ; Put high Time 87 | In Al,61h ; Get Al from 61th port 88 | Or Al,1 ; Set First bit 89 | Cli ; Clear Interrupt 90 | Out 61h,Al ; Start Timer 91 | Ret ; Return 92 | EndP SetTimer ; End of procedure 93 | 94 | Proc GetTimer Near ; GetTimer Procedure 95 | In Al,61h ; Get al from 61th port 96 | And Al,0FCh ; Zero first bit (stop timer) 97 | Out 61h,Al ; Put Al into 61th port. 98 | In Al,42h ; Get AL from 42th port 99 | Mov Ah,Al ; Ah=Al 100 | In Al,42h ; Get Al from 42th port 101 | Xchg Al,Ah ; Al=Ah ; Ah=Al 102 | Neg Ax ; Ax=Negative Ax 103 | Sti ; Set interrupt flag 104 | Ret ; Return 105 | EndP GetTimer ; End of GetTimer procedure 106 | 107 | Proc Speed Near ; Speed procedure ( Inp: Al=CPU ) 108 | Push Ax ; Save Ax 109 | Mov Si,07AAAh ; Si=07AAAh (Air value) 110 | Mov Bx,05555h ; Bx=05555h (Air value) 111 | Mov Cx,10 ; Cx=10 112 | Cmp Al,i8886 ; If Al<=i8086 113 | Jbe @@Test ; Jump to Test 114 | Mov Cx,50 ; Cx=50 115 | Cmp Al,V2030 ; If Al<=NECv20/v30 116 | Jbe @@Test ; Jump to Test 117 | Mov Cx,100 ; Cx=100 118 | Cmp Al,i188186 ; If Al<=I80188/186 119 | Jbe @@Test ; Jump to Test 120 | Mov Cx,200 ; Cx=200 121 | @@Test: 122 | Push Cx ; Save Cx 123 | Xor Dx,Dx ; Dx=0 124 | Call SetTimer ; 125 | @@PASS_A: DB 66 DUP(Sprite) ; 126 | Dec Cx ; Cx=Cx-1 127 | Jz @@Passed_A ; If Cx=0 the Jump to @@Passed_A 128 | Jmp @@PASS_A ; Jump to @@Pass_A 129 | @@Passed_A: Call GetTimer ; 130 | Mov Di,Ax ; 131 | Pop Cx ; Restore Cx 132 | Xor Dx,Dx ; Dx=0 133 | Call SetTimer ; 134 | @@PASS_B: DB 2 DUP(Sprite) ; 135 | Dec Cx ; Cx=Cx-1 136 | Jz @@Passed_B ; 137 | Jmp @@PASS_B ; 138 | @@Passed_B: Call GetTimer ; 139 | Sub Di,Ax ; Di=Di-Ax 140 | Pop Bx ; Restore Ax into Bx 141 | Shl Bx,1 ; 142 | Shl Bx,1 ; Bx=Bx*4 143 | ADD Bx,Offset Denom ; Bx=Bx+&Denom 144 | Mov Ax,[Cs:Bx] ; Dx:Ax=Denom 145 | Mov Dx,[Cs:Bx+2] ; 146 | Cmp Di,Dx ; If Di