Magnus Norddahl
3504f48bfa
- fix a typo
2019-04-15 14:37:10 +02:00
Magnus Norddahl
3f952e94cd
- fix the throw messages
2019-04-15 14:37:09 +02:00
Christoph Oelckers
74d02811c7
- fixed vector math instructions to use the same order of operations as the VM.
2019-04-15 14:37:07 +02:00
Magnus Norddahl
64387abcce
- add vm_jit cvar to control JIT compilation
2019-04-15 14:37:05 +02:00
Magnus Norddahl
87744b22ab
- update JIT PARAM handling to match the VM instruction change
2019-04-15 14:37:04 +02:00
Magnus Norddahl
43a6fc7227
- RUNTIME_FUNCTION only exists in 64-bit Windows
2019-04-15 14:37:02 +02:00
Magnus Norddahl
a54dbec73a
- fix wrong shift direction
2019-04-15 14:37:01 +02:00
Magnus Norddahl
bd1f529574
- build enough of the unwind opcodes for visual studio's debugger to produce the correct call stack
2019-04-15 14:36:59 +02:00
Magnus Norddahl
ea8725f03b
- construct our own runtime as the one provided by asmjit is too primitive
2019-04-15 14:36:58 +02:00
Magnus Norddahl
89bf3f0455
- add more names to asmjit objects
2019-04-15 14:36:56 +02:00
Magnus Norddahl
7e9e823674
- remove the frameX registers as they were just constant offsets to vmframe that could be merged into other constant offsets
2019-04-15 14:36:55 +02:00
Magnus Norddahl
475510c8ea
- give the remaining virtual registers names
2019-04-15 14:36:53 +02:00
Magnus Norddahl
68c05a424b
- give temp registers names and reuse the FString object for formatting names
2019-04-15 14:36:52 +02:00
Magnus Norddahl
d48738437b
- skip RESULT opcodes when outputting assembly
2019-04-15 14:36:51 +02:00
Magnus Norddahl
77850c1ec5
- clean up assembly output slightly by only generating labels for the opcodes jumped to
2019-04-15 14:36:49 +02:00
Magnus Norddahl
316010378d
- fix CASTB opcode implementation
2019-04-15 14:36:48 +02:00
Magnus Norddahl
2c89d1e694
- fix missing convert from float to double in LSP and LSP_R opcodes
...
- fix missing convert from double to float in SSP and SSP_R opcodes
2019-04-15 14:36:46 +02:00
Magnus Norddahl
9b9113d0c4
- fix debug build compile error
2019-04-15 14:36:44 +02:00
Magnus Norddahl
7230974c1e
- remove the need to do any VARF_Native runtime checks by making native functions use the same calling convention as the script version
2019-04-15 14:36:43 +02:00
Magnus Norddahl
ae6c7e541c
- do script calls directly from asmjit without using a lambda wrapper
...
- do VARF_Native check at compile time when possible
2019-04-15 14:36:41 +02:00
Magnus Norddahl
37dfbba232
- add -dumpjit command line parameter that dumps the JIT log for all functions to dumpjit.txt
...
# Conflicts:
# src/scripting/backend/vmbuilder.cpp
2019-04-15 14:36:39 +02:00
Magnus Norddahl
a60ac7b47d
- fix return warning
2019-04-15 14:33:49 +02:00
Magnus Norddahl
e7f0b7a0bd
- switch to using setjmp/longjmp for exception handling
2019-04-15 14:33:47 +02:00
Magnus Norddahl
b24ec1f9cc
- add disabled code that attempts to load registers directly from function arguments
2019-04-15 14:33:46 +02:00
Magnus Norddahl
04ba3ede16
- add missing include statement
2019-04-15 14:33:44 +02:00
Magnus Norddahl
6db9b1394c
- allocate VMFrame on the stack for simple functions with no strings
2019-04-15 14:33:43 +02:00
Magnus Norddahl
84d2de34f0
- remove argument not used anymore
2019-04-15 14:33:41 +02:00
Magnus Norddahl
f0c059678b
- move VM creation into the jitted function. this will allow the jit compiler to skip vm frame creation when possible
2019-04-15 14:33:39 +02:00
Magnus Norddahl
baaed0920a
- create ScriptCall function pointer on VMScriptFunction
2019-04-15 14:33:37 +02:00
Magnus Norddahl
03689cf004
- modify the VM calling convention so that the callee sets up its own VM frame
2019-04-15 14:33:35 +02:00
Magnus Norddahl
992c097ad1
- fix wrong registers getting saved when passing parameters by reference
2019-04-15 14:33:34 +02:00
Magnus Norddahl
19ae43be17
- removed CanJit as all opcodes are now implemented
...
- fix some store bugs
2019-04-15 14:33:32 +02:00
Magnus Norddahl
b3aeb37189
- fix 32 bit compile errors
2019-04-15 14:33:31 +02:00
Magnus Norddahl
e2dcca611c
- catch and rethrow c++ exceptions
2019-04-15 14:33:29 +02:00
Magnus Norddahl
22e60d74ad
- reuse temp virtual registers
2019-04-15 14:33:28 +02:00
Magnus Norddahl
80cda43370
- workaround bug in asmjit's register allocator for calls where the return register is already allocated in a physical register needed by one of the call arguments
2019-04-15 14:33:26 +02:00
Magnus Norddahl
bb3d0021d6
- switch ToMemAddress to imm_ptr where allowed
2019-04-15 14:33:25 +02:00
Magnus Norddahl
f90019561d
- switch from ASMJIT_ARCH_X64 to ASMJIT_ARCH_64BIT when checking if we need to use 64-bit pointers
2019-04-15 14:33:23 +02:00
Magnus Norddahl
e0f0511d29
- create a very basic OP_IJMP implementation
2019-04-15 14:33:22 +02:00
Magnus Norddahl
812a4290b1
- create CreateCall helper to get rid of a lot of the cc.call boilerplate
2019-04-15 14:33:20 +02:00
Magnus Norddahl
ff6317d6f4
- implement OP_TAIL and OP_TAIL_K
2019-04-15 14:33:19 +02:00
Magnus Norddahl
be6637dd17
- use the ParamOpcodes array for finding the OP_PARAM's used by a call
2019-04-15 14:33:17 +02:00
Magnus Norddahl
f1f2dca792
- implement string version of OP_CAST
2019-04-15 14:33:16 +02:00
Magnus Norddahl
0cf5f3704b
- implement string part of OP_CASTB
2019-04-15 14:33:14 +02:00
Magnus Norddahl
097de74510
- implement OP_LFP
2019-04-15 14:33:13 +02:00
Magnus Norddahl
7f996b5334
- read the parameters and registers directly off the stack
2019-04-15 14:33:11 +02:00
Jonathan Russell
ff421eda63
- changed a bunch of manual address additions in string opcodes to leas
2019-04-15 14:33:10 +02:00
Magnus Norddahl
b6521467f3
- more load fixes
2019-04-15 14:33:08 +02:00
Magnus Norddahl
e28389ad12
- fix truncated load addresses due to a bug in asmjit
...
- change ToMemAddress to use uint64_t
2019-04-15 14:33:06 +02:00
Magnus Norddahl
db0c516693
- avoid certain x86::ptr overloads as the last argument is not always an offset
2019-04-15 14:33:05 +02:00
Jonathan Russell
0da351bfea
- fixed typo in last commit
2019-04-15 14:33:03 +02:00
Jonathan Russell
2dd2344e80
- implemented SS_R, LCS_R, and LKS_R
2019-04-15 14:33:02 +02:00
Magnus Norddahl
fb7df75011
- fix bug in LKF_R
2019-04-15 14:33:00 +02:00
Magnus Norddahl
d74cc3e49e
- fixed OP_VTBL bug
2019-04-15 14:32:59 +02:00
Magnus Norddahl
e93d9570dc
- fix crash in OP_RET handling
2019-04-15 14:32:57 +02:00
Magnus Norddahl
378e58731a
- simplify some code
2019-04-15 14:32:56 +02:00
Jonathan Russell
b342dbc8db
- added string PARAM and RET
2019-04-15 14:32:54 +02:00
Magnus Norddahl
608f49a4a8
- fix clang errors and warnings
2019-04-15 14:32:53 +02:00
Jonathan Russell
06780bf228
- added OP_MOVES, OP_CONCAT, OP_LENS, OP_CMPS
2019-04-15 14:32:52 +02:00
Magnus Norddahl
a4b3536caf
- fix opcodes not being listed in jit debug assembly
2019-04-15 14:32:50 +02:00
Magnus Norddahl
c328f9c85c
- move EmitRESULT to jit_call
2019-04-15 14:32:49 +02:00
Magnus Norddahl
ff8d21b2ec
- minor cleanups in header file
2019-04-15 14:32:47 +02:00
Magnus Norddahl
9d970a1acb
- split JitCompiler into multiple files
2019-04-15 14:32:46 +02:00
Jonathan Russell
8905701df7
- added strings and a few string opcodes
2019-04-15 14:32:44 +02:00
Magnus Norddahl
f3ca96373a
- fix CALL_K and disable CALL
2019-04-15 14:32:43 +02:00
Magnus Norddahl
56fe7af9d3
- implement OP_CALL and OP_CALL_K
2019-04-15 14:32:41 +02:00
Magnus Norddahl
60ee2c91a4
- fix misc integer opcodes and remove mov statements when they have no effect
2019-04-15 14:32:40 +02:00
Jonathan Russell
279e97fcc9
- changed the way EmitComparisonOpcode works to get rid of the temporary register that was used previously
2019-04-15 14:32:38 +02:00
Magnus Norddahl
c248fad17f
- implement PARAM and PARAMI
2019-04-15 14:32:37 +02:00
Magnus Norddahl
53b11dd0d8
- fix missing zero extend
2019-04-15 14:32:36 +02:00
Magnus Norddahl
29f6258d33
- fix that the code for META and CLSS was swapped
2019-04-15 14:32:34 +02:00
Magnus Norddahl
c2669d3a03
- some jump fixes
2019-04-15 14:32:33 +02:00
Magnus Norddahl
f7dd6a1313
- fix jump direction in EmitComparisonOpcode
2019-04-15 14:32:31 +02:00
Jonathan Russell
9530a2e43c
- more spelling mistakes...
2019-04-15 14:32:29 +02:00
Jonathan Russell
a770b3af16
- fix minor spelling error
2019-04-15 14:32:28 +02:00
Jonathan Russell
821c336c5e
- add vector comparison opcodes
2019-04-15 14:32:26 +02:00
Magnus Norddahl
14d6aa8cac
- remove some macros and add functions checking if a register needs to be copied
2019-04-15 14:32:25 +02:00
Magnus Norddahl
35a8162022
- implemented LBIT, SBIT, VTBL, SCOPE, NEW, NEW_K, THROW, EQA_R and EQA_K
2019-04-15 14:32:23 +02:00
Magnus Norddahl
4cab630871
- implement emitter functions for LKP_R, META, CLSS, LO, LO_R, LP, LP_R, SO, SO_R, SP, SP_R
...
- add emit code for throwing exceptions on null pointers
2019-04-15 14:32:22 +02:00
Magnus Norddahl
2efaa7846d
- improve jit debug output slightly
2019-04-15 14:32:20 +02:00
Magnus Norddahl
f0dbc8414a
- fix offsetting bug when loading address registers
2019-04-15 14:32:19 +02:00
Magnus Norddahl
db78d02d79
- fix swapped operands in EmitSUBF_KR
2019-04-15 14:32:17 +02:00
Magnus Norddahl
ede8c6d86b
- implement MODF_RR, MODF_RK and MODF_KR
2019-04-15 14:32:16 +02:00
Magnus Norddahl
708362b31f
- fix mul using wrong instruction
2019-04-15 14:32:14 +02:00
Magnus Norddahl
c46a4d4483
- implement BOUND opcodes and add logging the resulting assembly code if asmjit throws an exception
2019-04-15 14:32:13 +02:00
Magnus Norddahl
c2938926a7
- implement a few more opcodes and fix some bugs
2019-04-15 14:32:11 +02:00
Magnus Norddahl
9427e22d7c
- implemented pow, min, max
2019-04-15 14:32:10 +02:00
Magnus Norddahl
f4181be6b8
- implement ATAN2 and FLOP
2019-04-15 14:32:08 +02:00
Magnus Norddahl
77fe376eca
- implement DYNCAST*, TEST, TESTN and JMP opcodes
2019-04-15 14:32:07 +02:00
Magnus Norddahl
9474a2554d
- convert JitCompile's switch into a class to enable easier code reuse
2019-04-15 14:32:05 +02:00
Magnus Norddahl
9889d2fbb6
- fix clang compile error
2019-04-15 14:32:03 +02:00
Magnus Norddahl
976a7fab3a
- implement throwing by storing exception information in a struct, then return from the jitted function and throw from c++
2019-04-15 14:32:02 +02:00
Jonathan Russell
45bc0d266e
- removed the ability to use printf-like formatting in emitAbortExceptionCall, it barely worked
2019-04-15 14:32:00 +02:00
Jonathan Russell
197b20af5d
- add first draft of abort exceptions
2019-04-15 14:31:58 +02:00
Magnus Norddahl
c65b7076eb
- call play sqrt when calculating lengths
2019-04-15 14:31:57 +02:00
Magnus Norddahl
50d0049460
- fix 8 and 16 bit store
2019-04-15 14:31:55 +02:00
Magnus Norddahl
76c08bf725
- destroy the jit runtime when all script functions are destroyed
2019-04-15 14:31:54 +02:00
Magnus Norddahl
4820c32794
- disable all unimplemented opcodes in the switch to ensure 'Unknown VM opcode' fatal error is generated if CanJit has a bug
2019-04-15 14:31:52 +02:00
Magnus Norddahl
e9914f38af
Fix compile errors on macOS
2019-04-15 14:31:51 +02:00
Jonathan Russell
601c492cf2
- added remaining int arithmetic opcodes (and fixed float loading offset issue)
2019-04-15 14:31:49 +02:00
Jonathan Russell
e771064657
- forgot to turn off debug switch in last commit
2019-04-15 14:31:47 +02:00
Jonathan Russell
4228891da2
- made absMaskInt const
2019-04-15 14:31:46 +02:00
Jonathan Russell
8306815292
- implemented CMP_APPROX for OP_EQF_*, making ~== work for doubles
2019-04-15 14:31:44 +02:00
Chronos Ouroboros
e07af1428c
Updated CanJit's supported opcodes list.
2019-04-15 14:31:43 +02:00
Chronos Ouroboros
63cda1c13d
Pointer addition opcodes must leave NULL pointers as they are.
2019-04-15 14:31:41 +02:00
Chronos Ouroboros
3c8aa9f641
Changed binary int ops to use a temporary register, fixed some opcodes.
...
For some reason, binary ops might reuse one of the input registers as the output register.
This is a problem for very obvious reasons.
2019-04-15 14:31:39 +02:00
Jonathan Russell
62ece01c0a
- made CMP_CHECK checking compile time
2019-04-15 14:31:37 +02:00
Jonathan Russell
f897f2bfd3
- added exact floating point comparison opcodes
2019-04-15 14:31:36 +02:00
Jonathan Russell
5846357268
- implemented all integer comparison operators
2019-04-15 14:31:34 +02:00
Jonathan Russell
166ce87a86
- adds OP_EQ_R, the first instruction using jumps
2019-04-15 14:31:33 +02:00
Magnus Norddahl
5c3ef8ac15
- add misc float opcodes
2019-04-15 14:31:31 +02:00
Jonathan Russell
b242ffdbbe
- added most vector maths opcodes
2019-04-15 14:31:29 +02:00
Chronos Ouroboros
73892f4a6e
Fix floats and implement some more opcodes.
2019-04-15 14:31:27 +02:00
Magnus Norddahl
113714990e
- copy initial register values from the VM frame
2019-04-15 14:31:26 +02:00
Magnus Norddahl
10a6ab4d56
- implement most of the integer math opcodes
2019-04-15 14:31:24 +02:00
Magnus Norddahl
d651c02b17
- embed and use asmjit to JIT ZScript VM functions
2019-04-15 14:31:22 +02:00
Christoph Oelckers
0ddb5038c3
- fixed the mapping of additive translucency to color-based translucency.
...
The destination mode sould be 'One', not 'InvSrcColor'.
Now both of these are available as explicit modes, not just through the optional mapping.
# Conflicts:
# src/hwrenderer/scene/hw_sprites.cpp
# src/r_data/renderstyle.cpp
# src/r_data/renderstyle.h
With additional render styles from " - abstraction of render style in render state.". drfrag
# Conflicts:
# src/r_data/renderstyle.cpp
# src/r_data/renderstyle.h
With additional render styles from "- made the screen blend work for the software renderer.". drfrag
2018-11-28 14:39:54 +01:00
Christoph Oelckers
b8ca67f426
- fixed the type checks for object arrays.
...
Null pointers must be allowed and non-object pointers which are not null must be explicitly checked for because the code could crash on them when performing a static_cast on an incorrect type.
2018-11-18 21:57:12 +01:00
Christoph Oelckers
692d6e9045
- Restricted argument count check to the void return case.
...
There were some issues here:
* a check for mismatching count is too strict because it is legal to omit return values
* it failed to detect returning multiple values in a single expression.
2018-11-16 21:33:22 +01:00
Christoph Oelckers
c1edaa317d
fixed right shift operator for unsigned values
...
This is version protected to avoid breaking old code.
2018-11-16 21:33:20 +01:00
Christoph Oelckers
38fe0b2fe1
- fixed: FxUnaryNotBitwise modified the source operand instead of allocating a new one.
2018-11-16 21:33:19 +01:00
Player701
3bd16afc0f
- Readonly pointer casting now works in ZScript.
2018-11-16 21:33:17 +01:00
Cacodemon345
0f2a4abe8f
BOUNCEONUNRIPPABLES flag; makes actors bounce on actors with DONTRIP flag
2018-11-16 21:33:12 +01:00
alexey.lysiuk
6e922761a8
- fixed compilation of targets with optimization
2018-11-16 21:33:11 +01:00
Magnus Norddahl
7567462328
- fix missing type check when using Push or Insert for typed arrays
2018-11-16 21:26:33 +01:00
Christoph Oelckers
1dad5101f1
- fixed: ZScript's finalization code used the last parsed lump for of one translation unit as reference, not the base lump.
...
This resulted in incorrect messages but also could produce some more subtle errors.
2018-11-16 21:17:46 +01:00
alexey.lysiuk
08dfdd2687
- added warning for constant conditional expression
...
ZScript code like `if (x = 0) // ...` no longer causes assertion failure in Debug but produces a warning regadless of configuration
https://forum.zdoom.org/viewtopic.php?t=62422
2018-11-02 13:31:43 +01:00
Christoph Oelckers
6daece72c9
- versioned the return mismatch check to demote it to a warning for older versions than 3.7.
...
# Conflicts:
# wadsrc/static/zscript.txt
2018-11-02 13:31:10 +01:00
alexey.lysiuk
7226f38375
- made 'return void' case a compilation error
2018-11-02 13:30:42 +01:00
Christoph Oelckers
53c87fd5eb
- extended the register limit for 'param'.
...
The instruction one free instruction byte so it's now using that to extend its argument's register range to 65535.
For param this is needed because it passes strings by reference and creating an implicit temporary copy for string constants does not work here.
2018-10-14 10:31:48 +02:00
alexey.lysiuk
7736504a22
Fixed code generation of infinite for loop
...
https://forum.zdoom.org/viewtopic.php?t=62023
2018-09-15 20:33:10 +02:00
Christoph Oelckers
608e5f5bcf
- fixed bad code for OP_SRL_KR.
2018-09-02 18:47:42 +02:00
Christoph Oelckers
80da2e74c5
- removed most of the old LastIndexOf methods in FString, only leaving one for ZScript and clearly giving it a name that says it all. RIndexOf has been made the proper version of LastIndexOf internally now.
2018-08-26 13:51:30 +02:00
Christoph Oelckers
23f2d9aaa0
- renamed RIndexOf to RightIndexOf
2018-08-26 13:51:28 +02:00
Kevin Caccamo
b57d2f11f3
Add the "RIndexOf" method to FString, which works like String.lastIndexOf from JavaScript
...
RIndexOf returns the index where the substring starts, instead of the index where the substring ends - 1.
Deprecate the LastIndexOf method of StringStruct
2018-08-26 13:51:27 +02:00
Christoph Oelckers
0fd1909f2c
- got rid of FNameNoInit and made the default constructor of FName non-initializing.
...
This setup has been a constant source of problems so now I reviewed all uses of FName to make sure that everything that needs to be initialized is done manually.
This also merges the player_t constructor into the class definition as default values.
2018-08-19 10:36:10 +02:00
alexey.lysiuk
e84b360cb5
- prohibit assignment of dynamic arrays
...
https://forum.zdoom.org/viewtopic.php?t=61682
2018-08-18 19:45:52 +02:00
alexey.lysiuk
2ce7760e49
- support static const arrays inside structs
...
https://forum.zdoom.org/viewtopic.php?t=61677
2018-08-18 13:01:46 +02:00
Marisa Kirisame
d8df6a7e6d
Add HITOWNER flag, when set, allows a projectile to collide with its shooter.
2018-08-18 00:52:36 +02:00
Christoph Oelckers
8c144881a8
- allow skipping optional arguments of the parent function in a virtual override definition.
...
This is mainly to allow retroactive addition to existing virtual functions without breaking existing content.
The MeansOfDeath fix for Actor.Die would not be possible without such handling.
2018-07-29 19:30:30 +02:00
alexey.lysiuk
baf0b8ee5f
- fixed potential garbage collection of still referenced objects
...
Objects from dynamic array stored in items of array of structures were incorrectly treated as unreachable
https://forum.zdoom.org/viewtopic.php?t=61354
2018-07-28 19:51:21 +02:00
Christoph Oelckers
9fc839b34a
- added MF8_DONTFACETALKER flag which prevents NPCs from facing the player in conversations.
2018-07-22 18:23:40 +02:00
Christoph Oelckers
08a1cc0e7e
- allow temporary strings to be used as self pointer for String's member functions.
...
Due to how function calls get resolved by the code generator there were some incorrect flags on the self pointer which triggered an assert and caused incorrect code generation.
Fortunately this was a mostly contained special case for which a workaround was possible.
2018-07-20 12:42:08 +02:00
alexey.lysiuk
c55cf00c8e
- added missing null pointer checks to VM ops
2018-07-16 19:11:20 +02:00
alexey.lysiuk
e0b5af42f3
- disabled default values for out parameters
...
https://forum.zdoom.org/viewtopic.php?t=61128
(cherry picked from commit 5d27c16f30
)
2018-06-30 12:50:32 +02:00
Christoph Oelckers
ed5c2b21ac
- ZScript used the wrong variable for compatflags2.
...
ii_* is merely the storage for info from the compatibility.txt lump.
(cherry picked from commit ae1fe041ee
)
2018-06-09 19:44:12 +02:00
alexey.lysiuk
c5b20b91ff
- fixed: flag CVars in ZScript referenced wrong addresses
...
(cherry picked from commit 4a1f36623b
)
2018-06-09 19:44:11 +02:00
drfrag666
8ff20c98a5
- That cmath include was actually not needed (bad merge).
2018-06-09 14:46:34 +02:00
Christoph Oelckers
43c3d63786
- redirect script access to the compatflags CVARs to their internal shadow variables.
...
This is needed so that MAPINFO settings for these flags don't get ignored.
(cherry picked from commit 1fdcacc337
)
# Conflicts:
# src/scripting/backend/codegen.cpp
2018-06-09 14:30:41 +02:00
Marisa Kirisame
74f4c8a6dd
BLOCKASPLAYER flag: treat non-player actors as blockable by "block players" lines
...
(cherry picked from commit fae514f30d
)
2018-06-05 00:04:22 +02:00
Christoph Oelckers
6fe5af7c0c
- fixed: FxFloatCast must transfer the outer expression's value type to the inner expression if it performs a float->float cast.
...
This violated an important rule that a cast may not alter the expression's type and led to failed asserts elsewhere.
(cherry picked from commit 7d515e72c2
)
2018-06-02 10:03:43 +02:00
drfrag666
0e25e40deb
- Addressed crash on exit with MinGW. This is a hack and i've reported it as a bug in the MinGW C runtime.
2018-05-17 12:06:44 +02:00
drfrag666
429bd5d843
- Made VMFrameStack GlobalVMStack a non thread_local variable for MinGW since that helps to prevent crashes on exit.
2018-05-14 12:53:57 +02:00
alexey.lysiuk
807820b54b
- fixed crash in DECORATE parsing
...
The case with forward declared class used as a parent must be handled explicitly
actor MyWeapon : Weapon { Weapon.AmmoType "MyBaseAmmo" }
actor MyAmmo : MyBaseAmmo { }
actor MyBaseAmmo : Ammo { }
(cherry picked from commit ef536e7b00
)
2018-05-10 21:58:55 +02:00
Christoph Oelckers
148353ab25
-protected critical portal data from getting written to by user code.
...
This data is game critical and may only be altered by code that knows what is allowed and what not. It must never be altered by any user code ever.
However, since the SkyViewpoint actors need to set up some relations between themselves and the default sky portals the previously purely internal 'internal' flag has been exported as a new keyword.
(cherry picked from commit cf8447d19c
)
2018-05-09 11:45:20 +02:00
alexey.lysiuk
7bd281ddc9
Added zero initialization of implicit dynamic array items
...
https://forum.zdoom.org/viewtopic.php?t=60111
2018-04-05 12:22:41 +03:00
alexey.lysiuk
ac7e5def32
Forbade dynamic array as the return type of a function
...
Compiler ignored this case silently but it crashed during code generation
2018-04-02 15:18:30 +03:00
alexey.lysiuk
ff96980dda
Fixed handling of default values in String.Mid()
...
https://forum.zdoom.org/viewtopic.php?t=60047
2018-03-31 21:45:20 +03:00
Christoph Oelckers
e89a598b31
- renamed FTexture's UseType flags and gave them a dedicated type.
...
This was done mainly to reduce the amount of occurences of the word FTexture but it immediately helped detect two small and mostly harmless bugs that were found due to the stricter type checks.
2018-03-25 20:26:16 +02:00
Jason Francis
bd7791ad9c
Allow setting string user variables in ACS
2018-03-24 10:20:39 +01:00
Jason Francis
4494b18e8a
Enable string & float user_ properties in UDMF things
2018-03-24 10:20:39 +01:00
Christoph Oelckers
f1bfc3514d
- fixed: For proper recognition of optional function arguments, the argflags must also be copied from the parent function to ensure they are itdentical on the override.
2018-03-14 19:52:30 +01:00
Christoph Oelckers
5d436cd3ed
- forward the error state of the translation parser to the calling code so that it can print a message pointing to the problem content.
2018-03-12 19:14:56 +01:00
Christoph Oelckers
13ef97c4ac
- removed debug message.
2018-03-12 18:47:49 +01:00
Major Cooke
4851c5bfde
Insert an extra line after printing the warnings.
2018-03-12 18:17:08 +01:00
Christoph Oelckers
def5e1d61b
Added proper handling for default parameter values of virtual overrides
...
Due to how the VM handles default parameters, these must always be identical to the parent to prevent undefined behavior.
So now, if such parameters are encountered, the compiler will either abort (for script version >= 3.3) or print a warning (for older versions.)
Any defaults being specified for older versions will be ignored, though, and the defaults of the parent function be copied to the override.
2018-03-12 10:19:16 +01:00
alexey.lysiuk
81bc05b7c5
Added support for default values of arguments with uint type
2018-03-07 15:58:06 +02:00
Christoph Oelckers
bcc8972356
- fixed: A preincrement of a local variable generated wrong code if passed as a function parameter.
...
Due to the special nature of this expression the code generator got stuck in 'address' mode and passed the address of the variable instead of its value.
2018-03-01 15:00:18 +01:00
Christoph Oelckers
425f1408f7
- fixed skip_super application fro ZScript.
...
The order of processing is different here so when the property gets parsed there are no states to delete.
To fix this the property just flags the class and lets the ZScript state compiler deal with this as needed.
2018-02-28 18:10:04 +01:00
Christoph Oelckers
af14609de7
- don't skip empty arrays which are themselves array elements in the ZScript serializer.
2018-02-27 15:42:22 +01:00
Christoph Oelckers
aaaf9aa108
Added 'TeleportSpecial' as an alias for 'Teleport' in ZScript to deconflict from the Actor.Teleport function.
2018-02-27 12:44:00 +01:00
alexey.lysiuk
74357ced0c
Fixed read of potentially junk values in ZScript parser
...
The following ill-formed ZScript code might crash targets with sizeof(int) != sizeof(void*) like 64-bit Intel
class test { void func() { if (true) ( return; ) } }
2018-02-21 16:26:04 +02:00
alexey.lysiuk
1e41c042d4
Fixed codegen crash with non-numeric random seed
...
The following code crashed ZScript code generator if my_seed is not convertible to numeric type
SetRandomSeed[my_random_id](my_seed);
2018-02-19 11:46:36 +02:00
Christoph Oelckers
09f1859c83
- allow retrieving the length of a string constant.
2018-01-21 18:49:46 +01:00
Christoph Oelckers
dbf0a68b02
Merge commit '67e3106254e987f5acb9534e725d4f5c3eaa82b2'
...
# Conflicts:
# src/doomdata.h
# src/namedef.h
# src/p_udmf.cpp
2018-01-20 19:07:54 +01:00
Christoph Oelckers
19cf887ad1
- fixed: Dynamic arrays for object pointers need different treatment than arrays for regular pointers, because they require GC::WriteBarrier to be called.
2018-01-19 19:49:42 +01:00
alexey.lysiuk
6d20da8ab5
Fixed nust -> must typos
2018-01-18 11:43:32 +02:00
Magnus Norddahl
5f36b86013
- Add dynamic spot lights
2018-01-04 17:58:11 +01:00
alexey.lysiuk
d50ba4954a
Fixed potential crash when calling undefined function in ZScript
...
The following code which uses explicit class specifier led to a crash:
class C
{
void F()
{
Object.Undefined();
}
}
2017-12-23 15:27:32 +02:00
Christoph Oelckers
ab58e4acb0
- use FileWriter for the AST dump.
2017-12-02 12:01:55 +01:00
alexey.lysiuk
5d83ee5e89
Exposed String.Remove() function to ZScript
...
https://forum.zdoom.org/viewtopic.php?t=58402
2017-11-12 14:44:21 +02:00
alexey.lysiuk
4beefb7007
Removed warning for uninitialized variables in ZScript
...
This reverts commit 8104ef5189
2017-11-06 15:38:28 +02:00
alexey.lysiuk
274951839a
Removed unused parameter from several functions in FStateDefinitions class
...
src/p_states.cpp:724:54: warning: parameter ‘actor’ set but not used [-Wunused-but-set-parameter]
https://forum.zdoom.org/viewtopic.php?t=58364
2017-11-05 15:20:25 +02:00
alexey.lysiuk
8104ef5189
Added warning for uninitialized variables in ZScript
...
https://forum.zdoom.org/viewtopic.php?t=57868
2017-11-03 16:23:41 +02:00
alexey.lysiuk
dac5777a70
Removed obsolete declarations from codegen.h
2017-11-03 12:44:28 +02:00
alexey.lysiuk
81ea9fb372
Added runtime check for negative array indices in VM
...
https://forum.zdoom.org/viewtopic.php?t=57886
2017-11-02 18:01:13 +02:00
alexey.lysiuk
57de598e48
Added implicit scope for if/else, while and do/while statements in ZScript
...
Scope is added only for variable or constant definition so it will no longer leak to outer scope
https://forum.zdoom.org/viewtopic.php?t=57848
2017-11-02 17:10:54 +02:00
alexey.lysiuk
de7d8995d5
Added string representation of 'static const' token
...
No more 'Unknown(-141)' in 'Expecting ...' error message
2017-11-02 14:45:35 +02:00
alexey.lysiuk
62e91b23bd
Extended String.LastIndexOf() with endIndex parameter
...
https://forum.zdoom.org/viewtopic.php?t=57326
2017-11-01 15:24:05 +02:00
alexey.lysiuk
c4865d2bb6
Exposed string split functionality to ZScript
...
https://forum.zdoom.org/viewtopic.php?t=58114
2017-10-28 11:44:12 +03:00
alexey.lysiuk
40a348b1f1
Fixed potential crash in resolving of multiple assignment
...
https://forum.zdoom.org/viewtopic.php?t=58055
https://forum.zdoom.org/viewtopic.php?t=58237
2017-10-27 18:15:24 +03:00
alexey.lysiuk
cb982ec313
Use FString::Back() when possible
...
Changed usages of str[str.Len() - 1] to str.Back()
2017-10-23 11:55:20 +03:00
alexey.lysiuk
48f9e53580
Added better error message for invalid class/struct member
...
https://forum.zdoom.org/viewtopic.php?t=57959
2017-09-24 10:25:05 +03:00
Magnus Norddahl
cfc1bfd1e2
- Fixed FxPow::Resolve not specifying the ValueType
2017-09-24 01:15:58 +02:00
Christoph Oelckers
eade38fb09
- fixed crash when defining a global constant which references a class member constant in its value.
2017-09-02 08:14:50 +02:00
Christoph Oelckers
948e50e458
- fixed: The struct field compiler did not check for forward declared type references that hadn't been resolved yet.
2017-08-27 12:31:47 +02:00
alexey.lysiuk
7b98fdb910
Added ToInt() and ToDouble() functions to ZScript string
...
https://forum.zdoom.org/viewtopic.php?t=57678
2017-08-25 15:09:18 +03:00
Christoph Oelckers
b4fa95ab15
- handle state label resolution in a non-actor cpntext more gracefully.
...
Note that this is merely a hotfix. Properly handling this to allow universal use of state scopes will require more work in cases where a scoped state is being accessed through a non-self pointer.
2017-08-12 10:04:06 +02:00
alexey.lysiuk
33beca6e6f
Exposed ToLower() and ToUpper() string functions to ZScript
...
https://forum.zdoom.org/viewtopic.php?t=57515
2017-08-07 15:24:18 +03:00
Rachael Alexanderson
91ff447a90
- fixed compile from last commit
...
- refactored the zscript hookup a bit, made it actually work
2017-07-29 17:03:43 -04:00
Rachael Alexanderson
712d21e26a
- implement per-renderer sprite hiding based on the actor's render feature flags
...
- hook the thing up to zscript (does not currently compile)
2017-07-29 17:03:43 -04:00
alexey.lysiuk
7436693860
Enabled dynamic stack size in ZScript parser generated by Lemon
...
https://forum.zdoom.org/viewtopic.php?t=57322
2017-07-23 11:54:16 +03:00
alexey.lysiuk
c56cd245ac
Added IndexOf() and LastIndexOf() functions to ZScript string type
...
https://forum.zdoom.org/viewtopic.php?t=57313
2017-07-22 10:54:32 +03:00
Christoph Oelckers
daca12600d
- fixed: The ADDA_RK opcode used the wrong constant type for the offset it adds to the pointer.
2017-07-15 09:14:39 +02:00
alexey.lysiuk
71b70d74a9
Fixed error handling in vector by scalar multiplication
...
https://forum.zdoom.org/viewtopic.php?t=57089
2017-07-01 12:37:31 +03:00
alexey.lysiuk
279b1e27dc
Made usage of assertions in VM code consistent
...
https://forum.zdoom.org/viewtopic.php?t=56995
2017-06-22 10:36:08 +03:00
Christoph Oelckers
3b024c347b
- use a dedicated flag word for the dynamic light flags instead of piggybacking on some flags4 bits.
2017-06-18 10:15:31 +02:00
alexey.lysiuk
eda55b25ee
Fixed code generation for vector parameters with default values
...
https://forum.zdoom.org/viewtopic.php?t=56915
2017-06-16 11:58:24 +03:00
Christoph Oelckers
1ed415014e
- fixed: 'self' may never be null for native VM functions so it must always abort if null gets passed.
2017-06-05 08:43:12 +02:00
Christoph Oelckers
91680a1e8d
- fixed incorrect number of returns in SetRandomSeed.
2017-06-04 18:56:03 +02:00
Rachael Alexanderson
2997f31f9f
- removed ZDOOMADD and updated actors in question with ZDOOMTRANS
2017-06-04 12:30:35 +02:00
Rachael Alexanderson
89b372cb01
- Changed MF7_SPRITEFLIP, MF8_ZDOOMTRANS to RenderFlags
...
- Added RF_ZDOOMADD
- renamed r_canontrans to r_vanillatrans
- this developer's insanity level has increased by 231%.
2017-06-04 12:30:35 +02:00
Rachael Alexanderson
01f88cfb16
- Added 'canonical transparency' cvar r_canontrans - this simply turns off transparency for Doom objects that were marked as transparent sometime in ZDoom's development cycle
2017-06-04 12:30:35 +02:00
jplebreton
2c7a0c87c8
add FloatBobStrength Actor property, a multiplier on Z offset created by FloatBob behavior. default of 1.0 is current behavior, set higher/lower for more/less extreme bobbing.
2017-06-03 18:02:27 +02:00
Christoph Oelckers
1465102ba0
- added SetRandomSeed function for ZScript. This uses the same RNG syntax as the other random functions.
2017-05-31 11:33:57 +02:00
Christoph Oelckers
b50123ec6b
- avoid function call in VM code.
...
- return after calling ThrowAbortException because this avoids storing some register variables on the stack.
2017-05-30 17:50:56 +02:00
alexey.lysiuk
62bac1d612
Added check for nullptr to CLSS and META instructions of scripting VM
...
https://forum.zdoom.org/viewtopic.php?t=56667
2017-05-30 18:09:51 +03:00
Christoph Oelckers
97b664968e
- removed a few unused VM opcodes.
2017-05-19 10:27:22 +02:00
Rachael Alexanderson
a96ef5276d
- Added new flags8 actor field. Isn't it frightening how quickly how we got to our 8th flag field?
...
- Speaking of frightening, added +FRIGHTENING flag.
2017-05-15 19:17:46 +02:00
Rachael Alexanderson
2acb485121
- Added +SPRITEFLIP which reverses a sprite's left-rightness.
2017-05-03 21:13:31 +02:00
Christoph Oelckers
aac6e65842
- fixed: FxActionSpecialCall did not resolve float to int casts.
2017-05-01 22:44:58 +02:00
alexey.lysiuk
ea3b47d0ad
Added generic workaround for double type alignment
...
This fixes not only 32-bit Linux/macOS builds but PowerPC Mac target too
2017-04-23 14:49:36 +03:00
Christoph Oelckers
57d703236b
- changed Doom source license to GPL in all subdirectories and fixed missing licenses in a few other files.
2017-04-17 12:27:19 +02:00
Christoph Oelckers
2d0da4fcfa
- fixed: Dynamic arrays of objects in structs were not registered for garbage collection.
2017-04-15 13:20:58 +02:00
Christoph Oelckers
e333e31410
- fixed: Vector array elements failed to allocate the proper amount of registers.
2017-04-15 12:03:21 +02:00
Christoph Oelckers
ca1981c52f
- fixed missing null pointer check in BuiltinNameToClass.
2017-04-14 23:06:12 +02:00
Christoph Oelckers
d014395dae
- do not delete the namespaces when removing compiler symbols. They still get referenced by some types and must remain until the engine shuts down.
2017-04-14 19:40:50 +02:00
Christoph Oelckers
7186342221
- do not try to serialize static arrays.
2017-04-14 19:25:47 +02:00
Christoph Oelckers
92acbdc625
- made GetClassName an intrinsic and expanded it to also work on class types.
2017-04-14 16:14:27 +02:00
Christoph Oelckers
7983f6ea4f
- fixed incorrect return variable.
2017-04-14 15:23:18 +02:00
Christoph Oelckers
cd180d29c7
- block direct use of 'new' for DObjects.
...
This is to ensure that the Class pointer can be set right on creation. ZDoom had always depended on handling this lazily which poses some problems for the VM.
So now there is a variadic Create<classtype> function taking care of that, but to ensure that it gets used, direct access to the new operator has been blocked.
This also neccessitated making DArgs a regular object because they get created before the type system is up. Since the few uses of DArgs are easily controllable this wasn't a big issue.
- did a bit of optimization on the bots' decision making whether to pick up a health item or not.
2017-04-14 13:31:58 +02:00
Christoph Oelckers
2d098e99fb
- fixed: WP_NOCHANGE had different values in native and script code, resulting in problems with weapon selection.
...
This now explicitly allocates a single object it can safely point to instead of trying to hack around it.
2017-04-13 18:59:45 +02:00
Christoph Oelckers
98dab9c4b9
- took PTypeBase and all its subclasses out of the DObject hierarchy.
...
- moved scope flag to a new variable that is specific to PType instead of hijacking the ObjectFlags for this.
2017-04-13 17:47:17 +02:00
Christoph Oelckers
988fe8d735
- removed all RTTI from the type table.
...
Using names is just as good as using types so now this is what's done.
2017-04-13 16:01:38 +02:00
Christoph Oelckers
aeb455d705
- removed all RTTI checks for the types.
2017-04-13 15:38:06 +02:00
Christoph Oelckers
b2d944974e
- first stage of simplifying the type system.
...
Let's use inline checkers in PType instead of constantly having to do clumsy IsKindOf checks etc. Once complete this also means that the types can be taken out of the class hierarchy, freeing up some common names.
2017-04-13 12:52:18 +02:00
alexey.lysiuk
fbc1028d2b
Fixed crash when parsing DECORATE constant expressions
2017-04-13 12:06:59 +03:00
alexey.lysiuk
1889efa814
Fixed build with Clang
...
Fixed bunch of compilation errors:
cannot pass non-trivial object of type 'FString' to variadic method; expected type from format string was 'char *' [-Wnon-pod-varargs]
Fixed linker erorr:
g_doomedmap.cpp.o: In function `InitActorNumsFromMapinfo()':
src/g_doomedmap.cpp: undefined reference to `PClass::FindActor(FName)'
2017-04-13 10:40:43 +03:00
Christoph Oelckers
1712667ce2
Merge branch 'master' of https://github.com/coelckers/gzdoom
2017-04-13 02:18:16 +02:00
Christoph Oelckers
85d8244d03
- fixed: With the reorganization of the class data the setup of actor replacements must be delayed until after InitializeDefaults has been called.
2017-04-13 02:18:06 +02:00
Christoph Oelckers
6599e2c425
- moved the VM types into their own file and only include it where really needed.
2017-04-13 01:12:04 +02:00
Christoph Oelckers
fc9e304189
- separated class descriptors from VM types.
...
Combining these two groups of data has been the cause of many hard to detect errors because it allowed liberal casting between types that are used for completely different things.
2017-04-12 22:46:49 +02:00
Christoph Oelckers
afd6743965
- moved AddNativeField to PSymbolTable, too.
2017-04-12 18:29:58 +02:00
Christoph Oelckers
8dc11317dd
- Moved WriteFields into SymbolTable as well.
2017-04-12 17:42:10 +02:00
Christoph Oelckers
96631e8808
- make PClass not inherit from PStruct.
...
Having these two types related can cause problems with detection in the compiler because for some parts they need quite different handling.
Common handling for the fields has been moved into PSymbolTable but overall redundancy was quite minor as both types share surprisingly little functionality.
2017-04-12 17:21:13 +02:00
alexey.lysiuk
20a9f17a15
Fixed handling of count parameter's default value in Array.Delete()
...
https://mantis.zdoom.org/view.php?id=571
2017-04-12 17:40:17 +03:00
Christoph Oelckers
0d7b7d6ab1
- merged PStruct and PNativeStruct.
...
There were exactly 4 places in the code that checked for the difference, this is better done with a flag.
2017-04-12 15:12:41 +02:00
Christoph Oelckers
6308251084
- added a FindSymbol wrapper to PClass so that other code does not need to access the symbol table directly.
...
- added an isActor utility function to codegen.cpp to simplify a few constructs.
2017-04-12 13:08:41 +02:00
Christoph Oelckers
b17ab7a133
- put PObjectPointer to some use.
...
- fixed: There was no check for compatible class pointers.
2017-04-12 11:40:40 +02:00
Christoph Oelckers
80801d11b1
- removed some redundant static_casts.
2017-04-12 10:29:04 +02:00