-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] AGS 4.0: rewrite ccInstance into non-forking ScriptExecutor #2621
base: ags4
Are you sure you want to change the base?
[WIP] AGS 4.0: rewrite ccInstance into non-forking ScriptExecutor #2621
Conversation
Save original input code[] values meant for fixups in _fixupValues[] array, as code[] array will be overwritten with resolved addresses etc. Use saved _fixupValues[] when resolving imports.
I think we can push these changes further, and introduce a "Script Thread" class. The "Script Thread" will contain its own data stack and call stack, leaving only registers in the ScriptExecutor. ScriptExecutor will be told to run this or that script on a specific "script thread". Then there will be 2 default "threads": the "main" one, and a "non-blocking" one to run "rep-exec-always" on. This will nicely mimic the previous behavior. But the "script thread" objects may become more useful somewhen in the future if we try to implement coroutines in AGS. |
I see there are changes to the script compiler, does this change requires rebuild of the auto test game with it or should be able to run the previously built ags4 auto test game ? |
No, there are no changes to compiler itself, there are only corrections to data types in ccScript. I did not have time earlier, but I will check out what happens when this runs a test game. |
This is an experiment in a WIP stage currently.
Purpose:
What is done
In the situation where a script would call a blocking action, such as Wait() function, for example,
previously engine would do this:
after this change it will do: