-
Notifications
You must be signed in to change notification settings - Fork 2
/
00common.bdscript
203 lines (202 loc) · 3.59 KB
/
00common.bdscript
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
---
WorkSize: 0
StackSize: 512
TempSize: 512
Triggers:
- Key: 9
Addr: GAMEOVER
- Key: 8
Addr: PROGRESS_CALLBACK
- Key: 7
Addr: NEWGAME
Name: 00common
---
; codeLabels:
; codeRevealer:
section .text
GAMEOVER:
ret
PROGRESS_CALLBACK:
popToSp 0
pushFromFSp 0
gosub 4, L34
pushFromFSp 0
gosub 4, L122
ret
L34:
popToSp 0
pushFromFSp 0
dup
pushImm 13318
sub
jz L68
dup
pushImm 13320
sub
jz L68
dup
pushImm 13322
sub
jz L68
dup
pushImm 13324
sub
jz L68
jmp L120
L68:
pushImm 13325
syscall 0, 15 ; trap_progress_check_flag (1 in, 1 out)
eqz
jz L83
pushImm 13325
syscall 0, 14 ; trap_progress_set_flag (1 in, 0 out)
jmp L118
L83:
pushImm 13326
syscall 0, 15 ; trap_progress_check_flag (1 in, 1 out)
eqz
jz L98
pushImm 13326
syscall 0, 14 ; trap_progress_set_flag (1 in, 0 out)
jmp L118
L98:
pushImm 13327
syscall 0, 15 ; trap_progress_check_flag (1 in, 1 out)
eqz
jz L113
pushImm 13327
syscall 0, 14 ; trap_progress_set_flag (1 in, 0 out)
jmp L118
L113:
pushImm 13328
syscall 0, 14 ; trap_progress_set_flag (1 in, 0 out)
L118:
jmp L120
L120:
drop
ret
L122:
popToSp 0
pushFromFSp 0
dup
pushImm 8236
sub
jz L149
dup
pushImm 8270
sub
jz L149
dup
pushImm 8240
sub
jz L149
jmp L183
L149:
pushImm 8236
syscall 0, 15 ; trap_progress_check_flag (1 in, 1 out)
dup
jz L163
pushImm 8270
syscall 0, 15 ; trap_progress_check_flag (1 in, 1 out)
eqzv
L163:
dup
jz L172
pushImm 8240
syscall 0, 15 ; trap_progress_check_flag (1 in, 1 out)
eqzv
L172:
jz L181
pushImm 8242
syscall 0, 14 ; trap_progress_set_flag (1 in, 0 out)
jmp L181
L181:
jmp L183
L183:
drop
ret
NEWGAME:
pushImm 2048
syscall 0, 14 ; trap_progress_set_flag (1 in, 0 out)
gosub 4, L193
ret
L193:
pushImm 1
pushImm 41
pushImm 0
syscall 0, 75 ; trap_saveram_set_weapon (3 in, 0 out)
pushImm 2
pushImm 75
pushImm 0
syscall 0, 75 ; trap_saveram_set_weapon (3 in, 0 out)
pushImm 3
pushImm 49
pushImm 0
syscall 0, 75 ; trap_saveram_set_weapon (3 in, 0 out)
pushImm 4
pushImm 81
pushImm 0
syscall 0, 75 ; trap_saveram_set_weapon (3 in, 0 out)
pushImm 5
pushImm 54
pushImm 0
syscall 0, 75 ; trap_saveram_set_weapon (3 in, 0 out)
pushImm 6
pushImm 55
pushImm 80
syscall 0, 75 ; trap_saveram_set_weapon (3 in, 0 out)
pushImm 7
pushImm 72
pushImm 0
syscall 0, 75 ; trap_saveram_set_weapon (3 in, 0 out)
pushImm 8
pushImm 62
pushImm 0
syscall 0, 75 ; trap_saveram_set_weapon (3 in, 0 out)
pushImm 9
pushImm 59
pushImm 0
syscall 0, 75 ; trap_saveram_set_weapon (3 in, 0 out)
pushImm 10
pushImm 60
pushImm 0
syscall 0, 75 ; trap_saveram_set_weapon (3 in, 0 out)
pushImm 11
pushImm 61
pushImm 0
syscall 0, 75 ; trap_saveram_set_weapon (3 in, 0 out)
pushImm 12
pushImm 74
pushImm 0
syscall 0, 75 ; trap_saveram_set_weapon (3 in, 0 out)
pushImm 13
pushImm 73
pushImm 0
syscall 0, 75 ; trap_saveram_set_weapon (3 in, 0 out)
pushImm 1
pushImm 81 ;give Kingdom Key D to Valor Form
syscall 0, 76 ; trap_saveram_set_form_weapon (2 in, 0 out)
pushImm 2
pushImm 0
syscall 0, 76 ; trap_saveram_set_form_weapon (2 in, 0 out)
pushImm 3
pushImm 0
syscall 0, 76 ; trap_saveram_set_form_weapon (2 in, 0 out)
pushImm 4
pushImm 44 ;give Alpha Weapon to Master Form
syscall 0, 76 ; trap_saveram_set_form_weapon (2 in, 0 out)
pushImm 5
pushImm 45 ;give Omega Weapon to Final Form
syscall 0, 76 ; trap_saveram_set_form_weapon (2 in, 0 out)
pushImm 6
pushImm 71
syscall 0, 76 ; trap_saveram_set_form_weapon (2 in, 0 out)
pushImm 10
pushImm 42
syscall 0, 76 ; trap_saveram_set_form_weapon (2 in, 0 out)
ret
D393:
TXT393:
db 'jump start',0,0
TXT399:
db 'jump end',0,0