crt.pp 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1993,97 by Florian Klaempfl,
  5. member of the Free Pascal development team.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {
  13. history:
  14. 29th may 1994: version 1.0
  15. unit is completed
  16. 14th june 1994: version 1.01
  17. the address from which startaddr was read wasn't right; fixed
  18. 18th august 1994: version 1.1
  19. the upper left corner of winmin is now 0,0
  20. 19th september 1994: version 1.11
  21. keypressed handles extended keycodes false; fixed
  22. 27th february 1995: version 1.12
  23. * crtinoutfunc didn't the line wrap in the right way;
  24. fixed
  25. 20th january 1996: version 1.13
  26. - unused variables removed
  27. 21th august 1996: version 1.14
  28. * adapted to newer FPKPascal versions
  29. * make the comments english
  30. 6th november 1996: version 1.49
  31. * some stuff for DPMI adapted
  32. 15th november 1996: version 1.5
  33. * bug in screenrows fixed
  34. 13th november 1997: removed textrec definition, is now included from
  35. textrec.inc
  36. }
  37. unit crt;
  38. {$I os.inc}
  39. interface
  40. uses
  41. go32;
  42. const
  43. { screen modes }
  44. bw40 = 0;
  45. co40 = 1;
  46. bw80 = 2;
  47. co80 = 3;
  48. mono = 7;
  49. font8x8 = 256;
  50. { screen color, fore- and background }
  51. black = 0;
  52. blue = 1;
  53. green = 2;
  54. cyan = 3;
  55. red = 4;
  56. magenta = 5;
  57. brown = 6;
  58. lightgray = 7;
  59. { only foreground }
  60. darkgray = 8;
  61. lightblue = 9;
  62. lightgreen = 10;
  63. lightcyan = 11;
  64. lightred = 12;
  65. lightmagenta = 13;
  66. yellow = 14;
  67. white = 15;
  68. { blink flag }
  69. blink = $80;
  70. const
  71. {$ifndef GO32V2}
  72. directvideo:boolean=true;
  73. {$else GO32V2}
  74. { direct video generates a GPF in DPMI of setcursor }
  75. directvideo:boolean=false;
  76. {$endif GO32V2}
  77. var
  78. { for compatibility }
  79. checkbreak,checkeof,checksnow : boolean;
  80. lastmode : word; { screen mode}
  81. textattr : byte; { current text attribute }
  82. windmin : word; { upper right corner of the CRT window }
  83. windmax : word; { lower left corner of the CRT window }
  84. function keypressed : boolean;
  85. function readkey : char;
  86. procedure gotoxy(x,y : byte);
  87. procedure window(left,top,right,bottom : byte);
  88. procedure clrscr;
  89. procedure textcolor(color : byte);
  90. procedure textbackground(color : byte);
  91. procedure assigncrt(var f : text);
  92. function wherex : byte;
  93. function wherey : byte;
  94. procedure delline;
  95. procedure delline(line : byte);
  96. procedure clreol;
  97. procedure insline;
  98. procedure cursoron;
  99. procedure cursoroff;
  100. procedure cursorbig;
  101. procedure lowvideo;
  102. procedure highvideo;
  103. procedure nosound;
  104. procedure sound(hz : word);
  105. procedure delay(ms : longint);
  106. procedure textmode(mode : integer);
  107. procedure normvideo;
  108. implementation
  109. var
  110. maxcols,maxrows : longint;
  111. { definition of textrec is in textrec.inc}
  112. {$i textrec.inc}
  113. { low level routines }
  114. function getscreenmode : byte;
  115. begin
  116. dosmemget($40,$49,getscreenmode,1);
  117. end;
  118. procedure setscreenmode(mode : byte);
  119. var regs : trealregs;
  120. begin
  121. {$ifdef GO32V2}
  122. regs.realeax:=mode;
  123. realintr($10,regs);
  124. {$else GO32V2}
  125. asm
  126. movb 8(%ebp),%al
  127. xorb %ah,%ah
  128. pushl %ebp
  129. int $0x10
  130. popl %ebp
  131. end;
  132. {$endif GO32V2}
  133. end;
  134. function screenrows : byte;
  135. begin
  136. dosmemget($40,$84,screenrows,1);
  137. { don't forget this: }
  138. inc(screenrows);
  139. end;
  140. function screencols : byte;
  141. begin
  142. dosmemget($40,$4a,screencols,1);
  143. end;
  144. function get_addr(row,col : byte) : word;
  145. begin
  146. get_addr:=((row-1)*maxcols+(col-1))*2;
  147. end;
  148. procedure screensetcursor(row,col : longint);
  149. var
  150. cols : byte;
  151. pos : word;
  152. {$ifdef GO32V2}
  153. regs : trealregs;
  154. {$endif GO32V2}
  155. begin
  156. if directvideo then
  157. begin
  158. { set new position for the BIOS }
  159. dosmemput($40,$51,row,1);
  160. dosmemput($40,$50,col,1);
  161. { calculates screen position }
  162. dosmemget($40,$4a,cols,1);
  163. { FPKPascal calculates with 32 bit }
  164. pos:=row*cols+col;
  165. { direct access to the graphics card registers }
  166. outportb($3d4,$0e);
  167. outportb($3d5,hi(pos));
  168. outportb($3d4,$0f);
  169. outportb($3d5,lo(pos));
  170. end
  171. else
  172. {$ifndef GO32V2}
  173. asm
  174. movb $0x02,%ah
  175. movb $0,%bh
  176. movb row,%dh
  177. movb col,%dl
  178. pushl %ebp
  179. int $0x10
  180. popl %ebp
  181. end;
  182. {$else GO32V2}
  183. regs.realeax:=$0200;
  184. regs.realebx:=0;
  185. regs.realedx:=row*$100+col;
  186. realintr($10,regs);
  187. {$endif GO32V2}
  188. end;
  189. procedure screengetcursor(var row,col : longint);
  190. begin
  191. col:=0;
  192. row:=0;
  193. dosmemget($40,$50,col,1);
  194. dosmemget($40,$51,row,1);
  195. end;
  196. { exported routines }
  197. procedure cursoron;
  198. {$ifdef GO32V2}
  199. var regs : trealregs;
  200. {$endif GO32V2}
  201. begin
  202. {$ifndef GO32V2}
  203. asm
  204. movb $1,%ah
  205. movb $10,%cl
  206. movb $9,%ch
  207. pushl %ebp
  208. int $0x10
  209. popl %ebp
  210. end;
  211. {$else GO32V2}
  212. regs.realeax:=$0100;
  213. regs.realecx:=$90A;
  214. realintr($10,regs);
  215. {$endif GO32V2}
  216. end;
  217. procedure cursoroff;
  218. {$ifdef GO32V2}
  219. var regs : trealregs;
  220. {$endif GO32V2}
  221. begin
  222. {$ifndef GO32V2}
  223. asm
  224. movb $1,%ah
  225. movb $-1,%cl
  226. movb $-1,%ch
  227. pushl %ebp
  228. int $0x10
  229. popl %ebp
  230. end;
  231. {$else GO32V2}
  232. regs.realeax:=$0100;
  233. regs.realecx:=$ffff;
  234. realintr($10,regs);
  235. {$endif GO32V2}
  236. end;
  237. procedure cursorbig;
  238. {$ifdef GO32V2}
  239. var regs : trealregs;
  240. {$endif GO32V2}
  241. begin
  242. {$ifdef GO32V2}
  243. regs.realeax:=$0100;
  244. regs.realecx:=$10A;
  245. realintr($10,regs);
  246. {$else GO32V2}
  247. asm
  248. movb $1,%ah
  249. movb $10,%cl
  250. movb $1,%ch
  251. pushl %ebp
  252. int $0x10
  253. popl %ebp
  254. end;
  255. {$endif GO32V2}
  256. end;
  257. var
  258. is_last : boolean;
  259. last : char;
  260. function readkey : char;
  261. var
  262. char2 : char;
  263. char1 : char;
  264. {$ifdef GO32V2}
  265. var regs : trealregs;
  266. {$endif GO32V2}
  267. begin
  268. if is_last then
  269. begin
  270. is_last:=false;
  271. readkey:=last;
  272. end
  273. else
  274. begin
  275. {$ifdef GO32V2}
  276. regs.realeax:=$0000;
  277. realintr($16,regs);
  278. byte(char1):=regs.realeax and $ff;
  279. byte(char2):=(regs.realeax and $ff00) div $100;
  280. {$else GO32V2}
  281. asm
  282. movb $0,%ah
  283. pushl %ebp
  284. int $0x16
  285. popl %ebp
  286. movw %ax,-2(%ebp)
  287. end;
  288. {$endif GO32V2}
  289. if char1=#0 then
  290. begin
  291. is_last:=true;
  292. last:=char2;
  293. end;
  294. readkey:=char1;
  295. end;
  296. end;
  297. function keypressed : boolean;
  298. {$ifdef GO32V2}
  299. var regs : trealregs;
  300. {$endif GO32V2}
  301. begin
  302. if is_last then
  303. begin
  304. keypressed:=true;
  305. exit;
  306. end
  307. else
  308. {$ifdef GO32V2}
  309. begin
  310. regs.realeax:=$0100;
  311. realintr($16,regs);
  312. if (regs.realflags and zeroflag) = 0 then
  313. keypressed:=true
  314. else keypressed:=false;
  315. end;
  316. {$else GO32V2}
  317. asm
  318. movb $1,%ah
  319. pushl %ebp
  320. int $0x16
  321. popl %ebp
  322. setnz %al
  323. movb %al,__RESULT
  324. end;
  325. {$endif GO32V2}
  326. end;
  327. procedure gotoxy(x,y : byte);
  328. begin
  329. if (x<1) then
  330. x:=1;
  331. if (y<1) then
  332. y:=1;
  333. if y+hi(windmin)-2>=hi(windmax) then
  334. y:=hi(windmax)-hi(windmin)+1;
  335. if x+lo(windmin)-2>=lo(windmax) then
  336. x:=lo(windmax)-lo(windmin)+1;
  337. screensetcursor(y+hi(windmin)-1,x+lo(windmin)-1);
  338. end;
  339. function wherex : byte;
  340. var
  341. row,col : longint;
  342. begin
  343. screengetcursor(row,col);
  344. wherex:=col-lo(windmin)+1;
  345. end;
  346. function wherey : byte;
  347. var
  348. row,col : longint;
  349. begin
  350. screengetcursor(row,col);
  351. wherey:=row-hi(windmin)+1;
  352. end;
  353. procedure window(left,top,right,bottom : byte);
  354. begin
  355. if (left<1) or
  356. (right>screencols) or
  357. (bottom>screenrows) or
  358. (left>right) or
  359. (top>bottom) then
  360. exit;
  361. windmin:=(left-1) or ((top-1) shl 8);
  362. windmax:=(right-1) or ((bottom-1) shl 8);
  363. gotoxy(1,1);
  364. end;
  365. procedure clrscr;
  366. var
  367. fil : word;
  368. row : longint;
  369. begin
  370. fil:=32 or (textattr shl 8);
  371. for row:=hi(windmin) to hi(windmax) do
  372. dosmemfillword($b800,get_addr(row+1,lo(windmin)+1),lo(windmax)-lo(windmin)+1,fil);
  373. gotoxy(1,1);
  374. end;
  375. procedure textcolor(color : Byte);
  376. begin
  377. textattr:=(textattr and $70) or color;
  378. end;
  379. procedure lowvideo;
  380. begin
  381. textattr:=textattr and $f7;
  382. end;
  383. procedure highvideo;
  384. begin
  385. textattr:=textattr or $08;
  386. end;
  387. procedure textbackground(color : Byte);
  388. begin
  389. textattr:=(textattr and $8f) or ((color and $7) shl 4);
  390. end;
  391. var
  392. startattrib : byte;
  393. procedure normvideo;
  394. begin
  395. textattr:=startattrib;
  396. end;
  397. procedure delline(line : byte);
  398. var
  399. row,left,right,bot : longint;
  400. fil : word;
  401. begin
  402. row:=line+hi(windmin);
  403. left:=lo(windmin)+1;
  404. right:=lo(windmax)+1;
  405. bot:=hi(windmax)+1;
  406. fil:=32 or (textattr shl 8);
  407. while (row<bot) do
  408. begin
  409. dosmemmove($b800,get_addr(row+1,left),$b800,get_addr(row,left),(right-left+1)*2);
  410. inc(row);
  411. end;
  412. dosmemfillword($b800,get_addr(bot,left),right-left+1,fil);
  413. end;
  414. procedure delline;
  415. begin
  416. delline(wherey);
  417. end;
  418. procedure insline;
  419. var
  420. row,col,left,right,bot : longint;
  421. fil : word;
  422. begin
  423. screengetcursor(row,col);
  424. inc(row);
  425. left:=lo(windmin)+1;
  426. right:=lo(windmax)+1;
  427. bot:=hi(windmax);
  428. fil:=32 or (textattr shl 8);
  429. while (bot>row) do
  430. begin
  431. dosmemmove($b800,get_addr(bot-1,left),$b800,get_addr(bot,left),(right-left+1)*2);
  432. dec(bot);
  433. end;
  434. dosmemfillword($b800,get_addr(row,left),right-left+1,fil);
  435. end;
  436. procedure clreol;
  437. var
  438. row,col : longint;
  439. fil : word;
  440. begin
  441. screengetcursor(row,col);
  442. inc(row);
  443. inc(col);
  444. fil:=32 or (textattr shl 8);
  445. dosmemfillword($b800,get_addr(row,col),lo(windmax)-col+2,fil);
  446. end;
  447. Function CrtWrite(var f : textrec):integer;
  448. var
  449. i,col,row : longint;
  450. c : char;
  451. va,sa : word;
  452. begin
  453. screengetcursor(row,col);
  454. inc(row);
  455. inc(col);
  456. va:=get_addr(row,col);
  457. for i:=0 to f.bufpos-1 do
  458. begin
  459. c:=f.buffer[i];
  460. case ord(c) of
  461. 10 : begin
  462. inc(row);
  463. va:=va+maxcols*2;
  464. end;
  465. 13 : begin
  466. col:=lo(windmin)+1;
  467. va:=get_addr(row,col);
  468. end;
  469. 8 : if col>lo(windmin)+1 then
  470. begin
  471. dec(col);
  472. va:=va-2;
  473. end;
  474. 7 : begin
  475. { beep }
  476. end;
  477. else
  478. begin
  479. sa:=textattr shl 8 or ord(c);
  480. dosmemput($b800,va,sa,sizeof(sa));
  481. inc(col);
  482. va:=va+2;
  483. end;
  484. end;
  485. if col>lo(windmax)+1 then
  486. begin
  487. col:=lo(windmin)+1;
  488. inc(row);
  489. { it's easier to calculate the new address }
  490. { it don't spend much time }
  491. va:=get_addr(row,col);
  492. end;
  493. while row>hi(windmax)+1 do
  494. begin
  495. delline(1);
  496. dec(row);
  497. va:=va-maxcols*2;
  498. end;
  499. end;
  500. f.bufpos:=0;
  501. screensetcursor(row-1,col-1);
  502. CrtWrite:=0;
  503. end;
  504. Function CrtClose(Var F: TextRec): Integer;
  505. Begin
  506. F.Mode:=fmClosed;
  507. CrtClose:=0;
  508. End;
  509. Function CrtOpen(Var F: TextRec): Integer;
  510. Begin
  511. If F.Mode = fmOutput Then
  512. CrtOpen:=0
  513. Else
  514. CrtOpen:=5;
  515. End;
  516. Function CrtRead(Var F: TextRec): Integer;
  517. Begin
  518. {$IFDEF GO32V2}
  519. f.bufend:=do_read(f.handle,longint(f.bufptr),f.bufsize);
  520. {$ENDIF}
  521. f.bufpos:=0;
  522. CrtRead:=0;
  523. End;
  524. Function CrtInOut(Var F: TextRec): Integer;
  525. Begin
  526. Case F.Mode of
  527. fmInput: CrtInOut:=CrtRead(F);
  528. fmOutput: CrtInOut:=CrtWrite(F);
  529. End;
  530. End;
  531. procedure assigncrt(var f : text);
  532. begin
  533. TextRec(F).Mode:=fmClosed;
  534. TextRec(F).BufSize:=SizeOf(TextBuf);
  535. TextRec(F).BufPtr:=@TextRec(F).Buffer;
  536. TextRec(F).BufPos:=0;
  537. TextRec(F).OpenFunc:=@CrtOpen;
  538. TextRec(F).InOutFunc:=@CrtInOut;
  539. TextRec(F).FlushFunc:=@CrtInOut;
  540. TextRec(F).CloseFunc:=@CrtClose;
  541. TextRec(F).Name[0]:='.';
  542. TextRec(F).Name[1]:=#0;
  543. end;
  544. procedure sound(hz : word);
  545. begin
  546. if hz=0 then
  547. begin
  548. nosound;
  549. exit;
  550. end;
  551. asm
  552. movzwl hz,%ecx
  553. movl $1193046,%eax
  554. cdq
  555. divl %ecx
  556. movl %eax,%ecx
  557. movb $0xb6,%al
  558. outb %al,$0x43
  559. movb %cl,%al
  560. outb %al,$0x42
  561. movb %ch,%al
  562. outb %al,$0x42
  563. inb $0x61,%al
  564. orb $0x3,%al
  565. outb %al,$0x61
  566. end ['EAX','ECX','EDX'];
  567. end;
  568. procedure nosound;
  569. begin
  570. asm
  571. inb $0x61,%al
  572. andb $0xfc,%al
  573. outb %al,$0x61
  574. end ['EAX'];
  575. end;
  576. var
  577. calibration : longint;
  578. procedure delay(ms : longint);
  579. var
  580. i,j : longint;
  581. begin
  582. for i:=1 to ms do
  583. for j:=1 to calibration do
  584. begin
  585. end;
  586. end;
  587. function get_ticks:longint;
  588. begin
  589. dosmemget($40,$6c,get_ticks,4);
  590. end;
  591. procedure initdelay;
  592. { From the mailling list,
  593. by Jonathan Anderson ([email protected]) }
  594. const
  595. threshold=3;
  596. { Raise this to increase speed but decrease accuracy }
  597. { currently the calibration will be no more than 7 off }
  598. { and shave a few ticks off the most accurate setting of 0 }
  599. { The best values to pick are powers of 2-1 (0,1,3,7,15...) }
  600. { but any non-negative value will work. }
  601. var
  602. too_small : boolean;
  603. first,
  604. incval : longint;
  605. begin
  606. calibration:=0;
  607. { wait for new tick }
  608. first:=get_ticks;
  609. while get_ticks=first do
  610. begin
  611. end;
  612. first:=get_ticks;
  613. { this estimates calibration }
  614. while get_ticks=first do
  615. inc(calibration);
  616. { calculate this to ms }
  617. { calibration:=calibration div 70; }
  618. { this is a very bad estimation because }
  619. { the loop above calls a function }
  620. { and the dealy loop does not }
  621. calibration:=calibration div 3;
  622. { The ideal guess value is about half of the real value }
  623. { although a value lower than that take a large performance }
  624. { hit compared to a value higher than that because it has to }
  625. { go through the loop a few times. }
  626. if calibration<(threshold+1)*2 then
  627. calibration:=(threshold+1)*2;
  628. { If calibration is not at least this value, an }
  629. { infinite loop will result. }
  630. repeat
  631. incval:=calibration;
  632. if calibration<0 then
  633. begin
  634. calibration:=$7FFFFFFF;
  635. exit;
  636. end;
  637. { If calibration becomes less than 0, then }
  638. { the maximum value was not long enough, so }
  639. { assign it the maximum value and exit. }
  640. { Without this code, an infinite loop would }
  641. { result on superfast computers about 315800 }
  642. { times faster (oh yeah!) than my Pentium 75. }
  643. { If you don't think that will happen, take }
  644. { out the if and save a few clock cycles. }
  645. too_small:=true; { Assumed true at beginning }
  646. while incval>threshold do
  647. begin
  648. incval:=incval div 2;
  649. first:=get_ticks;
  650. while get_ticks=first do
  651. begin
  652. end;
  653. first:=get_ticks;
  654. delay(55);
  655. if first=get_ticks then
  656. begin
  657. calibration:=calibration+incval;
  658. end
  659. else
  660. begin
  661. calibration:=calibration-incval;
  662. too_small:=false;
  663. { If you have to decrement calibration, }
  664. { the initial value was not too small to }
  665. { result in an accurate measurement. }
  666. end;
  667. end;
  668. until not too_small;
  669. end;
  670. procedure textmode(mode : integer);
  671. var
  672. set_font8x8 : boolean;
  673. begin
  674. lastmode:=mode;
  675. set_font8x8:=(mode and font8x8)<>0;
  676. mode:=mode and $ff;
  677. setscreenmode(mode);
  678. windmin:=0;
  679. windmax:=(screencols-1) or ((screenrows-1) shl 8);
  680. maxcols:=screencols;
  681. maxrows:=screenrows;
  682. end;
  683. var
  684. col,row : longint;
  685. begin
  686. is_last:=false;
  687. { load system variables to temporary variables to save time }
  688. maxcols:=screencols;
  689. maxrows:=screenrows;
  690. { set output window }
  691. windmax:=(maxcols-1) or ((maxrows-1) shl 8);
  692. { save the current settings to restore the old state after the exit }
  693. screengetcursor(row,col);
  694. dosmemget($b800,get_addr(row+1,col+1)+1,startattrib,1);
  695. lastmode:=getscreenmode;
  696. textattr:=startattrib;
  697. { redirect the standard output }
  698. assigncrt(Output);
  699. TextRec(Output).mode:=fmOutput;
  700. {$IFDEF GO32V2}
  701. assigncrt(Input);
  702. TextRec(Input).mode:=fmInput;
  703. {$ENDIF GO32V2}
  704. { calculates delay calibration }
  705. initdelay;
  706. end.
  707. {
  708. $Log$
  709. Revision 1.1 1998-03-25 11:18:41 root
  710. Initial revision
  711. Revision 1.8 1998/01/26 11:56:39 michael
  712. + Added log at the end
  713. Working file: rtl/dos/crt.pp
  714. description:
  715. ----------------------------
  716. revision 1.7
  717. date: 1998/01/07 09:24:18; author: michael; state: Exp; lines: +7 -2
  718. * Bug fixed in initdelay, avoiding possible infiniteloop.
  719. ----------------------------
  720. revision 1.6
  721. date: 1998/01/06 00:29:28; author: michael; state: Exp; lines: +2 -2
  722. Implemented a system independent sequence of reset/rewrite/append fileopenfunc etc system \n (from Peter Vreman)
  723. ----------------------------
  724. revision 1.5
  725. date: 1998/01/05 16:52:15; author: michael; state: Exp; lines: +7 -3
  726. + Minor change making use of new GO32V2 feature (From Peter Vreman)
  727. ----------------------------
  728. revision 1.4
  729. date: 1998/01/05 13:47:01; author: michael; state: Exp; lines: +199 -127
  730. * Bug fixes by Peter Vreman ([email protected]), discovered
  731. when writing CRT examples.
  732. Bug fix from mailing list also applied.
  733. ----------------------------
  734. revision 1.3
  735. date: 1997/12/12 13:14:36; author: pierre; state: Exp; lines: +33 -12
  736. + added handling of swap_vectors if under exceptions
  737. i.e. swapvector is not dummy under go32v2
  738. * bug in output, exceptions where not allways reset correctly
  739. now the code in dpmiexcp is called from v2prt0.as exit routine
  740. * in crt.pp corrected init_delay calibration loop
  741. and added it for go32v2 also (was disabled before due to crashes !!)
  742. the previous code did a wrong assumption on the time need to call
  743. get_ticks compared to an internal loop without call
  744. ----------------------------
  745. revision 1.2
  746. date: 1997/12/01 12:15:44; author: michael; state: Exp; lines: +11 -5
  747. + added copyright reference in header.
  748. ----------------------------
  749. revision 1.1
  750. date: 1997/11/27 08:33:49; author: michael; state: Exp;
  751. Initial revision
  752. ----------------------------
  753. revision 1.1.1.1
  754. date: 1997/11/27 08:33:49; author: michael; state: Exp; lines: +0 -0
  755. FPC RTL CVS start
  756. =============================================================================
  757. }