#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA028_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_A31E_A35E
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
overlay "start"
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
segment "start"
#endif

void F0437_STARTEND_DrawTitle(
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
void
#endif
)
{
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        REGISTER int16_t L1380_i_Counter;
        REGISTER unsigned int16_t L1381_ui_DestinationHeight;
        REGISTER int16_t L1382_i_DestinationPixelWidth;
        REGISTER unsigned char* L1384_puc_Bitmap_Title;
        REGISTER unsigned char* L1385_puc_Bitmap_LogicalScreenBase;
        REGISTER long L1383_l_Bitmap_TitleSteps;
        unsigned char* L1386_apuc_Bitmap_Screens[2]; /* Two buffers in order to use the 'double buffering' technique (display a buffer on screen while preparing the next image in the other buffer) */
        unsigned char* L1387_apuc_Bitmap_ShrinkedTitle[20]; /* Only the first 18 entries are actually used */
        unsigned char* L1388_puc_Bitmap_Temporary;
        unsigned char* L1389_puc_Bitmap_Master_StrikesBack;
        unsigned char* L1761_puc_Bitmap_Dungeon_Chaos; /* Unreferenced on Atari ST */
        char L1390_ac_Unreferenced[8]; /* BUG0_00 Useless code */
        int16_t L1391_aai_Coordinates[20][5]; /* Only the first 18 entries are actually used */
        unsigned int16_t L1392_aui_Palette[16];


        G0578_B_UseByteBoxCoordinates = C0_FALSE;
        if (G0648_l_AvailableHeapMemoryByteCount < C5004L_LZW_TEMPORARY_BUFFER_BYTE_COUNT +
                M075_BITMAP_BYTE_COUNT(320, 200) + /* Title bitmap */
                M075_BITMAP_BYTE_COUNT(320, 57)  + /* 'master' or 'strikes back' part of title bitmap */
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                M075_BITMAP_BYTE_COUNT(320, 80)  + /* 'Dungeon' or 'Chaos' part of title bitmap */
#endif
                M075_BITMAP_BYTE_COUNT(48, 12)   + /* Zoom step 0 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(64, 16)   + /* Zoom step 1 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(80, 20)   + /* Zoom step 2 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(96, 24)   + /* Zoom step 3 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(112, 28)  + /* Zoom step 4 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(128, 32)  + /* Zoom step 5 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(144, 36)  + /* Zoom step 6 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(160, 40)  + /* Zoom step 7 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(176, 44)  + /* Zoom step 8 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(192, 48)  + /* Zoom step 9 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(208, 52)  + /* Zoom step 10 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(224, 56)  + /* Zoom step 11 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(240, 60)  + /* Zoom step 12 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(256, 64)  + /* Zoom step 13 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(272, 68)  + /* Zoom step 14 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(288, 72)  + /* Zoom step 15 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(304, 76)  + /* Zoom step 16 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(320, 80)  + /* Zoom step 17 of 'Dungeon' or 'Chaos' */
                256                               /* Padding to allow memory alignment on a 256 bytes boundary. Required for the screen memory address on Atari ST */
                /* Total memory size = 133056 bytes (Atari ST) or 145856 bytes (Amiga) */
                ) {
                return;
        }
        L1383_l_Bitmap_TitleSteps = (long)F0468_MEMORY_Allocate((long)
                M075_BITMAP_BYTE_COUNT(320, 200) + /* Title bitmap */
                M075_BITMAP_BYTE_COUNT(320, 57)  + /* 'master' or 'strikes back' part of title bitmap */
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                M075_BITMAP_BYTE_COUNT(320, 80)  + /* 'Dungeon' or 'Chaos' part of title bitmap */
#endif
                M075_BITMAP_BYTE_COUNT(48, 12)   + /* Zoom step 0 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(64, 16)   + /* Zoom step 1 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(80, 20)   + /* Zoom step 2 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(96, 24)   + /* Zoom step 3 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(112, 28)  + /* Zoom step 4 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(128, 32)  + /* Zoom step 5 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(144, 36)  + /* Zoom step 6 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(160, 40)  + /* Zoom step 7 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(176, 44)  + /* Zoom step 8 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(192, 48)  + /* Zoom step 9 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(208, 52)  + /* Zoom step 10 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(224, 56)  + /* Zoom step 11 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(240, 60)  + /* Zoom step 12 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(256, 64)  + /* Zoom step 13 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(272, 68)  + /* Zoom step 14 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(288, 72)  + /* Zoom step 15 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(304, 76)  + /* Zoom step 16 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(320, 80)  + /* Zoom step 17 of 'Dungeon' or 'Chaos' */
                256                               /* Padding to allow memory alignment on a 256 bytes boundary. Required for the screen memory address on Atari ST */
                /* Total memory size = 133056 bytes (Atari ST) or 145856 bytes (Amiga) */
        , C0_ALLOCATION_TEMPORARY_ON_TOP_OF_HEAP);
        L1383_l_Bitmap_TitleSteps += 256;
        L1383_l_Bitmap_TitleSteps &= 0xFFFFFF00; /* Make sure the screen memory buffer is aligned on a 256 bytes boundary */
        F0490_MEMORY_LoadDecompressAndExpandGraphic(C001_GRAPHIC_TITLE, L1384_puc_Bitmap_Title = (unsigned char*)L1383_l_Bitmap_TitleSteps, 0, 0);
        L1383_l_Bitmap_TitleSteps += M075_BITMAP_BYTE_COUNT(320, 200);
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
        L1381_ui_DestinationHeight = 12;
        L1382_i_DestinationPixelWidth = 48;
        for (L1380_i_Counter = 0; L1380_i_Counter < 12; L1380_i_Counter++) {
                L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter] = (unsigned char*)L1383_l_Bitmap_TitleSteps;
                F0129_VIDEO_BlitShrinkWithPaletteChanges(L1384_puc_Bitmap_Title, L1383_l_Bitmap_TitleSteps, 320, 80, L1382_i_DestinationPixelWidth, L1381_ui_DestinationHeight, G0017_auc_Graphic562_PaletteChanges_NoChanges);
                M769_BOX_RIGHT(L1391_aai_Coordinates[L1380_i_Counter]) = (M768_BOX_LEFT(L1391_aai_Coordinates[L1380_i_Counter]) = (320 - L1382_i_DestinationPixelWidth) >> 1) + L1382_i_DestinationPixelWidth - 1;
                M771_BOX_BOTTOM(L1391_aai_Coordinates[L1380_i_Counter]) = (M770_BOX_TOP(L1391_aai_Coordinates[L1380_i_Counter]) = ((int16_t)(160 - L1381_ui_DestinationHeight)) >> 1) + L1381_ui_DestinationHeight - 1;
                L1383_l_Bitmap_TitleSteps += (L1391_aai_Coordinates[L1380_i_Counter][C4_SCALE] = ((L1382_i_DestinationPixelWidth + 15) >> 4) * 8) * L1381_ui_DestinationHeight;
                L1381_ui_DestinationHeight += 4;
                L1382_i_DestinationPixelWidth += 16;
        }
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        L1385_puc_Bitmap_LogicalScreenBase = L1386_apuc_Bitmap_Screens[1] = (unsigned char*)G0348_Bitmap_Screen;
        L1388_puc_Bitmap_Temporary = L1386_apuc_Bitmap_Screens[0] = L1384_puc_Bitmap_Title;
        F0010_MAIN_WriteSpacedWords(L1392_aui_Palette, 16, M501_RGB_DARK_BLUE, sizeof(int16_t));
        F0436_STARTEND_FadeToPalette(L1392_aui_Palette);
