mirror of
https://github.com/pret/pokeruby.git
synced 2024-12-02 18:16:44 +00:00
more renaming
This commit is contained in:
parent
cdc5d1b683
commit
0c234d0929
@ -160,7 +160,7 @@ gSpecials::
|
||||
def_special SetFlagInVar
|
||||
def_special CableCarWarp
|
||||
def_special sub_8123218
|
||||
def_special sub_8053E90
|
||||
def_special Overworld_PlaySpecialMapMusic
|
||||
def_special StartWallClock
|
||||
def_special ScrSpecial_ViewWallClock
|
||||
def_special ScrSpecial_ChooseStarter
|
||||
|
@ -605,7 +605,7 @@ struct SaveBlock1 /* 0x02025734 */
|
||||
/*0x14*/ struct WarpData warp2;
|
||||
/*0x1C*/ struct WarpData lastHealLocation;
|
||||
/*0x24*/ struct WarpData warp4;
|
||||
/*0x2C*/ u16 battleMusic;
|
||||
/*0x2C*/ u16 savedMusic;
|
||||
/*0x2E*/ u8 weather;
|
||||
/*0x2F*/ u8 filler_2F;
|
||||
/*0x30*/ u8 flashLevel; // flash level on current map, 0 being normal and 4 being the darkest
|
||||
|
@ -35,10 +35,10 @@ void ResetGameStats(void);
|
||||
void IncrementGameStat(u8 index);
|
||||
u32 GetGameStat(u8 index);
|
||||
void SetGameStat(u8, u32);
|
||||
// sub_8053154
|
||||
// LoadMapObjTemplatesFromHeader
|
||||
// LoadSaveblockMapObjScripts
|
||||
void Overworld_SaveMapObjCoords(u8, s16, s16);
|
||||
void Overworld_SaveMapObjMovementType(u8, u8);
|
||||
void Overworld_SetMapObjTemplateCoords(u8, s16, s16);
|
||||
void Overworld_SetMapObjTemplateMovementType(u8, u8);
|
||||
// mapdata_load_assets_to_gpu_and_full_redraw
|
||||
// get_mapdata_header
|
||||
// ApplyCurrentWarp
|
||||
@ -81,7 +81,7 @@ void walkrun_find_lowest_active_bit_in_bitfield(void);
|
||||
u8 sub_8053B00(struct UnkPlayerStruct *playerStruct, u16 a2, u8 a3);
|
||||
u8 sub_8053B60(struct UnkPlayerStruct *playerStruct, u8, u16, u8);
|
||||
u16 cur_mapdata_block_role_at_screen_center_acc_to_sav1(void);
|
||||
bool32 Overworld_IsBikeAllowedOnCurrentMap(void);
|
||||
bool32 Overworld_IsBikingAllowed(void);
|
||||
void SetDefaultFlashLevel(void);
|
||||
void Overworld_SetFlashLevel(s32 a1);
|
||||
u8 Overworld_GetFlashLevel(void);
|
||||
@ -89,19 +89,19 @@ void sub_8053D14(u16);
|
||||
// sub_8053D30
|
||||
// sub_8053D6C
|
||||
// GetLocationMusic
|
||||
// GetCurrLocationMusic
|
||||
// warp1_target_get_music
|
||||
// call_map_music_set_to_zero
|
||||
void sub_8053E90(void);
|
||||
void sav1_set_battle_music_maybe(u16);
|
||||
void sav1_reset_battle_music_maybe(void);
|
||||
// GetCurrLocationDefaultMusic
|
||||
// GetWarpDestinationMusic
|
||||
// Overworld_ResetMapMusic
|
||||
void Overworld_PlaySpecialMapMusic(void);
|
||||
void Overworld_SetSavedMusic(u16);
|
||||
void Overworld_ClearSavedMusic(void);
|
||||
void sub_8053F0C(void);
|
||||
void sub_8053F84(void);
|
||||
void Overworld_ChangeMusicToDefault(void);
|
||||
void Overworld_ChangeMusicTo(u16);
|
||||
// GetMapMusicFadeoutSpeed
|
||||
void sub_8053FF8(void);
|
||||
bool8 sub_8054034(void);
|
||||
void sub_8054044(void);
|
||||
void Overworld_FadeOutMapMusic(void);
|
||||
// PlayAmbientCry
|
||||
void UpdateAmbientCry(s16 *, u16 *);
|
||||
void ChooseAmbientCrySpecies(void);
|
||||
|
@ -876,7 +876,7 @@ static void CB2_StartFirstBattle(void)
|
||||
|
||||
static void CB2_EndFirstBattle(void)
|
||||
{
|
||||
sav1_reset_battle_music_maybe();
|
||||
Overworld_ClearSavedMusic();
|
||||
SetMainCallback2(c2_exit_to_overworld_1_continue_scripts_restart_music);
|
||||
}
|
||||
|
||||
|
@ -937,13 +937,13 @@ void GetOnOffBike(u8 var)
|
||||
if (gPlayerAvatar.flags & (PLAYER_AVATAR_FLAG_MACH_BIKE | PLAYER_AVATAR_FLAG_ACRO_BIKE))
|
||||
{
|
||||
SetPlayerAvatarTransitionFlags(PLAYER_AVATAR_FLAG_ON_FOOT);
|
||||
sav1_reset_battle_music_maybe();
|
||||
sub_8053E90();
|
||||
Overworld_ClearSavedMusic();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
}
|
||||
else
|
||||
{
|
||||
SetPlayerAvatarTransitionFlags(var);
|
||||
sav1_set_battle_music_maybe(BGM_CYCLING);
|
||||
Overworld_SetSavedMusic(BGM_CYCLING);
|
||||
Overworld_ChangeMusicTo(BGM_CYCLING);
|
||||
}
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ static void sub_8083B6C(void);
|
||||
static void sub_8083CA4(u8 taskId);
|
||||
|
||||
extern void sub_80831F8(u8 taskId);
|
||||
extern void call_map_music_set_to_zero(void);
|
||||
extern void Overworld_ResetMapMusic(void);
|
||||
extern void sub_810FEFC(void);
|
||||
extern void sub_8047CD8(void);
|
||||
extern void sub_805559C(void);
|
||||
@ -708,7 +708,7 @@ static void sub_808382C(u8 taskId)
|
||||
|
||||
static void sub_8083958(void)
|
||||
{
|
||||
call_map_music_set_to_zero();
|
||||
Overworld_ResetMapMusic();
|
||||
LoadPlayerParty();
|
||||
SavePlayerBag();
|
||||
sub_810FEFC();
|
||||
|
26
src/coins.c
26
src/coins.c
@ -6,47 +6,47 @@
|
||||
|
||||
#define MAX_COINS 9999
|
||||
|
||||
void UpdateCoinsWindow(s32 a, u8 b, u8 c)
|
||||
void UpdateCoinsWindow(s32 coins, u8 x, u8 y)
|
||||
{
|
||||
PrintCoins(a, 4, b + 2, c + 1);
|
||||
PrintCoins(coins, 4, x + 2, y + 1);
|
||||
}
|
||||
|
||||
void ShowCoinsWindow(u32 a, u8 b, u8 c)
|
||||
void ShowCoinsWindow(u32 coins, u8 x, u8 y)
|
||||
{
|
||||
MenuDrawTextWindow(b, c, b + 9, c + 3);
|
||||
UpdateCoinsWindow(a, b, c);
|
||||
MenuDrawTextWindow(x, y, x + 9, y + 3);
|
||||
UpdateCoinsWindow(coins, x, y);
|
||||
}
|
||||
|
||||
void HideCoinsWindow(u8 a, u8 b)
|
||||
void HideCoinsWindow(u8 x, u8 y)
|
||||
{
|
||||
MenuZeroFillWindowRect(a, b, a + 9, b + 3);
|
||||
MenuZeroFillWindowRect(x, y, x + 9, y + 3);
|
||||
}
|
||||
|
||||
void PrintCoins(s32 a, u8 b, u8 c, u8 d)
|
||||
void PrintCoins(s32 coins, u8 b, u8 x, u8 y)
|
||||
{
|
||||
u8 string[16];
|
||||
u8 *ptr;
|
||||
u8 r1;
|
||||
u8 foo;
|
||||
|
||||
ConvertIntToDecimalString(string, a);
|
||||
ConvertIntToDecimalString(string, coins);
|
||||
r1 = (b * 6 + 0x21 - 8 * (b + 2));
|
||||
c = c - r1 / 8;
|
||||
x = x - r1 / 8;
|
||||
foo = r1 % 8;
|
||||
ptr = gStringVar1;
|
||||
if (foo)
|
||||
{
|
||||
ptr[0] = 0xFC;
|
||||
ptr[0] = EXT_CTRL_CODE_BEGIN;
|
||||
ptr[1] = 0x11;
|
||||
ptr[2] = 8 - (foo);
|
||||
ptr += 3;
|
||||
}
|
||||
ptr[0] = 0xFC;
|
||||
ptr[0] = EXT_CTRL_CODE_BEGIN;
|
||||
ptr[1] = 0x11;
|
||||
ptr[2] = (b - StringLength(string)) * 6;
|
||||
ptr += 3;
|
||||
StringCopy(ptr, string);
|
||||
MenuPrint(gOtherText_Coins2, c, d);
|
||||
MenuPrint(gOtherText_Coins2, x, y);
|
||||
}
|
||||
|
||||
u16 GetCoins(void)
|
||||
|
@ -667,7 +667,7 @@ static void Task_EvolutionScene(u8 taskID)
|
||||
{
|
||||
u8 text[20];
|
||||
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
gTasks[taskID].tBits |= TASK_BIT_LEARN_MOVE;
|
||||
gTasks[taskID].tLearnsFirstMove = FALSE;
|
||||
gTasks[taskID].tLearnMoveState = 0;
|
||||
@ -691,7 +691,7 @@ static void Task_EvolutionScene(u8 taskID)
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
if (!(gTasks[taskID].tBits & TASK_BIT_LEARN_MOVE))
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
if (!gTasks[taskID].tEvoWasStopped)
|
||||
CreateShedinja(gTasks[taskID].tPreEvoSpecies, mon);
|
||||
DestroyTask(taskID);
|
||||
|
@ -1223,7 +1223,7 @@ void task00_8084310(u8 taskId)
|
||||
|
||||
void mapldr_08084390(void)
|
||||
{
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
pal_fill_black();
|
||||
CreateTask(c3_080843F8, 0);
|
||||
gMapObjects[gPlayerAvatar.mapObjectId].mapobj_bit_13 = 1;
|
||||
@ -1264,7 +1264,7 @@ extern void CameraObjectReset1(void);
|
||||
|
||||
void sub_8086748(void)
|
||||
{
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
pal_fill_for_map_transition();
|
||||
ScriptContext2_Enable();
|
||||
FreezeMapObjects();
|
||||
@ -1533,7 +1533,7 @@ void sub_8086C40(void)
|
||||
|
||||
void sub_8086C94(void)
|
||||
{
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
pal_fill_for_map_transition();
|
||||
ScriptContext2_Enable();
|
||||
CreateTask(sub_8086CBC, 0);
|
||||
@ -1898,7 +1898,7 @@ extern u8 sub_80608A4(u8);
|
||||
|
||||
void mapldr_080851BC(void)
|
||||
{
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
pal_fill_for_map_transition();
|
||||
ScriptContext2_Enable();
|
||||
gFieldCallback = NULL;
|
||||
@ -2135,7 +2135,7 @@ void sub_8087A74(u8);
|
||||
|
||||
void mapldr_080859D4(void)
|
||||
{
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
pal_fill_for_map_transition();
|
||||
ScriptContext2_Enable();
|
||||
FreezeMapObjects();
|
||||
@ -2279,7 +2279,7 @@ void sub_8087E1C(u8);
|
||||
|
||||
void mapldr_08085D88(void)
|
||||
{
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
pal_fill_for_map_transition();
|
||||
ScriptContext2_Enable();
|
||||
FreezeMapObjects();
|
||||
@ -2880,7 +2880,7 @@ u8 FldEff_UseSurf(void)
|
||||
u8 taskId;
|
||||
taskId = CreateTask(sub_8088954, 0xff);
|
||||
gTasks[taskId].data[15] = gFieldEffectArguments[0];
|
||||
sav1_reset_battle_music_maybe();
|
||||
Overworld_ClearSavedMusic();
|
||||
Overworld_ChangeMusicTo(0x016d);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ void task0A_asap_script_env_2_enable_and_set_ctx_running(u8 taskID)
|
||||
void sub_8080990(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
pal_fill_black();
|
||||
CreateTask(task0A_asap_script_env_2_enable_and_set_ctx_running, 10);
|
||||
}
|
||||
@ -130,7 +130,7 @@ void task_mpl_807DD60(u8 taskId)
|
||||
void sub_8080A3C(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
palette_bg_fill_black();
|
||||
CreateTask(task_mpl_807DD60, 10);
|
||||
}
|
||||
@ -165,7 +165,7 @@ void sub_8080A5C(u8 taskId)
|
||||
void sub_8080AC4(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
palette_bg_fill_black();
|
||||
CreateTask(sub_8080A5C, 10);
|
||||
}
|
||||
@ -188,7 +188,7 @@ void sub_8080AE4(void)
|
||||
|
||||
void mapldr_default(void)
|
||||
{
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
pal_fill_for_map_transition();
|
||||
sub_8080AE4();
|
||||
ScriptContext2_Enable();
|
||||
@ -196,7 +196,7 @@ void mapldr_default(void)
|
||||
|
||||
void sub_8080B60(void)
|
||||
{
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
pal_fill_black();
|
||||
sub_8080AE4();
|
||||
ScriptContext2_Enable();
|
||||
@ -204,7 +204,7 @@ void sub_8080B60(void)
|
||||
|
||||
void sub_8080B78(void)
|
||||
{
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
pal_fill_for_map_transition();
|
||||
PlaySE(SE_TK_WARPOUT);
|
||||
CreateTask(task_map_chg_seq_0807E2CC, 10);
|
||||
@ -354,7 +354,7 @@ void sub_8080E28(void)
|
||||
void sub_8080E44(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
pal_fill_black();
|
||||
CreateTask(task_mpl_807E3C8, 10);
|
||||
}
|
||||
|
@ -2462,24 +2462,24 @@ extern void sub_8064970(struct Sprite *);
|
||||
extern void sub_8060470(s16 *, s16 *, s16, s16);
|
||||
extern void InitObjectPriorityByZCoord();
|
||||
|
||||
u8 sub_805B410(u8 a, u8 b, s16 c, s16 d, u8 e, u8 f)
|
||||
u8 sub_805B410(u8 graphicsId, u8 b, s16 x, s16 y, u8 elevation, u8 direction)
|
||||
{
|
||||
const struct MapObjectGraphicsInfo *gfxInfo;
|
||||
struct SpriteTemplate spriteTemplate;
|
||||
const struct SubspriteTable *subspriteTables;
|
||||
u8 spriteId;
|
||||
|
||||
gfxInfo = GetFieldObjectGraphicsInfo(a);
|
||||
MakeObjectTemplateFromFieldObjectGraphicsInfo(a, sub_8064970, &spriteTemplate, &subspriteTables);
|
||||
gfxInfo = GetFieldObjectGraphicsInfo(graphicsId);
|
||||
MakeObjectTemplateFromFieldObjectGraphicsInfo(graphicsId, sub_8064970, &spriteTemplate, &subspriteTables);
|
||||
#ifdef NONMATCHING
|
||||
spriteTemplate.paletteTag = 0xFFFF;
|
||||
#else
|
||||
*(u16 *)&spriteTemplate.paletteTag = 0xFFFF;
|
||||
#endif
|
||||
c += 7;
|
||||
d += 7;
|
||||
sub_8060470(&c, &d, 8, 16);
|
||||
spriteId = CreateSpriteAtEnd(&spriteTemplate, c, d, 0);
|
||||
x += 7;
|
||||
y += 7;
|
||||
sub_8060470(&x, &y, 8, 16);
|
||||
spriteId = CreateSpriteAtEnd(&spriteTemplate, x, y, 0);
|
||||
if (spriteId != 64)
|
||||
{
|
||||
struct Sprite *sprite = &gSprites[spriteId];
|
||||
@ -2490,7 +2490,7 @@ u8 sub_805B410(u8 a, u8 b, s16 c, s16 d, u8 e, u8 f)
|
||||
sprite->oam.paletteNum = gfxInfo->paletteSlot;
|
||||
sprite->coordOffsetEnabled = TRUE;
|
||||
sprite->data0 = b;
|
||||
sprite->data1 = e;
|
||||
sprite->data1 = elevation;
|
||||
if (gfxInfo->paletteSlot == 10)
|
||||
npc_load_two_palettes__and_record(gfxInfo->paletteTag1, gfxInfo->paletteSlot);
|
||||
if (subspriteTables != NULL)
|
||||
@ -2498,9 +2498,9 @@ u8 sub_805B410(u8 a, u8 b, s16 c, s16 d, u8 e, u8 f)
|
||||
SetSubspriteTables(sprite, subspriteTables);
|
||||
sprite->subspriteMode = 2;
|
||||
}
|
||||
InitObjectPriorityByZCoord(sprite, e);
|
||||
SetObjectSubpriorityByZCoord(e, sprite, 1);
|
||||
StartSpriteAnim(sprite, FieldObjectDirectionToImageAnimId(f));
|
||||
InitObjectPriorityByZCoord(sprite, elevation);
|
||||
SetObjectSubpriorityByZCoord(elevation, sprite, 1);
|
||||
StartSpriteAnim(sprite, FieldObjectDirectionToImageAnimId(direction));
|
||||
}
|
||||
return spriteId;
|
||||
}
|
||||
|
@ -1365,8 +1365,8 @@ void sub_805A20C(u8 a)
|
||||
u8 taskId;
|
||||
|
||||
ScriptContext2_Enable();
|
||||
sav1_reset_battle_music_maybe();
|
||||
sub_8053F84();
|
||||
Overworld_ClearSavedMusic();
|
||||
Overworld_ChangeMusicToDefault();
|
||||
gPlayerAvatar.flags &= ~PLAYER_AVATAR_FLAG_SURFING;
|
||||
gPlayerAvatar.flags |= PLAYER_AVATAR_FLAG_ON_FOOT;
|
||||
gPlayerAvatar.unk6 = 1;
|
||||
|
@ -327,7 +327,7 @@ static void task50_0807F0C8(u8);
|
||||
|
||||
void sub_8081924(void)
|
||||
{
|
||||
sub_8054044();
|
||||
Overworld_FadeOutMapMusic();
|
||||
CreateTask(task50_0807F0C8, 80);
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ void UpdateCyclingRoadState(void) {
|
||||
if (VarGet(0x40a9) == 2 || VarGet(0x40a9) == 3)
|
||||
{
|
||||
VarSet(0x40a9, 0);
|
||||
sav1_set_battle_music_maybe(SE_STOP);
|
||||
Overworld_SetSavedMusic(SE_STOP);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,7 @@ void ReturnFromHallOfFamePC(void)
|
||||
static void ReshowPCMenuAfterHallOfFamePC(void)
|
||||
{
|
||||
ScriptContext2_Enable();
|
||||
sub_8053E90();
|
||||
Overworld_PlaySpecialMapMusic();
|
||||
BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0);
|
||||
ScrSpecial_CreatePCMenu();
|
||||
ScriptMenu_DisplayPCStartupPrompt();
|
||||
|
@ -187,7 +187,7 @@ void ItemUseOutOfBattle_Bike(u8 taskId)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Overworld_IsBikeAllowedOnCurrentMap() == TRUE && IsBikingDisallowedByPlayer() == FALSE)
|
||||
if (Overworld_IsBikingAllowed() == TRUE && IsBikingDisallowedByPlayer() == FALSE)
|
||||
{
|
||||
gFieldItemUseCallback = (void *)ItemUseOnFieldCB_Bike;
|
||||
SetUpItemUseOnFieldCallback(taskId);
|
||||
|
@ -283,9 +283,12 @@ void SetGameStat(u8 index, u32 value)
|
||||
gSaveBlock1.gameStats[index] = value;
|
||||
}
|
||||
|
||||
void sub_8053154(void)
|
||||
void LoadMapObjTemplatesFromHeader(void)
|
||||
{
|
||||
// Clear map object templates
|
||||
CpuFill32(0, gSaveBlock1.mapObjectTemplates, sizeof(gSaveBlock1.mapObjectTemplates));
|
||||
|
||||
// Copy map header events to save block
|
||||
CpuCopy32(gMapHeader.events->mapObjects,
|
||||
gSaveBlock1.mapObjectTemplates,
|
||||
gMapHeader.events->mapObjectCount * sizeof(struct MapObjectTemplate));
|
||||
@ -300,7 +303,7 @@ static void LoadSaveblockMapObjScripts(void)
|
||||
mapObjectTemplates[i].script = gMapHeader.events->mapObjects[i].script;
|
||||
}
|
||||
|
||||
void Overworld_SaveMapObjCoords(u8 localId, s16 x, s16 y)
|
||||
void Overworld_SetMapObjTemplateCoords(u8 localId, s16 x, s16 y)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; i < 64; i++)
|
||||
@ -315,7 +318,7 @@ void Overworld_SaveMapObjCoords(u8 localId, s16 x, s16 y)
|
||||
}
|
||||
}
|
||||
|
||||
void Overworld_SaveMapObjMovementType(u8 localId, u8 movementType)
|
||||
void Overworld_SetMapObjTemplateMovementType(u8 localId, u8 movementType)
|
||||
{
|
||||
s32 i;
|
||||
|
||||
@ -476,9 +479,9 @@ void Overworld_SetHealLocationWarp(u8 healLocationId)
|
||||
|
||||
void sub_80535C4(s16 a1, s16 a2)
|
||||
{
|
||||
u8 v4 = Overworld_GetMapTypeOfSaveblockLocation();
|
||||
u8 v5 = GetMapTypeByGroupAndId(gWarpDestination.mapGroup, gWarpDestination.mapNum);
|
||||
if (is_map_type_1_2_3_5_or_6(v4) && is_map_type_1_2_3_5_or_6(v5) != TRUE)
|
||||
u8 currMapType = Overworld_GetMapTypeOfSaveblockLocation();
|
||||
u8 destMapType = GetMapTypeByGroupAndId(gWarpDestination.mapGroup, gWarpDestination.mapNum);
|
||||
if (is_map_type_1_2_3_5_or_6(currMapType) && is_map_type_1_2_3_5_or_6(destMapType) != TRUE)
|
||||
sub_805363C(gSaveBlock1.location.mapGroup, gSaveBlock1.location.mapNum, -1, a1 - 7, a2 - 6);
|
||||
}
|
||||
|
||||
@ -593,7 +596,7 @@ void sub_80538F0(u8 mapGroup, u8 mapNum)
|
||||
sub_8053F0C();
|
||||
ApplyCurrentWarp();
|
||||
set_current_map_header_from_sav1_save_old_name();
|
||||
sub_8053154();
|
||||
LoadMapObjTemplatesFromHeader();
|
||||
ClearTempFieldEventData();
|
||||
ResetCyclingRoadChallengeData();
|
||||
prev_quest_postbuffer_cursor_backup_reset();
|
||||
@ -602,7 +605,7 @@ void sub_80538F0(u8 mapGroup, u8 mapNum)
|
||||
sub_80806E4();
|
||||
ChooseAmbientCrySpecies();
|
||||
SetDefaultFlashLevel();
|
||||
sav1_reset_battle_music_maybe();
|
||||
Overworld_ClearSavedMusic();
|
||||
mapheader_run_script_with_tag_x3();
|
||||
not_trainer_hill_battle_pyramid();
|
||||
sub_8056D38(gMapHeader.mapData);
|
||||
@ -626,7 +629,7 @@ void sub_8053994(u32 a1)
|
||||
bool8 v3;
|
||||
|
||||
set_current_map_header_from_sav1_save_old_name();
|
||||
sub_8053154();
|
||||
LoadMapObjTemplatesFromHeader();
|
||||
v2 = is_map_type_1_2_3_5_or_6(gMapHeader.mapType);
|
||||
v3 = Overworld_MapTypeIsIndoors(gMapHeader.mapType);
|
||||
ClearTempFieldEventData();
|
||||
@ -640,7 +643,7 @@ void sub_8053994(u32 a1)
|
||||
if (v2)
|
||||
FlagClear(SYS_USE_FLASH);
|
||||
SetDefaultFlashLevel();
|
||||
sav1_reset_battle_music_maybe();
|
||||
Overworld_ClearSavedMusic();
|
||||
mapheader_run_script_with_tag_x3();
|
||||
UpdateLocationHistoryForRoamer();
|
||||
RoamerMoveToOtherLocationSet();
|
||||
@ -694,7 +697,7 @@ u8 sub_8053B00(struct UnkPlayerStruct *playerStruct, u16 a2, u8 a3)
|
||||
return 16;
|
||||
if (MetatileBehavior_IsSurfableWaterOrUnderwater(a2) == 1)
|
||||
return 8;
|
||||
if (Overworld_IsBikeAllowedOnCurrentMap() != TRUE)
|
||||
if (Overworld_IsBikingAllowed() != TRUE)
|
||||
return 1;
|
||||
if (playerStruct->player_field_0 == 2)
|
||||
return 2;
|
||||
@ -732,7 +735,7 @@ u16 cur_mapdata_block_role_at_screen_center_acc_to_sav1(void)
|
||||
return MapGridGetMetatileBehaviorAt(gSaveBlock1.pos.x + 7, gSaveBlock1.pos.y + 7);
|
||||
}
|
||||
|
||||
bool32 Overworld_IsBikeAllowedOnCurrentMap(void)
|
||||
bool32 Overworld_IsBikingAllowed(void)
|
||||
{
|
||||
// is player in cycling road entrance?
|
||||
if (gSaveBlock1.location.mapGroup == MAP_GROUP_ROUTE110_SEASIDE_CYCLING_ROAD_SOUTH_ENTRANCE
|
||||
@ -833,10 +836,11 @@ static u16 GetLocationMusic(struct WarpData *warp)
|
||||
return Overworld_GetMapHeaderByGroupAndId(warp->mapGroup, warp->mapNum)->music;
|
||||
}
|
||||
|
||||
u16 GetCurrLocationMusic(void)
|
||||
u16 GetCurrLocationDefaultMusic(void)
|
||||
{
|
||||
u16 music;
|
||||
|
||||
// Play the desert music only when the sandstorm is active on Route 111.
|
||||
if (gSaveBlock1.location.mapGroup == MAP_GROUP_ROUTE111
|
||||
&& gSaveBlock1.location.mapNum == MAP_ID_ROUTE111
|
||||
&& GetSav1Weather() == 8)
|
||||
@ -856,7 +860,7 @@ u16 GetCurrLocationMusic(void)
|
||||
}
|
||||
}
|
||||
|
||||
u16 warp1_target_get_music(void)
|
||||
u16 GetWarpDestinationMusic(void)
|
||||
{
|
||||
u16 music = GetLocationMusic(&gWarpDestination);
|
||||
if (music != 0x7FFF)
|
||||
@ -873,19 +877,19 @@ u16 warp1_target_get_music(void)
|
||||
}
|
||||
}
|
||||
|
||||
void call_map_music_set_to_zero(void)
|
||||
void Overworld_ResetMapMusic(void)
|
||||
{
|
||||
ResetMapMusic();
|
||||
}
|
||||
|
||||
void sub_8053E90(void)
|
||||
void Overworld_PlaySpecialMapMusic(void)
|
||||
{
|
||||
u16 music = GetCurrLocationMusic();
|
||||
u16 music = GetCurrLocationDefaultMusic();
|
||||
|
||||
if (music != LEGENDARY_MUSIC)
|
||||
{
|
||||
if (gSaveBlock1.battleMusic)
|
||||
music = gSaveBlock1.battleMusic;
|
||||
if (gSaveBlock1.savedMusic)
|
||||
music = gSaveBlock1.savedMusic;
|
||||
else if (Overworld_GetMapTypeOfSaveblockLocation() == MAP_TYPE_UNDERWATER)
|
||||
music = BGM_DEEPDEEP;
|
||||
else if (TestPlayerAvatarFlags(PLAYER_AVATAR_FLAG_SURFING))
|
||||
@ -896,21 +900,21 @@ void sub_8053E90(void)
|
||||
PlayNewMapMusic(music);
|
||||
}
|
||||
|
||||
void sav1_set_battle_music_maybe(u16 songNum)
|
||||
void Overworld_SetSavedMusic(u16 songNum)
|
||||
{
|
||||
gSaveBlock1.battleMusic = songNum;
|
||||
gSaveBlock1.savedMusic = songNum;
|
||||
}
|
||||
|
||||
void sav1_reset_battle_music_maybe(void)
|
||||
void Overworld_ClearSavedMusic(void)
|
||||
{
|
||||
gSaveBlock1.battleMusic = 0;
|
||||
gSaveBlock1.savedMusic = 0;
|
||||
}
|
||||
|
||||
void sub_8053F0C(void)
|
||||
{
|
||||
if (FlagGet(SPECIAL_FLAG_1) != TRUE)
|
||||
{
|
||||
u16 newMusic = warp1_target_get_music();
|
||||
u16 newMusic = GetWarpDestinationMusic();
|
||||
u16 currentMusic = GetCurrentMapMusic();
|
||||
if (newMusic != LEGENDARY_MUSIC)
|
||||
{
|
||||
@ -929,11 +933,11 @@ void sub_8053F0C(void)
|
||||
}
|
||||
}
|
||||
|
||||
void sub_8053F84(void)
|
||||
void Overworld_ChangeMusicToDefault(void)
|
||||
{
|
||||
u16 currentMusic = GetCurrentMapMusic();
|
||||
if (currentMusic != GetCurrLocationMusic())
|
||||
FadeOutAndPlayNewMapMusic(GetCurrLocationMusic(), 8);
|
||||
if (currentMusic != GetCurrLocationDefaultMusic())
|
||||
FadeOutAndPlayNewMapMusic(GetCurrLocationDefaultMusic(), 8);
|
||||
}
|
||||
|
||||
void Overworld_ChangeMusicTo(u16 newMusic)
|
||||
@ -954,7 +958,7 @@ u8 GetMapMusicFadeoutSpeed(void)
|
||||
|
||||
void sub_8053FF8(void)
|
||||
{
|
||||
u16 music = warp1_target_get_music();
|
||||
u16 music = GetWarpDestinationMusic();
|
||||
if (FlagGet(SPECIAL_FLAG_1) != TRUE && music != GetCurrentMapMusic())
|
||||
{
|
||||
u8 speed = GetMapMusicFadeoutSpeed();
|
||||
@ -967,7 +971,7 @@ bool8 sub_8054034(void)
|
||||
return IsNotWaitingForBGMStop();
|
||||
}
|
||||
|
||||
void sub_8054044(void)
|
||||
void Overworld_FadeOutMapMusic(void)
|
||||
{
|
||||
FadeOutMapMusic(4);
|
||||
}
|
||||
@ -975,14 +979,16 @@ void sub_8054044(void)
|
||||
static void PlayAmbientCry(void)
|
||||
{
|
||||
s16 x, y;
|
||||
s8 pan;
|
||||
s8 volume;
|
||||
|
||||
PlayerGetDestCoords(&x, &y);
|
||||
if (sIsAmbientCryWaterMon != TRUE
|
||||
|| MetatileBehavior_IsSurfableWaterOrUnderwater(MapGridGetMetatileBehaviorAt(x, y)))
|
||||
{
|
||||
s8 pan = (Random() % 88) + 212;
|
||||
s8 volume = (Random() % 30) + 50;
|
||||
PlayCry2(sAmbientCrySpecies, pan, volume, 1);
|
||||
}
|
||||
if (sIsAmbientCryWaterMon == TRUE
|
||||
&& !MetatileBehavior_IsSurfableWaterOrUnderwater(MapGridGetMetatileBehaviorAt(x, y)))
|
||||
return;
|
||||
pan = (Random() % 88) + 212;
|
||||
volume = (Random() % 30) + 50;
|
||||
PlayCry2(sAmbientCrySpecies, pan, volume, 1);
|
||||
}
|
||||
|
||||
void UpdateAmbientCry(s16 *state, u16 *delayCounter)
|
||||
@ -1152,6 +1158,7 @@ void OverworldBasic(void)
|
||||
sub_8072EDC();
|
||||
}
|
||||
|
||||
// This CB2 is used when starting
|
||||
void CB2_OverworldBasic(void)
|
||||
{
|
||||
OverworldBasic();
|
||||
@ -1179,7 +1186,7 @@ void sub_80543DC(u16 (*a1)(u32))
|
||||
|
||||
void sub_80543E8(void)
|
||||
{
|
||||
if (gFieldCallback)
|
||||
if (gFieldCallback != NULL)
|
||||
gFieldCallback();
|
||||
else
|
||||
mapldr_default();
|
||||
@ -1980,27 +1987,27 @@ void sub_8055280(u16 a1)
|
||||
|
||||
u16 sub_80552B0(u32 a1)
|
||||
{
|
||||
if (gMain.heldKeys & 0x40)
|
||||
if (gMain.heldKeys & DPAD_UP)
|
||||
{
|
||||
return 19;
|
||||
}
|
||||
else if (gMain.heldKeys & 0x80)
|
||||
else if (gMain.heldKeys & DPAD_DOWN)
|
||||
{
|
||||
return 18;
|
||||
}
|
||||
else if (gMain.heldKeys & 0x20)
|
||||
else if (gMain.heldKeys & DPAD_LEFT)
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
else if (gMain.heldKeys & 0x10)
|
||||
else if (gMain.heldKeys & DPAD_RIGHT)
|
||||
{
|
||||
return 21;
|
||||
}
|
||||
else if (gMain.newKeys & 8)
|
||||
else if (gMain.newKeys & START_BUTTON)
|
||||
{
|
||||
return 24;
|
||||
}
|
||||
else if (gMain.newKeys & 1)
|
||||
else if (gMain.newKeys & A_BUTTON)
|
||||
{
|
||||
return 25;
|
||||
}
|
||||
|
250
src/scrcmd.c
250
src/scrcmd.c
File diff suppressed because it is too large
Load Diff
@ -81,8 +81,6 @@ void MapMusicMain(void)
|
||||
PlayBGM(sCurrentMapMusic);
|
||||
break;
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
break;
|
||||
case 5:
|
||||
if (IsBGMStopped())
|
||||
|
Loading…
Reference in New Issue
Block a user