#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA426_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M_AU1E_AU2E_AU2F_AU2G_AU3E
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
struct Interrupt* G1114_ps_Interrupt;


void F0575_VerticalBlank_Initialize(
)
{
#ifdef MEDIA433_A20E_A20F_A20G_A21E_A22E_A22G
        G1086_VerticalBlankCount = 0;
#endif
        G1114_ps_Interrupt = AllocMem((long)sizeof(struct Interrupt), MEMF_PUBLIC);
        if (G1114_ps_Interrupt == NULL) {
                Alert(0x80444DD0, 0L);
                F0507_AMIGA_DeinitializeAndInfiniteLoop();
        }
        G1114_ps_Interrupt->is_Node.ln_Type = NT_INTERRUPT;
        G1114_ps_Interrupt->is_Node.ln_Name = NULL;
        G1114_ps_Interrupt->is_Node.ln_Pri = 0;
        G1114_ps_Interrupt->is_Data = (APTR)&G0317_i_WaitForInputVerticalBlankCount;
        G1114_ps_Interrupt->is_Code = S0578_VerticalBlank_HandlerStub;
        AddIntServer(INTB_VERTB, G1114_ps_Interrupt); /* Vertical Blank */
}

void F0576_VerticalBlank_Deinitialize(
)
{
        RemIntServer(INTB_VERTB, G1114_ps_Interrupt); /* Vertical Blank */
        FreeMem(G1114_ps_Interrupt, (long)sizeof(struct Interrupt));
}

void F0577_VerticalBlank_Handler_CPSDF(
)
{
        int_start();
#ifndef NOCOPYPROTECTION
        if (!G0078_B_FuzzyBitFound_CPSF && !G0328_i_TimeBombToKillParty_CPSF) {
                F0106_DUNGEONVIEW_TestResetToStep1_CPSF();
                G0328_i_TimeBombToKillParty_CPSF += 5;
        }
        if (G0625_i_FloppyDriveDMATimeout_CPSDF < 0) { /* If there was any error while reading sector */
                G0315_i_SectorsReadFailure_CPSDF |= G0314_i_SectorsReadRequested_CPSDF;
                G0314_i_SectorsReadRequested_CPSDF = 0;
                G0625_i_FloppyDriveDMATimeout_CPSDF = 0;
        }
        if (G0625_i_FloppyDriveDMATimeout_CPSDF <= 0) {
                if (G0624_B_FloppyDriveTurnedOn_CPSDF) {
                        S0081_CPSDF_TurnOffFloppyDrive();
                }
        } else {
                S0080_CPSDF_CheckDMATransferCompletion();
        }
#endif
#ifdef MEDIA433_A20E_A20F_A20G_A21E_A22E_A22G
        G1086_VerticalBlankCount++;
#endif
        G0317_i_WaitForInputVerticalBlankCount++;
        if (G0317_i_WaitForInputVerticalBlankCount >= G0318_i_WaitForInputMaximumVerticalBlankCount) {
                G0321_B_StopWaitingForPlayerInput = C1_TRUE;
        }
        int_end();
}

#asm
_S0578_VerticalBlank_HandlerStub:
        movem.l a0-a1,-(sp)
        jsr     _F0577_VerticalBlank_Handler_CPS
        addq.l  #8,sp
        rts
#endasm
#endif
#ifdef MEDIA753_A36M_A31E_A31M_A33M_A35E_A35M_AU1E_AU2E_AU2F
extern int16_t G3283_VerticalBlankWaitCount;
extern unsigned long G1086_VerticalBlankCount;


#if ((EXETYPE == C07_HINT) || (EXETYPE == C06_CEDT))
#if (defined(MEDIA762_AU1E) && (EXETYPE == C06_CEDT))
extern int16_t G7108_BlinkingCursorTimer;
#endif
#if (EXETYPE == C07_HINT)
int16_t G7108_BlinkingCursorTimer;
#endif
long* G3860_;
int16_t* G3862_;
#endif
struct Interrupt G1114_ps_Interrupt;


