diff options
author | YamaArashi <shadow962@live.com> | 2017-05-05 16:46:59 -0700 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2017-05-05 16:46:59 -0700 |
commit | 084dc5134cedbb7e1b2ae280ecbcb3884993a7be (patch) | |
tree | b784dda8c415b7ca25835582c14640322505c044 | |
parent | 9c41a78a1a1635ff891d7384f3a437c2bf43809e (diff) |
some German differences
-rw-r--r-- | asm/crt0.s | 88 | ||||
-rw-r--r-- | include/config.h | 12 | ||||
-rw-r--r-- | src/string_util.c | 15 | ||||
-rw-r--r-- | src/text.c | 8 |
4 files changed, 116 insertions, 7 deletions
diff --git a/asm/crt0.s b/asm/crt0.s index 7a492ff17..e1d47e2f0 100644 --- a/asm/crt0.s +++ b/asm/crt0.s @@ -30,10 +30,94 @@ GPIOPortReadEnable: @ 80000C8 .space 6 +@ 80000D0 + +@ TODO: figure out what this data is + + .ifdef GERMAN + .4byte 0xFFFFFFFF + .4byte 0xFFFFFFFF + .4byte 0xFFFFFFFF + .4byte 0xFFFFFFFF + .4byte 0xFFFFFFFF + .4byte 0xFFFFFFFF + .4byte 0xFFFFFFFF + .4byte 0xFFFFFFFF + .4byte 0xFFFFFFFF + .4byte 0xFFFFFFFF + .4byte 0xFFFFFFFF + .4byte 0xFFFFFFFF + .4byte 2 + .4byte 5 + .4byte 0x656B6F70 + .4byte 0x206E6F6D + .4byte 0x79627572 + .4byte 0x72657620 + .4byte 0x6E6F6973 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0x81F52D0 + .4byte 0x81F6770 + .4byte 0x81F7530 + .4byte 0x81F82F0 + .4byte 0x83C7C30 + .4byte 0x83C8310 + .4byte 0x83C84C8 + .4byte 0x82040E8 + .4byte 0x820529C + .4byte 0x83F7BF0 + .4byte 0x1220 + .4byte 0x1340 + .4byte 0x18 + .4byte 0x938 + .4byte 0x3A8C + .4byte 0x46 + .4byte 0x836 + .4byte 0x84C + .4byte 0x182 + .4byte 0xA0A0A07 + .4byte 0xC060C0C + .4byte 0xC121006 + .4byte 0x8010B0F + .4byte 0xC + .4byte 0x890 + .4byte 0x3AC0 + .4byte 0x234 + .4byte 0x238 + .4byte 9 + .4byte 0xA + .4byte 0 + .4byte 8 + .4byte 0x556 + .4byte 0x557 + .4byte 0x312F + .4byte 0x311B + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0 + .4byte 0xFFFFFFFF + .endif + .arm .align 2, 0 .global Init -Init: @ 80000D0 +Init: mov r0, PSR_IRQ_MODE msr cpsr_cf, r0 ldr sp, sp_irq @@ -55,7 +139,7 @@ sp_irq: .word IWRAM_END - 0x60 .arm .align 2, 0 .global IntrMain -IntrMain: @ 800010C +IntrMain: mov r3, REG_BASE add r3, r3, 0x200 ldr r2, [r3, OFFSET_REG_IE - 0x200] diff --git a/include/config.h b/include/config.h index 5ee062006..4afee1e49 100644 --- a/include/config.h +++ b/include/config.h @@ -5,19 +5,23 @@ #define REVISION 0 #endif -#if REVISION == 2 +#if (ENGLISH && REVISION == 2) || (GERMAN && REVISION == 1) #define BUGFIX_BERRY #endif -#if REVISION >= 1 +#if (ENGLISH && REVISION >= 1) || GERMAN #define BUGFIX_GLYPHWIDTH #define BUGFIX_SAVEFAILEDSCREEN1 #endif -// #define BUGFIX_SAVEFAILEDSCREEN2 +#if GERMAN +#define BUGFIX_SAVEFAILEDSCREEN2 +#endif // European editions of Ruby/Sapphire and all editions of Emerald have this fix. -// #define BUGFIX_TRAINERAPPROACH +#if GERMAN +#define BUGFIX_TRAINERAPPROACH +#endif // Fixed in Emerald. // #define BUGFIX_SETMONIVS diff --git a/src/string_util.c b/src/string_util.c index e537cff3a..957d70153 100644 --- a/src/string_util.c +++ b/src/string_util.c @@ -137,6 +137,21 @@ u16 StringLength(const u8 *str) return length; } +#ifdef GERMAN +s32 StringLengthN(const u8 *str, s32 n) +{ + s32 i; + + for (i = 0; i < n && str[i] != EOS; i++) + ; + + if (i == n) + i = 0; + + return i; +} +#endif + s32 StringCompare(const u8 *str1, const u8 *str2) { while (*str1 == *str2) diff --git a/src/text.c b/src/text.c index cc3dab547..05f327adf 100644 --- a/src/text.c +++ b/src/text.c @@ -2474,12 +2474,18 @@ static u8 UpdateWindowText(struct Window *win) return 0; } +#if defined(ENGLISH) +#define SUB_800374C_LINE_LENGTH 26 +#elif defined(GERMAN) +#define SUB_800374C_LINE_LENGTH 27 +#endif + u8 sub_800374C(struct Window *win) { u8 retVal; sWaitType = 1; - sLineLength = 26; + sLineLength = SUB_800374C_LINE_LENGTH; retVal = UpdateWindowText(win); sLineLength = 26; sWaitType = 0; |