This page contains notes for the game Lufia II: Rise of the Sinistrals.
EV(ent) Flags#
Information#
- 2-7 tell the game that the respective character is in your party.
- 21-118 are various story triggers.
- 196 actually works also in the standard game and "Retry" mode, and does indeed allow you to switch all party members at will. Keep in mind that Selan is required at Doom Island; otherwise the game will freeze because no one else has the Light spell.
- 250-255 seem to be special dungeon events; they're very frequently activated after defeating bosses.
- The effects of blank entries are unknown as of yet.
- There is no event flag for 'Retry'-mode exp/gold. it could be that this information is stored in the TP Registers instead.
Table#
EV Flag |
Event that changes it |
|---|---|
0 |
|
1 |
Starting a new Game (Probably the party trigger for Maxim) |
2 |
Party trigger: Selan |
3 |
Party trigger: Guy |
4 |
Party trigger: Artea |
5 |
Party trigger: Dekar |
6 |
Party trigger: Tia |
7 |
Partytrigger: Lexis |
8 |
Jelze (Foomy) joined the Party |
9 |
Flash (Shaggy) joined the Party |
10 |
Starting a new Game |
11 |
|
12 |
Gusto (Hard hat) joined the Party |
13 |
Zappy (Red Fish) joined the Party |
14 |
|
15 |
Sully (Radisher) joined the Party |
16 |
Blaze (Armor Dog) joined the Party |
17 |
|
18 |
|
19 |
|
20 |
|
21 |
Finished the tutorial |
22 |
Diner with Tia in Elcid |
23 |
Met Iris the first time in the cave near Elcid |
24 |
Saved Tia in the Lake Cave |
25 |
Killed the fish in the Lake Cave |
26 |
Talked to the king in Alunze Kingdom |
27 |
Picked up the crown |
28 |
Brought the crown back to the King |
29 |
Killed Regal Goblin in the Northwest Cavern of Alunze |
30 |
Guy joined the party |
31 |
Defeated Camu... |
32 |
...and returned Hilda to Tanbel |
33 |
Talked to Rochy in Clamento |
34 |
(not used?) |
35 |
Killed the spider in the Ruby Cave |
36 |
After receiving the Ruby Apple from Jaffy |
37 |
Brought the Ruby Apple to Rochy and the money to Jaffy |
38 |
First visit to Parcelyte (Seeing Selan protecting the little girl) |
39 |
Short fight in Parcelyte Castle between Selan and one of the soldiers |
40 |
Selan joined the party |
41 |
Killed Pierre (first time, blue clown) |
42 |
Killed Danielle (first time, red clown) |
43 |
Selan talked about the two clones, killing them at the same time |
44 |
Defeated Pierre and Danielle |
45 |
Talked with the King about Gades and the destroyed city Gordovan |
46 |
Passed Gades in Gordovan Tower/met Iris again |
47 |
Talked to the king in Parcelyte |
48 |
Destroyed the crystal nall in the Cave north of Merix |
49 |
The guy repaired the bridge after you destroyed the crystal |
50 |
Talked to the king of Bound Kingdom |
51 |
Saved the prince of the Bound Kingdom |
52 |
Dekar and Guy joined the party in Bound Kingdom, heading for Gades |
53 |
After the earthquake in Sundletan |
54 |
(not used?) |
55 |
After Idura kidnapped Jeros |
56 |
(not used?) |
57 |
Saved Jeros from Idura |
58 |
Talked to Jyad at Phantom Tree Mountain |
59 |
Ported back with Jyad to Aleyn |
60 |
Rested twice at the inn in Aleyn |
61 |
(not used?) |
62 |
On after the women of Narcysus run away |
63 |
On after the women of Narcysus run away, turned off after defeating Idura inside Tower of Sacrifice |
64 |
Idura defeated in Tower of Sacrifice |
65 |
Finished Karlloon Temple (lost Dekar) |
66 |
Talked to Lexis assistance in Treadool |
67 |
Talked to Lexis in his Lab |
68 |
Talked to the shipbuilder in Aleyn |
69 |
Talked to the flower girl in Treadool |
70 |
Received the Pretty Flower |
71 |
Brought the Priphea to Leffa |
72 |
Talked to the king of Dankirk Kingdom |
73 |
They noticed the Ruby Icon is gone |
74 |
Talked to Jaffy about the Ruby Icon |
75 |
Brought the Ruby Icon to Prince Alex |
76 |
Returned the real Ruby Icon |
77 |
Talked to Prince Alex in Auralio to open the water gate |
78 |
Talked to the guy in Ferim Kingdom about the jewel in the Northwest Tower |
79 |
Met Amon the first time |
80 |
Returned to Ferim Kingdom king's room |
81 |
Talked to Iris in Agurio |
82 |
(not used?) |
83 |
Answered yes in Kirmo's Lab |
84 |
Saved Milka from the gargoyles |
85 |
Amon defeated in Divine Shrine |
86 |
Got the Submarine |
87 |
Defeated the ghost in the Shrine of Vengeance |
88 |
Talked to Iris in Barnan |
89 |
Finished Tower of Truth |
90 |
Finished Dragon Mountain |
91 |
(not used?) |
92 |
Talked to the queen of the mermaids |
93 |
Defeated the Doom Ship |
94 |
Talked to the mermaids right in front of the underwater temple |
95 |
Chaed was destroyed |
96 |
Talked with Lexis about the engine |
97 |
Killed the soldiers in the prison |
98 |
Got the engine and warped back to Portravia |
99 |
Got the airship |
100 |
Talked to the old guy in Narvick |
101 |
Talked to the old guy in Narvick (received the first maid) / Turns off after Gades is defeated |
102 |
Gades defeated |
103 |
Talked to the old guy in Narvick |
104 |
Talked to the old guy in Narvick (received the second maid) / Turns off after Amon is defeated |
105 |
Amon defeated |
106 |
Talked to the old guy in Narvick |
107 |
"Talked to the old guy in Narvick (received the third maid) / Turns off after Daos is ""defeated""" |
108 |
Optained the Dual Blade |
109 |
Ported back to Portravia |
110 |
The small conversation in Portravia |
111 |
Talked to Lexis to enter the final fight |
112 |
Gades defeated |
113 |
Amon defeated |
114 |
Erim defeated |
115 |
Daos is defeated |
116 |
First stone destroyed |
117 |
Second stone destroyed |
118 |
(not used?) - Destroying the third stone will start the credits/outro |
119 |
Tutorial event initialized |
120 |
Turned on after Guy left the party in Parcelyte |
121 |
Rested twice at the inn in Aleyn |
122 |
|
123 |
|
124 |
Talked to the King in Alunze Kingdom, deactivated again after talking to the passed out guy |
125 |
Opened the Shrine for Guys Sister Hilda |
126 |
Talked to Iris in Karlloon Shrine (Iris 'joined' the party) |
127 |
Talked to Lexis in Treadool and received the ship |
128 |
Talked to Iris in Agurio |
129 |
|
130 |
Teleporter 2 in Daos Room active? (not sure) |
131 |
|
132 |
On after Idura kidnaps Jeros |
133 |
Defeated Gades in Ancient Tower |
134 |
The two thieves opened the door in the prison |
135 |
|
136 |
Talked to Rochy in Clamento |
137 |
Small Cutscene inside the the cave in the north of Merix (Where Tia falls down) |
138 |
Cutscene at the entrance to Bound Kingdom, turned off after talking to Dekar or the king (not sure) |
139 |
|
140 |
Talked to Jyad at Phantom Tree Mountain |
141 |
Killed the two lions at Phantom Tree Mountain |
142 |
Killed Idura in Kalloon Shrine |
143 |
Received the Pretty Flower |
144 |
Amon defeated in Divine Shrine |
145 |
|
146 |
Amon defeated in Divine Shrine |
147 |
Inside Ancient Cave (not sure!) |
148 |
Talked to Prince Alex in Auralio to open the water gate |
149 |
Talked to Prince Alex in Auralio to open the water gate |
150 |
Bad News, the key is gone (Elcid) |
151 |
After the sewer scene in Alunze Castle |
152 |
Talked to Guy's sister Hilda in Tanbel |
153 |
Used the ship from Aleyn to go to Gruberik or Narcysus |
154 |
Talked to Dekar for the first time |
155 |
Bound Kingdom, the guard told you about Gades and the king |
156 |
On after Idura kidnaps Jeros |
157 |
Dekar and Guy joined the party inside the shrine to Alyen |
158 |
Tutorial Event (Entering the cave and talking to the old guy) |
159 |
Tutorial Event (Jelly beaten) |
160 |
Tutorial Event (Move the pillar) |
161 |
Tutorial Event (Jump down) |
162 |
Tutorial Event (Kill them all) |
163 |
Tutorial Event (cut the grass) |
164 |
Alunze Kingdom (talked to the passed out guy) |
165 |
|
166 |
|
167 |
Visited Picolina again after the Mother of Milka died while killing Amon |
168 |
|
169 |
Talked to Abel in Alunze Northwest Cavern |
170 |
Picked up the Crown (Alunze Castle) |
171 |
Tutorial Event (There is an R-Button) |
172 |
Tutorial Event (Undo Magic received) |
173 |
|
174 |
|
175 |
|
176 |
|
177 |
Turned on after killing both clowns one time inside the Treasure Sword Shrine |
178 |
Dekar and Guy joined the party in Bound Kingdom, heading for Gades, turned off after killing Gades |
179 |
|
180 |
|
181 |
|
182 |
|
183 |
Talked to the boy in Treble when you visit it for the first time |
184 |
|
185 |
Talked to the girl in Foomy Woods |
186 |
Activated the power extend platform in Divine Room |
187 |
|
188 |
|
189 |
|
190 |
Finished Karlloon Temple (lost Dekar) |
191 |
|
192 |
|
193 |
Killed the Egg Dragon for the first time (Turning off will allow you to get more Egg Rings/Egg Swords) |
194 |
|
195 |
Ancient Cave boss killed |
196 |
Gift Mode (Party members are standing inside the pub of Gruberik) |
197 |
|
198 |
|
199 |
Destroyed two statues in Ancient Tower, off again after the wedding etc. |
200 |
Got Iris Treasure 1/10 (Will be turned on after leaving ancient cave) |
201 |
Got Iris Treasure 2/10 (Will be turned on after leaving ancient cave) |
202 |
Ancient Cave Boss killed 3/10 (Will be turned on after leaving ancient cave) |
203 |
Got Iris Treasure 4/10 (Will be turned on after leaving Ancient Cave) |
204 |
Got Iris Treasure 5/10 (Will be turned on after leaving Ancient Cave) |
205 |
Got Iris Treasure 6/10 (Will be turned on after leaving Ancient Cave) |
206 |
Got Iris Treasure 7/10 (Will be turned on after leaving Ancient Cave) |
207 |
Got Iris Treasure 8/10 (Will be turned on after leaving Ancient Cave) |
208 |
Got Iris Treasure 9/10 (Will be turned on after leaving Ancient Cave) |
209 |
Got Iris Treasure 10/10 (Will be turned on after leaving Ancient Cave) |
210 |
Returned Iris Sword |
211 |
Returned Iris Shield |
212 |
Returned Iris Helmet |
213 |
Returned Iris Armor |
214 |
Returned Iris Ring |
215 |
Returned Iris Jewel |
216 |
Returned Iris Staff |
217 |
Returned Iris Pot |
218 |
Returned Iris Tiara |
219 |
Returned Ancient Cave Boss |
220 |
|
221 |
|
222 |
|
223 |
|
224 |
|
225 |
|
226 |
|
227 |
|
228 |
|
229 |
|
230 |
|
231 |
|
232 |
|
233 |
|
234 |
|
235 |
|
236 |
|
237 |
|
238 |
|
239 |
|
240 |
Turned on after receiving the Undo magic; turns off again after leaving the dungeon |
241 |
Turned on after receiving the Undo magic; turns off again after leaving the dungeon |
242 |
|
243 |
|
244 |
|
245 |
|
246 |
|
247 |
|
248 |
|
249 |
|
250 |
Changes after several special events to 'on', after leaving the floor/house/dungeon it turns off again |
251 |
Changes after several special events to 'on', after leaving the floor/house/dungeon it turns off again |
252 |
Changes after several special events to 'on', after leaving the floor/house/dungeon it turns off again |
253 |
Changes after several special events to 'on', after leaving the floor/house/dungeon it turns off again |
254 |
Changes after several special events to 'on', after leaving the floor/house/dungeon it turns off again |
255 |
Changes after several special events to 'on', after leaving the floor/house/dungeon it turns off again |
EV(ent) Registers#
EP Registers |
When changed |
|---|---|
0 |
|
1 |
|
2 |
|
3 |
Changed register to 2 after activating the hard switch in lake cave, changed back to one after leaving the cave, |
4 |
|
5 |
|
6 |
Changes the register to 2 after you talked the first time to the girl in Merix |
7 |
Counter for the number of times you rested at an inn |
8 |
Counter for Dragon Eggs returned (with a 'dragon egg code' active the dragon would give always stuff) |
9 |
|
10 |
Default value of 5 at game start |
11 |
|
12 |
Changes register to 1 after you got the Dragon Egg from the girl in Merix |
13 |
|
14 |
Counter for the Iris Treasures you returned |
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 |
Location List / Decompressed Map Names (North American Version)#
ID Map Name
00 World Map
01 Map of Seafloor
02 Arek Daos Shrine
03 Elcid
04 Elcid
05 Secret Skills Cave
06 Cave to Sundletan B1
07 Cave to Sundletan B2
08 Sundletan
09 Sundletan
0A Lake Cave B1
0B Lake Cave B2
0C Lake Cave B3
0D Shrine to Alunze Kingdom
0E Foomy Woods
0F Alunze Castle
10 Alunze Castle
11 Alunze Castle B2
12 Alunze Castle B3
13 Alunze Castle B4
14 Alunze Castle B5
15 Alunze Kingdom
16 Alunze Kingdom
17 Alunze North Shrine
18 Alunze Northwest Cave B1
19 Alunze Northwest Cave B2
1A Alunze Northwest Cave B3
1B Alunze Northwest Cave B4
1C Tanbel
1D Tanbel
1E
1F Tanbel Southeast Tower 1F
20 Tanbel Southeast Tower 2F
21 Tanbel Southeast Tower 3F
22 Tanbel Southeast Tower 4F
23 Tanbel Southeast Tower 5F
24 Tanbel Southeast Tower 6F
25 Clamento
26 Clamento
27 Ruby Cave B1
28 Ruby Cave B2
29 Ruby Cave B3
2A Ruby Cave B4
2B Small Shrine to Parcelyte
2C Parcelyte
2D Parcelyte
2E Parcelyte Castle
2F Parcelyte Castle
30 Treasure Sword Shrine 1F
31 Treasure Sword Shrine 2F
32 Treasure Sword Shrine 3F
33 Treasure Sword Shrine 4F
34 Treasure Sword Shrine B1
35 Small Shrine to Gordovan
36 Gordovan
37
38 Gordovan West Tower 1F
39 Gordovan West Tower 2F
3A Gordovan West Tower 3F
3B Gordovan West Tower 4F
3C Gordovan West Tower 5F
3D Gordovan West Tower 6F
3E Merix Village
3F Merix Village
40 Cave Bridge B1
41 Cave Bridge B2
42 Cave Bridge B3
43 Cave Bridge B4
44 Cave Bridge B5
45 Bound Kingdom
46 Bound Kingdom
47 North Dungeon B1
48 North Dungeon B2
49 North Dungeon B3
4A North Dungeon B4
4B
4C Ancient Tower 1F
4D Ancient Tower 2F
4E Ancient Tower 3F
4F Ancient Tower 4F
50 Ancient Tower 5F
51 Ancient Tower 6F
52 Ancient Tower 7F
53 Ancient Tower 6F
54 Ancient Tower 5F
55 Ancient Tower 4F
56 Small Shrine to Aleyn
57
58 North Lighthouse 1F
59 North Lighthouse 2F
5A North Lighthouse 3F
5B North Lighthouse 4F
5C North Lighthouse 5F
5D North Lighthouse 6F
5E Port Town of Aleyn
5F Port Town of Aleyn
60 Phantom Tree Mountain
61 Phant
62 Phant
63 Phant
64 Phant
65 Phant
66 Phant
67 Phant
68 Gruberik
69 Gruberik
6A Narcysus
6B Narcysus
6C
6D Tower of Sacrifice 1F
6E Tower of Sacrifice 2F
6F Tower of Sacrifice 3F
70 Tower of Sacrifice 4F
71 Tower of Sacrifice 5F
72 Tower of Sacrifice 6F
73 Karlloon
74 Karlloon
75 Karlloon North Shrine 1F
76 Karlloon North Shrine 2F
77 Karlloon North Shrine 3F
78 Karlloon North Shrine B1
79 Small Shrine to Treadool
7A Treadool
7B Treadool
7C
7D Lexis Shaia Laboratory
7E Flower Mountain
7F Flower Mountain
80 Flower Mountain
81 Flower Mountain
82 Flower Mountain
83 Flower Mountain
84 Flower Mountain
85 Forfeit Island
86 Forfeit Island
87 Markao
88 Dankirk Kingdom
89 Dankirk Kingdom
8A Auralio Kingdom
8B Auralio Kingdom
8C Dankirk North Cave B1
8D Dankirk North Cave B2
8E Dankirk North Cave B3
8F Dankirk North Cave B4
90 Dankirk North Cave B5
91 Ferim Kingdom
92 Ferim Kingdom
93
94 Northeast Tower 1F
95 Northeast Tower 2F
96 Northeast Tower 3F
97 Northeast Tower 4F
98 Northeast Tower 5F
99 Small Shrine to Agurio
9A Agurio
9B Treble
9C Treble
9D Pico Forest
9E Pico Forest
9F Small Shrine to Dragon Egg
A0 Portravia
A1 Portravia
A2 Kirmo Laboratory
A3 Mountain of No Return
A4 Mountain of No Return
A5 Mountain of No Return
A6 Eserikto
A7 Eserikto
A8 Divine Shrine 1F
A9 Divine Shrine 2F
AA Divine Shrine 3F
AB Divine Shrine B1
AC Barnan
AD Barnan
AE Barnan Sth. Submarine Cave
AF Shrine of Vengeance 1F
B0 Shrine of Vengeance 2F
B1 Shrine of Vengeance 3F
B2 Shrine of Vengeance 4F
B3 Shrine of Vengeance B1
B4 Shrine of Vengeance B2
B5 Durale
B6 Durale
B7
B8 Tower of Truth 1F
B9 Tower of Truth 2F
BA Tower of Truth 3F
BB Tower of Truth 4F
BC Tower of Truth 5F
BD Tower of Truth 6F
BE Chaed
BF Chaed
C0 Dragon Mountain
C1 Dragon Mountain
C2 Dragon Mountain
C3 Dragon Mountain
C4 Dragon Mountain
C5 Dragon Mountain
C6 Dragon Mountain
C7 Dragon Mountain
C8 Chaed Nth. Submarine Cave
C9 Submarine Town of Preamarl
CA Submarine Town of Preamarl
CB Submarine Cave to Shrine
CC Submarine Cave to Shrine
CD Submarine Cave Shrine
CE Submarine Cave Shrine
CF
D0 Chaed
D1 Gratze Sth. Submarine Cave
D2 ò3 y� Castle B1
D3 ò3 y� Castle B2
D4 ò3 y� Castle B3
D5 ò3 y� Castle B4
D6 ò3 y� Kingdom
D7 ò3 y� Kingdom
D8 Narvick
D9 �� �<
DA
DB
DC
DD Shuman Isl. Sealed Tower
DE
DF
E0
E1 Strahda Isl. Sealed Towe
E2
E3
E4
E5 Kamirno Isl. Sealed Towe
E6
E7 Shrine of Daos 1F
E8 Shrine of Daos 2F
E9 Shrine of Daos 3F
EA Shrine of Daos 4F
EB Shrine of Daos 5F
EC
ED Capsule Monsters` Shrine
EE
EF £� U e Mo� V ¹T� Cave
F0 Ancient Cave
F1 Ancient Cave Final Floor
F2
F3
F4
F5
F6
F7
F8
F9
FA
FB
FC
FD
FE
FF
Notes#
Map names are stored in ASCII, and there's two control codes: $00 (end string) and $0A (compression). For compression, the $0A control code is followed by a 16 bit value, where the lower 12 bits is the start address to copy from (+878000) and the upper 4 bits is the number of bytes to copy -2.
Example:
Location 03 Elcid (outside)
E l c i d
87883B | 456C636964 00
----
Location 04 Elcid (inside rooms)
878841 | 0A3B38 00
^^^^
Byteswap, result is 383B.
Add 2 to the first digit. Result is 5, the number of bytes to copy.
Next, add the next three digits (83B) to 878000. Result is 87883B, the start address to copy from.
- 61-67 - These are supposed to be copies of the name Phantom Tree Mountain for use in the inside caves, but the game doesn't display the map name for them. The $15 / 21 decimal byte length of Phantom Tree Mountain can't be represented by the 4 bits allocated for the number of bytes to copy during decompression, so only $05 bytes are copied instead. The result is just Phant for these entries.
- D2-D7 - With only 12 bits to represent the decompression start address, the range is limited to 878000-878FFF. But the start address for Gratze is 879028. The game ends up pulling data from 878028 instead. The data there is pointers, resulting in gibberish text.
- D9 - The inside rooms in Narvick. It has a decompression error for the name Narvick (like Gratze / '3y), but this isn't seen as the map name isn't displayed for this location. Pulls data from 878072 instead of 879072.
- E1,E5 - off-by-one error for the number of bytes to copy results in " Towe" instead of " Tower".
- ED - This name contains ` (ASCII 0x60), which isn't in the font graphics.
- EF - Decompression error, pulls data from 878103 instead of 879103. Correct name is Capsule Monsters Cave, but also has the missing ` issue.
Map Name text handler 80C9C0-80CA13#
$80/C9C0 08 PHP
$80/C9C1 8B PHB
$80/C9C2 E2 20 SEP #$20
$80/C9C4 C2 10 REP #$10
$80/C9C6 A9 7E LDA #$7E
$80/C9C8 48 PHA
$80/C9C9 AB PLB
$80/C9CA BF 00 80 87 LDA $878000,x //read one byte of map name (when starting, x is pointer obtained from (878016 + (location ID * 0x08))
$80/C9CE F0 3D BEQ $3D [$CA0D] //goto $CA0D if control code $00 end string
$80/C9D0 C9 0A CMP #$0A //control code $0A compression
$80/C9D2 D0 32 BNE $32 [$CA06]
$80/C9D4 E8 INX
$80/C9D5 BF 00 80 87 LDA $878000,x //8 bits of start address to copy from (of 12 bits total)
$80/C9D9 85 54 STA $54
$80/C9DB E8 INX
$80/C9DC BF 00 80 87 LDA $878000,x //4 bits of number of bytes to copy, and remaining 4 bits of start address to copy from
$80/C9E0 85 55 STA $55
$80/C9E2 E8 INX
$80/C9E3 4A LSR A //get most significant 4 bits (contains number of bytes to copy)
$80/C9E4 4A LSR A //^
$80/C9E5 4A LSR A //^
$80/C9E6 4A LSR A //^
$80/C9E7 1A INC A //add 2 to the number of bytes to copy...
$80/C9E8 1A INC A //^
$80/C9E9 85 56 STA $56 //...and store the result to 7E0056
$80/C9EB DA PHX //push current position in reading map name (ie., after the 0Axxxx command) to stack
$80/C9EC C2 20 REP #$20
$80/C9EE A5 54 LDA $54
$80/C9F0 29 FF 0F AND #$0FFF //get 12 bit start address
$80/C9F3 AA TAX //move to x reg...
$80/C9F4 E2 20 SEP #$20
$80/C9F6 BF 00 80 87 LDA $878000,x //...and start reading map name bytes from there
$80/C9FA 99 00 00 STA $0000,y //store byte of map name to RAM
$80/C9FD C8 INY
$80/C9FE E8 INX
$80/C9FF C6 56 DEC $56 //decrease number of bytes to copy...
$80/CA01 D0 F3 BNE $F3 [$C9F6] //...and loop until zero
$80/CA03 FA PLX //pull current position in reading map name
$80/CA04 80 C4 BRA $C4 [$C9CA] //finished control code $0A work
$80/CA06 99 00 00 STA $0000,y //store byte of map name to RAM
$80/CA09 C8 INY //increment number of bytes for final decompressed map name length, ignoring $00 end string (full 16 bit y reg is end address in RAM (+7E0000))
$80/CA0A E8 INX //increment current position
$80/CA0B 80 BD BRA $BD [$C9CA] //loop until control code $00 is found
$80/CA0D 7B TDC //clear accumulator (all 16 bits)
$80/CA0E 99 00 00 STA $0000,y //store the control code $00 byte to RAM
$80/CA11 AB PLB
$80/CA12 28 PLP
$80/CA13 6B RTL
Text Control Code $0A#
(This section corresponds to the Japanese version Estpolis Denki II)
Text control code $0A for the main dialogue is similar to the map name decompression for the North American version seen in the above section. The $0A byte is followed by a 16-bit value, where the lower 12 bits is how many bytes to jump back, and the upper 4 bits is the number of bytes to copy -2.
- Example 1:
Create 5 character string "0GOLD" on the third line of the second textbox by copying "0GOLD" from the second line of the first textbox.
ROM/SNES addr
0 G O L D
03413E/86C13E 203038352D
03415B/86C15B 0A1E30
^^^^
Byteswap, result is 301E.
Add 2 to the first digit. Result is 5, the number of bytes to copy.
Next, subtract the next three digits (01E) from the address that's 1 byte after the $0A control code byte (86C15C).
86C15C - 01E = 86C13E
- Example 2:
This is a modified example of the above just to show the maximum distance to jump back:
ROM/SNES addr
03415B/86C15B 0AFF3F
^^^^
Byteswap, result is 3FFF.
Add 2 to the first digit. Result is 5, the number of bytes to copy.
Next, subtract the next three digits (FFF) from the address that's 1 byte after the $0A control code byte (86C15C).
86C15C - FFF = 86B15D
- SNES programming for Example 1
$80/C1C2 B9 00 00 LDA $0000,y[$86:C15B] A:0000 X:0010 Y:C15B P:envMxdIZc
$80/C1C5 C8 INY A:000A X:0010 Y:C15B P:envMxdIzc //control code 0A
$80/C1C6 30 12 BMI $12 [$C1DA] A:000A X:0010 Y:C15C P:eNvMxdIzc
$80/C1DA 60 RTS A:000A X:0010 Y:C15C P:eNvMxdIzc
$80/9E5F C2 20 REP #$20 A:000A X:0010 Y:C15C P:eNvMxdIzc
$80/9E61 0A ASL A A:000A X:0010 Y:C15C P:eNvmxdIzc
$80/9E62 AA TAX A:0014 X:0010 Y:C15C P:envmxdIzc
$80/9E63 E2 20 SEP #$20 A:0014 X:0014 Y:C15C P:envmxdIzc
$80/9E65 7C FB CA JMP ($CAFB,x)[$80:9FB3] A:0014 X:0014 Y:C15C P:envMxdIzc
$80/9FB3 20 C2 C1 JSR $C1C2 [$80:C1C2] A:0014 X:0014 Y:C15C P:envMxdIzc
$80/C1C2 B9 00 00 LDA $0000,y[$86:C15C] A:0014 X:0014 Y:C15C P:envMxdIzc //8 bits of start address to copy from (of 12 bits total)
$80/C1C5 C8 INY A:001E X:0014 Y:C15C P:envMxdIzc
$80/C1C6 30 12 BMI $12 [$C1DA] A:001E X:0014 Y:C15D P:eNvMxdIzc
$80/C1DA 60 RTS A:001E X:0014 Y:C15D P:eNvMxdIzc
$80/9FB6 85 54 STA $54 [$00:0054] A:001E X:0014 Y:C15D P:eNvMxdIzc
$80/9FB8 20 C2 C1 JSR $C1C2 [$80:C1C2] A:001E X:0014 Y:C15D P:eNvMxdIzc
$80/C1C2 B9 00 00 LDA $0000,y[$86:C15D] A:001E X:0014 Y:C15D P:eNvMxdIzc //4 bits of number of bytes to copy, and remaining 4 bits of start address to copy from
$80/C1C5 C8 INY A:0030 X:0014 Y:C15D P:envMxdIzc
$80/C1C6 30 12 BMI $12 [$C1DA] A:0030 X:0014 Y:C15E P:eNvMxdIzc
$80/C1DA 60 RTS A:0030 X:0014 Y:C15E P:eNvMxdIzc
$80/9FBB 85 55 STA $55 [$00:0055] A:0030 X:0014 Y:C15E P:eNvMxdIzc
$80/9FBD 4A LSR A A:0030 X:0014 Y:C15E P:eNvMxdIzc //get most significant 4 bits (contains number of bytes to copy)
$80/9FBE 4A LSR A A:0018 X:0014 Y:C15E P:envMxdIzc //^
$80/9FBF 4A LSR A A:000C X:0014 Y:C15E P:envMxdIzc //^
$80/9FC0 4A LSR A A:0006 X:0014 Y:C15E P:envMxdIzc //^
$80/9FC1 18 CLC A:0003 X:0014 Y:C15E P:envMxdIzc //^
$80/9FC2 69 02 ADC #$02 A:0003 X:0014 Y:C15E P:envMxdIzc //add 2 to the number of bytes to copy
$80/9FC4 8D 3D 12 STA $123D [$86:123D] A:0005 X:0014 Y:C15E P:envMxdIzc //store total number of bytes to copy
$80/9FC7 8C 3A 12 STY $123A [$86:123A] A:0005 X:0014 Y:C15E P:envMxdIzc //remember current position in script
$80/9FCA A9 F0 LDA #$F0 A:0005 X:0014 Y:C15E P:envMxdIzc
$80/9FCC 14 55 TRB $55 [$00:0055] A:00F0 X:0014 Y:C15E P:eNvMxdIzc //clear number of bytes to copy, so now the 16-bit value is just the number of bytes to jump back
$80/9FCE 8B PHB A:00F0 X:0014 Y:C15E P:eNvMxdIzc
$80/9FCF 68 PLA A:00F0 X:0014 Y:C15E P:eNvMxdIzc
$80/9FD0 8D 3C 12 STA $123C [$86:123C] A:0086 X:0014 Y:C15E P:eNvMxdIzc //bank address (ie, 86xxxx)
$80/9FD3 C2 20 REP #$20 A:0086 X:0014 Y:C15E P:eNvMxdIzc
$80/9FD5 AD 3A 12 LDA $123A [$86:123A] A:0086 X:0014 Y:C15E P:eNvmxdIzc
$80/9FD8 38 SEC A:C15E X:0014 Y:C15E P:eNvmxdIzc
$80/9FD9 E9 02 00 SBC #$0002 A:C15E X:0014 Y:C15E P:eNvmxdIzC //subtract 2 from current position, result is address just after the 0A control code byte
$80/9FDC E5 54 SBC $54 [$00:0054] A:C15C X:0014 Y:C15E P:eNvmxdIzC //subtract number of bytes to jump back (01E in this case)
$80/9FDE A8 TAY A:C13E X:0014 Y:C15E P:eNvmxdIzC //accumulator holds the start address to copy bytes from
$80/9FDF 30 0F BMI $0F [$9FF0] A:C13E X:0014 Y:C13E P:eNvmxdIzC
$80/9FF0 8C B7 09 STY $09B7 [$86:09B7] A:C13E X:0014 Y:C13E P:eNvmxdIzC
$80/9FF3 E2 20 SEP #$20 A:C13E X:0014 Y:C13E P:eNvmxdIzC
$80/9FF5 82 42 FE BRL $FE42 [$9E3A] A:C13E X:0014 Y:C13E P:eNvMxdIzC
TBL#
Table files for extracting Japanese text, mainly for comparison to the prototype. The kanji tables were provided by kWhazit, with some updates made since to fill in missing entries.
Main font#
$00-FF#
$00-0F are various control codes. $10 is the space character.
- $02 might be used to auto-close a textbox after it's finished - TODO: find an example.
- $04 is used to create pauses as the text is being written (eg, 321 countdown as the thieves try to escape the Alunze Castle throne room) For the parameter byte, when bit 0x80 is clear, the remaining bits are used as an index to change the "typewriter" sound effect as text is being printed in message boxes (TODO: verify and add more notes). When bit 0x80 is set, each digit increase represents a delay of around 10 frames. A common delay command seen is 04 83 - 30 frames or a half second. A 1 second delay is created with 04 86. The counter used is a single byte; the maximum possible delay is around 4 seconds, and would be represented with 04 98 or maybe 04 99 (needs more research), though it's unlikely there's any delay that long used in the script.
- $09 is the hero's name you entered at the start of a new game (default "マキシム" / "Maxim") The name can be up to 5 characters, and is stored at memory address FIXME 7Exxxx-7Exxxx
- $0A is used for compression in the main dialogue. For item and spell descriptions in menus, it's used as a line break.
ID=Char |
|---|
$00=(end dialogue) |
$10= |
$20=0 |
$30=G |
$40=W |
$50=m |
$60=う |
$70=て |
$80=も |
$90=ぉ |
$A0=シ |
$B0=フ |
$C0=ワ |
$D0=げ |
$E0=ぼ |
$F0=ダ |
$0500-05FF#
ID=Char |
|---|
$0500=峡 |
$0510=半 |
$0520=防 |
$0530=頭 |
$0540=側 |
$0550=市 |
$0560=急 |
$0570=起 |
$0580=込 |
$0590=消 |
$05A0=失 |
$05B0=木 |
$05C0=夜 |
$05D0=遠 |
$05E0=正 |
$05F0=奥 |
$0600-06FF#
ID=Char |
|---|
$0600=母 |
$0610=楽 |
$0620=新 |
$0630=決 |
$0640=外 |
$0650=買 |
$0660=実 |
$0670=四 |
$0680=姫 |
$0690=直 |
$06A0=兄 |
$06B0=当 |
$06C0=物 |
$06D0=殿 |
$06E0=俺 |
$06F0=経 |
$0700-0778#
ID=Char |
|---|
$0700=現 |
$0710=服 |
$0720=晶 |
$0730=避 |
$0740=鳥 |
$0750=位 |
$0760=個 |
$0770=根 |