From 7f63cdfe25fad0761aec347b1260ec3c1d63f109 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 6 May 2019 18:31:13 -0400 Subject: Decompile two seagallop-related functions stuck in unk_8147500 --- src/seagallop.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src') diff --git a/src/seagallop.c b/src/seagallop.c index 39fb2b6df..e02b0887b 100644 --- a/src/seagallop.c +++ b/src/seagallop.c @@ -458,3 +458,42 @@ static bool8 GetDirectionOfTravel(void) } return (sTravelDirectionMatrix[gSpecialVar_0x8004] >> gSpecialVar_0x8006) & 1; } + +u8 sub_8147500(void) +{ + u16 originId, destId; + + originId = gSpecialVar_0x8004; + destId = gSpecialVar_0x8006; + + if (originId == SEAGALLOP_CINNABAR_ISLAND || destId == SEAGALLOP_CINNABAR_ISLAND) + return 1; + + if (originId == SEAGALLOP_VERMILION_CITY || destId == SEAGALLOP_VERMILION_CITY) + return 7; + + if (originId == SEAGALLOP_NAVEL_ROCK || destId == SEAGALLOP_NAVEL_ROCK) + return 10; + + if (originId == SEAGALLOP_BIRTH_ISLAND || destId == SEAGALLOP_BIRTH_ISLAND) + return 12; + + if ((originId == SEAGALLOP_ONE_ISLAND || originId == SEAGALLOP_TWO_ISLAND || originId == SEAGALLOP_THREE_ISLAND) && (destId == SEAGALLOP_ONE_ISLAND || destId == SEAGALLOP_TWO_ISLAND || destId == SEAGALLOP_THREE_ISLAND)) + return 2; + + if ((originId == SEAGALLOP_FOUR_ISLAND || originId == SEAGALLOP_FIVE_ISLAND) && (destId == SEAGALLOP_FOUR_ISLAND || destId == SEAGALLOP_FIVE_ISLAND)) + return 3; + + if ((originId == SEAGALLOP_SIX_ISLAND || originId == SEAGALLOP_SEVEN_ISLAND) && (destId == SEAGALLOP_SIX_ISLAND || destId == SEAGALLOP_SEVEN_ISLAND)) + return 5; + + return 6; +} + +bool8 sub_8147594(void) +{ + if (gSaveBlock1Ptr->location.mapGroup == MAP_GROUP(VERMILIONCITY) && gSaveBlock1Ptr->location.mapNum == MAP_NUM(VERMILIONCITY) && gSaveBlock1Ptr->pos.x < 24) + return TRUE; + + return FALSE; +} -- cgit v1.2.3