From ec2abbf46a9037eac81a152bae408d026648561d Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Tue, 9 May 2017 20:10:33 +0200 Subject: Decompile sub_8098898 --- src/pokemon_storage_system.c | 93 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 src/pokemon_storage_system.c (limited to 'src/pokemon_storage_system.c') diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c new file mode 100644 index 000000000..679ec0bc4 --- /dev/null +++ b/src/pokemon_storage_system.c @@ -0,0 +1,93 @@ +#include "global.h" +#include "menu.h" +#include "string_util.h" + +struct StorageAction { + u8 *text; + u8 format; +}; + +extern const struct StorageAction gUnknown_083B6DF4[]; + +extern const u8 unk_2000000[]; + +#define gUnk2002694 (u8 *)(&unk_2000000[0x2694]) +#define gUnk20026A6 (u8 *)(&unk_2000000[0x26a6]) +#define gUnk20011fa (u8 *)(&unk_2000000[0x11fa]) +#define gUnk20026e4 (u8 *)(&unk_2000000[0x26e4]) + +void sub_8098898(u8 index) { + u8 *ptr; + + MenuDrawTextWindow(10, 16, 29, 19); + + switch (gUnknown_083B6DF4[index].format) + { + + case 2: + ptr = StringCopy(gUnk2002694, gUnknown_083B6DF4[index].text); + ptr = StringCopy(ptr, gUnk20011fa); + break; + + case 5: + ptr = StringCopy(gUnk2002694, gUnknown_083B6DF4[index].text); + ptr = StringCopy(ptr, gUnk20026e4); + break; + + case 1: + // {var} + " is selected." + ptr = StringCopy(gUnk2002694, gUnk20011fa); + ptr = StringCopy(ptr, gUnknown_083B6DF4[index].text); + break; + + case 4: + // TODO: fix for German + // {var} + " was released." + ptr = StringCopy(gUnk2002694, gUnk20026e4); + ptr = StringCopy(ptr, gUnknown_083B6DF4[index].text); + break; + + case 3: + { + u8 *stringLength; + u8 *text; + + text = gUnknown_083B6DF4[index].text; + stringLength = &text[StringLength(text)] + 1; + + ptr = StringCopy(gUnk2002694, gUnknown_083B6DF4[index].text); + ptr = StringCopy(ptr, gUnk20011fa); + ptr = StringCopy(ptr, stringLength); + } + break; + + case 6: + // "Bye-bye, ".substr(0, -1) + {var} + "Bye-bye, !".substr(-1, 1) + { + u8 *stringLength; + u8 *text; + + text = gUnknown_083B6DF4[index].text; + stringLength = &text[StringLength(text)] - 1; + + ptr = StringCopy(gUnk2002694, gUnknown_083B6DF4[index].text); + ptr = StringCopy(ptr - 1, gUnk20026e4); + ptr = StringCopy(ptr, stringLength); + } + break; + + case 0: + default: + ptr = StringCopy(gUnk2002694, gUnknown_083B6DF4[index].text); + break; + } + + while (ptr < gUnk20026A6) + { + ptr[0] = CHAR_SPACE; + ptr++; + } + + ptr[0] = EOS; + MenuPrint(gUnk2002694, 11, 17); +} -- cgit v1.2.3 From 4d2b22a899c11dfcacfec6889968ab01655a3fe3 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Fri, 26 May 2017 14:53:51 +0200 Subject: Add headers --- src/pokemon_storage_system.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/pokemon_storage_system.c') diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 679ec0bc4..fb837f1f6 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1,4 +1,5 @@ #include "global.h" +#include "pokemon_storage_system.h" #include "menu.h" #include "string_util.h" -- cgit v1.2.3 From ec3fe21936b250b329e58941a47e11afb9b240e0 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sat, 24 Jun 2017 18:06:32 +0200 Subject: first src changes --- src/pokemon_storage_system.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/pokemon_storage_system.c') diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index fb837f1f6..0cab07fc1 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -42,10 +42,13 @@ void sub_8098898(u8 index) { break; case 4: - // TODO: fix for German // {var} + " was released." ptr = StringCopy(gUnk2002694, gUnk20026e4); +#if ENGLISH ptr = StringCopy(ptr, gUnknown_083B6DF4[index].text); +#elif GERMAN + ptr = de_sub_8073174(gUnk2002694, gUnknown_083B6DF4[index].text); +#endif break; case 3: -- cgit v1.2.3