#ifdef MEDIA351_G14ED_G20E_G21E
        F2163_SetBorderColor(C02_BORDER_COLOR_DARK_BLUE);
#endif
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
        F0008_MAIN_ClearBytes(L1385_puc_Bitmap_LogicalScreenBase, M075_BITMAP_BYTE_COUNT(320, 200));
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        F0510_AMIGA_WaitBottomOfViewPort();
        F0509_AMIGA_FillScreen(C00_COLOR_BLACK);
#endif
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
        F0132_VIDEO_Blit(L1384_puc_Bitmap_Title, G0348_Bitmap_Screen, G0005_ai_Graphic562_Box_Title_Presents, 0, 137, C160_BYTE_WIDTH_SCREEN, C160_BYTE_WIDTH_SCREEN, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        F0132_VIDEO_Blit(L1384_puc_Bitmap_Title, G0348_Bitmap_Screen, G0005_ai_Graphic562_Box_Title_Presents, 0, 137, C160_BYTE_WIDTH_SCREEN, C160_BYTE_WIDTH_SCREEN, CM1_COLOR_NO_TRANSPARENCY, C200_HEIGHT_SCREEN, C200_HEIGHT_SCREEN);
#endif
        L1392_aui_Palette[15] = M509_RGB_WHITE;
        F0436_STARTEND_FadeToPalette(L1392_aui_Palette);
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
        F0132_VIDEO_Blit(L1384_puc_Bitmap_Title, L1389_puc_Bitmap_Master_StrikesBack = (unsigned char*)L1383_l_Bitmap_TitleSteps, G0004_ai_Graphic562_Box_Title_StrikesBack_Source, 0, 80, C160_BYTE_WIDTH_SCREEN, C160_BYTE_WIDTH_SCREEN, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        F0132_VIDEO_Blit(L1384_puc_Bitmap_Title, L1389_puc_Bitmap_Master_StrikesBack = (unsigned char*)L1383_l_Bitmap_TitleSteps, G0004_ai_Graphic562_Box_Title_StrikesBack_Source, 0, 80, C160_BYTE_WIDTH_SCREEN, C160_BYTE_WIDTH_SCREEN, CM1_COLOR_NO_TRANSPARENCY, 200, 57);
#endif
        L1383_l_Bitmap_TitleSteps += M075_BITMAP_BYTE_COUNT(320, 57);
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        F0132_VIDEO_Blit(L1384_puc_Bitmap_Title, L1761_puc_Bitmap_Dungeon_Chaos = (unsigned char*)L1383_l_Bitmap_TitleSteps, G1075_ai_Box_Title_Dungeon_Chaos, 0, 0, C160_BYTE_WIDTH_SCREEN, C160_BYTE_WIDTH_SCREEN, CM1_COLOR_NO_TRANSPARENCY, 200, 80);
        L1383_l_Bitmap_TitleSteps += M075_BITMAP_BYTE_COUNT(320, 80);
        L1384_puc_Bitmap_Title = L1761_puc_Bitmap_Dungeon_Chaos;
#endif
#endif
#ifdef MEDIA137_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        L1381_ui_DestinationHeight = 12;
        L1382_i_DestinationPixelWidth = 48;
        for (L1380_i_Counter = 0; L1380_i_Counter < 18; L1380_i_Counter++) {
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
        for (L1380_i_Counter = 12; L1380_i_Counter < 18; L1380_i_Counter++) {
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter] = (unsigned char*)L1383_l_Bitmap_TitleSteps;
                F0129_VIDEO_BlitShrinkWithPaletteChanges(L1384_puc_Bitmap_Title, L1383_l_Bitmap_TitleSteps, 320, 80, L1382_i_DestinationPixelWidth, L1381_ui_DestinationHeight, G0017_auc_Graphic562_PaletteChanges_NoChanges);
#ifdef MEDIA137_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                M769_BOX_RIGHT(L1391_aai_Coordinates[L1380_i_Counter]) = (M768_BOX_LEFT(L1391_aai_Coordinates[L1380_i_Counter]) = (320 - L1382_i_DestinationPixelWidth) / 2) + L1382_i_DestinationPixelWidth - 1;
                M771_BOX_BOTTOM(L1391_aai_Coordinates[L1380_i_Counter]) = (M770_BOX_TOP(L1391_aai_Coordinates[L1380_i_Counter]) = ((int16_t)(160 - L1381_ui_DestinationHeight)) / 2) + L1381_ui_DestinationHeight - 1;
                L1383_l_Bitmap_TitleSteps += (L1391_aai_Coordinates[L1380_i_Counter][C4_SCALE] = ((L1382_i_DestinationPixelWidth + 15) / 16) * 8) * L1381_ui_DestinationHeight;
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
                M769_BOX_RIGHT(L1391_aai_Coordinates[L1380_i_Counter]) = (M768_BOX_LEFT(L1391_aai_Coordinates[L1380_i_Counter]) = (320 - L1382_i_DestinationPixelWidth) >> 1) + L1382_i_DestinationPixelWidth - 1;
                M771_BOX_BOTTOM(L1391_aai_Coordinates[L1380_i_Counter]) = (M770_BOX_TOP(L1391_aai_Coordinates[L1380_i_Counter]) = ((int16_t)(160 - L1381_ui_DestinationHeight)) >> 1) + L1381_ui_DestinationHeight - 1;
                L1383_l_Bitmap_TitleSteps += (L1391_aai_Coordinates[L1380_i_Counter][C4_SCALE] = ((L1382_i_DestinationPixelWidth + 15) >> 4) * 8) * L1381_ui_DestinationHeight;
#endif
                L1381_ui_DestinationHeight += 4;
                L1382_i_DestinationPixelWidth += 16;
        }
#endif
#ifdef MEDIA137_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        L1392_aui_Palette[15] = M501_RGB_DARK_BLUE;
        F0436_STARTEND_FadeToPalette(L1392_aui_Palette);
#endif
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
        F0008_MAIN_ClearBytes(L1388_puc_Bitmap_Temporary, M075_BITMAP_BYTE_COUNT(320, 200));
        Setscreen(CM1L_NO_CHANGE, L1388_puc_Bitmap_Temporary, CM1_NO_RESOLUTION_CHANGE); /* Do not change logical screen address, change physical screen address, do not change screen mode */
        F0008_MAIN_ClearBytes(L1385_puc_Bitmap_LogicalScreenBase, M075_BITMAP_BYTE_COUNT(320, 200));
        Setscreen(CM1L_NO_CHANGE, L1385_puc_Bitmap_LogicalScreenBase, CM1_NO_RESOLUTION_CHANGE); /* Do not change logical screen address, change physical screen address, do not change screen mode */
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        F0510_AMIGA_WaitBottomOfViewPort();
        F0509_AMIGA_FillScreen(C00_COLOR_BLACK);
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
        L1392_aui_Palette[15] = M501_RGB_DARK_BLUE;
        F0436_STARTEND_FadeToPalette(L1392_aui_Palette);
        F0008_MAIN_ClearBytes(G0348_Bitmap_Screen, M075_BITMAP_BYTE_COUNT(320, 200));
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        L1392_aui_Palette[3] = M505_RGB_DARK_GOLD;
        L1392_aui_Palette[4] = M502_RGB_LIGHT_BROWN;
        L1392_aui_Palette[5] = M506_RGB_GOLD;
        L1392_aui_Palette[6] = M504_RGB_LIGHTER_BROWN;
        L1392_aui_Palette[8] = M508_RGB_YELLOW;
        L1392_aui_Palette[15] = M507_RGB_RED;
        L1392_aui_Palette[10] = M501_RGB_DARK_BLUE;
        L1392_aui_Palette[12] = M501_RGB_DARK_BLUE;
        F0436_STARTEND_FadeToPalette(L1392_aui_Palette);
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
        for (L1380_i_Counter = 0; L1380_i_Counter < 18; L1380_i_Counter++) {
                M526_WaitVerticalBlank();
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
                F0132_VIDEO_Blit(L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter], L1386_apuc_Bitmap_Screens[L1380_i_Counter & 0x0001], L1391_aai_Coordinates[L1380_i_Counter], 0, 0, L1391_aai_Coordinates[L1380_i_Counter][C4_BYTE_WIDTH], C160_BYTE_WIDTH_SCREEN, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
                F0132_VIDEO_Blit(L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter], G0348_Bitmap_Screen, L1391_aai_Coordinates[L1380_i_Counter], 0, 0, L1391_aai_Coordinates[L1380_i_Counter][C4_BYTE_WIDTH], C160_BYTE_WIDTH_SCREEN, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
                Setscreen(CM1L_NO_CHANGE, L1386_apuc_Bitmap_Screens[L1380_i_Counter & 0x0001], CM1_NO_RESOLUTION_CHANGE); /* Do not change logical screen address, change physical screen address, do not change screen mode */
#endif
        }
        M526_WaitVerticalBlank();
        M526_WaitVerticalBlank();
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        M526_WaitVerticalBlank();
        WaitBlit();
        Forbid();
        for (L1380_i_Counter = 0; L1380_i_Counter < 18; L1380_i_Counter++) {
                if (VBeamPos() >= 152) {
                        M526_WaitVerticalBlank();
                }
                while (VBeamPos() < 152);
                F0132_VIDEO_Blit(L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter], G0348_Bitmap_Screen, L1391_aai_Coordinates[L1380_i_Counter], 0, 0, L1391_aai_Coordinates[L1380_i_Counter][C4_BYTE_WIDTH], C160_BYTE_WIDTH_SCREEN, CM1_COLOR_NO_TRANSPARENCY, M771_BOX_BOTTOM(L1391_aai_Coordinates[L1380_i_Counter]) - M770_BOX_TOP(L1391_aai_Coordinates[L1380_i_Counter]) + 1, C200_HEIGHT_SCREEN);
                WaitBlit();
        }
        Permit();
        Delay(25L);
        F0510_AMIGA_WaitBottomOfViewPort();
#endif
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
        F0132_VIDEO_Blit(L1389_puc_Bitmap_Master_StrikesBack, G0348_Bitmap_Screen, G0003_ai_Graphic562_Box_Title_StrikesBack_Destination, 0, 0, C160_BYTE_WIDTH_SCREEN, C160_BYTE_WIDTH_SCREEN, C00_COLOR_BLACK);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        F0132_VIDEO_Blit(L1389_puc_Bitmap_Master_StrikesBack, G0348_Bitmap_Screen, G0003_ai_Graphic562_Box_Title_StrikesBack_Destination, 0, 0, C160_BYTE_WIDTH_SCREEN, C160_BYTE_WIDTH_SCREEN, C00_COLOR_BLACK, 57, C200_HEIGHT_SCREEN);
        WaitBlit();
#endif
        L1392_aui_Palette[10] = M500_RGB_BLACK;
#ifdef MEDIA137_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        L1392_aui_Palette[12] = M507_RGB_RED;
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
        L1392_aui_Palette[12] = 0x700; /* BUGX_XX? Color should be 0xF00 ? */
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        F0510_AMIGA_WaitBottomOfViewPort();
#endif
        F0436_STARTEND_FadeToPalette(L1392_aui_Palette);
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
        M526_WaitVerticalBlank(); /* BUG0_71 Some timings are too short on fast computers. After the zoom effect, the title screen is quickly replaced by the entrance screen on a fast computer because the execution speed is not limited */
#endif
        F0469_MEMORY_FreeAtHeapTop((long)
                M075_BITMAP_BYTE_COUNT(320, 200) + /* Title bitmap */
                M075_BITMAP_BYTE_COUNT(320, 57)  + /* 'master' or 'strikes back' part of title bitmap */
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                M075_BITMAP_BYTE_COUNT(320, 80)  + /* 'Dungeon' or 'Chaos' part of title bitmap */
#endif
                M075_BITMAP_BYTE_COUNT(48, 12)   + /* Zoom step 0 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(64, 16)   + /* Zoom step 1 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(80, 20)   + /* Zoom step 2 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(96, 24)   + /* Zoom step 3 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(112, 28)  + /* Zoom step 4 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(128, 32)  + /* Zoom step 5 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(144, 36)  + /* Zoom step 6 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(160, 40)  + /* Zoom step 7 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(176, 44)  + /* Zoom step 8 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(192, 48)  + /* Zoom step 9 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(208, 52)  + /* Zoom step 10 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(224, 56)  + /* Zoom step 11 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(240, 60)  + /* Zoom step 12 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(256, 64)  + /* Zoom step 13 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(272, 68)  + /* Zoom step 14 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(288, 72)  + /* Zoom step 15 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(304, 76)  + /* Zoom step 16 of 'Dungeon' or 'Chaos' */
                M075_BITMAP_BYTE_COUNT(320, 80)  + /* Zoom step 17 of 'Dungeon' or 'Chaos' */
                256                               /* Padding to allow memory alignment on a 256 bytes boundary. Required for the screen memory address on Atari ST */
                /* Total memory size = 133056 bytes (Atari ST) or 145856 bytes (Amiga) */
        );
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
#ifdef MEDIA488_F20E_F20J
        REGISTER unsigned char* L1384_puc_Bitmap_Title;
        REGISTER unsigned char* L1389_puc_Bitmap_Master_StrikesBack;
        REGISTER int16_t L1380_i_Counter;
        REGISTER int16_t L1382_i_DestinationPixelWidth;
        REGISTER int16_t L1381_ui_DestinationHeight;
        unsigned char* L1387_apuc_Bitmap_ShrinkedTitle[18];
        int16_t L1391_aai_Coordinates[18][4];
        REGISTER int16_t L3496_i_ActualBitmapCount;
        long L3497_l_BitmapByteCount;
#endif
#ifdef MEDIA579_X30J_P20JA_P20JB
        REGISTER unsigned char* L1384_puc_Bitmap_Title;
        REGISTER unsigned char* L1389_puc_Bitmap_Master_StrikesBack;
        REGISTER int16_t L1380_i_Counter;
        REGISTER int16_t L1382_i_DestinationPixelWidth;
        REGISTER unsigned int16_t L1381_ui_DestinationHeight;
        REGISTER int16_t L3496_i_ActualBitmapCount;
        long L3497_l_BitmapByteCount;
        unsigned char* L1387_apuc_Bitmap_ShrinkedTitle[18];
        int16_t L1391_aai_Coordinates[18][4];
#endif
#ifdef MEDIA577_X30J
        unsigned int16_t L1392_aui_Palette[16];
#endif


        L1384_puc_Bitmap_Title = F0468_MEMORY_Allocate((long)G2183_CreditsBitmapByteCount, MASK0x8000_ALLOCATE_BITMAP | C0_ALLOCATION_TEMPORARY_ON_TOP_OF_HEAP);
        F0490_MEMORY_LoadDecompressAndExpandGraphic(C001_GRAPHIC_TITLE, L1384_puc_Bitmap_Title, 0, 0);
#ifdef MEDIA489_F20E_F20J_P20JA_P20JB
        F1012_PALETTE_SetCurtain(C0_BLACK_PALETTE);
        F0694_SetMultipleColorsInPalette(C12_PRESENTS);
#endif
#ifdef MEDIA577_X30J
        F0010_MAIN_WriteSpacedWords(L1392_aui_Palette, 16, M501_RGB_DARK_BLUE, sizeof(int16_t));
        F0436_STARTEND_FadeToPalette(L1392_aui_Palette);
#endif
        M518_FillScreenBlack();
#ifdef MEDIA458_P20JA_P20JB
        F0132_VIDEO_Blit(L1384_puc_Bitmap_Title, G0348_Bitmap_Screen, G0005_ai_Graphic562_Box_Title_Presents, 0, 137, 320, G2071_C320_ScreenPixelWidth, CM1_COLOR_NO_TRANSPARENCY, MASK0x0000_NO_FLIP);
#endif
#ifdef MEDIA506_F20E_F20J_X30J
        F0132_VIDEO_Blit(L1384_puc_Bitmap_Title, G0348_Bitmap_Screen, G0005_ai_Graphic562_Box_Title_Presents, 0, 137, 320, G2071_C320_ScreenPixelWidth, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA489_F20E_F20J_P20JA_P20JB
        F1012_PALETTE_SetCurtain(C1_NORMAL_PALETTE);
#endif
#ifdef MEDIA577_X30J
        L1392_aui_Palette[15] = M509_RGB_WHITE;
        F0436_STARTEND_FadeToPalette(L1392_aui_Palette);
#endif
        L1389_puc_Bitmap_Master_StrikesBack = F0468_MEMORY_Allocate((long)M075_BITMAP_BYTE_COUNT(320, 57), C0_ALLOCATION_TEMPORARY_ON_TOP_OF_HEAP);
#ifdef MEDIA458_P20JA_P20JB
        F0132_VIDEO_Blit(L1384_puc_Bitmap_Title, L1389_puc_Bitmap_Master_StrikesBack, G0004_ai_Graphic562_Box_Title_StrikesBack_Source, 0, 80, G2071_C320_ScreenPixelWidth, 320, CM1_COLOR_NO_TRANSPARENCY, MASK0x0000_NO_FLIP);
#endif
#ifdef MEDIA506_F20E_F20J_X30J
        F0132_VIDEO_Blit(L1384_puc_Bitmap_Title, L1389_puc_Bitmap_Master_StrikesBack, G0004_ai_Graphic562_Box_Title_StrikesBack_Source, 0, 80, G2071_C320_ScreenPixelWidth, 320, CM1_COLOR_NO_TRANSPARENCY);
#endif
        L1381_ui_DestinationHeight = 80;
        L1382_i_DestinationPixelWidth = 320;
        for (L1380_i_Counter = 0; L1380_i_Counter < 18; L1380_i_Counter++) {
                L3496_i_ActualBitmapCount = L1380_i_Counter;
                L3497_l_BitmapByteCount = M103_BITMAP_BYTE_COUNT(L1382_i_DestinationPixelWidth, L1381_ui_DestinationHeight);
                if (L3497_l_BitmapByteCount + 4 > G0648_l_AvailableHeapMemoryByteCount) {
                        L3496_i_ActualBitmapCount--;
                        break;
                }
                L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter] = F0468_MEMORY_Allocate(L3497_l_BitmapByteCount, MASK0x8000_ALLOCATE_BITMAP | C0_ALLOCATION_TEMPORARY_ON_TOP_OF_HEAP);
                F0129_VIDEO_BlitShrinkWithPaletteChanges(L1384_puc_Bitmap_Title, L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter], 320, 80, M100_PIXEL_WIDTH(L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter]) = L1382_i_DestinationPixelWidth, M101_PIXEL_HEIGHT(L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter]) = L1381_ui_DestinationHeight, NULL);
                M769_BOX_RIGHT(L1391_aai_Coordinates[L1380_i_Counter]) = (M768_BOX_LEFT(L1391_aai_Coordinates[L1380_i_Counter]) = (320 - L1382_i_DestinationPixelWidth) >> 1) + L1382_i_DestinationPixelWidth - 1;
