#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA371_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
#ifdef MEDIA351_G14ED_G20E_G21E
segment "gsthings"

BOOLEAN F0712_AnyKeyboardOrMouseInput(
)
{
        EventRecord L6389_;


        return EventAvail(-1, &L6389_);
}

BOOLEAN F0539_INPUT_Cconis(
)
{
        EventRecord L6390_;
        int16_t L6393_i_Unreferenced;


        if (G4018_B_) {
                F2166_();
        }
        if (EventAvail(keyDownMask, &L6390_)) {
                return (L6390_.what == keyDownEvt);
        } else {
                return C0_FALSE;
        }
}

long F0540_INPUT_Crawcin(
)
{
        EventRecord L6391_;
        long L6394_i_Unreferenced;


        if (G4018_B_) {
                F2166_();
        }
        if (GetNextEvent(keyDownMask, &L6391_)) {
                return F2156_(&L6391_);
        } else {
                return 0L;
        }
}

void F2180_(P6064_pc_String)
char* P6064_pc_String;
{
#ifdef MEDIA349_G14ED
        printf("%s", P6064_pc_String);
        while (!F0540_INPUT_Crawcin());
#endif
#ifdef MEDIA388_G20E_G21E
        F0047_TEXT_MESSAGEAREA_PrintMessage(C15_COLOR_WHITE, P6064_pc_String);
        F0357_COMMAND_DiscardAllInput();
        while (!F0712_AnyKeyboardOrMouseInput());
        F0357_COMMAND_DiscardAllInput();
#endif
}

void F2181_(P6065_)
int16_t P6065_;
{
#ifdef MEDIA349_G14ED
        printf("%c", (char)P6065_);
#endif
#ifdef MEDIA388_G20E_G21E
        char L6392_[2];


        L6392_[0] = P6065_;
        L6392_[1] = '\0';
        F2180_(L6392_);
#endif
}
#endif

#ifdef MEDIA425_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
struct Device* ConsoleDevice; /* Variable name required by C library function RawKeyConvert() */
struct GamePortTrigger G1040_s_GamePortTriggerBackup;
char G1136_ac_Unreferenced[22]; /* struct InputEvent size = 22 */
char G1042_ac_handlerData[80]; /* passed via A1 as the parameter to the interrupt handler, of type struct InputEvent* */
struct Process* G1036_ps_Process;
int16_t G1045_ai_InputBufferCharacters[256];
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
struct Interrupt G3172_s_InputDeviceInterrupt;
BOOLEAN G3173_B_InputInitialized = C0_FALSE;
#endif
int16_t G1038_i_MouseX;
int16_t G1039_i_MouseY;
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
char G1137_ac_Unreferenced[12];
struct IOStdReq* G1031_ps_IOStdReq = NULL;
struct GamePortTrigger G1041_s_GamePortTrigger = { GPTF_UPKEYS | GPTF_DOWNKEYS, 0, 1, 1 }; /* Trigger events on both button down and button up, with no repetition and with a minimum change of 1 on x axis or y axis */
struct IOStdReq* G1033_ps_IOStdReq = NULL;
struct MsgPort* G1030_ps_MessagePort = NULL;
struct IOStdReq* G1034_ps_IOStdReq = NULL;
struct Interrupt* G1037_ps_InputDeviceInterrupt = NULL;
long G1035_l_Signal_InputBufferNotEmpty = -1;
int16_t G1043_i_InputBufferCharacterCount = 0;
BOOLEAN G1044_B_MouseOrKeyboardInput = C0_FALSE;
BOOLEAN G1052_B_GameViewActive = C1_TRUE;
BOOLEAN G1048_B_RandomNumberInitialized = C0_FALSE;
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
char G1049_auc_ANSIBytes[8];
long G3241_l_Unreferenced = 0;
#endif
BOOLEAN G1046_B_LeftAmigaAndLeftAltDown = C0_FALSE;
BOOLEAN G1047_B_RightAmigaAndRightAltDown = C0_FALSE;
#ifdef MEDIA440_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
BOOLEAN G1050_B_LeftMouseButtonDown = C0_FALSE;
BOOLEAN G1051_B_RightMouseButtonDown = C0_FALSE;
#endif