int16_t F0577_VerticalBlank_Handler_CPSDF(
void
)
{
#if ((EXETYPE == C03_GAME) || (EXETYPE == C05_ANIM))
        asm {
                movem.l d1-d7/a0-a6,-(sp)
                movea.l (a1),a5
        }
#if (EXETYPE == C03_GAME)
        G0317_i_WaitForInputVerticalBlankCount++;
        asm {
                        move.w  G0317_i_WaitForInputVerticalBlankCount(a5),d0
                        cmp.w   G0318_i_WaitForInputMaximumVerticalBlankCount(a5),d0
                        bls.s   @Tloc_1498
                        move.w  #1,G0321_B_StopWaitingForPlayerInput(a5)
                @Tloc_1498:
        }
        if (G3207_B_AllowPaletteAndMessageAreaUpdatesInVerticalBlank) {
                if (G3199_B_UpdatePaletteColor16To31InVerticalBlank) {
                        asm {
                                lea     (0xDFF1A0).l,a1 /* COLOR16 Palette color 16 */
                                movea.l G3198_pui_PaletteColor16To31(a5),a0
                                move.l  (a0)+,(a1)+     /* Copy 32 bytes */
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                        }
                        G3199_B_UpdatePaletteColor16To31InVerticalBlank = C0_FALSE;
                }
                if (G3121_B_UpdateMiddleScreenPaletteInNextVerticalBlank) {
                        asm {
                                movea.l G3192_(a5),a1
                                movea.l (a1),a1
                                addq.l  #2,a1
                                movea.l G3123_PaletteSourceForMiddleScreen(a5),a0
                                move.w  (a0)+,0x00(a1)  /* Copy 16 words */
                                move.w  (a0)+,0x04(a1)
                                move.w  (a0)+,0x08(a1)
                                move.w  (a0)+,0x0C(a1)
                                move.w  (a0)+,0x10(a1)
                                move.w  (a0)+,0x14(a1)
                                move.w  (a0)+,0x18(a1)
                                move.w  (a0)+,0x1C(a1)
                                move.w  (a0)+,0x20(a1)
                                move.w  (a0)+,0x24(a1)
                                move.w  (a0)+,0x28(a1)
                                move.w  (a0)+,0x2C(a1)
                                move.w  (a0)+,0x30(a1)
                                move.w  (a0)+,0x34(a1)
                                move.w  (a0)+,0x38(a1)
                                move.w  (a0)+,0x3C(a1)
                                movea.l G3206_(a5),a1
                                movea.l G3123_PaletteSourceForMiddleScreen(a5),a0
                                move.l  (a0)+,(a1)+     /* Copy 32 bytes */
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                        }
                        G3121_B_UpdateMiddleScreenPaletteInNextVerticalBlank = C0_FALSE;
                }
                if (G3127_B_UpdateTopAndBottomScreenPaletteInNextVerticalBlank) {
                        asm {
                                movea.l G3119_pui_ColorPalette_SourceForTopAndBottomScreen(a5),a0
                                movea.l G3192_(a5),a2
                                movea.l 8(a2),a1
                                move.w  (a0),2(a1)
                                movea.l 4(a2),a1
                                addq.l  #2,a1
                                move.w  (a0)+,0x00(a1)
                                move.w  (a0)+,0x04(a1)
                                move.w  (a0)+,0x08(a1)
                                move.w  (a0)+,0x0C(a1)
                                move.w  (a0)+,0x10(a1)
                                move.w  (a0)+,0x14(a1)
                                move.w  (a0)+,0x18(a1)
                                move.w  (a0)+,0x1C(a1)
                                move.w  (a0)+,0x20(a1)
                                move.w  (a0)+,0x24(a1)
                                move.w  (a0)+,0x28(a1)
                                move.w  (a0)+,0x2C(a1)
                                move.w  (a0)+,0x30(a1)
                                move.w  (a0)+,0x34(a1)
                                move.w  (a0)+,0x38(a1)
                                move.w  (a0)+,0x3C(a1)
                                movea.l G3206_(a5),a1
                                lea     32(a1),a1
                                movea.l G3119_pui_ColorPalette_SourceForTopAndBottomScreen(a5),a0
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                lea     (0xDFF180).l,a1         /* COLOR00 Palette color 00 */
                                movea.l G3119_pui_ColorPalette_SourceForTopAndBottomScreen(a5),a0
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                                move.l  (a0)+,(a1)+
                        }
                        G3127_B_UpdateTopAndBottomScreenPaletteInNextVerticalBlank = C0_FALSE;
                }
                if (G3222_B_MessageAreaDataInitialized && !G3126_B_ViewportIsBeingBlittedToScreen) {
                        asm {
                                        tst.w   G0354_i_MessageAreaScrollingLineCount(a5)
                                        bmi     @Tloc_1654
                                        movea.l G0348_Bitmap_Screen(a5),a2
                                        movea.l a2,a3
                                        adda.w  G3216_(a5),a2
                                        adda.w  G3218_(a5),a3
                                        moveq   #3,d3
                                        moveq   #0,d4
                                        move.w  G3219_(a5),d4
                                        move.w  G3221_(a5),d5
                                @Tloc_15F8:
                                        move.l  d4,-(sp)
                                        move.l  a3,-(sp)
                                        move.l  a2,-(sp)
                                        jsr     F0007_MAIN_CopyBytes
                                        lea     0xC(sp),sp
                                        adda.w  d5,a2
                                        adda.w  d5,a3
                                        dbf     d3,@Tloc_15F8
                                        move.w  G0354_i_MessageAreaScrollingLineCount(a5),d0
                                        move.w  d0,d1
                                        mulu.w  G3214_(a5),d1
                                        movea.l G0348_Bitmap_Screen(a5),a2
                                        adda.w  G3217_(a5),a2
                                        adda.w  d1,a2
                                        movea.l G0356_puc_Bitmap_MessageAreaNewRow(a5),a3
                                        sub.w   G2187_MessageAreaHeight_Unreferenced(a5),d0
                                        neg.w   d0
                                        mulu.w  G3214_(a5),d0
                                        moveq   #0,d4
                                        move.w  d0,d4
                                        moveq   #3,d3
                                @Tloc_1636:
                                        move.l  d4,-(sp)
                                        move.l  a2,-(sp)
                                        move.l  a3,-(sp)
                                        jsr     F0007_MAIN_CopyBytes
                                        lea     0xC(sp),sp
                                        adda.w  G3221_(a5),a2
                                        adda.w  G3220_(a5),a3
                                        dbf     d3,@Tloc_1636
                                        subq.w  #1,G0354_i_MessageAreaScrollingLineCount(a5)
                                @Tloc_1654:
                        }
                        if (G0355_B_ScrollMessageArea) {
                                asm {
                                                movea.l G0348_Bitmap_Screen(a5),a2
                                                adda.w  G3217_(a5),a2
                                                movea.l G0356_puc_Bitmap_MessageAreaNewRow(a5),a3
                                                moveq   #3,d3
                                                moveq   #0,d4
                                                move.w  G3220_(a5),d4
                                        @Tloc_166E:
                                                move.l  d4,-(sp)
                                                move.l  a2,-(sp)
                                                move.l  a3,-(sp)
                                                jsr     F0007_MAIN_CopyBytes
                                                lea     0xC(sp),sp
                                                adda.w  G3221_(a5),a2
                                                adda.w  d4,a3
                                                dbf     d3,@Tloc_166E
                                }
                                G0355_B_ScrollMessageArea = C0_FALSE;
                        }
                }
        }
#ifdef MEDIA626_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
        if (G3210_WaitForCopperInterrupt_CPSX) {
                G3210_WaitForCopperInterrupt_CPSX--;
        }
        if (!G3126_B_ViewportIsBeingBlittedToScreen) {
                if (G0625_i_FloppyDriveDMATimeout_CPSDF < 0) { /* If there was any error while reading sector */
                        G0315_i_SectorsReadFailure_CPSDF |= G0314_i_SectorsReadRequested_CPSDF;
                        G0314_i_SectorsReadRequested_CPSDF = 0;
                        G0625_i_FloppyDriveDMATimeout_CPSDF = 0;
                }
                asm {
                                bgt.s   @Tloc_16BE       /* if (G0625_i_FloppyDriveDMATimeout_CPSDF <= 0) */
                                tst.w   G0624_B_FloppyDriveTurnedOn_CPSDF(a5)
                                beq.s   @Tloc_16C2
                                jsr     S0081_CPSDF_TurnOffFloppyDrive
                                bra.s   @Tloc_16C2
                        @Tloc_16BE:
                                jsr     S0080_CPSDF_CheckDMATransferCompletion
                        @Tloc_16C2:
                }
/*                if (G0625_i_FloppyDriveDMATimeout_CPSDF <= 0) {
                        if (G0624_B_FloppyDriveTurnedOn_CPSDF) {
                                S0081_CPSDF_TurnOffFloppyDrive();
                        }
                } else {
                        S0080_CPSDF_CheckDMATransferCompletion();
                }*/
        }
#endif
#endif
#endif
#if (EXETYPE == C05_ANIM)
        G1086_VerticalBlankCount++;
        if (G3283_VerticalBlankWaitCount) {
                G3283_VerticalBlankWaitCount--;
        }
#endif
        asm {
                movem.l (sp)+,d1-d7/a0-a6
        }
#endif
#if ((EXETYPE == C07_HINT) || (EXETYPE == C06_CEDT))
        asm {
                        move.l  a0,-(sp)
                        movea.l (a1)+,a0
                        addq.l  #1,(a0)         /* Increment *G3860_ */
                        movea.l (a1),a0
                        tst.w   (a0)
                        beq.s   @Tloc_7058
                        subq.w  #1,(a0)         /* Increment *G3862_ */
                @Tloc_7058:
                        movea.l (sp)+,a0
        }
#endif
        return 0;
}