#ifdef MEDIA579_X30J_P20JA_P20JB
                M771_BOX_BOTTOM(L1391_aai_Coordinates[L1380_i_Counter]) = (M770_BOX_TOP(L1391_aai_Coordinates[L1380_i_Counter]) = ((int16_t)(160 - L1381_ui_DestinationHeight)) >> 1) + L1381_ui_DestinationHeight - 1;
#endif
#ifdef MEDIA488_F20E_F20J
                M770_BOX_TOP(L1391_aai_Coordinates[L1380_i_Counter]) = (160 - L1381_ui_DestinationHeight) >> 1;
                M771_BOX_BOTTOM(L1391_aai_Coordinates[L1380_i_Counter]) = M770_BOX_TOP(L1391_aai_Coordinates[L1380_i_Counter]) + L1381_ui_DestinationHeight - 1;
#endif
                L1381_ui_DestinationHeight -= 4;
                L1382_i_DestinationPixelWidth -= 16;
        }
#ifdef MEDIA489_F20E_F20J_P20JA_P20JB
        M518_FillScreenBlack();
        F1012_PALETTE_SetCurtain(C0_BLACK_PALETTE);
        F0694_SetMultipleColorsInPalette(C13_DUNGEON);
        F0694_SetMultipleColorsInPalette(C14_MASTER);
        F1012_PALETTE_SetCurtain(C1_NORMAL_PALETTE);
