Commit Graph

37 Commits

Author SHA1 Message Date
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
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
fc2e7647fe [VM] Throw error on division by zero. 2019-10-17 21:38:47 +03:00
jtuu
cd52ca4576 [VM] Made the implementation of opcodes letb and letw more correct. 2019-10-17 20:02:53 +03:00
jtuu
4b7e03931c [VM] Implemented opcodes leta, flet and fleti. 2019-10-17 19:58:31 +03:00
jtuu
da6cdc7d74 [VM] Reset state more thoroughly when halting and loading new object code. 2019-10-17 18:44:05 +03:00
jtuu
755e38c76a Removed unused imports. 2019-10-17 17:53:20 +03:00
jtuu
4e9507cd3e Changed argument type of VirtualMachineIO.prototype.error from string to Error.
Also lint.
2019-10-17 17:50:19 +03:00
jtuu
cb81b988e5 [VM] Made the methods for getting register values public to enable unit tests.
Also renamed them so it's more obvious what they do.
2019-10-17 14:45:59 +03:00
jtuu
416e15e68e [VM] Changed some warnings into errors and added source locations to warnings. 2019-10-17 14:40:47 +03:00
jtuu
f3c26f9eda [VM] Added an interface for handling the virtual machine's IO. 2019-10-17 14:21:45 +03:00
jtuu
f8dc1af8ea Split VM code into separate files. 2019-10-15 15:34:30 +03:00
jtuu
9facc6357c Dispose threads when VM halts. 2019-10-11 15:02:54 +03:00
jtuu
c7b27846c8 [VM] Quick and dirty implementation of window_msg, add_msg and winend. 2019-10-11 12:49:20 +03:00
jtuu
21299646e4 [VM] Implemented arg_pushs and arg_pusha. 2019-10-11 11:11:06 +03:00
jtuu
2909b1bb3e Reworked VirtualMachineMemoryBuffer to extend ArrayBufferCursor. 2019-10-11 10:49:47 +03:00
jtuu
6ed419cf35 Use undefined instead of null as the empty value. 2019-10-11 09:14:34 +03:00
jtuu
f8c75d7dad [VM] Reworked the argument stack to emulate the PSOBB client more accurately. 2019-10-10 21:07:21 +03:00
jtuu
5248dbe0a0 [VM] Reworked register storage to emulate the PSOBB client more accurately. 2019-10-10 21:07:21 +03:00
jtuu
dbe4f3ab78 [VM] Implemented stack_push(m) and stack_pop(m) opcodes. 2019-10-07 20:52:44 +03:00
jtuu
f0d1d67b24 Lint and remove console.logs. 2019-10-04 14:21:51 +03:00
jtuu
3a8b189b0a [VM] Implemented conditional jump opcodes.
jmp_on, jmp_off, jmp_=, jmpi_=, jmp_!=, jmpi_!=, ujmp_>, ujmpi_>, jmp_>, jmpi_>, ujmp_<, ujmpi_<, jmp_<, jmpi_<, ujmp_>=, ujmpi_>=, jmp_>=, jmpi_>=, ujmp_<=, ujmpi_<=, jmp_<=, jmpi_<=
2019-10-04 14:17:34 +03:00
Daan Vanden Bosch
efed622e94 Fixed regression. 2019-10-03 17:28:48 +02:00
jtuu
d9110f0041 [VM] Push entire Arg object to stack instead of just its value. 2019-10-02 21:46:19 +03:00
jtuu
2e672c12b2 [VM] Implemented shift_left and shift_right opcodes. 2019-10-02 21:46:17 +03:00
jtuu
c628c30e1b [VM] Compare opcode numbers not the objects. 2019-10-02 21:46:13 +03:00
jtuu
78ed5c8071 [VM] Implemented opcodes for basic numeric operations. 2019-10-02 21:46:11 +03:00
jtuu
bdd7e8b174 [VM] Assign arguments to variables to make accessing them terser. 2019-10-02 21:46:09 +03:00
jtuu
806ab0ddd5 [VM] Implement arg_pushr, b, w, and s correctly. Remove arg_pusha and o because they are tricky and low priority. 2019-10-02 21:46:07 +03:00
jtuu
98acdbf7f9 [VM] Added arg stack. 2019-10-02 21:46:05 +03:00
jtuu
80a4aa784f [VM] Added a button to run the current quest in the VM.
Made the VM work with output from the assembler.
Added some comments to the VM and cleaned it up a little bit.
2019-10-02 21:43:53 +03:00
Daan Vanden Bosch
fc5a34946e Opcode is now structured cloning-safe. All IR is now structured cloning-safe. 2019-10-02 14:25:47 +02:00
Daan Vanden Bosch
03dc60cec9 Undo/redo now works again in the quest editor. The NPC counts view is also ported. 2019-08-26 15:42:12 +02:00
Daan Vanden Bosch
72506461ab Swapped code using new and old UI system around. 2019-08-21 17:56:46 +02:00
Daan Vanden Bosch
66127253d3 Split code into one module per tool + core and application module. 2019-08-10 22:09:06 +02:00