void F0575_VerticalBlank_Initialize(
void
)
{
#if ((EXETYPE == C07_HINT) || (EXETYPE == C06_CEDT))
        G3860_ = &G3601_l_VerticalBlankCount;
        G3862_ = &G7108_BlinkingCursorTimer;
#endif
        G1114_ps_Interrupt.is_Node.ln_Type = NT_INTERRUPT;
#if ((EXETYPE == C03_GAME) || (EXETYPE == C05_ANIM))
        G1114_ps_Interrupt.is_Node.ln_Pri = 127;
        G1114_ps_Interrupt.is_Node.ln_Name = NULL;
        G1114_ps_Interrupt.is_Data = (APTR)&G3153_puc_A5Backup;
#endif
#if ((EXETYPE == C07_HINT) || (EXETYPE == C06_CEDT))
        G1114_ps_Interrupt.is_Node.ln_Pri = 64;
        G1114_ps_Interrupt.is_Node.ln_Name = "vblIsr";
        G1114_ps_Interrupt.is_Data = (APTR)&G3860_;
#endif
        G1114_ps_Interrupt.is_Code = F0577_VerticalBlank_Handler_CPSDF;
        AddIntServer(INTB_VERTB, &G1114_ps_Interrupt); /* Vertical Blank */
}

void F0576_VerticalBlank_Deinitialize(
void
)
{
        RemIntServer(INTB_VERTB, &G1114_ps_Interrupt); /* Vertical Blank */
}
#endif
#endif
#ifdef MEDIA772_SU1E /* SU1E\ANIMATE.FTL   SU1E\FTLCODE SU1E\CHAOS.FTL*/
#if ((EXETYPE == C05_ANIM) || (EXETYPE == C04_SWITCH))
long G1086_VerticalBlankCount;
#endif


