forked from compuphase/pawn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
history.txt
2695 lines (2295 loc) · 154 KB
/
history.txt
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
Version 4.1, Build 7152
-----------------------
* Optimized assembler core for ARMv6-M architecture (ARM Cortex M0/M0+). Further
(minor) optimizations in the other ARM assembler cores.
* New function amx_VerifyAddress(), to test whether an address is valid in the
sandbox of the abstract machine.
* Added "#pragma opcodeset" in the compiler, so that the instruction set that a
target supports, can be set in the target's configuration file.
* Adjust the assembler cores such that they can be built with either GNU GCC or
GNU AS (both use a different syntax for assembly macros).
* A few more cases were added to the peephole optimizer in the compiler.
* The compiler allows the "var" keyword as the equivalent of the "new" keyword.
That is, "var" creates a new variable.
* The Implementer Guide is expanded with a section (plus an example) on running
scripts from ROM, and minimizing the footprint of the abstract machine.
* Fixes in support for 64-bit code, both in the Pawn compiler and in the abstract
machine.
* Fixes in the garbage collector (this is an optional module for the abstract machine).
* BUG fix: the compiler applied an incorrect high bound for packed strings.
* BUG fix: the compiler did not handle progressive initiallers correctly in
packed arrays.
Version 4.0, Build 5691
-----------------------
* The STACK opcode has different semantics: it now sets the ALT register to the
value of STK after adjusting it (instead of setting it to the value that STK
had before the adjustment). This change has no impact on compiled scripts or
the abstract machine. In the past and current release, the Pawn compiler does
not rely on the ALT register after a STACK opcode.
* Addition of a tool to create "dot" files for the Graphviz programs, to create
graphs of state machines.
* The location of configuration files for target hosts has changed, from the
"bin" directory to the directory "targets". The default configuration file is
now "default.cfg". For backward compatibility, if no "default.cfg" is found
(and no other configuration file is specified), the compiler falls back to
"pawn.cfg" file in the "bin" directory.
* For target host, host-specific include files have moved to a subdirectory with
the name of the target host, below the "include" directory. This is similar to
the locations of host-specific documentation and samples.
* In Quincy (the Pawn IDE), the sample browser has returned. In the menu, see
Tools / Sample browser...
* Portability fix: Linux no longer provides the "spawn()" function, so it has
been simulated with posix_spawn() and waitpid().
* BUG fix: in support of packed opcodes, since the support for 64-bit cells,
negative parameters were no longer optimized to packed opcodes. (The generated
code was correct, but sub-optimal.)
* BUG fix: code generation error for native functions that return an array.
(Pawn functions returning an array were not affected.)
Version 4.0, Build 5588
-----------------------
* The IDE has been rewritten in wxWidgets (instead of MFC), so that it now runs
on Linux as well.
* New warning to check for functions whose existance is checked (in
conditionally compiled sections) before the functions are defined (which also
requires an extra compilation pass).
* Identical literal strings are merged, as to reduce the "data" memory footprint.
* #warning directive (which works like #error, with the excaption that it is a
non-fatal message).
* #pragma warning directive, to push/pop/enable/disable warnings.
* #ifdef and #ifndef are supported (in addition to #if defined) for
compatibility with C.
* The default extension for include files are now both .i and .inc.
* All documentation is updated to a format that is easier to read from a screen
(as opposed to being printed).
* Improved support for new versions of GCC, clang and Borland/Embarcadero.
* BUG fix: dangling comma on initializers of two-dimensional arrays caused
incorrect code generation. This has been corrected.
* BUG fix: when two files have a symbol with the same name, the debugger could
pick the wrong source file. This has been corrected.
* BUG fix in test for UTF-8 files.
Version 4.0, Build 4733
-----------------------
* BUG fix: the optimizer generated wrong code for subtraction of a variable from
a constant. This has been corrected.
* BUG fix: overlay code caused "legacy" virtual instructions to be generated,
instead of the instructions from the new set.
* The CMake build scripts were updated to reflect the changes in recent versions
of CMake.
* In Quincy, the bottom panel may close automatically when it looses focus and
re-open when it gains focus. This allows to keep a large edit window and still
access the build/log windows with a single click. (Note: this functionality
can be disabled in the applocation options.)
* In Quincy, code snippets may now optionally also expand on a space character
(previously, only the TAB character was supported).
* A compilation problem with the ARM7 and Thumb2 cores, in combination with
recent releases of the GNU "newlib" chain, has been corrected.
Version 4.0, Build 4548
-----------------------
* The instruction set of the Pawn abstract machine has been revised and cleaned
up. This release is therefore not compatible with previous releases. AMX files
built with an old version of the Pawn compiler (before 4.0) will not run with
the current abstract machine, and AMX files built with the current compiler
will not run with the old abstract machine.
The Pawn language itself has also changed in the area of handling arrays with
symbolic subscripts and handling packed versus unpacked arrays. The scripts
need to be adjusted to the new syntax to compile in version 4.0.
See the separate "Pawn Porting Guide" for instructions for porting scripts and
host applications from Pawn 3.x to Pawn 4.0.
* The Pawn abstract machine now supports three sets of instructions:
- The "core" set is the minimal set of instructions that an abstract machine
must implement. If you need to mininmize the footprint of the Pawn abstract
machine (e.g. on an embedded system on a small micro-controller), use this
set. A Just-In-Time compiler will typically also implement the core set.
- The "supplemental" set adds macro instructions to the core set. A macro
instruction replaces two or more of the core instructions by a single one.
This reduces the size of the script and makes it run quicker as well (by
reducing the overhead of decoding the instructions). For a Just-In-Time
compiler, it is usually redundant to support this, because the macro
instructions are typically translated to the same native code as the
original sequence of core instructions.
- The "full" instruction set is a superset that adds "packed" instructions to
the supplemental+core instruction set. Packed instructions decrease the
size that the compiled script takes. It is mostly useful on embedded systems
(with a small micro-controller) that run a script from RAM (but have enough
ROM to contain a full abstract machine).
* The interface to public functions in the abstract machine has changed slightly:
functions that allocate memory inside the abstract machine now return only a
single pointer. Previous versions returned two pointers: one pointer to access
the data, and one pointer to pass to the abstract machine (a "virtual" pointer).
The manual has been updated for this; see also the "Pawn Porting Guide".
* The interface in the abstract machine to native functions has changed: native
functions now get passed addresses that it can use directly. Converting
addresses through amx_GetAddr() is no longer needed; in fact, that function
no longer exists. See also the "Pawn Porting Guide" for details.
* The Pawn compiler now generates 32-bit, 64-bit or 16-bit AMX files (for the
abstract machine). A new command-line option indicates the cell size. There
is no more need to create two versions of the Pawn compiler if you wish to
support both 32-bit and 64-bit scripts.
* The "enum" keyword is removed from the Pawn language. Instead, "const" now
declares either single constants or enumerated lists. In most cases, you can
just replace "enum" with "const", but note that the very first constant in
the enumerated list must be initialized (it does not default to zero).
For example:
const a = 10 // single constant
const Ping: { // constant list, default tag is "Ping"
b = 1,
c,
Pong: d // tag override
}
* In the language, the syntaxes for packed and unpacked strings have changed.
A packed string now uses the syntax:
"this is a packed string"
And unpacked string is now enclosed between two pairs of single quotes:
''this is an unpacked string''
The left-most quotes may also be back-quotes (for similarity with TeX):
``this is also an unpacked string''
* For literal arrays and array initialization, the syntax has also changed.
Square brackets now mean unpacked arrays and braces (curly brackets) meand
packed arrays. In a multi-dimensional array, only the last dimension may
be packed.
In practice, this means that in most cases the braces must be replaced by
brackets. For example, to declare and initialize an array with four cells,
you now use:
new rect[4] = [ 1, 2, 3, 4 ]
For packed arrays, you use braces both in the declaration of the array size
and in the initialization. For example:
new packed{10} = {'a', 'b', 'c' ... }
The above declares an array of ten characters (these fit in three cells on a
32-bit configuration).
* The "char" keyword is gone, see above for the new way to declare packed
arrays.
* Previous versions of Pawn used enumerations and tags to simulate a
light-weight variant of structures. This has been replaced by a more direct
way to declare "symbolic indices" in arrays. An array can now be declared
as:
new rect[.left, .top, .right, .bottom]
The array can then only be indexed with one of the declared symbolic fields,
such as in:
rect[.bottom] = rect[.top] + 15
Since the only valid index is a symbolic field, the brackets may be omitted,
giving the shorter equivalent:
rect.bottom = rect.top + 15
Symbolic indices may specify a tag for the field, and may also indicate a
(pseudo-)array. Please see the "Language Guide" for details.
* To make the new way to specify symbolic indices more practical, the "#define"
preprocessor directive now also supports definitions that are delimited with
square brackets. This means that definitions do not have to fit on a single
line. An example of such a declaration:
#define PRODUCT[
.code,
.description{20},
Float: .price
]
Later, this definition can be used to declare an array, for example:
new product[PRODUCT]
* There are many minor improvements in Quincy, which enhance its usability.
For example, when hoovering over a warning or error message, a balloon pops
up with a description text for the message, and the relevant line in the
source code is marked at the same time.
* Quincy has also obtained a symbol browser. This browser gets its data from
the XML reports that are generated by the compiler. The symbol browser also
extracts details from the documentation comments, and shows these in the
pop-up balloons when appropriate.
Version 3.3, build 4127
-----------------------
* The entire Pawn toolkit is now licensed under the Apache license, version 2.
The Apache license is a very liberal license (permitting use in commercial
projects), but it contains a patent clause. The previous license (zLib/libpng)
did not have a patent clause.
* wxQuincy, a minimalistic IDE distributed in the Linux autopackage and TAR files
now comes with source code. The IDE has been enhanced with a multiple-document
interface.
* The compiler is now a little better at guessing the TAB size in case of mixed
indentation with TABs and spaces. This avoids the warning "loose indentation"
to be reported erroneously.
* Keep the stack 8-byte aligned in the ARM7 assembler versions of the abstract
machine (some ARM compilers require this).
* amxFile uses the newest version of minIni.
* Quincy (Microsoft Windows version) now detects FTDI virtual ports (for remote
debugging); it supports up to 15 user help files and it supports host-specific
help files. Quincy now also has the ability to insert accented characters
(extended ASCII), and a new "repeat star in multi-line comments" option.
* BUG fix with strings with an escape character followed by a single line
comment (preprocessor parser error).
* BUG fix in expressions with chained relational operators and constant operands.
* BUG fix in the optimizer: removed redundant calls to malloc().
* BUG fix related to passing arrays based on an enumeration to a function.
* BUG fix in auto-completion in Quincy, related to non-alphabetic characters
('_' and '@').
Version 3.3, build 4097
-----------------------
* The Pawn compiler can now take a configuration file with specific settings for
an environment. New command line option: -T.
* The Linux distribution now comes with a minimalistic IDE, called wxQuincy.
* Uncrustify replaces "artistic style" as the code beautifier for Quincy.
* BUG fix: minor bug correction in missing comma in initialler of 2-dimensional
array.
* Modifications in Quincy: better detection of read-only paths (or drives), an
option to save the file in a different location without aborting the compile,
a message in the "build log" that signals that a source file was changed since
last build (and thus needs rebuilding), a window to view strings received over
the serial line.
* Improvements for GraphApp terminal (for Linux).
Version 3.3, build 4058
-----------------------
* Improvements in documentation comments, among which creating an "auto-summary"
from the phrase in a comment.
* Moved from libffi to Dyncall for the "process and libary control" module.
Dyncall is easier to build, and easier to integrate in a product.
* The interface to the debugger (from Quincy) is improved, especially for
scripts built from multiple source files. It is now also possible to set
break-points while debugging (previously, you either needed to leave the
debugger to set a breakpoint and restart the debugging session, or to set
the breakpoint by typing it in the debugger console).
* Quincy now has auto-completion of known function names and words that it
looks up from the current source file.
* Quincy now uses an improved GREP utility (GNU GREP, with a modification, see
the "grep.txt" file in the archive).
* BUG fix: a regression in handling multi-dimensional arrays.
* BUG fix: amx_GetString() could terminate a string with a double zero byte,
possibly exceeding the maximum array size with one byte.
* BUG fix: the code generator used 17-bit signed values for packed opcodes
(should be 16-bit).
Version 3.3, build 4026
-----------------------
* "exit" state functions are now also supported (in addition to "entry" state
functions).
* The call.pri and jump.pri opcodes have been removed, because they made a
buffer-overrun attack possible.
* Trailing commas are now allowed in the initialization data of arrays. For
example, the comma behind the closing brace of the second sub-array in the
following declaration is allowed (but optional). The commas behind the digits
2 and 4 are allowed too (and also optional).
new arr[2][2] = {
{ 1, 2,},
{ 3, 4,},
}
* The macro substition processor now recognizes the "#" character for
"stringizing" a parameter. For example, if you have the definition
#define log(%1) #%1
Then the expression log(test) will result in "test".
Note that concatenation of literal strings requires an ellipsis in Pawn (which
is different than C/C++). So to combine the parameter with literal strings,
use a syntax like:
#define log(%1) "logging: " ... #%1 ... "\n"
The stringize operator is only available in the replacement text of a macro.
* Support for the "thousands" separator (a comma) in numbers.
* When a source file contains indenting with both spaces and tab characters, and
no explicit tab size is given, the compiler now makes an educated guess for
the tab space to use. This reduces warnings about "loose indentation".
* SECURITY FIX: the CALL.pri and JUMP.pri instructions were removed, because
one could use them to force a jump out of the virtual sand box of the abstract
machine and call arbitrary code that is carefully laid out in the data section
of the script.
* The handshake of the debugger in a remote-debugging configuration is a little
faster. That is, the debugger finds the remote device/host faster. Remote
debugging is typically used with embedded systems.
* Better support for ncurses, which is now also the default for Linux (if it
is installed).
* for the amxProcess module, the dyncall library now replaces the libffi
library, because dyncall comes with ports for Unix/Linux, Macintosh and
Windows (libffi only supported Unix-like systems). The amxProcess module
now also compiles without dyncall, but with reduced functionality.
See http://www.dyncall.org/ for details on dyncall.
* The "binreloc" module is now optional when compiling pawnrun and pawndbg
under Linux; binreloc is part of the "autopackage" developer tools.
* A portable INI file parser in the amxFile extension module.
* Support for code snippets and balloon "info tips" in Quincy, as well as
supporting info-tips in the debugger for the current value of variables.
* Quincy supports workspaces (light-weight projects). A set of open files and
the currently selected compilation options can be saved in a workspace, for
quickly switching between projects.
* Various BUG fixes and improvements in the Pawn debugger (pawndbg) for working
with Quincy.
* BUG fix: the ternary operator ("a ? b : c") had a bug when "b" and "c" were
arrays of different lengths. This bug was reported by Bailopan on the Pawn
forum.
* BUG fix: amxFile had an error in the file CRC calculation.
* BUG fix: function uuencode() in amxString was broken.
* BUG fix: when basing a one-dimensional array on an enumaration and using the
ellipsis ("...") in the initialler to initialize the complete array to a
value, the ellipsis would drop out immediately and fail to fill the remainder
with the given value/sequence.
* BUG fix in amxString: valstr() failed on large numbers.
* BUG fix: a string like "\\" was not accepted by the Pawn compiler (double
backslash at the end of a string).
* BUG fixes in amxpool (minor bugs).
* BUG fix: indexing an undeclared symbol made the compiler abort with an
"assertion failed" message. This has been corrected.
* Various other bug fixes, and many improvements in Quincy.
Version 3.3, build 3930
-----------------------
* New native functions fattrib() and filecrc() in the amxFile module.
* On enum declarations, a "terminating" comma is now optional if there is only
one constant per line.
* Concatenation of literal strings (using "...") in the lexer, see the Language
Guide for details.
* Increased maximum line length for script files in the compiler (it is now
dynamically allocated).
* Implement a true LRU scheme in the overlay pool manager, also add an option
to mark blocks as "protected" (not swapped out).
* Various improvements in the Quincy IDE, including updated documentation.
* Minor fix in pawnrun.c: event-driven programs without main() now also work.
Previously, pawnrun required a script to have a function "main()", even if
that function were just empty.
* BUG fix in one of the new (packed) opcodes. The bug occurred in the "C"
versions of the abstract machine only. The assembler implementations were not affected.
* BUG fix: enum field size was not taken into account when implicitly passed to
a function (default value of a parameter of a function, using "sizeof").
* BUG fix: skipping lines on the imput (in the Pawn compiler) did not work with
UTF8 scanning (a static variable was overwritten).
* BUG fix in amx.c: when calling amx_Exec() with the flag to continue from the
point that the abstract machine encountered a "sleep" instruction, it should
also reload the overlay (a nested call to the AMX could have kicked the
sleeping function out of the pool).
* BUG fix: support array assignment of a two-dimensional array into part of a
three-dimensional array.
* Added opcode "PICK", for copying multi-dimensional arrays.
* Minor corrections in ARM7 assembler syntax (RealView assembler).
* BUG fix: stack not reset correctly for native function returning SLEEP.
* BUG fix: overlays and user-defined operators did not mix.
* BUG fix: the compiler dropped on an assertion in parsing a native function
that returns an array.
Version 3.3, build 3875
-----------------------
* The error system is now more helpful in the common case of a mistyped symbol
name: it tells you the name of a known symbol whose name closely matches.
* The compiler now generates "position-independent code", which makes it easier
to run code from ROM or to load portions of the code as overlays. Old compiled
scripts are transformed automatically to position-independent code (except
for the JIT's, which still use physical code addresses).
* Now that that is mentioned, the abstract machine has hooks and special opcodes
to load overlaid functions and the Pawn compiler can optionally create tables
suitable for this purpose. The Implementer's Guide has a new appendix on using
overlays. Overlays allow the creation of relatively large scripts in a memory
constrained environment (it is used on embedded systems with a hard upper
limit on the amount of RAM for a script, for example).
* The compiler also generates "packed instructions", where the opcode and its
parameter are packed in a single cell.
* amxFile has the new functions frename() and fstat(). Function fstat() returns
the size and the time stamp of a file. In contrast to flength(), this
function does not need to open the file to get its size.
* amxTime has a new function cvttimestamp() to convert Unix timestamps (number
of seconds since midnight of January 1, 1970) to date and time fields. In
addition, function settimestamp() was documented and declared in the header,
but not implemented. This has been corrected.
* amxString now contains the function strcopy(), which copies a packed string
into another packed string and an unpacked string into another unpacked
string. To convert strings between packed and unpacked strings, you can still
use the functions strpack() and strunpack().
* Support for array comparison, with a syntax and restrictions similar to array
assignment. Comparing two arrays is convenient when using arrays as
light-weight structures. Only the "==" and "!=" are implemented, just like
the comparison of structures in C/C++.
* There are new P-code interpreters for the ARM7 architecture. This
implemenation gives a significant performance boost compared to the C version,
especially because it manages to map all pseudo-registers to ARM registers.
The ARM7 core is implemented both in GNU AS syntax and in ARM assembler
syntax, in the files amxexec_arm7_gas.s and amxexec_arm7.s respectively.
* Jacob Dall sent patches to avoid a few common calling-convention issues on
Microsoft Windows.
* Opcode checking has become stricter: when initializing an abstract machine,
the abstract machine tests the parameters of branch instructions and of
instructions that access data in the data segment or the stack/heap.
* BUG fixes for Big Endian processors: one was in loading the debug information
and another in the "getch" code (for Linux/MacOS platforms). Both were
reported by Jim Schimpf on the Pawn forum.
* BUG fix: the garbage collector dereference a pointer before checking for its
validity. This bug was found by Jason Hughes and reported on the Pawn forum.
* BUG fix: amx_FindNative() used binary search on function names, but the
native table is sorted on SYSREQ IDs rather than names. This bug was reported
by "faluco" on the Pawn forum.
* BUG fix: the printf() function in the "console" module did not handle "%%"
correctly. It should print a single "%".
* BUG fix: under particular circumstances (including a file with stock functions
at the bottom of the file, and not using that particular stock function), the
debug information might not refer to the correct file. This bug was signaled
by Jean-Robert Laffineur.
* BUG fix: the debug information always included all public functions, even
those that were not implemented.
* BUG fix: "loo" reported a bug that turned out to be in the "termwin" module
(the "Microsoft Windows" graphical console). This bug occurred with scripts
that use events, and especially keyboard events.
* BUG fix: when using recursive functions, the stack depth check was sometimes
completely wrong and no indication for recursion was given.
* BUG fix: the libcall() function in the "Process" module pushed (on some
environments) the parameters in reversed order.
* BUG fix: the JIT attempted to access memory before that memory was allocated.
This bug was reported by Bailopan on the Pawn forum.
* Other fixes and improvements, notably a list of minor fixes posted by
Søren Hannibal and numerous bug reports by Bailopan.
Version 3.2, build 3664
-----------------------
* BUG fix: using user-defined operators with the compiler option -O2 (for using
macro instructions) could produce code that the abstract machine finds
"invalid". Actually, the code is good, but the abstract machine sees a
combination of instructions that it does not expect.
* The Linux autopackage now uses autopackage version 1.2. This should make the
Linux setup more robust.
* BUG fix: The function libcall() in the amxProcess extension module pushed the
parameters in the wrong order under Microsoft Windows (when the module was
built with Borland C++ and perhaps with other C/C++ compilers too).
* BUG fix: when the conditional operator is used in combination with functions
returning arrays, the heap was restored twice (once too often). In particular
the expression
a ? test1() : test2()
where test1() and test2() are both functions that return an array, had the
effect that both the "true branch" and the "false branch" allocate space for
the return value on the heap, and the heap is restored for the total of
test1() and test2() at the end of the expression. However, only one of the
branches is taken, so the heap is incremented for either test1() or test2(),
but restored for both.
This bug was reported by Bailopan on the Pawn forum.
* BUG fix: the heap checking (overrun and underrun) was incorrect in the JITs.
This made heap underflows go by mostly undetected. This bug was found by
Bailopan, when he investigated the bug with the conditional operator.
* The expression "++a" in a statement like "return ++a" was optimized
incorrectly by the peephole optimizer, because it considered the expression
result as "unused". This also occurred in the statements "sleep" and "exit".
This bug was reported by Bailopan on the Pawn forum.
* BUG fix: "nametable" field in the AMX header was swapped twice on Big Endian
architectures. This bug was reported by Pekka Nikander on the Pawn forum.
* There is a new build macro to remove the default implementation of
amx_Callback(). A patch from Markus Schaber, on the Pawn forum.
* The Abstract Machine core that uses computed gotos ("labels as values") is
now also used for the Intel C/C++ compiler (ICC). The Intel compiler supports
the GNU GCC extension. This change was suggested by Markus Schaber on the Pawn
forum.
* The AMX API functions amx_PushArray() and amx_PushString() now accept NULL for
the "amx_addr" parameter. This is convenient, because amx_Release() can free
heap memory for multiple allocations at once.
* The compiler now adds a warning for the expression
showval (a > 0) ? 1 : 2
because this is interpreted as calling showval() with the parameter "a > 0",
like in:
(showval(a > 0)) ? 1 : 2
What was intended is:
showval((a > 0) ? 1 : 2)
* On Microsoft Windows, there is a second pre-compiled debugger that splits the
debugger output from the script output. This debugger is intended to be used
from an IDE like Quincy.
* The definition of native functions has changed so that "params" is now a
"const" parameter. This gives some protection against inadvertedly changing
the stack in the abstract machine.
* Improved support for running scripts in ROM. In this configuration, the P-code
of the script resides in ROM and the data/stack/heap is in RAM. The abstract
machine must be configured specifically for running scripts in ROM, because
various optimizations (such as relocating jump addresses) no longer work.
* Various minor improvements to the Pawn debugger and the Quincy IDE.
* Various minor optimizations and minor fixes. Some related to Macintosh
support, others to the Linux Autopackage. A few error/warning messages in the
compiler were made more precise/accurate too.
Version 3.2, build 3636
-----------------------
* Performance of the compiler has improved, due to a faster "memory file"
interface. The new interface was donated by the AMX Mod X team
(http://www.amxmodx.org).
* BUG fix: for "optimize level" 2 and when using GCC or the assembler core, the
SYSREQ.N instructions were not replaced correctly by SYSREQ.ND. Mostly, it
failed to replace the instruction; when it did replace the instruction, it
did so at the wrong position, leading to a crash. This problem did not occur
with the ANSI C version of the abstract machine.
* amxProcess now loads libffi dynamically, so that it works with both version
1.20 and version 2.00-beta. Version 1.20 is the only release that can still be
downloaded separately, and which is needed for GCC versions before 3.4;
see http://sources.redhat.com/libffi/.
libffi is only used for the Linux version of amxProcess; the Microsoft Windows
version uses its own code.
* Better checks for unreachable code, including a test for code following an
infinite loop.
* If no AMXLIB environment variable is set, pawnrun and pawndbg now look for
the add-in modules in the same path as where they reside themselves. This
change makes it easier to run Pawn "out of the box" on Linux machines.
* When making an array without specifiying the dimensions, but where the element
count at the lowest dimension is the same for all, the compiler now "counts"
this size, rather than setting the lowest dimension as "variable length".
An example for this situation is the declaration:
new my_array[][] = { {1,0}, {2,1}, {3,1} }
No dimensions are given, but the new compiler determines that the minor
dimension is 2 (and the major dimension is 3). Previous compilers set the
minor dimension to 0 --meaning "variable".
* BUG fix: #elseif handling did not work. Bug reported and patched by "rain" at
the Pawn forum.
* A minor compiler bug (which surfaced when you would change the file output
stage) was reported by Bailopan on the Pawn forum, including a suggested fix.
Version 3.2, build 3599
-----------------------
* Constants (fields) in an enumeration may now be redeclared in other
enumerations, provided that all enumerations have a tag. When arrays are
declared with these enumeration tags for the index, the same constant
name may refer to different elements in different arrays.
* The directive "#pragma depricated" now allows for a comment on the directive
line. This comment is appended to the warning message (warning 234). This
feature was requested on the Pawn forum by "Greenberet" and Felix Kollmann.
* New extension module amxProcess, bringing process control and a "foreign
function interface" (meaning that you can call functions from dynamically
loaded DLLs in Microsoft Windows or shared libraries in Unix/Linux). There
is an example script, gtkcalc, that uses the amxProcess module to create a
simple GUI via gtk-server (see http://www.gtk-server.org/).
* Pawn now uses autopackage 1.0.10, which fixes a problem with the zsh shell
(Linux/Unix).
* BUG fix in handling the "precision" (i.e. the maximum width) of string
parameters in printf() and strformat() (from the amxCons and amxString
modules respectively).
* BUG fix in using a state function before its definition, when this usage
occurs from a fall-back state.
* BUG fix: the "@" character was not allowed in macro definitions (while the
documentation stated that they were). They are now allowed.
* BUG fix: the retail binaries crashed when an extension module invoked a
public function on an event, and that extension module was in a DLL. The
cause was that the DLL contained its own copy of amx_Exec(), but possibly
one that was compiled differently from the amx_Exec() in the main program.
The fix is to let the main host program pass in a pointer to the correct
amx_Exec() to use. This bug was reported by Loo on the Pawn forum.
* BUG fix: when compiling with -O2, an invalid assembler instruction
occasionally popped up. Reported by Brad Benjamin.
* BUG fix: the OP_SYSREQ_N was not handled correctly in the assembly-optimized
version of the AMX. This opcode is only generated when the optimization level
(of the Pawn compiler) is set to 2.
* BUG fix in amxCons in relation with amxString: when strformat() forwards to
amx_printstring() and the format string contains a %s, amx_printstring() is
re-entered, but the redirected output functions were not passed through.
Version 3.1, build 3541
-----------------------
* The debugger now allows for a "split-screen" build, meaning that the debugger
output goes to a simple console window/terminal (or "DOS box") and the
console output produced by the script goes through a second emulated terminal
(termwin for Microsoft Windows, or term_ga for GraphApp).
* Minor improvements in the termwin pseudo-terminal, mostly concerning lay-out.
* For warning 203 (symbol is never used), the reported line number is now the
line of the declaration of the symbol. For warning 204 (symbol is assigned a
value that is never used), the line number is the one at which the latest
assignment appears.
* When the "sleep" instruction is used, the compiler now flags this in its stack
usage report. The stack usage may not be accurate in such case, because the
sleep instruction often permits re-entrancy (this depends on the host
application).
* Quincy now checks for updates once a week. It downloads the PAD file for Pawn
and parses it using TinyXML. You can turn this feature off.
* Relevant modifications from the Quincy 2005 project (http://quincy.codecutter.org)
were merged into the "Quincy for Pawn" project.
* The Windows installer now registers the file extensions .p and .pawn and
associates these with Quincy.
* BUG fixes related to the JIT (it had not been updated in a while).
* BUG fix: a declaration like new array[1000][1000][1000] created invalid code
because the total array size exceeds 4 GiB. A check for this limit was
missing. Reported by Bailopan on the Pawn forum.
* BUG fix: calling a public function from within a script (where the public
function lacks a forward declaration) crashed the compiler. Reported by
Bailopan on the Pawn forum.
* BUG fix: the amx_StrParam() macro copied one character too few to the newly
allocated string. Reported by Peter W.
* BUG fix: a script having zero native functions still required amx_Register()
to be called. This bug was fixed earlier, but it surfaces again... Reported
by Peter W.
Version 3.1, build 3526
-----------------------
* The setup program failed to put the documentation (PDF files) in the
"Documentation" sub-menu in the Start / Program Files menu.
* Quincy was modified so that it would work when installed in a path with a
space character. In addition, the settings are now stored in an INI file,
which resides in the same location as the Quincy.exe file. I prefer INI
files, because they allow multiple installations of a program (in different
directories) with different configurations.
* The modifications done by Allen Cronce for the Mac OS-X port were merged with
the main sources. Apart from the port, the modified source code also features
bug fixes related to the Endianness of the debugging information, so it is
relevant to all users of Big Endian architectures (and who wish to use the
debugger).
Version 3.1, build 3522
-----------------------
* Quincy, a C++ IDE written by Al Stevens and published in Dr. Dobb's Journal,
is now adapted for Pawn. This is a Windows IDE, featuring an editor and a
debugger.
* Remote file uploading functionality in the Pawn debugger (for hosts that
support remote debugging).
Warning: For remote debugging, port 1 now refers to COM1 in Windows (and
ttyS1 in Linux); in previous releases you had to select port 0 for COM1.
* State variables are now available. Just like local variables have a
function-local scope, state variables have a scope restricted to a state
(or a set of states) --but they may be used across functions that implement
that state. The documentation is up to date.
* Keyword "state" is now also an operator; it returns "true" if the automaton
is in the indicated state.
* Macro-instructions for common repeated sequences, for more compact code and
quicker execution. The new compiler option "-O" sets the optimization level.
The JIT does not support these macro instructions, and scripts that may need
to run on the JIT must therefore be compiled with -O1 (standard optimization),
which is also the default setting.
* Support for re-entrant events in handling the "sleep" instruction.
* Added a delay() routine in amxTime.
* Added file matching and counting routines: fexist() (replaces the old
exist() function) and fmatch(). These routines allow wild-cards, similar to
those in the Unix shells.
* The Path to the XSL stylesheet is now stored into the report, and the
stylesheet information is embedded in the XSL file. The generated report can
therefore be viewed directly (with a browser).
* Dynamically loaded extension modules are looked up from the path in the
"AMXLIB" environment variable. This is especially useful for applications
that have a "plugins" directory, for contributed extensions in the form of
Pawn extension modules.
* There is improved support for compiling scripts for execution from read-only
memory.
* Native and public functions can be marked "depricated", to help upgrading to
new scripting environments.
* To avoid a frequent error: (typing) error in the name/signature of a public
function, the compiler now issues a warning if no forward declaration exists
for a public function. The idea is that the (implicitly included) include
file that the host application supplies, contains forward declarations for
all public functions.
Warning: this may require that you add forward declarations to existing
header files.
* The BinReloc package used for Pawn is now version 2.0 (see
www.autopackage.org). This package allows the Pawn compiler to be installed
in any path; it will always find the required include files in directories
that are relative to the path to the executable.
* The compiler uses strlcpy() and strlcat() as safe alternatives for strncpy()
and strncat(). As not all compilers include these functions in their C
library, the source code comes with standard implementations in the file
lstring.c.
* Fixed several bugs related to the order in which automatons were used and
declared.
* BUG fix: the generated code for the entry function (state machines, or
"automatons") had the wrong stack convention.
* Minor corrections in macros (for masking absence of terminal support) in the
console support (amxcons.c).
* BUG fix in strmid() concerning short destination strings.
* BUG fixes in the string packing routine (used a.o. by strcat()).
* CMakeLists.txt for the compiler: minor path-related fix
* BUG fix in amxjitsn.asm, where the JIT code was split into two different
sections for no good reason (probably predating the "mprotect" support code
in amx.c). Bug reported and fixed by David "BAILOPAN" Anderson.
* BUG fix: arrays used in logical expressions were not check for full indexing
(as they should). Specifically, after declarating "new series[10]" an
expression like "if (series || 0)" would compile without errors. Bug
reported and fixed by David "BAILOPAN" Anderson (my fix is somewhat
different, to catch more cases).
* BUG fix: the #error directive ignored the parsing state, so an #error
directive folded inside #if 0 ... #endif still fired. Reported by "chop".
* BUG fix: the tagof operator used as a default value for function arguments
took the tag of a variable, but not of an expression. Reported and fixed by
Jonathan on the Pawn forum.
* BUG fix in recursion detection.
* BUG fix for the sleep opcode: the STK and HEA registers were not updated in
the AMX structure (ANSI C and GNU C versions only; the assembler versions
were correct). Reported and fixed by "chop".
* BUG fix: the "JIT" flag was erased under specific conditions in amx_Init().
* BUG fix: memory block for the JIT code must be aligned under Linux.
* BUG fix: structure packing was incorrect for GCC. Also removed "far"
pointers from the definitions of the debug structures.
* Warning: The fixed point function fixedstr() is renamed to strfixed() to be
in line with the string functions strval() and valstr(). Similarly,
floatstr() is renamed to strfloat().
Change log for older releases
-----------------------------
28/07/2005 BUG fix for the "switch" opcode in the JIT, in the situation
where only the "default" case was present (no other
cases, which means that the switch was actually
redundant). This bug found and fixed by Bailopan, and
reported on the Pawn forum.
BUG fixes for debugging symbols in 64-bit mode, found and fixed
by Bailopan and reported on the Pawn forum.
Fixes in the CMakeList.txt file for compiling under Linux/UNIX.
22/07/2005 The compiler has native support for states and automatons.
Implementing finite state machines is thereby easier,
and the compiler helps in checking that the state
machine is coherent. See the language guide for details.
Several bugs related to arrays and enumerations have been
fixed. Some of these bugs were (also) reported by
Vic Viper on the forums.
Yet one more Big Endian bug was found and fixed.
Robert Daniels found and fixed a problem related to
3-dimensional arrays with a variable last dimension.
His fixes have been merged in the main source.
A 64-bit bug found by Bailopan was fixed. Compact Encoding
should now also work with 64-bit cells.
There are three new native function modules: one with string
manipulation functions, one with simple network packet
exchange functions and one with time/date functions.
A general purpose way to accept event sources has been
implemented in the "pawnrun" example program and in
several of the native function libraries. With this
interface, a native function library can "register"
a public function that it will call upon a specific
event. See pawnrun.c and the modules "amxCons.c"
(@keypressed) and amxTime.c ("@timer") for details and
examples.
The debug protocol has changed completely. The old debug opcodes
are replaced by a single new opcode: BREAK. The debug
information is now appended to the AMX file, instead of
being intermixed with the normal opcodes. The rationale
of the new design is improved performance when running
scripts with debug information, and the ability to
do remote debugging.
The console debugger has been enhanced to support states and to
allow debugging over a serial line (RS-232), provided
that the host application supports the protocol too.
The screen lay-out was improved as well.
The Linux compiler now uses the BinReloc package from
www.autopackage.org to locate the include files and the
configuration file. This should be more robust than the
earlier hack.
The peephole optimizer was improved. After finding an
optimization, it now recurses over all rules to find
(more) optimizations on the adjusted code.
Documentation comments have been improved (and now include the
automatons and the transitions). The lay-out has been
improved as well.
New #pragma "amxlimit" lets the compiler verify that the script
fits the abstract machine after compilation. This is