#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA674_F31E_F31J_X31J_P31J
#ifdef MEDIA667_P31J
unsigned char G2048_auc_GameDiskDriveLetter[3] = "A:";
unsigned char G2049_auc_SavedGameDiskDriveLetter[3] = "A:";
char G0575_ac_SavedGameFileName[14] = "A:\\DMSAVE.DAT";
char G0576_ac_SavedGameBackupFileName[14] = "A:\\DMSAVE.BAK";
char* G2321_[4] = { G0575_ac_SavedGameFileName, G0576_ac_SavedGameBackupFileName, G2048_auc_GameDiskDriveLetter, G2049_auc_SavedGameDiskDriveLetter };
#endif
#ifdef MEDIA670_F31E_F31J
BOOLEAN G0567_B_GameAndSaveDiskUseSameDrive;
char* G2321_[4] = { G0575_ac_SavedGameFileName, G0576_ac_SavedGameBackupFileName, M772_CAST_PC(G2048_auc_GameDiskDriveLetter), M772_CAST_PC(G2049_auc_SavedGameDiskDriveLetter) };
FILE_HANDLE G4081_i_FileHandle;
unsigned char G2048_auc_GameDiskDriveLetter[3] = "A:";
unsigned char G2049_auc_SavedGameDiskDriveLetter[3] = "A:";
char G0575_ac_SavedGameFileName[14] = "A:\\DMSAVE.DAT";
char G0576_ac_SavedGameBackupFileName[14] = "A:\\DMSAVE.BAK";
int16_t G2145_i_GameDiskDriveOrdinal;
int16_t G2146_i_SaveDiskDriveOrdinal;
#endif


#include "FILE.C"

#ifdef MEDIA670_F31E_F31J
int F7327_GetCharacterFromKeyboard( /* F0540_INPUT_Crawcin */
void
)
{
        int L6501_;


        L6501_ = F2277_KEYREAD();
        return L6501_;
}

BOOLEAN F0539_INPUT_Cconis(
void
)
{
        return F2254_KEYAVAIL();
}

void F0451_FLOPPY_Initialize(
void
)
{
        F2251_INSTALL_CRITICAL_HANDLER();
        G2146_i_SaveDiskDriveOrdinal = 1;
        G2145_i_GameDiskDriveOrdinal = 4;
        G0567_B_GameAndSaveDiskUseSameDrive = C1_TRUE;
        G0575_ac_SavedGameFileName[0] = G0576_ac_SavedGameBackupFileName[0] = G2049_auc_SavedGameDiskDriveLetter[0] = G2048_auc_GameDiskDriveLetter[0] = 'A' + G2146_i_SaveDiskDriveOrdinal - 1;
}
#endif

#ifdef MEDIA667_P31J
void F0451_FLOPPY_Initialize(
)
{
        asm     mov     ah, 19h
        asm     int     21h     /* DOS - GET DEFAULT DISK NUMBER */
        asm     mov     ah, 0
        asm     inc     ax
        asm     mov     G2143_i_CurrentDefaultDriveOrdinal, ax
        if (F0715_GetConvertedDeviceType(G2143_i_CurrentDefaultDriveOrdinal) == 1) {
                G2228_B_RunningFromHardDisk = C1_TRUE;
                G2145_i_GameDiskDriveOrdinal = G2143_i_CurrentDefaultDriveOrdinal;
                G2146_i_SaveDiskDriveOrdinal = 1;
                G2144_i_DriveOrdinal = M000_INDEX_TO_ORDINAL(C0_FLOPPY_DRIVE_A);
                G0567_B_GameAndSaveDiskUseSameDrive = C0_FALSE;
        } else {
                G2228_B_RunningFromHardDisk = C0_FALSE;
                G2145_i_GameDiskDriveOrdinal = G2143_i_CurrentDefaultDriveOrdinal;
                G2144_i_DriveOrdinal = G2143_i_CurrentDefaultDriveOrdinal;
                if (G2143_i_CurrentDefaultDriveOrdinal == M000_INDEX_TO_ORDINAL(C0_FLOPPY_DRIVE_A)) {
                        if (F0715_GetConvertedDeviceType(M000_INDEX_TO_ORDINAL(C1_FLOPPY_DRIVE_B)) && (F0715_GetConvertedDeviceType(M000_INDEX_TO_ORDINAL(C0_FLOPPY_DRIVE_A)) == F0715_GetConvertedDeviceType(M000_INDEX_TO_ORDINAL(C1_FLOPPY_DRIVE_B)))) {
                                G2146_i_SaveDiskDriveOrdinal = M000_INDEX_TO_ORDINAL(C1_FLOPPY_DRIVE_B);
                                G0567_B_GameAndSaveDiskUseSameDrive = C0_FALSE;
                        } else {
                                G2146_i_SaveDiskDriveOrdinal = G2143_i_CurrentDefaultDriveOrdinal;
                                G0567_B_GameAndSaveDiskUseSameDrive = C1_TRUE;
                        }
                } else {
                        if (G2143_i_CurrentDefaultDriveOrdinal == M000_INDEX_TO_ORDINAL(C1_FLOPPY_DRIVE_B)) {
                                if (F0715_GetConvertedDeviceType(M000_INDEX_TO_ORDINAL(C0_FLOPPY_DRIVE_A)) && (F0715_GetConvertedDeviceType(M000_INDEX_TO_ORDINAL(C0_FLOPPY_DRIVE_A)) == F0715_GetConvertedDeviceType(M000_INDEX_TO_ORDINAL(C1_FLOPPY_DRIVE_B)))) {
                                        G2146_i_SaveDiskDriveOrdinal = M000_INDEX_TO_ORDINAL(C0_FLOPPY_DRIVE_A);
                                        G0567_B_GameAndSaveDiskUseSameDrive = C0_FALSE;
                                } else {
                                        G2146_i_SaveDiskDriveOrdinal = G2143_i_CurrentDefaultDriveOrdinal;
                                        G0567_B_GameAndSaveDiskUseSameDrive = C1_TRUE;
                                }
                        } else {
                                G2146_i_SaveDiskDriveOrdinal = G2143_i_CurrentDefaultDriveOrdinal;
                                G0567_B_GameAndSaveDiskUseSameDrive = C1_TRUE;
                        }
                }
        }
        G2048_auc_GameDiskDriveLetter[0] = 'A' + G2145_i_GameDiskDriveOrdinal - 1U;
        G0575_ac_SavedGameFileName[0] = G0576_ac_SavedGameBackupFileName[0] = G2049_auc_SavedGameDiskDriveLetter[0] = 'A' + G2146_i_SaveDiskDriveOrdinal - 1U;
}
#endif
#endif
