Commit graph

51 commits

Author SHA1 Message Date
Braden Obrzut
a4326c85a3 - Fixed: Local array initializers didn't work for multi-dimensional arrays. 2015-03-26 18:10:56 -04:00
Braden Obrzut
918a247c0d - Assign the fileDepth of a constant earlier to avoid uninitialized value when evaluating constant. 2015-03-26 17:20:34 -04:00
Randy Heit
95c8faaa22 Prohibit ACS_ExecuteWait inside functions 2015-02-24 19:11:09 -06:00
Randy Heit
0024e3ac6c Comment fix 2015-02-24 19:11:09 -06:00
Randy Heit
6370396036 Fix memset in ParseArrayDims.
- In C, passing an array to a function actually passes a pointer to the
  first element of the array.
2014-12-26 17:41:04 -06:00
Benjamin Berkels
7a36703541 event scripts now have three arguments 2014-10-11 16:34:24 -04:00
Benjamin Berkels
495e6b2142 added new event script type 2014-10-11 16:34:23 -04:00
Randy Heit
93b84fe5f2 Fixed: scriptarray[i] += x generated &= x instead 2014-07-28 19:52:33 -05:00
Randy Heit
fafedb271d Improve error message when using functions in Hexen-compat mode
- When trying to define a function with the -h switch, you previously
  got two error messages on the token following the function, making it
  unclear what the problem was. There is now only one error message at the
  end of the function's parameter list.
2014-07-24 15:00:31 -05:00
Randy Heit
ac678ff7b8 Add script/function arrays to ACC
- Script arrays are semantically identical to map arrays: They have fixed
  sizes and can be multidimensional. They can also be initialized, although
  this is just syntactic sugar. e.g.
    int init_array[2] = { 10, 20 }
  produces code identical to:
    int init_array[2];
    init_array[0] = 10;
    init_array[1] = 20;
  Script arrays are also implicitly initialized to 0, just like any other
  variable in ACS.
- Unlike map arrays, they only exist for the life of the script, and each
  script gets its own copy of the array.
- Script arrays exists in a separate space from script variables. I did
  not repeat the bullshittery of map arrays here. (I still have no idea what I
  was thinking when I designed them that way.)
- Each script and function that uses local arrays is recorded with a new
  chunk: SARY for scripts and FARY for functions. The first two bytes are the
  script/function number, and the rest of the chunk consists of four-byte
  integers describing the size (in ints) of each array used by that
  script/function. To determine how many arrays a script/function uses,
  take the chunk length, subtract two, and divide by four.
2014-07-24 14:41:39 -05:00
Randy Heit
bede8930a8 Fixed: One use of ERR_NOT_AN_ARRAY did not provide the symbol's name 2014-07-22 17:20:38 -05:00
Randy Heit
c447410ad8 Don't convert string constants to numbers for #define
- Fixed: You could not #define a string for use in a library, because it
  was converted to a number at definition time and not at use time. This
  is no longer the case. Symbolic constants now store the string in its
  original form, and they now expand into the string when encountered
  instead of their string table index.
2014-07-21 23:32:57 -05:00
alexey.lysiuk
9487be3e67 Fix compilation on OS X and other systems without non-standard <malloc.h>
All required declarations are in <stdlib.h>
2014-06-07 16:58:50 +03:00
Randy Heit
c6bc836ecb Add support for unary +
- Other languages can do this, and carlcyber noticed ACC couldn't, so now
  it can.
2014-02-04 20:32:27 -06:00
Randy Heit
f099d5e667 Add constant evaluation for ~
- When this operator was added to the language, it never got added to the
  constant expression path, so you could only use it in expressions
  evaluated at runtime.
2014-02-04 20:27:05 -06:00
Randy Heit
26d4df32d4 Fix constant < > <= >= evaluation
- SendExprCommand() evaluated all four of these as their inverse. I
  wouldn't at all be surprised if this was caused by me fixing the
  undefined behavior (Which PopExStk() is called first?) and not
  even noticing that these were reversed because they popped off the stack
  in reverse order.
2014-02-04 20:21:51 -06:00
Randy Heit
3a5bedf702 Fix constant || and && evaluation
- When SendExprCommand() evaluates constant expressions for || and &&,
  it must explicitly pop both operands off the stack before pushing the
  result. The compiler will do normal short-circuiting here, so if it only
  needs one value to determine the result, only one would be popped off
  the stack.