#endif
#ifdef MEDIA577_X30J
        L1392_aui_Palette[15] = M501_RGB_DARK_BLUE;
        F0436_STARTEND_FadeToPalette(L1392_aui_Palette);
        F0732_FillScreenArea(G3000_ai_Box_Screen, C00_COLOR_BLACK);
        L1392_aui_Palette[3] = M505_RGB_DARK_GOLD;
        L1392_aui_Palette[4] = M502_RGB_LIGHT_BROWN;
        L1392_aui_Palette[5] = M506_RGB_GOLD;
        L1392_aui_Palette[6] = M504_RGB_LIGHTER_BROWN;
        L1392_aui_Palette[7] = M508_RGB_YELLOW;
        L1392_aui_Palette[8] = M507_RGB_RED;
        L1392_aui_Palette[11] = M725_RGB_XXX;
        L1392_aui_Palette[15] = M509_RGB_WHITE;
        L1392_aui_Palette[10] = M501_RGB_DARK_BLUE;
        L1392_aui_Palette[12] = M501_RGB_DARK_BLUE;
        F0436_STARTEND_FadeToPalette(L1392_aui_Palette);
#endif
        for (L1380_i_Counter = L3496_i_ActualBitmapCount; L1380_i_Counter >= 0; L1380_i_Counter--) {
                M526_WaitVerticalBlank();
                F0766_BlitToScreen(L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter], L1391_aai_Coordinates[L1380_i_Counter], CM1_COLOR_NO_TRANSPARENCY);
