-
Notifications
You must be signed in to change notification settings - Fork 149
/
Copy pathallegro.bi
3104 lines (2888 loc) · 162 KB
/
allegro.bi
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
'' FreeBASIC binding for allegro-4.4.2
''
'' based on the C header files:
'' ______ ___ ___
'' /\ _ \ /\_ \ /\_ \
'' \ \ \L\ \\//\ \ \//\ \ __ __ _ __ ___
'' \ \ __ \ \ \ \ \ \ \ /'__`\ /'_ `\/\`'__\/ __`\
'' \ \ \/\ \ \_\ \_ \_\ \_/\ __//\ \L\ \ \ \//\ \L\ \
'' \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
'' \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
'' /\____/
'' \_/__/ Version 4.4.2
''
''
'' A game programming library.
''
'' By Shawn Hargreaves, May 19, 2011.
''
'' Allegro is gift-ware. It was created by a number of people working in
'' cooperation, and is given to you freely as a gift. You may use, modify,
'' redistribute, and generally hack it about in any way you like, and you do
'' not have to give us anything in return. However, if you like this product
'' you are encouraged to thank us by making a return gift to the Allegro
'' community. This could be by writing an add-on package, providing a useful
'' bug report, making an improvement to the library, or perhaps just
'' releasing the sources of your program so that other people can learn from
'' them. If you redistribute parts of this code or make a game using it, it
'' would be nice if you mentioned Allegro somewhere in the credits, but you
'' are not required to do this. We trust you not to abuse our generosity.
''
'' Disclaimer:
''
'' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
'' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
'' FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
'' SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
'' FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
'' ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
'' DEALINGS IN THE SOFTWARE.
''
'' translated to FreeBASIC by:
'' FreeBASIC development team
#pragma once
#if defined(__FB_DOS__) or (defined(__FB_WIN32__) and (not defined(ALLEGRO_STATICLINK))) or defined(__FB_UNIX__)
#inclib "alleg"
#endif
#ifdef __FB_UNIX__
#inclib "X11"
#inclib "Xext"
#inclib "Xpm"
#inclib "Xxf86vm"
#inclib "Xcursor"
#elseif defined(__FB_WIN32__) and defined(ALLEGRO_STATICLINK)
#inclib "alleg_s"
#endif
#undef screen
#undef circle
#undef line
#undef palette
#undef rgb
#include once "crt/long.bi"
#include once "crt/errno.bi"
#include once "crt/limits.bi"
#include once "crt/stdarg.bi"
#include once "crt/stddef.bi"
#include once "crt/stdlib.bi"
#include once "crt/time.bi"
#include once "crt/string.bi"
#ifdef __FB_WIN32__
#include once "crt/stdint.bi"
#endif
'' The following symbols have been renamed:
'' #define MID => AL_MID
'' #define EMPTY_STRING => EMPTY_STRING_
'' #define SYSTEM_NONE => SYSTEM_NONE_
'' constant MOUSEDRV_NONE => MOUSEDRV_NONE_
'' constant DRAW_SPRITE_H_FLIP => DRAW_SPRITE_H_FLIP_
'' constant DRAW_SPRITE_V_FLIP => DRAW_SPRITE_V_FLIP_
'' constant DRAW_SPRITE_VH_FLIP => DRAW_SPRITE_VH_FLIP_
'' #define MIDI_DIGMID => MIDI_DIGMID_
'' #define EOF => EOF_
'' #define cpu_fpu => cpu_fpu_
'' #define cpu_mmx => cpu_mmx_
'' #define cpu_3dnow => cpu_3dnow_
'' #ifdef __FB_UNIX__
'' #define TIMERDRV_UNIX_PTHREADS => TIMERDRV_UNIX_PTHREADS_
'' #define SYSTEM_LINUX => SYSTEM_LINUX_
'' #elseif defined(__FB_DOS__)
'' #define SYSTEM_DOS => SYSTEM_DOS_
'' #define KEYDRV_PCDOS => KEYDRV_PCDOS_
'' #define TIMEDRV_FIXED_RATE => TIMEDRV_FIXED_RATE_
'' #define TIMEDRV_VARIABLE_RATE => TIMEDRV_VARIABLE_RATE_
'' #define MOUSEDRV_MICKEYS => MOUSEDRV_MICKEYS_
'' #define MOUSEDRV_INT33 => MOUSEDRV_INT33_
'' #define MOUSEDRV_POLLING => MOUSEDRV_POLLING_
'' #define MOUSEDRV_WINNT => MOUSEDRV_WINNT_
'' #define MOUSEDRV_WIN2K => MOUSEDRV_WIN2K_
'' #endif
'' #if defined(__FB_DOS__) or defined(__FB_UNIX__)
'' #define GFX_VGA => GFX_VGA_
'' #define GFX_MODEX => GFX_MODEX_
'' #define GFX_VBEAF => GFX_VBEAF_
'' #endif
'' #ifdef __FB_UNIX__
'' #define MOUSEDRV_LINUX_PS2 => MOUSEDRV_LINUX_PS2_
'' #define MOUSEDRV_LINUX_IPS2 => MOUSEDRV_LINUX_IPS2_
'' #define MOUSEDRV_LINUX_GPMDATA => MOUSEDRV_LINUX_GPMDATA_
'' #define MOUSEDRV_LINUX_MS => MOUSEDRV_LINUX_MS_
'' #define MOUSEDRV_LINUX_IMS => MOUSEDRV_LINUX_IMS_
'' #define MOUSEDRV_LINUX_EVDEV => MOUSEDRV_LINUX_EVDEV_
'' #elseif defined(__FB_WIN32__)
'' #define SYSTEM_DIRECTX => SYSTEM_DIRECTX_
'' #define GFX_DIRECTX_ACCEL => GFX_DIRECTX_ACCEL_
'' #define GFX_DIRECTX_SAFE => GFX_DIRECTX_SAFE_
'' #define GFX_DIRECTX_SOFT => GFX_DIRECTX_SOFT_
'' #define GFX_DIRECTX_WIN => GFX_DIRECTX_WIN_
'' #define GFX_DIRECTX_OVL => GFX_DIRECTX_OVL_
'' #define GFX_GDI => GFX_GDI_
'' #else
'' #define GFX_XTENDED => GFX_XTENDED_
'' #define DIGI_SB10 => DIGI_SB10_
'' #define DIGI_SB15 => DIGI_SB15_
'' #define DIGI_SB20 => DIGI_SB20_
'' #define DIGI_SBPRO => DIGI_SBPRO_
'' #define DIGI_SB16 => DIGI_SB16_
'' #define DIGI_AUDIODRIVE => DIGI_AUDIODRIVE_
'' #define DIGI_SOUNDSCAPE => DIGI_SOUNDSCAPE_
'' #define MIDI_OPL2 => MIDI_OPL2_
'' #define MIDI_2XOPL2 => MIDI_2XOPL2_
'' #define MIDI_OPL3 => MIDI_OPL3_
'' #define MIDI_SB_OUT => MIDI_SB_OUT_
'' #define MIDI_AWE32 => MIDI_AWE32_
'' #endif
extern "C"
#define ALLEGRO_H
#define ALLEGRO_BASE_H
#define ALLEGRO_COLOR8
#define ALLEGRO_COLOR16
#define ALLEGRO_COLOR24
#define ALLEGRO_COLOR32
#ifdef __FB_UNIX__
const ALLEGRO_UNIX = 1
#elseif defined(__FB_WIN32__)
const ALLEGRO_MINGW32 = 1
#else
const ALLEGRO_DJGPP = 1
#endif
#if defined(__FB_WIN32__) and (not defined(ALLEGRO_STATICLINK))
#define _AL_DLL import
#else
#define _AL_DLL
#endif
#define ALLEGRO_NO_ASM
#define ALLEGRO_USE_C
#ifdef __FB_UNIX__
#define ALLEGRO_PLATFORM_STR "Unix"
#elseif defined(__FB_DOS__)
#define ALLEGRO_PLATFORM_STR "djgpp"
#define ALLEGRO_DOS
#define ALLEGRO_I386
#define ALLEGRO_LITTLE_ENDIAN
#define ALLEGRO_GUESS_INTTYPES_OK
#endif
#if defined(__FB_DOS__) or defined(__FB_UNIX__)
#define ALLEGRO_CONSOLE_OK
#define ALLEGRO_VRAM_SINGLE_SURFACE
#endif
#ifdef __FB_UNIX__
#undef ALLEGRO_COLOR8
#undef ALLEGRO_COLOR16
#undef ALLEGRO_COLOR24
#undef ALLEGRO_COLOR32
const ALLEGRO_COLOR8 = 1
const ALLEGRO_COLOR16 = 1
const ALLEGRO_COLOR24 = 1
const ALLEGRO_COLOR32 = 1
const ALLEGRO_HAVE_INTTYPES_H = 1
#endif
#if defined(__FB_WIN32__) or defined(__FB_UNIX__)
const ALLEGRO_HAVE_STDINT_H = 1
#endif
#ifdef __FB_UNIX__
const ALLEGRO_HAVE_MEMCMP = 1
const ALLEGRO_LITTLE_ENDIAN = 1
#elseif defined(__FB_WIN32__) and defined(ALLEGRO_STATICLINK)
#define ALLEGRO_PLATFORM_STR "MinGW32.s"
#elseif defined(__FB_WIN32__) and (not defined(ALLEGRO_STATICLINK))
#define ALLEGRO_PLATFORM_STR "MinGW32"
#endif
#ifdef __FB_WIN32__
#define ALLEGRO_WINDOWS
#define ALLEGRO_I386
#define ALLEGRO_LITTLE_ENDIAN
#endif
#if defined(__FB_DOS__) or defined(__FB_WIN32__)
#define ALLEGRO_USE_CONSTRUCTOR
#endif
#if defined(__FB_WIN32__) or defined(__FB_UNIX__)
#define ALLEGRO_MULTITHREADED
#endif
#ifdef __FB_UNIX__
#define ALLEGRO_NO_STRICMP
#define ALLEGRO_NO_STRLWR
#define ALLEGRO_NO_STRUPR
#elseif defined(__FB_DOS__)
declare sub _unlock_dpmi_data(byval addr as any ptr, byval size as long)
#define LOCK_DATA(d, s) _go32_dpmi_lock_data(cptr(any ptr, d), s)
#define LOCK_CODE(c, s) _go32_dpmi_lock_code(cptr(any ptr, c), s)
#define UNLOCK_DATA(d, s) _unlock_dpmi_data(cptr(any ptr, d), s)
#define LOCK_VARIABLE(x) LOCK_DATA(cptr(any ptr, @x), sizeof(x))
#define LOCK_FUNCTION(x) LOCK_CODE(cptr(any ptr, x), cint(x##_end) - cint(x))
const ALLEGRO_LFN = 0
#define _video_ds() _dos_ds
#define bmp_select(bmp) _farsetsel((bmp)->seg)
#define bmp_write8(addr, c) _farnspokeb(addr, c)
#define bmp_write15(addr, c) _farnspokew(addr, c)
#define bmp_write16(addr, c) _farnspokew(addr, c)
#macro bmp_write24(addr, c)
scope
_farnspokew(addr, c and &hFFFF)
_farnspokeb(addr + 2, c shr 16)
end scope
#endmacro
#define bmp_write32(addr, c) _farnspokel(addr, c)
#define bmp_read8(addr) _farnspeekb(addr)
#define bmp_read15(addr) _farnspeekw(addr)
#define bmp_read16(addr) _farnspeekw(addr)
#define bmp_read32(addr) _farnspeekl(addr)
#define bmp_read24(addr) (_farnspeekl(addr) and &hFFFFFF)
#endif
#if defined(__FB_DOS__) or defined(__FB_WIN32__)
#define ALLEGRO_ASM_PREFIX "_"
#endif
#ifdef __FB_DOS__
#define ALLEGRO_ASM_USE_FS
#endif
#define ASTDINT_H
#define ALLEGRO_GCC
#if defined(__FB_DOS__) or ((not defined(__FB_64BIT__)) and (defined(__FB_DARWIN__) or defined(__FB_CYGWIN__) or ((not defined(__FB_ARM__)) and (defined(__FB_LINUX__) or defined(__FB_FREEBSD__) or defined(__FB_OPENBSD__) or defined(__FB_NETBSD__))) or defined(__FB_WIN32__)))
#define ALLEGRO_I386
#elseif defined(__FB_64BIT__) and (defined(__FB_DARWIN__) or defined(__FB_CYGWIN__) or ((not defined(__FB_ARM__)) and (defined(__FB_LINUX__) or defined(__FB_FREEBSD__) or defined(__FB_OPENBSD__) or defined(__FB_NETBSD__))) or defined(__FB_WIN32__))
#define ALLEGRO_AMD64
#elseif (not defined(__FB_64BIT__)) and defined(__FB_ARM__) and (defined(__FB_LINUX__) or defined(__FB_FREEBSD__) or defined(__FB_OPENBSD__) or defined(__FB_NETBSD__))
#define ALLEGRO_ARM
#endif
#macro _AL_SINCOS(x, s, c)
scope
(c) = cos(x)
(s) = sin(x)
end scope
#endmacro
#define END_OF_MAIN()
#if defined(__FB_WIN32__) or defined(__FB_UNIX__)
#define LOCK_DATA(d, s)
#define LOCK_CODE(c, s)
#define UNLOCK_DATA(d, s)
#define LOCK_VARIABLE(x)
#define LOCK_FUNCTION(x)
const ALLEGRO_LFN = 1
#endif
#ifdef __FB_UNIX__
#define OTHER_PATH_SEPARATOR asc("/")
#define DEVICE_SEPARATOR asc(!"\0")
#else
#define OTHER_PATH_SEPARATOR asc(!"\\")
#define DEVICE_SEPARATOR asc(":")
#endif
const FA_RDONLY = 1
const FA_HIDDEN = 2
const FA_SYSTEM = 4
const FA_LABEL = 8
const FA_DIREC = 16
const FA_ARCH = 32
const FA_NONE = 0
const FA_ALL = not FA_NONE
#ifdef __FB_UNIX__
declare function _alemu_stricmp(byval s1 as const zstring ptr, byval s2 as const zstring ptr) as long
declare function stricmp alias "_alemu_stricmp"(byval s1 as const zstring ptr, byval s2 as const zstring ptr) as long
declare function _alemu_strlwr(byval string as zstring ptr) as zstring ptr
declare function strlwr alias "_alemu_strlwr"(byval string as zstring ptr) as zstring ptr
declare function _alemu_strupr(byval string as zstring ptr) as zstring ptr
declare function strupr alias "_alemu_strupr"(byval string as zstring ptr) as zstring ptr
#endif
#if defined(__FB_WIN32__) or defined(__FB_UNIX__)
#define _video_ds() _default_ds()
#define _farsetsel(seg)
#define _farnspokeb(addr, val) scope : (*cptr(ubyte ptr, (addr))) = (val) : end scope
#define _farnspokew(addr, val) scope : (*cptr(ushort ptr, (addr))) = (val) : end scope
#define _farnspokel(addr, val) scope : (*cptr(ulong ptr, (addr))) = (val) : end scope
#define _farnspeekb(addr) (*cptr(ubyte ptr, (addr)))
#define _farnspeekw(addr) (*cptr(ushort ptr, (addr)))
#define _farnspeekl(addr) (*cptr(ulong ptr, (addr)))
#endif
#define READ3BYTES(p) (((*cptr(ubyte ptr, (p))) or ((*(cptr(ubyte ptr, (p)) + 1)) shl 8)) or ((*(cptr(ubyte ptr, (p)) + 2)) shl 16))
#macro WRITE3BYTES(p, c)
scope
(*cptr(ubyte ptr, (p))) = (c)
(*(cptr(ubyte ptr, (p)) + 1)) = (c) shr 8
(*(cptr(ubyte ptr, (p)) + 2)) = (c) shr 16
end scope
#endmacro
#if defined(__FB_WIN32__) or defined(__FB_UNIX__)
#define bmp_select(bmp)
#define bmp_write8(addr, c) scope : (*cptr(ubyte ptr, (addr))) = (c) : end scope
#define bmp_write15(addr, c) scope : (*cptr(ushort ptr, (addr))) = (c) : end scope
#define bmp_write16(addr, c) scope : (*cptr(ushort ptr, (addr))) = (c) : end scope
#define bmp_write32(addr, c) scope : (*cptr(ulong ptr, (addr))) = (c) : end scope
#define bmp_read8(addr) (*cptr(ubyte ptr, (addr)))
#define bmp_read15(addr) (*cptr(ushort ptr, (addr)))
#define bmp_read16(addr) (*cptr(ushort ptr, (addr)))
#define bmp_read32(addr) (*cptr(ulong ptr, (addr)))
declare function bmp_read24(byval addr as uinteger) as long
declare sub bmp_write24(byval addr as uinteger, byval c as long)
#endif
#define AL_RAND() rand()
#ifdef __FB_WIN32__
#define ALLEGRO_COLORCONV_ALIGNED_WIDTH
#define ALLEGRO_NO_COLORCOPY
#endif
const ALLEGRO_VERSION = 4
const ALLEGRO_SUB_VERSION = 4
const ALLEGRO_WIP_VERSION = 2
#define ALLEGRO_VERSION_STR "4.4.2"
#define ALLEGRO_DATE_STR "2011"
const ALLEGRO_DATE = 20110519
#ifndef TRUE
const TRUE = -1
#endif
#ifndef FALSE
const FALSE = 0
#endif
#undef MIN
#undef MAX
#undef AL_MID
#define MIN(x, y) iif((x) < (y), (x), (y))
#define MAX(x, y) iif((x) > (y), (x), (y))
#define AL_MID(x, y, z) iif((x) > (y), iif((y) > (z), (y), iif((x) > (z), (z), (x))), iif((y) > (z), iif((z) > (x), (z), (x)), (y)))
#define CLAMP(x, y, z) MAX((x), MIN((y), (z)))
const AL_PI = 3.14159265358979323846
#define AL_ID(a, b, c, d) (((((a) shl 24) or ((b) shl 16)) or ((c) shl 8)) or (d))
extern _AL_DLL allegro_errno as long ptr
type _DRIVER_INFO
id as long
driver as any ptr
autodetect as long
end type
#define ALLEGRO_SYSTEM_H
#define ALLEGRO_UNICODE__H
#define U_ASCII AL_ID(asc("A"), asc("S"), asc("C"), asc("8"))
#define U_ASCII_CP AL_ID(asc("A"), asc("S"), asc("C"), asc("P"))
#define U_UNICODE AL_ID(asc("U"), asc("N"), asc("I"), asc("C"))
#define U_UTF8 AL_ID(asc("U"), asc("T"), asc("F"), asc("8"))
#define U_CURRENT AL_ID(asc("c"), asc("u"), asc("r"), asc("."))
declare sub set_uformat(byval type as long)
declare function get_uformat() as long
declare sub register_uformat(byval type as long, byval u_getc as function(byval s as const zstring ptr) as long, byval u_getx as function(byval s as zstring ptr ptr) as long, byval u_setc as function(byval s as zstring ptr, byval c as long) as long, byval u_width as function(byval s as const zstring ptr) as long, byval u_cwidth as function(byval c as long) as long, byval u_isok as function(byval c as long) as long, byval u_width_max as long)
declare sub set_ucodepage(byval table as const ushort ptr, byval extras as const ushort ptr)
declare function need_uconvert(byval s as const zstring ptr, byval type as long, byval newtype as long) as long
declare function uconvert_size(byval s as const zstring ptr, byval type as long, byval newtype as long) as long
declare sub do_uconvert(byval s as const zstring ptr, byval type as long, byval buf as zstring ptr, byval newtype as long, byval size as long)
declare function uconvert(byval s as const zstring ptr, byval type as long, byval buf as zstring ptr, byval newtype as long, byval size as long) as zstring ptr
declare function uwidth_max(byval type as long) as long
#define uconvert_ascii(s, buf) uconvert(s, U_ASCII, buf, U_CURRENT, sizeof(buf))
#define uconvert_toascii(s, buf) uconvert(s, U_CURRENT, buf, U_ASCII, sizeof(buf))
#define EMPTY_STRING_ !"\0\0\0"
extern _AL_DLL empty_string as zstring * 4
extern _AL_DLL ugetc as function(byval s as const zstring ptr) as long
extern _AL_DLL ugetx as function(byval s as zstring ptr ptr) as long
extern _AL_DLL ugetxc as function(byval s as const zstring ptr ptr) as long
extern _AL_DLL usetc as function(byval s as zstring ptr, byval c as long) as long
extern _AL_DLL uwidth as function(byval s as const zstring ptr) as long
extern _AL_DLL ucwidth as function(byval c as long) as long
extern _AL_DLL uisok as function(byval c as long) as long
declare function uoffset(byval s as const zstring ptr, byval idx as long) as long
declare function ugetat(byval s as const zstring ptr, byval idx as long) as long
declare function usetat(byval s as zstring ptr, byval idx as long, byval c as long) as long
declare function uinsert(byval s as zstring ptr, byval idx as long, byval c as long) as long
declare function uremove(byval s as zstring ptr, byval idx as long) as long
declare function utolower(byval c as long) as long
declare function utoupper(byval c as long) as long
declare function uisspace(byval c as long) as long
declare function uisdigit(byval c as long) as long
declare function ustrsize(byval s as const zstring ptr) as long
declare function ustrsizez(byval s as const zstring ptr) as long
declare function _ustrdup(byval src as const zstring ptr, byval malloc_func as function(byval as uinteger) as any ptr) as zstring ptr
declare function ustrzcpy(byval dest as zstring ptr, byval size as long, byval src as const zstring ptr) as zstring ptr
declare function ustrzcat(byval dest as zstring ptr, byval size as long, byval src as const zstring ptr) as zstring ptr
declare function ustrlen(byval s as const zstring ptr) as long
declare function ustrcmp(byval s1 as const zstring ptr, byval s2 as const zstring ptr) as long
declare function ustrzncpy(byval dest as zstring ptr, byval size as long, byval src as const zstring ptr, byval n as long) as zstring ptr
declare function ustrzncat(byval dest as zstring ptr, byval size as long, byval src as const zstring ptr, byval n as long) as zstring ptr
declare function ustrncmp(byval s1 as const zstring ptr, byval s2 as const zstring ptr, byval n as long) as long
declare function ustricmp(byval s1 as const zstring ptr, byval s2 as const zstring ptr) as long
declare function ustrnicmp(byval s1 as const zstring ptr, byval s2 as const zstring ptr, byval n as long) as long
declare function ustrlwr(byval s as zstring ptr) as zstring ptr
declare function ustrupr(byval s as zstring ptr) as zstring ptr
declare function ustrchr(byval s as const zstring ptr, byval c as long) as zstring ptr
declare function ustrrchr(byval s as const zstring ptr, byval c as long) as zstring ptr
declare function ustrstr(byval s1 as const zstring ptr, byval s2 as const zstring ptr) as zstring ptr
declare function ustrpbrk(byval s as const zstring ptr, byval set as const zstring ptr) as zstring ptr
declare function ustrtok(byval s as zstring ptr, byval set as const zstring ptr) as zstring ptr
declare function ustrtok_r(byval s as zstring ptr, byval set as const zstring ptr, byval last as zstring ptr ptr) as zstring ptr
declare function uatof(byval s as const zstring ptr) as double
declare function ustrtol(byval s as const zstring ptr, byval endp as zstring ptr ptr, byval base as long) as clong
declare function ustrtod(byval s as const zstring ptr, byval endp as zstring ptr ptr) as double
declare function ustrerror(byval err as long) as const zstring ptr
declare function uszprintf(byval buf as zstring ptr, byval size as long, byval format as const zstring ptr, ...) as long
declare function uvszprintf(byval buf as zstring ptr, byval size as long, byval format as const zstring ptr, byval args as va_list) as long
declare function usprintf(byval buf as zstring ptr, byval format as const zstring ptr, ...) as long
#define ustrdup(src) _ustrdup(src, malloc)
#define ustrcpy(dest, src) ustrzcpy(dest, INT_MAX, src)
#define ustrcat(dest, src) ustrzcat(dest, INT_MAX, src)
#define ustrncpy(dest, src, n) ustrzncpy(dest, INT_MAX, src, n)
#define ustrncat(dest, src, n) ustrzncat(dest, INT_MAX, src, n)
#define uvsprintf(buf, format, args) uvszprintf(buf, INT_MAX, format, args)
#define ALLEGRO_CONFIG_H
declare sub set_config_file(byval filename as const zstring ptr)
declare sub set_config_data(byval data as const zstring ptr, byval length as long)
declare sub override_config_file(byval filename as const zstring ptr)
declare sub override_config_data(byval data as const zstring ptr, byval length as long)
declare sub flush_config_file()
declare sub reload_config_texts(byval new_language as const zstring ptr)
declare sub push_config_state()
declare sub pop_config_state()
declare sub hook_config_section(byval section as const zstring ptr, byval intgetter as function(byval as const zstring ptr, byval as long) as long, byval stringgetter as function(byval as const zstring ptr, byval as const zstring ptr) as const zstring ptr, byval stringsetter as sub(byval as const zstring ptr, byval as const zstring ptr))
declare function config_is_hooked(byval section as const zstring ptr) as long
declare function get_config_string(byval section as const zstring ptr, byval name as const zstring ptr, byval def as const zstring ptr) as const zstring ptr
declare function get_config_int(byval section as const zstring ptr, byval name as const zstring ptr, byval def as long) as long
declare function get_config_hex(byval section as const zstring ptr, byval name as const zstring ptr, byval def as long) as long
declare function get_config_float(byval section as const zstring ptr, byval name as const zstring ptr, byval def as single) as single
declare function get_config_id(byval section as const zstring ptr, byval name as const zstring ptr, byval def as long) as long
declare function get_config_argv(byval section as const zstring ptr, byval name as const zstring ptr, byval argc as long ptr) as zstring ptr ptr
declare function get_config_text(byval msg as const zstring ptr) as const zstring ptr
declare sub set_config_string(byval section as const zstring ptr, byval name as const zstring ptr, byval val as const zstring ptr)
declare sub set_config_int(byval section as const zstring ptr, byval name as const zstring ptr, byval val as long)
declare sub set_config_hex(byval section as const zstring ptr, byval name as const zstring ptr, byval val as long)
declare sub set_config_float(byval section as const zstring ptr, byval name as const zstring ptr, byval val as single)
declare sub set_config_id(byval section as const zstring ptr, byval name as const zstring ptr, byval val as long)
declare function list_config_entries(byval section as const zstring ptr, byval names as const zstring ptr ptr ptr) as long
declare function list_config_sections(byval names as const zstring ptr ptr ptr) as long
declare sub free_config_entries(byval names as const zstring ptr ptr ptr)
const ALLEGRO_ERROR_SIZE = 256
extern _AL_DLL __allegro_id alias "allegro_id" as byte
#define allegro_id (*cptr(zstring ptr, @__allegro_id))
extern _AL_DLL allegro_error as zstring * ALLEGRO_ERROR_SIZE
const OSTYPE_UNKNOWN = 0
#define OSTYPE_WIN3 AL_ID(asc("W"), asc("I"), asc("N"), asc("3"))
#define OSTYPE_WIN95 AL_ID(asc("W"), asc("9"), asc("5"), asc(" "))
#define OSTYPE_WIN98 AL_ID(asc("W"), asc("9"), asc("8"), asc(" "))
#define OSTYPE_WINME AL_ID(asc("W"), asc("M"), asc("E"), asc(" "))
#define OSTYPE_WINNT AL_ID(asc("W"), asc("N"), asc("T"), asc(" "))
#define OSTYPE_WIN2000 AL_ID(asc("W"), asc("2"), asc("K"), asc(" "))
#define OSTYPE_WINXP AL_ID(asc("W"), asc("X"), asc("P"), asc(" "))
#define OSTYPE_WIN2003 AL_ID(asc("W"), asc("2"), asc("K"), asc("3"))
#define OSTYPE_WINVISTA AL_ID(asc("W"), asc("V"), asc("S"), asc("T"))
#define OSTYPE_WIN7 AL_ID(asc("W"), asc("I"), asc("N"), asc("7"))
#define OSTYPE_OS2 AL_ID(asc("O"), asc("S"), asc("2"), asc(" "))
#define OSTYPE_WARP AL_ID(asc("W"), asc("A"), asc("R"), asc("P"))
#define OSTYPE_DOSEMU AL_ID(asc("D"), asc("E"), asc("M"), asc("U"))
#define OSTYPE_OPENDOS AL_ID(asc("O"), asc("D"), asc("O"), asc("S"))
#define OSTYPE_LINUX AL_ID(asc("T"), asc("U"), asc("X"), asc(" "))
#define OSTYPE_SUNOS AL_ID(asc("S"), asc("U"), asc("N"), asc(" "))
#define OSTYPE_FREEBSD AL_ID(asc("F"), asc("B"), asc("S"), asc("D"))
#define OSTYPE_NETBSD AL_ID(asc("N"), asc("B"), asc("S"), asc("D"))
#define OSTYPE_OPENBSD AL_ID(asc("O"), asc("B"), asc("S"), asc("D"))
#define OSTYPE_IRIX AL_ID(asc("I"), asc("R"), asc("I"), asc("X"))
#define OSTYPE_DARWIN AL_ID(asc("D"), asc("A"), asc("R"), asc("W"))
#define OSTYPE_QNX AL_ID(asc("Q"), asc("N"), asc("X"), asc(" "))
#define OSTYPE_UNIX AL_ID(asc("U"), asc("N"), asc("I"), asc("X"))
#define OSTYPE_BEOS AL_ID(asc("B"), asc("E"), asc("O"), asc("S"))
#define OSTYPE_HAIKU AL_ID(asc("H"), asc("A"), asc("I"), asc("K"))
#define OSTYPE_MACOS AL_ID(asc("M"), asc("A"), asc("C"), asc(" "))
#define OSTYPE_MACOSX AL_ID(asc("M"), asc("A"), asc("C"), asc("X"))
#define OSTYPE_PSP AL_ID(asc("K"), asc("P"), asc("S"), asc("P"))
extern _AL_DLL os_type as long
extern _AL_DLL os_version as long
extern _AL_DLL os_revision as long
extern _AL_DLL os_multitasking as long
const SYSTEM_AUTODETECT = 0
#define SYSTEM_NONE_ AL_ID(asc("N"), asc("O"), asc("N"), asc("E"))
#define MAKE_VERSION(a, b, c) ((((a) shl 16) or ((b) shl 8)) or (c))
declare function _install_allegro_version_check(byval system_id as long, byval errno_ptr as long ptr, byval atexit_ptr as function(byval func as sub()) as long, byval version as long) as long
declare function install_allegro(byval system_id as long, byval errno_ptr as long ptr, byval atexit_ptr as function(byval func as sub()) as long) as long
#define allegro_init() _install_allegro_version_check(SYSTEM_AUTODETECT, @errno, cptr(function cdecl(byval as sub cdecl()) as long, @atexit), MAKE_VERSION(ALLEGRO_VERSION, ALLEGRO_SUB_VERSION, ALLEGRO_WIP_VERSION))
declare sub allegro_exit()
declare sub allegro_message(byval msg as const zstring ptr, ...)
declare sub get_executable_name(byval output as zstring ptr, byval size as long)
declare function set_close_button_callback(byval proc as sub()) as long
declare sub check_cpu()
const CPU_ID = &h0001
const CPU_FPU = &h0002
const CPU_MMX = &h0004
const CPU_MMXPLUS = &h0008
const CPU_SSE = &h0010
const CPU_SSE2 = &h0020
const CPU_3DNOW = &h0040
const CPU_ENH3DNOW = &h0080
const CPU_CMOV = &h0100
const CPU_AMD64 = &h0200
const CPU_IA64 = &h0400
const CPU_SSE3 = &h0800
const CPU_SSSE3 = &h1000
const CPU_SSE41 = &h2000
const CPU_SSE42 = &h4000
const CPU_FAMILY_UNKNOWN = 0
const CPU_FAMILY_I386 = 3
const CPU_FAMILY_I486 = 4
const CPU_FAMILY_I586 = 5
const CPU_FAMILY_I686 = 6
const CPU_FAMILY_ITANIUM = 7
const CPU_FAMILY_EXTENDED = 15
const CPU_FAMILY_POWERPC = 18
const CPU_MODEL_I486DX = 0
const CPU_MODEL_I486DX50 = 1
const CPU_MODEL_I486SX = 2
const CPU_MODEL_I487SX = 3
const CPU_MODEL_I486SL = 4
const CPU_MODEL_I486SX2 = 5
const CPU_MODEL_I486DX2 = 7
const CPU_MODEL_I486DX4 = 8
const CPU_MODEL_PENTIUM = 1
const CPU_MODEL_PENTIUMP54C = 2
const CPU_MODEL_PENTIUMOVERDRIVE = 3
const CPU_MODEL_PENTIUMOVERDRIVEDX4 = 4
const CPU_MODEL_CYRIX = 14
const CPU_MODEL_UNKNOWN = 15
const CPU_MODEL_K5 = 0
const CPU_MODEL_K6 = 6
const CPU_MODEL_PENTIUMPROA = 0
const CPU_MODEL_PENTIUMPRO = 1
const CPU_MODEL_PENTIUMIIKLAMATH = 3
const CPU_MODEL_PENTIUMII = 5
const CPU_MODEL_CELERON = 6
const CPU_MODEL_PENTIUMIIIKATMAI = 7
const CPU_MODEL_PENTIUMIIICOPPERMINE = 8
const CPU_MODEL_PENTIUMIIIMOBILE = 9
const CPU_MODEL_ATHLON = 2
const CPU_MODEL_DURON = 3
const CPU_MODEL_PENTIUMIV = 0
const CPU_MODEL_XEON = 2
const CPU_MODEL_ATHLON64 = 4
const CPU_MODEL_OPTERON = 5
const CPU_MODEL_POWERPC_601 = 1
const CPU_MODEL_POWERPC_602 = 2
const CPU_MODEL_POWERPC_603 = 3
const CPU_MODEL_POWERPC_603e = 4
const CPU_MODEL_POWERPC_603ev = 5
const CPU_MODEL_POWERPC_604 = 6
const CPU_MODEL_POWERPC_604e = 7
const CPU_MODEL_POWERPC_620 = 8
const CPU_MODEL_POWERPC_750 = 9
const CPU_MODEL_POWERPC_7400 = 10
const CPU_MODEL_POWERPC_7450 = 11
const _AL_CPU_VENDOR_SIZE = 32
extern _AL_DLL cpu_vendor as zstring * _AL_CPU_VENDOR_SIZE
extern _AL_DLL cpu_family as long
extern _AL_DLL cpu_model as long
extern _AL_DLL cpu_capabilities as long
type BITMAP as BITMAP_
type RGB as RGB_
type GFX_VTABLE as GFX_VTABLE_
type GFX_MODE as GFX_MODE_
type SYSTEM_DRIVER
id as long
name as const zstring ptr
desc as const zstring ptr
ascii_name as const zstring ptr
init as function() as long
exit as sub()
get_executable_name as sub(byval output as zstring ptr, byval size as long)
find_resource as function(byval dest as zstring ptr, byval resource as const zstring ptr, byval size as long) as long
set_window_title as sub(byval name as const zstring ptr)
set_close_button_callback as function(byval proc as sub()) as long
message as sub(byval msg as const zstring ptr)
assert as sub(byval msg as const zstring ptr)
save_console_state as sub()
restore_console_state as sub()
create_bitmap as function(byval color_depth as long, byval width as long, byval height as long) as BITMAP ptr
created_bitmap as sub(byval bmp as BITMAP ptr)
create_sub_bitmap as function(byval parent as BITMAP ptr, byval x as long, byval y as long, byval width as long, byval height as long) as BITMAP ptr
created_sub_bitmap as sub(byval bmp as BITMAP ptr, byval parent as BITMAP ptr)
destroy_bitmap as function(byval bitmap as BITMAP ptr) as long
read_hardware_palette as sub()
set_palette_range as sub(byval p as const RGB ptr, byval from as long, byval to as long, byval retracesync as long)
get_vtable as function(byval color_depth as long) as GFX_VTABLE ptr
set_display_switch_mode as function(byval mode as long) as long
display_switch_lock as sub(byval lock as long, byval foreground as long)
desktop_color_depth as function() as long
get_desktop_resolution as function(byval width as long ptr, byval height as long ptr) as long
get_gfx_safe_mode as sub(byval driver as long ptr, byval mode as GFX_MODE ptr)
yield_timeslice as sub()
create_mutex as function() as any ptr
destroy_mutex as sub(byval handle as any ptr)
lock_mutex as sub(byval handle as any ptr)
unlock_mutex as sub(byval handle as any ptr)
gfx_drivers as function() as _DRIVER_INFO ptr
digi_drivers as function() as _DRIVER_INFO ptr
midi_drivers as function() as _DRIVER_INFO ptr
keyboard_drivers as function() as _DRIVER_INFO ptr
mouse_drivers as function() as _DRIVER_INFO ptr
joystick_drivers as function() as _DRIVER_INFO ptr
timer_drivers as function() as _DRIVER_INFO ptr
end type
extern _AL_DLL system_none as SYSTEM_DRIVER
extern _AL_DLL system_driver as SYSTEM_DRIVER ptr
#define _system_driver_list(i) ((@___system_driver_list)[i])
extern _AL_DLL ___system_driver_list alias "_system_driver_list" as _DRIVER_INFO
#define ALLEGRO_SYSTEM_INL
#define ALLEGRO_DEBUG_H
declare sub al_assert(byval file as const zstring ptr, byval linenr as long)
declare sub al_trace(byval msg as const zstring ptr, ...)
declare sub register_assert_handler(byval handler as function(byval msg as const zstring ptr) as long)
declare sub register_trace_handler(byval handler as function(byval msg as const zstring ptr) as long)
declare sub set_window_title(byval name as const zstring ptr)
declare function desktop_color_depth() as long
declare function get_desktop_resolution(byval width as long ptr, byval height as long ptr) as long
#define ALLEGRO_MOUSE_H
const MOUSEDRV_AUTODETECT = -1
const MOUSEDRV_NONE_ = 0
type MOUSE_DRIVER
id as long
name as const zstring ptr
desc as const zstring ptr
ascii_name as const zstring ptr
init as function() as long
exit as sub()
poll as sub()
timer_poll as sub()
position as sub(byval x as long, byval y as long)
set_range as sub(byval x1 as long, byval y_1 as long, byval x2 as long, byval y2 as long)
set_speed as sub(byval xspeed as long, byval yspeed as long)
get_mickeys as sub(byval mickeyx as long ptr, byval mickeyy as long ptr)
analyse_data as function(byval buffer as const zstring ptr, byval size as long) as long
enable_hardware_cursor as sub(byval mode as long)
select_system_cursor as function(byval cursor as long) as long
end type
extern _AL_DLL mousedrv_none as MOUSE_DRIVER
extern _AL_DLL mouse_driver as MOUSE_DRIVER ptr
#define _mouse_driver_list(i) ((@___mouse_driver_list)[i])
extern _AL_DLL ___mouse_driver_list alias "_mouse_driver_list" as _DRIVER_INFO
declare function install_mouse() as long
declare sub remove_mouse()
declare function poll_mouse() as long
declare function mouse_needs_poll() as long
declare sub enable_hardware_cursor()
declare sub disable_hardware_cursor()
const MOUSE_CURSOR_NONE = 0
const MOUSE_CURSOR_ALLEGRO = 1
const MOUSE_CURSOR_ARROW = 2
const MOUSE_CURSOR_BUSY = 3
const MOUSE_CURSOR_QUESTION = 4
const MOUSE_CURSOR_EDIT = 5
const AL_NUM_MOUSE_CURSORS = 6
extern _AL_DLL mouse_sprite as BITMAP ptr
extern _AL_DLL mouse_x_focus as long
extern _AL_DLL mouse_y_focus as long
extern _AL_DLL mouse_x as long
extern _AL_DLL mouse_y as long
extern _AL_DLL mouse_z as long
extern _AL_DLL mouse_w as long
extern _AL_DLL mouse_b as long
extern _AL_DLL mouse_pos as long
extern _AL_DLL freeze_mouse_flag as long
const MOUSE_FLAG_MOVE = 1
const MOUSE_FLAG_LEFT_DOWN = 2
const MOUSE_FLAG_LEFT_UP = 4
const MOUSE_FLAG_RIGHT_DOWN = 8
const MOUSE_FLAG_RIGHT_UP = 16
const MOUSE_FLAG_MIDDLE_DOWN = 32
const MOUSE_FLAG_MIDDLE_UP = 64
const MOUSE_FLAG_MOVE_Z = 128
const MOUSE_FLAG_MOVE_W = 256
extern _AL_DLL mouse_callback as sub(byval flags as long)
declare sub show_mouse(byval bmp as BITMAP ptr)
declare sub scare_mouse()
declare sub scare_mouse_area(byval x as long, byval y as long, byval w as long, byval h as long)
declare sub unscare_mouse()
declare sub position_mouse(byval x as long, byval y as long)
declare sub position_mouse_z(byval z as long)
declare sub position_mouse_w(byval w as long)
declare sub set_mouse_range(byval x1 as long, byval y_1 as long, byval x2 as long, byval y2 as long)
declare sub set_mouse_speed(byval xspeed as long, byval yspeed as long)
declare sub select_mouse_cursor(byval cursor as long)
declare sub set_mouse_cursor_bitmap(byval cursor as long, byval bmp as BITMAP ptr)
declare sub set_mouse_sprite_focus(byval x as long, byval y as long)
declare sub get_mouse_mickeys(byval mickeyx as long ptr, byval mickeyy as long ptr)
declare sub set_mouse_sprite(byval sprite as BITMAP ptr)
declare function show_os_cursor(byval cursor as long) as long
declare function mouse_on_screen() as long
#define ALLEGRO_TIMER_H
const TIMERS_PER_SECOND = cast(clong, 1193181)
#define SECS_TO_TIMER(x) (cast(clong, (x)) * TIMERS_PER_SECOND)
#define MSEC_TO_TIMER(x) (cast(clong, (x)) * (TIMERS_PER_SECOND / 1000))
#define BPS_TO_TIMER(x) (TIMERS_PER_SECOND / cast(clong, (x)))
#define BPM_TO_TIMER(x) ((60 * TIMERS_PER_SECOND) / cast(clong, (x)))
type TIMER_DRIVER
id as long
name as const zstring ptr
desc as const zstring ptr
ascii_name as const zstring ptr
init as function() as long
exit as sub()
install_int as function(byval proc as sub(), byval speed as clong) as long
remove_int as sub(byval proc as sub())
install_param_int as function(byval proc as sub(byval param as any ptr), byval param as any ptr, byval speed as clong) as long
remove_param_int as sub(byval proc as sub(byval param as any ptr), byval param as any ptr)
can_simulate_retrace as function() as long
simulate_retrace as sub(byval enable as long)
rest as sub(byval tyme as ulong, byval callback as sub())
end type
extern _AL_DLL timer_driver as TIMER_DRIVER ptr
#define _timer_driver_list(i) ((@___timer_driver_list)[i])
extern _AL_DLL ___timer_driver_list alias "_timer_driver_list" as _DRIVER_INFO
declare function install_timer() as long
declare sub remove_timer()
declare function install_int_ex(byval proc as sub(), byval speed as clong) as long
declare function install_int(byval proc as sub(), byval speed as clong) as long
declare sub remove_int(byval proc as sub())
declare function install_param_int_ex(byval proc as sub(byval param as any ptr), byval param as any ptr, byval speed as clong) as long
declare function install_param_int(byval proc as sub(byval param as any ptr), byval param as any ptr, byval speed as clong) as long
declare sub remove_param_int(byval proc as sub(byval param as any ptr), byval param as any ptr)
extern _AL_DLL retrace_count as long
declare sub rest(byval tyme as ulong)
declare sub rest_callback(byval tyme as ulong, byval callback as sub())
#define ALLEGRO_KEYBOARD_H
type KEYBOARD_DRIVER
id as long
name as const zstring ptr
desc as const zstring ptr
ascii_name as const zstring ptr
autorepeat as long
init as function() as long
exit as sub()
poll as sub()
set_leds as sub(byval leds as long)
set_rate as sub(byval delay as long, byval rate as long)
wait_for_input as sub()
stop_waiting_for_input as sub()
scancode_to_ascii as function(byval scancode as long) as long
scancode_to_name as function(byval scancode as long) as const zstring ptr
end type
extern _AL_DLL keyboard_driver as KEYBOARD_DRIVER ptr
#define _keyboard_driver_list(i) ((@___keyboard_driver_list)[i])
extern _AL_DLL ___keyboard_driver_list alias "_keyboard_driver_list" as _DRIVER_INFO
declare function install_keyboard() as long
declare sub remove_keyboard()
declare function poll_keyboard() as long
declare function keyboard_needs_poll() as long
extern _AL_DLL keyboard_callback as function(byval key as long) as long
extern _AL_DLL keyboard_ucallback as function(byval key as long, byval scancode as long ptr) as long
extern _AL_DLL keyboard_lowlevel_callback as sub(byval scancode as long)
declare sub install_keyboard_hooks(byval keypressed as function() as long, byval readkey as function() as long)
#define key(i) ((@__key)[i])
extern _AL_DLL __key alias "key" as byte
extern _AL_DLL key_shifts as long
extern _AL_DLL three_finger_flag as long
extern _AL_DLL key_led_flag as long
declare function keypressed() as long
declare function readkey() as long
declare function ureadkey(byval scancode as long ptr) as long
declare sub simulate_keypress(byval keycode as long)
declare sub simulate_ukeypress(byval keycode as long, byval scancode as long)
declare sub clear_keybuf()
declare sub set_leds(byval leds as long)
declare sub set_keyboard_rate(byval delay as long, byval repeat as long)
declare function scancode_to_ascii(byval scancode as long) as long
declare function scancode_to_name(byval scancode as long) as const zstring ptr
enum
__allegro_KB_SHIFT_FLAG = &h0001
__allegro_KB_CTRL_FLAG = &h0002
__allegro_KB_ALT_FLAG = &h0004
__allegro_KB_LWIN_FLAG = &h0008
__allegro_KB_RWIN_FLAG = &h0010
__allegro_KB_MENU_FLAG = &h0020
__allegro_KB_COMMAND_FLAG = &h0040
__allegro_KB_SCROLOCK_FLAG = &h0100
__allegro_KB_NUMLOCK_FLAG = &h0200
__allegro_KB_CAPSLOCK_FLAG = &h0400
__allegro_KB_INALTSEQ_FLAG = &h0800
__allegro_KB_ACCENT1_FLAG = &h1000
__allegro_KB_ACCENT2_FLAG = &h2000
__allegro_KB_ACCENT3_FLAG = &h4000
__allegro_KB_ACCENT4_FLAG = &h8000
end enum
enum
__allegro_KEY_A = 1
__allegro_KEY_B = 2
__allegro_KEY_C = 3
__allegro_KEY_D = 4
__allegro_KEY_E = 5
__allegro_KEY_F = 6
__allegro_KEY_G = 7
__allegro_KEY_H = 8
__allegro_KEY_I = 9
__allegro_KEY_J = 10
__allegro_KEY_K = 11
__allegro_KEY_L = 12
__allegro_KEY_M = 13
__allegro_KEY_N = 14
__allegro_KEY_O = 15
__allegro_KEY_P = 16
__allegro_KEY_Q = 17
__allegro_KEY_R = 18
__allegro_KEY_S = 19
__allegro_KEY_T = 20
__allegro_KEY_U = 21
__allegro_KEY_V = 22
__allegro_KEY_W = 23
__allegro_KEY_X = 24
__allegro_KEY_Y = 25
__allegro_KEY_Z = 26
__allegro_KEY_0 = 27
__allegro_KEY_1 = 28
__allegro_KEY_2 = 29
__allegro_KEY_3 = 30
__allegro_KEY_4 = 31
__allegro_KEY_5 = 32
__allegro_KEY_6 = 33
__allegro_KEY_7 = 34
__allegro_KEY_8 = 35
__allegro_KEY_9 = 36
__allegro_KEY_0_PAD = 37
__allegro_KEY_1_PAD = 38
__allegro_KEY_2_PAD = 39
__allegro_KEY_3_PAD = 40
__allegro_KEY_4_PAD = 41
__allegro_KEY_5_PAD = 42
__allegro_KEY_6_PAD = 43
__allegro_KEY_7_PAD = 44
__allegro_KEY_8_PAD = 45
__allegro_KEY_9_PAD = 46
__allegro_KEY_F1 = 47
__allegro_KEY_F2 = 48
__allegro_KEY_F3 = 49
__allegro_KEY_F4 = 50
__allegro_KEY_F5 = 51
__allegro_KEY_F6 = 52
__allegro_KEY_F7 = 53
__allegro_KEY_F8 = 54
__allegro_KEY_F9 = 55
__allegro_KEY_F10 = 56
__allegro_KEY_F11 = 57
__allegro_KEY_F12 = 58
__allegro_KEY_ESC = 59
__allegro_KEY_TILDE = 60
__allegro_KEY_MINUS = 61
__allegro_KEY_EQUALS = 62
__allegro_KEY_BACKSPACE = 63
__allegro_KEY_TAB = 64
__allegro_KEY_OPENBRACE = 65
__allegro_KEY_CLOSEBRACE = 66
__allegro_KEY_ENTER = 67
__allegro_KEY_COLON = 68
__allegro_KEY_QUOTE = 69
__allegro_KEY_BACKSLASH = 70
__allegro_KEY_BACKSLASH2 = 71
__allegro_KEY_COMMA = 72
__allegro_KEY_STOP = 73
__allegro_KEY_SLASH = 74
__allegro_KEY_SPACE = 75
__allegro_KEY_INSERT = 76
__allegro_KEY_DEL = 77
__allegro_KEY_HOME = 78
__allegro_KEY_END = 79
__allegro_KEY_PGUP = 80
__allegro_KEY_PGDN = 81
__allegro_KEY_LEFT = 82
__allegro_KEY_RIGHT = 83
__allegro_KEY_UP = 84
__allegro_KEY_DOWN = 85
__allegro_KEY_SLASH_PAD = 86
__allegro_KEY_ASTERISK = 87
__allegro_KEY_MINUS_PAD = 88
__allegro_KEY_PLUS_PAD = 89
__allegro_KEY_DEL_PAD = 90
__allegro_KEY_ENTER_PAD = 91
__allegro_KEY_PRTSCR = 92
__allegro_KEY_PAUSE = 93
__allegro_KEY_ABNT_C1 = 94
__allegro_KEY_YEN = 95
__allegro_KEY_KANA = 96
__allegro_KEY_CONVERT = 97
__allegro_KEY_NOCONVERT = 98
__allegro_KEY_AT = 99
__allegro_KEY_CIRCUMFLEX = 100
__allegro_KEY_COLON2 = 101
__allegro_KEY_KANJI = 102
__allegro_KEY_EQUALS_PAD = 103
__allegro_KEY_BACKQUOTE = 104
__allegro_KEY_SEMICOLON = 105
__allegro_KEY_COMMAND = 106
__allegro_KEY_UNKNOWN1 = 107
__allegro_KEY_UNKNOWN2 = 108
__allegro_KEY_UNKNOWN3 = 109
__allegro_KEY_UNKNOWN4 = 110
__allegro_KEY_UNKNOWN5 = 111
__allegro_KEY_UNKNOWN6 = 112
__allegro_KEY_UNKNOWN7 = 113
__allegro_KEY_UNKNOWN8 = 114
__allegro_KEY_MODIFIERS = 115
__allegro_KEY_LSHIFT = 115
__allegro_KEY_RSHIFT = 116
__allegro_KEY_LCONTROL = 117
__allegro_KEY_RCONTROL = 118
__allegro_KEY_ALT = 119
__allegro_KEY_ALTGR = 120
__allegro_KEY_LWIN = 121
__allegro_KEY_RWIN = 122
__allegro_KEY_MENU = 123
__allegro_KEY_SCRLOCK = 124
__allegro_KEY_NUMLOCK = 125
__allegro_KEY_CAPSLOCK = 126
__allegro_KEY_MAX = 127
end enum
const KB_SHIFT_FLAG = __allegro_KB_SHIFT_FLAG
const KB_CTRL_FLAG = __allegro_KB_CTRL_FLAG
const KB_ALT_FLAG = __allegro_KB_ALT_FLAG
const KB_LWIN_FLAG = __allegro_KB_LWIN_FLAG
const KB_RWIN_FLAG = __allegro_KB_RWIN_FLAG