2014-02-04 20:19:13 -06:00
Randy Heit
9af2df3096 - Added desaturation translation support to ACC. This is the same as the % syntax introduced
by DECORATE. Note that the values in the color range are fixed point numbers. i.e. You must
  use 1.0 and not 1. This is in keeping with the existing convention.

SVN r3879 (trunk)
2012-09-20 02:26:58 +00:00
Randy Heit
57040693cd - Fix VC++ 6 warnings.
SVN r3853 (trunk)
2012-08-25 19:29:04 +00:00
Randy Heit
72b11c089f - Optimize away PCD_DUP when the preceding instruction is PCD_PUSHBYTE.
- Added NamedScriptWait (PCD_SCRIPTWAITNAMED) and ACS_NamedExecuteWait.

SVN r3755 (trunk)
2012-07-11 03:59:01 +00:00
Randy Heit
6c45d91701 - Fixed: There was no check for accessing an array without filling out all the required dimensions.
SVN r3409 (trunk)
2012-03-08 23:02:57 +00:00
Randy Heit
3386968b3d - Add proper support for line specials that don't fit in a byte.
SVN r3408 (trunk)
2012-03-08 22:24:00 +00:00
Randy Heit
caa7fbc0c4 - Added the -hh switch, which works like the old -h but with an additional message if the scripts
could not be written in a Hexen-compatible manner.
- Fixed logic for Hexen-compatibility errors: pc_NoShrink by itself does not imply -h.


SVN r3407 (trunk)
2012-03-08 22:06:57 +00:00
Braden Obrzut
5c03978cd7 - Removed pcode escalation with -h since the only thing is does is confuse people into thinking the ZDoom ACC is incompatible with Hexen. ACC will now produce an error when the user attempts to use a feature unsupported by the ACS0 bytecode format.
SVN r3403 (trunk)
2012-03-06 01:56:14 +00:00
Randy Heit
5efc9cc00a - Bump script parameter limit up to 4, since ACS_ExecuteWithResult currently has an unused fifth
parameter that could just as well be passed to a script.

SVN r3392 (trunk)
2012-02-26 02:41:15 +00:00
Randy Heit
14c7636374 - Do not allow scripts to be named "None".
SVN r3391 (trunk)
2012-02-26 02:37:44 +00:00
Randy Heit
c10009b525 - Use case insensitive search when checking for existing script names, since they're case
insensitive in the engine.