#ifdef MEDIA579_X30J_P20JA_P20JB
                F0469_MEMORY_FreeAtHeapTop((long)F0653_GetBitmapByteCount(L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter]) + 4);
#endif
#ifdef MEDIA488_F20E_F20J
                F0469_MEMORY_FreeAtHeapTop(M103_BITMAP_BYTE_COUNT(M100_PIXEL_WIDTH(L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter]), M101_PIXEL_HEIGHT(L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter])) + 4);
#endif
        }
        M526_WaitVerticalBlank();
        M526_WaitVerticalBlank();
#ifdef MEDIA458_P20JA_P20JB
        F0132_VIDEO_Blit(L1389_puc_Bitmap_Master_StrikesBack, G0348_Bitmap_Screen, G0003_ai_Graphic562_Box_Title_StrikesBack_Destination, 0, 0, 320, G2071_C320_ScreenPixelWidth, C00_COLOR_BLACK, MASK0x0000_NO_FLIP);
#endif
#ifdef MEDIA506_F20E_F20J_X30J
        F0132_VIDEO_Blit(L1389_puc_Bitmap_Master_StrikesBack, G0348_Bitmap_Screen, G0003_ai_Graphic562_Box_Title_StrikesBack_Destination, 0, 0, 320, G2071_C320_ScreenPixelWidth, C00_COLOR_BLACK);