#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
BOOLEAN F0536_INPUT_Initialize(
)
{
        G1030_ps_MessagePort = CreatePort(NULL, 0L);
        if (G1030_ps_MessagePort == NULL) {
                Alert(0x80444D60, 0L);
        }
        G1031_ps_IOStdReq = CreateStdIO(G1030_ps_MessagePort);
        if (G1031_ps_IOStdReq == NULL) {
                Alert(0x80444D61, 0L);
        }
        if (OpenDevice("console.device", -1L, G1031_ps_IOStdReq, 0L)) {
                Alert(0x80444D62, 0L);
        }
        ConsoleDevice = G1031_ps_IOStdReq->io_Device;
        DeletePort(G1030_ps_MessagePort);
        CloseDevice(G1031_ps_IOStdReq);
        DeleteStdIO(G1031_ps_IOStdReq);
        G1031_ps_IOStdReq = NULL;
        G1030_ps_MessagePort = CreatePort(NULL, 0L);
        if (G1030_ps_MessagePort == NULL) {
                Alert(0x80444D63, 0L);
        }
        G1033_ps_IOStdReq = CreateStdIO(G1030_ps_MessagePort);
        if (G1033_ps_IOStdReq == NULL) {
                Alert(0x80444D64, 0L);
        }
        if (OpenDevice("gameport.device", 0L, G1033_ps_IOStdReq, 0L)) {
                Alert(0x80444D65, 0L);
        }
        G1033_ps_IOStdReq->io_Command = GPD_ASKTRIGGER;
        G1033_ps_IOStdReq->io_Length = sizeof(G1040_s_GamePortTriggerBackup);
        G1033_ps_IOStdReq->io_Data = (APTR)&G1040_s_GamePortTriggerBackup;
        DoIO(G1033_ps_IOStdReq); /* Backup current trigger conditions in G1040_s_GamePortTriggerBackup */
        G1033_ps_IOStdReq->io_Command = GPD_SETTRIGGER;
        G1033_ps_IOStdReq->io_Length = sizeof(G1041_s_GamePortTrigger);
        G1033_ps_IOStdReq->io_Data = (APTR)&G1041_s_GamePortTrigger;
        DoIO(G1033_ps_IOStdReq);
        DeletePort(G1030_ps_MessagePort);
        CloseDevice(G1033_ps_IOStdReq);
        DeleteStdIO(G1033_ps_IOStdReq);
        G1033_ps_IOStdReq = NULL;
        G1030_ps_MessagePort = CreatePort(NULL, 0L);
        if (G1030_ps_MessagePort == NULL) {
                Alert(0x80444D66, 0L);
        }
        G1034_ps_IOStdReq = CreateStdIO(G1030_ps_MessagePort);
        if (G1034_ps_IOStdReq == NULL) {
                Alert(0x80444D67, 0L);
        }
        G1035_l_Signal_InputBufferNotEmpty = AllocSignal(-1L);
        if (G1035_l_Signal_InputBufferNotEmpty == -1) {
                Alert(0x80444D68, 0L);
        }
        G1036_ps_Process = (struct Process*)FindTask(0L);
        if (!G1036_ps_Process) {
                Alert(0x80444D69, 0L);
        }
        G1037_ps_InputDeviceInterrupt = (struct Interrupt*)AllocMem((long)sizeof(struct Interrupt), MEMF_PUBLIC);
        if (G1037_ps_InputDeviceInterrupt == NULL) {
                Alert(0x80444D6A, 0L);
        }
        G1037_ps_InputDeviceInterrupt->is_Data = (APTR)&G1042_ac_handlerData;
        G1037_ps_InputDeviceInterrupt->is_Code = S0542_INPUT_DeviceInterruptStub;
        G1037_ps_InputDeviceInterrupt->is_Node.ln_Pri = 0x7F;
        if (OpenDevice("input.device", 0L, G1034_ps_IOStdReq, 0L)) {
                Alert(0x80444D6B, 0L);
        }
        G1034_ps_IOStdReq->io_Command = IND_ADDHANDLER;
        G1034_ps_IOStdReq->io_Length = sizeof(struct Interrupt);
        G1034_ps_IOStdReq->io_Data = (APTR)G1037_ps_InputDeviceInterrupt;
        DoIO(G1034_ps_IOStdReq);
        if (!G0567_B_GameAndSaveDiskUseSameDrive && (F0452_FLOPPY_GetDiskTypeInDrive_CPSB(C2_DRIVE_TYPE_SAVE_DISK) == C1_DISK_TYPE_SAVE_DISK_WRITE_ENABLED)) {
                G1038_i_MouseX = 250 * 2; /* Coordinates of Resume button on entrance screen */
                G1039_i_MouseY = 85 * 2;
        } else {
                G1038_i_MouseX = 250 * 2; /* Coordinates of Enter button on entrance screen */
                G1039_i_MouseY = 52 * 2;
        }
        F0073_MOUSE_BuildPointerScreenArea(G1038_i_MouseX >> 1, G1039_i_MouseY >> 1);
        return 1;
        F0537_INPUT_ReleaseResources();
        return 0;
}

void F0537_INPUT_ReleaseResources(
)
{
        if (G1035_l_Signal_InputBufferNotEmpty != -1) {
                FreeSignal(G1035_l_Signal_InputBufferNotEmpty);
        }
        if (G1030_ps_MessagePort) {
                DeletePort(G1030_ps_MessagePort);
        }
        if (G1034_ps_IOStdReq) {
                DeleteStdIO(G1034_ps_IOStdReq);
        }
        if (G1031_ps_IOStdReq) {
                DeleteStdIO(G1031_ps_IOStdReq);
        }
        if (G1033_ps_IOStdReq) {
                DeleteStdIO(G1033_ps_IOStdReq);
        }
        if (G1037_ps_InputDeviceInterrupt) {
                FreeMem(G1037_ps_InputDeviceInterrupt, (long)sizeof(struct Interrupt));
        }
}

void F0538_INPUT_Deinitialize(
)
{
        G1034_ps_IOStdReq->io_Command = IND_SETMTRIG;
        G1034_ps_IOStdReq->io_Length = sizeof(struct GamePortTrigger);
        G1034_ps_IOStdReq->io_Data = (APTR)&G1040_s_GamePortTriggerBackup;
        DoIO(G1034_ps_IOStdReq);
        G1034_ps_IOStdReq->io_Command = IND_REMHANDLER;
        G1034_ps_IOStdReq->io_Length = sizeof(struct Interrupt);
        G1034_ps_IOStdReq->io_Data = (APTR)G1037_ps_InputDeviceInterrupt;
        DoIO(G1034_ps_IOStdReq);
        CloseDevice(G1034_ps_IOStdReq);
        F0537_INPUT_ReleaseResources();
}