void F1372_SetVerticalBlankInterrupt(
int16_t P4500_)
{
        long L5001_l_SupervisorStack;


        switch (P4500_) {
                case 1: /* Install custom routine */
                        asm {
                                lea     @TA5Backup,a0
                                move.l  a5,(a0)
                        }
                        L5001_l_SupervisorStack = Super(0L);
                        asm {
                                jsr     @Tloc_2A6
                        }
                        Super(L5001_l_SupervisorStack);
                        return;
                case 2: /* Uninstall custom routine */
                        L5001_l_SupervisorStack = Super(0L);
                        asm {
                                jsr     @Tloc_2B8
                        }
                        Super(L5001_l_SupervisorStack);
                        return;
#if (EXETYPE == C07_HINT)
                        L5001_l_SupervisorStack = Super(0L); /* BUGX_XX Dead code. case 3 should be here */
                        asm {
                                jsr     @Tloc_646E
                        }
                        Super(L5001_l_SupervisorStack);
                        return;
                case 3:
#endif
                default:
                        return;
        }
        asm {
                @Tloc_290:
                        move.l  a5,-(sp)
                        movea.l @TA5Backup,a5
#if ((EXETYPE == C05_ANIM) || (EXETYPE == C04_SWITCH))
                        addq.l  #1,G1086_VerticalBlankCount(a5)
#endif
#if ((EXETYPE == C06_CEDT) || (EXETYPE == C07_HINT))
                        addq.l  #1,G3601_l_VerticalBlankCount(a5)
#endif
#if (EXETYPE == C06_CEDT)
                        tst.w   G7108_BlinkingCursorTimer(a5)
                        beq.s   @Tloc_2A4
                        subq.w  #1,G7108_BlinkingCursorTimer(a5)
                @Tloc_2A4:
#endif
                        movea.l (sp)+,a5
                @Tloc_29C:
                        jmp     (0).l
                @TA5Backup:
                        dc.l 0
                @Tloc_2A6:
                        lea     (@Tloc_29C+2),a0
                        move.l  (0x70).w,(a0)
                        lea     @Tloc_290,a0
                        move.l  a0,(0x70).w
#if (EXETYPE == C07_HINT)
                        lea     @Tbyte_6488,a0
                        clr.b   (a0)
#endif
                        rts
                @Tloc_2B8:
                        lea     (@Tloc_29C+2),a0
                        move.l  (a0),(0x70).w
                        rts
#if (EXETYPE == C07_HINT)
                @Tloc_646E:
                        lea     @Tbyte_6488,a0
                        tas     (a0)
                        bne.s   @Tlocret_6486
                        lea     (@Tloc_29C+2),a0
                        lea     (@Tloc_64F2+2),a1
                        move.l  (a0),(a1)
                        lea     @Tloc_648C,a1
                        move.l  a1,(a0)
                @Tlocret_6486:
                        rts
                @Tbyte_6488:
                        dc.l 0
                @Tloc_648C:
                        movem.l d0-d1/a0/a2/a5,-(sp)
                        lea     @Tbyte_6488,a0
                        tas     (a0)
                        bne.s   @Tloc_64EE
                        lea     @Tloc_29C+2,a0
                        move.l  @Tloc_64F2+2,(a0)
                        movea.l @TA5Backup,a5
                        lea     G3720_CPSX(a5),a1
                        movea.l 8(a1),a0
                        movea.l 0xC(a1),a2
                        moveq   #0,d1
                @Tloc_64B2:
                        add.w   (a0)+,d1
                        cmpa.l  a2,a0
                        blt.s   @Tloc_64B2
                        move.w  0x18(a1),d0
                        cmp.w   d0,d1
                        beq.s   @Tloc_64C4
                        jsr     @Tloc_2B8
                @Tloc_64C4:
                        move.w  d1,0x18(a1)
                        movea.l 0x10(a1),a0
                        movea.l 0x14(a1),a2
                        move.w  0x1C(a1),d0
                        moveq   #0,d1
                @Tloc_64D6:
                        add.w   (a0)+,d1
                        cmpa.l  a2,a0
                        blt.s   @Tloc_64D6
                        cmp.w   d0,d1
                        beq.s   @Tloc_64E4
                        jsr     @Tloc_2B8
                @Tloc_64E4:
                        move.w  d1,0x1C(a1)
                        lea     @Tbyte_6488,a0
                        clr.b   (a0)
                @Tloc_64EE:
                        movem.l (sp)+,d0-d1/a0/a2/a5
                @Tloc_64F2:
                        jmp     (0).l
#endif
        }
}
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
segment "interrupts"