#endif
        F0469_MEMORY_FreeAtHeapTop((long)M075_BITMAP_BYTE_COUNT(320, 57));
#ifdef MEDIA577_X30J
        L1392_aui_Palette[10] = M501_RGB_DARK_BLUE;
        L1392_aui_Palette[12] = M726_RGB_XXX;
        F0436_STARTEND_FadeToPalette(L1392_aui_Palette);
#endif
        M526_WaitVerticalBlank();
        F0469_MEMORY_FreeAtHeapTop((long)G2183_CreditsBitmapByteCount + 4);
#endif
#ifdef MEDIA645_A31E_A35E
        int16_t L3498_i_;
        unsigned char* L1387_apuc_Bitmap_ShrinkedTitle[20];
        STRUCT2 L3499_ps_Struct2;
        REGISTER int16_t L1380_i_Counter;
        REGISTER int16_t L1382_i_DestinationPixelWidth;
        REGISTER int16_t L1381_ui_DestinationHeight;
        register int16_t L3500_i_;
        register int16_t L3501_i_;
        REGISTER unsigned char* L1384_puc_Bitmap_Title;


        L1384_puc_Bitmap_Title = F0763_LoadEndgameBitmapExpanded(C001_GRAPHIC_TITLE);
        F0632_COORD_SetNegativeBitmapPointer(CM58_NEGGRAPHIC_TITLE_PRESENTS, L1384_puc_Bitmap_Title);
        F0632_COORD_SetNegativeBitmapPointer(CM59_NEGGRAPHIC_TITLE_CHAOS, L1384_puc_Bitmap_Title);
        F0632_COORD_SetNegativeBitmapPointer(CM60_NEGGRAPHIC_TITLE_STRIKES_BACK, L1384_puc_Bitmap_Title);
        F0436_STARTEND_FadeToPalette(G3078_aui_Palette_PreTitle);
        M518_FillScreenBlack();
        F0660_(CM58_NEGGRAPHIC_TITLE_PRESENTS, C424_ZONE_TITLE_PRESENTS, CM1_COLOR_NO_TRANSPARENCY);
        F0436_STARTEND_FadeToPalette(G3079_aui_Palette_PreTitle2);
        L3498_i_ = G0317_i_WaitForInputVerticalBlankCount + 60;
        F0630_InitBitmapStruct2(CM59_NEGGRAPHIC_TITLE_CHAOS, &L3499_ps_Struct2);
        L1382_i_DestinationPixelWidth = L3499_ps_Struct2.Width;
        L1381_ui_DestinationHeight = L3499_ps_Struct2.Height;
        L3500_i_ = L1382_i_DestinationPixelWidth / 20;
        L3501_i_ = L1381_ui_DestinationHeight / 20;
        for (L1380_i_Counter = 0; L1380_i_Counter < 20; L1380_i_Counter++) {
                if (M103_BITMAP_BYTE_COUNT(L1382_i_DestinationPixelWidth, L1381_ui_DestinationHeight) + 4 > G0648_l_AvailableHeapMemoryByteCount) {
                        break;
                }
                L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter] = F0606_AllocateMemForGraphic(L1382_i_DestinationPixelWidth, L1381_ui_DestinationHeight, 0);
                if (L1380_i_Counter == 0) {
                        F0132_VIDEO_Blit(L1384_puc_Bitmap_Title, L1387_apuc_Bitmap_ShrinkedTitle[0], F0627_GetTemporaryZoneInitializedFromDimensions(L1382_i_DestinationPixelWidth, L1381_ui_DestinationHeight), L3499_ps_Struct2.X, L3499_ps_Struct2.Y, M100_PIXEL_WIDTH(L1384_puc_Bitmap_Title), L1382_i_DestinationPixelWidth, CM1_COLOR_NO_TRANSPARENCY, M101_PIXEL_HEIGHT(L1384_puc_Bitmap_Title), L1381_ui_DestinationHeight);
                } else {
                        F0129_VIDEO_BlitShrinkWithPaletteChanges(L1387_apuc_Bitmap_ShrinkedTitle[0], L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter], L3499_ps_Struct2.Width, L3499_ps_Struct2.Height, L1382_i_DestinationPixelWidth, L1381_ui_DestinationHeight, NULL);
                }
                L1382_i_DestinationPixelWidth -= L3500_i_;
                L1381_ui_DestinationHeight -= L3501_i_;
        }
        while (G0317_i_WaitForInputVerticalBlankCount < L3498_i_);
        F0436_STARTEND_FadeToPalette(G3078_aui_Palette_PreTitle);
        M518_FillScreenBlack();
        F0436_STARTEND_FadeToPalette(G3080_aui_Palette_PreTitle3);
        while (--L1380_i_Counter >= 0) {
                M526_WaitVerticalBlank();
                F0021_MAIN_BlitToScreen(L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter], C425_ZONE_TITLE_CHAOS, CM1_COLOR_NO_TRANSPARENCY);
                F0607_FreeMemForGraphic(L1387_apuc_Bitmap_ShrinkedTitle[L1380_i_Counter]);
        }
        F0022_MAIN_Delay(20);
        F0660_(CM60_NEGGRAPHIC_TITLE_STRIKES_BACK, C426_ZONE_TITLE_STRIKES_BACK, C00_COLOR_BLACK);
        F0436_STARTEND_FadeToPalette(G3081_aui_Palette_PreTitle4);
        F0022_MAIN_Delay(2);
        F0607_FreeMemForGraphic(L1384_puc_Bitmap_Title);
#endif
}
#endif
