Now that you learned how to simplify/optimize your code let us take a look at two at them (optimized!).
Yu Narukami
03ac1dfc 03E703E7
03ac1e00 00630063
03ac1e04 00630063
23ac1e08 00000063
Yosuke Hanamura
03ac1f34 03e703e7
03ac1f38 00630063
03ac1f3C 00630063
03ac1f40 00000063
If you notice, the addresses obey the same order with a fun fact:
-IF YOU SUBTRACT THE ADDRESS OF THE HIGHEST FOR LOWEST YOU ALWAYS GET THE SAME NUMBER!-
Like this:
First address of Yu Narukami is 03ac1dfc
And
First address of Yosuke Hanamura is 03ac1f34
03ac1f34 > 03ac1dfc
SO the addresses are like this: Yosuke Hanamura > Yu Narukami
Now let’s subtract the first with the first, the second with the second and so on:
Yu Narukami
03ac1dfc 03E703E7
03ac1e00 00630063
03ac1e04 00630063
23ac1e08 00000063
Yosuke Hanamura
03ac1f34 03e703e7
03ac1f38 00630063
03ac1f3C 00630063
23ac1f40 00000063
We have this:
03ac1f34 -03ac1dfc = 00000138
03ac1f38 -03ac1ee0 = 00000138
03ac1f3C -03ac1ee4 = 00000138
23ac1f40 -23ac1ee8 = 00000138
So it’s always 00000138! (IN HEX ALREADY!)
Which means that every character has their code equal to the previous + 00000138!
So what?!
So now we know that: Yu Narukami’s codes + 00000138 = Yosuke Hanamura’s codes
And so on… Yosuke Hanamura’s codes + 00000138 = Chie Satonaka codes… all the way up to the last character.
Okay… now what?
Now we can use a neat trick with AR code that: writes all the codes, then repeat all of them with an increased value!
Take a breath and read the last line again!
This AR code trick allows us to: write all the codes, then repeat all of them with an increased value!
So we can tell the game to do Yu Narukami’s codes, then add a value (00000138) to the next repetition.
And we also know that Yu Narukami’s codes + 00000138 = Yosuke Hanamura’s codes… and so on until the game writes all the characters codes. NEAT HUH?!
And how do we do that?!
Let’s go…
The trick has 03 different code lines that I’ll explain:
---First line of the trick: C0000000 XXXXXXXX
C0000000 XXXXXXXX – will tell the game to repeat the next lines XXXXXXXX times.
So C0000000 00000005 will tell the game to repeat the next lines 05 times!
---Second line of the trick: DC000000 XXXXXXXX
DC000000 XXXXXXXX – will tell the game to INCREASE the previous addresses lines (that starts with “0” or “1” or “2” with XXXXXXXX.
So DC000000 00000004 will tell the game to INCREASE the previous lines with 04!
EG.
03ac1f38 00630063
DC000000 00000004
Will tell the game to add 04 in the previous line(s).
So it will tell the game to add 04 to 03ac1f38 which will result in the line 03ac1f3C.
---Third line of the trick: D1000000 00000000 (or D2000000 0000000)
D1000000 00000000 will tell that: THAT PART OF THE CODE HAS ENDED!
(Let’s leave D2000000 00000000 for another time)
This line is useful because we need to tell the game when to stop writing otherwise we screw up the game!
-----Now let’s assemble our code-----
We need to tell the game what we want to write, how many times, and with how much increase each write.
However, let us first review what we learned so far…
C0000000 XXXXXXXX – will tell the game to repeat the next lines XXXXXXXX times.
DC000000 XXXXXXXX – will tell the game to INCREASE the previous addresses.
D1000000 00000000 will tell that THAT PART OF THE CODE HAS ENDED!
So we have a code that needs what we want AFTER it, then another code that needs what we want BEFORE it, and a code to end it…
So here’s how our code should go
C0000000 XXXXXXXX
--THE ACTUAL CODE--
DC000000 XXXXXXXX
D1000000 00000000
So let’s start:
C0000000 XXXXXXXX – How many times the codes needs to go?
The same as the number of characters which are 20 characters, but we don’t want 20 REPETITIONS, we want ONE CODE(or ONE SET OF CODES) AND 19 REPETITIONS! (but remember to use the number in HEX so 19 is 13 in HEX
So we have
C0000000 00000013
OK… now we add the code (this case A SET OF CODES), this case we want the first of the list which in our case is Yu Narukami set of codes
So now we have
C0000000 00000013
03ac1dfc 03E703E7
03ac1e00 00630063
03ac1e04 00630063
23ac1e08 00000063
Next up we want to tell the game how much it adds to the addresses before repeating, which we got 00000138 SOooooo…
C0000000 00000013
03ac1dfc 03E703E7
03ac1e00 00630063
03ac1e04 00630063
23ac1e08 00000063
DC000000 00000138
And to wrap it up we want to tell the game to stop writing after the block of codes and repetitions ends… so to end this all
C0000000 00000013
03ac1dfc 03E703E7
03ac1e00 00630063
03ac1e04 00630063
23ac1e08 00000063
DC000000 00000138
D1000000 00000000
PHEW… that’s it… we got all those characters codes trough an huge optimization and we got this:
All Characters
C0000000 00000013
03ac1dfc 03E703E7
03ac1e00 00630063
03ac1e04 00630063
23ac1e08 00000063
DC000000 00000138
D1000000 00000000