BOOLEAN F0539_INPUT_Cconis(
)
{
        register BOOLEAN L1734_B_;


        Forbid();
        L1734_B_ = G1043_i_InputBufferCharacterCount > 0;
        Permit();
        return L1734_B_;
}

int16_t F0540_INPUT_Crawcin(
)
{
        register int16_t L1735_i_;
        register int16_t L1736_i_;


        while (G1043_i_InputBufferCharacterCount <= 0) {
                Wait(1 << G1035_l_Signal_InputBufferNotEmpty);
        }
        L1735_i_ = G1045_ai_InputBufferCharacters[0]; /* Extract the first character in the buffer */
        G1043_i_InputBufferCharacterCount--;
        for (L1736_i_ = 0; L1736_i_ < G1043_i_InputBufferCharacterCount; L1736_i_++) { /* Shift remaining characters in the buffer */
                G1045_ai_InputBufferCharacters[L1736_i_] = G1045_ai_InputBufferCharacters[L1736_i_ + 1];
        }
        G1045_ai_InputBufferCharacters[G1043_i_InputBufferCharacterCount] = 0; /* Erase last character */
        return L1735_i_;
}

int16_t F0541_INPUT_WaitForMouseOrKeyboardActivity(
)
{
        G1044_B_MouseOrKeyboardInput = C0_FALSE;
        while (G1044_B_MouseOrKeyboardInput == C0_FALSE) {
                Delay(50L);
        }
        return 0;
}

#asm
_S0542_INPUT_DeviceInterruptStub:
        movem.l a0-a1,-(sp)
        bsr.s   _F0543_INPUT_DeviceInterruptHand
        addq.l  #8,sp
        rts
#endasm
#endif

struct InputEvent* F0543_INPUT_DeviceInterruptHandler(P0967_ps_oldEventChain)
struct InputEvent* P0967_ps_oldEventChain;
{
        register struct InputEvent* L1737_ps_InputEvent1;
        register struct InputEvent* L1738_ps_InputEvent2;
        register struct InputEvent* L1739_ps_InputEvent3;
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        register int16_t L1740_i_NormalizedKeyCode;
#endif
#ifdef MEDIA626_A31E_A31M_A33M_A35E_A35M
        register int16_t L2622_i_Unreferenced;
#endif
#ifdef MEDIA423_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
        register BOOLEAN L1741_B_;
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        static unsigned char G1049_auc_ANSIBytes[4];
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
        register long L2623_l_NormalizedKeyCode;
        register int16_t L2624_i_ANSIByteCount;
        register unsigned int16_t L2625_ui_ieQualifier;
#endif
#ifdef MEDIA744_A36M
        int16_t L2622_i_Unreferenced;
        register BOOLEAN L1741_B_;
#endif


#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        int_start();
        L1738_ps_InputEvent2 = L1739_ps_InputEvent3 = NULL;
        if (!G1048_B_RandomNumberInitialized && P0967_ps_oldEventChain) {
                G0349_ul_LastRandomNumber = P0967_ps_oldEventChain->ie_TimeStamp.tv_secs * P0967_ps_oldEventChain->ie_TimeStamp.tv_micro;
                G1048_B_RandomNumberInitialized = C1_TRUE;
        }
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
        L1738_ps_InputEvent2 = NULL;
        L1739_ps_InputEvent3 = NULL;
#endif
        for (L1737_ps_InputEvent1 = P0967_ps_oldEventChain; L1737_ps_InputEvent1 != NULL; L1737_ps_InputEvent1 = L1737_ps_InputEvent1->ie_NextEvent) {
                L1741_B_ = C0_FALSE;
                T0543000_ProcessInputEvent:
                switch(L1737_ps_InputEvent1->ie_Class) {
                        case IECLASS_RAWKEY:
#ifdef MEDIA440_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
                                /* Pressing left Alt and left Amiga keys simultaneously is equivalent to a click on the left mouse button
                                   Pressing right Alt and right Amiga keys simultaneously is equivalent to a click on the right mouse button
                                   Compared to demo?
                                   BUGX_XX: Some presses are ignored: press both left, press both right, release both right, release both left. Press both right: ignored! Press both right again, not ignored.
                                   */
                                if (M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_LCOMMAND) || M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_LALT)) {
                                        if (M007_GET(L1737_ps_InputEvent1->ie_Code, IECODE_UP_PREFIX) && G1046_B_LeftAmigaAndLeftAltDown) {
                                                G1046_B_LeftAmigaAndLeftAltDown = C0_FALSE;
                                                L1737_ps_InputEvent1->ie_Class = IECLASS_RAWMOUSE;
                                                L1737_ps_InputEvent1->ie_Code = IECODE_UP_PREFIX | IECODE_LBUTTON;
                                                L1737_ps_InputEvent1->ie_X = 0;
                                                L1737_ps_InputEvent1->ie_Y = 0;
                                                goto T0543000_ProcessInputEvent;
                                        }
                                }
                                if (M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_RCOMMAND) || M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_RALT)) {
                                        if (M007_GET(L1737_ps_InputEvent1->ie_Code, IECODE_UP_PREFIX) && G1047_B_RightAmigaAndRightAltDown) {
                                                G1047_B_RightAmigaAndRightAltDown = C0_FALSE;
                                                L1737_ps_InputEvent1->ie_Class = IECLASS_RAWMOUSE;
                                                L1737_ps_InputEvent1->ie_Code = IECODE_UP_PREFIX | IECODE_RBUTTON;
                                                L1737_ps_InputEvent1->ie_X = 0;
                                                L1737_ps_InputEvent1->ie_Y = 0;
                                                goto T0543000_ProcessInputEvent;
                                        }
                                }
                                if (M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_LCOMMAND) && M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_LALT) && !G1046_B_LeftAmigaAndLeftAltDown) {
                                        G1046_B_LeftAmigaAndLeftAltDown = C1_TRUE;
                                        L1737_ps_InputEvent1->ie_Class = IECLASS_RAWMOUSE;
                                        L1737_ps_InputEvent1->ie_Code = IECODE_LBUTTON;
                                        L1737_ps_InputEvent1->ie_X = 0;
                                        L1737_ps_InputEvent1->ie_Y = 0;
                                        goto T0543000_ProcessInputEvent;
                                }
                                if (M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_RCOMMAND) && M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_RALT) && !G1047_B_RightAmigaAndRightAltDown) {
                                        G1047_B_RightAmigaAndRightAltDown = C1_TRUE;
                                        L1737_ps_InputEvent1->ie_Class = IECLASS_RAWMOUSE;
                                        L1737_ps_InputEvent1->ie_Code = IECODE_RBUTTON;
                                        L1737_ps_InputEvent1->ie_X = 0;
                                        L1737_ps_InputEvent1->ie_Y = 0;
                                        goto T0543000_ProcessInputEvent;
                                }
