1 all numbers are int16_t
11 if argX is 255, then we have 'immediate' 2-byte value
15 bits 6-7: # of operands (0-3)
16 bits 0-5: opcode (0-31)
19 255: immediate value, else:
20 bits 0-6: variable number
21 bit 7: if set, use global
23 'immediate' for storing: ignore
25 all jumps are absolute offsets (in bytes)
27 spriteid: bit 7 != 0: right (have any meaning only for banks 84 and 90)
42 ; 3 args: dest, vi0, vi1
51 VM_JMP ; only 1st arg has any meaning
54 VM_END ; stop thread and destroy object
57 VM_BSR ; only 1st arg has any meaning
61 VM_NEW ; spawn thread (create new object); arg0: pc (arg1, arg2: args, can be ommited)
62 VM_BRK ; 'break' until the next frame
69 VM_RST ; 1st arg: function id; 2nd and 3rd args: arguments
71 ; working with map: get/set foreground/background
73 VM_MGF ; arg1: x; arg2: y; dest
74 VM_MGB ; arg1: x; arg2: y; dest
75 VM_MSF ; arg1: x; arg2: y; tile
76 VM_MSB ; arg1: x; arg2: y; tile
79 death: block 'main' professor thread, remove it's sprite, spawn new 'dying' thread
80 'death' thread will set global flag 'done' when animation is compete
83 thread 0 is 'main' thread: title, professor, etc
85 max threads: 258 (256 objects, 'main' and one for moving lift, etc)