crt.pp 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860
  1. {
  2. $Id$
  3. This file is part of the Free Pascal run time library.
  4. Copyright (c) 1999-2000 by the Free Pascal development team.
  5. Borland Pascal 7 Compatible CRT Unit for Go32V2
  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. unit crt;
  13. interface
  14. const
  15. { CRT modes }
  16. BW40 = 0; { 40x25 B/W on Color Adapter }
  17. CO40 = 1; { 40x25 Color on Color Adapter }
  18. BW80 = 2; { 80x25 B/W on Color Adapter }
  19. CO80 = 3; { 80x25 Color on Color Adapter }
  20. Mono = 7; { 80x25 on Monochrome Adapter }
  21. Font8x8 = 256; { Add-in for ROM font }
  22. { Mode constants for 3.0 compatibility }
  23. C40 = CO40;
  24. C80 = CO80;
  25. { Foreground and background color constants }
  26. Black = 0;
  27. Blue = 1;
  28. Green = 2;
  29. Cyan = 3;
  30. Red = 4;
  31. Magenta = 5;
  32. Brown = 6;
  33. LightGray = 7;
  34. { Foreground color constants }
  35. DarkGray = 8;
  36. LightBlue = 9;
  37. LightGreen = 10;
  38. LightCyan = 11;
  39. LightRed = 12;
  40. LightMagenta = 13;
  41. Yellow = 14;
  42. White = 15;
  43. { Add-in for blinking }
  44. Blink = 128;
  45. var
  46. { Interface variables }
  47. CheckBreak: Boolean; { Enable Ctrl-Break }
  48. CheckEOF: Boolean; { Enable Ctrl-Z }
  49. DirectVideo: Boolean; { Enable direct video addressing }
  50. CheckSnow: Boolean; { Enable snow filtering }
  51. LastMode: Word; { Current text mode }
  52. TextAttr: Byte; { Current text attribute }
  53. WindMin: Word; { Window upper left coordinates }
  54. WindMax: Word; { Window lower right coordinates }
  55. ScreenWidth,
  56. ScreenHeight : longint;
  57. { Interface procedures }
  58. procedure AssignCrt(var F: Text);
  59. function KeyPressed: Boolean;
  60. function ReadKey: Char;
  61. procedure TextMode(Mode: Integer);
  62. procedure Window(X1,Y1,X2,Y2: Byte);
  63. procedure GotoXY(X,Y: Byte);
  64. function WhereX: Byte;
  65. function WhereY: Byte;
  66. procedure ClrScr;
  67. procedure ClrEol;
  68. procedure InsLine;
  69. procedure DelLine;
  70. procedure TextColor(Color: Byte);
  71. procedure TextBackground(Color: Byte);
  72. procedure LowVideo;
  73. procedure HighVideo;
  74. procedure NormVideo;
  75. procedure Delay(MS: Word);
  76. procedure Sound(Hz: Word);
  77. procedure NoSound;
  78. {Extra Functions}
  79. procedure cursoron;
  80. procedure cursoroff;
  81. procedure cursorbig;
  82. implementation
  83. uses
  84. go32;
  85. {$ASMMODE ATT}
  86. var
  87. DelayCnt : Longint;
  88. VidSeg : Word;
  89. {
  90. definition of textrec is in textrec.inc
  91. }
  92. {$i textrec.inc}
  93. {****************************************************************************
  94. Low level Routines
  95. ****************************************************************************}
  96. procedure setscreenmode(mode : byte);
  97. var
  98. regs : trealregs;
  99. begin
  100. regs.realeax:=mode;
  101. realintr($10,regs);
  102. end;
  103. function GetScreenHeight : longint;
  104. begin
  105. getscreenheight:=mem[$40:$84]+1;
  106. If mem[$40:$84]=0 then
  107. getscreenheight := 25;
  108. end;
  109. function GetScreenWidth : longint;
  110. begin
  111. getscreenwidth:=memw[$40:$4a];
  112. end;
  113. procedure SetScreenCursor(x,y : longint);
  114. var
  115. regs : trealregs;
  116. begin
  117. regs.realeax:=$0200;
  118. regs.realebx:=0;
  119. regs.realedx:=(y-1) shl 8+(x-1);
  120. realintr($10,regs);
  121. end;
  122. procedure GetScreenCursor(var x,y : longint);
  123. begin
  124. x:=mem[$40:$50]+1;
  125. y:=mem[$40:$51]+1;
  126. end;
  127. {****************************************************************************
  128. Helper Routines
  129. ****************************************************************************}
  130. Function WinMinX: Byte;
  131. {
  132. Current Minimum X coordinate
  133. }
  134. Begin
  135. WinMinX:=(WindMin and $ff)+1;
  136. End;
  137. Function WinMinY: Byte;
  138. {
  139. Current Minimum Y Coordinate
  140. }
  141. Begin
  142. WinMinY:=(WindMin shr 8)+1;
  143. End;
  144. Function WinMaxX: Byte;
  145. {
  146. Current Maximum X coordinate
  147. }
  148. Begin
  149. WinMaxX:=(WindMax and $ff)+1;
  150. End;
  151. Function WinMaxY: Byte;
  152. {
  153. Current Maximum Y coordinate;
  154. }
  155. Begin
  156. WinMaxY:=(WindMax shr 8) + 1;
  157. End;
  158. Function FullWin:boolean;
  159. {
  160. Full Screen 80x25? Window(1,1,80,25) is used, allows faster routines
  161. }
  162. begin
  163. FullWin:=(WinMinX=1) and (WinMinY=1) and
  164. (WinMaxX=ScreenWidth) and (WinMaxY=ScreenHeight);
  165. end;
  166. {****************************************************************************
  167. Public Crt Functions
  168. ****************************************************************************}
  169. procedure textmode(mode : integer);
  170. var
  171. regs : trealregs;
  172. begin
  173. lastmode:=mode;
  174. mode:=mode and $ff;
  175. setscreenmode(mode);
  176. { set 8x8 font }
  177. if (lastmode and $100)<>0 then
  178. begin
  179. regs.realeax:=$1112;
  180. regs.realebx:=$0;
  181. realintr($10,regs);
  182. end;
  183. screenwidth:=getscreenwidth;
  184. screenheight:=getscreenheight;
  185. windmin:=0;
  186. windmax:=(screenwidth-1) or ((screenheight-1) shl 8);
  187. end;
  188. Procedure TextColor(Color: Byte);
  189. {
  190. Switch foregroundcolor
  191. }
  192. Begin
  193. TextAttr:=(Color and $f) or (TextAttr and $70);
  194. If (Color>15) Then TextAttr:=TextAttr Or Blink;
  195. End;
  196. Procedure TextBackground(Color: Byte);
  197. {
  198. Switch backgroundcolor
  199. }
  200. Begin
  201. TextAttr:=((Color shl 4) and ($f0 and not Blink)) or (TextAttr and ($0f OR Blink) );
  202. End;
  203. Procedure HighVideo;
  204. {
  205. Set highlighted output.
  206. }
  207. Begin
  208. TextColor(TextAttr Or $08);
  209. End;
  210. Procedure LowVideo;
  211. {
  212. Set normal output
  213. }
  214. Begin
  215. TextColor(TextAttr And $77);
  216. End;
  217. Procedure NormVideo;
  218. {
  219. Set normal back and foregroundcolors.
  220. }
  221. Begin
  222. TextColor(7);
  223. TextBackGround(0);
  224. End;
  225. Procedure GotoXy(X: Byte; Y: Byte);
  226. {
  227. Go to coordinates X,Y in the current window.
  228. }
  229. Begin
  230. If (X>0) and (X<=WinMaxX- WinMinX+1) and
  231. (Y>0) and (Y<=WinMaxY-WinMinY+1) Then
  232. Begin
  233. Inc(X,WinMinX-1);
  234. Inc(Y,WinMinY-1);
  235. SetScreenCursor(x,y);
  236. End;
  237. End;
  238. Procedure Window(X1, Y1, X2, Y2: Byte);
  239. {
  240. Set screen window to the specified coordinates.
  241. }
  242. Begin
  243. if (X1>X2) or (X2>ScreenWidth) or
  244. (Y1>Y2) or (Y2>ScreenHeight) then
  245. exit;
  246. WindMin:=((Y1-1) Shl 8)+(X1-1);
  247. WindMax:=((Y2-1) Shl 8)+(X2-1);
  248. GoToXY(1,1);
  249. End;
  250. Procedure ClrScr;
  251. {
  252. Clear the current window, and set the cursor on 1,1
  253. }
  254. var
  255. fil : word;
  256. y : longint;
  257. begin
  258. fil:=32 or (textattr shl 8);
  259. if FullWin then
  260. DosmemFillWord(VidSeg,0,ScreenHeight*ScreenWidth,fil)
  261. else
  262. begin
  263. for y:=WinMinY to WinMaxY do
  264. DosmemFillWord(VidSeg,((y-1)*ScreenWidth+(WinMinX-1))*2,WinMaxX-WinMinX+1,fil);
  265. end;
  266. Gotoxy(1,1);
  267. end;
  268. Procedure ClrEol;
  269. {
  270. Clear from current position to end of line.
  271. }
  272. var
  273. x,y : longint;
  274. fil : word;
  275. Begin
  276. GetScreenCursor(x,y);
  277. fil:=32 or (textattr shl 8);
  278. if x<=WinMaxX then
  279. DosmemFillword(VidSeg,((y-1)*ScreenWidth+(x-1))*2,WinMaxX-x+1,fil);
  280. End;
  281. Function WhereX: Byte;
  282. {
  283. Return current X-position of cursor.
  284. }
  285. var
  286. x,y : longint;
  287. Begin
  288. GetScreenCursor(x,y);
  289. WhereX:=x-WinMinX+1;
  290. End;
  291. Function WhereY: Byte;
  292. {
  293. Return current Y-position of cursor.
  294. }
  295. var
  296. x,y : longint;
  297. Begin
  298. GetScreenCursor(x,y);
  299. WhereY:=y-WinMinY+1;
  300. End;
  301. {*************************************************************************
  302. KeyBoard
  303. *************************************************************************}
  304. var
  305. is_last : boolean;
  306. last : char;
  307. function readkey : char;
  308. var
  309. char2 : char;
  310. char1 : char;
  311. regs : trealregs;
  312. begin
  313. if is_last then
  314. begin
  315. is_last:=false;
  316. readkey:=last;
  317. end
  318. else
  319. begin
  320. regs.ah:=$10;
  321. realintr($16,regs);
  322. if (regs.al=$e0) and (regs.ah<>0) then
  323. regs.al:=0;
  324. char1:=chr(regs.al);
  325. char2:=chr(regs.ah);
  326. if char1=#0 then
  327. begin
  328. is_last:=true;
  329. last:=char2;
  330. end;
  331. readkey:=char1;
  332. end;
  333. end;
  334. function keypressed : boolean;
  335. var
  336. regs : trealregs;
  337. begin
  338. if is_last then
  339. begin
  340. keypressed:=true;
  341. exit;
  342. end
  343. else
  344. begin
  345. regs.ah:=$11;
  346. realintr($16,regs);
  347. keypressed:=((regs.realflags and zeroflag) = 0);
  348. end;
  349. end;
  350. {*************************************************************************
  351. Delay
  352. *************************************************************************}
  353. procedure Delayloop;assembler;
  354. asm
  355. .LDelayLoop1:
  356. subl $1,%eax
  357. jc .LDelayLoop2
  358. cmpl %fs:(%edi),%ebx
  359. je .LDelayLoop1
  360. .LDelayLoop2:
  361. end;
  362. procedure initdelay;assembler;
  363. asm
  364. pushl %ebx
  365. pushl %edi
  366. { for some reason, using int $31/ax=$901 doesn't work here }
  367. { and interrupts are always disabled at this point when }
  368. { running a program inside gdb(pas). Web bug 1345 (JM) }
  369. sti
  370. movl $0x46c,%edi
  371. movl $-28,%edx
  372. movl %fs:(%edi),%ebx
  373. .LInitDel1:
  374. cmpl %fs:(%edi),%ebx
  375. je .LInitDel1
  376. movl %fs:(%edi),%ebx
  377. movl %edx,%eax
  378. call DelayLoop
  379. notl %eax
  380. xorl %edx,%edx
  381. movl $55,%ecx
  382. divl %ecx
  383. movl %eax,DelayCnt
  384. popl %edi
  385. popl %ebx
  386. end;
  387. procedure Delay(MS: Word);assembler;
  388. asm
  389. pushl %ebx
  390. pushl %edi
  391. movzwl MS,%ecx
  392. jecxz .LDelay2
  393. movl $0x400,%edi
  394. movl DelayCnt,%edx
  395. movl %fs:(%edi),%ebx
  396. .LDelay1:
  397. movl %edx,%eax
  398. call DelayLoop
  399. loop .LDelay1
  400. .LDelay2:
  401. popl %edi
  402. popl %ebx
  403. end;
  404. procedure sound(hz : word);
  405. begin
  406. if hz=0 then
  407. begin
  408. nosound;
  409. exit;
  410. end;
  411. asm
  412. movzwl hz,%ecx
  413. movl $1193046,%eax
  414. cltd
  415. divl %ecx
  416. movl %eax,%ecx
  417. inb $0x61,%al
  418. testb $0x3,%al
  419. jnz .Lsound_next
  420. orb $0x3,%al
  421. outb %al,$0x61
  422. movb $0xb6,%al
  423. outb %al,$0x43
  424. .Lsound_next:
  425. movb %cl,%al
  426. outb %al,$0x42
  427. movb %ch,%al
  428. outb %al,$0x42
  429. end ['EAX','ECX','EDX'];
  430. end;
  431. procedure nosound;
  432. begin
  433. asm
  434. inb $0x61,%al
  435. andb $0xfc,%al
  436. outb %al,$0x61
  437. end ['EAX'];
  438. end;
  439. {****************************************************************************
  440. HighLevel Crt Functions
  441. ****************************************************************************}
  442. procedure removeline(y : longint);
  443. var
  444. fil : word;
  445. begin
  446. fil:=32 or (textattr shl 8);
  447. y:=WinMinY+y-1;
  448. While (y<WinMaxY) do
  449. begin
  450. dosmemmove(VidSeg,(y*ScreenWidth+(WinMinX-1))*2,
  451. VidSeg,((y-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1)*2);
  452. inc(y);
  453. end;
  454. dosmemfillword(VidSeg,((WinMaxY-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1),fil);
  455. end;
  456. procedure delline;
  457. begin
  458. removeline(wherey);
  459. end;
  460. procedure insline;
  461. var
  462. my,y : longint;
  463. fil : word;
  464. begin
  465. fil:=32 or (textattr shl 8);
  466. y:=WhereY;
  467. my:=WinMaxY-WinMinY;
  468. while (my>=y) do
  469. begin
  470. dosmemmove(VidSeg,(((WinMinY+my-1)-1)*ScreenWidth+(WinMinX-1))*2,
  471. VidSeg,(((WinMinY+my)-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1)*2);
  472. dec(my);
  473. end;
  474. dosmemfillword(VidSeg,(((WinMinY+y-1)-1)*ScreenWidth+(WinMinX-1))*2,(WinMaxX-WinMinX+1),fil);
  475. end;
  476. {****************************************************************************
  477. Extra Crt Functions
  478. ****************************************************************************}
  479. procedure cursoron;
  480. var
  481. regs : trealregs;
  482. begin
  483. regs.realeax:=$0100;
  484. regs.realecx:=$90A;
  485. If VidSeg=$b800 then
  486. regs.realecx:=$90A
  487. else
  488. regs.realecx:=$b0d;
  489. realintr($10,regs);
  490. end;
  491. procedure cursoroff;
  492. var
  493. regs : trealregs;
  494. begin
  495. regs.realeax:=$0100;
  496. regs.realecx:=$ffff;
  497. realintr($10,regs);
  498. end;
  499. procedure cursorbig;
  500. var
  501. regs : trealregs;
  502. begin
  503. regs.realeax:=$0100;
  504. regs.realecx:=$10A;
  505. realintr($10,regs);
  506. end;
  507. {*****************************************************************************
  508. Read and Write routines
  509. *****************************************************************************}
  510. var
  511. CurrX,CurrY : longint;
  512. Procedure WriteChar(c:char);
  513. var
  514. regs : trealregs;
  515. begin
  516. case c of
  517. #10 : inc(CurrY);
  518. #13 : CurrX:=WinMinX;
  519. #8 : begin
  520. if CurrX>WinMinX then
  521. dec(CurrX);
  522. end;
  523. #7 : begin { beep }
  524. regs.dl:=7;
  525. regs.ah:=2;
  526. realintr($21,regs);
  527. end;
  528. else
  529. begin
  530. memw[VidSeg:((CurrY-1)*ScreenWidth+(CurrX-1))*2]:=(textattr shl 8) or byte(c);
  531. inc(CurrX);
  532. end;
  533. end;
  534. if CurrX>WinMaxX then
  535. begin
  536. CurrX:=WinMinX;
  537. inc(CurrY);
  538. end;
  539. while CurrY>WinMaxY do
  540. begin
  541. removeline(1);
  542. dec(CurrY);
  543. end;
  544. end;
  545. Function CrtWrite(var f : textrec):integer;
  546. var
  547. i : longint;
  548. begin
  549. GetScreenCursor(CurrX,CurrY);
  550. for i:=0 to f.bufpos-1 do
  551. WriteChar(f.buffer[i]);
  552. SetScreenCursor(CurrX,CurrY);
  553. f.bufpos:=0;
  554. CrtWrite:=0;
  555. end;
  556. Function CrtRead(Var F: TextRec): Integer;
  557. procedure BackSpace;
  558. begin
  559. if (f.bufpos>0) and (f.bufpos=f.bufend) then
  560. begin
  561. WriteChar(#8);
  562. WriteChar(' ');
  563. WriteChar(#8);
  564. dec(f.bufpos);
  565. dec(f.bufend);
  566. end;
  567. end;
  568. var
  569. ch : Char;
  570. Begin
  571. GetScreenCursor(CurrX,CurrY);
  572. f.bufpos:=0;
  573. f.bufend:=0;
  574. repeat
  575. if f.bufpos>f.bufend then
  576. f.bufend:=f.bufpos;
  577. SetScreenCursor(CurrX,CurrY);
  578. ch:=readkey;
  579. case ch of
  580. #0 : case readkey of
  581. #71 : while f.bufpos>0 do
  582. begin
  583. dec(f.bufpos);
  584. WriteChar(#8);
  585. end;
  586. #75 : if f.bufpos>0 then
  587. begin
  588. dec(f.bufpos);
  589. WriteChar(#8);
  590. end;
  591. #77 : if f.bufpos<f.bufend then
  592. begin
  593. WriteChar(f.bufptr^[f.bufpos]);
  594. inc(f.bufpos);
  595. end;
  596. #79 : while f.bufpos<f.bufend do
  597. begin
  598. WriteChar(f.bufptr^[f.bufpos]);
  599. inc(f.bufpos);
  600. end;
  601. end;
  602. ^S,
  603. #8 : BackSpace;
  604. ^Y,
  605. #27 : begin
  606. while f.bufpos<f.bufend do begin
  607. WriteChar(f.bufptr^[f.bufpos]);
  608. inc(f.bufpos);
  609. end;
  610. while f.bufend>0 do
  611. BackSpace;
  612. end;
  613. #13 : begin
  614. WriteChar(#13);
  615. WriteChar(#10);
  616. f.bufptr^[f.bufend]:=#13;
  617. f.bufptr^[f.bufend+1]:=#10;
  618. inc(f.bufend,2);
  619. break;
  620. end;
  621. #26 : if CheckEOF then
  622. begin
  623. f.bufptr^[f.bufend]:=#26;
  624. inc(f.bufend);
  625. break;
  626. end;
  627. else
  628. begin
  629. if f.bufpos<f.bufsize-2 then
  630. begin
  631. f.buffer[f.bufpos]:=ch;
  632. inc(f.bufpos);
  633. WriteChar(ch);
  634. end;
  635. end;
  636. end;
  637. until false;
  638. f.bufpos:=0;
  639. SetScreenCursor(CurrX,CurrY);
  640. CrtRead:=0;
  641. End;
  642. Function CrtReturn(Var F: TextRec): Integer;
  643. Begin
  644. CrtReturn:=0;
  645. end;
  646. Function CrtClose(Var F: TextRec): Integer;
  647. Begin
  648. F.Mode:=fmClosed;
  649. CrtClose:=0;
  650. End;
  651. Function CrtOpen(Var F: TextRec): Integer;
  652. Begin
  653. If F.Mode=fmOutput Then
  654. begin
  655. TextRec(F).InOutFunc:=@CrtWrite;
  656. TextRec(F).FlushFunc:=@CrtWrite;
  657. end
  658. Else
  659. begin
  660. F.Mode:=fmInput;
  661. TextRec(F).InOutFunc:=@CrtRead;
  662. TextRec(F).FlushFunc:=@CrtReturn;
  663. end;
  664. TextRec(F).CloseFunc:=@CrtClose;
  665. CrtOpen:=0;
  666. End;
  667. procedure AssignCrt(var F: Text);
  668. begin
  669. Assign(F,'');
  670. TextRec(F).OpenFunc:=@CrtOpen;
  671. end;
  672. { use the C version to avoid using dpmiexcp unit
  673. which makes sysutils and exceptions working incorrectly PM }
  674. function __djgpp_set_ctrl_c(enable : longint) : boolean;cdecl;external;
  675. var
  676. x,y : longint;
  677. begin
  678. { Load startup values }
  679. ScreenWidth:=GetScreenWidth;
  680. ScreenHeight:=GetScreenHeight;
  681. WindMax:=(ScreenWidth-1) or ((ScreenHeight-1) shl 8);
  682. { Load TextAttr }
  683. GetScreenCursor(x,y);
  684. lastmode := mem[$40:$49];
  685. if screenheight>25 then
  686. lastmode:=lastmode or $100;
  687. If not(lastmode=Mono) then
  688. VidSeg := $b800
  689. else
  690. VidSeg := $b000;
  691. TextAttr:=mem[VidSeg:((y-1)*ScreenWidth+(x-1))*2+1];
  692. { Redirect the standard output }
  693. assigncrt(Output);
  694. Rewrite(Output);
  695. TextRec(Output).Handle:=StdOutputHandle;
  696. assigncrt(Input);
  697. Reset(Input);
  698. TextRec(Input).Handle:=StdInputHandle;
  699. { Calculates delay calibration }
  700. initdelay;
  701. { Enable ctrl-c input (JM) }
  702. __djgpp_set_ctrl_c(0);
  703. end.
  704. {
  705. $Log$
  706. Revision 1.10 2003-10-03 21:56:36 peter
  707. * stdcall fixes
  708. Revision 1.9 2003/03/17 18:13:13 peter
  709. * exported ScreenHeight, ScreenWidth
  710. Revision 1.8 2002/12/15 20:22:24 peter
  711. * fix making string empty in readln when cursor is not at the end
  712. Revision 1.7 2002/09/10 10:38:04 pierre
  713. * merged from fixes: fix bug report 1974
  714. Revision 1.6 2002/09/07 16:01:18 peter
  715. * old logs removed and tabs fixed
  716. }