#endif
#ifdef MEDIA410_A20ED
                                if (M007_GET(L1737_ps_InputEvent1->ie_Code, IECODE_UP_PREFIX)) {
                                        if (G1046_B_LeftAmigaAndLeftAltDown) {
                                                G1046_B_LeftAmigaAndLeftAltDown = C0_FALSE;
                                                L1737_ps_InputEvent1->ie_Class = IECLASS_RAWMOUSE;
                                                L1737_ps_InputEvent1->ie_Code = IECODE_UP_PREFIX | IECODE_LBUTTON;
                                                L1737_ps_InputEvent1->ie_X = 0;
                                                L1737_ps_InputEvent1->ie_Y = 0;
                                                goto T0543000_ProcessInputEvent;
                                        }
                                        if (G1047_B_RightAmigaAndRightAltDown) {
                                                G1047_B_RightAmigaAndRightAltDown = C0_FALSE;
                                                L1737_ps_InputEvent1->ie_Class = IECLASS_RAWMOUSE;
                                                L1737_ps_InputEvent1->ie_Code = IECODE_UP_PREFIX | IECODE_RBUTTON;
                                                L1737_ps_InputEvent1->ie_X = 0;
                                                L1737_ps_InputEvent1->ie_Y = 0;
                                                goto T0543000_ProcessInputEvent;
                                        }
                                }
                                if (M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_LCOMMAND) && M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_LALT)) {
                                        G1046_B_LeftAmigaAndLeftAltDown = C1_TRUE;
                                        L1737_ps_InputEvent1->ie_Class = IECLASS_RAWMOUSE;
                                        L1737_ps_InputEvent1->ie_Code = IECODE_LBUTTON;
                                        L1737_ps_InputEvent1->ie_X = 0;
                                        L1737_ps_InputEvent1->ie_Y = 0;
                                        goto T0543000_ProcessInputEvent;
                                }
                                if (M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_RCOMMAND) && M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_RALT)) {
                                        G1047_B_RightAmigaAndRightAltDown = C1_TRUE;
                                        L1737_ps_InputEvent1->ie_Class = IECLASS_RAWMOUSE;
                                        L1737_ps_InputEvent1->ie_Code = IECODE_RBUTTON;
                                        L1737_ps_InputEvent1->ie_X = 0;
                                        L1737_ps_InputEvent1->ie_Y = 0;
                                        goto T0543000_ProcessInputEvent;
                                }
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                Forbid();
                                G1044_B_MouseOrKeyboardInput = C1_TRUE;
#endif
                                if (!M007_GET(L1737_ps_InputEvent1->ie_Code, (unsigned int16_t)IECODE_UP_PREFIX) && L1737_ps_InputEvent1->ie_Code < 96) { /* 96 is first 'special' key (shift, alt, etc.) */
                                        if (M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_LCOMMAND) && ((L1737_ps_InputEvent1->ie_Code == 0x37) || (L1737_ps_InputEvent1->ie_Code == 0x36))) { /* Left 'Amiga' key and 'N' or 'M' */
#ifdef MEDIA433_A20E_A20F_A20G_A21E_A22E_A22G
                                                L1741_B_ = C1_TRUE;
                                        }
