Commit Graph

177 Commits

Author SHA1 Message Date
jtuu
b24afee12a Fixed VM threading in auto-advance mode.
Now when a thread is started at least one advance is required to have valid execution state.
2019-11-21 15:22:47 +02:00
jtuu
8582a25bc3 Lint 2019-11-16 18:07:21 +02:00
jtuu
918d8f7bdc The script editor is now set to readonly mode when a quest is running. 2019-11-16 17:35:20 +02:00
jtuu
f6f5fa7c3f QuestRunner now works in inline args mode. 2019-11-16 17:08:09 +02:00
jtuu
c57595a7af Simplified the way the VM manages the registers and the string argument store. 2019-11-16 00:16:09 +02:00
jtuu
0365b40e55 Added stop button. 2019-11-15 20:17:24 +02:00
jtuu
24abf3ae7f Modified QuestRunner's execution flow.
Now it goes like this:
1. Advance instruction pointer.
2. Check for breakpoints.
3. Execute instruction.

Also fixed some bugs.
2019-11-15 19:59:05 +02:00
jtuu
6e41b6fb79 Reworked script editor decorations.
Breakpoints now move correctly when script is edited.
2019-11-15 19:59:05 +02:00
jtuu
8c4e0c2ed2 Hooked up the stepping buttons to their respective methods in QuestRunner. 2019-11-15 19:59:05 +02:00
jtuu
b8f0cbfcb3 Added running and paused properties to QuestRunner.
Also tried to improve the situation with the circular dependencies.
2019-11-15 19:59:05 +02:00
jtuu
a219200291 Added buttons for VM controls.
Also added new icons.
2019-11-15 19:59:05 +02:00
jtuu
69f044ead1 [VM] Changed how mapping labels to segment indices works slightly. 2019-11-15 19:59:05 +02:00
jtuu
5c6dc50b4e Started working on stepping execution for QuestRunner.
Step over and step in kind of work but there are still bugs. Step out is unimplemented.
2019-11-15 19:59:05 +02:00
jtuu
911bde2bd9 Highlight the source location currently being executed when VM pauses. 2019-11-14 00:34:07 +02:00
jtuu
90ad66e96d Breakpoints now cause VM to pause. 2019-11-14 00:31:20 +02:00
jtuu
144e9513ac Added toggleable icons that represent breakpoints in the script editor. 2019-11-13 21:51:30 +02:00
jtuu
fbc9d96d25 Fixed VM state resetting. 2019-11-13 21:50:01 +02:00
jtuu
d2b57bb0c6 [VM] Implemented template string parsing for arg_pushs.
Most of the tags aren't implemented though.
2019-11-13 19:10:30 +02:00
jtuu
66525ca00c Added definition for opcode 0xf882 get_pl_job. 2019-11-12 17:10:03 +02:00
jtuu
d85de25f31 [VM] Fixed a bug where string arguments did not have a null terminator. 2019-11-11 23:00:56 +02:00
jtuu
f6b766bda3 Fixed VM tests that were broken by the changes to ExecutionResult. 2019-11-11 18:09:51 +02:00
jtuu
b8db5d46fc [VM] Allow last instruction to return an ExecutionResult other than Halted.
The next call to execute will then be a no-op and return Halted.
2019-11-11 18:07:26 +02:00
jtuu
87cabac307 Added a unit test for list opcode. 2019-11-11 16:08:38 +02:00
jtuu
6b2a61bc4f Added RegTupRef argument support for the argument stack. 2019-11-11 16:07:25 +02:00
jtuu
fbd4df4b58 Changed the way VM input is handled.
Now the VM informs the runner when it requires input via ExecutionResult. Input is provided to the VM by calling methods directly on it.
Also implemented opcode list.
2019-11-11 15:21:13 +02:00
jtuu
b9e762fa6e Use the new message log in QuestRunner. 2019-11-08 18:34:58 +02:00
jtuu
7e99857baf Added a message log in the quest editor.
QuestEditorStore was extended to hold the state of the message log. The view is handled by a new core GUI class MessageLog.
2019-11-08 15:07:46 +02:00
Daan Vanden Bosch
9545f056ab Added QuestRunner for managing game state, orchestrating the VM and controlling the visual aspects of a virtual quest run. 2019-11-05 21:07:17 +01:00
Daan Vanden Bosch
4a755a884f Entity world-relative rotation now stays constant while translating manually. 2019-11-04 18:02:30 +01:00
Daan Vanden Bosch
db9d15b78a Fixed bug in computation of inverse rotation of section. The bug manifested while manually translating an entity across a rotated section. 2019-11-04 18:01:11 +01:00
Daan Vanden Bosch
8212348a81 Made event rendering more robust. Added call_now option to ListProperty.observe_list. 2019-11-04 17:19:57 +01:00
jtuu
e7a39168ae [VM] Print a warning instead of throwing an error when a unimplemented opcode is encountered. 2019-11-01 21:05:20 +02:00
jtuu
4441435302 [VM] Implemented opcode set_episode and made it possible to load the entire quest in the VM. 2019-11-01 21:04:50 +02:00
jtuu
89a119e90d Modified the function convert_quest_from_model to do a deep copy of the given object.
Added a couple other cloning functions.
2019-11-01 18:13:32 +02:00
Daan Vanden Bosch
af5c27a565 Removed unnecessary console.log statements. 2019-10-31 19:11:58 +01:00
Daan Vanden Bosch
ee76fb8aea Merge remote-tracking branch 'github/master' 2019-10-31 19:11:20 +01:00
Daan Vanden Bosch
f1fa19238d Event DAG edges are now shown with lines. 2019-10-31 19:11:14 +01:00
jtuu
c726cd3461 [VM] Implemented gettime opcode. 2019-10-30 23:00:06 +02:00
jtuu
260c070f34 [VM] Implemented get_random opcode and added a unit test for it. 2019-10-30 21:02:35 +02:00
Daan Vanden Bosch
95da6e9e57 Logging when duplicate events are encountered. 2019-10-29 15:26:10 +01:00
Daan Vanden Bosch
5f1b3d5ff1 Quest events are now grouped in DAGs. 2019-10-29 15:22:46 +01:00
Daan Vanden Bosch
dff39bd194 Improved events view UI. 2019-10-27 23:21:58 +01:00
Daan Vanden Bosch
13fd0a984c Fixed bug in QuestModel. 2019-10-27 22:47:38 +01:00
Daan Vanden Bosch
2ed9659d9b Only the current area's event chains are now shown. 2019-10-27 22:40:26 +01:00
Daan Vanden Bosch
d6ebb8e21a Added simple transparency to entities. Seems to work for most entities except for those that use translucent texture to emulate light rays etc. 2019-10-27 16:45:30 +01:00
jtuu
27e0d2fd6d [VM] Added a unit test for float arithmetic. 2019-10-17 23:57:47 +03:00
jtuu
f42d66e7e1 [VM] Transform float arithmethic arguments to valid 32-bit floats. 2019-10-17 23:53:15 +03:00
jtuu
48f525a3bd [VM] Fixed floating point arithmetic opcodes.
They were broken because they weren't actually using floats.
2019-10-17 22:11:59 +03:00
jtuu
2906c8b577 [VM] Added unit tests for integer arithmetic. 2019-10-17 21:48:21 +03:00
jtuu
fc2e7647fe [VM] Throw error on division by zero. 2019-10-17 21:38:47 +03:00