Commit graph

14246 commits

Author SHA1 Message Date
Christoph Oelckers
0cd93c14af - allow %*d etc. format specifiers in ZScript, but only for numeric types. 2018-12-02 14:34:08 +01:00
Christoph Oelckers
4a1f011dc1 - Alt HUD scriptification, part 1. 2018-12-02 14:34:08 +01:00
Magnus Norddahl
edc05111cd - don't use SSE for integer min/max 2018-12-02 09:58:08 +01:00
Magnus Norddahl
706a923884 - Use SSE2 for min/max instead 2018-12-02 07:35:02 +01:00
Christoph Oelckers
c66dae9f2c - this was wrong... 2018-12-02 00:08:19 +01:00
Christoph Oelckers
117537339d - fixed script call in PickNewWeapon. 2018-12-01 23:36:48 +01:00
Christoph Oelckers
2d0b90deb1 - fixed: P_Massacre without a class restriction no longer worked. 2018-12-01 22:44:06 +01:00
Christoph Oelckers
577af8860c - scriptified invnext and invprev CCMDs. 2018-12-01 22:37:12 +01:00
Christoph Oelckers
5c647de70c - moved ValidateInvFirst to the script side because this was one of the major functions that directly reference AInventory. 2018-12-01 17:46:20 +01:00
Christoph Oelckers
bc1990b6d7 - moved AInventory::DoRespawn fully to the script side. 2018-12-01 17:29:37 +01:00
Christoph Oelckers
3922f817fb - made CallTryPickup a global function.
This one still gets called in too many places but stands in the way of moving Inventory fully to the script side.
2018-12-01 17:21:40 +01:00
Christoph Oelckers
7b63e088e1 - moved the GetBlend script call to the one single place where it is needed to get rid of one native AInventory method. 2018-12-01 17:21:20 +01:00
Christoph Oelckers
a14b0c58bf - re-fixed the massacre fix for Dehacked-modified inventory items.
Instead of overriding the Massacre method it is preferable to clear the flags causing the bad behavior, most notably ISMONSTER.

# Conflicts:
#	src/g_inventory/a_pickups.cpp
#	src/g_inventory/a_pickups.h
2018-12-01 17:20:52 +01:00
Christoph Oelckers
7301bbc58e - scriptified GiveAmmo and the one remaining piece of native code still using it. 2018-12-01 17:20:23 +01:00
Christoph Oelckers
2c59172c42 - scriptified DropInventory. 2018-12-01 17:18:26 +01:00
Christoph Oelckers
09129e0113 - scriptified UseInventory and several functions using the already scriptified ones, 2018-12-01 17:17:08 +01:00
Christoph Oelckers
588ddd185b - scriptified TakeInventory, including the ACS/FS interfaces. 2018-12-01 17:11:09 +01:00
Christoph Oelckers
e7d309cb96 - code consolidation in invnext and invprev. 2018-12-01 17:09:43 +01:00
Christoph Oelckers
023efc7685 - scriptified RemoveInventory and Inventory.OnDestroy. 2018-12-01 17:09:23 +01:00
Christoph Oelckers
eb47fb9adc - scriptified GiveInventory and made the interface a bit more configurable by mods.
Now a child type can decide for itself how to treat 'amount'.
The scripting interfaces to this function in ACS and FraggleScript have been consolidated and also scriptified.
2018-12-01 17:07:09 +01:00
Christoph Oelckers
a426655d61 - scriptified AddInventory. 2018-12-01 17:03:58 +01:00
Christoph Oelckers
d812b94d57 - disabled direct native functions for now until the problems with string arguments are fixed. 2018-12-01 16:56:55 +01:00
Christoph Oelckers
691652042c - added direct native variants to nearly all status bar function.
I skipped ValidateInvFirst because that one will have to be scriptified soon.
2018-12-01 16:54:31 +01:00
Magnus Norddahl
5169a5b119 - minor code cleanup now that it is working 2018-12-01 14:35:21 +01:00
Christoph Oelckers
85a3edf583 - removed the no longer needed exception prevention hack.
# Conflicts:
#	src/scripting/vm/vmframe.cpp
2018-12-01 14:27:18 +01:00
Christoph Oelckers
067e9de00a - fixed: V_FindFontColor is not suitable for direct calls from JIT code, thanks to its FName parameter. 2018-12-01 14:26:53 +01:00
Christoph Oelckers
aa32acae25 - a bit of code reordering for adding direct native entry points.
- offloaded key list generation for alternative HUD to non-UI parts.