#endif
#ifdef MEDIA410_A20ED
                                                if (G1052_B_GameViewActive && (L1737_ps_InputEvent1->ie_Code == 0x36)) { /* 'Amiga' + 'N' keys: shows a black screen with a blurred white mouse pointer */
                                                        LoadView(G0734_ps_AmigaData->ViewBeforeGame);
                                                        M526_WaitVerticalBlank();
                                                        G1052_B_GameViewActive = C0_FALSE;
                                                        L1741_B_ = C1_TRUE;
                                                } else {
                                                        if (!G1052_B_GameViewActive && (L1737_ps_InputEvent1->ie_Code == 0x37)) { /* 'Amiga' + 'M' keys: show normal game screen */
                                                                LoadView(&G0734_ps_AmigaData->GameView);
                                                                M526_WaitVerticalBlank();
                                                                G1052_B_GameViewActive = C1_TRUE;
                                                                L1741_B_ = C1_TRUE;
                                                        }
                                                }
                                        } else {
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                if (M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_CAPSLOCK) && (((L1737_ps_InputEvent1->ie_Code >= 0x4C) && (L1737_ps_InputEvent1->ie_Code <= 0x4F)) || ((L1737_ps_InputEvent1->ie_Code == 0x46) || (L1737_ps_InputEvent1->ie_Code == 0x5F)))) { /* Movement keys: 0x4C to 0x4F: Arrows, 0x46 DEL, 0x5F Help */
                                                        M008_SET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_LSHIFT);
                                                }
                                                /* This switch statement 'normalizes' the data output by RawKeyConvert in G1049_auc_ANSIBytes (1 to 4 characters, the actual length is the value returned) so that it fits in an int16_t (two bytes) for easy comparisons with data in KEYBOARD_INPUT structures */
                                                switch (RawKeyConvert(L1737_ps_InputEvent1, G1049_auc_ANSIBytes, (long)sizeof(G1049_auc_ANSIBytes), NULL)) { /* Use default keymap */
                                                        case 1: /* 1 character in G1049_auc_ANSIBytes */
                                                                if (M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_NUMERICPAD)) {
                                                                        L1740_i_NormalizedKeyCode = G1049_auc_ANSIBytes[0] | 0xAB00;
                                                                } else {
                                                                        if (G1049_auc_ANSIBytes[0] == 0x7F) {
                                                                                if (M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_LSHIFT) || M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_RSHIFT)) {
                                                                                        L1740_i_NormalizedKeyCode = 0x9BFF;
                                                                                } else {
                                                                                        L1740_i_NormalizedKeyCode = 0x7F;
                                                                                }
                                                                        } else {
                                                                                L1740_i_NormalizedKeyCode = G1049_auc_ANSIBytes[0];
                                                                        }
                                                                }
                                                                break;
                                                        case 2: /* 2 characters in G1049_auc_ANSIBytes */
                                                                L1740_i_NormalizedKeyCode = (G1049_auc_ANSIBytes[0] << 8) | G1049_auc_ANSIBytes[1];
                                                                break;
                                                        case 3: /* 3 characters in G1049_auc_ANSIBytes */
                                                                if (G1049_auc_ANSIBytes[2] == '~') {
                                                                        L1740_i_NormalizedKeyCode = (G1049_auc_ANSIBytes[0] << 8) | G1049_auc_ANSIBytes[1];
                                                                } else {
                                                                        L1740_i_NormalizedKeyCode = (G1049_auc_ANSIBytes[1] + G1049_auc_ANSIBytes[2]) | (G1049_auc_ANSIBytes[0] << 8);
                                                                }
                                                                break;
                                                        case 4: /* 4 characters in G1049_auc_ANSIBytes    Function keys with shift/caps lock. BUGX_XX: MASK0x0040_UNKNOWN is added but the corresponding normalized key codes are not used in any KEYBOARD_INPUT structure if it was not added or if data was completed, then Shift F1 would have the same effect as F1, but actually has no effect in the game */
                                                                L1740_i_NormalizedKeyCode = ((G1049_auc_ANSIBytes[0] << 8) | G1049_auc_ANSIBytes[2]) | MASK0x0040_UNKNOWN;
                                                                break;
                                                }
                                                if ((L1740_i_NormalizedKeyCode == 0x9B3F) && (M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_LSHIFT) || M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_RSHIFT))) {
                                                        L1740_i_NormalizedKeyCode = 0x9B6F;
                                                }
                                                if (G1043_i_InputBufferCharacterCount < 256) {
                                                        G1045_ai_InputBufferCharacters[G1043_i_InputBufferCharacterCount] = L1740_i_NormalizedKeyCode;
                                                }
                                                if (G1043_i_InputBufferCharacterCount == 0) {
                                                        Signal(G1036_ps_Process, 1 <<  G1035_l_Signal_InputBufferNotEmpty);
                                                }
                                                G1043_i_InputBufferCharacterCount++;
#ifdef MEDIA410_A20ED
                                        }
