extern void F0742_MUSIC_SetTrack(
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int P2947_i_MapIndex
#endif
);

#ifdef MEDIA042_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
void F0003_MAIN_ProcessNewPartyMap_CPSE(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0000_i_MapIndex)
#endif
int16_t P0000_i_MapIndex FINAL_SEPARATOR
{
#ifdef MEDIA067_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_P20JA_P20JB_A31E_A31M_A33M_A35E_A35M_X31J
#ifndef NOCOPYPROTECTION
        EVENT L0000_s_Event_CPSE;
#endif
#endif


#ifdef MEDIA505_F20E_F20J_P20JB_I34E_I34M_F31E_F31J_P31J
        F0742_MUSIC_SetTrack(P0000_i_MapIndex);
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        if (!G2136_B_EvaluatingMemoryRequirements) {
#endif
#ifdef MEDIA128_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G20E_G21E_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0194_GROUP_RemoveAllActiveGroups(); /* BUG0_63 The behavior of groups and the directions of individual creatures in groups are not restored when a saved game is loaded. Each group on the same map as the party has additional data that other groups do not have. This additional data is stored as part of saved games and loaded when the game is restarted. However, after loading a saved game the function to initialize this data is called. This overwrites the data and thus the state of groups when the game was saved is ignored */
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        }
#endif
        F0174_DUNGEON_SetCurrentMapAndPartyMap(P0000_i_MapIndex);
        F0096_DUNGEONVIEW_LoadCurrentMapGraphics_CPSDF();
#ifdef MEDIA067_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_P20JA_P20JB_A31E_A31M_A33M_A35E_A35M_X31J
#ifndef NOCOPYPROTECTION
#ifdef MEDIA065_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_P20JA_P20JB_A31E_A31M_A33M_X31J
        if ((G0313_ul_GameTime - G0418_l_LastEvent22Time_CPSE) > 500) {
#endif
#ifdef MEDIA741_A35E_A35M
        if (((G0313_ul_GameTime - G0418_l_LastEvent22Time_CPSE) > 500) && (!G2136_B_EvaluatingMemoryRequirements)) {
#endif
#ifdef MEDIA282_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_P20JA_P20JB_A31E_A31M_A33M_A35E_A35M_X31J /* CHANGE7_04_IMPROVEMENT */
                G0418_l_LastEvent22Time_CPSE = G0313_ul_GameTime + 1;
#endif
                L0000_s_Event_CPSE.A.A.Type = C22_EVENT_CPSE;
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_04_IMPROVEMENT Event 22 expires 2 ticks in the future */
                M033_SET_MAP_AND_TIME(L0000_s_Event_CPSE.Map_Time, P0000_i_MapIndex, (G0418_l_LastEvent22Time_CPSE = G0313_ul_GameTime) + 2);
#endif
#ifdef MEDIA282_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_P20JA_P20JB_A31E_A31M_A33M_A35E_A35M_X31J /* CHANGE7_04_IMPROVEMENT Event 22 expires 3 ticks in the future */
                M033_SET_MAP_AND_TIME(L0000_s_Event_CPSE.Map_Time, P0000_i_MapIndex, G0418_l_LastEvent22Time_CPSE + 2);
#endif
                F0238_TIMELINE_AddEvent_GetEventIndex_CPSE(&L0000_s_Event_CPSE);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0428_DIALOG_RequireGameDiskInDrive_NoDialogDrawn(C0_DO_NOT_FORCE_DIALOG_DM_CSB, C0_FALSE);
#endif
#ifdef MEDIA581_X30J_P20JA_P20JB_A31E_A31M_A33M_A35E_A35M_X31J
                F0428_DIALOG_RequireGameDiskInDrive_NoDialogDrawn(C0_DO_NOT_FORCE_DIALOG_DM_CSB);
#endif
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
                Floprd(M517_FuzzySectorReadingBuffer_CPSE, C0L_FILLER, C0_FLOPPY_DRIVE_A, C007_SECTOR_7, C0_TRACK_0, C0_SIDE_0, C1_ONE_SECTOR);
#endif
#ifdef MEDIA368_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_P20JA_P20JB_A31E_A31M_A33M_A35E_A35M_X31J
                F0527_FLOPPY_ReadFuzzySector_CPSX(M517_FuzzySectorReadingBuffer_CPSE);
#endif
                G0488_i_Graphic560_RequestCheckFuzzyBitCount_CPSE = C01113_TRUE;
                G0031_i_Graphic562_FuzzySectorAnalyzed_CPSE = C00255_FALSE;
#ifdef MEDIA282_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_P20JA_P20JB_A31E_A31M_A33M_A35E_A35M_X31J /* CHANGE7_04_IMPROVEMENT */
                G0068_i_CheckLastEvent22Time_CPSE = C00555_TRUE;
#endif
        }
#endif
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        if (!G2136_B_EvaluatingMemoryRequirements) {
#endif
                F0195_GROUP_AddAllActiveGroups(); /* BUG0_63 */
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        }
#endif
        F0337_INVENTORY_SetDungeonViewPalette();
}
#endif
