#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA676_F31E_F31J_X31J_P31J_AU1E_AU2E_AU3E
void F7054_DetermineGameFormats(GAME* P3714_ps_)
{
        unsigned int16_t L3955_ui_;
        int16_t L3959_i_;
        unsigned int16_t L3960_ui_;
        unsigned char L3956_uc_;
        char L3957_c_;
        CSB_SAVE_HEADER* L3958_ps_;


        L3955_ui_ = P3714_ps_->SaveHeaderFormat;
        switch (L3955_ui_) {
                case C0x01_SAVE_HEADER_FORMAT_DUNGEON_MASTER:
                        if (P3714_ps_->SaveHeader.FormatID == C1_FORMAT_DM_ATARI_ST) {
                                P3714_ps_->SaveHeader.Platform = C1_PLATFORM_ATARI_ST;
                                P3714_ps_->SaveHeader.DungeonID = C10_DUNGEON_DM;
                        }
                        L3959_i_ = P3714_ps_->SaveHeader.DungeonID;
                        L3960_ui_ = P3714_ps_->SaveHeader.Platform;
                        L3956_uc_ = P3714_ps_->SaveHeader.FormatID;
                        L3957_c_ = P3714_ps_->SaveHeader.Useless;
                        break;
                case C0x02_SAVE_HEADER_FORMAT_CHAOS_STRIKES_BACK:
                        L3958_ps_ = (CSB_SAVE_HEADER*)&P3714_ps_->SaveHeader;
                        L3959_i_ = L3958_ps_->DungeonID;
                        L3960_ui_ = L3958_ps_->Platform;
                        L3956_uc_ = L3958_ps_->FormatID;
                        L3957_c_ = L3958_ps_->Useless;
        }
        P3714_ps_->ChampionFormat = C2_CHAMPION_FORMAT_PORTRAITS_EXCLUDED;
        switch (L3960_ui_) {
                case C1_PLATFORM_ATARI_ST:
                        if (L3956_uc_ < 4) { /* C1_FORMAT_DM_ATARI_ST or C2_FORMAT_DM_AMIGA_2X_PC98_X68000_FM_TOWNS_CSB_ATARI_ST or C3_FORMAT_DM_APPLE_IIGS */
                                P3714_ps_->ChampionFormat = C1_CHAMPION_FORMAT_PORTRAITS_INCLUDED;
                        }
                        break;
                case C3_PLATFORM_AMIGA:
                        if (L3959_i_ == C10_DUNGEON_DM) {
                                if (L3956_uc_ < 4) { /* C1_FORMAT_DM_ATARI_ST or C2_FORMAT_DM_AMIGA_2X_PC98_X68000_FM_TOWNS_CSB_ATARI_ST or C3_FORMAT_DM_APPLE_IIGS */
                                        P3714_ps_->ChampionFormat = C1_CHAMPION_FORMAT_PORTRAITS_INCLUDED;
                                }
                        }
                        break;
                case C2_PLATFORM_APPLE_IIGS:
                        if (L3959_i_ == C10_DUNGEON_DM) {
                                if (L3956_uc_ < 4) { /* C1_FORMAT_DM_ATARI_ST or C2_FORMAT_DM_AMIGA_2X_PC98_X68000_FM_TOWNS_CSB_ATARI_ST or C3_FORMAT_DM_APPLE_IIGS */
                                        P3714_ps_->ChampionFormat = C1_CHAMPION_FORMAT_PORTRAITS_INCLUDED;
                                }
                        }
                        break;
        }
        if (P3714_ps_->ChampionFormat == C1_CHAMPION_FORMAT_PORTRAITS_INCLUDED) {
#ifdef MEDIA671_F31E_F31J_P31J
                P3714_ps_->ChampionDataByteCount = 3324;
#endif
#ifdef MEDIA697_X31J_AU1E_AU2E_AU3E
                P3714_ps_->ChampionDataByteCount = 3328;
#endif
                P3714_ps_->PortraitFormat = C1_PORTRAIT_FORMAT_INTERNAL;
                P3714_ps_->PortraitByteCount = 0;
                P3714_ps_->PortraitCount = 0;
        } else {
#ifdef MEDIA671_F31E_F31J_P31J
                P3714_ps_->ChampionDataByteCount = 1404;
#endif
#ifdef MEDIA697_X31J_AU1E_AU2E_AU3E
                P3714_ps_->ChampionDataByteCount = 1408;
#endif
                P3714_ps_->PortraitFormat = C2_PORTRAIT_FORMAT_EXTERNAL;
                P3714_ps_->PortraitByteCount = 464;
                P3714_ps_->PortraitCount = 4;
        }
}
#endif