#endif
                                }
                                Permit();
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                                                if (L1737_ps_InputEvent1->ie_Code == 0x36) { /* 'Amiga' + 'N' keys: shows a black screen with a blurred white mouse pointer */
                                                        if (GfxBase->ActiView != &G3191_ps_MsgPort_FTL_DRIA_Video->_0x032_View) {
                                                                LoadView(&G3191_ps_MsgPort_FTL_DRIA_Video->_0x032_View);
                                                                WaitTOF();
                                                                G3198_pui_PaletteColor16To31 = G3197_pui_ColorPalette;
                                                                G3199_B_UpdatePaletteColor16To31InVerticalBlank = C1_TRUE;
                                                                WaitTOF();
                                                                F1043_();
                                                                WaitTOF();
                                                                L1741_B_ = C1_TRUE;
                                                        }
                                                } else {
                                                        if (L1737_ps_InputEvent1->ie_Code == 0x37) { /* 'Amiga' + 'M' keys: show normal game screen */
                                                                if (GfxBase->ActiView != &G3191_ps_MsgPort_FTL_DRIA_Video->_0x032_View) {
                                                                        LoadView(&G3191_ps_MsgPort_FTL_DRIA_Video->_0x032_View);
                                                                        WaitTOF();
                                                                        G3198_pui_PaletteColor16To31 = G3197_pui_ColorPalette;
                                                                        G3199_B_UpdatePaletteColor16To31InVerticalBlank = C1_TRUE;
                                                                        WaitTOF();
                                                                        F1043_();
                                                                        WaitTOF();
                                                                        L1741_B_ = C1_TRUE;
                                                                }
                                                        }
                                                }
                                                break;
                                        } else {
                                                if (M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_REPEAT) || (GfxBase->ActiView != &G3191_ps_MsgPort_FTL_DRIA_Video->_0x032_View)) {
                                                        break;
                                                }
                                                if (M007_GET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_CAPSLOCK) && (((L1737_ps_InputEvent1->ie_Code >= 0x4C) && (L1737_ps_InputEvent1->ie_Code <= 0x4F)) || ((L1737_ps_InputEvent1->ie_Code == 0x46) || (L1737_ps_InputEvent1->ie_Code == 0x5F)))) { /* Movement keys: 0x4C to 0x4F: Arrows, 0x46 DEL, 0x5F Help */
                                                        M008_SET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_LSHIFT);
                                                }
                                                L2625_ui_ieQualifier = L1737_ps_InputEvent1->ie_Qualifier;
                                                M009_CLEAR(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_RCOMMAND | IEQUALIFIER_LCOMMAND | IEQUALIFIER_RALT | IEQUALIFIER_LALT | IEQUALIFIER_CONTROL);
                                                if (M007_GET(L2625_ui_ieQualifier, IEQUALIFIER_CONTROL)) {
                                                        M008_SET(L1737_ps_InputEvent1->ie_Qualifier, IEQUALIFIER_LSHIFT);
                                                }
                                                L2623_l_NormalizedKeyCode = (long)L1737_ps_InputEvent1->ie_Code << 8;
                                                L2624_i_ANSIByteCount = RawKeyConvert(L1737_ps_InputEvent1, G1049_auc_ANSIBytes, (long)sizeof(G1049_auc_ANSIBytes), NULL);
                                                if ((L2624_i_ANSIByteCount == 1) && (G1049_auc_ANSIBytes[0] >= (char)IECODE_ASCII_FIRST) && (G1049_auc_ANSIBytes[0] <= (char)IECODE_ASCII_LAST)) {
                                                        L2623_l_NormalizedKeyCode |= G1049_auc_ANSIBytes[0] & 0x00FF;
                                                }
                                                if (M007_GET(L2625_ui_ieQualifier, IEQUALIFIER_CONTROL)) {
                                                        M727_CLEAR(L2623_l_NormalizedKeyCode, IEQUALIFIER_RCOMMAND | IEQUALIFIER_LCOMMAND);
                                                        M008_SET(L2623_l_NormalizedKeyCode, IEQUALIFIER_RCOMMAND);
                                                }
                                                switch (L2623_l_NormalizedKeyCode) { /* Replace Numeric Pad key presses with movement keys */
                                                        case 0x3D37: /* Num pad 7 */
                                                                L2623_l_NormalizedKeyCode = 0x4600; /* DEL - Turn Left */
                                                                break;
                                                        case 0x3F39: /* Num pad 9 */
                                                                L2623_l_NormalizedKeyCode = 0x5F00; /* Help - Turn Right */
                                                                break;
                                                        case 0x3E38: /* Num pad 8 */
                                                                L2623_l_NormalizedKeyCode = 0x4C00; /* Arrow Up - Move Forward*/
                                                                break;
                                                        case 0x2E35: /* Num pad 5 */
                                                        case 0x1E32: /* Num pad 2 */
                                                                L2623_l_NormalizedKeyCode = 0x4D00; /* Arrow Down - Move Backward*/
                                                                break;
                                                        case 0x2D34: /* Num pad 4 */
                                                                L2623_l_NormalizedKeyCode = 0x4F00; /* Arrow Left - Move Left*/
                                                                break;
                                                        case 0x2F36: /* Num pad 6 */
                                                                L2623_l_NormalizedKeyCode = 0x4E00; /* Arrow Right - Move Right */
                                                }
                                                F1097_StoreKeyInBuffer((int16_t)L2623_l_NormalizedKeyCode);
                                                L1737_ps_InputEvent1->ie_Qualifier = L2625_ui_ieQualifier;
                                        }
                                }
#endif
                                break;
                        case IECLASS_RAWMOUSE:
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                                if (GfxBase->ActiView != &G3191_ps_MsgPort_FTL_DRIA_Video->_0x032_View) {
                                        break;
                                }
