Commit graph

70 commits

Author SHA1 Message Date
TDRR
2c2b811db0 Add missing Zandronum functions. 2023-10-18 00:17:02 -04:00
Rachael Alexanderson
497dd29e9e - fix more line endings 2021-03-10 11:44:43 -05:00
Dasperal
51b7e7e88b Fixed bug with required optional parameters of MorphActor function 2020-08-28 20:33:33 +02:00
Dasperal
fc4d47b612 Fixed bug with address miscalculation in ternary operator when compiling with -h or #nocompact flags 2019-11-03 17:13:57 +01:00
Ambartsumov Nikolay
8cb3ad63fe Add ternary operator syntax 2019-10-19 18:35:15 +02:00
Gaerzi
3256a3ec46 Add support for colourise/tint translation like SLADE 3's. 2017-03-05 22:50:47 +01:00
nashmuhandes
7d78c58a0a Added REOPEN script 2016-08-29 23:07:26 +08:00
Jordon Moss
afbec00f36 Added KILL script type
Added /*.o to .gitignore as well. We don't want people accidentally
committing object files from their compiles, now do we?
2016-07-28 08:32:34 +02:00
MaxED
b59cc47e53 Fixed: #region blocks should not increase outertokencount (otherwise #library inside a #region will generate the ERR_LIBRARY_NOT_FIRST error). 2016-02-15 15:56:25 +03:00
Christoph Oelckers
28aeaf0c11 Merge branch 'newspecials' 2016-02-06 01:46:52 +01:00
coelckers
6bb023d058 Merge pull request #44 from m-x-d/standardized-error-reports
Changed several Err_Exit calls to behave the same way all the other E…
2016-02-02 12:44:26 +01:00
MaxED
8b958ecbae Changed several Err_Exit calls to behave the same way all the other Err_Exit calls do. 2016-02-02 14:29:32 +03:00
MaxED
4c10065b3b Added #region / #endregion handling. 2016-02-02 14:20:55 +03:00
Christoph Oelckers
0f40a7aebe - fixed: outertokencount must be reset after an #import directive, so that the position check for the inner #library finds the correct value. 2016-01-29 09:59:12 +01:00
Randy Heit
76b8552d4d Enforce #library must be the first thing in an ACS file if it's used 2016-01-28 19:38:56 -06:00
Christoph Oelckers
ab65e882d0 - added new PCodes to handle action specials > 255.
- added some new specials and parameters from EE.
2016-01-25 13:06:36 +01:00
rhinoduck
701c391c3f Fix for function return value speculation
- a speculated function is now marked as returning a value if it is called as such at any point before its definition
- no unwarranted errors about missing return values are raised for speculated functions anymore
2016-01-08 16:36:34 -06:00
rhinoduck
ae6b71612e Fix wrong function index on some recursive calls
- problem: function index for recursive calls does not get updated in
  cases when the definition of the function comes before its use
- solution: treat the function as predefined until we process the whole
  of its body so that a ref gets added if a recusive call is encountered
2015-10-10 17:40:52 +02:00
Edoardo Prezioso
925b279bcd - Fixed the 'division by zero' crash in the constant expression parsing. 2015-09-05 23:05:46 +02:00
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