diff options
author | scnorton <scnorton@biociphers.org> | 2017-06-20 09:55:43 -0400 |
---|---|---|
committer | scnorton <scnorton@biociphers.org> | 2017-06-20 09:55:43 -0400 |
commit | 6c419f362a02a95d9b54638c222b093b22787f71 (patch) | |
tree | 104c89ccc4c212813d4ac47e78740291bc79e150 | |
parent | 9e5917e65692dd9f9db99f97966d8dfb3245ab6f (diff) |
Three more small functions in field_specials.s
-rwxr-xr-x | asm/field_specials.s | 45 | ||||
-rw-r--r-- | include/field_specials.h | 1 | ||||
-rwxr-xr-x | src/field_specials.c | 17 |
3 files changed, 18 insertions, 45 deletions
diff --git a/asm/field_specials.s b/asm/field_specials.s index c69c2a98b..c915508a9 100755 --- a/asm/field_specials.s +++ b/asm/field_specials.s @@ -6,51 +6,6 @@ .text - thumb_func_start ShowFieldMessageStringVar4 -ShowFieldMessageStringVar4: @ 810E24C - push {lr} - ldr r0, _0810E258 @ =gStringVar4 - bl ShowFieldMessage - pop {r0} - bx r0 - .align 2, 0 -_0810E258: .4byte gStringVar4 - thumb_func_end ShowFieldMessageStringVar4 - - thumb_func_start StorePlayerCoordsInVars -StorePlayerCoordsInVars: @ 810E25C - ldr r1, _0810E26C @ =gSpecialVar_0x8004 - ldr r2, _0810E270 @ =gSaveBlock1 - ldrh r0, [r2] - strh r0, [r1] - ldr r1, _0810E274 @ =gSpecialVar_0x8005 - ldrh r0, [r2, 0x2] - strh r0, [r1] - bx lr - .align 2, 0 -_0810E26C: .4byte gSpecialVar_0x8004 -_0810E270: .4byte gSaveBlock1 -_0810E274: .4byte gSpecialVar_0x8005 - thumb_func_end StorePlayerCoordsInVars - - thumb_func_start GetPlayerTrainerIdOnesDigit -GetPlayerTrainerIdOnesDigit: @ 810E278 - push {lr} - ldr r0, _0810E294 @ =gSaveBlock2 - ldrb r1, [r0, 0xB] - lsls r1, 8 - ldrb r0, [r0, 0xA] - orrs r0, r1 - movs r1, 0xA - bl __umodsi3 - lsls r0, 24 - lsrs r0, 24 - pop {r1} - bx r1 - .align 2, 0 -_0810E294: .4byte gSaveBlock2 - thumb_func_end GetPlayerTrainerIdOnesDigit - thumb_func_start GetPlayerBigGuyGirlString GetPlayerBigGuyGirlString: @ 810E298 push {lr} diff --git a/include/field_specials.h b/include/field_specials.h index dcade37a7..a71207656 100644 --- a/include/field_specials.h +++ b/include/field_specials.h @@ -8,6 +8,7 @@ extern u8 gUnknown_02039250; extern u8 gUnknown_02039251; extern u32 gUnknown_02039254; extern u16 gSpecialVar_0x8004; +extern u16 gSpecialVar_0x8005; extern u8 gUnknown_02039258; extern u8 gUnknown_02039259; diff --git a/src/field_specials.c b/src/field_specials.c index 03faa80a3..d881deed5 100755 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -4,6 +4,7 @@ #include "fieldmap.h" #include "event_data.h" #include "field_map_obj.h" +#include "field_message_box.h" #include "field_camera.h" #include "field_player_avatar.h" #include "main.h" @@ -626,3 +627,19 @@ void PetalburgGymSpecial2(void) { PetalburgGymFunc(gSpecialVar_0x8004, gUnknown_083F8376[4]); } + +void ShowFieldMessageStringVar4(void) +{ + ShowFieldMessage(gStringVar4); +} + +void StorePlayerCoordsInVars(void) +{ + gSpecialVar_0x8004 = gSaveBlock1.pos.x; + gSpecialVar_0x8005 = gSaveBlock1.pos.y; +} + +u8 GetPlayerTrainerIdOnesDigit(void) +{ + return (u16)((gSaveBlock2.playerTrainerId[1] << 8) | gSaveBlock2.playerTrainerId[0]) % 10; +} |