#endif
                                if (!G0597_B_IgnoreMouseMovements) {
                                        G1038_i_MouseX += L1737_ps_InputEvent1->ie_X;
                                        G1039_i_MouseY += L1737_ps_InputEvent1->ie_Y;
                                }
                                if (G1038_i_MouseX < 0) {
                                        G1038_i_MouseX = 0;
                                }
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                if (G1038_i_MouseX > 640) {
                                        G1038_i_MouseX = 640;
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                                if (G1038_i_MouseX > 639) {
                                        G1038_i_MouseX = 639;
#endif
                                }
                                if (G1039_i_MouseY < 0) {
                                        G1039_i_MouseY = 0;
                                }
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                if (G1039_i_MouseY > 400) {
                                        G1039_i_MouseY = 400;
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                                if (G1039_i_MouseY > 399) {
                                        G1039_i_MouseY = 399;
#endif
                                }
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                if (((G1038_i_MouseX >> 1) != G0589_i_MousePointerHotspotX) || ((G1039_i_MouseY >> 1) != G0590_i_MousePointerHotspotY)) {
                                        Forbid();
                                        F0073_MOUSE_BuildPointerScreenArea(G1038_i_MouseX >> 1, G1039_i_MouseY >> 1);
                                        Permit();
                                }
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                                Disable();
                                G3114_ = G1038_i_MouseX >> 1;
                                G3112_ = G1039_i_MouseY >> 1;
                                Enable();
#endif
                                switch (L1737_ps_InputEvent1->ie_Code) {
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                        case IECODE_NOBUTTON: /* 0xFF */
                                                G0588_i_MouseButtonsStatus = 0;
                                        default:
                                                break;
#endif
                                        case IECODE_LBUTTON: /* 0x68 */
#ifdef MEDIA440_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
                                                if (!G1050_B_LeftMouseButtonDown) {
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                        Forbid();
#endif
#ifdef MEDIA440_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
                                                        G1050_B_LeftMouseButtonDown = C1_TRUE;
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                        G1044_B_MouseOrKeyboardInput = C1_TRUE;
#endif
                                                        M008_SET(G0588_i_MouseButtonsStatus, MASK0x0002_MOUSE_LEFT_BUTTON);
                                                        F0359_COMMAND_ProcessClick_CPSC(G1038_i_MouseX >> 1, G1039_i_MouseY >> 1, MASK0x0002_MOUSE_LEFT_BUTTON);
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                        Permit();
#endif
#ifdef MEDIA440_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
                                                }
#endif
                                                break;
                                        case IECODE_RBUTTON: /* 0x69 */
#ifdef MEDIA440_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
                                                if (!G1051_B_RightMouseButtonDown) {
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                        Forbid();
#endif
#ifdef MEDIA440_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
                                                        G1051_B_RightMouseButtonDown = C1_TRUE;
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                        G1044_B_MouseOrKeyboardInput = C1_TRUE;
#endif
                                                        M008_SET(G0588_i_MouseButtonsStatus, MASK0x0001_MOUSE_RIGHT_BUTTON);
                                                        F0359_COMMAND_ProcessClick_CPSC(G1038_i_MouseX >> 1, G1039_i_MouseY >> 1, MASK0x0001_MOUSE_RIGHT_BUTTON);
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                        Permit();
#endif
#ifdef MEDIA440_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
                                                }
#endif
                                                break;
                                        case IECODE_LBUTTON + IECODE_UP_PREFIX: /* 0x68 + 0x80 */
#ifdef MEDIA440_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
                                                if (G1050_B_LeftMouseButtonDown == C1_TRUE) {
                                                        G1050_B_LeftMouseButtonDown = C0_FALSE;
#endif
                                                        M009_CLEAR(G0588_i_MouseButtonsStatus, MASK0x0002_MOUSE_LEFT_BUTTON);
#ifdef MEDIA433_A20E_A20F_A20G_A21E_A22E_A22G
                                                        F0544_INPUT_ResetPressingEyeOrMouth();
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                                                        F0359_COMMAND_ProcessClick_CPSC(G1038_i_MouseX >> 1, G1039_i_MouseY >> 1, MASK0x0004_MOUSE_LEFT_BUTTON_UP);
#endif
#ifdef MEDIA440_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
                                                }
                                                break;
#endif
#ifdef MEDIA410_A20ED
                                                goto T0543001;
#endif
                                        case IECODE_RBUTTON + IECODE_UP_PREFIX: /* 0x69 + 0x80 */
#ifdef MEDIA440_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
                                                if (G1051_B_RightMouseButtonDown == C1_TRUE) {
                                                        G1051_B_RightMouseButtonDown = C0_FALSE;
#endif
                                                        M009_CLEAR(G0588_i_MouseButtonsStatus, MASK0x0001_MOUSE_RIGHT_BUTTON);
#ifdef MEDIA433_A20E_A20F_A20G_A21E_A22E_A22G
                                                        F0544_INPUT_ResetPressingEyeOrMouth();
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                                                        F0359_COMMAND_ProcessClick_CPSC(G1038_i_MouseX >> 1, G1039_i_MouseY >> 1, MASK0x0008_MOUSE_RIGHT_BUTTON_UP);
#endif
#ifdef MEDIA440_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
                                                }
#endif
#ifdef MEDIA410_A20ED /* Code moved to F0544_INPUT_ResetPressingEyeOrMouth */
                                                T0543001:
                                                Forbid();
                                                if (G0331_B_PressingEye) {
                                                        G0597_B_IgnoreMouseMovements = C0_FALSE;
                                                        G0332_B_StopPressingEye = C1_TRUE;
                                                }
                                                if (G0333_B_PressingMouth) {
                                                        G0597_B_IgnoreMouseMovements = C0_FALSE;
                                                        G0334_B_StopPressingMouth = C1_TRUE;
                                                }
                                                Permit();
#endif
                                                break;
                                }
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                if (G1052_B_GameViewActive) {
                                        L1737_ps_InputEvent1->ie_Code = IECODE_NOBUTTON;
                                }
#endif
                                break;
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                        case IECLASS_DISKINSERTED:
                                F1101_DetectDiskChange();
#endif
                        default:
                                break;
                }
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                if (GfxBase->ActiView == &G3191_ps_MsgPort_FTL_DRIA_Video->_0x032_View) {
                        L1741_B_ = C1_TRUE;
                }
#endif
                if (!L1741_B_) {
                        if (L1738_ps_InputEvent2 == NULL) {
                                L1738_ps_InputEvent2 = L1739_ps_InputEvent3 = L1737_ps_InputEvent1;
                        } else {
                                L1739_ps_InputEvent3->ie_NextEvent = L1737_ps_InputEvent1;
                                L1739_ps_InputEvent3 = L1737_ps_InputEvent1;
                        }
                }
        }
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        int_end();
#endif
        return L1738_ps_InputEvent2;
}