#ifdef MEDIA388_G20E_G21E
BOOLEAN G3976_B_;
#endif
#ifdef MEDIA349_G14ED
unsigned char* G3974_puc_;
#endif
int16_t G3973_i_;
unsigned char* G3977_puc_;
#ifdef MEDIA388_G20E_G21E
unsigned char* G3974_puc_;
#endif
int16_t G3972_i_;


asm(F2176_) {
                SEP        #0x30
                LDA        0xc023       /* VGCINT */
                AND        #0x20
                BNE        L09000B
                SEC
                RTL
        L09000B:
                LDA        #0x00
                STA        >G3972_i_
                STA        >G3972_i_+1
                LDA        #0x20
                TRB        0xc032       /* SCANINT */
                CLC
                RTL
                REP        #0x30
}

#ifdef MEDIA388_G20E_G21E
asm(F2177_) {
        L09001E_TaskHeader:
                DCL        0x00000000      /* 00 link pointer */
        L090022_TaskCount:
                DCW        0x0001          /* count */
                DCW        0xa55a          /* signature */
                REP        #0x30
                LDA        #0x01
                STA        0xffffff        /* Address replaced in F2173_ with address of L090022_TaskCount by relocation */
        L09002F:
                LDA        #C0_FALSE
                STA        >G3976_B_
                LDA        >G0317_i_WaitForInputVerticalBlankCount
                INC        A
                STA        >G0317_i_WaitForInputVerticalBlankCount
                CMP        >G0318_i_WaitForInputMaximumVerticalBlankCount
                BCC        L09004C
                LDA        #C1_TRUE
                STA        >G0321_B_StopWaitingForPlayerInput
        L09004C:
                SEP        #0x30
                RTL
                REP        #0x30
}
#endif

