-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathEventEngineNotes.txt
More file actions
134 lines (105 loc) · 3.5 KB
/
EventEngineNotes.txt
File metadata and controls
134 lines (105 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/!\ FE8 ONLY HERE
Event Code Format: (Size: 2 (short))
bit 0-7 : CodeID | Event Code Id, valid range are 00-xx and 80-yy (xx and yy are size of some routine arrays)
bit 8-11 : CodeSize | Event Instruction size. If the Event Routine returns 0 or 2, the event cursor will advance by this value times 2
bit 12-15 : CodeParam | Depends (read by routines usually) (usually defines what behaviour is to be had)
Event Code Format: (Condensed)
0xCCSP
0xCC is CodeID
0x0S is CodeSize
0x0P is CodeParam
Example 0x2A21:
CodeID = 0x2A (Move to Chapter codes)
CodeSize = 0x02 (2 shorts aka a word)
CodeParam = 0x01
Event Routine return value:
0: Event cursor added to set value (see Event Code Format) and Continue Execution
2: Event cursor added to set value (see Event Code Format) and Yield
3: Yield
5: Kill the Event Engine
Anything else: Continue Execution
6C_08591AC0 & 6C_08591AF8 (Event Engine):
2C | word | some routine pointer
30 | word | some event pointer
34 | word | some other event pointer
38 | word | current event cursor
3C | short | Event State Bits:
bit 0 (& 0x01):
bit 1 (& 0x02):
bit 2 (& 0x04): Currently Skipping? (like when start is pressed or something)
bit 3 (& 0x08):
3E | short | Timer for STAL codes
42 | byte |
48 | word | UNIT pointer
MuCtr 6C:
2C | word | Unit Struct pointer
30 | word | MOVEUNIT pointer
34 | word | Event Move Buffer pointer
38 | short | Event Move Buffer Entry Count
EVENT CODES:
ID 00 "Null"
Does Nothing, returns 0
ID 01 "End"
If Event bit 0 is set:
returns 5 (Ends event execution)
Subcode 0001b "ENDB"
Clears Event Call Stack
Else "ENDA"
Nothing specific
Goes back to last event call
return 5 if no return (End event exec)
return 1 otherwise (Continue)
ID 02 "Event ID & Event Bit manipulation":
Subcode 0000b "EVBIT_F <bit>"
Clears event bit <bit>
Subcode 1000b "EVBIT_T <bit>"
Sets event bit <bit>
Subcode 0001b "ENUF <evid>"
Unsets event id <evid>
Subcode 1001b "ENUT <evid>"
Sets event id <evid>
return 0 (Advance & Continue)
ID 03 "Event ID & Event Bit Check":
Subcode 0000b "CHECK_EVBIT <bit>:2"
Slot C = State of event bit <bit>
Subcode 0001b "CHECK_EVENTID <evid>:2"
Slot C = State of event id <evid>
return 0 (Advance & Continue)
ID 04 "Random Number Generation":
All "RANDOMNUMBER <max>:2"
Slot C = Random Integer in range 0 to <max> inclusive
return 0 (Advance & Continue)
ID 05 "Slot Set":
All "SVAL <slot>:2 <value>:4"
Slot <slot> = <value>
return 0 (Advance & Continue)
ID 06 "Slot Operations":
Subcode 0: SADD
Subcode 1: SSUB
Subcode 2: SMUL
Subcode 3: SDIV
Subcode 4: SMOD?
Subcode 5: SAND
Subcode 6: SORR
Subcode 7: SXOR
Subcode 8: SLSL
Subcode 9: SLSR
Other: return 6 (Continue)
"<op> <param>:2"
<param>:
bit 0-3: Dest Slot
bit 4-7: LSorc Slot
bit 8-11: RSorc Slot
Execututes operation between values in LSorc and RSorc, stores result in Dest
return 0 (Advance & Continue)
10 | EVBIT_MODIFY
2A | MNCH, MNC2, MNC3, MNTS
UNIT LOADING:
LOAD1 Param Ptr
LOAD2 Ptr @ LOAD1 but Param is fixed to 2
LOAD3 Param Ptr @ LOAD1 but also calls FE8U:80125C0 on the UNIT list which I don't really get?
LOAD4 Param @ loads skirmish enemies
Param meaning:
- 0 means do not load if unit is dead and player unit.
- 1 means no extra load constraints.
- 2 means load as cutscene unit unless unit is dead and player unit and not either of Seth, Myrrh, Innes or L'Arachel.