#ifdef MEDIA433_A20E_A20F_A20G_A21E_A22E_A22G
void F0544_INPUT_ResetPressingEyeOrMouth(
)
{
        Forbid();
        if (G0331_B_PressingEye) {
                G0597_B_IgnoreMouseMovements = C0_FALSE;
                G0332_B_StopPressingEye = C1_TRUE;
        }
        if (G0333_B_PressingMouth) {
                G0597_B_IgnoreMouseMovements = C0_FALSE;
                G0334_B_StopPressingMouth = C1_TRUE;
        }
        Permit();
}
#endif

#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
void S0542_INPUT_DeviceInterruptStub(
)
{
        asm {
                movem.l d1-d7/a0-a6,-(sp)
                movea.l (a1),a5
                move.l  a0,-(sp)
                jsr     F0543_INPUT_DeviceInterruptHandler
                addq.l  #4,sp
                movem.l (sp)+,d1-d7/a0-a6
        }
}

BOOLEAN F0536_INPUT_Initialize(
)
{
        if (!G0567_B_GameAndSaveDiskUseSameDrive && (F0452_FLOPPY_GetDiskTypeInDrive_CPSB(C2_DRIVE_TYPE_SAVE_DISK) == C1_DISK_TYPE_SAVE_DISK_WRITE_ENABLED)) {
                G1038_i_MouseX = 250 * 2; /* Coordinates of Resume button on entrance screen */
                G1039_i_MouseY = 85 * 2;
        } else {
                G1038_i_MouseX = 250 * 2; /* Coordinates of Enter button on entrance screen */
                G1039_i_MouseY = 52 * 2;
        }
        Disable();
        G3114_ = G1038_i_MouseX >> 1;
        G3112_ = G1039_i_MouseY >> 1;
        Enable();
        F0008_MAIN_ClearBytes(&G3172_s_InputDeviceInterrupt, (long)sizeof(struct Interrupt));
        G3172_s_InputDeviceInterrupt.is_Data = (APTR)&G3153_puc_A5Backup;
        G3172_s_InputDeviceInterrupt.is_Code = S0542_INPUT_DeviceInterruptStub;
        G3172_s_InputDeviceInterrupt.is_Node.ln_Pri = 0x7F;
        G1034_ps_IOStdReq->io_Command = IND_ADDHANDLER;
        G1034_ps_IOStdReq->io_Length = sizeof(struct Interrupt);
        G1034_ps_IOStdReq->io_Data = (APTR)&G3172_s_InputDeviceInterrupt;
        DoIO(G1034_ps_IOStdReq);
        G3173_B_InputInitialized = C1_TRUE;
}

void F0538_INPUT_Deinitialize(
)
{
        if (G3173_B_InputInitialized) {
                G1034_ps_IOStdReq->io_Command = IND_REMHANDLER;
                G1034_ps_IOStdReq->io_Length = sizeof(struct Interrupt);
                G1034_ps_IOStdReq->io_Data = (APTR)&G3172_s_InputDeviceInterrupt;
                DoIO(G1034_ps_IOStdReq);
                G3173_B_InputInitialized = C0_FALSE;
        }
}

void F1097_StoreKeyInBuffer(P2794_)
int16_t P2794_;
{
        register int16_t L2626_i_;


        Forbid();
        if ((L2626_i_ = (G3174_i_LastKeyIndex + 1) & 0x3F) != G3175_i_FirstKeyIndex) {
                G3161_ac_Buffer724Bytes->i108_ai_InputKeyFIFOBuffer[G3174_i_LastKeyIndex] = P2794_;
                G3174_i_LastKeyIndex = L2626_i_;
        }
        Permit();
}

int16_t F1098_GetFirstKeyFromBuffer(
)
{
        register int16_t L2627_i_Key;


        Forbid();
        L2627_i_Key = G3161_ac_Buffer724Bytes->i108_ai_InputKeyFIFOBuffer[G3175_i_FirstKeyIndex++];
        G3175_i_FirstKeyIndex &= 0x3F;
        Permit();
        return L2627_i_Key;
}

BOOLEAN F1099_IsKeyBufferNotEmpty(
)
{
        register BOOLEAN L2628_B_IsKeyBufferNotEmpty;


        Forbid();
        L2628_B_IsKeyBufferNotEmpty = G3174_i_LastKeyIndex != G3175_i_FirstKeyIndex;
        Permit();
        return L2628_B_IsKeyBufferNotEmpty;
}

void F1100_Unreferenced(P2793_)
int16_t P2793_;
{
}

void F1101_DetectDiskChange(
)
{
        register long L2629_l_DiskChangeCounter;


        if (G3179_B_GameDiskChanged |= ((L2629_l_DiskChangeCounter = F1108_GetDiskChangeCounter(G0573_i_GameDiskFloppyDriveIndex)) != G3177_l_GameDiskChangeCounter)) {
                G3177_l_GameDiskChangeCounter = L2629_l_DiskChangeCounter;
        }
        if (G3180_B_SaveDiskChanged |= ((L2629_l_DiskChangeCounter = F1108_GetDiskChangeCounter(G0574_i_SaveDiskFloppyDriveIndex)) != G3178_l_SaveDiskChangeCounter)) {
                G3178_l_SaveDiskChangeCounter = L2629_l_DiskChangeCounter;
        }
}

void F1102_Unreferenced(
)
{
}
#endif
#endif
#endif
