#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA773_SU1E_AU1E
int16_t F7004_LoadChampions(
void)
{
        register unsigned int16_t L3829_i_;
        register unsigned int16_t L3828_ui_;
#ifdef MEDIA772_SU1E
        int16_t L5814_i_;
#endif
#ifdef MEDIA762_AU1E
        FILE_HANDLE L5814_;
#endif
        char L5813_[50];


        L3829_i_ = F7072_GetDialogChoiceOrdinal(G7068_YOU_MAY_LOAD_EITHER_A_SAVED_GAME_OR_A_CHAMPION_PORTRAIT, C15_COLOR_WHITE | MASK0x8000_INVERT_BOX, G7064_GAME_PORTRAIT_CANCEL, &G2254_s_Input_Dialog3ChoicesB);
        if (L3829_i_ == 3) {
                loc_24A0:
                F7071_();
                return -1;
        }
        if (L3829_i_ == 1) { /* Game */
                if (F7051_LoadGame(C0_GAME_SOURCE) == -1) {
                        return -1;
                } else {
                        return 1;
                }
        }
        if (L3829_i_ != 2) {
                return;
        }
        L5813_[0] = '\0';
        do {
                G3771_ = G3802_pc_SaveFloppyDriveRootPath;
                G3770_ = 1;
                if ((F1995_(L3829_i_) == 0) || (F7082_DrawFilePickerDialog(L5813_) == 0)) {
                        goto loc_24A0;
                }
                L3829_i_ = 3;
        } while (L5813_[0] == '\0');
#ifdef MEDIA772_SU1E
        if ((L5814_i_ = Fopen(L5813_, C0_READ_ONLY)) < 0) {
#endif
#ifdef MEDIA762_AU1E
        if ((L5814_ = F0770_FILE_Open(L5813_)) == NULL) {
#endif
                goto loc_255C;
        }
#ifdef MEDIA772_SU1E
        L3829_i_ = (Fread(L5814_i_, (long)sizeof(CMP), &G2246_CMPData) == (long)sizeof(CMP));
        Fclose(L5814_i_);
#endif
#ifdef MEDIA762_AU1E
        L3829_i_ = F0772_FILE_Read(L5814_, (long)sizeof(CMP), &G2246_CMPData);
        F0771_FILE_Close(L5814_);
#endif
        if ((L3829_i_ == 0) || (G2246_CMPData.Magic != 0x91A7)) {
                loc_255C:
#ifdef MEDIA772_SU1E
                F7072_GetDialogChoiceOrdinal(G7079_THIS_CHAMPION_IS_DAMAGED, C08_COLOR_RED, G7060_OK, &G2263_s_Input_Dialog1Choice);
#endif
#ifdef MEDIA762_AU1E
                F7074_DrawDialogErrorMessage(G7079_THIS_CHAMPION_IS_DAMAGED, C08_COLOR_RED);
#endif
                loc_2574:
                F7077_InitCMPStructure();
                return -1;
        }
        if (G2246_CMPData.cmp_ui_8 & 0x8000) {
#ifdef MEDIA772_SU1E
                F7072_GetDialogChoiceOrdinal(G7080_THIS_CHAMPION_CANNOT_BE_USED_WITH_THIS_ADVENTURE, C08_COLOR_RED, G7060_OK, &G2263_s_Input_Dialog1Choice);
#endif
#ifdef MEDIA762_AU1E
                F7074_DrawDialogErrorMessage(G7080_THIS_CHAMPION_CANNOT_BE_USED_WITH_THIS_ADVENTURE, C08_COLOR_RED);
#endif
                goto loc_2574;
        }
        F7071_();
#ifdef MEDIA762_AU1E
        F2104_CHAMPION_ConvertBitmapToAtariSTPlanar(G2246_CMPData.Portrait, 32, 29);
#endif
        for (L3829_i_ = 0; L3829_i_ < 8; L3829_i_++) {
#ifdef MEDIA772_SU1E
                if (!G2246_CMPData.Name[L3829_i_]) {
#endif
#ifdef MEDIA762_AU1E
                if (G2246_CMPData.Name[L3829_i_] == '\0') {
#endif
                        break;
                }
        }
        while (L3829_i_ < 8) {
                G2246_CMPData.Name[L3829_i_] = '\0';
                L3829_i_++;
        }
        for (L3829_i_ = 0; L3829_i_ < 20; L3829_i_++) {
#ifdef MEDIA772_SU1E
                if (!G2246_CMPData.Title[L3829_i_]) {
#endif
#ifdef MEDIA762_AU1E
                if (G2246_CMPData.Title[L3829_i_] == '\0') {
#endif
                        break;
                }
        }
        while (L3829_i_ < 20) {
                G2246_CMPData.Title[L3829_i_] = '\0';
                L3829_i_++;
        }
        return 2;
}
#endif
