-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathADELE.PAS
3473 lines (2682 loc) · 96.4 KB
/
ADELE.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Malte Genesis/Module du coeur de AdŠle Û
³ dition AdŠle pour Mode R‚el et Windows/V - Version 1.33 Û
³ 1998/01/01 Û
³ Û
³ Tous droits r‚serv‚ par les Chevaliers de Malte (C) Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Nom du programmeur
ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ
Sylvain Maltais
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette unit‚ agit en tant que coeur d'AdŠle. Il contient la boŒte des
techniques provoquant ses talents.
Remarques
ÍÍÍÍÍÍÍÍÍ
þ Chantal n'est pas une fille facile, elle a besoin d'ˆtre comprise
pour bien agir.
þ AVERTISSEMENT! Cette unit‚ doit … tout prix avoir comme offset 0. Il
faut donc qu'elle soit la 1iŠre unit‚ ins‚rer dans un programme. Si
vous pr‚f‚rez Ofs(Init)=0 sinon il plante...
Compilateur
ÍÍÍÍÍÍÍÍÍÍÍ
þ Turbo Pascal 7 ou post‚rieur
þ Borland Pascal 7 ou post‚rieur
þ Delphi 1.2 ou post‚rieur
}
Unit Adele;
{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}
INTERFACE
{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}
{$I DEF.INC}
Uses {$IFDEF Windows}
Messages,
{$ENDIF}
Dostex,Systex;
Const
{$IFDEF Real}
Jump:Jumper=(
FlagsMethod:stupJumperDef { Drapeaux de configuration lors du lancement }
);
{$ENDIF}
CheckSVGA:Boolean=False; {Cette constante permet de fixer le drapeau indiquant
si la d‚tection de carte vid‚o Super VGA est autoris‚.}
VesaBiosBank:Boolean=False; {Cette constante permet interdit l'accŠs par la
routine BIOS plut“t que par la routine d'appel pour
les banques de m‚moires vid‚o}
ModeSupport:^TWord=NIL;
NumModeSupport:Word=0;{ Nombre de mode vid‚o support‚e }
{$IFDEF Windows}
WindowOrg:TPoint=(X:cw_UseDefault;Y:cw_UseDefault); { Origine de la fenˆtre CRT }
WindowSize:TPoint=(X:cw_UseDefault;Y:cw_UseDefault);{ Taille de la fenˆtre CRT }
ScreenSize:TPoint=(X:80;Y:25); { Dimensions du tampon d'acc‚l‚ration }
Cursor:TPoint=(X:0;Y:0); { Position du curseur }
Origin:TPoint=(X:0;Y:0); { R‚gion d'origine du client }
InactiveTitle:PChar='(Inactive %s)'; { Titre de la fenˆtre inactive}
AutoTracking:Boolean=True; { Track curseur dans Write? }
CheckEOF:Boolean=False; { D‚finit un Ctrl+Z comme EOF? }
CheckBreak:Boolean=True; { D‚finit un Ctrl+C comme Break? }
Focused:Boolean=False; { Fenˆtre CRT focus‚? }
Type
LongRec=Record Lo,Hi:Integer;End;{ Enregistrement d'un double mots }
{ Tableau de MinMaxInfo }
PMinMaxInfo=^TMinMaxInfo;
TMinMaxInfo=Array[0..4]of TPoint;
{ Enregistrement de d‚finition des touches de la fenˆtre }
TScrollKey=Record
Key:Byte;
Ctrl:Boolean;
SBar:Byte;
Action:Byte;
End;
{$ENDIF}
Var
{$IFDEF Windows}
WindowTitle:Array[0..79]of Char; { Nom de la fenˆtre CRT }
DC:HDC; { Device globale de contexte }
{$ENDIF}
{ Information sur le CPU et son bus }
CPU:Byte; { Code correspondant au CPU }
Up32Bits:Boolean; { Supporte le code 32-bits? }
CPUID:Boolean; { Supporte l'instruction CPUID? }
CPUVendor:Byte; { Fabricant du CPU (cv????)}
Bus:Byte; { Type de bus }
{Information sur le modŠle d'Ordinateur}
ComputerName:Word;
PS2:Boolean;
{Information sur les Interruptions}
IntExistFlags:Word;
{ Information sur le systŠme d'exploitation }
GetDosVer:Word;
GetDosBlock:DosBlockPtr;
HandleExist:Boolean;
OS2:Boolean;
OS2HiVer,OS2LoVer,Win,WinLoVer,WinHiVer:Byte;
{ Information de pays }
CountryCode,CodePage:Word;
Date:Word;
Curr:Array[0..4]of Char;
ThSep,DeSep,DtSep,TmSep:Array[0..1]of Char;
CurrStyle,Digits:Byte;
Time:TimeType;
CaseUp:Pointer;
DaSep:Array[0..1]of Char;
{ Information sur le(s) lecteur(s) de disquette }
FloppyDskExist:Boolean; { Lecteur de disquette exitante? }
NmFloppyDsk:Byte; { Nombre de lecteur de disquette }
{ Information sur le(s) disque(s) dur }
HardDskExist:Boolean; { Disque dur existant? }
NmHardDsk:Byte; { Nombre de disque dur }
HardDskCtrl:Word; { Type de contr“leur de disque dur }
{Information r‚seau/spooler d'imprimante}
IsNovell:Boolean;
Spooler:Byte;
{ Information sur la manette de jeux }
JoyExist, { Contr“leur de manette de jeux existant? }
BiosJoy:Boolean; { BIOS supporte la manette de jeux? }
JoyPort, { Adresse du port de manette de jeux }
JoyPotentioMeter:Word; { PotentiomŠtre … utiliser avec la manette}
{ Information sur le clavier }
KbdModel,KbdCtrl:Byte;
KbdReadPort:Word;
BiosKbdEnh:Boolean;
{ Information sur le port parallŠle }
LPTExist:Boolean;
NmLPT,Get1LPT:Byte;
{ Information sur le port s‚rie }
SerialExist:Boolean;
NmSerial:Byte;
{ Information sur la m‚moire conventionnel }
MemTotalSize:Word;
EmmExist:Boolean;
EmmSeg,EmmTotalSize:Word; { Information sur EMS }
{ Information sur l''eXtended Memory Manager (XMS) }
XmsExist:Boolean;
XmmCtrl:Pointer;
XmsTotalSize:Word;
{ Information sur la m‚moire ‚tendu g‚r‚ par le Bios Int 15h }
ExtBiosExist:Boolean;
ExtBiosSizeK:Word;
{ Information sur le CMOS }
CtrlCmos:Byte;
CmosPort:Word;
{ Information sur la souris }
Mouse:Byte;
MouseVer,MsButton:Word;
{ Index de proc‚dure ou fonction … r‚f‚rence resource RLL }
{$IFDEF Real}
ind:indRec;
{$ENDIF}
{ Information de port s‚rie pour la souris }
DefMousePort:Word; { Adresse de port s‚rie de la souris par d‚faut }
Const
DefMouseCom:Byte=1; { Port s‚rie par d‚faut de la souris}
TypeMouse:Byte=2; { Type de souris? }
ComLCR:Byte=2; { Port souris LCR }
PicStateMouse:Byte=$10; { tat du PIC? }
IRQIntNumMouse:Byte=$C; { Interruption IRQ par d‚faut de la souris s‚rie }
DefaultLanguage:Byte=0; { Langue Courante: 0 = Fran‡ais, 1 = Anglais }
Procedure AutoDetect;Far;
Procedure Init;Far;
Function viSetVideoModePrim(Mode:Word;Var P:PIV;Var Q:MIV):Byte;Far;
Function viSetVideoSizePrim(Grf,Length,Height:Word;Var P:PIV;Var Q:MIV):Byte;Far;
Procedure Bar(X1,Y1,X2,Y2:Integer;Kr:Word);Far;
Procedure BarChrHor(X1,Y,X2:Byte;Chr:Char);Far;
Procedure BarChrVer(X,Y1,Y2:Byte;Chr:Char);Far;
Procedure BarSpaceHor(X1,Y,X2,Attr:Byte);Far;
Procedure BarSpaceHori(X1,Y,X2,Attr:Byte);Far;
Procedure BarSpaceHorizontal(X1,Y,X2,Attr:Byte);Far;
Procedure BarSpcHor(X1,Y,X2,Attr:Byte);Far;
Procedure BarSpcVer(X,Y1,Y2,Attr:Byte);Far;
Procedure BarTxtHor(X1,Y,X2:Byte;Chr:Char;Attr:Byte);Far;
Function BiosBlinkFound:Boolean;Far;
Function BitsPerPixel:Byte;Far;
Function BytesPerLine:Word;Far;
Function BytesPerLn:Word;Far;
Procedure Circle(X,Y,Rayon:Integer;Color:Word);Far;
Procedure ClearLineHor(X,Y,L,Kr:Word);Far;
Procedure ClearLineHori(X,Y,L,Kr:Word);Far;
Procedure ClearScr(Attr:Byte);Far;
Procedure ClearScreen(Attr:Byte);Far;
Procedure ClearWindow(X1,Y1,X2,Y2,Attr:Byte);Far;
Procedure CloseCur;Far;
Procedure CloseCursor;Far;
Procedure ClrLnHor(X,Y,L,Kr:Word);Far;
Procedure ClrLnHorImg(X,Y,L:Word;BitsPerPixel:Byte;Const Buffer);Far;
Procedure ClrWn(X1,Y1,X2,Y2,Attr:Byte);Far;
Procedure ClrScr(Attr:Byte);Far;
Procedure Cls(Attr:Byte);Far;
Procedure ClsCur;Far;
Function ColorFound:Boolean;Far;
Procedure CopT8Bin(X,Y:Word;Value:Byte;Fore:Word);Far;
Procedure Copy8Bin(X,Y:Word;Value:Byte;Back,Fore:Word);Far;
Procedure FillBnk(aY:LongInt;L,Kr:Word);Far;
Procedure FillBox(X1,Y1,X2,Y2:Byte;Chr:Char;Attr:Byte);Far;
Procedure FillScreen(Attr:Byte);Far;
{$IFNDEF __Windows__}
Function Focused:Boolean;Far;
{$ENDIF}
Function FontFound:Boolean;Far;
Function GetAttr(X,Y:Byte):Byte;Far;
Function GetBitsPerPixel:Byte;Far;
Function GetBytesPerLine:Word;Far;
Function GetBytesPerLn:Word;Far;
Function GetChar(X,Y:Byte):Char;Far;
Function GetCharacter(X,Y:Byte):Char;Far;
Function GetChr(X,Y:Byte):Char;Far;
Function GetCube(X,Y:Byte):Word;Far;
Function GetCur:Word;Far;
Function GetHeightChar:Byte;Far;
Function GetHeightCharacter:Byte;Far;
Function GetHeightChr:Byte;Far;
Procedure GetLnHorImg(X1,Y,X2:Word;Var Buffer);Far;
Function GetMaxColors:Word;Far;
Function GetMaxColor:Word;Far;
Function GetMaxKr:Word;Far;
Function GetMaxPal:Word;Far;
Function GetMaxX:Word;Far;
Function GetMaxXPixels:Word;Far;
Function GetMaxXTxts:Byte;Far;
Function GetMaxY:Word;Far;
Function GetMaxYPixels:Word;Far;
Function GetMaxYTxts:Byte;Far;
Procedure GetMIV(Var X:MIV);Far;
Procedure GetModeInfoVideo(Var X:PIV);Far;
Function GetNmColors:LongInt;Far;
Function GetNmKr:LongInt;Far;
Function GetNmVideoPages:Byte;Far;
Function GetNmXPixels:Word;Far;
Function GetNmXTxts:Byte;Far;
Function GetNmYPixels:Word;Far;
Function GetNmYTxts:Byte;Far;
Function GetNumColors:LongInt;Far;
Function GetNumXPixels:Word;Far;
Function GetNumYPixels:Word;Far;
Procedure GetPhysInfoVideo(Var X:PIV);Far;
Procedure GetPhysicalInfoVideo(Var X:PIV);Far;
Procedure GetPIV(Var X:PIV);Far;
Procedure GetPIVSec(Var X:PIV);Far;
Function GetPixel(X,Y:Word):Word;Far;
Function GetRawY(Y:Byte):Word;Far;
Function GetRealRawY(Y:Word):LongInt;Far;
Function GetRealRawYWord(Y:Word):Word;Far;
Function GetSelPg:Byte;Far;
Function GetSizeSmlImg(X1,Y1,X2,Y2:Word):Word;Far;
Procedure GetSmlImg(X1,Y1,X2,Y2:Word;Var Buffer);Far;
Function GetVideoBitsDAC:Byte;Far;
Function GetVideoBitsIO:Byte;Far;
Function GetVideoBitsROM:Byte;Far;
Function GetVideoBnkPg:Byte;Far;
Function GetVideoCard:Byte;Far;
Function GetVideoCardCat:Byte;Far;
Function GetVideoPg:Byte;Far;
Function GetVideoMem:LongInt;Far;
Function GetVideoMemory:LongInt;Far;
Function GetVideoMode:Word;Far;
Function GetVideoMonitor:Byte;Far;
Function GetVideoScrSize:LongInt;Far;
Function GetVideoSeg:Word;Far;
Function GetVideoSegBuf:Word;Far;
Function GetVideoSegROM:Word;Far;
Function GetVideoShowPg:Byte;Far;
Function GetVideoSizeBnkPg:Word;Far;
Function GetVideoTxtAddrPg:Word;Far;
Function GetVideoTxtMtxPtr:Pointer;Far;
Function GetVidMem:LongInt;Far;
Function GetXCurPos:Byte;Far;
Function GetYCurPos:Byte;Far;
Procedure GotoXY(X,Y:Byte);Far;
Function HeightChr:Byte;Far;
Procedure InitSound;Far;
Function IsBlink:Boolean;Far;
Function IsColor:Boolean;Far;
Function IsDblMtx:Boolean;Far;
Function IsEGA:Boolean;Far;
Function IsGraf:Boolean;Far;
Function IsGraphics:Boolean;Far;
Function IsGraphix:Boolean;Far;
Function IsGrf:Boolean;Far;
Function IsKr:Boolean;Far;
Function IsMono:Boolean;Far;
Function IsMonochrome:Boolean;Far;
Function IsVESA:Boolean;Far;
Function IsVGA:Boolean;Far;
Function IsVideoBlink:Boolean;Far;
Function IsVideoDirectAccess:Boolean;Far;
Function IsVideoModeBios:Boolean;Far;
Function IsVideoModeIBMLogic:Boolean;Far;
Function IsVideoSnow:Boolean;Far;
Function KrFound:Boolean;Far;
Procedure Locate(X,Y:Byte);Far;
Function MaxXTxts:Byte;Far;
Function MaxYTxts:Byte;Far;
Procedure MoveText(X1,Y1,X2,Y2,X3,Y3:Byte);Far;
Function NmXPixels:Word;Far;
Function NmXTxts:Byte;Far;
Function NmYPixels:Word;Far;
Function NmYTxts:Byte;Far;
Procedure PageCopy(S,T:Byte);Far;
Procedure PCopy(S,T:Byte);Far;
Procedure PCopy2Img(Page:Byte;X1,Y1,X2,Y2:Word);Far;
Procedure Plot(X,Y,Kr:Word);Far;
Procedure Point(X,Y,Kr:Word);Far;
Function PrimCardCat:Byte;Far;
Procedure PSet(X,Y,Kr:Word);Far;
Procedure PutCharGAttr(X,Y:Byte;Chr:Char;Attr,GAttr:Byte);Far;
Procedure PutFillBox(X1,Y1,X2,Y2:Integer;Kr:Word);Far;
Procedure PutFillCircle(X,Y,Rayon:Integer;Kr:Word);Far;
Procedure PutFillRoundRect(x1,y1,x2,y2,b,Kr:Integer);Far;
Procedure PutLine(X1,Y1,X2,Y2,Kr:Word);Far;
Procedure PutLineHori(X1,Y,X2,Kr:Word);Far;
Procedure PutLn(X1,Y1,X2,Y2,Kr:Word);Far;
Procedure PutLnHor(X1,Y,X2,Kr:Word);Far;
Procedure PutRect(X1,Y1,X2,Y2,Kr:Integer);Far;
Procedure PutRoundRect(X1,Y1,X2,Y2,LineWidth,B,Kr:Word);Far;
Procedure PutSmlImg(X1,Y1,X2,Y2:Word;Var Buffer);Far;
Procedure PutSprite(X1,Y1,X2,Y2:Word;Var Buffer);Far;
Procedure PutTextXY(X,Y:Byte;Const Str:String;Attr:Byte);Far;
Procedure PutTxtXY(X,Y:Byte;Const Str:String;Attr:Byte);Far;
Procedure PutTxtXYUnCol(X,Y:Byte;Const Str:String);Far;
Procedure PutTxtXYUnKr(X,Y:Byte;Const Str:String);Far;
Procedure ReadBnk(aY:LongInt;L:Word;Var x0);Far;
Procedure SelBnkPg(Pg:Byte);Far;
Procedure SetAttr(X,Y,Attr:Byte);Far;
Procedure SetBackgroundColor(Kr:Byte);Far;
Procedure SetBlink(X:Boolean);Far;
Procedure SetBnkPg(Pg:Byte);Far;
Procedure SetBorderColor(Kr:Byte);Far;
Procedure SetBytesPerLn(X:Word);Far;
Procedure SetChar(X,Y:Byte;Chr:Char);Far;
Procedure SetCharacter(X,Y:Byte;Chr:Char);Far;
Procedure SetChr(X,Y:Byte;Chr:Char);Far;
Procedure SetChrWidth(L:Byte);Far;
Procedure SetCube(X,Y:Byte;Chr:Char;Attr:Byte);Far;
Procedure SetCur(A,B:Byte);Far;
Procedure SetCurPos(X,Y:Byte);Far;
Procedure SetCursor(A,B:Byte);Far;
Procedure SetCursorPos(X,Y:Byte);Far;
Procedure SetCursorPosition(X,Y:Byte);Far;
Procedure SetDblMtx(X:Boolean);Far;
Procedure SetExtChr(X,Y:Byte;Chr:Word);Far;
Procedure SetExtCube(X,Y:Byte;Chr:Word;Attr:Byte);Far;
Procedure SetGCube(X,Y:Word;C:Chr;Attr:Byte);
Procedure SetGCubeT(X,Y:Word;C:Chr;Attr:Byte);
Procedure SetHeightChr(H:Byte);
Procedure SetHorizontalScale(X:Word);Far;
Procedure SetMatrix(Palette,Height:Byte;Number,Start:Word;Var X:TByte);Far;
Procedure SetModeMatrix;Far;
Procedure SetModeMtx;Far;
Procedure SetModeScr;Far;
Procedure SetModeScreen;Far;
Procedure SetModeValue(Mode:Word);Far;
Procedure SetNumYTexts(Y:Byte);Far;
Procedure SetPage(Pg:Byte);Far;
Procedure SetPalBlk(Start,Nm:Word);Far;
Procedure SetPaletteRGB(Start:Word;R,G,B:Byte);Far;
Procedure SetPalRGB(Var P;Start,Num:Word);Far;
Procedure SetPg(Pg:Byte);Far;
Procedure SetPhysInfoVideo(Var X:PIV);Far;
Procedure SetPhysicalInfoVideo(Var X:PIV);Far;
Procedure SetPIV(Var X:PIV);Far;
Procedure SetPixel(X,Y,Kr:Word);Far;
Procedure SetTxtMtx(Mtx:Pointer);
Procedure SetUnderline(X:Boolean);Far;
Procedure SetVerticalScale(Y:Word);Far;
Procedure SetVideoSeg(Seg:Word);Far;
Procedure SetVisualPage(Pg:Byte);Far;
Procedure SetVisualPg(Pg:Byte);Far;
Procedure SetWriteMode(Mode:Byte);Far;
Procedure SplitScreen(Y:Word);Far;
Function Stat(X,Y:Byte):Word;Far;
Function VGA320x400Found:Boolean;Far;
Function VideoFontFound:Boolean;Far;
Function VideoHerculeFound:Boolean;Far;
Function VideoMousePortFound:Boolean;Far;
Function VideoPaletteFound:Boolean;Far;
Procedure WriteBnk(aY:LongInt;L:Word;Const x0);Far;
Procedure WriteXY(X,Y:Byte;Const Str:String;Attr:Byte);Far;
Procedure WriteXYUnKr(X,Y:Byte;Const Str:String);Far;
Function _GetActivePage:Byte;Far;
Function _GetPixel(X,Y:Word):Word;Far;
Function _ImageSize(X1,Y1,X2,Y2:Word):Word;Far;
Procedure _SetActivePage(Pg:Byte);Far;
Procedure Done;Far;
Function viInitVideo:Byte;Far;{Ceci n'est pas … utiliser pour le programmeur...}
{Routine de Luxe/Icon}
Procedure SetLuxe(X:Boolean);
Function IsLuxe:Boolean;
Procedure CloseIcon(X,Y,Attr:Byte);
Procedure DownIcon(X,Y,Attr:Byte);
Procedure LeftIcon(X,Y,Attr:Byte);
Procedure RightIcon(X,Y,Attr:Byte);
Procedure SelIcon(X,Y,Attr:Byte);
Procedure UnSelIcon(X,Y,Attr:Byte);
Procedure UpIcon(X,Y,Attr:Byte);
Procedure ZoomIcon(X,Y,Attr:Byte);
Procedure PutCloseIcon(X,Y,Attr:Byte);
Procedure PutDownIcon(X,Y,Attr:Byte);
Procedure DossierDocumentIcon(X,Y,Attr:Byte);
Procedure DossierProgramIcon(X,Y,Attr:Byte);
{$IFDEF Real}
Procedure mtxStartUp;{Ceci ne n'est pas une proc‚dure mais une table}
Procedure StartUpChantal{(Var Jump:Jumper;Var StartUp:StartUpRec)};Far;
Function DirectAltPress:Boolean;
Function DirectCtrlPress:Boolean;
Procedure DirectFillChar(Var X;Len:Word;Value:Byte);
Procedure DirectGetIntVec(IntNo:Byte;Var Vector:Pointer);
Function DirectGetRawTimer:LongInt;
Function DirectGetRawTimerB:Byte;
Function DirectJoyPos(Axe:Byte):Word;
Function DirectKeyPress:Boolean;
Function DirectLShiftPress:Boolean;
Procedure DirectMove(Const Source;Var Dest;Count:Word);
Procedure DirectMove386(Const Source;Var Dest;Count:Word);
Procedure DirectPushKey(K:Word);
Function DirectRawReadKey:Word;
Function DirectRShiftPress:Boolean;
Procedure DirectSetIntVec(IntNo:Byte;Vector:Pointer);
Function DirectShiftPress:Boolean;
{$ENDIF}
{$IFDEF __Windows__}
Procedure InitWinCrt;
Procedure DoneWinCrt;
Procedure WriteBuf(Buffer:PChar;Count:Word);
Procedure WriteChar(Ch:Char);
Function KeyPressed:Boolean;
Function ReadKey:Char;
Function ReadBuf(Buffer:PChar;Count:Word):Word;
Function WhereX:Integer;
Function WhereY:Integer;
Procedure ClrEol;
Procedure ScrollTo(X,Y:Integer);
Procedure TrackCursor;
Procedure AssignCrt(Var F:Text);
{ Proc‚dure de fenˆtre CRT }
Function CrtWinProc(Window:Word;Message,WParam:Word;LParam:Longint):Longint;Export;
{$ENDIF}
{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}
IMPLEMENTATION
{ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}
{$IFDEF __Windows__}
{ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ}
{ÛÛ Destination/Plate-Forme: WINDOWS ÛÛ}
{ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ}
Uses Video;
Const
{$IFNDEF Win32}
CrtClass:TWndClass=(
Style:cs_HRedraw+cs_VRedraw;
lpfnWndProc:@CrtWinProc;
cbClsExtra:0;
cbWndExtra:0;
hInstance:0;
hIcon:0;
hCursor:0;
hbrBackground:0;
lpszMenuName:NIL;
lpszClassName:'TPWinCrt');
CrtWindow:HWnd=0; { Handle du la fenˆtre CRT }
{$ENDIF}
FirstLine:Integer=0; { PremiŠre ligne dans le tampon circulaire }
KeyCount:Integer=0; { Compteur de touche dans KeyBuffer }
Created:Boolean=False; { Fenˆtre CRT cr‚er? }
Reading:Boolean=False; { Lecture dans la fenêtre CRT? }
Painting:Boolean=False; { Handleur wm_Paint? }
{$IFNDEF Win32}
Var
SaveExit:Pointer; { Pointeur de sauvegarde de la sortie }
ScrBuf:PChar; { Pointeur sur le tampon d'acc‚l‚ration }
ClientSize:TPoint; { Dimensions de la r‚gion Client}
Range:TPoint; { Rangs de la barre de fenˆtrage }
CharSize:TPoint; { Taille de la cellule de caractŠre }
CharAscent:Integer; { CaractŠre ascentu‚ }
PS:TPaintStruct; { Structure globale de peinture }
SaveFont:HFont; { Sauvegarde de la device de police de contexte }
KeyBuffer:Array[0..63]of Char; { Tampon du clavier }
{ Table des touches de fenˆtre }
Const
ScrollKeyCount=12;
ScrollKeys:Array[1..ScrollKeyCount]of TScrollKey=(
(Key:vk_Left; Ctrl:False;SBar:sb_Horz;Action:sb_LineUp),
(Key:vk_Right;Ctrl:False;SBar:sb_Horz;Action:sb_LineDown),
(Key:vk_Left; Ctrl:True; SBar:sb_Horz;Action:sb_PageUp),
(Key:vk_Right;Ctrl:True; SBar:sb_Horz;Action:sb_PageDown),
(Key:vk_Home; Ctrl:False;SBar:sb_Horz;Action:sb_Top),
(Key:vk_End; Ctrl:False;SBar:sb_Horz;Action:sb_Bottom),
(Key:vk_Up; Ctrl:False;SBar:sb_Vert;Action:sb_LineUp),
(Key:vk_Down; Ctrl:False;SBar:sb_Vert;Action:sb_LineDown),
(Key:vk_Prior;Ctrl:False;SBar:sb_Vert;Action:sb_PageUp),
(Key:vk_Next; Ctrl:False;SBar:sb_Vert;Action:sb_PageDown),
(Key:vk_Home; Ctrl:True; SBar:sb_Vert;Action:sb_Top),
(Key:vk_End; Ctrl:True; SBar:sb_Vert;Action:sb_Bottom));
{$ENDIF}
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Fonction Min Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette fonction retourne lequel des deux nombres envoy‚ en paramŠtre est
le plus petit.
}
Function Min(X,Y:Integer):Integer;Begin
If(X<Y)Then Min:=X else Min:=Y
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Fonction Max Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette fonction retourne lequel des deux nombres envoy‚ en paramŠtre est
le plus grand.
}
Function Max(X,Y:Integer):Integer;Begin
If(X>Y)Then Max:=X else Max:=Y
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure InitDeviceContext Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet l'allocation d'une device de contexte.
}
Procedure InitDeviceContext;Begin
{$IFNDEF Win32}
If(Painting)Then DC:=BeginPaint(CrtWindow,PS)Else DC:=GetDC(CrtWindow);
SaveFont:=SelectObject(DC,GetStockObject(System_Fixed_Font))
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure DoneDeviceContext Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet la restitution d'une device contexte.
}
Procedure DoneDeviceContext;Begin
{$IFNDEF Win32}
SelectObject(DC,SaveFont);
If(Painting)Then EndPaint(CrtWindow,PS)Else ReleaseDC(CrtWindow,DC)
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure DoneDeviceContext Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet l'affiche du curseur.
}
Procedure ShowCursor;Begin
{$IFNDEF Win32}
CreateCaret(CrtWindow,0,CharSize.X,2);
SetCaretPos((Cursor.X-Origin.X)*CharSize.X,(Cursor.Y-Origin.Y)*CharSize.Y+CharAscent);
ShowCaret(CrtWindow)
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure DoneDeviceContext Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet la mise … jour de la barre de fenˆtrage.
}
Procedure SetScrollBars;Begin
{$IFNDEF Win32}
SetScrollRange(CrtWindow,sb_Horz,0,Max(1,Range.X),False);
SetScrollPos(CrtWindow,sb_Horz,Origin.X,True);
SetScrollRange(CrtWindow,sb_Vert,0,Max(1,Range.Y),False);
SetScrollPos(CrtWindow,sb_Vert,Origin.Y,True)
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure Terminate Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet la terminaison de la fenˆtre CRT.
}
Procedure Terminate;Begin
{$IFNDEF Win32}
If(Focused)and(Reading)Then CloseCur;
Halt(255)
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure ScrollTo Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet le d‚filement de fenˆtre … l'origine.
}
Procedure ScrollTo(X,Y:Integer);Begin
{$IFNDEF Win32}
If(Created)Then Begin
X:=Max(0,Min(X,Range.X));Y:=Max(0,Min(Y,Range.Y));
If(X<>Origin.X)or(Y<>Origin.Y)Then Begin
If(X<>Origin.X)Then SetScrollPos(CrtWindow,sb_Horz,X,True);
If(Y<>Origin.Y)Then SetScrollPos(CrtWindow,sb_Vert,Y,True);
ScrollWindow(CrtWindow,(Origin.X-X)*CharSize.X,(Origin.Y-Y)*CharSize.Y,Nil,Nil);
Origin.X:=X;Origin.Y:=Y;
UpdateWindow(CrtWindow)
End
End
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure TrackCursor Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet d'effectuer le d‚filement afin de faire rendre le
curseur visible.
}
Procedure TrackCursor;Begin
{$IFNDEF Win32}
ScrollTo(Max(Cursor.X-ClientSize.X+1,Min(Origin.X,Cursor.X)),
Max(Cursor.Y-ClientSize.Y+1,Min(Origin.Y,Cursor.Y)))
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Fonction ScrPtr Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette fonction permet de retourner un pointeur … la position du tampon
d'‚cran.
}
Function ScrPtr(X,Y:Integer):PChar;Begin
{$IFNDEF Win32}
Inc(Y,FirstLine);
If(Y>=ScreenSize.Y)Then Dec(Y,ScreenSize.Y);
ScrPtr:=@ScrBuf[Y*ScreenSize.X+X]
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure ShowText Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet la mise … jour du texte o— le curseur se trouve.
}
Procedure ShowText(L,R:Integer);Begin
{$IFNDEF Win32}
If(L<R)Then Begin
InitDeviceContext;
TextOut(DC,(L-Origin.X)*CharSize.X,(Cursor.Y-Origin.Y)*CharSize.Y,ScrPtr(L,Cursor.Y),R-L);
DoneDeviceContext;
End;
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure WriteBuf Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet d'‚crit dans le tampon de texte de la fenˆtre CRT.
}
Procedure WriteBuf(Buffer:PChar;Count:Word);Var L,R:Integer;
{$IFNDEF Win32}
Procedure NewLine;Begin
ShowText(L,R);
L:=0;R:=0;Cursor.X:=0;Inc(Cursor.Y);
If(Cursor.Y=ScreenSize.Y)Then Begin
Dec(Cursor.Y);Inc(FirstLine);
If(FirstLine=ScreenSize.Y)Then FirstLine:=0;
FillChar(ScrPtr(0,Cursor.Y)^,ScreenSize.X,' ');
ScrollWindow(CrtWindow,0,-CharSize.Y,Nil,Nil);
UpdateWindow(CrtWindow);
End;
End;
{$ENDIF}
Begin
{$IFNDEF Win32}
InitWinCrt;
L:=Cursor.X;R:=Cursor.X;
While Count>0do Begin
Case Buffer^of
#32..#255:Begin
ScrPtr(Cursor.X, Cursor.Y)^:=Buffer^;
Inc(Cursor.X);
If(Cursor.X>R)Then R:=Cursor.X;
If(Cursor.X=ScreenSize.X)Then NewLine;
End;
#13:NewLine;
#8:If Cursor.X>0Then Begin
Dec(Cursor.X);
ScrPtr(Cursor.X,Cursor.Y)^:=' ';
If(Cursor.X<L)Then L:=Cursor.X;
End;
#7:MessageBeep(0);
End;
Inc(Buffer);Dec(Count)
End;
ShowText(L,R);
If(AutoTracking)Then TrackCursor
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Proc‚dure WriteChar Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet d'‚crire un caractŠre dans la fenˆtre CRT.
}
Procedure WriteChar(Ch:Char);Begin
WriteBuf(@Ch,1)
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Fonction KeyPressed Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette fonction retourne l'‚tat du clavier.
}
Function KeyPressed:Boolean;{$IFNDEF Win32}Var M:TMsg;{$ENDIF}Begin
{$IFNDEF Win32}
InitWinCrt;
While PeekMessage(M,0,0,0,pm_Remove)do Begin
If(M.Message=wm_Quit)Then Terminate;
TranslateMessage(M);
DispatchMessage(M);
End;
KeyPressed:=KeyCount>0
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Fonction ReadKey Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette fonction permet la lecture d'un touche dans la fenˆtre CRT.
}
Function ReadKey:Char;Begin
{$IFNDEF Win32}
TrackCursor;
If Not(KeyPressed)Then Begin
Reading:=True;
If(Focused)Then ShowCursor;
Repeat Until KeyPressed;
If(Focused)Then CloseCur;
Reading:=False;
End;
ReadKey:=KeyBuffer[0];Dec(KeyCount);
Move(KeyBuffer[1],KeyBuffer[0],KeyCount);
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Fonction ReadBuf Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette fonction permet la lecture d'un tampon de la fenˆtre CRT.
}
Function ReadBuf(Buffer:PChar;Count:Word):Word;Var Ch:Char;I:Word;Begin
{$IFNDEF Win32}
I:=0;
Repeat
Ch:=ReadKey;
Case(Ch)of
#8:If I>0Then Begin
Dec(I);
WriteChar(#8);
End;
#32..#255:If I<Count-2Then Begin
Buffer[I]:=Ch;Inc(I);
WriteChar(Ch);
End;
End;
Until(Ch=#13)or(CheckEOF and(Ch=#26));
Buffer[I]:=Ch;Inc(I);
If Ch=#13Then Begin
Buffer[I]:=#10;Inc(I);
WriteChar(#13)
End;
TrackCursor;
ReadBuf:=I
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Fonction WhereX Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette fonction retourne la position horizontal actuel dans la fenˆtre
active du curseur.
}
Function WhereX:Integer;Begin
{$IFNDEF Win32}
WhereX:=Cursor.X;
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Fonction WhereY Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette fonction retourne la position vertical actuel dans la fenˆtre
active du curseur.
}
Function WhereY:Integer;Begin
{$IFNDEF Win32}
WhereY:=Cursor.Y;
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Procedure ClrScr Û
ÀÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Destination/Plate-Forme: Windows 3.xx
Description
ÍÍÍÍÍÍÍÍÍÍÍ
Cette proc‚dure permet d'effacer la fenˆtre de l'application.
}
Procedure ClrScr;Begin
{$IFNDEF Win32}
InitWinCrt;
FillChar(ScrBuf^,ScreenSize.X*ScreenSize.Y,' ');
LongInt(Cursor):=0;LongInt(Origin):=0;
SetScrollBars;
InvalidateRect(CrtWindow,NIL,True);
UpdateWindow(CrtWindow);
{$ENDIF}
End;
{ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÜ
³ Procedure FillScreen Û