This change also revealed a problem with handling empty sprites in the key list so this got fixed, too.
2018-12-01 14:18:28 +01:00
Magnus Norddahl
83c011740c - fix augmentation length bug 2018-12-01 14:14:28 +01:00
Magnus Norddahl
b428136866 - unwind data is now working on macOS 2018-12-01 12:46:35 +01:00
Christoph Oelckers
a7e472b4b3 - moved all exports from class Font to vmthunks.cpp and gave them direct native entrypoints.
- changed PARAM_STRING to use the passed string by reference instead of by value. The 3 instances where passing by value was needed now use PARAM_STRING_VAL.
2018-12-01 10:30:50 +01:00
Christoph Oelckers
ea3d26aafd - fixed character to int conversion for UTF8-characters. 2018-12-01 10:30:50 +01:00
alexey.lysiuk
8d9b4f5a17 - previous fix attempts done right 2018-12-01 09:44:14 +02:00
SanyaWaffles
6dd73e43fd Attempts to fix errors introduced by merging of asmjit branch and wea… (#649)
* Attempts to fix errors introduced by merging of asmjit branch and weapons scripting branch

* This didn't work. The others should work though.

* fix scriptutil.cpp:(.text+0x18d): undefined reference to `PClass::FindActor(FName)'

* Attempt to fix compilation on macOS
2018-12-01 07:31:25 +01:00
Magnus Norddahl
c41603c171 - implemented unwind data on Unix - does it work? no idea, there's no easy way to tell when the debugger doesn't support the interface.. 2018-12-01 01:14:15 +01:00
Christoph Oelckers
42b9a41421 - removed the longjmp based exception catch/rethrow mechanism and instead force-terminate in case a user exception is thrown while the VM is executing JITed code on a non-Windows system
On Windows none of this is needed, because we can generate a proper unwind frame for the JITed functions, but even on Linux, it would require manual additions to each single piece of native code that ever gets called from inside a JIT compiled function.
This is an utterly prohibitive proposition because it makes direct native calls a virtual impossibility
So, in order to get the thrown error properly presented both I_Error and ThrowAbortException will now forward to I_FatalError if it is called from inside a JIT context.
2018-11-30 21:30:14 +01:00
Christoph Oelckers
b26b16e4b7 Merge remote-tracking branch 'remotes/origin/master' into asmjit 2018-11-30 21:29:12 +01:00
Christoph Oelckers
a0c0e8bdfe Merge remote-tracking branch 'remotes/origin/weapon_scriptification' into asmjit
# Conflicts:
#	src/g_inventory/a_pickups.cpp
2018-11-30 21:28:44 +01:00
Christoph Oelckers
32f7e9a9ea -add a dummy definition for vm_jit in 32 bit. 2018-11-30 20:50:31 +01:00
Christoph Oelckers
62f649b4f6 - fixed: the direct native GetTextureSize used the wrong calling convention. 2018-11-30 19:28:24 +01:00
Player701
b79e3f8904 - Added a flag to make bouncing objects disappear when hitting sky surfaces 2018-11-30 18:53:57 +01:00
Christoph Oelckers
8e46cb3a21 Merge remote-tracking branch 'remotes/origin/master' into asmjit 2018-11-30 18:49:28 +01:00
Christoph Oelckers
00d97197db - removed deprecated method to retrieve OpenGL extensions
Since we force a core profile and this was explicitly disabled for core profiles, this code has no use anymore
2018-11-30 17:16:21 +01:00
Christoph Oelckers
a3df67bdd4 - let FOBJModel::ParseVector actually use its templated size parameter
In this setup the array can be statically updated because the size is always constant per instantiation
2018-11-30 17:12:36 +01:00
Christoph Oelckers
25ad71a113 - Changed a few allocations into usin TArrays
S_SoundCurve in particular looked like a candidate for leaking memory.
2018-11-30 17:07:42 +01:00
Christoph Oelckers
024870ba11 - merged DCanvas and DSimpleCanvas and use a TArray to hold its memory. 2018-11-30 17:02:39 +01:00
Magnus Norddahl
cb1153272a - fix native call crash and assertion error 2018-11-30 16:55:22 +01:00
Magnus Norddahl
6e598274f7 - hook up unix unwind info (still not working) 2018-11-30 02:06:40 +01:00
Player701
927d333063 - Exported AActor::Grind to ZScript. 2018-11-29 23:46:47 +01:00
Magnus Norddahl
b1bb82fe01 - fix WriteSLEB128 2018-11-29 19:44:26 +01:00
Magnus Norddahl
5d052fc565 - fix compile errors 2018-11-29 19:32:08 +01:00
Magnus Norddahl
37e33c6609 - implemented unwind info for Linux and macOS - now to fix the bugs that cannot be fixed when the documentation is as useless as it is for those platforms.. 2018-11-29 18:45:55 +01:00
Christoph Oelckers
19df662348 - fixed code generation for dummy results. 2018-11-29 20:15:53 +01:00
Christoph Oelckers
b8394b2f16 - fixed compilation warnings. 2018-11-29 20:11:28 +01:00
Christoph Oelckers
717912c88c - direct native methods for dynamic arrays. 2018-11-29 20:09:41 +01:00
Christoph Oelckers
3ecda35379 Add direct native calls to TexMan's native methods. 2018-11-29 19:41:03 +01:00
Christoph Oelckers
3acd9c8116 Made all virtual base functions for the event handler scripted
This was by far the largest block of native virtuals, and they were only native to be able to allow checking if the event was implemented for the current handler. This can easily be done by looking at the byte code, just like VMCall also does but in turn it removes more than half of the existing native virtuals from the interface.
2018-11-29 18:46:28 +01:00
Magnus Norddahl
110b982031 - fix compile error on systems with no SSE support 2018-11-29 13:08:46 +01:00
Christoph Oelckers
762a100d60 Direct native functions for SBarInfo
Mostly pointless because they all get used only once and aren't even virtual overrides, but I only realized this after everything was complete…
2018-11-29 12:20:24 +01:00
Christoph Oelckers
53d59559cd Added direct native functions to the remaining content of vmthunks.cpp 2018-11-29 17:55:56 +01:00
Christoph Oelckers
62efe11a85 - more direct native functions for sector utilities. 2018-11-29 17:38:58 +01:00
Magnus Norddahl
e3c13fe193 - Emit DW_CFA_advance_loc and DW_CFA_def_cfa_offset codes 2018-11-29 02:37:58 +01:00
Christoph Oelckers
f43f0b9bd4 - added a few more direct native entry points. 2018-11-29 00:27:09 +01:00
Magnus Norddahl
fa185693d2 - _mm_rcp_ps may be faster but its precision is too poor 2018-11-29 00:17:40 +01:00
Magnus Norddahl
4ee7cf2de1 - forgot to set the light level 2018-11-29 00:03:50 +01:00
Magnus Norddahl
d62a26a177 - use psprite renderstyle on HUD models 2018-11-29 00:01:16 +01:00
Christoph Oelckers
d3ff657231 - added a direct native function for NextHighestCeilingAt to test multiple return values. 2018-11-28 21:40:56 +01:00
Magnus Norddahl
5ae456d059 - fix typo in macro 2018-11-28 19:59:35 +01:00
Christoph Oelckers
a5a9ab07af Merge branch 'master' into asmjit 2018-11-28 18:44:42 +01:00
Christoph Oelckers
9c398cd343 - fixed: P_Recalculate3DFloors may not be called before the vertex buffer has been set up.
Since this function creates dynamic copies for 3D floors that need to be split it requires the vertex buffer index to be set up.
In older versions this did not produce errors because there was a fallback render path that was less efficient.
Now with that fallback removed this resulted in temporary 3D floors being created without valid vertex data.
2018-11-28 18:42:37 +01:00
Magnus Norddahl
232c24e4de - add .eh_frame generation code except for building the actual CIE and FDE instructions 2018-11-28 13:10:31 +01:00
Christoph Oelckers
fc7ca39927 - allocate storage for all of a function's return values 2018-11-28 00:24:50 +01:00
Christoph Oelckers
6a9696e525 - moved the remaining exports from p_sectors.cpp to vmthunks.cpp 2018-11-28 00:24:50 +01:00
Magnus Norddahl
8860517bbd - pass additional return values as the last args to a direct native call 2018-11-27 20:43:35 +01:00
Magnus Norddahl
3202c86ea7 - use the OP_PARAM and OP_RESULT opcodes to build the function signature 2018-11-27 19:56:39 +01:00
Christoph Oelckers
5e4e9e2c2b Merge branch 'master' into asmjit 2018-11-27 19:53:22 +01:00
Christoph Oelckers
59b4e297c0 - 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.
2018-11-27 19:43:10 +01:00
Christoph Oelckers
3d3a00fd0d - fixed: The flat drawer did not check for full brightness before processing dynamic lights. 2018-11-27 17:49:10 +01:00
Magnus Norddahl
d5b9b8e57a - fixed missing setRet call for REGT_POINTER return types 2018-11-27 17:10:20 +01:00
Magnus Norddahl
9dbb1d77ce - fix compile error 2018-11-27 17:02:51 +01:00
Magnus Norddahl
73819d45b7 - annotate which function we are calling for better dumpjit info 2018-11-27 17:00:29 +01:00
Magnus Norddahl
d195efc431 Merge remote-tracking branch 'origin/master' into asmjit 2018-11-27 15:38:10 +01:00
Magnus Norddahl
5e01a874be - merge the span step code used by both the 8 bit and 32 bit drawers 2018-11-26 17:02:01 +01:00
Magnus Norddahl
dbb7df998d - step with SSE 2018-11-26 14:32:56 +01:00
Magnus Norddahl
2db433e68f - only do shade clamps if needed 2018-11-26 12:18:07 +01:00
Magnus Norddahl
8b852ce4d8 - move the jit runtime to its own file 2018-11-26 10:46:09 +01:00
Magnus Norddahl
52b7a77771 - use SSE for the dynlights 2018-11-26 00:49:07 +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
90d79865a5 Merge branch 'master' into asmjit 2018-11-25 23:33:23 +01:00
Christoph Oelckers
182d43ae70 - fixed: Any direct native function may not use struct values as parameters, not even something as simple as an FName. 2018-11-25 23:33:15 +01:00
Christoph Oelckers
bef5b953b2 - free everything. 2018-11-25 23:33:15 +01:00
Christoph Oelckers
34a1c8e545 - delete JIT data when shutting down. 2018-11-25 23:33:14 +01:00
Magnus Norddahl
c164b3c3b0 - fix: float constants got their move instructions inserted after the call instruction 2018-11-25 22:26:38 +01:00
Christoph Oelckers
d79ef939e9 - fixed: The serializer must treat object that were already destroyed or are declared transient like a null pointer and not ignore them.
This caused FraggleScript's SpawnedThings array to go out of sync.
2018-11-25 22:13:14 +01:00
Christoph Oelckers
9475bfe4f1 - declare builtins as static. 2018-11-25 21:47:28 +01:00
Christoph Oelckers
176da5de68 - added a direct native variant for A_PlaySound because this function is relatively easy to test. 2018-11-25 18:41:27 +01:00
Magnus Norddahl
61b91f9814 - fix macro expansion error on gcc and clang 2018-11-25 18:37:26 +01:00
Magnus Norddahl
d30bf44dcc - use SSE for the normal walls 2018-11-25 17:11:05 +01:00
Christoph Oelckers
2b960aa28f - finished adding direct native functions to vmthunks.cpp. 2018-11-25 16:12:15 +01:00
Magnus Norddahl
53175c49a7 - change DrawSpanOpt32 to render a scanline in multiple steps as the speed is about the same and it will make it easier to use SSE for each of the steps 2018-11-25 15:49:15 +01:00
Christoph Oelckers
03364a8c3e - all sector exports done. 2018-11-25 15:14:48 +01:00