Commit graph

281 commits

Author SHA1 Message Date
Christoph Oelckers
9521b6cd1f - removed all remaining native parts of APlayerPawn.
Unlike the other classes, the places where variables from this class were accessed were quite scattered so there isn't much scriptified code. Instead, most of these places are now using the script variable access methods.
This was the last remaining subclass of AActor, meaning that class Actor can now be opened for user-side extensions.
2019-01-03 22:05:49 +01:00
Christoph Oelckers
2258a71c36 - took several methods out of the native PlayerPawn implementation, either by scriptification or moving them to other places. 2019-01-03 13:59:46 +01:00
Christoph Oelckers
d1ca2a91f3 - fixed: ThePatchRemap table was only initialized in one of FFont's constructors. 2018-12-15 17:49:12 +01:00
Christoph Oelckers
faa4bb45c9 - store UnchangedSpriteNames in Dehacked in a less hacky manner. 2018-12-15 15:36:33 +01:00
Christoph Oelckers
9348baeeb1 Removed all remaining references to AInventory
What remains is the class definition and one single reference that will be scriptified.
2018-12-04 17:11:36 +01:00
Christoph Oelckers
3d28006eda - started removing literal references of AInventory, so far only simple stuff. 2018-12-04 00:41:39 +01:00
Christoph Oelckers
a573c63f60 - removed all direct access to AInventory's members.
We are getting closer to make class Inventory fully scripted.
2018-12-04 00:22:26 +01:00
Christoph Oelckers
0e095b0c05 - removed all direct references of AInventory::Owner and AInventory::Amount from the C++ code. 2018-12-03 17:41:05 +01:00
Christoph Oelckers
40a67b8c9a - fixed issues with Dehacked's ad-hoc script code generation
* The functions had no prototype and caused crashes.
* even after creating a prototype it didn't work because CreateAnonymousFunction was set up incorrectly for the case where a known return type was given.
2018-12-03 12:24:55 +01:00
Christoph Oelckers
bfcd714186 - started replacing direct references to class AInventory.
The easiest part was the type checks which could be changed to the name variant with a global search and replace.
2018-12-02 21:35:55 +01:00
Christoph Oelckers
47b1fa774d Merge branch 'asmjit' into weapon_scriptification
# Conflicts:
#	src/gi.cpp
#	wadsrc/static/zscript/base.txt
2018-11-26 00:14:44 +01:00
Christoph Oelckers
d6b781312c - removed all remaining native components of the weapon class. 2018-11-25 10:00:55 +01:00
Christoph Oelckers
b5c4ab8c47 - removed all direct access to AWeapon's members to prepare moving this class fully to the script side.
Disregarding UI-side and setup-related calls there's unfortunately still 6 places in the native game code which require direct access.
2018-11-25 08:17:37 +01:00
Christoph Oelckers
8fa16b6c30 - some cleanup on the weapon slot interface.
This really shouldn't make any decisions from directly reading weapon class defaults.
2018-11-25 07:21:02 +01:00
Christoph Oelckers
fb91982da2 - scriptified APlayerPawn::Die and fixed a few things I encountered while doing it. 2018-11-24 20:32:12 +01:00
Christoph Oelckers
b267252a09 - fixed: Since out types cannot be marked as such in a function prototype (as it'd cause parameter mismatches in the resolving pass) it is necessary to check the argflags as well when determining the register type. 2018-11-24 09:34:53 +01:00
Christoph Oelckers
a9ec819557 - moved the type infomation entirely out of VMValue.
For the varargs functions that used the Type field to validate their parameters, now a hidden additional argument is passed which contains a byte array with the type info for the current call's arguments. Since this is static per call location it can be better prepared once when the code is being compiled instead of being put in a runtime created array for each invocation. Everything else uses the per-function instance of the same data.

The only thing that still needed the type field with a VMValue is the defaults array, so this uses a different struct type now to store its data.
2018-11-18 19:31:13 +01:00
Christoph Oelckers
a981737855 - generate register type info for the parameter lists of all functions.
Currently used for loading parameters into registers.
For checking parameters of native functions some more work is needed to get the info to the function. Currently it doesn't receive the function descriptor.
2018-11-18 17:10:55 +01:00
Christoph Oelckers
fe0a341e0c - moved all code related to function calls into the helper class so that all future work on the calling convention is in one place only. 2018-11-18 10:02:31 +01:00
Christoph Oelckers
cbedcff559 - moved all handling for the simple calls into EmitterArray to have it in one place only.
The main case of FxVmFunctionCall is not done yet, though.
2018-11-18 08:29:41 +01:00
Christoph Oelckers
629d329f22 - removed OP_TAIL.
The amount of support code for this minor optimization was quite large and this stood in the way of streamlining the VM's calling convention, so it was preferable to remove it before moving on.
2018-11-18 07:43:03 +01:00
Magnus Norddahl
4e0c5cf16c - fix compile errors 2018-11-18 03:28:57 +01:00
Christoph Oelckers
983c0c56b1 - changed OP_PARAM handling so that all registers remain allocated until the call instruction and reordered instruction emission so that the param instructions all directly precede the call instruction. 2018-11-18 01:06:04 +01:00
Christoph Oelckers
b2c07e731f - completed the Dehacked fix.
I missed some arguments that were specified but set to 'not given'.
2018-11-17 21:33:21 +01:00
Christoph Oelckers
5180265ab1 - fixed: The Dehacked function wrappers now need full parameter lists. 2018-11-17 21:21:23 +01:00
Magnus Norddahl
70f18f87b9 Merge remote-tracking branch 'origin/master' into asmjit 2018-10-14 22:55:57 +02:00
Christoph Oelckers
dd719f0f14 - 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 09:13:26 +02:00
Magnus Norddahl
01825231ec - add -dumpjit command line parameter that dumps the JIT log for all functions to dumpjit.txt 2018-10-10 06:17:35 +02:00
Christoph Oelckers
d18f5eecb4 - Fixed: Dehacked must not validate parameters for MBF special functions.
These won't match the conditions.
Additionally this adds disassembly output for the synthesized replacement functions for diagnostics purposes.
2018-06-03 19:28:16 +02:00
alexey.lysiuk
2ae8d39441 Removed all superfluous #include's
Automatically optimized by CLion IDE with manual corrections
2018-04-24 14:30:35 +03:00
alexey.lysiuk
de0a815215 Fixed error reporting on loading malformed DeHackEd patches 2018-03-21 13:08:16 +02:00
alexey.lysiuk
92f10febe8 Fixed crash on loading malformed DeHackEd patches
Lump that contains only "Patch File for DeHackEd v3.0" (without line break at the end) caused a crash
2018-03-21 13:03:44 +02:00
drfrag
88bebaec39 - Fixed not getting the 'old and unsupported DeHackEd patch' error message for some old patch versions. 2018-03-21 12:48:46 +02:00
Christoph Oelckers
b939836846 - renamed FileRdr back to FileReader. 2018-03-11 19:29:37 +01:00
Christoph Oelckers
b315bc3be0 - added a few more FileRdr replacements
- fixed: The streaming music player must return the file reader if it fails to open, so that the next player can still use it.
- fixed: Timidity++'s Instruments class did not delete the sound font when it was destroyed.

..-
2018-03-10 20:33:49 +01:00
Christoph Oelckers
d873ae75ab - silence all error messages in the state map parser for DEHSUPP when re-reading the data.
The state map will just be skipped and the parser only needs to run to get over the data.
However, due to changes from a previous patch the data cannot be validated so aside from not using the data it may also not abort on errors.
2018-02-27 11:34:44 +01:00
Rachael Alexanderson
117b796c6b - fixed: Phobia: The Age (or any mod with DEHACKED overriding player bits) overwrote the player's Friendly flag 2018-02-20 04:45:15 -05:00
alexey.lysiuk
0bd9437a96 Fixed loading of external DeHackEd patches
https://forum.zdoom.org/viewtopic.php?t=58685
2017-12-09 11:37:25 +02:00
Christoph Oelckers
7d0759e2fa - handled all other uses of fopen that could reasonably converted to FileReader or FileWriter. 2017-12-02 14:24:28 +01:00
Rachael Alexanderson
765646ee1c - fixed: Changed IWAD_FILENUM to a dynamic lookup. 2017-09-13 04:19:03 -04:00
alexey.lysiuk
173fa31383 Fixed internal Dehacked support
https://mantis.zdoom.org/view.php?id=619
2017-04-22 22:58:45 +03: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
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
9c9b2ccf6d - replaced more dyn_casts and checks for RUNTIME_CLASS(PClassActor)
It is preferable to use IsDescendantOf wherever possible if we ever want to be able to separate PClass from PType.
2017-04-12 10:20:58 +02:00
Christoph Oelckers
e4d2380775 - moved all remaining fields from PClassActor to FActorInfo.
- added a few access functions for FActorInfo variables.

With PClassActor now empty the class descriptors can finally be converted back to static data outside the class hierarchy, like they were before the scripting merge, and untangle the game data from VM internals.
2017-04-12 00:07:41 +02:00
Christoph Oelckers
854053a14f - use TArrays instead of TMaps to store damage factors and pain chances.
For these fields maps have no advantage. Linearly searching a small array with up to 10 entries is nearly always faster than generating a hash for finding the entry in the map.
2017-04-11 23:29:37 +02:00
Christoph Oelckers
4afe2d4218 - moved OwnedStates and NumOwnedStates out of PClassActor. 2017-04-11 22:44:35 +02:00
Christoph Oelckers
311ce2362a - started moving stuff out of PClassActor into meta data.
This reinstates the old FActorInfo as part of the meta data a class can have so that the class descriptor itself can be freed from any data not directly relevant for managing the class's type information.
2017-04-11 19:37:56 +02:00
Christoph Oelckers
e551ef52f8 - removed atag parameter from GetConstantAddress. 2017-04-10 15:39:04 +02:00