Closed Try closed 6 months ago
Introduce new opaque type struct phoenix::func { uint32_t value; }. When callback uses phoenix::func, VM should unroll reference chain internally and pass real symbol-id to game-engine.
Initial implementation at b8b70341. Do you also need support for returning func
s from externals?
Fix handling of func forwarding in de-compiler :)
Should be fixed in phoenix-studio/a316d60. Had to force push to override broken commit :/
Before:
After:
Do you also need support for returning
func
s from externals?
Not really important - returning integer also works fine. Yet, this functionality is nice to have for completeness.
Okay, does https://github.com/GothicKit/phoenix/compare/feature/daedalus-func-type now work for you?
Okay, does https://github.com/GothicKit/phoenix/compare/feature/daedalus-func-type now work for you?
Tested locally on my side - works well, so please merge :)
In Daedalus it's possible to pass function to other functions as parameters:
Couple of minor issues with it:
0x2a75
(symbol id ofFUNCTION
) instead ofFUNCTION
_FF_CREATE
will receive id ofFF_APPLYEXTDATA.FUNCTION
symbol and won't be able use it directly.Current workaround: it's possible to traverse reference chain up to original function:
Proposed changes:
func
forwarding in de-compiler :)struct phoenix::func { uint32_t value; }
. When callback usesphoenix::func
, VM should unroll reference chain internally and pass real symbol-id to game-engine.