SVN r3366 (trunk)
2012-02-16 22:18:01 +00:00
Randy Heit
c99a7cf35e - Added support for named scripts. (Of course, without engine support, it doesn't matter. :)
- Increase the maximum script number from 999 to 32767.
- Only create dummy scripts for scripts WadAuthor's error checker might be interested in: If its
  number doesn't fit in a byte, WadAuthor doesn't need to know about it, because you can't 
  call it directly from a Hexen-format map.

SVN r3358 (trunk)
2012-02-15 00:21:37 +00:00
Braden Obrzut
6e0f75a4d1 - Applied Zom-B's patch for multi-dimension array initializer checks.
SVN r3281 (trunk)
2011-08-17 07:24:38 +00:00
Christoph Oelckers
d189561899 - ACC implementation of strcpy, submitted by FDARI.
SVN r3226 (trunk)
2011-06-13 09:12:56 +00:00
Christoph Oelckers
cb62d422ea - savestring extensions for ACC.
SVN r3203 (trunk)
2011-05-11 22:26:54 +00:00
Randy Heit
e810579a68 - Better error message for trying to cram too many values into an array.
- Fixed: Array initialization in ACC was incorrect for partial initializers, especially with higher dimensions.

SVN r2416 (trunk)
2010-07-08 22:08:20 +00:00
Randy Heit
0dcf40afe6 - Fixed: Visual C++ 6.0 does not have _get_pgmptr(). You just access the variable directly with that version.
- Silenced some conversion warnings made by VC++ 6.
- Added the current working directory (.) as an automatic include directory, just ahead of
  the program directory, for compatibility with older ACCs that had no include path handling.

SVN r2016 (trunk)
2009-12-04 01:15:08 +00:00
Randy Heit
e403e82025 ACS update:
- Add clientside script flag for Skulltag support.
- Change GetActorMomX/Y/Z to GetActorVelX/Y/Z.

SVN r1690 (trunk)
2009-06-30 21:03:21 +00:00
Christoph Oelckers
dc777b74f1 - ACC changes for externally definable functions.
SVN r1576 (trunk)
2009-05-11 21:07:27 +00:00
Randy Heit
83b212acbb - Fixed: ACC must adjust the StatementLevel in ProcessStatement(), not in
LeadingCompoundStatement().

SVN r1395 (trunk)
2009-02-04 00:58:14 +00:00
Randy Heit
0157077f3f - Apparently, va_list is a reference type on x86_64 Linux systems, so
veprintf() needs to make a copy to pass to the second call to
  vfprintf(), since it will be modified by the first call.
- Removed three warnings when compiling with GCC 4.3.


SVN r1328 (trunk)
2008-12-24 18:39:25 +00:00
Randy Heit
96f9dcd051 - Add x and b casts for ACS printing.
- Add ClassifyActor constants to zdefs.acs.

SVN r1311 (trunk)
2008-12-07 03:59:06 +00:00
Christoph Oelckers
78184b3f56 - added ACC 64bit patch from Agent ME.
SVN r1073 (trunk)
2008-07-19 08:01:33 +00:00
Randy Heit
43f6244206 - Added "return" script support to ACC.
SVN r741 (trunk)
2008-02-13 02:27:20 +00:00
Randy Heit
98cd068a97 - Fixed: ACC multiplied array indices one too many times when an optional index for a
multidimensional array was omitted.

SVN r732 (trunk)
2008-02-05 22:41:30 +00:00
Randy Heit
1e63067140 - Fixed: When ACC encountered a bad numeric constant, it could infinite loop
trying to get past it if it was a string without an opening quote, because
  it didn't check for TK_EOF.

SVN r501 (trunk)
2007-03-09 23:52:36 +00:00
Christoph Oelckers
1e12f4404d - Fixed: In the Doom2 cast finale it was impossible to toggle the console.
- Added APROP_Friendly actor property for ACS.
- Added a new flag, MF2_DONTREFLECT that prevents missiles from being reflected.
- Fixed: ALoreShot::DoSpecialDamage must check whether the shooter is still
  present. If it had been removed before the projectile hits its target
  a crash could occur.
- Fixed: GetPlayerInfo was missing breaks and always returned 0 as a result.
- Added Grubber's submission for printing key bindings in ACS.


SVN r491 (trunk)
2007-02-24 12:09:36 +00:00
Christoph Oelckers
818083693a - Fixed: PrintAlias passed FString objects directly to Printf.
- Added bitwise not (~) operator to ACS.


SVN r352 (trunk)
2006-10-09 15:55:47 +00:00
Randy Heit
aebf8d6695 - Removed PCD_PRINTCOLOR.
- Updated ReplaceTextures and SectorDamage parameter counts.

SVN r317 (trunk)
2006-09-01 00:47:32 +00:00
Randy Heit
28018a2859 Added PCD_PRINTCOLOR support to ACC.
SVN r305 (trunk)
2006-08-22 21:46:38 +00:00
Randy Heit
a96324456a - Fixed: Inside an ACS library, you could not use a normal #define to specify
the size of an array. Now #defines are fully processed inside an import but
  are forgotten when the import is popped if they weren't created with
  #libdefine.

SVN r280 (trunk)
2006-08-03 03:45:26 +00:00
Christoph Oelckers
a4879364bb - Added NecroMage's submission for bitwise/shift assignment operators for ACS.
SVN r261 (trunk)
2006-07-16 20:13:24 +00:00
Christoph Oelckers
5b2ebfbb01 - Changed music name handling in MAPINFO so that music can be specified by
full path of a file in a Zip.
- Fixed: intermusic in MAPINFO was limited to WAD lumps and couldn't handle 
  external data.

ACS:

- Fixed: Global and World array symbols didn't initialize their array information.


SVN r182 (trunk)
2006-06-09 08:19:46 +00:00
Randy Heit
23b23f3950 Fix for generating incorrect code for accessing arrays with three or more dimensions.
SVN r15 (trunk)
2006-02-25 03:54:30 +00:00