void F2173_(
)
{
        unsigned char* L6250_;
#ifdef MEDIA387_G20E
        int16_t L6251_;
#endif
#ifdef MEDIA388_G20E_G21E
        unsigned char* L6252_;


        asm {
                CLC
                LDA        #F2177_
                ADC        #0x0e
                STA        L6252_
                LDA        #^F2177_
                ADC        #0x00
                STA        L6252_+2
                CLC
                LDA        #F2177_
                ADC        #0x04
                STA        [L6252_]
                LDY        #0x02
                LDA        #^F2177_
                ADC        #0x00
                SEP        #0x30
                STA        [L6252_],Y
                REP        #0x30
        }
#endif
        L6250_ = (unsigned char*)F2177_;
        SetHeartBeat(L6250_);
#ifdef MEDIA388_G20E_G21E
        G3973_i_ = GetIRQEnable();
        IntSource(5);
        G3974_puc_ = GetVector(14);
        L6250_ = (unsigned char*)F2182_;
        SetVector(14, L6250_);
        IntSource(4);
#endif
}

void F2174_(
)
{
        unsigned char* L6253_;


        L6253_ = (unsigned char*)F2177_;
        DelHeartBeat(L6253_);
#ifdef MEDIA388_G20E_G21E
        IntSource(5);
        SetVector(14, G3974_puc_);
        if (G3973_i_ & 0x20) {
                IntSource(4);
        }
#endif
}

void F0693_WaitVerticalBlank(
)
{
        asm {
                        LDA        #C1_TRUE
#ifdef MEDIA349_G14ED
                        STA        >L0C0031
#endif
#ifdef MEDIA388_G20E_G21E
                        STA        >G3976_B_
#endif
                L0901B9:
#ifdef MEDIA349_G14ED
                        LDA        >L0C0031
#endif
#ifdef MEDIA388_G20E_G21E
                        LDA        >G3976_B_
#endif
                        BNE        L0901B9
        }
}

#ifdef MEDIA349_G14ED
void F2226_F2173_sub(
)
{
        unsigned char* L6453_;


        G3973_i_ = GetIRQEnable();
        IntSource(5);
        G3974_puc_ = GetVector(14);
        L6453_ = (unsigned char*)F2182_;
        SetVector(14, L6453_);
        IntSource(4);
}

void F2227_F2174_sub(
)
{
        IntSource(5);
        SetVector(14, G3974_puc_);
        if (G3973_i_ & 0x20) {
                IntSource(4);
        }
}
#endif

asm(F2178_) {
        CLC
        RTL
}

void F2175_(
)
{
        unsigned char* L6255_;
        int16_t L6254_;


        L6254_ = GetIRQEnable();
        IntSource(11);
        G3977_puc_ = GetVector(18);
        L6255_ = (unsigned char*)F2178_;
        SetVector(18, L6255_); /* Replace the 'Desk Accessory Manager' vector with an empty one. This disables access to Apple IIGS Control Panel with the OpenApple-CTRL-ESC keyboard shortcut */
        if (L6254_ & 0x04) {
                IntSource(10);
        }
}
#endif
