#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA042_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
extern void F0695_SetCreatureReplacementColors(
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int P2370_i_ReplacedColor            SEPARATOR
int P2371_i_ReplacementColorSetIndex
#endif
);


#ifdef MEDIA265_S20E_S21E /* CHANGE7_04_IMPROVEMENT Additional copy protection to check if fuzzy bits detection has been disabled in CPSE. This new variable is used for an additional check to detect if code to check CPSE sector 7 reading has been disabled. It makes sure that the sector 7 reading in CPSE is checked by either F0277_CPSE_IsFuzzySectorValid_FuzzyBits or by hidden code in graphic #21 in the 500 ticks following the last event 22 */
#ifndef NOCOPYPROTECTION
int16_t G0068_i_CheckLastEvent22Time_CPSE = C00512_FALSE;
#endif
#endif
#ifdef MEDIA423_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
int16_t G1011_i_CopyProtectionCounter_CPSDF = 2;
#endif
#endif
#ifdef MEDIA001_S10EA_S10EB /* CHANGE2_00_IMPROVEMENT */
#ifndef NOCOPYPROTECTION
unsigned int16_t G0069_ui_State_CPSF = 15;
#endif
#endif
#ifdef MEDIA232_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M /* CHANGE2_00_IMPROVEMENT Status variables for CPSF are now reset each time a game is restarted in F0462_START_StartGame_CPSEF */
#ifndef NOCOPYPROTECTION
unsigned int16_t G0069_ui_State_CPSF;
#endif
#endif
#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
BOOLEAN G0070_B_FuzzySectorAnalyzed_CPSF;
BOOLEAN G0071_B_FuzzySectorReadingInitiated_CPSF;
unsigned int16_t G0072_ui_GraceReadRetryCount_CPSF;
#endif
#endif
#ifdef MEDIA315_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M /* CHANGE7_10_IMPROVEMENT Additional copy protection to check if fuzzy bits detection has been disabled in CPSF. This new variable is used for an additional check to ensure that graphic #21 is executed correctly in CPSF. If not, memory is not freed while drawing the dungeon view and the game will run out of memory */
#ifndef NOCOPYPROTECTION
int16_t G0073_i_StopFreeingMemory_CPSF = C00512_FALSE;
#endif
#endif
unsigned char* G0074_puc_Bitmap_Temporary;
#ifdef MEDIA036_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_F31E_F31J_P31J
unsigned char* G0075_apuc_PaletteChanges_Projectile[4];
#endif
BOOLEAN G0076_B_UseFlippedWallAndFootprintsBitmaps;
BOOLEAN G0077_B_DoNotDrawFluxcagesDuringEndgame;
#ifdef MEDIA749_A36M_A31E_A31M_A33M_A35E_A35M_X31J
unsigned char* G0075_apuc_PaletteChanges_Projectile[4];
#endif
#ifdef MEDIA721_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J
unsigned char* G2031_apuc_PaletteChanges_FloorOrnament[3];
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t G2154_i_ZoneShiftX;
int16_t G2155_i_ZoneShiftY;
int16_t G2032_ai_XYZ[4];
#endif
#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
BOOLEAN G0078_B_FuzzyBitFound_CPSF = C1_TRUE;
#endif
#endif
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
int16_t G0675_i_StairsNativeBitmapIndex_Up_Front_D3L;
int16_t G0676_i_StairsNativeBitmapIndex_Up_Front_D3C;
int16_t G0677_i_StairsNativeBitmapIndex_Up_Front_D2L;
int16_t G0678_i_StairsNativeBitmapIndex_Up_Front_D2C;
int16_t G0679_i_StairsNativeBitmapIndex_Up_Front_D1L;
int16_t G0680_i_StairsNativeBitmapIndex_Up_Front_D1C;
int16_t G0681_i_StairsNativeBitmapIndex_Up_Front_D0C_Left;
int16_t G0682_i_StairsNativeBitmapIndex_Down_Front_D3L;
int16_t G0683_i_StairsNativeBitmapIndex_Down_Front_D3C;
int16_t G0684_i_StairsNativeBitmapIndex_Down_Front_D2L;
int16_t G0685_i_StairsNativeBitmapIndex_Down_Front_D2C;
int16_t G0686_i_StairsNativeBitmapIndex_Down_Front_D1L;
int16_t G0687_i_StairsNativeBitmapIndex_Down_Front_D1C;
int16_t G0688_i_StairsNativeBitmapIndex_Down_Front_D0C_Left;
int16_t G0689_i_StairsNativeBitmapIndex_Side_D2L;
int16_t G0690_i_StairsNativeBitmapIndex_Up_Side_D1L;
int16_t G0691_i_StairsNativeBitmapIndex_Down_Side_D1L;
int16_t G0692_i_StairsNativeBitmapIndex_Side_D0L;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t G0079_ai_StairsNativeBitmapIndices[C018_STAIRS_GRAPHIC_COUNT];
#endif
int16_t G0693_ai_DoorNativeBitmapIndex_Front_D3LCR[2];
int16_t G0694_ai_DoorNativeBitmapIndex_Front_D2LCR[2];
int16_t G0695_ai_DoorNativeBitmapIndex_Front_D1LCR[2];
#ifdef MEDIA670_F31E_F31J
int16_t G4141_ = -1;
int16_t G4142_ = -2;
#endif
#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
int16_t G0081_ai_FuzzyBits_CPSF[32];
int16_t G0082_ai_CodePatch0_CPSF[34];
int16_t* G0083_api_Graphic21Result_CPSF[4] = {
        G0081_ai_FuzzyBits_CPSF,
        &G0070_B_FuzzySectorAnalyzed_CPSF,
        &G0078_B_FuzzyBitFound_CPSF,
#endif
#endif
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_10_IMPROVEMENT This value is never used as graphic #21 in DM only refers to the first 3 pointers in the array */
#ifndef NOCOPYPROTECTION
        &G0071_B_FuzzySectorReadingInitiated_CPSF };
#endif
#endif
#ifdef MEDIA315_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M /* CHANGE7_10_IMPROVEMENT */
#ifndef NOCOPYPROTECTION
        &G0073_i_StopFreeingMemory_CPSF };
#endif
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
unsigned char* G0084_puc_Bitmap_Floor;
unsigned char* G0085_puc_Bitmap_Ceiling;
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
unsigned char G1012_auc_Frame_Ceiling[8] = { 0, 223, 0, 28, 112, 29, 0, 0 };
unsigned char G1013_auc_Frame_Floor[8] = { 0, 223, 66, 135, 112, 70, 0, 0 };
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t G2108_Floor = -1;
int16_t G2109_Ceiling = -2;
#endif
#ifdef MEDIA506_F20E_F20J_X30J
int16_t G3072_i_WallSet_Wall_D3R2 = -6;
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
int16_t G3004_i_WallSet_Wall_D3L = -8;
int16_t G3005_i_WallSet_Wall_D3R = -9;
int16_t G3006_i_WallSet_Wall_D2L = -11;
int16_t G3007_i_WallSet_Wall_D2R = -12;
int16_t G3008_i_WallSet_Wall_D1L = -14;
int16_t G3009_i_WallSet_Wall_D1R = -15;
int16_t G3010_i_WallSet_Wall_D3L2 = -5;
int16_t G3011_i_WallSet_Wall_D3C = -7;
int16_t G3012_i_WallSet_Wall_D2C = -10;
int16_t G3013_i_WallSet_Wall_D1C = -13;
int16_t G3014_i_WallSet_Wall_D0L = -16;
int16_t G3015_i_WallSet_Wall_D0R = -17;
int16_t G2115_DoorFrameTopD2LCR = -36;
int16_t G2112_DoorFrameTopD1LCR = -39;
int16_t G2120_DoorFrameLeftD3L = -29;
int16_t G2119_DoorFrameLeftD3C = -30;
int16_t G2118_DoorFrameLeftD2C = -31;
int16_t G2117_DoorFrameLeftD1C = -32;
int16_t G2116_DoorFrameFrontD0C = -34;
int16_t G2114_DoorFrameTopD2L = -35;
int16_t G2113_DoorFrameTopD2R = -37;
int16_t G2111_DoorFrameTopD1L = -38;
int16_t G2110_DoorFrameTopD1R = -40;
#endif
#ifdef MEDIA506_F20E_F20J_X30J
int16_t G2196_DoorFrameRightD1C = -33;
int16_t G3049_i_WallSetFlipped_Wall_D3C = -18;
int16_t G3050_i_WallSetFlipped_Wall_D3L = -19;
int16_t G3051_i_WallSetFlipped_Wall_D3R = -20;
int16_t G3052_i_WallSetFlipped_Wall_D2C = -21;
int16_t G3053_i_WallSetFlipped_Wall_D2L = -22;
int16_t G3054_i_WallSetFlipped_Wall_D2R = -23;
int16_t G3055_i_WallSetFlipped_Wall_D1C = -24;
int16_t G3056_i_WallSetFlipped_Wall_D1L = -25;
int16_t G3057_i_WallSetFlipped_Wall_D1R = -26;
int16_t G3058_i_WallSetFlipped_Wall_D0L = -27;
int16_t G3059_i_WallSetFlipped_Wall_D0R = -28;
int16_t G3060_i_WallSet_Wall_D3C = -7;
int16_t G3061_i_WallSet_Wall_D3L = -8;
int16_t G3062_i_WallSet_Wall_D3R = -9;
int16_t G3063_i_WallSet_Wall_D2C = -10;
int16_t G3064_i_WallSet_Wall_D2L = -11;
int16_t G3065_i_WallSet_Wall_D2R = -12;
int16_t G3066_i_WallSet_Wall_D1C = -13;
int16_t G3067_i_WallSet_Wall_D1L = -14;
int16_t G3068_i_WallSet_Wall_D1R = -15;
int16_t G3069_i_WallSet_Wall_D0L = -16;
int16_t G3070_i_WallSet_Wall_D0R = -17;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t G2107_WallSet[15] = {
#endif
#ifdef MEDIA722_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J_P31J
        -17,  /* Wall D0R */
        -16,  /* Wall D0L */
        -15,  /* Wall D1R */
        -14,  /* Wall D1L */
        -13,  /* Wall D1C */
        -9,   /* Wall D2R2 */
        -8,   /* Wall D2L2 */
        -12,  /* Wall D2R */
        -11,  /* Wall D2L */
        -10,  /* Wall D2C */
        -4,   /* Wall D3R2 */
        -3,   /* Wall D3L2 */
        -7,   /* Wall D3R */
        -6,   /* Wall D3L */
        -5 }; /* Wall D3C */
#endif
#ifdef MEDIA670_F31E_F31J
        -19,  /* Wall D0R */
        -18,  /* Wall D0L */
        -17,  /* Wall D1R */
        -16,  /* Wall D1L */
        -15,  /* Wall D1C */
        -11,   /* Wall D2R2 */
        -10,   /* Wall D2L2 */
        -14,  /* Wall D2R */
        -13,  /* Wall D2L */
        -12,  /* Wall D2C */
        -6,   /* Wall D3R2 */
        -5,   /* Wall D3L2 */
        -9,   /* Wall D3R */
        -8,   /* Wall D3L */
        -7 }; /* Wall D3C */
#endif
#ifdef MEDIA709_I34E_I34M_P31J
int16_t G2110_DoorFrameTopD1R = -35;
int16_t G2111_DoorFrameTopD1L = -33;
int16_t G2112_DoorFrameTopD1LCR = -34;
int16_t G2113_DoorFrameTopD2R = -32;
int16_t G2114_DoorFrameTopD2L = -30;
int16_t G2115_DoorFrameTopD2LCR = -31;
int16_t G2116_DoorFrameFrontD0C = -29;
int16_t G2196_DoorFrameRightD1C = -28;
int16_t G2117_DoorFrameLeftD1C = -27;
int16_t G2118_DoorFrameLeftD2C = -26;
int16_t G2119_DoorFrameLeftD3C = -25;
int16_t G2120_DoorFrameLeftD3L = -24;
int16_t G2121_ = -22;
int16_t G2122_ = -23;
#endif
#ifdef MEDIA749_A36M_A31E_A31M_A33M_A35E_A35M_X31J
int16_t G2110_DoorFrameTopD1R = -50;
int16_t G2111_DoorFrameTopD1L = -48;
int16_t G2112_DoorFrameTopD1LCR = -49;
int16_t G2113_DoorFrameTopD2R = -47;
int16_t G2114_DoorFrameTopD2L = -45;
int16_t G2115_DoorFrameTopD2LCR = -46;
int16_t G2116_DoorFrameFrontD0C = -44;
int16_t G2196_DoorFrameRightD1C = -43;
int16_t G2117_DoorFrameLeftD1C = -42;
int16_t G2118_DoorFrameLeftD2C = -41;
int16_t G2119_DoorFrameLeftD3C = -40;
int16_t G2120_DoorFrameLeftD3L = -39;
int16_t G2121_ = -37;
int16_t G2122_ = -38;
#endif
#ifdef MEDIA670_F31E_F31J
int16_t G4151_i_Unreferenced;
int16_t G2110_DoorFrameTopD1R = -52;
int16_t G2111_DoorFrameTopD1L = -50;
int16_t G2112_DoorFrameTopD1LCR = -51;
int16_t G2113_DoorFrameTopD2R = -49;
int16_t G2114_DoorFrameTopD2L = -47;
int16_t G2115_DoorFrameTopD2LCR = -48;
int16_t G2116_DoorFrameFrontD0C = -46;
int16_t G2196_DoorFrameRightD1C = -45;
int16_t G2117_DoorFrameLeftD1C = -44;
int16_t G2118_DoorFrameLeftD2C = -43;
int16_t G2119_DoorFrameLeftD3C = -42;
int16_t G2120_DoorFrameLeftD3L = -41;
int16_t G2121_ = -39;
int16_t G2122_ = -40;
#endif
#ifdef MEDIA626_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
int16_t G0089_ai_CodePatch1_CPSF[34];
#endif
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
int16_t G3071_WallSetNotFlipped[15];
#endif
#ifdef MEDIA749_A36M_A31E_A31M_A33M_A35E_A35M_X31J
int16_t G3048_WallSetFlipped[15] = {
        -32,
        -31,
        -30,
        -29,
        -28,
        -24,
        -23,
        -27,
        -26,
        -25,
        -19,
        -18,
        -22,
        -21,
        -20 };
#endif
#ifdef MEDIA670_F31E_F31J
int16_t G3048_WallSetFlipped[17] = {
        -34,
        -33,
        -32,
        -31,
        -30,
        -26,
        -25,
        -29,
        -28,
        -27,
        -21,
        -20,
        -24,
        -23,
        -22,
        -3,
        -4 };
#endif
unsigned char* G0086_puc_Bitmap_ViewportBlackArea;
unsigned char* G0087_puc_Bitmap_ViewportFloorArea;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
unsigned char* G0696_puc_Bitmap_WallSet_Wall_D3R2;
unsigned char* G0697_puc_Bitmap_WallSet_Wall_D3L2;
unsigned char* G0698_puc_Bitmap_WallSet_Wall_D3LCR;
unsigned char* G0699_puc_Bitmap_WallSet_Wall_D2LCR;
unsigned char* G0700_puc_Bitmap_WallSet_Wall_D1LCR;
unsigned char* G0701_puc_Bitmap_WallSet_Wall_D0L;
unsigned char* G0702_puc_Bitmap_WallSet_Wall_D0R;
unsigned char* G0703_puc_Bitmap_WallSet_DoorFrameTop_D2LCR;
unsigned char* G0704_puc_Bitmap_WallSet_DoorFrameTop_D1LCR;
unsigned char* G0705_puc_Bitmap_WallSet_DoorFrameLeft_D3L;
unsigned char* G0706_puc_Bitmap_WallSet_DoorFrameLeft_D3C;
unsigned char* G0707_puc_Bitmap_WallSet_DoorFrameLeft_D2C;
unsigned char* G0708_puc_Bitmap_WallSet_DoorFrameLeft_D1C;
unsigned char* G0709_puc_Bitmap_WallSet_DoorFrameFront;
unsigned char* G0710_puc_Bitmap_WallSet_DoorFrameRight_D1C;
#ifdef MEDIA137_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
#ifndef NOCOPYPROTECTION
int16_t G0089_ai_CodePatch1_CPSF[34];
#endif
#endif
unsigned char* G0090_puc_Bitmap_WallD3LCR_Flipped;
unsigned char* G0091_puc_Bitmap_WallD2LCR_Flipped;
unsigned char* G0092_puc_Bitmap_WallD1LCR_Flipped;
unsigned char* G0093_puc_Bitmap_WallD0L_Flipped;
unsigned char* G0094_puc_Bitmap_WallD0R_Flipped;
unsigned char* G0095_puc_Bitmap_WallD3LCR_Native;
unsigned char* G0096_puc_Bitmap_WallD2LCR_Native;
unsigned char* G0097_puc_Bitmap_WallD1LCR_Native;
unsigned char* G0098_puc_Bitmap_WallD0L_Native;
unsigned char* G0099_puc_Bitmap_WallD0R_Native;
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
unsigned char* G4050_puc_Bitmap_Floor_Flipped;
unsigned char* G4051_puc_Bitmap_Ceiling_Flipped;
unsigned char* G4052_puc_Bitmap_Floor_Native;
unsigned char* G4053_puc_Bitmap_Ceiling_Native;
#endif
#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
int16_t G0100_ai_CodePatch2_CPSF[34];
#endif
#endif
ORNAMENT_INFO G0101_as_CurrentMapWallOrnamentsInfo[16];
ORNAMENT_INFO G0102_as_CurrentMapFloorOrnamentsInfo[16]; /* For each possible ornament (+ footprints): Graphic # and Coordinate set) */
ORNAMENT_INFO G0103_as_CurrentMapDoorOrnamentsInfo[17]; /* For each possible ornament (+ masks for broken door and hole in door): Graphic # and Coordinate set) */
#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
int16_t* G0104_api_CodePatches_CPSF[3] = {
        G0082_ai_CodePatch0_CPSF,
        G0089_ai_CodePatch1_CPSF,
        G0100_ai_CodePatch2_CPSF };
#endif
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
char G2026_ac_ViewSquareIndexToViewLane[23] = { 0, -1, 1, 0, -1, 1, 0, -1, 1, 254, 2, 0, -1, 1, 254, 2, 0, -1, 1, 254, 2, 253, 3 };
char G2027_ac_ViewSquareIndexToViewDepth[23] = { 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4 };
char G2028_ac_ViewSquareIndexTo[23] = { 11, -1, -1, 8, 9, 10, 5, 6, 7, -1, -1, 0, 1, 2, 3, 4, -1, -1, -1, -1, -1, -1, -1 };
char G2029_ac_ViewSquareIndexTo[23] = { -1, -1, -1, 6, -1, -1, 3, 4, 5, -1, -1, 0, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
char G2033_ac_ViewSquareIndexTo[23] = { -1, 11, 12, 8, 9, 10, 5, 6, 7, -1, -1, 0, 1, 2, 3, 4, -1, -1, -1, -1, -1, -1, -1 };
char G2034_ac_ViewSquareIndexTo[23] = { 14, 15, 16, 11, 12, 13, 8, 9, 10, -1, -1, 3, 4, 5, 6, 7, 0, 1, 2, -1, -1, -1, -1 };
char G2035_ac_ViewSquareIndexToFieldAspectIndex[23] = { 13, 14, 15, 10, 11, 12, 7, 8, 9, 5, 6, 2, 3, 4, 0, 1, -1, -1, -1, -1, -1, -1, -1 };
#endif
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
unsigned char G0105_auc_Graphic558_Box_ExplosionPattern_D0C[4]; /* This is the full dungeon view */
unsigned char G0106_auc_Graphic558_Box_ThievesEye_ViewportVisibleArea[4];
unsigned char G0107_auc_Graphic558_Box_ThievesEye_VisibleArea[4];
unsigned char G0108_auc_Graphic558_Box_ThievesEye_HoleInDoorFrame[4];
unsigned char G0109_auc_Graphic558_Box_ChampionPortraitOnWall[4];
unsigned char G0110_auc_Graphic558_Frame_StairsUpFront_D3L[8];
unsigned char G0111_auc_Graphic558_Frame_StairsUpFront_D3C[8];
unsigned char G0112_auc_Graphic558_Frame_StairsUpFront_D3R[8];
unsigned char G0113_auc_Graphic558_Frame_StairsUpFront_D2L[8];
unsigned char G0114_auc_Graphic558_Frame_StairsUpFront_D2C[8];
unsigned char G0115_auc_Graphic558_Frame_StairsUpFront_D2R[8];
unsigned char G0116_auc_Graphic558_Frame_StairsUpFront_D1L[8];
unsigned char G0117_auc_Graphic558_Frame_StairsUpFront_D1C[8];
unsigned char G0118_auc_Graphic558_Frame_StairsUpFront_D1R[8];
unsigned char G0119_auc_Graphic558_Frame_StairsUpFront_D0L[8];
unsigned char G0120_auc_Graphic558_Frame_StairsUpFront_D0R[8];
unsigned char G0121_auc_Graphic558_Frame_StairsDownFront_D3L[8];
unsigned char G0122_auc_Graphic558_Frame_StairsDownFront_D3C[8];
unsigned char G0123_auc_Graphic558_Frame_StairsDownFront_D3R[8];
unsigned char G0124_auc_Graphic558_Frame_StairsDownFront_D2L[8];
unsigned char G0125_auc_Graphic558_Frame_StairsDownFront_D2C[8];
unsigned char G0126_auc_Graphic558_Frame_StairsDownFront_D2R[8];
unsigned char G0127_auc_Graphic558_Frame_StairsDownFront_D1L[8];
unsigned char G0128_auc_Graphic558_Frame_StairsDownFront_D1C[8];
unsigned char G0129_auc_Graphic558_Frame_StairsDownFront_D1R[8];
unsigned char G0130_auc_Graphic558_Frame_StairsDownFront_D0L[8];
unsigned char G0131_auc_Graphic558_Frame_StairsDownFront_D0R[8];
unsigned char G0132_auc_Graphic558_Frame_StairsSide_D2L[8];
unsigned char G0133_auc_Graphic558_Frame_StairsSide_D2R[8];
unsigned char G0134_auc_Graphic558_Frame_StairsUpSide_D1L[8];
unsigned char G0135_auc_Graphic558_Frame_StairsUpSide_D1R[8];
unsigned char G0136_auc_Graphic558_Frame_StairsDownSide_D1L[8];
unsigned char G0137_auc_Graphic558_Frame_StairsDownSide_D1R[8];
unsigned char G0138_auc_Graphic558_Frame_StairsSide_D0L[8];
unsigned char G0139_auc_Graphic558_Frame_StairsSide_D0R[8];
unsigned char G0140_auc_Graphic558_Frame_FloorPit_D3L[8];
unsigned char G0141_auc_Graphic558_Frame_FloorPit_D3C[8];
unsigned char G0142_auc_Graphic558_Frame_FloorPit_D3R[8];
unsigned char G0143_auc_Graphic558_Frame_FloorPit_D2L[8];
unsigned char G0144_auc_Graphic558_Frame_FloorPit_D2C[8];
unsigned char G0145_auc_Graphic558_Frame_FloorPit_D2R[8];
unsigned char G0146_auc_Graphic558_Frame_FloorPit_D1L[8];
unsigned char G0147_auc_Graphic558_Frame_FloorPit_D1C[8];
unsigned char G0148_auc_Graphic558_Frame_FloorPit_D1R[8];
unsigned char G0149_auc_Graphic558_Frame_FloorPit_D0L[8];
unsigned char G0150_auc_Graphic558_Frame_FloorPit_D0C[8];
unsigned char G0151_auc_Graphic558_Frame_FloorPit_D0R[8];
unsigned char G0152_auc_Graphic558_Frame_CeilingPit_D2L[8];
unsigned char G0153_auc_Graphic558_Frame_CeilingPit_D2C[8];
unsigned char G0154_auc_Graphic558_Frame_CeilingPit_D2R[8];
unsigned char G0155_auc_Graphic558_Frame_CeilingPit_D1L[8];
unsigned char G0156_auc_Graphic558_Frame_CeilingPit_D1C[8];
unsigned char G0157_auc_Graphic558_Frame_CeilingPit_D1R[8];
unsigned char G0158_auc_Graphic558_Frame_CeilingPit_D0L[8];
unsigned char G0159_auc_Graphic558_Frame_CeilingPit_D0C[8];
unsigned char G0160_auc_Graphic558_Frame_CeilingPit_D0R[8];
unsigned char G0161_auc_Graphic558_Box_WallBitmap_D3LCR[4];
unsigned char G0162_auc_Graphic558_Box_WallBitmap_D2LCR[4];
unsigned char G0711_auc_Graphic558_Frame_Wall_D3L2[8];
unsigned char G0712_auc_Graphic558_Frame_Wall_D3R2[8];
unsigned char G0163_aauc_Graphic558_Frame_Walls[12][8];
unsigned char G0164_auc_Graphic558_Frame_DoorFrameLeft_D3L[8];
unsigned char G0165_auc_Graphic558_Frame_DoorFrameRight_D3R[8];
unsigned char G0166_auc_Graphic558_Frame_DoorFrameLeft_D3C[8];
unsigned char G0167_auc_Graphic558_Frame_DoorFrameRight_D3C[8];
unsigned char G0168_auc_Graphic558_Frame_DoorFrameLeft_D2C[8];
unsigned char G0169_auc_Graphic558_Frame_DoorFrameRight_D2C[8];
unsigned char G0170_auc_Graphic558_Frame_DoorFrameLeft_D1C[8];
unsigned char G0171_auc_Graphic558_Frame_DoorFrameRight_D1C[8];
unsigned char G0172_auc_Graphic558_Frame_DoorFrame_D0C[8];
unsigned char G0173_auc_Graphic558_Frame_DoorFrameTop_D2L[8];
unsigned char G0174_auc_Graphic558_Frame_DoorFrameTop_D2C[8];
unsigned char G0175_auc_Graphic558_Frame_DoorFrameTop_D2R[8];
unsigned char G0176_auc_Graphic558_Frame_DoorFrameTop_D1L[8];
unsigned char G0177_auc_Graphic558_Frame_DoorFrameTop_D1C[8];
unsigned char G0178_auc_Graphic558_Frame_DoorFrameTop_D1R[8];
DOOR_FRAMES G0179_s_Graphic558_Frames_Door_D3L;
DOOR_FRAMES G0180_s_Graphic558_Frames_Door_D3C;
DOOR_FRAMES G0181_s_Graphic558_Frames_Door_D3R;
DOOR_FRAMES G0182_s_Graphic558_Frames_Door_D2L;
DOOR_FRAMES G0183_s_Graphic558_Frames_Door_D2C;
DOOR_FRAMES G0184_s_Graphic558_Frames_Door_D2R;
DOOR_FRAMES G0185_s_Graphic558_Frames_Door_D1L;
DOOR_FRAMES G0186_s_Graphic558_Frames_Door_D1C;
DOOR_FRAMES G0187_s_Graphic558_Frames_Door_D1R;
unsigned char G0188_aauc_Graphic558_FieldAspects[12][8];
int16_t G0189_i_Graphic558_StopAddingEvents_CPSE; /* This variable is necessary even if NOCOPYPROTECTION is defined because a value is loaded for it from graphic #558 */
unsigned char G0190_auc_Graphic558_WallOrnamentDerivedBitmapIndexIncrement[12];
unsigned char G0191_auc_Graphic558_FloorOrnamentNativeBitmapIndexIncrements[9];
unsigned char G0192_auc_Graphic558_AlcoveOrnamentIndices[C003_ALCOVE_ORNAMENT_COUNT];
int G0193_ai_Graphic558_FountainOrnamentIndices[C001_FOUNTAIN_ORNAMENT_COUNT];
unsigned char G0194_auc_Graphic558_WallOrnamentCoordinateSetIndices[60];
unsigned char G0195_auc_Graphic558_FloorOrnamentCoordinateSetIndices[9];
unsigned char G0196_auc_Graphic558_DoorOrnamentCoordinateSetIndices[12];
unsigned char G0197_auc_Graphic558_DoorButtonCoordinateSet[1];
unsigned char G0198_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D3[16];
unsigned char G0199_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D2[16];
unsigned char G0200_auc_Graphic558_PaletteChanges_DoorOrnament_D3[16];
unsigned char G0201_auc_Graphic558_PaletteChanges_DoorOrnament_D2[16];
unsigned char G0202_auc_Graphic558_Box_WallPatchBehindInscription[4];
unsigned char G0203_auc_Graphic558_InscriptionLineY[4];
unsigned char G0204_auc_Graphic558_UnreadableInscriptionBoxY2[15];
unsigned char G0205_aaauc_Graphic558_WallOrnamentCoordinateSets[8][13][6];
unsigned char G0206_aaauc_Graphic558_FloorOrnamentCoordinateSets[3][9][6];
unsigned char G0207_aaauc_Graphic558_DoorOrnamentCoordinateSets[4][3][6];
unsigned char G0208_aaauc_Graphic558_DoorButtonCoordinateSets[1][4][6];
OBJECT_ASPECT G0209_as_Graphic558_ObjectAspects[C085_OBJECT_ASPECT_COUNT];
PROJECTIL_ASPECT G0210_as_Graphic558_ProjectileAspects[C014_PROJECTILE_ASPECT_COUNT];
EXPLOSION_ASPECT G0211_as_Graphic558_ExplosionAspects[C004_EXPLOSION_ASPECT_COUNT];
unsigned char G0212_auc_Graphic558_PaletteChanges_Smoke[16];
unsigned char G0213_auc_Graphic558_PaletteChanges_FloorOrnament_D3[16];
unsigned char G0214_auc_Graphic558_PaletteChanges_FloorOrnament_D2[16];
unsigned char G0215_auc_Graphic558_ProjectileScales[7];
unsigned char G0216_auc_Graphic558_ExplosionBaseScales[5];
unsigned char G0217_aauc_Graphic558_ObjectPileShiftSetIndices[16][2]; /* 16 pairs of X and Y shift values */
unsigned char G0218_aaaauc_Graphic558_ObjectCoordinateSets[3][10][5][2];
CREATURE_ASPECT G0219_as_Graphic558_CreatureAspects[C027_CREATURE_TYPE_COUNT];
CREATURE_REPLACEMENT_COLOR_SET G0220_as_Graphic558_CreatureReplacementColorSets[13];
/* BUG0_04 Some creatures may be drawn with unexpected colors in Dungeon Master
In the color palettes used to draw the dungeon view, two colors (9 and 10) are only used by creature graphics and each creature type can specify replacement colors to use instead of the default colors. Creature types that do not use these colors can specify that no replacement is needed. Each map in the dungeon has an associated list of allowed creature types. If multiple creatures with conflicting color replacements are allowed on the same map then each replacement color is defined by the creature type that appears the last in the list of allowed creature types. There are no such conflicts in Dungeon Master.
However, the side bitmap of 'Giant Wasp' uses color 10 but no replacement is specified. In the game, the actual color used is not the same on all maps where they are present: on map 3 the color is the one defined by 'Magenta Worm', on map 5 it is the color defined by 'Wizard Eye' and on map 10 it is the color defined by 'Water Elemental'.
All bitmaps for 'Swamp Slime' use both colors 9 and 10 but replacement is only specified for color 10. On the map where this creature is used, there are no other creatures defining color 9 so the default color is used which is appropriate. However, this color should be explicitly specified.
The front, side and attack bitmaps for 'Lord Chaos' use color 9 but no replacement is specified. On the map where this creature is used, the colors defined by the Demon are used, which are also appropriate for Lord Chaos. However, these colors should be explicitly specified. Note a unique case for Lord Chaos bitmaps in DM: the palette changes applied when drawing bitmaps at D2 change color 9 to color 10 so this color is also affected by other creatures on the map */
/* BUG7_01 Some creatures may be drawn with unexpected colors in Chaos Strikes Back
In the color palettes used to draw the dungeon view, two colors (9 and 10) are only used by creature graphics and each creature type can specify replacement colors to use instead of the default colors. Creature types that do not use these colors can specify that no replacement is needed. Each map in the dungeon has an associated list of allowed creature types. If multiple creatures with conflicting color replacements are allowed on the same map then each replacement color is defined by the creature type that appears the last in the list of allowed creature types. There are such conflicts in Chaos Strikes Back for 'Worm' which are never drawn with their 'true' colors.
All bitmaps for 'Slime Devil' use both colors 9 and 10 but replacement is only specified for color 10. On the map where this creature is used, there are no other creatures defining color 9 so the default color is used which is appropriate. However, this color should be explicitly specified.
The front, side and attack bitmaps for 'Lord Chaos' use both colors 9 and 10 but no replacements are specified. On the map where this creature is used, the colors defined by the Demon are used, which are also appropriate for Lord Chaos. However, these colors should be explicitly specified.
All bitmaps for 'Hellhound' do not use colors 9 and 10 but it specifies replacements for both, inherited from 'Pain Rat' (DM). On the map where this creature is used, none of the creatures use colors 9 and 10 so this has no consequence. However, these colors should not be specified.
All bitmaps for 'Worm' use both colors 9 and 10 and specify replacements for both colors 9 and 10 but these replacements are still for 'Magenta Worm' (DM). In the game, the actual colors used are not the same on all maps where they are present: on map 0 the colors are defined by 'Demon', on map 9 the colors are defined by 'Dragon' (same colors as 'Demon') and on map 4 color 9 is defined by 'Giant Scorpion' and color 10 is defined by 'Flying Eye'.
The front, side and attack bitmaps for 'Zytaz' use both colors 9 and 10 and specify replacements for both colors 9 and 10 but the replacements are still for the 'Materializer' (DM). They appear with other (and correct) colors in the game only because they were defined by 'Demon'. However, these colors should be explicitly specified */
unsigned char G0221_auc_Graphic558_PaletteChanges_Creature_D3[16];
unsigned char G0222_auc_Graphic558_PaletteChanges_Creature_D2[16];
char G0223_aac_Graphic558_ShiftSets[3][8];
unsigned char G0224_aaaauc_Graphic558_CreatureCoordinateSets[3][11][5][2];
int16_t G0225_aai_Graphic558_CenteredExplosionCoordinates[15][2];
int16_t G0226_aaai_Graphic558_ExplosionCoordinates[15][2][2];
int16_t G0227_aai_Graphic558_RebirthStep2ExplosionCoordinates[7][3];
int16_t G0228_aai_Graphic558_RebirthStep1ExplosionCoordinates[7][3];
int16_t G0229_i_Graphic558Anchor;
#endif
#ifdef MEDIA353_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
unsigned char G0105_auc_Graphic558_Box_ExplosionPattern_D0C[4] = { 0, 223, 0, 135 }; /* This is the full dungeon view */
unsigned char G0106_auc_Graphic558_Box_ThievesEye_ViewportVisibleArea[4] = { 64, 159, 19, 113 };
unsigned char G0107_auc_Graphic558_Box_ThievesEye_VisibleArea[4] = { 0, 95, 0, 94 };
unsigned char G0108_auc_Graphic558_Box_ThievesEye_HoleInDoorFrame[4] = { 0, 31, 19, 113 };
unsigned char G0109_auc_Graphic558_Box_ChampionPortraitOnWall[4] = { 96, 127, 35, 63 };
unsigned char G0110_auc_Graphic558_Frame_StairsUpFront_D3L[8] = { 0, 79, 25, 70, 40, 46, 0, 0 };
unsigned char G0111_auc_Graphic558_Frame_StairsUpFront_D3C[8] = { 64, 159, 25, 70, 48, 46, 0, 0 };
unsigned char G0112_auc_Graphic558_Frame_StairsUpFront_D3R[8] = { 149, 223, 25, 70, 40, 46, 5, 0 };
unsigned char G0113_auc_Graphic558_Frame_StairsUpFront_D2L[8] = { 0, 63, 22, 83, 32, 62, 0, 0 };
unsigned char G0114_auc_Graphic558_Frame_StairsUpFront_D2C[8] = { 64, 159, 22, 83, 48, 62, 0, 0 };
unsigned char G0115_auc_Graphic558_Frame_StairsUpFront_D2R[8] = { 160, 223, 22, 83, 32, 62, 0, 0 };
unsigned char G0116_auc_Graphic558_Frame_StairsUpFront_D1L[8] = { 0, 31, 9, 108, 16, 100, 0, 0 };
unsigned char G0117_auc_Graphic558_Frame_StairsUpFront_D1C[8] = { 32, 191, 9, 108, 80, 100, 0, 0 };
unsigned char G0118_auc_Graphic558_Frame_StairsUpFront_D1R[8] = { 192, 223, 9, 108, 16, 100, 0, 0 };
unsigned char G0119_auc_Graphic558_Frame_StairsUpFront_D0L[8] = { 0, 31, 58, 101, 16, 44, 0, 0 };
unsigned char G0120_auc_Graphic558_Frame_StairsUpFront_D0R[8] = { 192, 223, 58, 101, 16, 44, 0, 0 };
unsigned char G0121_auc_Graphic558_Frame_StairsDownFront_D3L[8] = { 0, 79, 28, 68, 40, 41, 0, 0 };
unsigned char G0122_auc_Graphic558_Frame_StairsDownFront_D3C[8] = { 64, 159, 28, 70, 48, 43, 0, 0 };
unsigned char G0123_auc_Graphic558_Frame_StairsDownFront_D3R[8] = { 149, 223, 28, 68, 40, 41, 5, 0 };
unsigned char G0124_auc_Graphic558_Frame_StairsDownFront_D2L[8] = { 0, 63, 24, 85, 32, 62, 0, 0 };
unsigned char G0125_auc_Graphic558_Frame_StairsDownFront_D2C[8] = { 64, 159, 24, 85, 48, 62, 0, 0 };
unsigned char G0126_auc_Graphic558_Frame_StairsDownFront_D2R[8] = { 160, 223, 24, 85, 32, 62, 0, 0 };
unsigned char G0127_auc_Graphic558_Frame_StairsDownFront_D1L[8] = { 0, 31, 18, 108, 16, 91, 0, 0 };
unsigned char G0128_auc_Graphic558_Frame_StairsDownFront_D1C[8] = { 32, 191, 18, 108, 80, 91, 0, 0 };
unsigned char G0129_auc_Graphic558_Frame_StairsDownFront_D1R[8] = { 192, 223, 18, 108, 16, 91, 0, 0 };
unsigned char G0130_auc_Graphic558_Frame_StairsDownFront_D0L[8] = { 0, 31, 76, 135, 16, 60, 0, 0 };
unsigned char G0131_auc_Graphic558_Frame_StairsDownFront_D0R[8] = { 192, 223, 76, 135, 16, 60, 0, 0 };
unsigned char G0132_auc_Graphic558_Frame_StairsSide_D2L[8] = { 60, 75, 57, 61, 8, 5, 0, 0 };
unsigned char G0133_auc_Graphic558_Frame_StairsSide_D2R[8] = { 148, 163, 57, 61, 8, 5, 0, 0 };
unsigned char G0134_auc_Graphic558_Frame_StairsUpSide_D1L[8] = { 32, 63, 57, 99, 16, 43, 0, 0 };
unsigned char G0135_auc_Graphic558_Frame_StairsUpSide_D1R[8] = { 160, 191, 57, 99, 16, 43, 0, 0 };
unsigned char G0136_auc_Graphic558_Frame_StairsDownSide_D1L[8] = { 32, 63, 60, 98, 16, 39, 0, 0 };
unsigned char G0137_auc_Graphic558_Frame_StairsDownSide_D1R[8] = { 160, 191, 60, 98, 16, 39, 0, 0 };
unsigned char G0138_auc_Graphic558_Frame_StairsSide_D0L[8] = { 0, 15, 73, 85, 8, 13, 0, 0 };
unsigned char G0139_auc_Graphic558_Frame_StairsSide_D0R[8] = { 208, 223, 73, 85, 8, 13, 0, 0 };
unsigned char G0140_auc_Graphic558_Frame_FloorPit_D3L[8] = { 0, 79, 66, 73, 40, 8, 0, 0 };
unsigned char G0141_auc_Graphic558_Frame_FloorPit_D3C[8] = { 64, 159, 66, 73, 48, 8, 0, 0 };
unsigned char G0142_auc_Graphic558_Frame_FloorPit_D3R[8] = { 144, 223, 66, 73, 40, 8, 0, 0 };
unsigned char G0143_auc_Graphic558_Frame_FloorPit_D2L[8] = { 0, 79, 77, 88, 40, 12, 0, 0 };
unsigned char G0144_auc_Graphic558_Frame_FloorPit_D2C[8] = { 64, 159, 77, 88, 48, 12, 0, 0 };
unsigned char G0145_auc_Graphic558_Frame_FloorPit_D2R[8] = { 144, 223, 77, 88, 40, 12, 0, 0 };
unsigned char G0146_auc_Graphic558_Frame_FloorPit_D1L[8] = { 0, 63, 93, 116, 32, 24, 0, 0 };
unsigned char G0147_auc_Graphic558_Frame_FloorPit_D1C[8] = { 32, 191, 93, 116, 80, 24, 0, 0 };
unsigned char G0148_auc_Graphic558_Frame_FloorPit_D1R[8] = { 160, 223, 93, 116, 32, 24, 0, 0 };
unsigned char G0149_auc_Graphic558_Frame_FloorPit_D0L[8] = { 0, 31, 124, 135, 16, 12, 0, 0 };
unsigned char G0150_auc_Graphic558_Frame_FloorPit_D0C[8] = { 16, 207, 124, 135, 96, 12, 0, 0 };
unsigned char G0151_auc_Graphic558_Frame_FloorPit_D0R[8] = { 192, 223, 124, 135, 16, 12, 0, 0 };
unsigned char G0152_auc_Graphic558_Frame_CeilingPit_D2L[8] = { 0, 79, 19, 23, 40, 5, 0, 0 };
unsigned char G0153_auc_Graphic558_Frame_CeilingPit_D2C[8] = { 64, 159, 19, 23, 48, 5, 0, 0 };
unsigned char G0154_auc_Graphic558_Frame_CeilingPit_D2R[8] = { 144, 223, 19, 23, 40, 5, 0, 0 };
unsigned char G0155_auc_Graphic558_Frame_CeilingPit_D1L[8] = { 0, 63, 8, 16, 32, 9, 0, 0 };
unsigned char G0156_auc_Graphic558_Frame_CeilingPit_D1C[8] = { 32, 191, 8, 16, 80, 9, 0, 0 };
unsigned char G0157_auc_Graphic558_Frame_CeilingPit_D1R[8] = { 160, 223, 8, 16, 32, 9, 0, 0 };
unsigned char G0158_auc_Graphic558_Frame_CeilingPit_D0L[8] = { 0, 15, 0, 3, 8, 4, 0, 0 };
unsigned char G0159_auc_Graphic558_Frame_CeilingPit_D0C[8] = { 16, 207, 0, 3, 96, 4, 0, 0 };
unsigned char G0160_auc_Graphic558_Frame_CeilingPit_D0R[8] = { 208, 223, 0, 3, 8, 4, 0, 0 };
unsigned char G0161_auc_Graphic558_Box_WallBitmap_D3LCR[4] = { 0, 115, 0, 50 };
unsigned char G0162_auc_Graphic558_Box_WallBitmap_D2LCR[4] = { 0, 135, 0, 70 };
unsigned char G0711_auc_Graphic558_Frame_Wall_D3L2[8] = {   0,  15, 25, 73, 8, 49, 0, 0 };
unsigned char G0712_auc_Graphic558_Frame_Wall_D3R2[8] = { 208, 223, 25, 73, 8, 49, 0, 0 };
unsigned char G0163_aauc_Graphic558_Frame_Walls[12][8] = {
        /* { X1, X2, Y1, Y2, ByteWidth, Height, X, Y } */
        {  74, 149, 25,  75,  64,  51,  18, 0 },   /* D3C */
        {   0,  83, 25,  75,  64,  51,  32, 0 },   /* D3L */
        { 139, 223, 25,  75,  64,  51,   0, 0 },   /* D3R */
        {  60, 163, 20,  90,  72,  71,  16, 0 },   /* D2C */
        {   0,  74, 20,  90,  72,  71,  61, 0 },   /* D2L */
        { 149, 223, 20,  90,  72,  71,   0, 0 },   /* D2R */
        {  32, 191,  9, 119, 128, 111,  48, 0 },   /* D1C */
        {   0,  63,  9, 119, 128, 111, 192, 0 },   /* D1L */
        { 160, 223,  9, 119, 128, 111,   0, 0 },   /* D1R */
        {   0, 223,  0, 135,   0,   0,   0, 0 },   /* D0C */
        {   0,  31,  0, 135,  16, 136,   0, 0 },   /* D0L */
        { 192, 223,  0, 135,  16, 136,   0, 0 } }; /* D0R */
unsigned char G0164_auc_Graphic558_Frame_DoorFrameLeft_D3L[8] = { 0, 31, 28, 70, 16, 43, 0, 0 };
unsigned char G0165_auc_Graphic558_Frame_DoorFrameRight_D3R[8] = { 192, 223, 28, 70, 16, 43, 0, 0 };
unsigned char G0166_auc_Graphic558_Frame_DoorFrameLeft_D3C[8] = { 64, 95, 27, 70, 16, 44, 0, 0 };
unsigned char G0167_auc_Graphic558_Frame_DoorFrameRight_D3C[8] = { 128, 159, 27, 70, 16, 44, 0, 0 };
unsigned char G0168_auc_Graphic558_Frame_DoorFrameLeft_D2C[8] = { 48, 95, 22, 86, 24, 65, 0, 0 };
unsigned char G0169_auc_Graphic558_Frame_DoorFrameRight_D2C[8] = { 128, 175, 22, 86, 24, 65, 0, 0 };
unsigned char G0170_auc_Graphic558_Frame_DoorFrameLeft_D1C[8] = { 43, 74, 14, 107, 16, 94, 0, 0 };
unsigned char G0171_auc_Graphic558_Frame_DoorFrameRight_D1C[8] = { 149, 180, 14, 107, 16, 94, 0, 0 };
unsigned char G0172_auc_Graphic558_Frame_DoorFrame_D0C[8] = { 96, 127, 0, 122, 16, 123, 0, 0 };
unsigned char G0173_auc_Graphic558_Frame_DoorFrameTop_D2L[8] = { 0, 59, 22, 24, 48, 3, 16, 0 };
unsigned char G0174_auc_Graphic558_Frame_DoorFrameTop_D2C[8] = { 64, 159, 22, 24, 48, 3, 0, 0 };
unsigned char G0175_auc_Graphic558_Frame_DoorFrameTop_D2R[8] = { 164, 223, 22, 24, 48, 3, 16, 0 };
unsigned char G0176_auc_Graphic558_Frame_DoorFrameTop_D1L[8] = { 0, 31, 14, 17, 64, 4, 16, 0 };
unsigned char G0177_auc_Graphic558_Frame_DoorFrameTop_D1C[8] = { 48, 175, 14, 17, 64, 4, 0, 0 };
unsigned char G0178_auc_Graphic558_Frame_DoorFrameTop_D1R[8] = { 192, 223, 14, 17, 64, 4, 16, 0 };
DOOR_FRAMES G0179_s_Graphic558_Frames_Door_D3L = {
        /* { X1, X2, Y1, Y2, ByteWidth, Height, X, Y } */
        {   24, 71, 28, 67, 24, 41,  0,  0 },     /* Closed Or Destroyed */
        { { 24, 71, 28, 38, 24, 41,  0, 30 },     /* Vertical Closed one fourth */
          { 24, 71, 28, 48, 24, 41,  0, 20 },     /* Vertical Closed half */
          { 24, 71, 28, 58, 24, 41,  0, 10 } },   /* Vertical Closed three fourth */
        { { 24, 29, 28, 67, 24, 41, 18,  0 },     /* Left Horizontal Closed one fourth */
          { 24, 35, 28, 67, 24, 41, 12,  0 },     /* Left Horizontal Closed half */
          { 24, 41, 28, 67, 24, 41,  6,  0 } },   /* Left Horizontal Closed three fourth */
        { { 66, 71, 28, 67, 24, 41, 24,  0 },     /* Right Horizontal Closed one fourth */
          { 60, 71, 28, 67, 24, 41, 24,  0 },     /* Right Horizontal Closed half */
          { 54, 71, 28, 67, 24, 41, 24,  0 } } }; /* Right Horizontal Closed three fourth */
DOOR_FRAMES G0180_s_Graphic558_Frames_Door_D3C = {
        /* { X1, X2, Y1, Y2, ByteWidth, Height, X, Y } */
        {    88, 135, 28, 67, 24, 41,  0,  0 },     /* Closed Or Destroyed */
        { {  88, 135, 28, 38, 24, 41,  0, 30 },     /* Vertical Closed one fourth */
          {  88, 135, 28, 48, 24, 41,  0, 20 },     /* Vertical Closed half */
          {  88, 135, 28, 58, 24, 41,  0, 10 } },   /* Vertical Closed three fourth */
        { {  88,  93, 28, 67, 24, 41, 18,  0 },     /* Left Horizontal Closed one fourth */
          {  88,  99, 28, 67, 24, 41, 12,  0 },     /* Left Horizontal Closed half */
          {  88, 105, 28, 67, 24, 41,  6,  0 } },   /* Left Horizontal Closed three fourth */
        { { 130, 135, 28, 67, 24, 41, 24,  0 },     /* Right Horizontal Closed one fourth */
          { 124, 135, 28, 67, 24, 41, 24,  0 },     /* Right Horizontal Closed half */
          { 118, 135, 28, 67, 24, 41, 24,  0 } } }; /* Right Horizontal Closed three fourth */
DOOR_FRAMES G0181_s_Graphic558_Frames_Door_D3R = {
        /* { X1, X2, Y1, Y2, ByteWidth, Height, X, Y } */
        {   150, 197, 28, 67, 24, 41,  0,  0 },     /* Closed Or Destroyed */
        { { 150, 197, 28, 38, 24, 41,  0, 30 },     /* Vertical Closed one fourth */
          { 150, 197, 28, 48, 24, 41,  0, 20 },     /* Vertical Closed half */
          { 150, 197, 28, 58, 24, 41,  0, 10 } },   /* Vertical Closed three fourth */
        { { 150, 153, 28, 67, 24, 41, 18,  0 },     /* Left Horizontal Closed one fourth */
          { 150, 161, 28, 67, 24, 41, 12,  0 },     /* Left Horizontal Closed half */
          { 150, 167, 28, 67, 24, 41,  6,  0 } },   /* Left Horizontal Closed three fourth */
        { { 192, 197, 28, 67, 24, 41, 24,  0 },     /* Right Horizontal Closed one fourth */
          { 186, 197, 28, 67, 24, 41, 24,  0 },     /* Right Horizontal Closed half */
          { 180, 197, 28, 67, 24, 41, 24,  0 } } }; /* Right Horizontal Closed three fourth */
DOOR_FRAMES G0182_s_Graphic558_Frames_Door_D2L = {
        /* { X1, X2, Y1, Y2, ByteWidth, Height, X, Y } */
        {    0, 63, 24, 82, 32, 61,  0,  0 },     /* Closed Or Destroyed */
        { {  0, 63, 24, 39, 32, 61,  0, 45 },     /* Vertical Closed one fourth */
          {  0, 63, 24, 54, 32, 61,  0, 30 },     /* Vertical Closed half */
          {  0, 63, 24, 69, 32, 61,  0, 15 } },   /* Vertical Closed three fourth */
        { {  0,  7, 24, 82, 32, 61, 24,  0 },     /* Left Horizontal Closed one fourth */
          {  0, 15, 24, 82, 32, 61, 16,  0 },     /* Left Horizontal Closed half */
          {  0, 23, 24, 82, 32, 61,  8,  0 } },   /* Left Horizontal Closed three fourth */
        { { 56, 63, 24, 82, 32, 61, 32,  0 },     /* Right Horizontal Closed one fourth */
          { 48, 63, 24, 82, 32, 61, 32,  0 },     /* Right Horizontal Closed half */
          { 40, 63, 24, 82, 32, 61, 32,  0 } } }; /* Right Horizontal Closed three fourth */
DOOR_FRAMES G0183_s_Graphic558_Frames_Door_D2C = {
        /* { X1, X2, Y1, Y2, ByteWidth, Height, X, Y } */
        {    80, 143, 24, 82, 32, 61,  0,  0 },     /* Closed Or Destroyed */
        { {  80, 143, 24, 39, 32, 61,  0, 45 },     /* Vertical Closed one fourth */
          {  80, 143, 24, 54, 32, 61,  0, 30 },     /* Vertical Closed half */
          {  80, 143, 24, 69, 32, 61,  0, 15 } },   /* Vertical Closed three fourth */
        { {  80,  87, 24, 82, 32, 61, 24,  0 },     /* Left Horizontal Closed one fourth */
          {  80,  95, 24, 82, 32, 61, 16,  0 },     /* Left Horizontal Closed half */
          {  80, 103, 24, 82, 32, 61,  8,  0 } },   /* Left Horizontal Closed three fourth */
        { { 136, 143, 24, 82, 32, 61, 32,  0 },     /* Right Horizontal Closed one fourth */
          { 128, 143, 24, 82, 32, 61, 32,  0 },     /* Right Horizontal Closed half */
          { 120, 143, 24, 82, 32, 61, 32,  0 } } }; /* Right Horizontal Closed three fourth */
DOOR_FRAMES G0184_s_Graphic558_Frames_Door_D2R = {
        /* { X1, X2, Y1, Y2, ByteWidth, Height, X, Y } */
        {   160, 223, 24, 82, 32, 61,  0,  0 },     /* Closed Or Destroyed */
        { { 160, 223, 24, 39, 32, 61,  0, 45 },     /* Vertical Closed one fourth */
          { 160, 223, 24, 54, 32, 61,  0, 30 },     /* Vertical Closed half */
          { 160, 223, 24, 69, 32, 61,  0, 15 } },   /* Vertical Closed three fourth */
        { { 160, 167, 24, 82, 32, 61, 24,  0 },     /* Left Horizontal Closed one fourth */
          { 160, 175, 24, 82, 32, 61, 16,  0 },     /* Left Horizontal Closed half */
          { 160, 183, 24, 82, 32, 61,  8,  0 } },   /* Left Horizontal Closed three fourth */
        { { 216, 223, 24, 82, 32, 61, 32,  0 },     /* Right Horizontal Closed one fourth */
          { 208, 223, 24, 82, 32, 61, 32,  0 },     /* Right Horizontal Closed half */
          { 200, 223, 24, 82, 32, 61, 32,  0 } } }; /* Right Horizontal Closed three fourth */
DOOR_FRAMES G0185_s_Graphic558_Frames_Door_D1L = {
        /* { X1, X2, Y1, Y2, ByteWidth, Height, X, Y } */
        {    0, 31, 17, 102, 48, 88, 64,  0 },     /* Closed Or Destroyed */
        { {  0, 31, 17,  38, 48, 88, 64, 66 },     /* Vertical Closed one fourth */
          {  0, 31, 17,  60, 48, 88, 64, 44 },     /* Vertical Closed half */
          {  0, 31, 17,  82, 48, 88, 64, 22 } },   /* Vertical Closed three fourth */
        { {  0,  0,  0,   0,  0,  0,  0,  0 },     /* Left Horizontal Closed one fourth */
          {  0,  0,  0,   0,  0,  0,  0,  0 },     /* Left Horizontal Closed half */
          {  0,  0,  0,   0,  0,  0,  0,  0 } },   /* Left Horizontal Closed three fourth */
        { { 20, 31, 17, 102, 48, 88, 48,  0 },     /* Right Horizontal Closed one fourth */
          {  8, 31, 17, 102, 48, 88, 48,  0 },     /* Right Horizontal Closed half */
          {  0, 31, 17, 102, 48, 88, 52,  0 } } }; /* Right Horizontal Closed three fourth */
DOOR_FRAMES G0186_s_Graphic558_Frames_Door_D1C = {
        /* { X1, X2, Y1, Y2, ByteWidth, Height, X, Y } */
        {    64, 159, 17, 102, 48, 88,  0,  0 },     /* Closed Or Destroyed */
        { {  64, 159, 17,  38, 48, 88,  0, 66 },     /* Vertical Closed one fourth */
          {  64, 159, 17,  60, 48, 88,  0, 44 },     /* Vertical Closed half */
          {  64, 159, 17,  82, 48, 88,  0, 22 } },   /* Vertical Closed three fourth */
        { {  64,  75, 17, 102, 48, 88, 36,  0 },     /* Left Horizontal Closed one fourth */
          {  64,  87, 17, 102, 48, 88, 24,  0 },     /* Left Horizontal Closed half */
          {  64,  99, 17, 102, 48, 88, 12,  0 } },   /* Left Horizontal Closed three fourth */
        { { 148, 159, 17, 102, 48, 88, 48,  0 },     /* Right Horizontal Closed one fourth */
          { 136, 159, 17, 102, 48, 88, 48,  0 },     /* Right Horizontal Closed half */
          { 124, 159, 17, 102, 48, 88, 48,  0 } } }; /* Right Horizontal Closed three fourth */
DOOR_FRAMES G0187_s_Graphic558_Frames_Door_D1R = {
        /* { X1, X2, Y1, Y2, ByteWidth, Height, X, Y } */
        {   192, 223, 17, 102, 48, 88,  0,  0 },     /* Closed Or Destroyed */
        { { 192, 223, 17,  38, 48, 88,  0, 66 },     /* Vertical Closed one fourth */
          { 192, 223, 17,  60, 48, 88,  0, 44 },     /* Vertical Closed half */
          { 192, 223, 17,  82, 48, 88,  0, 22 } },   /* Vertical Closed three fourth */
        { { 192, 203, 17, 102, 48, 88, 36,  0 },     /* Left Horizontal Closed one fourth */
          { 192, 215, 17, 102, 48, 88, 24,  0 },     /* Left Horizontal Closed half */
          { 192, 223, 17, 102, 48, 88, 12,  0 } },   /* Left Horizontal Closed three fourth */
        { {   0,   0,  0,   0,  0,  0,  0,  0 },     /* Right Horizontal Closed one fourth */
          {   0,   0,  0,   0,  0,  0,  0,  0 },     /* Right Horizontal Closed half */
          {   0,   0,  0,   0,  0,  0,  0,  0 } } }; /* Right Horizontal Closed three fourth */
unsigned char G0188_aauc_Graphic558_FieldAspects[12][8] = {
        /* { NativeBitmapRelativeIndex, BaseStartUnitIndex, Transparent color, Mask, ByteWidth, Height, X, BitPlaneWordCount } */
        { 0, 63, 0x8A, 0xFF,   0,   0,  0, 64 },   /* D3C */
        { 0, 63, 0x0A, 0x80,  48,  51, 11, 64 },   /* D3L */
        { 0, 63, 0x0A, 0x00,  48,  51,  0, 64 },   /* D3R */
        { 0, 60, 0x8A, 0xFF,   0,   0,  0, 64 },   /* D2C */
        { 0, 63, 0x0A, 0x81,  40,  71,  5, 64 },   /* D2L */
        { 0, 63, 0x0A, 0x01,  40,  71,  0, 64 },   /* D2R */
        { 0, 61, 0x8A, 0xFF,   0,   0,  0, 64 },   /* D1C */
        { 0, 63, 0x0A, 0x82,  32, 111,  0, 64 },   /* D1L */
        { 0, 63, 0x0A, 0x02,  32, 111,  0, 64 },   /* D1R */
        { 0, 59, 0x8A, 0xFF,   0,   0,  0, 64 },   /* D0C */
        { 0, 63, 0x0A, 0x83,  16, 136,  0, 64 },   /* D0L */
        { 0, 63, 0x0A, 0x03,  16, 136,  0, 64 } }; /* D0R */
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
unsigned char G0188_aauc_Graphic558_FieldAspects[12][8] = {
        /* { NativeBitmapRelativeIndex, BaseStartUnitIndex, Transparent color, Mask, ByteWidth, Height, X, BitPlaneWordCount } */
        { 0, 63, 0x8A, 0xFF,  76,  51,  0, 64 },   /* D3C */
        { 0, 63, 0x0A, 0x80,  84,  51, 11, 64 },   /* D3L */
        { 0, 63, 0x0A, 0x00,  85,  51,  0, 64 },   /* D3R */
        { 0, 60, 0x8A, 0xFF, 104,  71,  0, 64 },   /* D2C */
#ifdef MEDIA488_F20E_F20J
        { 0, 63, 0x0A, 0x81,  80,  71,  5, 64 },   /* D2L */
        { 0, 63, 0x0A, 0x01,  80,  71,  0, 64 },   /* D2R */
#endif
#ifdef MEDIA579_X30J_P20JA_P20JB
        { 0, 63, 0x0A, 0x81,  75,  71,  5, 64 },   /* D2L */
        { 0, 63, 0x0A, 0x01,  75,  71,  0, 64 },   /* D2R */
#endif
        { 0, 61, 0x8A, 0xFF, 160, 111,  0, 64 },   /* D1C */
        { 0, 63, 0x0A, 0x82,  59, 111,  0, 64 },   /* D1L */
        { 0, 63, 0x0A, 0x02,  59, 111,  0, 64 },   /* D1R */
        { 0, 59, 0x8A, 0xFF, 224, 136,  0, 64 },   /* D0C */
        { 0, 63, 0x0A, 0x83,  32, 136,  0, 64 },   /* D0L */
        { 0, 63, 0x0A, 0x03,  32, 136,  0, 64 } }; /* D0R */
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
unsigned char G0188_aauc_Graphic558_FieldAspects[16][8] = {
        { 0, 0x3F, 0x0A, 0x00, 0x24, 0x31, 0, 0x40 },
        { 0, 0x3F, 0x0A, 0x80, 0x24, 0x31, 0, 0x40 },
        { 0, 0x3F, 0x8A, 0xFF, 0x46, 0x31, 0, 0x40 },
        { 0, 0x3F, 0x0A, 0x01, 0x53, 0x31, 0, 0x40 },
        { 0, 0x3F, 0x0A, 0x81, 0x53, 0x31, 0, 0x40 },
        { 0, 0x3F, 0x0A, 0x02, 0x08, 0x34, 0, 0x40 },
        { 0, 0x3F, 0x0A, 0x82, 0x08, 0x34, 0, 0x40 },
        { 0, 0x3C, 0x8A, 0xFF, 0x6A, 0x4A, 0, 0x40 },
        { 0, 0x3F, 0x0A, 0x03, 0x4E, 0x4A, 0, 0x40 },
        { 0, 0x3F, 0x0A, 0x83, 0x4E, 0x4A, 0, 0x40 },
        { 0, 0x3D, 0x8A, 0xFF, 0xA0, 0x6F, 0, 0x40 },
        { 0, 0x3F, 0x0A, 0x04, 0x3C, 0x6F, 0, 0x40 },
        { 0, 0x3F, 0x0A, 0x84, 0x3C, 0x6F, 0, 0x40 },
        { 0, 0x3B, 0x8A, 0xFF, 0xE0, 0x88, 0, 0x40 },
        { 0, 0x3F, 0x0A, 0x05, 0x21, 0x88, 0, 0x40 },
        { 0, 0x3F, 0x0A, 0x85, 0x21, 0x88, 0, 0x40 } };
#endif
#ifdef MEDIA396_G20E_G21E_A20E_A20F_A20G_A21E_A22E_A22G_X30J_P20JA_P20JB_A31E_A31M_A33M_A35E_A35M_X31J /* Not included in Amiga DM DEMO 2.0 EN */
#ifndef NOCOPYPROTECTION
int16_t G0189_i_Graphic558_StopAddingEvents_CPSE = C03217_FALSE;
#endif
#endif
#ifdef MEDIA358_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
unsigned char G0190_auc_Graphic558_WallOrnamentDerivedBitmapIndexIncrement[12] = {
        0,   /* D3L Right */
        0,   /* D3R Left */
        1,   /* D3L Front */
        1,   /* D3C Front */
        1,   /* D3R Front */
        2,   /* D2L Right */
        2,   /* D2R Left */
        3,   /* D2L Front */
        3,   /* D2C Front */
        3,   /* D2R Front */
        4,   /* D1L Right */
        4 }; /* D1R Left */
unsigned char G0191_auc_Graphic558_FloorOrnamentNativeBitmapIndexIncrements[9] = {
        0,   /* D3L */
        1,   /* D3C */
        0,   /* D3R */
        2,   /* D2L */
        3,   /* D2C */
        2,   /* D2R */
        4,   /* D1L */
        5,   /* D1C */
        4 }; /* D1R */
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
unsigned char G0190_auc_Graphic558_WallOrnamentDerivedBitmapIndexIncrement[14] = {
        0,
        0,
        0,
        0,
        1,
        1,
        1,
        2,
        2,
        3,
        3,
        3,
        4,
        4 };
unsigned char G0191_auc_Graphic558_FloorOrnamentNativeBitmapIndexIncrements[11] = {
        0,
        0,
        0,
        1,
        0,
        2,
        3,
        2,
        4,
        5,
        4 };
#endif
#ifdef MEDIA365_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
unsigned char G0192_auc_Graphic558_AlcoveOrnamentIndices[C003_ALCOVE_ORNAMENT_COUNT] = {
        1,   /* Square Alcove */
        2,   /* Vi Altar */
        3 }; /* Arched Alcove */
#endif
#ifdef MEDIA362_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int G0193_ai_Graphic558_FountainOrnamentIndices[C001_FOUNTAIN_ORNAMENT_COUNT] = { 35 }; /* Fountain */
#endif
#ifdef MEDIA744_A36M
unsigned char G0193_ai_Graphic558_FountainOrnamentIndices[C001_FOUNTAIN_ORNAMENT_COUNT] = { 35 }; /* Fountain */
#endif
#ifdef MEDIA353_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
unsigned char G0194_auc_Graphic558_WallOrnamentCoordinateSetIndices[60] = {
        1,   /* Wall Ornament 00 Unreadable Inscription */
        1,   /* Wall Ornament 01 Square Alcove */
        1,   /* Wall Ornament 02 Vi Altar */
        1,   /* Wall Ornament 03 Arched Alcove */
        0,   /* Wall Ornament 04 Hook */
        0,   /* Wall Ornament 05 Iron Lock */
        0,   /* Wall Ornament 06 Wood Ring */
        0,   /* Wall Ornament 07 Small Switch */
        0,   /* Wall Ornament 08 Dent 1 */
        0,   /* Wall Ornament 09 Dent 2 */
        0,   /* Wall Ornament 10 Iron Ring */
        2,   /* Wall Ornament 11 Crack */
        3,   /* Wall Ornament 12 Slime Outlet */
        0,   /* Wall Ornament 13 Dent 3 */
        0,   /* Wall Ornament 14 Tiny Switch */
        0,   /* Wall Ornament 15 Green Switch Out */
        0,   /* Wall Ornament 16 Blue Switch Out */
        0,   /* Wall Ornament 17 Coin Slot */
        0,   /* Wall Ornament 18 Double Iron Lock */
        0,   /* Wall Ornament 19 Square Lock */
        0,   /* Wall Ornament 20 Winged Lock */
        0,   /* Wall Ornament 21 Onyx Lock */
        0,   /* Wall Ornament 22 Stone Lock */
        0,   /* Wall Ornament 23 Cross Lock */
        0,   /* Wall Ornament 24 Topaz Lock */
        0,   /* Wall Ornament 25 Skeleton Lock */
        0,   /* Wall Ornament 26 Gold Lock */
        0,   /* Wall Ornament 27 Tourquoise Lock */
        0,   /* Wall Ornament 28 Emerald Lock */
        0,   /* Wall Ornament 29 Ruby Lock */
        0,   /* Wall Ornament 30 Ra Lock */
        0,   /* Wall Ornament 31 Master Lock */
        0,   /* Wall Ornament 32 Gem Hole */
        2,   /* Wall Ornament 33 Slime */
        2,   /* Wall Ornament 34 Grate */
        1,   /* Wall Ornament 35 Fountain */
        1,   /* Wall Ornament 36 Manacles */
        1,   /* Wall Ornament 37 Ghoul's Head */
        1,   /* Wall Ornament 38 Empty Torch Holder */
        1,   /* Wall Ornament 39 Scratches */
        4,   /* Wall Ornament 40 Poison Holes */
        4,   /* Wall Ornament 41 Fireball Holes */
        4,   /* Wall Ornament 42 Dagger Holes */
        5,   /* Wall Ornament 43 Champion Mirror */
        0,   /* Wall Ornament 44 Lever Up */
        0,   /* Wall Ornament 45 Lever Down */
        1,   /* Wall Ornament 46 Full Torch Holder */
        0,   /* Wall Ornament 47 Red Switch Out */
        0,   /* Wall Ornament 48 Eye Switch */
        0,   /* Wall Ornament 49 Big Switch Out */
        2,   /* Wall Ornament 50 Crack Switch Out */
        0,   /* Wall Ornament 51 Green Switch In */
        0,   /* Wall Ornament 52 Blue Switch In */
        0,   /* Wall Ornament 53 Red Switch In */
        0,   /* Wall Ornament 54 Big Switch In */
        2,   /* Wall Ornament 55 Crack Switch In. Atari ST Version 1.0 1987-12-08: 0  */
        6,   /* Wall Ornament 56 Amalgam (Encased Gem) */
        6,   /* Wall Ornament 57 Amalgam (Free Gem) */
        6,   /* Wall Ornament 58 Amalgam (Without Gem) */
        7 }; /* Wall Ornament 59 Lord Order (Outside) */
unsigned char G0195_auc_Graphic558_FloorOrnamentCoordinateSetIndices[9] = {
        0,   /* Floor Ornament 00 Square Grate */
        0,   /* Floor Ornament 01 Square Pressure Pad */
        0,   /* Floor Ornament 02 Moss */
        0,   /* Floor Ornament 03 Round Grate */
        2,   /* Floor Ornament 04 Round Pressure Plate */
        0,   /* Floor Ornament 05 Black Flame Pit */
        0,   /* Floor Ornament 06 Crack */
        2,   /* Floor Ornament 07 Tiny Pressure Pad */
        0 }; /* Floor Ornament 08 Puddle */
unsigned char G0196_auc_Graphic558_DoorOrnamentCoordinateSetIndices[12] = {
        0,   /* Door Ornament #00 Square Grid */
        1,   /* Door Ornament #01 Iron Bars */
        1,   /* Door Ornament #02 Jewels */
        1,   /* Door Ornament #03 Wooden Bars */
        0,   /* Door Ornament #04 Arched Grid */
        2,   /* Door Ornament #05 Block Lock */
        3,   /* Door Ornament #06 Corner Lock */
        1,   /* Door Ornament #07 Black door */
        2,   /* Door Ornament #08 Red Triangle Lock */
        2,   /* Door Ornament #09 Triangle Lock */
        1,   /* Door Ornament #10 Ra Door */
        1 }; /* Door Ornament #11 Iron Door Damages */
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
unsigned char G0194_auc_Graphic558_WallOrnamentCoordinateSetIndices[60] = {
        7,
        1,
        1,
        1,
        0,
        0,
        0,
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
        0,
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        8,
#endif
        0,
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
        0,
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        8,
#endif
        0,
        2,
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
        3,
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        2,
#endif
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        2,
        2,
        1,
        1,
        1,
        1,
        1,
        4,
        4,
        4,
        5,
        0,
        0,
        1,
        0,
        0,
        0,
        2,
        0,
        0,
        0,
        0,
        2,
        6,
        6,
        6,
        6 };
unsigned char G0195_auc_Graphic558_FloorOrnamentCoordinateSetIndices[9] = {
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0 };
unsigned char G0196_auc_Graphic558_DoorOrnamentCoordinateSetIndices[12] = {
        0,
        1,
        1,
        1,
        0,
        1,
        2,
        1,
        1,
        1,
        1,
        1 };
#endif
#ifdef MEDIA365_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
unsigned char G0197_auc_Graphic558_DoorButtonCoordinateSet[1] = { 0 }; /* Door button #0 */
#endif
#ifdef MEDIA417_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_P20JA_P20JB
unsigned char G0198_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D3[16] = { 0, 0, 120, 30, 40, 30, 0, 60, 30, 90, 100, 110, 0, 10, 0, 20 };
unsigned char G0199_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D2[16] = { 0, 120, 10, 30, 40, 30, 60, 70, 50, 90, 100, 110, 0, 20, 140, 130 };
unsigned char G0200_auc_Graphic558_PaletteChanges_DoorOrnament_D3[16] = { 0, 120, 10, 30, 40, 30, 0, 60, 30, 90, 100, 110, 0, 20, 0, 130 };
unsigned char G0201_auc_Graphic558_PaletteChanges_DoorOrnament_D2[16] = { 0, 10, 20, 30, 40, 30, 60, 70, 50, 90, 100, 110, 120, 130, 140, 150 };
#endif
#ifdef MEDIA379_G14ED_G20E_G21E_X30J_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
unsigned char G0198_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D3[16] = { 0, 0, 12, 3, 4, 3, 0, 6, 3, 9, 10, 11, 0, 1, 0, 2 };
unsigned char G0199_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D2[16] = { 0, 12, 1, 3, 4, 3, 6, 7, 5, 9, 10, 11, 0, 2, 14, 13 };
unsigned char G0200_auc_Graphic558_PaletteChanges_DoorOrnament_D3[16] = { 0, 12, 1, 3, 4, 3, 0, 6, 3, 9, 10, 11, 0, 2, 0, 13 };
unsigned char G0201_auc_Graphic558_PaletteChanges_DoorOrnament_D2[16] = { 0, 1, 2, 3, 4, 3, 6, 7, 5, 9, 10, 11, 12, 13, 14, 15 };
#endif
#ifdef MEDIA353_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
unsigned char G0202_auc_Graphic558_Box_WallPatchBehindInscription[4] = { 110, 113, 37, 62 };
unsigned char G0203_auc_Graphic558_InscriptionLineY[4] = {
        48,   /* 1 Line  */
        59,   /* 2 lines */
        75,   /* 3 lines */
        86 }; /* 4 lines */
unsigned char G0204_auc_Graphic558_UnreadableInscriptionBoxY2[15] = {
        /* { Y for 1 line, Y for 2 lines, Y for 3 lines } */
        45, 48, 53,   /* D3L Right, D3R Left */
        43, 49, 56,   /* D3L Front, D3C Front, D3R Front */
        42, 49, 56,   /* D2L Right, D2R Left */
        46, 53, 63,   /* D2L Front, D2C Front, D2R Front */
        46, 57, 68 }; /* D1L Right, D1R Left */
unsigned char G0205_aaauc_Graphic558_WallOrnamentCoordinateSets[8][13][6] = {
        /* { X1, X2, Y1, Y2, ByteWidth, Height } */
        { {  80,  83, 41,  45,  8,   5 },     /* D3L */
          { 140, 143, 41,  45,  8,   5 },     /* D3R */
          {  16,  29, 39,  50,  8,  12 },     /* D3L */
          { 107, 120, 39,  50,  8,  12 },     /* D3C */
          { 187, 200, 39,  50,  8,  12 },     /* D3R */
          {  67,  77, 40,  49,  8,  10 },     /* D2L */
          { 146, 156, 40,  49,  8,  10 },     /* D2R */
          {   0,  17, 38,  55, 16,  18 },     /* D2L */
          { 102, 123, 38,  55, 16,  18 },     /* D2C */
          { 206, 223, 38,  55, 16,  18 },     /* D2R */
          {  48,  63, 38,  56,  8,  19 },     /* D1L */
          { 160, 175, 38,  56,  8,  19 },     /* D1R */
          {  96, 127, 36,  63, 16,  28 } },   /* D1C */
        { {  74,  82, 41,  60,  8,  20 },     /* D3L */
          { 141, 149, 41,  60,  8,  20 },     /* D3R */
          {   1,  47, 37,  63, 24,  27 },     /* D3L */
          {  88, 134, 37,  63, 24,  27 },     /* D3C */
          { 171, 217, 37,  63, 24,  27 },     /* D3R */
          {  61,  76, 38,  67,  8,  30 },     /* D2L */
          { 147, 162, 38,  67,  8,  30 },     /* D2R */
          {   0,  43, 37,  73, 32,  37 },     /* D2L */
          {  80, 143, 37,  73, 32,  37 },     /* D2C */
          { 180, 223, 37,  73, 32,  37 },     /* D2R */
          {  32,  63, 36,  83, 16,  48 },     /* D1L */
          { 160, 191, 36,  83, 16,  48 },     /* D1R */
          {  64, 159, 36,  91, 48,  56 } },   /* D1C */
        { {  80,  83, 66,  70,  8,   5 },     /* D3L */
          { 140, 143, 66,  70,  8,   5 },     /* D3R */
          {  16,  29, 64,  75,  8,  12 },     /* D3L */
          { 106, 119, 64,  75,  8,  12 },     /* D3C */
          { 187, 200, 64,  75,  8,  12 },     /* D3R */
          {  67,  77, 74,  83,  8,  10 },     /* D2L */
          { 146, 156, 74,  83,  8,  10 },     /* D2R */
          {   0,  17, 73,  90, 16,  18 },     /* D2L */
          { 100, 121, 73,  90, 16,  18 },     /* D2C */
          { 206, 223, 73,  90, 16,  18 },     /* D2R */
          {  48,  63, 84, 102,  8,  19 },     /* D1L */
          { 160, 175, 84, 102,  8,  19 },     /* D1R */
          {  96, 127, 92, 119, 16,  28 } },   /* D1C */
        { {  80,  83, 49,  53,  8,   5 },     /* D3L */
          { 140, 143, 49,  53,  8,   5 },     /* D3R */
          {  16,  29, 50,  61,  8,  12 },     /* D3L */
          { 106, 119, 50,  61,  8,  12 },     /* D3C */
          { 187, 200, 50,  61,  8,  12 },     /* D3R */
          {  67,  77, 53,  62,  8,  10 },     /* D2L */
          { 146, 156, 53,  62,  8,  10 },     /* D2R */
          {   0,  17, 55,  72, 16,  18 },     /* D2L */
          { 100, 121, 55,  72, 16,  18 },     /* D2C */
          { 206, 223, 55,  72, 16,  18 },     /* D2R */
          {  48,  63, 57,  75,  8,  19 },     /* D1L */
          { 160, 175, 57,  75,  8,  19 },     /* D1R */
          {  96, 127, 64,  91, 16,  28 } },   /* D1C */
        { {  75,  90, 40,  44,  8,   5 },     /* D3L */
          { 133, 148, 40,  44,  8,   5 },     /* D3R */
          {   1,  48, 44,  49, 24,   6 },     /* D3L */
          {  88, 135, 44,  49, 24,   6 },     /* D3C */
          { 171, 218, 44,  49, 24,   6 },     /* D3R */
          {  60,  77, 40,  46, 16,   7 },     /* D2L */
          { 146, 163, 40,  46, 16,   7 },     /* D2R */
          {   0,  35, 43,  50, 32,   8 },     /* D2L */
          {  80, 143, 43,  50, 32,   8 },     /* D2C */
          { 184, 223, 43,  50, 32,   8 },     /* D2R */
          {  32,  63, 41,  52, 16,  12 },     /* D1L */
          { 160, 191, 41,  52, 16,  12 },     /* D1R */
          {  64, 159, 41,  52, 48,  12 } },   /* D1C */
        { {  78,  85, 36,  51,  8,  16 },     /* D3L */
          { 138, 145, 36,  51,  8,  16 },     /* D3R */
          {  10,  41, 34,  53, 16,  20 },     /* D3L */
          {  98, 129, 34,  53, 16,  20 },     /* D3C */
          { 179, 210, 34,  53, 16,  20 },     /* D3R */
          {  66,  75, 34,  56,  8,  23 },     /* D2L */
          { 148, 157, 34,  56,  8,  23 },     /* D2R */
          {   0,  26, 33,  61, 24,  29 },     /* D2L */
          {  91, 133, 33,  61, 24,  29 },     /* D2C */
          { 194, 223, 33,  61, 24,  29 },     /* D2R */
          {  41,  56, 31,  65,  8,  35 },     /* D1L */
          { 167, 182, 31,  65,  8,  35 },     /* D1R */
          {  80, 143, 29,  71, 32,  43 } },   /* D1C */
        { {  75,  82, 25,  75,  8,  51 },     /* D3L */
          { 142, 149, 25,  75,  8,  51 },     /* D3R */
          {  12,  60, 25,  75, 32,  51 },     /* D3L */
          {  88, 136, 25,  75, 32,  51 },     /* D3C */
          { 163, 211, 25,  75, 32,  51 },     /* D3R */
          {  64,  73, 20,  90,  8,  71 },     /* D2L */
          { 150, 159, 20,  90,  8,  71 },     /* D2R */
          {   0,  38, 20,  90, 32,  71 },     /* D2L */
          {  82, 142, 20,  90, 32,  71 },     /* D2C */
          { 184, 223, 20,  90, 32,  71 },     /* D2R */
          {  41,  56,  9, 119,  8, 111 },     /* D1L */
          { 169, 184,  9, 119,  8, 111 },     /* D1R */
          {  64, 159,  9, 119, 48, 111 } },   /* D1C */
        { {  74,  85, 25,  75,  8,  51 },     /* D3L */
          { 137, 149, 25,  75,  8,  51 },     /* D3R */
          {   0,  75, 25,  75, 40,  51 },     /* D3L Atari ST: {   0,  83, 25,  75, 48,  51 } */
          {  74, 149, 25,  75, 40,  51 },     /* D3C Atari ST: {  74, 149, 25,  75, 48,  51 } */
          { 148, 223, 25,  75, 40,  51 },     /* D3R Atari ST: { 139, 223, 25,  75, 48,  51 } */
          {  60,  77, 20,  90, 16,  71 },     /* D2L */
          { 146, 163, 20,  90, 16,  71 },     /* D2R */
          {   0,  74, 20,  90, 56,  71 },     /* D2L */
          {  60, 163, 20,  90, 56,  71 },     /* D2C */
          { 149, 223, 20,  90, 56,  71 },     /* D2R */
          {  32,  63,  9, 119, 16, 111 },     /* D1L */
          { 160, 191,  9, 119, 16, 111 },     /* D1R */
          {  32, 191,  9, 119, 80, 111 } } }; /* D1C */
unsigned char G0206_aaauc_Graphic558_FloorOrnamentCoordinateSets[3][9][6] = {
        /* { X1, X2, Y1, Y2, ByteWidth, Height } */
        { {  32,  79, 66,  71, 24,  6 },     /* D3L */
          {  96, 127, 66,  71, 16,  6 },     /* D3C */
          { 144, 191, 66,  71, 24,  6 },     /* D3R */
          {   0,  63, 77,  87, 32, 11 },     /* D2L */
          {  80, 143, 77,  87, 32, 11 },     /* D2C */
          { 160, 223, 77,  87, 32, 11 },     /* D2R */
          {   0,  31, 92, 116, 16, 25 },     /* D1L */
          {  80, 143, 92, 116, 32, 25 },     /* D1C */
          { 192, 223, 92, 116, 16, 25 } },   /* D1R */
        { {   0,  95, 66,  74, 48,  9 },     /* D3L */
          {  64, 159, 66,  74, 48,  9 },     /* D3C */
          { 128, 223, 66,  74, 48,  9 },     /* D3R */
          {   0,  79, 75,  89, 40, 15 },     /* D2L */
          {  56, 167, 75,  89, 56, 15 },     /* D2C */
          { 144, 223, 75,  89, 40, 15 },     /* D2R */
          {   0,  63, 90, 118, 32, 29 },     /* D1L */
          {  32, 191, 90, 118, 80, 29 },     /* D1C */
          { 160, 223, 90, 118, 32, 29 } },   /* D1R */
        { {  42,  57, 68,  72,  8,  5 },     /* D3L */
          { 104, 119, 68,  72,  8,  5 },     /* D3C */
          { 166, 181, 68,  72,  8,  5 },     /* D3R */
          {   9,  40, 80,  85, 16,  6 },     /* D2L */
          {  96, 127, 80,  85, 16,  6 },     /* D2C */
          { 183, 214, 80,  85, 16,  6 },     /* D2R */
          {   0,  15, 97, 108,  8, 12 },     /* D1L */
          {  96, 127, 97, 108, 16, 12 },     /* D1C */
          { 208, 223, 97, 108,  8, 12 } } }; /* D1R */
unsigned char G0207_aaauc_Graphic558_DoorOrnamentCoordinateSets[4][3][6] = {
        /* { X1, X2, Y1, Y2, ByteWidth, Height } */
        { { 17, 31,  8, 17,  8, 10 },     /* D3LCR */
          { 22, 42, 11, 23, 16, 13 },     /* D2LCR */
          { 32, 63, 13, 31, 16, 19 } },   /* D1LCR */
        { {  0, 47,  0, 40, 24, 41 },     /* D3LCR */
          {  0, 63,  0, 60, 32, 61 },     /* D2LCR */
          {  0, 95,  0, 87, 48, 88 } },   /* D1LCR */
        { { 17, 31, 15, 24,  8, 10 },     /* D3LCR */
          { 22, 42, 22, 34, 16, 13 },     /* D2LCR */
          { 32, 63, 31, 49, 16, 19 } },   /* D1LCR */
        { { 23, 35, 31, 39,  8,  9 },     /* D3LCR */
          { 30, 48, 41, 52, 16, 12 },     /* D2LCR */
          { 44, 75, 61, 79, 16, 19 } } }; /* D1LCR */
unsigned char G0208_aaauc_Graphic558_DoorButtonCoordinateSets[1][4][6] = {
        /* X1, X2, Y1, Y2, ByteWidth, Height */
        { { 199, 204, 41, 44, 8, 4},     /* D3R */
          { 136, 141, 41, 44, 8, 4},     /* D3C */
          { 144, 155, 42, 47, 8, 6},     /* D2C */
          { 160, 175, 44, 52, 8, 9} } }; /* D1C */
OBJECT_ASPECT G0209_as_Graphic558_ObjectAspects[C085_OBJECT_ASPECT_COUNT] = {
        /* FirstNativeBitmapRelativeIndex, FirstDerivedBitmapRelativeIndex, ByteWidth, Height, GraphicInfo, CoordinateSet */
        {  0,   0, 24, 27, 0x11, 0 }, /* Chest */
        {  2,   6, 24,  8, 0x00, 1 }, /* Scroll */
        {  3,   8,  8, 18, 0x00, 1 },
        {  4,  10,  8,  8, 0x00, 1 },
        {  5,  12,  8,  4, 0x00, 1 },
        {  6,  14, 16, 11, 0x00, 1 },
        {  7,  16, 24, 13, 0x00, 0 },
        {  8,  18, 32, 16, 0x00, 0 },
        {  9,  20, 40, 24, 0x00, 0 },
        { 10,  22, 16, 20, 0x00, 1 },
        { 11,  24, 40, 20, 0x00, 0 },
        { 12,  26, 32,  4, 0x00, 1 },
        { 13,  28, 40,  8, 0x00, 1 },
        { 14,  30, 32, 17, 0x00, 0 },
        { 15,  32, 40, 17, 0x00, 2 },
        { 16,  34, 16,  9, 0x00, 1 },
        { 17,  36, 24,  5, 0x00, 1 },
        { 18,  38, 16,  9, 0x00, 0 },
        { 19,  40,  8,  4, 0x00, 1 },
        { 20,  42, 32, 21, 0x00, 2 },
        { 21,  44, 32, 25, 0x00, 2 },
        { 22,  46, 32, 14, 0x00, 1 },
        { 23,  48, 32, 26, 0x00, 2 },
        { 24,  50, 32, 16, 0x00, 0 },
        { 25,  52, 32, 16, 0x00, 0 },
        { 26,  54, 16, 16, 0x00, 1 },
        { 27,  56, 16, 15, 0x00, 1 },
        { 28,  58, 16, 13, 0x00, 1 },
        { 29,  60, 16, 10, 0x00, 1 },
        { 30,  62, 40, 24, 0x00, 0 },
        { 31,  64, 40,  9, 0x00, 1 },
        { 32,  66, 16,  3, 0x00, 1 },
        { 33,  68, 32,  5, 0x00, 1 },
        { 34,  70, 40, 16, 0x00, 0 },
        { 35,  72,  8,  7, 0x00, 1 },
        { 36,  74, 32,  7, 0x00, 1 },
        { 37,  76, 24, 14, 0x00, 0 },
        { 38,  78, 16,  8, 0x00, 0 },
        { 39,  80,  8,  3, 0x00, 1 },
        { 40,  82, 40,  9, 0x00, 1 },
        { 41,  84, 24, 14, 0x00, 0 },
        { 42,  86, 40, 20, 0x00, 0 },
        { 43,  88, 40, 15, 0x00, 1 },
        { 44,  90, 32, 10, 0x00, 1 },
        { 45,  92, 32, 19, 0x00, 0 },
        { 46,  94, 40, 25, 0x00, 2 },
        { 47,  96, 24,  7, 0x00, 1 },
        { 48,  98,  8,  7, 0x00, 1 },
        { 49, 100, 16,  5, 0x00, 1 },
        { 50, 102,  8,  9, 0x00, 1 },
        { 51, 104, 32, 11, 0x00, 1 },
        { 52, 106, 32, 14, 0x00, 0 },
        { 53, 108, 24, 20, 0x00, 0 },
        { 54, 110, 16, 14, 0x00, 1 },
        { 55, 112, 32, 23, 0x00, 0 },
        { 56, 114, 24, 16, 0x00, 0 },
        { 57, 116, 32, 25, 0x00, 0 },
        { 58, 118, 24, 25, 0x00, 0 },
        { 59, 120,  8,  8, 0x00, 1 },
        { 60, 122,  8,  7, 0x00, 1 },
        { 61, 124,  8,  8, 0x00, 1 },
        { 62, 126,  8,  8, 0x00, 1 },
        { 63, 128,  8,  5, 0x00, 1 },
        { 64, 130,  8, 13, 0x01, 1 },
        { 65, 134, 16, 13, 0x00, 1 },
        { 66, 136, 16, 14, 0x00, 0 },
        { 67, 138, 16, 10, 0x00, 1 },
        { 68, 140,  8, 18, 0x00, 1 },
        { 69, 142,  8, 17, 0x00, 1 },
        { 70, 144, 32, 18, 0x00, 0 },
        { 71, 146, 16, 23, 0x00, 0 },
        { 72, 148, 16, 24, 0x00, 0 },
        { 73, 150, 16, 15, 0x00, 0 },
        { 74, 152,  8,  7, 0x00, 1 },
        { 75, 154,  8, 15, 0x00, 1 },
        { 76, 156,  8,  9, 0x00, 1 },
        { 77, 158, 16, 14, 0x00, 0 },
        { 78, 160,  8,  8, 0x00, 1 },
        { 79, 162, 16,  9, 0x00, 1 },
        { 80, 164,  8, 13, 0x01, 1 },
        { 81, 168,  8, 18, 0x00, 1 },
        { 82, 170, 24, 28, 0x00, 0 },
        { 83, 172, 40, 13, 0x00, 1 },
        { 84, 174,  8,  4, 0x00, 1 },
        { 85, 176, 32, 17, 0x00, 0 } };
PROJECTIL_ASPECT G0210_as_Graphic558_ProjectileAspects[C014_PROJECTILE_ASPECT_COUNT] = {
        /* { FirstNativeBitmapRelativeIndex, FirstDerivedBitmapRelativeIndex, ByteWidth, Height, GraphicInfo } */
        {  0,   0, 32, 11, 0x0011 },   /* Arrow */
        {  3,  18, 16, 11, 0x0011 },   /* Dagger */
        {  6,  36, 24, 47, 0x0010 },   /* Axe - Executioner */
        {  9,  54, 32, 15, 0x0112 },   /* Explosion Lightning Bolt */
        { 11,  54, 32, 12, 0x0011 },   /* Slayer */
        { 14,  72, 24, 47, 0x0010 },   /* Stone Club */
        { 17,  90, 24, 47, 0x0010 },   /* Club */
        { 20, 108, 16, 11, 0x0011 },   /* Poison Dart */
        { 23, 126, 48, 18, 0x0011 },   /* Storm - Side Splitter - Diamond Edge - Falchion - Ra Blade - Rapier - Biter - Samurai Sword - Sword - Dragon Fang */
        { 26, 144,  8, 15, 0x0012 },   /* Throwing Star */
        { 28, 156, 16, 28, 0x0103 },   /* Explosion Fireball */
        { 29, 156, 16, 11, 0x0103 },   /* Explosion Default */
        { 30, 156, 16, 28, 0x0103 },   /* Explosion Slime */
        { 31, 156, 16, 24, 0x0103 } }; /* Explosion Poison Bolt Poison Cloud */
EXPLOSION_ASPECT G0211_as_Graphic558_ExplosionAspects[C004_EXPLOSION_ASPECT_COUNT] = {
        /* { ByteWidth, Height } */
        { 80, 111 },   /* Fire   */
        { 64,  97 },   /* Spell  */
        { 80,  91 },   /* Poison */
        { 80,  91 } }; /* Death  */
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
unsigned char G0204_auc_Graphic558_UnreadableInscriptionBoxY2[15] = {
        5,   8, 13,
        7,  13, 20,
        5,  12, 19,
        10, 17, 27,
        11, 22, 33 };
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
OBJECT_ASPECT G0209_as_Graphic558_ObjectAspects[C085_OBJECT_ASPECT_COUNT] = {
        {  0,   0, 0x11, 0 },
        {  2,   6,    0, 1 },
        {  3,   8,    0, 1 },
        {  4,  10,    0, 1 },
        {  5,  12,    0, 1 },
        {  6,  14,    0, 1 },
        {  7,  16,    0, 0 },
        {  8,  18,    0, 0 },
        {  9,  20,    0, 0 },
        { 10,  22,    0, 1 },
        { 11,  24,    0, 0 },
        { 12,  26,    0, 1 },
        { 13,  28,    0, 1 },
        { 14,  30,    0, 0 },
        { 15,  32,    0, 2 },
        { 16,  34,    0, 1 },
        { 17,  36,    0, 1 },
        { 18,  38,    0, 0 },
        { 19,  40,    0, 1 },
        { 20,  42,    0, 2 },
        { 21,  44,    0, 2 },
        { 22,  46,    0, 1 },
        { 23,  48,    0, 2 },
        { 24,  50,    0, 0 },
        { 25,  52,    0, 0 },
        { 26,  54,    0, 1 },
        { 27,  56,    0, 1 },
        { 28,  58,    0, 1 },
        { 29,  60,    0, 1 },
        { 30,  62,    0, 0 },
        { 31,  64,    0, 1 },
        { 32,  66,    0, 1 },
        { 33,  68,    0, 1 },
        { 34,  70,    0, 0 },
        { 35,  72,    0, 1 },
        { 36,  74,    0, 1 },
        { 37,  76,    0, 0 },
        { 38,  78,    0, 0 },
        { 39,  80,    0, 1 },
        { 40,  82,    0, 1 },
        { 41,  84,    0, 0 },
        { 42,  86,    0, 0 },
        { 43,  88,    0, 1 },
        { 44,  90,    0, 1 },
        { 45,  92,    0, 0 },
        { 46,  94,    0, 2 },
        { 47,  96,    0, 1 },
        { 48,  98,    0, 1 },
        { 49, 100,    0, 1 },
        { 50, 102,    0, 1 },
        { 51, 104,    0, 1 },
        { 52, 106,    0, 0 },
        { 53, 108,    0, 0 },
        { 54, 110,    0, 1 },
        { 55, 112,    0, 0 },
        { 56, 114,    0, 0 },
        { 57, 116,    0, 0 },
        { 58, 118,    0, 0 },
        { 59, 120,    0, 1 },
        { 60, 122,    0, 1 },
        { 61, 124,    0, 1 },
        { 62, 126,    0, 1 },
        { 63, 128,    0, 1 },
        { 64, 130,    1, 1 },
        { 65, 134,    0, 1 },
        { 66, 136,    0, 0 },
        { 67, 138,    0, 1 },
        { 68, 140,    0, 1 },
        { 69, 142,    0, 1 },
        { 70, 144,    0, 0 },
        { 71, 146,    0, 0 },
        { 72, 148,    0, 0 },
        { 73, 150,    0, 0 },
        { 74, 152,    0, 1 },
        { 75, 154,    0, 1 },
        { 76, 156,    0, 1 },
        { 77, 158,    0, 0 },
        { 78, 160,    0, 1 },
        { 79, 162,    0, 1 },
        { 80, 164,    1, 1 },
        { 81, 168,    0, 1 },
        { 82, 170,    0, 0 },
        { 83, 172,    0, 1 },
        { 84, 174,    0, 1 },
        { 85, 176,    0, 0 } };
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
OBJECT_ASPECT G0209_as_Graphic558_ObjectAspects[C085_OBJECT_ASPECT_COUNT] = {
        {  0,  0, 0x11, 0 },
        {  2,  3,    0, 1 },
        {  3,  4,    0, 1 },
        {  4,  5,    0, 1 },
        {  5,  6,    0, 1 },
        {  6,  7,    0, 1 },
        {  7,  8,    0, 0 },
        {  8,  9,    0, 0 },
        {  9, 10,    0, 0 },
        { 10, 11,    0, 1 },
        { 11, 12,    0, 0 },
        { 12, 13,    0, 1 },
        { 13, 14,    0, 1 },
        { 14, 15,    0, 0 },
        { 15, 16,    0, 2 },
        { 16, 17,    0, 1 },
        { 17, 18,    0, 1 },
        { 18, 19,    0, 0 },
        { 19, 20,    0, 1 },
        { 20, 21,    0, 2 },
        { 21, 22,    0, 2 },
        { 22, 23,    0, 1 },
        { 23, 24,    0, 2 },
        { 24, 25,    0, 0 },
        { 25, 26,    0, 0 },
        { 26, 27,    0, 1 },
        { 27, 28,    0, 1 },
        { 28, 29,    0, 1 },
        { 29, 30,    0, 1 },
        { 30, 31,    0, 0 },
        { 31, 32,    0, 1 },
        { 32, 33,    0, 1 },
        { 33, 34,    0, 1 },
        { 34, 35,    0, 0 },
        { 35, 36,    0, 1 },
        { 36, 37,    0, 1 },
        { 37, 38,    0, 0 },
        { 38, 39,    0, 0 },
        { 39, 40,    0, 1 },
        { 40, 41,    0, 1 },
        { 41, 42,    0, 0 },
        { 42, 43,    0, 0 },
        { 43, 44,    0, 1 },
        { 44, 45,    0, 1 },
        { 45, 46,    0, 0 },
        { 46, 47,    0, 2 },
        { 47, 48,    0, 1 },
        { 48, 49,    0, 1 },
        { 49, 50,    0, 1 },
        { 50, 51,    0, 1 },
        { 51, 52,    0, 1 },
        { 52, 53,    0, 0 },
        { 53, 54,    0, 0 },
        { 54, 55,    0, 1 },
        { 55, 56,    0, 0 },
        { 56, 57,    0, 0 },
        { 57, 58,    0, 0 },
        { 58, 59,    0, 0 },
        { 59, 60,    0, 1 },
        { 60, 61,    0, 1 },
        { 61, 62,    0, 1 },
        { 62, 63,    0, 1 },
        { 63, 64,    0, 1 },
        { 64, 65,    1, 1 },
        { 65, 67,    0, 1 },
        { 66, 68,    0, 0 },
        { 67, 69,    0, 1 },
        { 68, 70,    0, 1 },
        { 69, 71,    0, 1 },
        { 70, 72,    0, 0 },
        { 71, 73,    0, 0 },
        { 72, 74,    0, 0 },
        { 73, 75,    0, 0 },
        { 74, 76,    0, 1 },
        { 75, 77,    0, 1 },
        { 76, 78,    0, 1 },
        { 77, 79,    0, 0 },
        { 78, 80,    0, 1 },
        { 79, 81,    0, 1 },
        { 80, 82,    1, 1 },
        { 81, 84,    0, 1 },
        { 82, 85,    0, 0 },
        { 83, 86,    0, 1 },
        { 84, 87,    0, 1 },
        { 85, 88,    0, 0 } };
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
PROJECTIL_ASPECT G0210_as_Graphic558_ProjectileAspects[C014_PROJECTILE_ASPECT_COUNT] = {
        {  0,   0, 0x0011 },
        {  3,  18, 0x0011 },
        {  6,  36, 0x0010 },
        {  9,  54, 0x0112 },
        { 11,  54, 0x0011 },
        { 14,  72, 0x0010 },
        { 17,  90, 0x0010 },
        { 20, 108, 0x0011 },
        { 23, 126, 0x0011 },
        { 26, 144, 0x0012 },
        { 28, 156, 0x0103 },
        { 29, 156, 0x0103 },
        { 30, 156, 0x0103 },
        { 31, 156, 0x0103 } };
#endif
#ifdef MEDIA417_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_P20JA_P20JB
unsigned char G0212_auc_Graphic558_PaletteChanges_Smoke[16] = { 0, 10, 20, 30, 40, 50, 120, 10, 80, 90, 100, 110, 120, 130, 140, 150 };
unsigned char G0213_auc_Graphic558_PaletteChanges_FloorOrnament_D3[16] = { 0, 120, 10, 30, 40, 30, 0, 60, 30, 90, 100, 110, 0, 20, 140, 130 };
unsigned char G0214_auc_Graphic558_PaletteChanges_FloorOrnament_D2[16] = { 0, 10, 20, 30, 40, 30, 60, 70, 50, 90, 100, 110, 120, 130, 140, 150 };
#endif
#ifdef MEDIA379_G14ED_G20E_G21E_X30J_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
unsigned char G0212_auc_Graphic558_PaletteChanges_Smoke[16] = { 0, 1, 2, 3, 4, 5, 12, 1, 8, 9, 10, 11, 12, 13, 14, 15 };
unsigned char G0213_auc_Graphic558_PaletteChanges_FloorOrnament_D3[16] = { 0, 12, 1, 3, 4, 3, 0, 6, 3, 9, 10, 11, 0, 2, 14, 13 };
unsigned char G0214_auc_Graphic558_PaletteChanges_FloorOrnament_D2[16] = { 0, 1, 2, 3, 4, 3, 6, 7, 5, 9, 10, 11, 12, 13, 14, 15 };
#endif
#ifdef MEDIA721_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J
unsigned char G2030_auc_ObjectScales[5] = { 27, 21, 18, 14, 12 }; /* Scales for objects based on distance+cell */
#endif
#ifdef MEDIA358_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
unsigned char G0215_auc_Graphic558_ProjectileScales[7] = {
        13,   /* D4 Back  */
        16,   /* D4 Front */
        19,   /* D3 Back  */
        22,   /* D3 Front */
        25,   /* D2 Back  */
        28,   /* D2 Front */
        32 }; /* D1 Back  */
unsigned char G0216_auc_Graphic558_ExplosionBaseScales[5] = {
        10,   /* D4 */
        16,   /* D3 */
        23,   /* D2 */
        32,   /* D1 */
        32 }; /* D0 */
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
unsigned char G0215_auc_Graphic558_ProjectileScales[7] = {
        32,  /* D1 Back  */
        27,  /* D2 Front */
        21,  /* D2 Back  */
        18,  /* D3 Front */
        14,  /* D3 Back  */
        12,  /* D4 Front */
        9 }; /* D4 Back  */
unsigned char G0216_auc_Graphic558_ExplosionBaseScales[5] = {
        32,  /* D0 */
        32,  /* D1 */
        21,  /* D2 */
        14,  /* D3 */
        9 }; /* D4 */
#endif
#ifdef MEDIA365_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
unsigned char G0217_aauc_Graphic558_ObjectPileShiftSetIndices[16][2] = {
        /* { X shift index, Y shift index } */
        { 2, 5 },
        { 0, 6 },
        { 5, 7 },
        { 3, 0 },
        { 7, 1 },
        { 1, 2 },
        { 6, 3 },
        { 3, 3 },
        { 5, 5 },
        { 2, 6 },
        { 7, 7 },
        { 1, 0 },
        { 3, 1 },
        { 6, 2 },
        { 1, 3 },
        { 5, 3 } }; /* 16 pairs of X and Y shift values */
#endif
#ifdef MEDIA353_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
unsigned char G0218_aaaauc_Graphic558_ObjectCoordinateSets[3][10][5][2] = {
        /* { {X, Y }, {X, Y }, {X, Y }, {X, Y }, {X, Y } } */
        { { {   0,   0 }, {   0,   0 }, { 125,  72 }, {  95,  72 }, { 112, 64 } },     /* D3C */
          { {   0,   0 }, {   0,   0 }, {  62,  72 }, {  25,  72 }, {  24, 64 } },     /* D3L */
          { {   0,   0 }, {   0,   0 }, { 200,  72 }, { 162,  72 }, { 194, 64 } },     /* D3R */
          { {  92,  78 }, { 132,  78 }, { 136,  86 }, {  88,  86 }, { 112, 74 } },     /* D2C */
          { {  10,  78 }, {  53,  78 }, {  41,  86 }, {   0,   0 }, {   3, 74 } },     /* D2L */
          { { 171,  78 }, { 218,  78 }, {   0,   0 }, { 183,  86 }, { 219, 74 } },     /* D2R */
          { {  83,  96 }, { 141,  96 }, { 148, 111 }, {  76, 111 }, { 112, 94 } },     /* D1C */
          { {   0,   0 }, {  26,  96 }, {   5, 111 }, {   0,   0 }, {   0,  0 } },     /* D1L */
          { { 197,  96 }, {   0,   0 }, {   0,   0 }, { 220, 111 }, {   0,  0 } },     /* D1R */
          { {  66, 131 }, { 158, 131 }, {   0,   0 }, {   0,   0 }, {   0,  0 } } },   /* D0C */
        { { {   0,   0 }, {   0,   0 }, { 125,  72 }, {  95,  72 }, { 112, 63 } },     /* D3C */
          { {   0,   0 }, {   0,   0 }, {  62,  72 }, {  25,  72 }, {  24, 63 } },     /* D3L */
          { {   0,   0 }, {   0,   0 }, { 200,  72 }, { 162,  72 }, { 194, 63 } },     /* D3R */
          { {  92,  78 }, { 132,  78 }, { 136,  86 }, {  88,  86 }, { 112, 73 } },     /* D2C */
          { {  10,  78 }, {  53,  78 }, {  41,  86 }, {   0,   0 }, {   3, 73 } },     /* D2L */
          { { 171,  78 }, { 218,  78 }, {   0,   0 }, { 183,  86 }, { 219, 73 } },     /* D2R */
          { {  83,  96 }, { 141,  96 }, { 148, 111 }, {  76, 111 }, { 112, 89 } },     /* D1C */
          { {   0,   0 }, {  26,  96 }, {   5, 111 }, {   0,   0 }, {   0,  0 } },     /* D1L */
          { { 197,  96 }, {   0,   0 }, {   0,   0 }, { 220, 111 }, {   0,  0 } },     /* D1R */
          { {  66, 131 }, { 158, 131 }, {   0,   0 }, {   0,   0 }, {   0,  0 } } },   /* D0C */
        { { {   0,   0 }, {   0,   0 }, { 125,  75 }, {  95,  75 }, { 112, 65 } },     /* D3C */
          { {   0,   0 }, {   0,   0 }, {  62,  75 }, {  25,  75 }, {  24, 65 } },     /* D3L */
          { {   0,   0 }, {   0,   0 }, { 200,  75 }, { 162,  75 }, { 194, 65 } },     /* D3R */
          { {  92,  81 }, { 132,  81 }, { 136,  88 }, {  88,  88 }, { 112, 76 } },     /* D2C */
          { {  10,  81 }, {  53,  81 }, {  41,  88 }, {   0,   0 }, {   3, 76 } },     /* D2L */
          { { 171,  81 }, { 218,  81 }, {   0,  0  }, { 183,  88 }, { 219, 76 } },     /* D2R */
          { {  83,  98 }, { 141,  98 }, { 148, 115 }, {  76, 115 }, { 112, 98 } },     /* D1C */
          { {   0,   0 }, {  26,  98 }, {   5, 115 }, {   0,   0 }, {   0,  0 } },     /* D1L */
          { { 197,  98 }, {   0,   0 }, {   0,   0 }, { 220, 115 }, {   0,  0 } },     /* D1R */
          { {  66, 135 }, { 158, 135 }, {   0,   0 }, {   0,   0 }, {   0,  0 } } } }; /* D0C */
CREATURE_ASPECT G0219_as_Graphic558_CreatureAspects[C027_CREATURE_TYPE_COUNT] = {
        /* { FirstNativeBitmapRelativeIndex, FirstDerivedBitmapIndex, ByteWidthFront, HeightFront, ByteWidthSide, HeightSide, ByteWidthAttack, HeightAttack, CoordinateSet / TransparentColor, Replacement Color Set Index for color 10 / Replacement Color Set Index for color 9 } */
        {  0, 0, 56,  84, 56,  84, 56,  84, 0x1D, 0x01 },   /* Creature #00 Giant Scorpion / Scorpion */
        {  4, 0, 32,  66,  0,   0, 32,  69, 0x0B, 0x20 },   /* Creature #01 Swamp Slime / Slime Devil */
        {  6, 0, 24,  48, 24,  48,  0,   0, 0x0B, 0x00 },   /* Creature #02 Giggler */
        { 10, 0, 32,  61,  0,   0, 32,  61, 0x24, 0x31 },   /* Creature #03 Wizard Eye / Flying Eye */
        { 12, 0, 32,  64, 56,  64, 32,  64, 0x14, 0x34 },   /* Creature #04 Pain Rat / Hellhound */
        { 16, 0, 24,  49, 40,  49,  0,   0, 0x18, 0x34 },   /* Creature #05 Ruster */
        { 19, 0, 32,  60,  0,   0, 32,  60, 0x0D, 0x00 },   /* Creature #06 Screamer */
        { 21, 0, 32,  43,  0,   0, 32,  64, 0x04, 0x00 },   /* Creature #07 Rockpile / Rock pile */
        { 23, 0, 32,  83,  0,   0, 32,  93, 0x04, 0x00 },   /* Creature #08 Ghost / Rive */
        { 25, 0, 32, 101, 32, 101, 32, 101, 0x14, 0x00 },   /* Creature #09 Stone Golem */
        { 29, 0, 32,  82, 32,  82, 32,  83, 0x04, 0x00 },   /* Creature #10 Mummy */
        { 33, 0, 32,  80,  0,   0, 32,  99, 0x14, 0x00 },   /* Creature #11 Black Flame */
        { 35, 0, 32,  80, 32,  80, 32,  76, 0x04, 0x00 },   /* Creature #12 Skeleton */
        { 39, 0, 32,  96, 56,  93, 32,  90, 0x1D, 0x20 },   /* Creature #13 Couatl */
        { 43, 0, 32,  49, 16,  49, 32,  56, 0x04, 0x30 },   /* Creature #14 Vexirk */
        { 47, 0, 32,  59, 56,  43, 32,  67, 0x14, 0x78 },   /* Creature #15 Magenta Worm / Worm */
        { 51, 0, 32,  83, 32,  74, 32,  74, 0x04, 0x65 },   /* Creature #16 Trolin / Ant Man */
        { 55, 0, 24,  49, 24,  53, 24,  53, 0x24, 0x00 },   /* Creature #17 Giant Wasp / Muncher */
        { 59, 0, 32,  89, 32,  89, 32,  89, 0x04, 0x00 },   /* Creature #18 Animated Armour / Deth Knight */
        { 63, 0, 32,  84, 32,  84, 32,  84, 0x0D, 0xA9 },   /* Creature #19 Materializer / Zytaz */
        { 67, 0, 56,  27,  0,   0, 56,  80, 0x04, 0x65 },   /* Creature #20 Water Elemental */
        { 69, 0, 56,  77, 56,  81, 56,  77, 0x04, 0xA9 },   /* Creature #21 Oitu */
        { 73, 0, 32,  87, 32,  89, 32,  89, 0x04, 0xCB },   /* Creature #22 Demon */
        { 77, 0, 32,  96, 32,  94, 32,  96, 0x04, 0x00 },   /* Creature #23 Lord Chaos */
        { 81, 0, 64,  94, 72,  94, 64,  94, 0x04, 0xCB },   /* Creature #24 Red Dragon / Dragon */
        { 85, 0, 32,  93,  0,   0,  0,   0, 0x04, 0xCB },   /* Creature #25 Lord Order */
        { 86, 0, 32,  93,  0,   0,  0,   0, 0x04, 0xCB } }; /* Creature #26 Grey Lord */
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
CREATURE_ASPECT G0219_as_Graphic558_CreatureAspects[C027_CREATURE_TYPE_COUNT] = {
        {  0, 0, 0x1D, 0x01 },
        {  4, 0, 0x0B, 0x20 },
        {  6, 0, 0x0B, 0x00 },
        { 10, 0, 0x24, 0x31 },
        { 12, 0, 0x14, 0x34 },
        { 16, 0, 0x18, 0x34 },
        { 19, 0, 0x0D, 0x00 },
        { 21, 0, 0x04, 0x00 },
        { 23, 0, 0x04, 0x00 },
        { 25, 0, 0x14, 0x00 },
        { 29, 0, 0x04, 0x00 },
        { 33, 0, 0x14, 0x00 },
        { 35, 0, 0x04, 0x00 },
        { 39, 0, 0x1D, 0x20 },
#ifdef MEDIA532_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_F31E_F31J_X31J_P31J
        { 43, 0, 0x04, 0x30 },
#endif
#ifdef MEDIA666_A33M_A35E_A35M
        { 43, 0, 0x04, 0x00 },
#endif
        { 47, 0, 0x14, 0x78 },
        { 51, 0, 0x04, 0x65 },
        { 55, 0, 0x24, 0x00 },
        { 59, 0, 0x04, 0x00 },
        { 63, 0, 0x0D, 0xA9 },
#ifdef MEDIA507_F20E_F20J_X30J_P20JA
        { 67, 0, 0x04, 0x65 },
        { 69, 0, 0x04, 0xA9 },
#endif
#ifdef MEDIA485_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        { 67, 0, 0x14, 0x65 },
        { 69, 0, 0x14, 0xA9 },
#endif
        { 73, 0, 0x04, 0xCB },
#ifdef MEDIA507_F20E_F20J_X30J_P20JA
        { 77, 0, 0x04, 0x00 },
        { 81, 0, 0x04, 0xCB },
        { 85, 0, 0x04, 0xCB },
        { 86, 0, 0x04, 0xCB } };
#endif
#ifdef MEDIA485_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        { 77, 0, 0x14, 0x00 },
        { 81, 0, 0x14, 0xCB },
        { 85, 0, 0x14, 0xCB },
        { 86, 0, 0x14, 0xCB } };
#endif
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
CREATURE_REPLACEMENT_COLOR_SET G0220_as_Graphic558_CreatureReplacementColorSets[13] = {
        /* { Color, Color, Color, Color, Color, Color, D2 replacement color index (x10), D3 replacement color index (x10) } */
        { 0x0CA0, 0x0A80, 0x0860, 0x0640, 0x0420, 0x0200,  9,  9 },
        { 0x0060, 0x0040, 0x0020, 0x0000, 0x0000, 0x0000,  0,  0 },
        { 0x0860, 0x0640, 0x0420, 0x0200, 0x0000, 0x0000, 10, 10 },
        { 0x0640, 0x0420, 0x0200, 0x0000, 0x0000, 0x0000,  9,  0 },
        { 0x000A, 0x0008, 0x0006, 0x0004, 0x0002, 0x0000,  9, 10 },
        { 0x0008, 0x0006, 0x0004, 0x0002, 0x0000, 0x0000, 10,  0 },
        { 0x0808, 0x0606, 0x0404, 0x0202, 0x0000, 0x0000,  9,  0 },
        { 0x0A0A, 0x0808, 0x0606, 0x0404, 0x0202, 0x0000, 10,  9 },
        { 0x0FA0, 0x0C80, 0x0A60, 0x0840, 0x0620, 0x0400, 10,  5 },
        { 0x0F80, 0x0C60, 0x0A40, 0x0820, 0x0600, 0x0200,  5,  7 },
        { 0x0800, 0x0600, 0x0400, 0x0200, 0x0000, 0x0000, 10, 12 },
        { 0x0600, 0x0400, 0x0200, 0x0000, 0x0000, 0x0000, 12,  0 },
        { 0x0C86, 0x0A64, 0x0842, 0x0620, 0x0400, 0x0200, 10,  5 } };
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
CREATURE_REPLACEMENT_COLOR_SET G0220_as_Graphic558_CreatureReplacementColorSets[13] = {
        /* { Color, Color, Color, Color, Color, Color, D2 replacement color index (x10), D3 replacement color index (x10) } */
        { 0x0CA0, 0x0A80, 0x0860, 0x0640, 0x0420, 0x0200,  90,  90 },    /* Atari ST: { 0x0650, 0x0540, 0x0430, 0x0320, 0x0210, 0x0100,  90,  90 }, RGB colors are different */
        { 0x0060, 0x0040, 0x0020, 0x0000, 0x0000, 0x0000,   0,   0 },    /* Atari ST: { 0x0030, 0x0020, 0x0010, 0x0000, 0x0000, 0x0000,   0,   0 }, */
        { 0x0860, 0x0640, 0x0420, 0x0200, 0x0000, 0x0000, 100, 100 },    /* Atari ST: { 0x0430, 0x0320, 0x0210, 0x0100, 0x0000, 0x0000, 100, 100 }, */
        { 0x0640, 0x0420, 0x0200, 0x0000, 0x0000, 0x0000,  90,   0 },    /* Atari ST: { 0x0320, 0x0210, 0x0100, 0x0000, 0x0000, 0x0000,  90,   0 }, */
        { 0x000A, 0x0008, 0x0006, 0x0004, 0x0002, 0x0000,  90, 100 },    /* Atari ST: { 0x0005, 0x0004, 0x0003, 0x0002, 0x0001, 0x0000,  90, 100 }, */
        { 0x0008, 0x0006, 0x0004, 0x0002, 0x0000, 0x0000, 100,   0 },    /* Atari ST: { 0x0004, 0x0003, 0x0002, 0x0001, 0x0000, 0x0000, 100,   0 }, */
        { 0x0808, 0x0606, 0x0404, 0x0202, 0x0000, 0x0000,  90,   0 },    /* Atari ST: { 0x0404, 0x0303, 0x0202, 0x0101, 0x0000, 0x0000,  90,   0 }, */
        { 0x0A0A, 0x0808, 0x0606, 0x0404, 0x0202, 0x0000, 100,  90 },    /* Atari ST: { 0x0505, 0x0404, 0x0303, 0x0202, 0x0101, 0x0000, 100,  90 }, */
        { 0x0FA0, 0x0C80, 0x0A60, 0x0840, 0x0620, 0x0400, 100,  50 },    /* Atari ST: { 0x0750, 0x0640, 0x0530, 0x0420, 0x0310, 0x0200, 100,  50 }, */
        { 0x0F80, 0x0C60, 0x0A40, 0x0820, 0x0600, 0x0200,  50,  70 },    /* Atari ST: { 0x0740, 0x0630, 0x0520, 0x0410, 0x0300, 0x0100,  50,  30 }, D3 replacement color index is different */
        { 0x0800, 0x0600, 0x0400, 0x0200, 0x0000, 0x0000, 100, 120 },    /* Atari ST: { 0x0400, 0x0300, 0x0200, 0x0100, 0x0000, 0x0000, 100, 100 }, D3 replacement color index is different */
        { 0x0600, 0x0400, 0x0200, 0x0000, 0x0000, 0x0000, 120,   0 },    /* Atari ST: { 0x0300, 0x0200, 0x0100, 0x0000, 0x0000, 0x0000, 120,   0 }, */
        { 0x0C86, 0x0A64, 0x0842, 0x0620, 0x0400, 0x0200, 100,  50 } };  /* Atari ST: { 0x0643, 0x0532, 0x0421, 0x0310, 0x0200, 0x0100, 100,  50 } }; */
/* BUG0_04 Some creatures may be drawn with unexpected colors in Dungeon Master
In the color palettes used to draw the dungeon view, two colors (9 and 10) are only used by creature graphics and each creature type can specify replacement colors to use instead of the default colors. Creature types that do not use these colors can specify that no replacement is needed. Each map in the dungeon has an associated list of allowed creature types. If multiple creatures with conflicting color replacements are allowed on the same map then each replacement color is defined by the creature type that appears the last in the list of allowed creature types. There are no such conflicts in Dungeon Master.
However, the side bitmap of 'Giant Wasp' uses color 10 but no replacement is specified. In the game, the actual color used is not the same on all maps where they are present: on map 3 the color is the one defined by 'Magenta Worm', on map 5 it is the color defined by 'Wizard Eye' and on map 10 it is the color defined by 'Water Elemental'.
All bitmaps for 'Swamp Slime' use both colors 9 and 10 but replacement is only specified for color 10. On the map where this creature is used, there are no other creatures defining color 9 so the default color is used which is appropriate. However, this color should be explicitly specified.
The front, side and attack bitmaps for 'Lord Chaos' use color 9 but no replacement is specified. On the map where this creature is used, the colors defined by the Demon are used, which are also appropriate for Lord Chaos. However, these colors should be explicitly specified. Note a unique case for Lord Chaos bitmaps in DM: the palette changes applied when drawing bitmaps at D2 change color 9 to color 10 so this color is also affected by other creatures on the map */
/* BUG7_01 Some creatures may be drawn with unexpected colors in Chaos Strikes Back
In the color palettes used to draw the dungeon view, two colors (9 and 10) are only used by creature graphics and each creature type can specify replacement colors to use instead of the default colors. Creature types that do not use these colors can specify that no replacement is needed. Each map in the dungeon has an associated list of allowed creature types. If multiple creatures with conflicting color replacements are allowed on the same map then each replacement color is defined by the creature type that appears the last in the list of allowed creature types. There are such conflicts in Chaos Strikes Back for 'Worm' which are never drawn with their 'true' colors.
All bitmaps for 'Slime Devil' use both colors 9 and 10 but replacement is only specified for color 10. On the map where this creature is used, there are no other creatures defining color 9 so the default color is used which is appropriate. However, this color should be explicitly specified.
The front, side and attack bitmaps for 'Lord Chaos' use both colors 9 and 10 but no replacements are specified. On the map where this creature is used, the colors defined by the Demon are used, which are also appropriate for Lord Chaos. However, these colors should be explicitly specified.
All bitmaps for 'Hellhound' do not use colors 9 and 10 but it specifies replacements for both, inherited from 'Pain Rat' (DM). On the map where this creature is used, none of the creatures use colors 9 and 10 so this has no consequence. However, these colors should not be specified.
All bitmaps for 'Worm' use both colors 9 and 10 and specify replacements for both colors 9 and 10 but these replacements are still for 'Magenta Worm' (DM). In the game, the actual colors used are not the same on all maps where they are present: on map 0 the colors are defined by 'Demon', on map 9 the colors are defined by 'Dragon' (same colors as 'Demon') and on map 4 color 9 is defined by 'Giant Scorpion' and color 10 is defined by 'Flying Eye'.
The front, side and attack bitmaps for 'Zytaz' use both colors 9 and 10 and specify replacements for both colors 9 and 10 but the replacements are still for the 'Materializer' (DM). They appear with other (and correct) colors in the game only because they were defined by 'Demon'. However, these colors should be explicitly specified */
#endif
#ifdef MEDIA607_X30J_X31J
CREATURE_REPLACEMENT_COLOR_SET G0220_as_Graphic558_CreatureReplacementColorSets[13] = {
        /* { Color, Color, Color, Color, Color, Color, D2 replacement color index (x10), D3 replacement color index } */
        { 0xA601, 0x8501, 0x6401, 0x4301, 0x2201, 0x1101,  9,   9 },
        { 0x6001, 0x4001, 0x2001, 0x1001, 0x0801, 0x0001,  0,   0 },
        { 0x6401, 0x4301, 0x2201, 0x1101, 0x0081, 0x0041, 10,  10 },
        { 0x4301, 0x2201, 0x1101, 0x0081, 0x0041, 0x0001,  9,   0 },
        { 0x0029, 0x0021, 0x0019, 0x0011, 0x0009, 0x0005,  9,  10 },
        { 0x0021, 0x0019, 0x0011, 0x0009, 0x0005, 0x0003, 10,   0 },
        { 0x0421, 0x0319, 0x0211, 0x0109, 0x0085, 0x0043,  9,   0 },
        { 0x0529, 0x0421, 0x0319, 0x0211, 0x0109, 0x0085, 10,   9 },
        { 0xA7C1, 0x8601, 0x6501, 0x4401, 0x2301, 0x1201, 10,   5 },
        { 0x87C1, 0x6601, 0x4501, 0x2401, 0x1301, 0x0981,  5,   3 },
        { 0x0401, 0x0301, 0x0201, 0x0101, 0x0081, 0x0041, 10,  10 },
        { 0x0301, 0x0201, 0x0101, 0x0081, 0x0041, 0x0001, 12,   0 },
        { 0x8619, 0x6511, 0x4409, 0x2305, 0x1201, 0x0901, 10,   5 } };
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
CREATURE_REPLACEMENT_COLOR_SET G0220_as_Graphic558_CreatureReplacementColorSets[13] = {
        /* { Color, Color, Color, Color, Color, Color, D2 replacement color index (x10), D3 replacement color index } */
        { 0x0CA0, 0x0A80, 0x0860, 0x0640, 0x0420, 0x0200,  9,  9 },
        { 0x0060, 0x0040, 0x0020, 0x0000, 0x0000, 0x0000,   0, 0 },
        { 0x0860, 0x0640, 0x0420, 0x0200, 0x0000, 0x0000, 10, 10 },
        { 0x0640, 0x0420, 0x0200, 0x0000, 0x0000, 0x0000,  9,  0 },
        { 0x000A, 0x0008, 0x0006, 0x0004, 0x0002, 0x0000,  9, 10 },
        { 0x0008, 0x0006, 0x0004, 0x0002, 0x0000, 0x0000, 10,  0 },
        { 0x0808, 0x0606, 0x0404, 0x0202, 0x0000, 0x0000,  9,  0 },
        { 0x0A0A, 0x0808, 0x0606, 0x0404, 0x0202, 0x0000, 10,  9 },
        { 0x0FA0, 0x0C80, 0x0A60, 0x0840, 0x0620, 0x0400, 10,  5 },
        { 0x0F80, 0x0C60, 0x0A40, 0x0820, 0x0600, 0x0200,  5,  3 },
        { 0x0800, 0x0600, 0x0400, 0x0200, 0x0000, 0x0000, 10, 10 },
        { 0x0600, 0x0400, 0x0200, 0x0000, 0x0000, 0x0000, 12,  0 },
        { 0x0C86, 0x0A64, 0x0842, 0x0620, 0x0400, 0x0200, 10,  5 } };
#endif
#ifdef MEDIA489_F20E_F20J_P20JA_P20JB
int16_t G2025_as_Graphic558_CreatureReplacementColorSets[13][2] = {
        {  90,  90 },
        {  00,  00 },
        { 100, 100 },
        {  90,  00 },
        {  90, 100 },
        { 100,  00 },
        {  90,  00 },
        { 100,  90 },
        { 100,  50 },
        {  50,  30 },
        { 100, 100 },
        { 120,  00 },
        { 100,  50 } };
#endif
#ifdef MEDIA712_I34E_I34M_F31E_F31J_P31J
int16_t G2025_as_Graphic558_CreatureReplacementColorSets[13][2] = {
        {  9,  9 },
        {  0,  0 },
        { 10, 10 },
        {  9,  0 },
        {  9, 10 },
        { 10,  0 },
        {  9,  0 },
        { 10,  9 },
        { 10,  5 },
        {  5,  3 },
        { 10, 10 },
        { 12,  0 },
        { 10,  5 } };
#endif
#ifdef MEDIA417_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_P20JA_P20JB
unsigned char G0221_auc_Graphic558_PaletteChanges_Creature_D3[16] = { 0, 120, 10, 30, 40, 30, 0, 60, 30, 0, 0, 110, 0, 20, 0, 130 };
unsigned char G0222_auc_Graphic558_PaletteChanges_Creature_D2[16] = { 0, 10, 20, 30, 40, 30, 60, 70, 50, 0, 0, 110, 120, 130, 140, 150 };
#endif
#ifdef MEDIA379_G14ED_G20E_G21E_X30J_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
unsigned char G0221_auc_Graphic558_PaletteChanges_Creature_D3[16] = { 0, 12, 1, 3, 4, 3, 0, 6, 3, 0, 0, 11, 0, 2, 0, 13 };
unsigned char G0222_auc_Graphic558_PaletteChanges_Creature_D2[16] = { 0, 1, 2, 3, 4, 3, 6, 7, 5, 0, 0, 11, 12, 13, 14, 15 };
#endif
#ifdef MEDIA420_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
char G0223_aac_Graphic558_ShiftSets[3][8] = {
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
int16_t G0223_aac_Graphic558_ShiftSets[3][8] = {
#endif
#ifdef MEDIA365_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        { 0, 1, 2, 3, 0, -3, -2, -1 },   /* D0 Back or D1 Front */
        { 0, 1, 1, 2, 0, -2, -1, -1 },   /* D1 Back or D2 Front */
        { 0, 1, 1, 1, 0, -1, -1, -1 } }; /* D2 Back or D3 Front */
#endif
#ifdef MEDIA353_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
unsigned char G0224_aaaauc_Graphic558_CreatureCoordinateSets[3][11][5][2] = {
        /* { { X, Y }, { X, Y }, { X, Y }, { X, Y }, { X, Y } } */
        { { {  95,  70 }, { 127,  70 }, { 129,  75 }, {  93,  75 }, { 111,  72 } },     /* D3C */
          { { 131,  70 }, { 163,  70 }, { 158,  75 }, { 120,  75 }, { 145,  72 } },     /* D3L */
          { {  59,  70 }, {  91,  70 }, { 107,  75 }, {  66,  75 }, {  79,  72 } },     /* D3R */
          { {  92,  81 }, { 131,  81 }, { 132,  90 }, {  91,  90 }, { 111,  85 } },     /* D2C */
          { {  99,  81 }, { 146,  81 }, { 135,  90 }, {  80,  90 }, { 120,  85 } },     /* D2L */
          { {  77,  81 }, { 124,  81 }, { 143,  90 }, {  89,  90 }, { 105,  85 } },     /* D2R */
          { {  83, 103 }, { 141, 103 }, { 148, 119 }, {  76, 119 }, { 109, 111 } },     /* D1C */
          { {  46, 103 }, { 118, 103 }, { 101, 119 }, {   0,   0 }, {  79, 111 } },     /* D1L */
          { { 107, 103 }, { 177, 103 }, {   0,   0 }, { 123, 119 }, { 144, 111 } },     /* D1R */
          { {   0,   0 }, {  67, 135 }, {   0,   0 }, {   0,   0 }, {   0,   0 } },     /* D0L */
          { { 156, 135 }, {   0,   0 }, {   0,   0 }, {   0,   0 }, {   0,   0 } } },   /* D0R */
        { { {  94,  75 }, { 128,  75 }, { 111,  70 }, { 111,  72 }, { 111,  75 } },     /* D3C */
          { { 120,  75 }, { 158,  75 }, { 149,  70 }, { 145,  72 }, { 150,  75 } },     /* D3L */
          { {  66,  75 }, { 104,  75 }, {  75,  70 }, {  79,  72 }, {  73,  75 } },     /* D3R */
          { {  91,  90 }, { 132,  90 }, { 111,  83 }, { 111,  85 }, { 111,  90 } },     /* D2C */
          { {  80,  90 }, { 135,  90 }, { 125,  83 }, { 120,  85 }, { 125,  90 } },     /* D2L */
          { {  89,  90 }, { 143,  90 }, {  99,  83 }, { 105,  85 }, {  98,  90 } },     /* D2R */
          { {  81, 119 }, { 142, 119 }, { 111, 105 }, { 111, 111 }, { 111, 119 } },     /* D1C */
          { {   0,   0 }, { 101, 119 }, {  84, 105 }, {  70, 111 }, {  77, 119 } },     /* D1L */
          { { 123, 119 }, {   0,   0 }, { 139, 105 }, { 153, 111 }, { 146, 119 } },     /* D1R */
          { {   0,   0 }, {  83, 130 }, {  57, 121 }, {  47, 126 }, {  57, 130 } },     /* D0L */
          { { 140, 130 }, {   0,   0 }, { 166, 121 }, { 176, 126 }, { 166, 130 } } },   /* D0R */
        { { {  95,  59 }, { 127,  59 }, { 129,  61 }, {  93,  61 }, { 111,  60 } },     /* D3C */
          { { 131,  59 }, { 163,  59 }, { 158,  61 }, { 120,  61 }, { 145,  60 } },     /* D3L */
          { {  59,  59 }, {  91,  59 }, { 107,  61 }, {  66,  61 }, {  79,  60 } },     /* D3R */
          { {  92,  65 }, { 131,  65 }, { 132,  67 }, {  91,  67 }, { 111,  66 } },     /* D2C */
          { {  99,  65 }, { 146,  65 }, { 135,  67 }, {  80,  67 }, { 120,  66 } },     /* D2L */
          { {  77,  65 }, { 124,  65 }, { 143,  67 }, {  89,  67 }, { 105,  66 } },     /* D2R */
          { {  83,  79 }, { 141,  79 }, { 148,  85 }, {  76,  85 }, { 111,  81 } },     /* D1C */
          { {  46,  79 }, { 118,  79 }, { 101,  85 }, {   0,   0 }, {  79,  81 } },     /* D1L */
          { { 107,  79 }, { 177,  79 }, {   0,   0 }, { 123,  85 }, { 144,  81 } },     /* D1R */
          { {   0,   0 }, {  67,  96 }, {   0,   0 }, {   0,   0 }, {   0,   0 } },     /* D0L */
          { { 156,  96 }, {   0,   0 }, {   0,   0 }, {   0,   0 }, {   0,   0 } } } }; /* D0R */
int16_t G0225_aai_Graphic558_CenteredExplosionCoordinates[15][2] = {
        /* { X, Y } */
        { 111, 47 },   /* D4C */
        {  57, 47 },   /* D4L */
        { 167, 47 },   /* D4R */
        { 111, 50 },   /* D3C */
        {  45, 50 },   /* D3L */
        { 179, 50 },   /* D3R */
        { 111, 53 },   /* D2C */
        {  20, 53 },   /* D2L */
        { 205, 53 },   /* D2R */
        { 111, 57 },   /* D1C */
        { -30, 57 },   /* D1L */
        { 253, 57 },   /* D1R */
        { 111, 60 },   /* D0C */
        { -53, 60 },   /* D0L */
        { 276, 60 } }; /* D0R */
int16_t G0226_aaai_Graphic558_ExplosionCoordinates[15][2][2] = {
        /* { { Front Left X, Front Left Y }, { Front Right X, Front Right Y } } */
        { { 100, 47 }, { 122, 47 } },   /* D4C */
        { {  52, 47 }, {  76, 47 } },   /* D4L */
        { { 148, 47 }, { 172, 47 } },   /* D4R */
        { {  95, 50 }, { 127, 50 } },   /* D3C */
        { {  31, 50 }, {  63, 50 } },   /* D3L */
        { { 159, 50 }, { 191, 50 } },   /* D3R */
        { {  92, 53 }, { 131, 53 } },   /* D2C */
        { {  -3, 53 }, {  46, 53 } },   /* D2L */
        { { 177, 53 }, { 226, 53 } },   /* D2R */
        { {  83, 57 }, { 141, 57 } },   /* D1C */
        { { -54, 57 }, {  18, 57 } },   /* D1L */
        { { 207, 57 }, { 277, 57 } },   /* D1R */
        { {   0,  0 }, {   0,  0 } },   /* D0C */
        { { -73, 60 }, { -33, 60 } },   /* D0L */
        { { 256, 60 }, { 296, 60 } } }; /* D0R */
int16_t G0227_aai_Graphic558_RebirthStep2ExplosionCoordinates[7][3] = {
        /* { X, Y, Scale } */
        { 113, 57, 12 },   /* D3C */
        {  24, 57, 12 },   /* D3L */
        { 195, 57, 12 },   /* D3R */
        { 111, 63, 16 },   /* D2C */
        {  12, 63, 16 },   /* D2L */
        { 213, 63, 16 },   /* D2R */
        { 112, 76, 24 } }; /* D1C */
int16_t G0228_aai_Graphic558_RebirthStep1ExplosionCoordinates[7][3] = {
        /* { X, Y, Scale } */
        { 112, 53, 15 },   /* D3C */
        {  24, 53, 15 },   /* D3L */
        { 194, 53, 15 },   /* D3R */
        { 112, 59, 20 },   /* D2C */
        {  15, 59, 20 },   /* D2L */
        { 208, 59, 20 },   /* D2R */
        { 112, 70, 32 } }; /* D1C */
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
unsigned char G2036_auc_RebirthStep2ExplosionScale[7] = { 12, 12, 12, 16, 16, 16, 24 }; /* Scale column from G0227_aai_Graphic558_RebirthStep2ExplosionCoordinates */
unsigned char G2037_auc_RebirthStep1ExplosionScale[7] = { 15, 15, 15, 20, 20, 20, 32 }; /* Scale column from G0228_aai_Graphic558_RebirthStep1ExplosionCoordinates */
#endif
int16_t G0230_i_CurrentFloorSet = -1;
int16_t G0231_i_CurrentWallSet = -1;


#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
overlay "show"
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
segment "show"
#endif

#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
STATICFUNCTION void F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal();
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
STATICFUNCTION void F0674_F0128_sub(int16_t P2065_i_GraphicIndex, unsigned char* P2066_puc_Bitmap);
/*#ifdef MEDIA458_P20JA_P20JB*/
static void F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(unsigned char* P0101_puc_Bitmap_Source, unsigned char* P0102_puc_Bitmap_Destination);
/*#endif*/
#endif
STATICFUNCTION void F0122_DUNGEONVIEW_DrawSquareD1L(
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t P0165_i_Direction SEPARATOR
int16_t P0166_i_MapX      SEPARATOR
int16_t P0167_i_MapY
#endif
);
STATICFUNCTION void F0123_DUNGEONVIEW_DrawSquareD1R(
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t P0168_i_Direction SEPARATOR
int16_t P0169_i_MapX      SEPARATOR
int16_t P0170_i_MapY
#endif
);
STATICFUNCTION void F0124_DUNGEONVIEW_DrawSquareD1C(
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t P0171_i_Direction SEPARATOR
int16_t P0172_i_MapX      SEPARATOR
int16_t P0173_i_MapY
#endif
);
STATICFUNCTION void F0125_DUNGEONVIEW_DrawSquareD0L(
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t          P0174_i_Direction SEPARATOR
int16_t          P0175_i_MapX      SEPARATOR
int16_t          P0176_i_MapY
#endif
);
STATICFUNCTION void F0126_DUNGEONVIEW_DrawSquareD0R(
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t          P0177_i_Direction SEPARATOR
int16_t          P0178_i_MapX      SEPARATOR
int16_t          P0179_i_MapY
#endif
);
STATICFUNCTION void F0127_DUNGEONVIEW_DrawSquareD0C(
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t          P0180_i_Direction SEPARATOR
int16_t          P0181_i_MapX      SEPARATOR
int16_t          P0182_i_MapY
#endif
);


#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#include "BMPSIZE.C"
#endif

STATICFUNCTION void F0093_DUNGEONVIEW_ApplyCreatureReplacementColors(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0096_i_ReplacedColor, P0097_i_ReplacementColorSetIndex)
#endif
REGISTER int16_t P0096_i_ReplacedColor            SEPARATOR
REGISTER int16_t P0097_i_ReplacementColorSetIndex FINAL_SEPARATOR
{
        REGISTER int16_t L0069_i_PaletteIndex;


#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        if (!G2136_B_EvaluatingMemoryRequirements) {
#endif
#ifdef MEDIA078_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_A36M_A31E_A31M_A33M_A35E_A35M_X31J
                for (L0069_i_PaletteIndex = 0; L0069_i_PaletteIndex < 6; L0069_i_PaletteIndex++) {
                        G0021_aaui_Graphic562_Palette_DungeonView[L0069_i_PaletteIndex][P0096_i_ReplacedColor] = G0220_as_Graphic558_CreatureReplacementColorSets[P0097_i_ReplacementColorSetIndex].RGBColor[L0069_i_PaletteIndex];
                }
                G0222_auc_Graphic558_PaletteChanges_Creature_D2[P0096_i_ReplacedColor] = G0220_as_Graphic558_CreatureReplacementColorSets[P0097_i_ReplacementColorSetIndex].D2ReplacementColor;
                G0221_auc_Graphic558_PaletteChanges_Creature_D3[P0096_i_ReplacedColor] = G0220_as_Graphic558_CreatureReplacementColorSets[P0097_i_ReplacementColorSetIndex].D3ReplacementColor;
#endif
#ifdef MEDIA496_F20E_F20J_P20JA_P20JB_I34E_I34M_F31E_F31J_P31J
                F0695_SetCreatureReplacementColors(P0096_i_ReplacedColor, P0097_i_ReplacementColorSetIndex);
                G0222_auc_Graphic558_PaletteChanges_Creature_D2[P0096_i_ReplacedColor] = G2025_as_Graphic558_CreatureReplacementColorSets[P0097_i_ReplacementColorSetIndex][0];
                G0221_auc_Graphic558_PaletteChanges_Creature_D3[P0096_i_ReplacedColor] = G2025_as_Graphic558_CreatureReplacementColorSets[P0097_i_ReplacementColorSetIndex][1];
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        }
#endif
}

BOOLEAN F0094_DUNGEONVIEW_LoadFloorSet(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0098_i_FloorSet)
#endif
REGISTER int16_t P0098_i_FloorSet FINAL_SEPARATOR
#define AP0098_i_GraphicIndex P0098_i_FloorSet
{
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if (G0230_i_CurrentFloorSet != P0098_i_FloorSet) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER BOOLEAN L2424_B_NewFloorSet;


        if ((L2424_B_NewFloorSet = (G0230_i_CurrentFloorSet != P0098_i_FloorSet)) != 0) {
#endif
                G0230_i_CurrentFloorSet = P0098_i_FloorSet;
                AP0098_i_GraphicIndex = (P0098_i_FloorSet * C002_FLOOR_SET_GRAPHIC_COUNT) + M644_GRAPHIC_FIRST_FLOOR_SET;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0098_i_GraphicIndex, G0084_puc_Bitmap_Floor, 0, 0);
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0098_i_GraphicIndex + 1, G0085_puc_Bitmap_Ceiling, 0, 0);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0098_i_GraphicIndex, F0631_GetBitmapPointer(G2108_Floor), 0, 0);
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0098_i_GraphicIndex + 1, F0631_GetBitmapPointer(G2109_Ceiling), 0, 0);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0098_i_GraphicIndex, F0631_GetBitmapPointer(G2108_Floor));
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0098_i_GraphicIndex + 1, F0631_GetBitmapPointer(G2109_Ceiling));
#endif
        }
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        return L2424_B_NewFloorSet;
#endif
}

#ifdef MEDIA535_F20E_F20J_X30J_P20JA_P20JB_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
STATICFUNCTION void F1000_(
int16_t P2063_i_GraphicIndex1 SEPARATOR
int16_t P2064_i_GraphicIndex2 FINAL_SEPARATOR
{
        REGISTER unsigned char* L2425_puc_;
        REGISTER unsigned char* L2426_puc_;
        REGISTER int16_t L2428_i_Width;
        REGISTER int16_t L2429_i_Height;
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
        int16_t L2427_ai_XYZ[4];
#endif
        REGISTER int16_t L2430_i_Unreferenced; /* BUG0_00 Useless code */
#ifdef MEDIA744_A36M
        int16_t L1874_i_Unreferenced;
#endif


        L2426_puc_ = F0631_GetBitmapPointer(P2063_i_GraphicIndex1);
        L2425_puc_ = F0631_GetBitmapPointer(P2064_i_GraphicIndex2);
        L2428_i_Width = M100_PIXEL_WIDTH(L2426_puc_);
#ifdef MEDIA586_X30J_P20JA_P20JB_X31J
        if (!(L2428_i_Width & 1)) {
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
        if ((L2428_i_Width & 15) == 0) {
#endif
#ifdef MEDIA551_F20E_F20J_F31E_F31J
        if ((L2428_i_Width & 31) == 0) {
#endif
                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(L2426_puc_, L2425_puc_);
        } else {
                L2429_i_Height = M101_PIXEL_HEIGHT(L2426_puc_);
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                M704_ZONE_LEFT(L2427_ai_XYZ) = 0;
                M705_ZONE_RIGHT(L2427_ai_XYZ) = L2428_i_Width - 1;
                M706_ZONE_TOP(L2427_ai_XYZ) = 0;
                M707_ZONE_BOTTOM(L2427_ai_XYZ) = L2429_i_Height - 1;
#endif
                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(L2426_puc_, G0296_puc_Bitmap_Viewport);
                F0615_CopyBitmapDimensions(L2426_puc_, L2425_puc_);
                F0134_VIDEO_FillBitmap(M772_CAST_PC(L2425_puc_), C10_COLOR_FLESH, L2428_i_Width, L2429_i_Height);
#ifdef MEDIA579_X30J_P20JA_P20JB
                F0654_Call_F0132_VIDEO_Blit(M772_CAST_PC(G0296_puc_Bitmap_Viewport), M772_CAST_PC(L2425_puc_), L2427_ai_XYZ, 2 - (L2428_i_Width & 1), 0, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA488_F20E_F20J
                F0654_Call_F0132_VIDEO_Blit(M772_CAST_PC(G0296_puc_Bitmap_Viewport), M772_CAST_PC(L2425_puc_), L2427_ai_XYZ, 32 - (L2428_i_Width & 31), 0, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA670_F31E_F31J
                F0654_Call_F0132_VIDEO_Blit(M772_CAST_PC(G0296_puc_Bitmap_Viewport), M772_CAST_PC(L2425_puc_), F0627_GetTemporaryZoneInitializedFromDimensions(L2428_i_Width, L2429_i_Height), 32 - (L2428_i_Width & 31), 0, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA692_X31J
                F0654_Call_F0132_VIDEO_Blit(G0296_puc_Bitmap_Viewport, L2425_puc_, F0627_GetTemporaryZoneInitializedFromDimensions(L2428_i_Width, L2429_i_Height), 2 - (L2428_i_Width & 1), 0, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                F0654_Call_F0132_VIDEO_Blit(G0296_puc_Bitmap_Viewport, L2425_puc_, F0627_GetTemporaryZoneInitializedFromDimensions(L2428_i_Width, L2429_i_Height), 16 - (L2428_i_Width & 15), 0, CM1_COLOR_NO_TRANSPARENCY);
#endif
                G0297_B_DrawFloorAndCeilingRequested = C1_TRUE;
        }
}
#endif

BOOLEAN F0095_DUNGEONVIEW_LoadWallSet(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0099_i_WallSet)
#endif
REGISTER int16_t P0099_i_WallSet FINAL_SEPARATOR
#define AP0099_i_GraphicIndex P0099_i_WallSet
{
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER BOOLEAN L2431_B_NewWallSet;
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        REGISTER unsigned char** L0071_ppuc_Bitmaps;
#endif
        REGISTER int16_t L0070_i_WallSetLastGraphicIndex;
#ifdef MEDIA577_X30J
        REGISTER unsigned int16_t* L0071_pi_BitmapIndices;
#endif


#ifdef MEDIA018_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J
        if ((G0231_i_CurrentWallSet != P0099_i_WallSet) || G0523_B_RestartGameRequested) {
#endif
#ifdef MEDIA458_P20JA_P20JB
        if (G0231_i_CurrentWallSet != P0099_i_WallSet) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if ((L2431_B_NewWallSet = (G0231_i_CurrentWallSet != P0099_i_WallSet)) != 0) {
#endif
                G0231_i_CurrentWallSet = P0099_i_WallSet;
                AP0099_i_GraphicIndex = (P0099_i_WallSet * M647_WALL_SET_GRAPHIC_COUNT) + M646_GRAPHIC_FIRST_WALL_SET;
#ifdef MEDIA062_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_11_OPTIMIZATION Comma removed */
                L0071_ppuc_Bitmaps = &G0709_puc_Bitmap_WallSet_DoorFrameFront, L0070_i_WallSetLastGraphicIndex = AP0099_i_GraphicIndex + M647_WALL_SET_GRAPHIC_COUNT;
#endif
#ifdef MEDIA267_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G /* CHANGE7_11_OPTIMIZATION Comma removed */
                L0071_ppuc_Bitmaps = &G0709_puc_Bitmap_WallSet_DoorFrameFront;
#endif
#ifdef MEDIA577_X30J
                L0071_pi_BitmapIndices = (unsigned int16_t*)&G2116_DoorFrameFrontD0C;
#endif
#ifdef MEDIA280_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J /* CHANGE7_11_OPTIMIZATION Comma removed */
                L0070_i_WallSetLastGraphicIndex = AP0099_i_GraphicIndex + M647_WALL_SET_GRAPHIC_COUNT;
#endif

                while (AP0099_i_GraphicIndex < L0070_i_WallSetLastGraphicIndex) {
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
                        F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, *L0071_ppuc_Bitmaps++, 0, 0);
#endif
#ifdef MEDIA353_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, *L0071_ppuc_Bitmaps--, 0, 0);
#endif
#ifdef MEDIA577_X30J
                        F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(*L0071_pi_BitmapIndices--), 0, 0);
#endif
                }
#endif
#ifdef MEDIA489_F20E_F20J_P20JA_P20JB
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2116_DoorFrameFrontD0C), 0, 0);
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2117_DoorFrameLeftD1C), 0, 0);
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2118_DoorFrameLeftD2C), 0, 0);
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2119_DoorFrameLeftD3C), 0, 0);
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2120_DoorFrameLeftD3L), 0, 0);
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2112_DoorFrameTopD1LCR), 0, 0);
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2115_DoorFrameTopD2LCR), 0, 0);
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G3015_i_WallSet_Wall_D0R), 0, 0);
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G3014_i_WallSet_Wall_D0L), 0, 0);
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G3013_i_WallSet_Wall_D1C), 0, 0);
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G3012_i_WallSet_Wall_D2C), 0, 0);
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G3011_i_WallSet_Wall_D3C), 0, 0);
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G3010_i_WallSet_Wall_D3L2), 0, 0);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2116_DoorFrameFrontD0C));
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2117_DoorFrameLeftD1C));
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2118_DoorFrameLeftD2C));
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2119_DoorFrameLeftD3C));
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2120_DoorFrameLeftD3L));
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2112_DoorFrameTopD1LCR));
                F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2115_DoorFrameTopD2LCR));
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(G0708_puc_Bitmap_WallSet_DoorFrameLeft_D1C, G0710_puc_Bitmap_WallSet_DoorFrameRight_D1C, G0171_auc_Graphic558_Frame_DoorFrameRight_D1C[C4_BYTE_WIDTH], G0171_auc_Graphic558_Frame_DoorFrameRight_D1C[C5_HEIGHT]);
                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(G0697_puc_Bitmap_WallSet_Wall_D3L2, G0696_puc_Bitmap_WallSet_Wall_D3R2, G0712_auc_Graphic558_Frame_Wall_D3R2[C4_BYTE_WIDTH], G0712_auc_Graphic558_Frame_Wall_D3R2[C5_HEIGHT]);
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                F1000_(G2117_DoorFrameLeftD1C, G2196_DoorFrameRightD1C);
#endif
#ifdef MEDIA506_F20E_F20J_X30J
                F1000_(G3010_i_WallSet_Wall_D3L2, G3072_i_WallSet_Wall_D3R2);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                for (L0070_i_WallSetLastGraphicIndex = 0; L0070_i_WallSetLastGraphicIndex < 15; L0070_i_WallSetLastGraphicIndex++) {
                        F0490_MEMORY_LoadDecompressAndExpandGraphic(AP0099_i_GraphicIndex++, F0631_GetBitmapPointer(G2107_WallSet[L0070_i_WallSetLastGraphicIndex]));
                }
#endif
        }
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        return L2431_B_NewWallSet;
#endif
}

void F0096_DUNGEONVIEW_LoadCurrentMapGraphics_CPSDF(
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
void
#endif
)
{
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER int16_t* L0077_pi_GraphicIndices;
#endif
#ifdef MEDIA613_X30J_A36M_A31E_A31M_A33M_A35E_A35M_X31J
        REGISTER int16_t* L0078_pi_GraphicIndex;
#endif
        REGISTER unsigned char* L0076_puc_Multiple;
#define AL0076_puc_CoordinateSet  L0076_puc_Multiple
#define AL0076_puc_CreatureAspect L0076_puc_Multiple
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        REGISTER int16_t* L0077_pi_GraphicIndices;
        REGISTER int16_t L0072_i_Multiple;
        REGISTER int16_t L0073_i_Multiple;
#endif
#define AL0072_i_GraphicIndex         L0072_i_Multiple
#define AL0072_i_ProjectileAspectType L0072_i_Multiple
#define AL0072_i_OrnamentIndex        L0072_i_Multiple
#define AL0072_i_CreatureType         L0072_i_Multiple
#define AL0073_i_WallSet      L0073_i_Multiple
#define AL0073_i_Counter      L0073_i_Multiple
#define AL0073_i_GraphicIndex L0073_i_Multiple
#define AL0073_i_SoundIndex   L0073_i_Multiple
        REGISTER unsigned int16_t L0074_ui_Multiple;
#define AL0074_ui_FloorSet                   L0074_ui_Multiple
#define AL0074_ui_GraphicIndex               L0074_ui_Multiple
#define AL0074_ui_DoorSet                    L0074_ui_Multiple
#define AL0074_ui_OrnamentIndex              L0074_ui_Multiple
#define AL0074_ui_Counter                    L0074_ui_Multiple
#define AL0074_ui_ReplacementColorSetOrdinal L0074_ui_Multiple
#define AL0074_ui_AttackSoundOrdinal         L0074_ui_Multiple
#define AL0074_ui_CreatureGraphicInfo        L0074_ui_Multiple
        REGISTER unsigned int16_t L0075_ui_Multiple;
#define AL0075_ui_Unknown      L0075_ui_Multiple
#define AL0075_ui_WallSet      L0075_ui_Multiple
#define AL0075_ui_GraphicCount L0075_ui_Multiple
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        int16_t* L0078_pi_GraphicIndex;
        unsigned char L0079_auc_DoorSets[2];
        int16_t L0080_i_CreatureTypeIndex;
        BOOLEAN L0081_B_FirstFunctionCallOrSmallHeapMemory;
#endif
        int16_t L0082_i_Unreferenced; /* BUG0_00 Useless code */
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER int16_t L0072_i_Multiple;
#define AL0072_i_MaximumSoundIndex    L0072_i_Multiple
        REGISTER int16_t L0073_i_Multiple;
        REGISTER int16_t L0084_i_Multiple;
#endif
#define AL0084_i_Unknown         L0084_i_Multiple
#define AL0084_i_OrnamentCounter L0084_i_Multiple
        int16_t L0083_i_CreatureAdditionalGraphicCount;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        int16_t L0084_i_Multiple;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        int16_t L0080_i_CreatureTypeIndex;
#endif
        int16_t L0085_i_MapAlcoveGraphicCount;
        int16_t L0086_i_MapFountainGraphicCount;
        BOOLEAN L0087_B_OpenGraphicsDatRequired;
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        BOOLEAN L0081_B_FirstFunctionCallOrSmallHeapMemory;
        unsigned char L0079_auc_DoorSets[2];
#endif
        static BOOLEAN G0232_B_FirstFunctionCall = C1_TRUE;


#ifdef MEDIA022_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_A31M_A33M_F31E_F31J_X31J_P31J
        L0081_B_FirstFunctionCallOrSmallHeapMemory = G0232_B_FirstFunctionCall || !G0661_B_LargeHeapMemory;
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        L0081_B_FirstFunctionCallOrSmallHeapMemory = G0232_B_FirstFunctionCall || !G2040_auc_MemoryFlags[C0_MEM_];
        if (G2136_B_EvaluatingMemoryRequirements) {
                L0087_B_OpenGraphicsDatRequired = C0_FALSE;
        } else {
#endif
                AL0074_ui_FloorSet = G0269_ps_CurrentMap->D.FloorSet;
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_12_OPTIMIZATION */
                AL0075_ui_WallSet = G0269_ps_CurrentMap->D.WallSet;
                if (L0087_B_OpenGraphicsDatRequired = (L0081_B_FirstFunctionCallOrSmallHeapMemory || (AL0074_ui_FloorSet != G0230_i_CurrentFloorSet) || (AL0075_ui_WallSet != G0231_i_CurrentWallSet))) {
#endif
#ifdef MEDIA278_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J /* CHANGE7_12_OPTIMIZATION Use of another variable */
                AL0073_i_WallSet = G0269_ps_CurrentMap->D.WallSet;
                if (L0087_B_OpenGraphicsDatRequired = (L0081_B_FirstFunctionCallOrSmallHeapMemory || (AL0074_ui_FloorSet != G0230_i_CurrentFloorSet) || (AL0073_i_WallSet != G0231_i_CurrentWallSet))) {
#endif
#ifdef MEDIA014_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J
                        F0428_DIALOG_RequireGameDiskInDrive_NoDialogDrawn(C0_DO_NOT_FORCE_DIALOG_DM_CSB, C0_FALSE);
#endif
#ifdef MEDIA592_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        F0428_DIALOG_RequireGameDiskInDrive_NoDialogDrawn(C0_DO_NOT_FORCE_DIALOG_DM_CSB);
#endif
#ifdef MEDIA667_P31J
                        AL0084_i_Unknown = C0_DO_NOT_FORCE_DIALOG_DM_CSB;
#ifndef NOCOPYPROTECTION
                        do {
#endif
                                F0428_DIALOG_RequireGameDiskInDrive_NoDialogDrawn(AL0084_i_Unknown);
#ifndef NOCOPYPROTECTION
                                AL0084_i_Unknown = C2_FORCE_DIALOG_CSB;
                                AL0075_ui_Unknown = F0809_CheckCopyProtectionSide0Track0_CPSX(G0296_puc_Bitmap_Viewport);
                                G0297_B_DrawFloorAndCeilingRequested = C1_TRUE;
                        } while (!AL0075_ui_Unknown);
#endif
#endif
                        F0477_MEMORY_OpenGraphicsDat_CPSDF();
#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
                } else {
                        while (G0625_i_FloppyDriveDMATimeout_CPSDF);
#endif
#endif
                }
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        }
#endif
#ifdef MEDIA278_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J /* CHANGE7_13_OPTIMIZATION Code moved and maximum number of loadable graphics updated */
        L0077_pi_GraphicIndices = (int16_t*)M533_F0468_MEMORY_Allocate((long)(M534_LOADABLE_GRAPHIC_COUNT * sizeof(int16_t)), C0_ALLOCATION_TEMPORARY_ON_TOP_OF_HEAP, MASK0x0400_MEMREQ);
#endif
#ifdef MEDIA270_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_P20JA_P20JB_I34E_I34M_F31E_F31J_P31J /* CHANGE7_13_OPTIMIZATION Code moved and maximum number of loadable graphics updated */
        F0007_MAIN_CopyBytes(M772_CAST_PC(G0018_ai_Graphic562_MandatoryGraphicIndices), M772_CAST_PC(L0077_pi_GraphicIndices), M543_BYTE_COUNT_INT(sizeof(G0018_ai_Graphic562_MandatoryGraphicIndices)));
#endif
#ifdef MEDIA577_X30J /* CHANGE7_13_OPTIMIZATION Code moved and maximum number of loadable graphics updated */
        F0007_MAIN_CopyBytes(G0018_ai_Graphic562_MandatoryGraphicIndices, L0077_pi_GraphicIndices, M543_BYTE_COUNT_INT((67 + 2) * sizeof(int16_t)));
#endif
#ifdef MEDIA749_A36M_A31E_A31M_A33M_A35E_A35M_X31J /* CHANGE7_13_OPTIMIZATION Code moved and maximum number of loadable graphics updated */
        F0007_MAIN_CopyBytes(G0018_ai_Graphic562_MandatoryGraphicIndices, L0077_pi_GraphicIndices, M543_BYTE_COUNT_INT((M531_MANDATORY_GRAPHIC_COUNT + 1 - 1) * sizeof(int16_t)));
#endif
#ifdef MEDIA278_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J /* CHANGE7_13_OPTIMIZATION Code moved and maximum number of loadable graphics updated */
        AL0075_ui_GraphicCount = M531_MANDATORY_GRAPHIC_COUNT;
#endif
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        F0094_DUNGEONVIEW_LoadFloorSet(AL0074_ui_FloorSet);
#endif
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_12_OPTIMIZATION */
        F0095_DUNGEONVIEW_LoadWallSet(AL0075_ui_WallSet);
#endif
#ifdef MEDIA272_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB /* CHANGE7_12_OPTIMIZATION Use of another variable */
        F0095_DUNGEONVIEW_LoadWallSet(AL0073_i_WallSet);
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        if (!G2136_B_EvaluatingMemoryRequirements) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                AL0074_ui_FloorSet = F0094_DUNGEONVIEW_LoadFloorSet(AL0074_ui_FloorSet);
                AL0073_i_WallSet = F0095_DUNGEONVIEW_LoadWallSet(AL0073_i_WallSet);
#endif
#ifdef MEDIA707_I34E_I34M
        }
#endif
#ifdef MEDIA050_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_A31E_A31M_A33M_F31E_F31J_X31J
        if (G0661_B_LargeHeapMemory) {
#endif
#ifdef MEDIA758_A36M_A35E_A35M
        if (G2040_auc_MemoryFlags[C1_MEM_FLIPPED_WALS]) {
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                G0074_puc_Bitmap_Temporary = F0468_MEMORY_Allocate((long)M075_BITMAP_BYTE_COUNT(144, 71), C0_ALLOCATION_TEMPORARY_ON_TOP_OF_HEAP);
                G0578_B_UseByteBoxCoordinates = C1_TRUE;
                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(G0095_puc_Bitmap_WallD3LCR_Native = G0698_puc_Bitmap_WallSet_Wall_D3LCR, G0074_puc_Bitmap_Temporary, G0163_aauc_Graphic558_Frame_Walls[M600_VIEW_SQUARE_D3C][C4_BYTE_WIDTH], G0163_aauc_Graphic558_Frame_Walls[M600_VIEW_SQUARE_D3C][C5_HEIGHT]);
                F0134_VIDEO_FillBitmap(G0090_puc_Bitmap_WallD3LCR_Flipped, C10_COLOR_FLESH, M076_BITMAP_UNIT_COUNT(128, 51));
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                F0132_VIDEO_Blit(G0074_puc_Bitmap_Temporary, G0090_puc_Bitmap_WallD3LCR_Flipped, G0161_auc_Graphic558_Box_WallBitmap_D3LCR, 11, 0, C064_BYTE_WIDTH, C064_BYTE_WIDTH, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0132_VIDEO_Blit(G0074_puc_Bitmap_Temporary, G0090_puc_Bitmap_WallD3LCR_Flipped, G0161_auc_Graphic558_Box_WallBitmap_D3LCR, 11, 0, C064_BYTE_WIDTH, C064_BYTE_WIDTH, CM1_COLOR_NO_TRANSPARENCY, 51, 51);
#endif
                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(G0096_puc_Bitmap_WallD2LCR_Native = G0699_puc_Bitmap_WallSet_Wall_D2LCR, G0074_puc_Bitmap_Temporary, G0163_aauc_Graphic558_Frame_Walls[M603_VIEW_SQUARE_D2C][C4_BYTE_WIDTH], G0163_aauc_Graphic558_Frame_Walls[M603_VIEW_SQUARE_D2C][C5_HEIGHT]);
                F0134_VIDEO_FillBitmap(G0091_puc_Bitmap_WallD2LCR_Flipped, C10_COLOR_FLESH, M076_BITMAP_UNIT_COUNT(144, 71));
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                F0132_VIDEO_Blit(G0074_puc_Bitmap_Temporary, G0091_puc_Bitmap_WallD2LCR_Flipped, G0162_auc_Graphic558_Box_WallBitmap_D2LCR, 8, 0, C072_BYTE_WIDTH, C072_BYTE_WIDTH, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0132_VIDEO_Blit(G0074_puc_Bitmap_Temporary, G0091_puc_Bitmap_WallD2LCR_Flipped, G0162_auc_Graphic558_Box_WallBitmap_D2LCR, 8, 0, C072_BYTE_WIDTH, C072_BYTE_WIDTH, CM1_COLOR_NO_TRANSPARENCY, 71, 71);
#endif
                F0469_MEMORY_FreeAtHeapTop((long)M075_BITMAP_BYTE_COUNT(144, 71));
                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(G0097_puc_Bitmap_WallD1LCR_Native = G0700_puc_Bitmap_WallSet_Wall_D1LCR, G0092_puc_Bitmap_WallD1LCR_Flipped, G0163_aauc_Graphic558_Frame_Walls[M606_VIEW_SQUARE_D1C][C4_BYTE_WIDTH], G0163_aauc_Graphic558_Frame_Walls[M606_VIEW_SQUARE_D1C][C5_HEIGHT]);
                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(G0098_puc_Bitmap_WallD0L_Native = G0701_puc_Bitmap_WallSet_Wall_D0L, G0094_puc_Bitmap_WallD0R_Flipped, G0163_aauc_Graphic558_Frame_Walls[M610_VIEW_SQUARE_D0L][C4_BYTE_WIDTH], G0163_aauc_Graphic558_Frame_Walls[M610_VIEW_SQUARE_D0L][C5_HEIGHT]);
                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(G0099_puc_Bitmap_WallD0R_Native = G0702_puc_Bitmap_WallSet_Wall_D0R, G0093_puc_Bitmap_WallD0L_Flipped, G0163_aauc_Graphic558_Frame_Walls[M610_VIEW_SQUARE_D0L][C4_BYTE_WIDTH], G0163_aauc_Graphic558_Frame_Walls[M610_VIEW_SQUARE_D0L][C5_HEIGHT]);
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(G4052_puc_Bitmap_Floor_Native = G0084_puc_Bitmap_Floor, G4050_puc_Bitmap_Floor_Flipped, 112, 70);
                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(G4053_puc_Bitmap_Ceiling_Native = G0085_puc_Bitmap_Ceiling, G4051_puc_Bitmap_Ceiling_Flipped, 112, 29);
#endif
#ifdef MEDIA506_F20E_F20J_X30J
                F1000_(G3011_i_WallSet_Wall_D3C, G3049_i_WallSetFlipped_Wall_D3C);
                F1000_(G3012_i_WallSet_Wall_D2C, G3052_i_WallSetFlipped_Wall_D2C);
                F1000_(G3013_i_WallSet_Wall_D1C, G3055_i_WallSetFlipped_Wall_D1C);
                F1000_(G3014_i_WallSet_Wall_D0L, G3059_i_WallSetFlipped_Wall_D0R);
                F1000_(G3015_i_WallSet_Wall_D0R, G3058_i_WallSetFlipped_Wall_D0L);
#endif
#ifdef MEDIA670_F31E_F31J
                if (AL0074_ui_FloorSet || G0232_B_FirstFunctionCall) {
                        F1000_(G2108_Floor, G3048_WallSetFlipped[C15_WALL_]);
                        F1000_(G2109_Ceiling, G3048_WallSetFlipped[C16_WALL_]);
                }
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                if (AL0073_i_WallSet || G0232_B_FirstFunctionCall) {
                        F1000_(G2107_WallSet[C14_WALL_D3C], G3048_WallSetFlipped[C14_WALL_D3C]);
                        F1000_(G2107_WallSet[C09_WALL_D2C], G3048_WallSetFlipped[C09_WALL_D2C]);
                        F1000_(G2107_WallSet[C04_WALL_D1C], G3048_WallSetFlipped[C04_WALL_D1C]);
                        F1000_(G2107_WallSet[C01_WALL_D0L], G3048_WallSetFlipped[C00_WALL_D0R]);
                        F1000_(G2107_WallSet[C00_WALL_D0R], G3048_WallSetFlipped[C01_WALL_D0L]);
                        F1000_(G2107_WallSet[C12_WALL_D3R], G3048_WallSetFlipped[C13_WALL_D3L]);
                        F1000_(G2107_WallSet[C13_WALL_D3L], G3048_WallSetFlipped[C12_WALL_D3R]);
                        F1000_(G2107_WallSet[C07_WALL_D2R], G3048_WallSetFlipped[C08_WALL_D2L]);
                        F1000_(G2107_WallSet[C08_WALL_D2L], G3048_WallSetFlipped[C07_WALL_D2R]);
                        F1000_(G2107_WallSet[C02_WALL_D1R], G3048_WallSetFlipped[C03_WALL_D1L]);
                        F1000_(G2107_WallSet[C03_WALL_D1L], G3048_WallSetFlipped[C02_WALL_D1R]);
                        F1000_(G2107_WallSet[C10_WALL_D3R2], G3048_WallSetFlipped[C11_WALL_D3L2]);
                        F1000_(G2107_WallSet[C11_WALL_D3L2], G3048_WallSetFlipped[C10_WALL_D3R2]);
                        F1000_(G2107_WallSet[C05_WALL_D2R2], G3048_WallSetFlipped[C06_WALL_D2L2]);
                        F1000_(G2107_WallSet[C06_WALL_D2L2], G3048_WallSetFlipped[C05_WALL_D2R2]);
                }
#endif
#ifdef MEDIA758_A36M_A35E_A35M
        }
#endif
#ifdef MEDIA055_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
        }
#endif
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_13_OPTIMIZATION */
        L0077_pi_GraphicIndices = (int16_t*)F0468_MEMORY_Allocate((long)(M534_LOADABLE_GRAPHIC_COUNT * sizeof(int16_t)), C0_ALLOCATION_TEMPORARY_ON_TOP_OF_HEAP);
        F0007_MAIN_CopyBytes(G0018_ai_Graphic562_MandatoryGraphicIndices, L0077_pi_GraphicIndices, sizeof(G0018_ai_Graphic562_MandatoryGraphicIndices));
        AL0075_ui_GraphicCount = M531_MANDATORY_GRAPHIC_COUNT;
#endif
#ifdef MEDIA124_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G20E_G21E_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_A31E_A31M_A33M_F31E_F31J_X31J_P31J
        if (!G0269_ps_CurrentMap->C.CreatureTypeCount || G0661_B_LargeHeapMemory) {
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        if (!G0269_ps_CurrentMap->C.CreatureTypeCount || G2040_auc_MemoryFlags[C0_MEM_]) {
#endif
/* These graphics are loaded only if there are no creature types allowed on the map (for the Hall of Champions / Prison) or if there is no memory limitation to store all graphics */
/* BUG0_86 Champion portraits, resurrect/reincarnate and rename panel graphics are missing/garbage and the game may crash. If any creature type is allowed on a map containing champion mirrors then these graphics are loaded only if the engine determines that there is no memory limitation to load all graphics (this depends on the amount of memory available at startup). Memory is always considered limited in Dungeon Master for PC and Chaos Strikes Back for PC-9801 so the graphics are never loaded in these versions. This issue only affects custom dungeons. It does not exist in the original dungeons because there are no creature types allowed on the maps containing champion mirrors. This issue also does not affect the demo versions of Dungeon Master for Amiga and Apple IIGS which always load these graphics. The demo dungeons do contain a Skeleton creature on the same map as the champion mirrors */
                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = C040_GRAPHIC_PANEL_RESURRECT_REINCARNATE;
                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = C026_GRAPHIC_CHAMPION_PORTRAITS;
                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = C027_GRAPHIC_PANEL_RENAME_CHAMPION;
#ifdef MEDIA128_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G20E_G21E_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        }
#endif
#ifdef MEDIA062_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J
        L0078_pi_GraphicIndex = &G0675_i_StairsNativeBitmapIndex_Up_Front_D3L;
        AL0073_i_GraphicIndex = (G0269_ps_CurrentMap->D.WallSet * C018_STAIRS_GRAPHIC_COUNT) + M645_GRAPHIC_FIRST_STAIRS;
#endif
#ifdef MEDIA489_F20E_F20J_P20JA_P20JB
        AL0072_i_GraphicIndex = AL0073_i_GraphicIndex = (G0269_ps_CurrentMap->D.WallSet * C018_STAIRS_GRAPHIC_COUNT) + M645_GRAPHIC_FIRST_STAIRS;
#endif
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
        for (AL0072_i_GraphicIndex = AL0073_i_GraphicIndex + C018_STAIRS_GRAPHIC_COUNT; AL0073_i_GraphicIndex < AL0072_i_GraphicIndex; *(L0078_pi_GraphicIndex--) = AL0073_i_GraphicIndex++) {
#endif
#ifdef MEDIA367_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J
        for (AL0072_i_GraphicIndex = AL0073_i_GraphicIndex + C018_STAIRS_GRAPHIC_COUNT; AL0073_i_GraphicIndex < AL0072_i_GraphicIndex; *(L0078_pi_GraphicIndex++) = AL0073_i_GraphicIndex++) {
#endif
#ifdef MEDIA062_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J
                if (!G0661_B_LargeHeapMemory) { /* If heap memory is small (if large, then all these graphics are added later) */
                        L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_GraphicIndex;
                }
        }
#endif
#ifdef MEDIA489_F20E_F20J_P20JA_P20JB
        G0675_i_StairsNativeBitmapIndex_Up_Front_D3L = AL0073_i_GraphicIndex++;
        G0676_i_StairsNativeBitmapIndex_Up_Front_D3C = AL0073_i_GraphicIndex++;
        G0677_i_StairsNativeBitmapIndex_Up_Front_D2L = AL0073_i_GraphicIndex++;
        G0678_i_StairsNativeBitmapIndex_Up_Front_D2C = AL0073_i_GraphicIndex++;
        G0679_i_StairsNativeBitmapIndex_Up_Front_D1L = AL0073_i_GraphicIndex++;
        G0680_i_StairsNativeBitmapIndex_Up_Front_D1C = AL0073_i_GraphicIndex++;
        G0681_i_StairsNativeBitmapIndex_Up_Front_D0C_Left = AL0073_i_GraphicIndex++;
        G0682_i_StairsNativeBitmapIndex_Down_Front_D3L = AL0073_i_GraphicIndex++;
        G0683_i_StairsNativeBitmapIndex_Down_Front_D3C = AL0073_i_GraphicIndex++;
        G0684_i_StairsNativeBitmapIndex_Down_Front_D2L = AL0073_i_GraphicIndex++;
        G0685_i_StairsNativeBitmapIndex_Down_Front_D2C = AL0073_i_GraphicIndex++;
        G0686_i_StairsNativeBitmapIndex_Down_Front_D1L = AL0073_i_GraphicIndex++;
        G0687_i_StairsNativeBitmapIndex_Down_Front_D1C = AL0073_i_GraphicIndex++;
        G0688_i_StairsNativeBitmapIndex_Down_Front_D0C_Left = AL0073_i_GraphicIndex++;
        G0689_i_StairsNativeBitmapIndex_Side_D2L = AL0073_i_GraphicIndex++;
        G0690_i_StairsNativeBitmapIndex_Up_Side_D1L = AL0073_i_GraphicIndex++;
        G0691_i_StairsNativeBitmapIndex_Down_Side_D1L = AL0073_i_GraphicIndex++;
        G0692_i_StairsNativeBitmapIndex_Side_D0L = AL0073_i_GraphicIndex;
        AL0073_i_GraphicIndex = AL0072_i_GraphicIndex;
        if (!G0661_B_LargeHeapMemory) { /* If heap memory is small (if large, then all these graphics are added later) */
                for (AL0072_i_GraphicIndex = AL0073_i_GraphicIndex + C018_STAIRS_GRAPHIC_COUNT; AL0073_i_GraphicIndex < AL0072_i_GraphicIndex; AL0073_i_GraphicIndex++) {
                        L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_GraphicIndex;
                }
        }
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        AL0073_i_GraphicIndex = (G0269_ps_CurrentMap->D.WallSet * M647_WALL_SET_GRAPHIC_COUNT) + M645_GRAPHIC_FIRST_STAIRS;
        for (AL0074_ui_Counter = 0; AL0074_ui_Counter < C018_STAIRS_GRAPHIC_COUNT; G0079_ai_StairsNativeBitmapIndices[AL0074_ui_Counter++] = AL0073_i_GraphicIndex++) {
#ifdef MEDIA622_A31E_A31M_A33M_F31E_F31J_X31J_P31J
                if (!G0661_B_LargeHeapMemory) { /* If heap memory is small (if large, then all these graphics are added later) */
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
                if (!G2040_auc_MemoryFlags[C0_MEM_]) { /* If heap memory is small (if large, then all these graphics are added later) */
#endif
                        L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_GraphicIndex;
                }
        }
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        if (!G2136_B_EvaluatingMemoryRequirements) {
#endif
                F0633_COORD_SetNegativeBitmapIndex(M714_NEGGRAPHIC_STAIRS_UP_D3L2, G0079_ai_StairsNativeBitmapIndices[C00_STAIRS_BITMAP_UP_FRONT_D3L]);
                F0633_COORD_SetNegativeBitmapIndex(M716_NEGGRAPHIC_STAIRS_DOWN_D3L2, G0079_ai_StairsNativeBitmapIndices[C07_STAIRS_BITMAP_DOWN_FRONT_D3L]);
                F0633_COORD_SetNegativeBitmapIndex(M715_NEGGRAPHIC_STAIRS_UP_D3R2, G0079_ai_StairsNativeBitmapIndices[C00_STAIRS_BITMAP_UP_FRONT_D3L]);
                F0633_COORD_SetNegativeBitmapIndex(M717_NEGGRAPHIC_STAIRS_DOWN_D3R2, G0079_ai_StairsNativeBitmapIndices[C07_STAIRS_BITMAP_DOWN_FRONT_D3L]);
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        }
#endif
#endif
#ifdef MEDIA160_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_F20E_F20J_X30J_P20JA
        AL0072_i_GraphicIndex = M564_GRAPHIC_OBJECT_NAMES;
        if (!G0661_B_LargeHeapMemory) {
                AL0072_i_GraphicIndex -= 6; /* Do not load the last 6 sounds (creature attack sounds) when available memory is low */
        }
        AL0073_i_Counter = M719_GRAPHIC_FIRST_SOUND;
        while (AL0073_i_Counter < AL0072_i_GraphicIndex) {
                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_Counter++;
        }
#endif
#ifdef MEDIA470_P20JB_A31E_A31M_A33M_F31E_F31J_X31J_P31J
        AL0072_i_MaximumSoundIndex = M513_SOUND_COUNT;
        if (!G0661_B_LargeHeapMemory) {
                AL0072_i_MaximumSoundIndex -= 16;
        }
        for (AL0073_i_SoundIndex = C00_SOUND_FIRST_BASE; AL0073_i_SoundIndex < AL0072_i_MaximumSoundIndex; AL0073_i_SoundIndex++) {
                if (F0707_ResetSoundBufferAddress(AL0073_i_SoundIndex)) {
                        L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = G0060_as_Graphic562_Sounds[AL0073_i_SoundIndex].GraphicIndex;
                }
        }
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        if (G2040_auc_MemoryFlags[C3_MEM_BASE_SOUNDS]) {
                for (AL0073_i_SoundIndex = C00_SOUND_FIRST_BASE; AL0073_i_SoundIndex < C19_SOUND_FIRST_ATTACK; AL0073_i_SoundIndex++) {
                        if (F0707_ResetSoundBufferAddress(AL0073_i_SoundIndex)) {
#ifdef MEDIA707_I34E_I34M
                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = G0060_as_Graphic562_Sounds[AL0073_i_SoundIndex].GraphicIndex;
#endif
#ifdef MEDIA758_A36M_A35E_A35M
                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = G0060_as_Graphic562_Sounds[AL0073_i_SoundIndex].GraphicIndex | MASK0x4000_DO_NOT_COPY_DIMENSIONS;
#endif
                        }
                }
#ifdef MEDIA758_A36M_A35E_A35M
        }
#endif
                if (G2040_auc_MemoryFlags[C0_MEM_]) {
                        if (G2040_auc_MemoryFlags[C4_MEM_ATTACK_SOUNDS]) {
                                for (AL0073_i_SoundIndex = C19_SOUND_FIRST_ATTACK; AL0073_i_SoundIndex < C28_SOUND_FIRST_MOVEMENT; AL0073_i_SoundIndex++) {
                                        if (F0707_ResetSoundBufferAddress(AL0073_i_SoundIndex)) {
#ifdef MEDIA707_I34E_I34M
                                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = G0060_as_Graphic562_Sounds[AL0073_i_SoundIndex].GraphicIndex;
#endif
#ifdef MEDIA758_A36M_A35E_A35M
                                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = G0060_as_Graphic562_Sounds[AL0073_i_SoundIndex].GraphicIndex | MASK0x4000_DO_NOT_COPY_DIMENSIONS;
#endif
                                        }
                                }
                        }
                        if (G2040_auc_MemoryFlags[C5_MEM_MOVEMENT_SOUNDS]) {
                                for (AL0073_i_SoundIndex = C00_SOUND_FIRST_BASE; AL0073_i_SoundIndex < M513_SOUND_COUNT; AL0073_i_SoundIndex++) {
                                        if (F0707_ResetSoundBufferAddress(AL0073_i_SoundIndex)) {
#ifdef MEDIA707_I34E_I34M
                                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = G0060_as_Graphic562_Sounds[AL0073_i_SoundIndex].GraphicIndex;
#endif
#ifdef MEDIA758_A36M_A35E_A35M
                                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = G0060_as_Graphic562_Sounds[AL0073_i_SoundIndex].GraphicIndex | MASK0x4000_DO_NOT_COPY_DIMENSIONS;
#endif
                                        }
                                }
                        }
                }
#ifdef MEDIA707_I34E_I34M
        }
#endif
#endif
#ifdef MEDIA392_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
        L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = M718_GRAPHIC_READ_FUZZY_SECTOR;
#endif
        for (AL0073_i_Counter = 0; AL0073_i_Counter < C085_OBJECT_ASPECT_COUNT; AL0073_i_Counter++) {
                AL0074_ui_GraphicIndex = M612_GRAPHIC_FIRST_OBJECT + G0209_as_Graphic558_ObjectAspects[AL0073_i_Counter].FirstNativeBitmapRelativeIndex;
                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex;
                if (M007_GET(G0209_as_Graphic558_ObjectAspects[AL0073_i_Counter].GraphicInfo, MASK0x0010_ALCOVE)) {
                        L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex + 1;
                }
        }
        for (AL0073_i_Counter = 0; AL0073_i_Counter < C014_PROJECTILE_ASPECT_COUNT; AL0073_i_Counter++) {
                AL0074_ui_GraphicIndex = M613_GRAPHIC_FIRST_PROJECTILE + G0210_as_Graphic558_ProjectileAspects[AL0073_i_Counter].FirstNativeBitmapRelativeIndex;
                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex;
                if ((AL0072_i_ProjectileAspectType = M007_GET(G0210_as_Graphic558_ProjectileAspects[AL0073_i_Counter].GraphicInfo, MASK0x0003_ASPECT_TYPE)) != C3_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_NO_ROTATION) {
                        L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex + 1;
                        if (AL0072_i_ProjectileAspectType != C2_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_ROTATION) {
                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex + 2;
                        }
                }
        }
        for (AL0073_i_GraphicIndex = M614_GRAPHIC_FIRST_EXPLOSION; AL0073_i_GraphicIndex < M612_GRAPHIC_FIRST_OBJECT; L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_GraphicIndex++);
        L0079_auc_DoorSets[0] = G0269_ps_CurrentMap->D.DoorSet0;
        L0079_auc_DoorSets[1] = G0269_ps_CurrentMap->D.DoorSet1;
#ifdef MEDIA078_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_A36M_A31E_A31M_A33M_A35E_A35M_X31J
        for (AL0074_ui_DoorSet = 0; AL0074_ui_DoorSet <= 1; AL0074_ui_DoorSet++) {
                L0078_pi_GraphicIndex = &G0693_ai_DoorNativeBitmapIndex_Front_D3LCR[AL0074_ui_DoorSet];
                AL0073_i_GraphicIndex = M633_GRAPHIC_FIRST_DOOR_SET + (L0079_auc_DoorSets[AL0074_ui_DoorSet] * C003_DOOR_SET_GRAPHIC_COUNT);
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
                for (AL0072_i_GraphicIndex = AL0073_i_GraphicIndex + C003_DOOR_SET_GRAPHIC_COUNT; AL0073_i_GraphicIndex < AL0072_i_GraphicIndex; L0078_pi_GraphicIndex -= 2) {
#endif
#ifdef MEDIA370_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_A36M_A31E_A31M_A33M_A35E_A35M_X31J
                for (AL0072_i_GraphicIndex = AL0073_i_GraphicIndex + C003_DOOR_SET_GRAPHIC_COUNT; AL0073_i_GraphicIndex < AL0072_i_GraphicIndex; L0078_pi_GraphicIndex += 2) {
#endif
#ifdef MEDIA074_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_A31E_A31M_A33M_X31J
                        if (!G0661_B_LargeHeapMemory) { /* If heap memory is small (if large, then all these graphics are added later) */
#endif
#ifdef MEDIA758_A36M_A35E_A35M
                        if (!G2040_auc_MemoryFlags[C0_MEM_]) { /* If heap memory is small (if large, then all these graphics are added later) */
#endif
                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_GraphicIndex;
                        }
                        *L0078_pi_GraphicIndex = AL0073_i_GraphicIndex++;
                }
        }
#endif
#ifdef MEDIA496_F20E_F20J_P20JA_P20JB_I34E_I34M_F31E_F31J_P31J
        AL0073_i_GraphicIndex = M633_GRAPHIC_FIRST_DOOR_SET + (G0269_ps_CurrentMap->D.DoorSet0 * C003_DOOR_SET_GRAPHIC_COUNT);
        G0693_ai_DoorNativeBitmapIndex_Front_D3LCR[0] = AL0073_i_GraphicIndex++;
        G0694_ai_DoorNativeBitmapIndex_Front_D2LCR[0] = AL0073_i_GraphicIndex++;
        G0695_ai_DoorNativeBitmapIndex_Front_D1LCR[0] = AL0073_i_GraphicIndex++;
        AL0073_i_GraphicIndex = M633_GRAPHIC_FIRST_DOOR_SET + (G0269_ps_CurrentMap->D.DoorSet1 * C003_DOOR_SET_GRAPHIC_COUNT);
        G0693_ai_DoorNativeBitmapIndex_Front_D3LCR[1] = AL0073_i_GraphicIndex++;
        G0694_ai_DoorNativeBitmapIndex_Front_D2LCR[1] = AL0073_i_GraphicIndex++;
        G0695_ai_DoorNativeBitmapIndex_Front_D1LCR[1] = AL0073_i_GraphicIndex++;
#ifdef MEDIA493_F20E_F20J_P20JA_P20JB_F31E_F31J_P31J
        if (!G0661_B_LargeHeapMemory) {
#endif
#ifdef MEDIA707_I34E_I34M
        if (!G2040_auc_MemoryFlags[C0_MEM_]) {
#endif
                for (AL0074_ui_Counter = 0; AL0074_ui_Counter <= 1; AL0074_ui_Counter++) {
                        for (AL0072_i_GraphicIndex = (AL0073_i_GraphicIndex = M633_GRAPHIC_FIRST_DOOR_SET + (L0079_auc_DoorSets[AL0074_ui_Counter] * C003_DOOR_SET_GRAPHIC_COUNT)) + C003_DOOR_SET_GRAPHIC_COUNT; AL0073_i_GraphicIndex < AL0072_i_GraphicIndex; AL0073_i_GraphicIndex++) {
                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_GraphicIndex;
                        }
                }
        }
#endif
        F0010_MAIN_WriteSpacedWords(G0267_ai_CurrentMapAlcoveOrnamentIndices, C003_ALCOVE_ORNAMENT_COUNT, -1, (int16_t)sizeof(int16_t));
        F0010_MAIN_WriteSpacedWords(G0268_ai_CurrentMapFountainOrnamentIndices, C001_FOUNTAIN_ORNAMENT_COUNT, -1, (int16_t)sizeof(int16_t));
        L0085_i_MapAlcoveGraphicCount = 0;
        L0086_i_MapFountainGraphicCount = 0;
        G0266_i_CurrentMapViAltarWallOrnamentIndex = -1;
        for (AL0074_ui_OrnamentIndex = 0; AL0074_ui_OrnamentIndex <= G0269_ps_CurrentMap->B.WallOrnamentCount; AL0074_ui_OrnamentIndex++) {
                AL0073_i_GraphicIndex = M615_GRAPHIC_FIRST_WALL_ORNAMENT + ((AL0072_i_OrnamentIndex = G0261_auc_CurrentMapWallOrnamentIndices[AL0074_ui_OrnamentIndex]) * 2); /* Each wall ornament has 2 graphics */
                G0101_as_CurrentMapWallOrnamentsInfo[AL0074_ui_OrnamentIndex].NativeBitmapIndex = AL0073_i_GraphicIndex;
                for (AL0084_i_OrnamentCounter = 0; AL0084_i_OrnamentCounter < C003_ALCOVE_ORNAMENT_COUNT; AL0084_i_OrnamentCounter++) {
                        if (AL0072_i_OrnamentIndex == G0192_auc_Graphic558_AlcoveOrnamentIndices[AL0084_i_OrnamentCounter]) {
                                G0267_ai_CurrentMapAlcoveOrnamentIndices[L0085_i_MapAlcoveGraphicCount++] = AL0074_ui_OrnamentIndex;
                                if (AL0072_i_OrnamentIndex == 2) { /* Wall ornament #2 is the Vi Altar */
                                        G0266_i_CurrentMapViAltarWallOrnamentIndex = AL0074_ui_OrnamentIndex;
                                }
                        }
                }
                for (AL0084_i_OrnamentCounter = 0; AL0084_i_OrnamentCounter < C001_FOUNTAIN_ORNAMENT_COUNT; AL0084_i_OrnamentCounter++) {
                        if (AL0072_i_OrnamentIndex == G0193_ai_Graphic558_FountainOrnamentIndices[AL0084_i_OrnamentCounter]) {
                                G0268_ai_CurrentMapFountainOrnamentIndices[L0086_i_MapFountainGraphicCount++] = AL0074_ui_OrnamentIndex;
                        }
                }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                AL0076_puc_CoordinateSet = G0205_aaauc_Graphic558_WallOrnamentCoordinateSets[G0101_as_CurrentMapWallOrnamentsInfo[AL0074_ui_OrnamentIndex].CoordinateSet = G0194_auc_Graphic558_WallOrnamentCoordinateSetIndices[AL0072_i_OrnamentIndex]][0];
                if (!G0661_B_LargeHeapMemory) { /* If heap memory is small (if large, then all these graphics are added later) */
                        L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_Counter++;
                        L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_Counter++;
                }
                for (AL0072_i_GraphicIndex = (AL0073_i_Counter = C004_DERIVED_BITMAP_FIRST_WALL_ORNAMENT + (AL0074_ui_OrnamentIndex * 4)) + 4; AL0073_i_Counter < AL0072_i_GraphicIndex; AL0076_puc_CoordinateSet += ((AL0072_i_GraphicIndex - AL0073_i_Counter) == 2) ? 18 * sizeof(unsigned char) : 12 * sizeof(unsigned char)) {
                        F0480_CACHE_ReleaseBlock(AL0073_i_Counter | MASK0x8000_DERIVED_BITMAP);
                        G0639_DerivedBitmapByteCount[AL0073_i_Counter++] = AL0076_puc_CoordinateSet[C4_BYTE_WIDTH] * AL0076_puc_CoordinateSet[C5_HEIGHT];
                }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                G0101_as_CurrentMapWallOrnamentsInfo[AL0074_ui_Counter].CoordinateSet = G0194_auc_Graphic558_WallOrnamentCoordinateSetIndices[AL0072_i_OrnamentIndex];
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
                if (!G2136_B_EvaluatingMemoryRequirements) {
#endif
                        AL0072_i_GraphicIndex = C004_DERIVED_BITMAP_FIRST_WALL_ORNAMENT + (AL0074_ui_Counter * 4);
                        F0480_CACHE_ReleaseBlock(AL0072_i_GraphicIndex | MASK0x8000_DERIVED_BITMAP);
                        G0639_DerivedBitmapByteCount[AL0072_i_GraphicIndex++] = F0459_START_GetScaledBitmapByteCount(G2005_GraphicWidthHeight[AL0073_i_GraphicIndex].Width, G2005_GraphicWidthHeight[AL0073_i_GraphicIndex].Height, M637_SCALE_14_16);
                        F0480_CACHE_ReleaseBlock(AL0072_i_GraphicIndex | MASK0x8000_DERIVED_BITMAP);
                        G0639_DerivedBitmapByteCount[AL0072_i_GraphicIndex++] = F0459_START_GetScaledBitmapByteCount(G2005_GraphicWidthHeight[AL0073_i_GraphicIndex + 1].Width, G2005_GraphicWidthHeight[AL0073_i_GraphicIndex + 1].Height, M637_SCALE_14_16);
                        F0480_CACHE_ReleaseBlock(AL0072_i_GraphicIndex | MASK0x8000_DERIVED_BITMAP);
                        G0639_DerivedBitmapByteCount[AL0072_i_GraphicIndex++] = F0459_START_GetScaledBitmapByteCount(G2005_GraphicWidthHeight[AL0073_i_GraphicIndex].Width, G2005_GraphicWidthHeight[AL0073_i_GraphicIndex].Height, M638_SCALE_21_20);
                        F0480_CACHE_ReleaseBlock(AL0072_i_GraphicIndex | MASK0x8000_DERIVED_BITMAP);
                        G0639_DerivedBitmapByteCount[AL0072_i_GraphicIndex] = F0459_START_GetScaledBitmapByteCount(G2005_GraphicWidthHeight[AL0073_i_GraphicIndex + 1].Width, G2005_GraphicWidthHeight[AL0073_i_GraphicIndex + 1].Height, M638_SCALE_21_20);
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
                }
#endif
#ifdef MEDIA510_F20E_F20J_X30J_P20JA_P20JB_A31E_A31M_A33M_F31E_F31J_X31J_P31J
                if (!G0661_B_LargeHeapMemory) { /* If heap memory is small (if large, then all these graphics are added later) */
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
                if (!G2040_auc_MemoryFlags[C0_MEM_]) { /* If heap memory is small (if large, then all these graphics are added later) */
#endif
                        L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_GraphicIndex++;
                        L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_GraphicIndex++;
                }
#endif
        }
        for (AL0074_ui_OrnamentIndex = 0; AL0074_ui_OrnamentIndex < G0269_ps_CurrentMap->B.FloorOrnamentCount; AL0074_ui_OrnamentIndex++) {
                AL0073_i_GraphicIndex = M616_GRAPHIC_FIRST_FLOOR_ORNAMENT + ((AL0072_i_OrnamentIndex = G0262_auc_CurrentMapFloorOrnamentIndices[AL0074_ui_OrnamentIndex]) * 6);
                G0102_as_CurrentMapFloorOrnamentsInfo[AL0074_ui_OrnamentIndex].NativeBitmapIndex = AL0073_i_GraphicIndex;
                G0102_as_CurrentMapFloorOrnamentsInfo[AL0074_ui_OrnamentIndex].CoordinateSet = G0195_auc_Graphic558_FloorOrnamentCoordinateSetIndices[AL0072_i_OrnamentIndex];
#ifdef MEDIA022_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_A31M_A33M_F31E_F31J_X31J_P31J
                if (!G0661_B_LargeHeapMemory) { /* If heap memory is small (if large, then all these graphics are added later) */
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
                if (!G2040_auc_MemoryFlags[C0_MEM_]) { /* If heap memory is small (if large, then all these graphics are added later) */
#endif
                        for (AL0072_i_GraphicIndex = AL0073_i_GraphicIndex + 6; AL0073_i_GraphicIndex < AL0072_i_GraphicIndex; L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_GraphicIndex++);
                }
        }
        for (AL0074_ui_OrnamentIndex = 0; AL0074_ui_OrnamentIndex < G0269_ps_CurrentMap->C.DoorOrnamentCount; AL0074_ui_OrnamentIndex++) {
                AL0073_i_GraphicIndex = M617_GRAPHIC_FIRST_DOOR_ORNAMENT + (AL0072_i_OrnamentIndex = G0263_auc_CurrentMapDoorOrnamentIndices[AL0074_ui_OrnamentIndex]);
                G0103_as_CurrentMapDoorOrnamentsInfo[AL0074_ui_OrnamentIndex].NativeBitmapIndex = AL0073_i_GraphicIndex;
#ifdef MEDIA022_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_A31M_A33M_F31E_F31J_X31J_P31J
                if (!G0661_B_LargeHeapMemory) { /* If heap memory is small (if large, then all these graphics are added later) */
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
                if (!G2040_auc_MemoryFlags[C0_MEM_]) { /* If heap memory is small (if large, then all these graphics are added later) */
#endif
                        L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_GraphicIndex;
                }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                AL0076_puc_CoordinateSet = G0207_aaauc_Graphic558_DoorOrnamentCoordinateSets[G0103_as_CurrentMapDoorOrnamentsInfo[AL0074_ui_OrnamentIndex].CoordinateSet = G0196_auc_Graphic558_DoorOrnamentCoordinateSetIndices[AL0072_i_OrnamentIndex]][0];
                for (AL0072_i_GraphicIndex = (AL0073_i_GraphicIndex = C068_DERIVED_BITMAP_FIRST_DOOR_ORNAMENT_D3 + AL0074_ui_OrnamentIndex * 2) + 2; AL0073_i_GraphicIndex < AL0072_i_GraphicIndex; AL0076_puc_CoordinateSet += 6) {
                        F0480_CACHE_ReleaseBlock(AL0073_i_GraphicIndex | MASK0x8000_DERIVED_BITMAP);
                        G0639_DerivedBitmapByteCount[AL0073_i_Counter++] = AL0076_puc_CoordinateSet[C4_BYTE_WIDTH] * AL0076_puc_CoordinateSet[C5_HEIGHT];
                }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
                if (!G2136_B_EvaluatingMemoryRequirements) {
#endif
                        G0103_as_CurrentMapDoorOrnamentsInfo[AL0074_ui_OrnamentIndex].CoordinateSet = G0196_auc_Graphic558_DoorOrnamentCoordinateSetIndices[AL0072_i_OrnamentIndex];
                        AL0072_i_GraphicIndex = C068_DERIVED_BITMAP_FIRST_DOOR_ORNAMENT_D3 + AL0074_ui_OrnamentIndex * 2;
                        F0480_CACHE_ReleaseBlock(AL0072_i_GraphicIndex | MASK0x8000_DERIVED_BITMAP);
                        G0639_DerivedBitmapByteCount[AL0072_i_GraphicIndex++] = F0459_START_GetScaledBitmapByteCount(G2005_GraphicWidthHeight[AL0073_i_GraphicIndex].Width, G2005_GraphicWidthHeight[AL0073_i_GraphicIndex].Height, M637_SCALE_14_16);
                        F0480_CACHE_ReleaseBlock(AL0072_i_GraphicIndex | MASK0x8000_DERIVED_BITMAP);
                        G0639_DerivedBitmapByteCount[AL0072_i_GraphicIndex] = F0459_START_GetScaledBitmapByteCount(G2005_GraphicWidthHeight[AL0073_i_GraphicIndex].Width, G2005_GraphicWidthHeight[AL0073_i_GraphicIndex].Height, M638_SCALE_21_23);
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
                }
#endif
#endif
        }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        for (AL0072_i_GraphicIndex = C102_DERIVED_BITMAP_FIRST_DOOR_BUTTON, AL0073_i_Counter = 0; AL0073_i_Counter < C001_DOOR_BUTTON_COUNT; AL0073_i_Counter++) {
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        AL0072_i_GraphicIndex = C102_DERIVED_BITMAP_FIRST_DOOR_BUTTON;
        for (AL0073_i_Counter = 0; AL0073_i_Counter < C001_DOOR_BUTTON_COUNT; AL0073_i_Counter++) {
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_Counter + M634_GRAPHIC_FIRST_DOOR_BUTTON;
                AL0076_puc_CoordinateSet = G0208_aaauc_Graphic558_DoorButtonCoordinateSets[G0197_auc_Graphic558_DoorButtonCoordinateSet[AL0073_i_Counter]][1];
                G0639_DerivedBitmapByteCount[AL0072_i_GraphicIndex++] = AL0076_puc_CoordinateSet[C4_BYTE_WIDTH] * AL0076_puc_CoordinateSet[C5_HEIGHT];
                AL0076_puc_CoordinateSet += 6;
                G0639_DerivedBitmapByteCount[AL0072_i_GraphicIndex++] = AL0076_puc_CoordinateSet[C4_BYTE_WIDTH] * AL0076_puc_CoordinateSet[C5_HEIGHT];
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                AL0074_ui_GraphicIndex = AL0073_i_Counter + M634_GRAPHIC_FIRST_DOOR_BUTTON;
                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex;
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
                if (!G2136_B_EvaluatingMemoryRequirements) { /* ANOMALY_ASSEMBLY_COMPILATION_DIFFERENCE jmp */
#endif
                        G0639_DerivedBitmapByteCount[AL0072_i_GraphicIndex++] = F0459_START_GetScaledBitmapByteCount(G2005_GraphicWidthHeight[AL0074_ui_GraphicIndex].Width, G2005_GraphicWidthHeight[AL0074_ui_GraphicIndex].Height, M637_SCALE_14_16);
                        G0639_DerivedBitmapByteCount[AL0072_i_GraphicIndex++] = F0459_START_GetScaledBitmapByteCount(G2005_GraphicWidthHeight[AL0074_ui_GraphicIndex].Width, G2005_GraphicWidthHeight[AL0074_ui_GraphicIndex].Height, C21_SCALE_);
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
                }
#endif
#endif
        }
        F0093_DUNGEONVIEW_ApplyCreatureReplacementColors(9, 8); /* Restore the default color #9 */
        F0093_DUNGEONVIEW_ApplyCreatureReplacementColors(10, 12); /* Restore the default color #10 */
        for (L0080_i_CreatureTypeIndex = 0; L0080_i_CreatureTypeIndex < G0269_ps_CurrentMap->C.CreatureTypeCount; L0080_i_CreatureTypeIndex++) {
                AL0076_puc_CreatureAspect = (unsigned char*)&G0219_as_Graphic558_CreatureAspects[AL0072_i_CreatureType = G0264_puc_CurrentMapAllowedCreatureTypes[L0080_i_CreatureTypeIndex]];
#ifdef MEDIA128_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G20E_G21E_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                if (AL0074_ui_ReplacementColorSetOrdinal = M073_COLOR_09_REPLACEMENT_COLOR_SET((CREATURE_ASPECT*)AL0076_puc_CreatureAspect)) {
                        F0093_DUNGEONVIEW_ApplyCreatureReplacementColors(9, M001_ORDINAL_TO_INDEX(AL0074_ui_ReplacementColorSetOrdinal));
                }
                if (AL0074_ui_ReplacementColorSetOrdinal = M074_COLOR_10_REPLACEMENT_COLOR_SET((CREATURE_ASPECT*)AL0076_puc_CreatureAspect)) {
                        F0093_DUNGEONVIEW_ApplyCreatureReplacementColors(10, M001_ORDINAL_TO_INDEX(AL0074_ui_ReplacementColorSetOrdinal));
                }
#endif
#ifdef MEDIA022_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_A31M_A33M_F31E_F31J_X31J_P31J
                if (!G0661_B_LargeHeapMemory) { /* If heap memory is small (if large, then all these graphics are added later) */
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
                if (!G2040_auc_MemoryFlags[C0_MEM_]) { /* If heap memory is small (if large, then all these graphics are added later) */
#endif
#ifdef MEDIA707_I34E_I34M
                        if (G2040_auc_MemoryFlags[C3_MEM_BASE_SOUNDS]) {
#endif
#ifdef MEDIA160_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_F20E_F20J_X30J_P20JA
                        if ((AL0074_ui_AttackSoundOrdinal = G0243_as_Graphic559_CreatureInfo[AL0072_i_CreatureType].AttackSoundOrdinal) && (AL0074_ui_AttackSoundOrdinal <= 6)) {
                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_AttackSoundOrdinal + C549_GRAPHIC_FIRST_CREATURE_ATTACK_SOUND;
                        }
#endif
#ifdef MEDIA485_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                if ((AL0074_ui_AttackSoundOrdinal = G0243_as_Graphic559_CreatureInfo[AL0072_i_CreatureType].AttackSoundOrdinal) != 0) { /* ANOMALY_ASSEMBLY_COMPILATION_DIFFERENCE jmp */
#ifdef MEDIA470_P20JB_A31E_A31M_A33M_F31E_F31J_X31J_P31J
                                        if (F0707_ResetSoundBufferAddress(AL0084_i_OrnamentCounter = G2003_aauc_CreatureSounds[M001_ORDINAL_TO_INDEX(AL0074_ui_AttackSoundOrdinal)][C0_ATTACK_SOUND])) {
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
                                        if ((G2040_auc_MemoryFlags[C4_MEM_ATTACK_SOUNDS]) && (F0707_ResetSoundBufferAddress(AL0084_i_OrnamentCounter = G2003_aauc_CreatureSounds[M001_ORDINAL_TO_INDEX(AL0074_ui_AttackSoundOrdinal)][C0_ATTACK_SOUND]))) {
#endif
#ifdef MEDIA479_P20JB_I34E_I34M_A31E_A31M_A33M_F31E_F31J_X31J_P31J
                                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = G0060_as_Graphic562_Sounds[AL0084_i_OrnamentCounter].GraphicIndex;
#endif
#ifdef MEDIA758_A36M_A35E_A35M
                                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = G0060_as_Graphic562_Sounds[AL0084_i_OrnamentCounter].GraphicIndex | MASK0x4000_DO_NOT_COPY_DIMENSIONS;
#endif
                                        }
#ifdef MEDIA470_P20JB_A31E_A31M_A33M_F31E_F31J_X31J_P31J
                                        if (F0707_ResetSoundBufferAddress(AL0084_i_OrnamentCounter = G2003_aauc_CreatureSounds[M001_ORDINAL_TO_INDEX(AL0074_ui_AttackSoundOrdinal)][C1_MOVEMENT_SOUND])) {
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
                                        if ((G2040_auc_MemoryFlags[C5_MEM_MOVEMENT_SOUNDS]) && (F0707_ResetSoundBufferAddress(AL0084_i_OrnamentCounter = G2003_aauc_CreatureSounds[M001_ORDINAL_TO_INDEX(AL0074_ui_AttackSoundOrdinal)][C1_MOVEMENT_SOUND]))) {
#endif
#ifdef MEDIA479_P20JB_I34E_I34M_A31E_A31M_A33M_F31E_F31J_X31J_P31J
                                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = G0060_as_Graphic562_Sounds[AL0084_i_OrnamentCounter].GraphicIndex;
#endif
#ifdef MEDIA758_A36M_A35E_A35M
                                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = G0060_as_Graphic562_Sounds[AL0084_i_OrnamentCounter].GraphicIndex | MASK0x4000_DO_NOT_COPY_DIMENSIONS;
#endif
                                        }
                                }
#ifdef MEDIA707_I34E_I34M
                        }
#endif
#endif
                        AL0073_i_GraphicIndex = M618_GRAPHIC_FIRST_CREATURE + ((CREATURE_ASPECT*)AL0076_puc_CreatureAspect)->FirstNativeBitmapRelativeIndex;
                        L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0073_i_GraphicIndex;
                        AL0074_ui_CreatureGraphicInfo = G0243_as_Graphic559_CreatureInfo[AL0072_i_CreatureType].GraphicInfo;
                        if (M007_GET(AL0074_ui_CreatureGraphicInfo, MASK0x0008_SIDE)) {
                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = ++AL0073_i_GraphicIndex;
                        }
                        if (M007_GET(AL0074_ui_CreatureGraphicInfo, MASK0x0010_BACK)) {
                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = ++AL0073_i_GraphicIndex;
                        }
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_14_FIX Useless code removed */
                        if (M007_GET(AL0074_ui_CreatureGraphicInfo, MASK0x0080_SPECIAL_D2_FRONT) && !M007_GET(AL0074_ui_CreatureGraphicInfo, MASK0x0100_SPECIAL_D2_FRONT_IS_FLIPPED_FRONT)) { /* BUG0_00 Useless code */
                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = ++AL0073_i_GraphicIndex;
                        }
#endif
                        if (M007_GET(AL0074_ui_CreatureGraphicInfo, MASK0x0020_ATTACK)) {
                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = ++AL0073_i_GraphicIndex;
                        }
                        if (L0083_i_CreatureAdditionalGraphicCount = M007_GET(AL0074_ui_CreatureGraphicInfo, MASK0x0003_ADDITIONAL)) {
                                do {
                                        if (!M007_GET(AL0074_ui_CreatureGraphicInfo, MASK0x0004_FLIP_NON_ATTACK)) {
                                                L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = ++AL0073_i_GraphicIndex;
                                        }
                                } while (--L0083_i_CreatureAdditionalGraphicCount);
                        }
                }
        }
#ifdef MEDIA022_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_A31M_A33M_F31E_F31J_X31J_P31J
        if (L0081_B_FirstFunctionCallOrSmallHeapMemory) { /* If this is not the first call to the function and G0661_B_LargeHeapMemory = C1_TRUE then all graphics have already been loaded during the first call */
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        if (L0081_B_FirstFunctionCallOrSmallHeapMemory || G2136_B_EvaluatingMemoryRequirements) { /* If this is not the first call to the function and G2040_auc_MemoryFlags[C0_MEM_] = C1_TRUE then all graphics have already been loaded during the first call */
#endif
#ifdef MEDIA021_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_A31M_A33M_F31E_F31J_X31J
                if (G0661_B_LargeHeapMemory) { /* If heap memory is large enough then load all graphics that are not listed in G0018_ai_Graphic562_MandatoryGraphicIndices or loaded in all cases */
#endif
#ifdef MEDIA758_A36M_A35E_A35M
                if (G2040_auc_MemoryFlags[C0_MEM_]) {
#endif
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
                        for (AL0074_ui_GraphicIndex = M645_GRAPHIC_FIRST_STAIRS; AL0074_ui_GraphicIndex < M633_GRAPHIC_FIRST_DOOR_SET; L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex++);
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        for (AL0073_i_GraphicIndex = 0; AL0073_i_GraphicIndex < 4; AL0073_i_GraphicIndex++) {
                                AL0072_i_GraphicIndex = AL0073_i_GraphicIndex * M647_WALL_SET_GRAPHIC_COUNT + M645_GRAPHIC_FIRST_STAIRS;
                                for (AL0074_ui_GraphicIndex = AL0072_i_GraphicIndex; AL0074_ui_GraphicIndex < AL0072_i_GraphicIndex + C018_STAIRS_GRAPHIC_COUNT; L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex++);
                        }
#endif
#ifdef MEDIA046_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        for (AL0074_ui_GraphicIndex = M633_GRAPHIC_FIRST_DOOR_SET; AL0074_ui_GraphicIndex < M648_GRAPHIC_INSCRIPTION_FONT; L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex++);
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
                        for (AL0074_ui_GraphicIndex = M615_GRAPHIC_FIRST_WALL_ORNAMENT; AL0074_ui_GraphicIndex < M616_GRAPHIC_FIRST_FLOOR_ORNAMENT; L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex++);
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        for (AL0074_ui_GraphicIndex = M615_GRAPHIC_FIRST_WALL_ORNAMENT; AL0074_ui_GraphicIndex < M639_GRAPHIC_FLOOR_ORNAMENT_15_D3L_FOOTPRINTS; L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex++);
#endif
                        for (AL0074_ui_GraphicIndex = M616_GRAPHIC_FIRST_FLOOR_ORNAMENT; AL0074_ui_GraphicIndex < M649_GRAPHIC_DOOR_MASK_DESTROYED; L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex++);
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
                        for (AL0074_ui_GraphicIndex = M617_GRAPHIC_FIRST_DOOR_ORNAMENT; AL0074_ui_GraphicIndex < M613_GRAPHIC_FIRST_PROJECTILE; L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex++);
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        for (AL0074_ui_GraphicIndex = M617_GRAPHIC_FIRST_DOOR_ORNAMENT; AL0074_ui_GraphicIndex < M634_GRAPHIC_FIRST_DOOR_BUTTON; L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex++);
#endif
                        for (AL0074_ui_GraphicIndex = M618_GRAPHIC_FIRST_CREATURE; AL0074_ui_GraphicIndex < M719_GRAPHIC_FIRST_SOUND; L0077_pi_GraphicIndices[AL0075_ui_GraphicCount++] = AL0074_ui_GraphicIndex++);
                }
#endif
#ifdef MEDIA707_I34E_I34M
                if (!G2136_B_EvaluatingMemoryRequirements) {
#endif
#ifdef MEDIA758_A36M_A35E_A35M
                if (G2136_B_EvaluatingMemoryRequirements) {
#endif
#ifdef MEDIA485_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0710_WaitSoundPlayComplete();
#endif
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
                }
#endif
                F0484_MEMORY_LoadGraphics_CPSDEF(M773_CAST_PI(L0077_pi_GraphicIndices), AL0075_ui_GraphicCount);
        }
        if (L0087_B_OpenGraphicsDatRequired) {
                F0478_MEMORY_CloseGraphicsDat_CPSDF();
        }
        F0469_MEMORY_FreeAtHeapTop((long)(M534_LOADABLE_GRAPHIC_COUNT * sizeof(int16_t)));
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        if (!G2136_B_EvaluatingMemoryRequirements) {
#endif
                G0297_B_DrawFloorAndCeilingRequested = C1_TRUE;
                G0342_B_RefreshDungeonViewPaletteRequested = C1_TRUE;
                G0232_B_FirstFunctionCall = C0_FALSE;
#ifdef MEDIA728_I34E_I34M_A36M_A35E_A35M
        }
#endif
}

#ifdef MEDIA154_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
#include "DRAWVIEW.C"
#endif

void F0098_DUNGEONVIEW_DrawFloorAndCeiling(
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
void
#endif
)
{
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
        F0008_MAIN_ClearBytes(G0086_puc_Bitmap_ViewportBlackArea, M075_BITMAP_BYTE_COUNT(224, 37));
        F0007_MAIN_CopyBytes(G0085_puc_Bitmap_Ceiling, G0296_puc_Bitmap_Viewport, M075_BITMAP_BYTE_COUNT(224, 29));
        F0007_MAIN_CopyBytes(G0084_puc_Bitmap_Floor, G0087_puc_Bitmap_ViewportFloorArea, M075_BITMAP_BYTE_COUNT(224, 70));
#endif
#ifdef MEDIA425_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M
        REGISTER int16_t L1759_i_BitPlaneIndex;
        REGISTER unsigned char* L1760_puc_BitPlane;


#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        for (L1760_puc_BitPlane = G0086_puc_Bitmap_ViewportBlackArea, L1759_i_BitPlaneIndex = 0; L1759_i_BitPlaneIndex < 4; L1759_i_BitPlaneIndex++, L1760_puc_BitPlane += M091_BITPLANE_SIZE(224, 136)) {
                F0008_MAIN_ClearBytes(L1760_puc_BitPlane, M091_BITPLANE_SIZE(224, 37));
        }
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
        L1760_puc_BitPlane = G0086_puc_Bitmap_ViewportBlackArea;
        for (L1759_i_BitPlaneIndex = 0; L1759_i_BitPlaneIndex < 4; L1759_i_BitPlaneIndex++) {
                F0008_MAIN_ClearBytes(L1760_puc_BitPlane, (long)(G2142_ViewportBlackAreaByteCount >> 2));
                L1760_puc_BitPlane += (long)(G2070_ViewportBitmapByteCount >> 2);
        }
#endif
#endif
#ifdef MEDIA525_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_F31E_F31J_X31J_P31J
        F0008_MAIN_ClearBytes(M772_CAST_PC(G0086_puc_Bitmap_ViewportBlackArea), (long)G2142_ViewportBlackAreaByteCount);
#endif
#ifdef MEDIA543_F20E_F20J_X30J_F31E_F31J_X31J
        F0674_F0128_sub(G2109_Ceiling, G0296_puc_Bitmap_Viewport);
        F0674_F0128_sub(G2108_Floor, G0087_puc_Bitmap_ViewportFloorArea);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        M100_PIXEL_WIDTH(G0296_puc_Bitmap_Viewport) = G2073_C224_ViewportPixelWidth;
        M101_PIXEL_HEIGHT(G0296_puc_Bitmap_Viewport) = G2074_C136_ViewportHeight;
#endif
        G0297_B_DrawFloorAndCeilingRequested = C0_FALSE;
}

#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
STATICFUNCTION void F0674_F0128_sub(
int16_t        P2065_i_GraphicIndex SEPARATOR
unsigned char* P2066_puc_Bitmap     FINAL_SEPARATOR
{
        unsigned char* L2432_puc_Bitmap;


        L2432_puc_Bitmap = F0631_GetBitmapPointer(P2065_i_GraphicIndex);
        F0007_MAIN_CopyBytes(M772_CAST_PC(L2432_puc_Bitmap), M772_CAST_PC(P2066_puc_Bitmap), (long)F0653_GetBitmapByteCount(L2432_puc_Bitmap));
}
#endif

STATICFUNCTION void F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0101_puc_Bitmap_Source, P0102_puc_Bitmap_Destination, P0103_ui_ByteWidth, P0104_ui_Height)
#endif
unsigned char*   P0101_puc_Bitmap_Source      SEPARATOR
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
unsigned char*   P0102_puc_Bitmap_Destination SEPARATOR
unsigned int16_t P0103_ui_ByteWidth           SEPARATOR
unsigned int16_t P0104_ui_Height              FINAL_SEPARATOR
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
unsigned char*   P0102_puc_Bitmap_Destination FINAL_SEPARATOR
#endif
{
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        F0007_MAIN_CopyBytes(P0101_puc_Bitmap_Source, P0102_puc_Bitmap_Destination, P0103_ui_ByteWidth * P0104_ui_Height);
        F0130_VIDEO_FlipHorizontal(P0102_puc_Bitmap_Destination, P0103_ui_ByteWidth, P0104_ui_Height);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
        F0655_CopyBitmapAndFlip(P0101_puc_Bitmap_Source, P0102_puc_Bitmap_Destination, MASK0x0001_FLIP_HORIZONTAL);
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
        F0616_CopyBitmap(P0101_puc_Bitmap_Source, P0102_puc_Bitmap_Destination);
        F1006_(P0102_puc_Bitmap_Destination);
#endif
#endif
}

#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
void F0100_DUNGEONVIEW_DrawWallSetBitmap(
P0105_puc_Bitmap, P0106_puc_Frame)
unsigned char*          P0105_puc_Bitmap SEPARATOR
REGISTER unsigned char* P0106_puc_Frame  FINAL_SEPARATOR
{
        if (P0106_puc_Frame[C4_BYTE_WIDTH]) {
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                F0132_VIDEO_Blit(P0105_puc_Bitmap, G0296_puc_Bitmap_Viewport, P0106_puc_Frame, P0106_puc_Frame[C6_X], P0106_puc_Frame[C7_Y], P0106_puc_Frame[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0132_VIDEO_Blit(P0105_puc_Bitmap, G0296_puc_Bitmap_Viewport, P0106_puc_Frame, P0106_puc_Frame[C6_X], P0106_puc_Frame[C7_Y], P0106_puc_Frame[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH, P0106_puc_Frame[C5_HEIGHT], C136_HEIGHT_VIEWPORT);
#endif
        }
}
#endif

#ifdef MEDIA267_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G /* CHANGE7_15_OPTIMIZATION New function to draw walls in the center of the dungeon view without unnecessary transparency support for better performance */
void F0101_DUNGEONVIEW_DrawWallSetBitmapWithoutTransparency(
P0107_puc_Bitmap, P0108_puc_Frame)
unsigned char*          P0107_puc_Bitmap SEPARATOR
REGISTER unsigned char* P0108_puc_Frame  FINAL_SEPARATOR
{
        if (P0108_puc_Frame[C4_BYTE_WIDTH]) {
#ifdef MEDIA266_S20E_S21E_G14ED_G20E_G21E
                F0132_VIDEO_Blit(P0107_puc_Bitmap, G0296_puc_Bitmap_Viewport, P0108_puc_Frame, P0108_puc_Frame[C6_X], P0108_puc_Frame[C7_Y], P0108_puc_Frame[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0132_VIDEO_Blit(P0107_puc_Bitmap, G0296_puc_Bitmap_Viewport, P0108_puc_Frame, P0108_puc_Frame[C6_X], P0108_puc_Frame[C7_Y], P0108_puc_Frame[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, CM1_COLOR_NO_TRANSPARENCY, P0108_puc_Frame[C5_HEIGHT], C136_HEIGHT_VIEWPORT);
#endif
        }
}
#endif

#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
void F0102_DUNGEONVIEW_DrawDoorBitmap(
P0109_puc_Frame)
REGISTER unsigned char* P0109_puc_Frame FINAL_SEPARATOR
{
        if (P0109_puc_Frame[C4_BYTE_WIDTH]) {
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                F0132_VIDEO_Blit(G0074_puc_Bitmap_Temporary, G0296_puc_Bitmap_Viewport, P0109_puc_Frame, P0109_puc_Frame[C6_X], P0109_puc_Frame[C7_Y], P0109_puc_Frame[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0132_VIDEO_Blit(G0074_puc_Bitmap_Temporary, G0296_puc_Bitmap_Viewport, P0109_puc_Frame, P0109_puc_Frame[C6_X], P0109_puc_Frame[C7_Y], P0109_puc_Frame[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH, P0109_puc_Frame[C5_HEIGHT], C136_HEIGHT_VIEWPORT);
#endif
        }
}

void F0103_DUNGEONVIEW_DrawDoorFrameBitmapFlippedHorizontally(
P0110_puc_Bitmap, P0111_puc_Frame)
unsigned char*          P0110_puc_Bitmap SEPARATOR
REGISTER unsigned char* P0111_puc_Frame  FINAL_SEPARATOR
{
        if (P0111_puc_Frame[C4_BYTE_WIDTH]) {
                F0130_VIDEO_FlipHorizontal(P0110_puc_Bitmap, P0111_puc_Frame[C4_BYTE_WIDTH], P0111_puc_Frame[C5_HEIGHT]);
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                F0132_VIDEO_Blit(P0110_puc_Bitmap, G0296_puc_Bitmap_Viewport, P0111_puc_Frame, P0111_puc_Frame[C6_X], P0111_puc_Frame[C7_Y], P0111_puc_Frame[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0132_VIDEO_Blit(P0110_puc_Bitmap, G0296_puc_Bitmap_Viewport, P0111_puc_Frame, P0111_puc_Frame[C6_X], P0111_puc_Frame[C7_Y], P0111_puc_Frame[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH, P0111_puc_Frame[C5_HEIGHT], C136_HEIGHT_VIEWPORT);
#endif
        }
}
#endif

STATICFUNCTION void F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0112_i_NativeBitmapIndex, P0113_puc_Frame)
#endif
int16_t                 P0112_i_NativeBitmapIndex SEPARATOR
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
REGISTER unsigned char* P0113_puc_Frame           FINAL_SEPARATOR
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t                 P2069_i_ZoneIndex         FINAL_SEPARATOR
#endif
{
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        if (P0113_puc_Frame[C4_BYTE_WIDTH]) {
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                F0132_VIDEO_Blit(F0489_MEMORY_GetNativeBitmapOrGraphic(P0112_i_NativeBitmapIndex), G0296_puc_Bitmap_Viewport, P0113_puc_Frame, P0113_puc_Frame[C6_X], P0113_puc_Frame[C7_Y], P0113_puc_Frame[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0132_VIDEO_Blit(F0489_MEMORY_GetNativeBitmapOrGraphic(P0112_i_NativeBitmapIndex), G0296_puc_Bitmap_Viewport, P0113_puc_Frame, P0113_puc_Frame[C6_X], P0113_puc_Frame[C7_Y], P0113_puc_Frame[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH, P0113_puc_Frame[C5_HEIGHT], C136_HEIGHT_VIEWPORT);
#endif
        }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER unsigned char* L2433_puc_Bitmap;
        STRUCT2 L2434_s_Struct2;
        int16_t L2435_ai_XYZ[4];


        L2433_puc_Bitmap = F0630_InitBitmapStruct2(P0112_i_NativeBitmapIndex, &L2434_s_Struct2);
        if (L2433_puc_Bitmap != NULL) {
                if (F0635_(L2433_puc_Bitmap, L2435_ai_XYZ, P2069_i_ZoneIndex, &L2434_s_Struct2.Width, &L2434_s_Struct2.Height)) {
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        F0132_VIDEO_Blit(L2433_puc_Bitmap, G0296_puc_Bitmap_Viewport, L2435_ai_XYZ, L2434_s_Struct2.X + L2434_s_Struct2.Width, L2434_s_Struct2.Y + L2434_s_Struct2.Height, M100_PIXEL_WIDTH(L2433_puc_Bitmap), G2073_C224_ViewportPixelWidth, C10_COLOR_FLESH, MASK0x0000_NO_FLIP);
#endif
#ifdef MEDIA543_F20E_F20J_X30J_F31E_F31J_X31J
                        F0132_VIDEO_Blit(L2433_puc_Bitmap, G0296_puc_Bitmap_Viewport, L2435_ai_XYZ, L2434_s_Struct2.X + L2434_s_Struct2.Width, L2434_s_Struct2.Y + L2434_s_Struct2.Height, M100_PIXEL_WIDTH(L2433_puc_Bitmap), G2073_C224_ViewportPixelWidth, C10_COLOR_FLESH);
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                        F0132_VIDEO_Blit(L2433_puc_Bitmap, G0296_puc_Bitmap_Viewport, L2435_ai_XYZ, L2434_s_Struct2.X + L2434_s_Struct2.Width, L2434_s_Struct2.Y + L2434_s_Struct2.Height, M100_PIXEL_WIDTH(L2433_puc_Bitmap), G2073_C224_ViewportPixelWidth, C10_COLOR_FLESH, M101_PIXEL_HEIGHT(L2433_puc_Bitmap), G2074_C136_ViewportHeight);
#endif
                }
        }
#endif
}

#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
STATICFUNCTION void F0765_DUNGEONVIEW_DrawBitmapWithoutTransparency(
int16_t P2070_i_NativeBitmapIndex SEPARATOR
int16_t P2071_i_ZoneIndex         FINAL_SEPARATOR
{
        REGISTER unsigned char* L2436_puc_Bitmap;
        STRUCT2 L2437_s_Struct2;
        int16_t L2438_ai_XYZ[4];


        L2436_puc_Bitmap = F0630_InitBitmapStruct2(P2070_i_NativeBitmapIndex, &L2437_s_Struct2);
        if (L2436_puc_Bitmap != NULL) {
                if (F0635_(L2436_puc_Bitmap, L2438_ai_XYZ, P2071_i_ZoneIndex, &L2437_s_Struct2.Width, &L2437_s_Struct2.Height)) {
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        F0132_VIDEO_Blit(L2436_puc_Bitmap, G0296_puc_Bitmap_Viewport, L2438_ai_XYZ, L2437_s_Struct2.X + L2437_s_Struct2.Width, L2437_s_Struct2.Y + L2437_s_Struct2.Height, M100_PIXEL_WIDTH(L2436_puc_Bitmap), G2073_C224_ViewportPixelWidth, CM1_COLOR_NO_TRANSPARENCY, MASK0x0000_NO_FLIP);
#endif
#ifdef MEDIA543_F20E_F20J_X30J_F31E_F31J_X31J
                        F0132_VIDEO_Blit(L2436_puc_Bitmap, G0296_puc_Bitmap_Viewport, L2438_ai_XYZ, L2437_s_Struct2.X + L2437_s_Struct2.Width, L2437_s_Struct2.Y + L2437_s_Struct2.Height, M100_PIXEL_WIDTH(L2436_puc_Bitmap), G2073_C224_ViewportPixelWidth, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                        F0132_VIDEO_Blit(L2436_puc_Bitmap, G0296_puc_Bitmap_Viewport, L2438_ai_XYZ, L2437_s_Struct2.X + L2437_s_Struct2.Width, L2437_s_Struct2.Y + L2437_s_Struct2.Height, M100_PIXEL_WIDTH(L2436_puc_Bitmap), G2073_C224_ViewportPixelWidth, CM1_COLOR_NO_TRANSPARENCY, M101_PIXEL_HEIGHT(L2436_puc_Bitmap), G2074_C136_ViewportHeight);
#endif
                }
        }
}
#endif

STATICFUNCTION void F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0114_i_NativeBitmapIndex, P0115_puc_Frame)
#endif
int16_t                 P0114_i_NativeBitmapIndex SEPARATOR
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
REGISTER unsigned char* P0115_puc_Frame           FINAL_SEPARATOR
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t                 P2072_i_ZoneIndex         FINAL_SEPARATOR
#endif
{
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        if (P0115_puc_Frame[C4_BYTE_WIDTH]) {
                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(F0489_MEMORY_GetNativeBitmapOrGraphic(P0114_i_NativeBitmapIndex), G0074_puc_Bitmap_Temporary, P0115_puc_Frame[C4_BYTE_WIDTH], P0115_puc_Frame[C5_HEIGHT]);
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                F0132_VIDEO_Blit(G0074_puc_Bitmap_Temporary, G0296_puc_Bitmap_Viewport, P0115_puc_Frame, P0115_puc_Frame[C6_X], P0115_puc_Frame[C7_Y], P0115_puc_Frame[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0132_VIDEO_Blit(G0074_puc_Bitmap_Temporary, G0296_puc_Bitmap_Viewport, P0115_puc_Frame, P0115_puc_Frame[C6_X], P0115_puc_Frame[C7_Y], P0115_puc_Frame[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH, P0115_puc_Frame[C5_HEIGHT], C136_HEIGHT_VIEWPORT);
#endif
        }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER unsigned char* L2439_puc_Bitmap;
        STRUCT2 L2440_s_Struct2;
        int16_t L2468_ai_XYZ[4];


        L2439_puc_Bitmap = F0630_InitBitmapStruct2(P0114_i_NativeBitmapIndex, &L2440_s_Struct2);
        if (L2439_puc_Bitmap != NULL) {
                if (F0635_(L2439_puc_Bitmap, L2468_ai_XYZ, P2072_i_ZoneIndex, &L2440_s_Struct2.Width, &L2440_s_Struct2.Height)) {
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        F0132_VIDEO_Blit(L2439_puc_Bitmap, G0296_puc_Bitmap_Viewport, L2468_ai_XYZ, L2440_s_Struct2.X + L2440_s_Struct2.Width, L2440_s_Struct2.Y + L2440_s_Struct2.Height, M100_PIXEL_WIDTH(L2439_puc_Bitmap), G2073_C224_ViewportPixelWidth, C10_COLOR_FLESH, MASK0x0001_FLIP_HORIZONTAL);
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(L2439_puc_Bitmap, G0074_puc_Bitmap_Temporary);
#endif
#ifdef MEDIA607_X30J_X31J
                        if (M100_PIXEL_WIDTH(L2439_puc_Bitmap = G0074_puc_Bitmap_Temporary) & 1) {
                                L2440_s_Struct2.X += 2 - (M100_PIXEL_WIDTH(L2439_puc_Bitmap) & 1);
                        }
#endif
#ifdef MEDIA551_F20E_F20J_F31E_F31J
                        if (M100_PIXEL_WIDTH(L2439_puc_Bitmap = G0074_puc_Bitmap_Temporary) & 31) {
                                L2440_s_Struct2.X += 32 - (M100_PIXEL_WIDTH(L2439_puc_Bitmap) & 31);
                        }
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                        if (M100_PIXEL_WIDTH(L2439_puc_Bitmap = G0074_puc_Bitmap_Temporary) & 15) {
                                L2440_s_Struct2.X += 16 - (M100_PIXEL_WIDTH(L2439_puc_Bitmap) & 15);
                        }
#endif
#ifdef MEDIA543_F20E_F20J_X30J_F31E_F31J_X31J
                        F0132_VIDEO_Blit(L2439_puc_Bitmap, G0296_puc_Bitmap_Viewport, L2468_ai_XYZ, L2440_s_Struct2.X + L2440_s_Struct2.Width, L2440_s_Struct2.Y + L2440_s_Struct2.Height, M100_PIXEL_WIDTH(L2439_puc_Bitmap), G2073_C224_ViewportPixelWidth, C10_COLOR_FLESH);
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                        F0132_VIDEO_Blit(L2439_puc_Bitmap, G0296_puc_Bitmap_Viewport, L2468_ai_XYZ, L2440_s_Struct2.X + L2440_s_Struct2.Width, L2440_s_Struct2.Y + L2440_s_Struct2.Height, M100_PIXEL_WIDTH(L2439_puc_Bitmap), G2073_C224_ViewportPixelWidth, C10_COLOR_FLESH, M101_PIXEL_HEIGHT(L2439_puc_Bitmap), G2074_C136_ViewportHeight);
#endif
                }
        }
#endif
}

#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
STATICFUNCTION unsigned char* F1005_(
int16_t          P2747_i_NativeBitmapOrGraphicIndex SEPARATOR
REGISTER int16_t P2748_i_DerivedBitmapIndex         SEPARATOR
int16_t          P2749_i_Flip                       FINAL_SEPARATOR
{
        REGISTER unsigned char* L2441_puc_Bitmap1;
        REGISTER unsigned char* L2442_puc_Bitmap2;


        if (P2749_i_Flip == MASK0x0000_NO_FLIP) {
                return F0489_MEMORY_GetNativeBitmapOrGraphic(P2747_i_NativeBitmapOrGraphicIndex);
        } else {
                if (P2748_i_DerivedBitmapIndex >= 0) {
                        if (F0491_CACHE_IsDerivedBitmapInCache(P2748_i_DerivedBitmapIndex)) {
                                return F0492_CACHE_GetDerivedBitmap(P2748_i_DerivedBitmapIndex);
                        }
                        L2442_puc_Bitmap2 = F0489_MEMORY_GetNativeBitmapOrGraphic(P2747_i_NativeBitmapOrGraphicIndex);
                        L2441_puc_Bitmap1 = F0492_CACHE_GetDerivedBitmap(P2748_i_DerivedBitmapIndex);
                } else {
                        L2442_puc_Bitmap2 = F0489_MEMORY_GetNativeBitmapOrGraphic(P2747_i_NativeBitmapOrGraphicIndex);
                        L2441_puc_Bitmap1 = G0074_puc_Bitmap_Temporary;
                }
                F0616_CopyBitmap(L2442_puc_Bitmap2, L2441_puc_Bitmap1);
                if (M007_GET(P2749_i_Flip, MASK0x0001_FLIP_HORIZONTAL)) {
                        F1006_(L2441_puc_Bitmap1);
                }
                if (M007_GET(P2749_i_Flip, MASK0x0002_FLIP_VERTICAL)) {
                        F1030_(L2441_puc_Bitmap1);
                }
                if (P2748_i_DerivedBitmapIndex >= 0) {
                        F0493_CACHE_AddDerivedBitmap(P2748_i_DerivedBitmapIndex);
                }
        }
        return L2441_puc_Bitmap1;
}
#endif

#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
void F0792_DUNGEONVIEW_DrawBitmapYYY(
int16_t P2073_i_NativeBitmapIndex SEPARATOR
int16_t P2074_i_ZoneIndex         SEPARATOR
int16_t P2075_i_Flip              FINAL_SEPARATOR
{
        unsigned char* L2443_puc_Bitmap;
        STRUCT2 L2444_s_Struct2;
        int16_t L2445_ai_XYZ[4];


        L2443_puc_Bitmap = F0630_InitBitmapStruct2(P2073_i_NativeBitmapIndex, &L2444_s_Struct2);
        if (L2443_puc_Bitmap != NULL) {
                if (F0635_(L2443_puc_Bitmap, L2445_ai_XYZ, P2074_i_ZoneIndex, &L2444_s_Struct2.Width, &L2444_s_Struct2.Height)) {
                        F0132_VIDEO_Blit(L2443_puc_Bitmap, G0296_puc_Bitmap_Viewport, L2445_ai_XYZ, L2444_s_Struct2.X + L2444_s_Struct2.Width, L2444_s_Struct2.Y + L2444_s_Struct2.Height, M100_PIXEL_WIDTH(L2443_puc_Bitmap), G2073_C224_ViewportPixelWidth, CM1_COLOR_NO_TRANSPARENCY, P2075_i_Flip);
                }
        }
}
#endif

#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
STATICFUNCTION unsigned char* F0675_DUNGEONVIEW_GetScaledBitmap(
unsigned int16_t P2076_ui_BitmapIndex       SEPARATOR
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
REGISTER int16_t P2782_i_                   SEPARATOR
unsigned int16_t P2781_i_Flip               SEPARATOR
REGISTER int16_t P2077_i_DerivedBitmapIndex SEPARATOR
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
int16_t          P2077_i_DerivedBitmapIndex SEPARATOR
#endif
int16_t          P2078_i_HorizontalScale    SEPARATOR
int16_t          P2079_i_VerticalScale      SEPARATOR
unsigned char*   P2080_puc_PaletteChange    FINAL_SEPARATOR
{
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
        unsigned char* L0123_puc_Bitmap;
        unsigned char* L0125_puc_Bitmap_Native;
        int16_t L0120_i_Width;
        int16_t L0121_i_Height;
        BOOLEAN L2446_B_DerivedBitmapInCache;
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
        REGISTER unsigned char* L0123_puc_Bitmap;
        REGISTER unsigned char* L0125_puc_Bitmap_Native;
        REGISTER int16_t L0120_i_Width;
        REGISTER int16_t L0121_i_Height;
        REGISTER BOOLEAN L2446_B_DerivedBitmapInCache;
#endif


        L2446_B_DerivedBitmapInCache = C1_TRUE;
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
        if (P2781_i_Flip && (P2782_i_ >= 0)) {
                if (F0491_CACHE_IsDerivedBitmapInCache(P2782_i_)) {
                        return F0492_CACHE_GetDerivedBitmap(P2782_i_);
                }
        }
#endif
        if ((P2078_i_HorizontalScale == C32_SCALE_D1) && (P2079_i_VerticalScale == C32_SCALE_D1) && (P2080_puc_PaletteChange == NULL)) {
                L0123_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(P2076_ui_BitmapIndex);
        } else {
                if (P2077_i_DerivedBitmapIndex >= 0) {
                        if ((L2446_B_DerivedBitmapInCache = F0491_CACHE_IsDerivedBitmapInCache(P2077_i_DerivedBitmapIndex)) != C0_FALSE) {
                                L0123_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(P2077_i_DerivedBitmapIndex);
                                goto T0114xxx;
                        } else {
                                L0125_puc_Bitmap_Native = F0489_MEMORY_GetNativeBitmapOrGraphic(P2076_ui_BitmapIndex);
                                L0123_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(P2077_i_DerivedBitmapIndex);
                        }
                } else {
                        L0125_puc_Bitmap_Native = F0489_MEMORY_GetNativeBitmapOrGraphic(P2076_ui_BitmapIndex);
                        L0123_puc_Bitmap = G0074_puc_Bitmap_Temporary;
                }
                L0120_i_Width = M100_PIXEL_WIDTH(L0125_puc_Bitmap_Native);
                L0121_i_Height = M101_PIXEL_HEIGHT(L0125_puc_Bitmap_Native);
                F0129_VIDEO_BlitShrinkWithPaletteChanges(L0125_puc_Bitmap_Native, L0123_puc_Bitmap, L0120_i_Width, L0121_i_Height, M100_PIXEL_WIDTH(L0123_puc_Bitmap) = M078_SCALED_DIMENSION(L0120_i_Width, P2078_i_HorizontalScale), M101_PIXEL_HEIGHT(L0123_puc_Bitmap) = M078_SCALED_DIMENSION(L0121_i_Height, P2079_i_VerticalScale), P2080_puc_PaletteChange);
        }
        T0114xxx:
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
        if (P2781_i_Flip) {
                if (P2782_i_ >= 0) {
                        L0125_puc_Bitmap_Native = F0492_CACHE_GetDerivedBitmap(P2782_i_);
                } else {
                        L0125_puc_Bitmap_Native = G0074_puc_Bitmap_Temporary;
                }
                if (L0125_puc_Bitmap_Native != L0123_puc_Bitmap) {
                        F0616_CopyBitmap(L0123_puc_Bitmap, L0125_puc_Bitmap_Native);
                        L0123_puc_Bitmap = L0125_puc_Bitmap_Native;
                }
                if (M007_GET(P2781_i_Flip, MASK0x0001_FLIP_HORIZONTAL)) {
                        F1006_(L0123_puc_Bitmap);
                }
                if (M007_GET(P2781_i_Flip, MASK0x0002_FLIP_VERTICAL)) {
                        F1030_(L0123_puc_Bitmap);
                }
                if (P2782_i_ >= 0) {
                        F0493_CACHE_AddDerivedBitmap(P2782_i_);
                }
        }
#endif
        if (!L2446_B_DerivedBitmapInCache) {
                F0493_CACHE_AddDerivedBitmap(P2077_i_DerivedBitmapIndex);
        }
        return L0123_puc_Bitmap;
}

STATICFUNCTION void F0791_DUNGEONVIEW_DrawBitmapXX(
REGISTER unsigned char* P0101_puc_Bitmap_Source      SEPARATOR
REGISTER unsigned char* P0102_puc_Bitmap_Destination SEPARATOR
int16_t                 P2081_i_ZoneIndex            SEPARATOR
unsigned int16_t        P2082_i_Flip                 SEPARATOR
int16_t                 P2083_i_TransparentColor     FINAL_SEPARATOR
{
        int16_t L2447_i_Width;
        int16_t L2448_i_Height;
        REGISTER int16_t L2449_i_;
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
        int16_t L2450_i_;
#endif
#ifdef MEDIA577_X30J
        char L2451_ac_Unreferenced[8];
#endif


        if (P2081_i_ZoneIndex == CM1_UNKNOWN) {
                return;
        }
        if (M007_GET(P2081_i_ZoneIndex, MASK0x8000_SHIFT_OBJECTS_AND_CREATURES | MASK0x4000_SHIFT_UNREADABLE_INSCRIPTION_AND_OPEN_VERTICAL_DOOR)) {
                L2447_i_Width = G2154_i_ZoneShiftX;
                L2448_i_Height = G2155_i_ZoneShiftY;
                M727_CLEAR(P2081_i_ZoneIndex, MASK0x4000_SHIFT_UNREADABLE_INSCRIPTION_AND_OPEN_VERTICAL_DOOR);
        } else {
                L2447_i_Width = 0;
                L2448_i_Height = 0;
        }
        if (F0635_(P0101_puc_Bitmap_Source, G2032_ai_XYZ, P2081_i_ZoneIndex, &L2447_i_Width, &L2448_i_Height)) {
                L2449_i_ = M100_PIXEL_WIDTH(P0101_puc_Bitmap_Source);
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                L2450_i_ = M708_ZONE_WIDTH(G2032_ai_XYZ) + L2447_i_Width;
                if ((L2449_i_ > L2450_i_) && M007_GET(P2082_i_Flip, MASK0x0001_FLIP_HORIZONTAL)) {
                        L2449_i_ -= L2450_i_;
                } else {
                        L2449_i_ = 0;
                }
                if ((L2447_i_Width != 0) && M007_GET(P2082_i_Flip, MASK0x0001_FLIP_HORIZONTAL)) {
                        L2447_i_Width = 0;
                }
                L2447_i_Width += L2449_i_;
                L2449_i_ = M101_PIXEL_HEIGHT(P0101_puc_Bitmap_Source);
                L2450_i_ = M709_ZONE_HEIGHT(G2032_ai_XYZ) + L2448_i_Height;
                if ((L2449_i_ > L2450_i_) && M007_GET(P2082_i_Flip, MASK0x0002_FLIP_VERTICAL)) {
                        L2449_i_ -= L2450_i_;
                } else {
                        L2449_i_ = 0;
                }
                if ((L2448_i_Height != 0) && M007_GET(P2082_i_Flip, MASK0x0002_FLIP_VERTICAL)) {
                        L2448_i_Height = 0;
                }
                L2448_i_Height += L2449_i_;
#endif
#ifdef MEDIA607_X30J_X31J
                if (M007_GET(P2082_i_Flip, MASK0x0001_FLIP_HORIZONTAL) && (L2449_i_ & 1)) {
                        L2447_i_Width += 2 - (L2449_i_ & 1);
                }
#endif
#ifdef MEDIA551_F20E_F20J_F31E_F31J
                if (M007_GET(P2082_i_Flip, MASK0x0001_FLIP_HORIZONTAL) && (L2449_i_ & 31)) {
                        L2447_i_Width += 32 - (L2449_i_ & 31);
                }
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                if (M007_GET(P2082_i_Flip, MASK0x0001_FLIP_HORIZONTAL) && (L2449_i_ & 15)) {
                        L2447_i_Width += 16 - (L2449_i_ & 15);
                }
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                F0132_VIDEO_Blit(P0101_puc_Bitmap_Source, P0102_puc_Bitmap_Destination, G2032_ai_XYZ, L2447_i_Width, L2448_i_Height, M100_PIXEL_WIDTH(P0101_puc_Bitmap_Source), M100_PIXEL_WIDTH(P0102_puc_Bitmap_Destination), P2083_i_TransparentColor, P2082_i_Flip);
#endif
#ifdef MEDIA543_F20E_F20J_X30J_F31E_F31J_X31J
                F0132_VIDEO_Blit(P0101_puc_Bitmap_Source, P0102_puc_Bitmap_Destination, G2032_ai_XYZ, L2447_i_Width, L2448_i_Height, L2449_i_, M100_PIXEL_WIDTH(P0102_puc_Bitmap_Destination), P2083_i_TransparentColor);
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                F0132_VIDEO_Blit(P0101_puc_Bitmap_Source, P0102_puc_Bitmap_Destination, G2032_ai_XYZ, L2447_i_Width, L2448_i_Height, L2449_i_, M100_PIXEL_WIDTH(P0102_puc_Bitmap_Destination), P2083_i_TransparentColor, M101_PIXEL_HEIGHT(P0101_puc_Bitmap_Source), M101_PIXEL_HEIGHT(P0102_puc_Bitmap_Destination));
#endif
        }
}
#endif

#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
void F0106_DUNGEONVIEW_TestResetToStep1_CPSF(
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
void
#endif
)
{
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
        if ((G0072_ui_GraceReadRetryCount_CPSF < 5) && !G0078_B_FuzzyBitFound_CPSF) { /* If copy protected sector 7 was read and analyzed and no fuzzy bit was found */
#endif
#ifdef MEDIA423_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
        if ((G0072_ui_GraceReadRetryCount_CPSF < 6) && !G0078_B_FuzzyBitFound_CPSF) { /* If copy protected sector 7 was read and analyzed and no fuzzy bit was found */
#endif
                if (!G0625_i_FloppyDriveDMATimeout_CPSDF && !M007_GET(G0315_i_SectorsReadFailure_CPSDF, MASK0x0001_CPS_FUZZY_SECTOR)) { /* If no copy protected sector is being read and sector 7 was read without failure */
                        M008_SET(G0315_i_SectorsReadFailure_CPSDF, MASK0x0001_CPS_FUZZY_SECTOR); /* Set failure flag because no fuzzy bit was found */
                        G0072_ui_GraceReadRetryCount_CPSF++;
                }
                M009_CLEAR(G0316_i_SectorsReadPreviousFailure_CPSDF, MASK0x0001_CPS_FUZZY_SECTOR);
                G0069_ui_State_CPSF = 15; /* Reset CPSF to state 1 */
                G0078_B_FuzzyBitFound_CPSF = C1_TRUE;
        }
}
#endif
#endif

STATICFUNCTION BOOLEAN F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0116_i_WallOrnamentOrdinal, P0117_i_ViewWallIndex)
#endif
REGISTER int16_t P0116_i_WallOrnamentOrdinal SEPARATOR
REGISTER int16_t P0117_i_ViewWallIndex       FINAL_SEPARATOR
#define AP0116_i_CharacterCount    P0116_i_WallOrnamentOrdinal
#define AP0116_i_WallOrnamentIndex P0116_i_WallOrnamentOrdinal
{
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        register unsigned char* L0090_puc_Multiple;
#endif
#define AL0090_puc_String        L0090_puc_Multiple
#define AL0090_puc_CoordinateSet L0090_puc_Multiple
        REGISTER unsigned char* L0091_puc_Multiple;
#define AL0091_puc_Character     L0091_puc_Multiple
#define AL0091_puc_Bitmap        L0091_puc_Multiple
#define AL0091_puc_CoordinateSet L0091_puc_Multiple
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        unsigned char* L0092_puc_Bitmap;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER unsigned char* L0092_puc_Bitmap;
        REGISTER unsigned char* L0090_puc_Multiple;
        REGISTER int16_t L0097_i_Multiple;
#define AL0097_i_TextLineIndex L0097_i_Multiple
#define AL0097_i_Scale         L0097_i_Multiple
#define AL9992_i_FountainOrnamentIndex          L0097_i_Multiple
        REGISTER BOOLEAN L0094_B_FlipHorizontal;
#endif
        REGISTER int16_t L0088_i_Multiple;
#define AL0088_i_NativeBitmapIndex       L0088_i_Multiple
#define AL0088_i_UnreadableTextLineCount L0088_i_Multiple
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        BOOLEAN L0096_B_IsAlcove;
#endif
        REGISTER int16_t L0089_i_Multiple;
#define AL0089_i_WallOrnamentCoordinateSetIndex L0089_i_Multiple
#define AL0089_i_PixelWidth                     L0089_i_Multiple
#define AL0089_i_X                              L0089_i_Multiple
#define AL0089_i_ZoneIndex                      L0089_i_Multiple
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
#define AL9992_i_FountainOrnamentIndex          L0089_i_Multiple
        int16_t L0093_i_CoordinateSetOffset;
        BOOLEAN L0094_B_FlipHorizontal;
#endif
        BOOLEAN L0095_B_IsInscription;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        BOOLEAN L0096_B_IsAlcove;
        int16_t L0097_i_TextLineIndex;
        unsigned char L0098_auc_Frame[8];
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        int16_t L2452_i_Width;
        int16_t L2453_i_Height;
        int16_t L2454_ai_XYZ[4];
#endif
        unsigned char L0099_auc_InscriptionString[70];
#ifdef MEDIA571_F20J_X30J_P20JA_P20JB_F31J_X31J_P31J
        int16_t L2455_i_;
        int16_t L2456_i_TextLineIndex;
        unsigned char L2457_auc_[70];
#endif


#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        if (P0116_i_WallOrnamentOrdinal) {
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (P0116_i_WallOrnamentOrdinal == 0) {
                return C0_FALSE;
        }
#endif
                P0116_i_WallOrnamentOrdinal--;
                AL0088_i_NativeBitmapIndex = G0101_as_CurrentMapWallOrnamentsInfo[AP0116_i_WallOrnamentIndex].NativeBitmapIndex;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                AL0090_puc_CoordinateSet = G0205_aaauc_Graphic558_WallOrnamentCoordinateSets[AL0089_i_WallOrnamentCoordinateSetIndex = G0101_as_CurrentMapWallOrnamentsInfo[AP0116_i_WallOrnamentIndex].CoordinateSet][P0117_i_ViewWallIndex];
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                L0094_B_FlipHorizontal = C0_FALSE;
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                AL0089_i_ZoneIndex = C1004_ZONE_WALL_ORNAMENT + (G0101_as_CurrentMapWallOrnamentsInfo[AP0116_i_WallOrnamentIndex].CoordinateSet * C13_UNKNOWN) + P0117_i_ViewWallIndex;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                AL0089_i_ZoneIndex = C1004_ZONE_WALL_ORNAMENT + (G0101_as_CurrentMapWallOrnamentsInfo[AP0116_i_WallOrnamentIndex].CoordinateSet * C15_UNKNOWN) + P0117_i_ViewWallIndex;
#endif
                L0096_B_IsAlcove = F0149_DUNGEON_IsWallOrnamentAnAlcove(AP0116_i_WallOrnamentIndex);
                if (L0095_B_IsInscription = (AP0116_i_WallOrnamentIndex == G0265_i_CurrentMapInscriptionWallOrnamentIndex)) {
#ifdef MEDIA061_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E
                        F0168_DUNGEON_DecodeText(L0099_auc_InscriptionString, G0290_T_DungeonView_InscriptionThing, C0_TEXT_TYPE_INSCRIPTION);
#endif
#ifdef MEDIA571_F20J_X30J_P20JA_P20JB_F31J_X31J_P31J
                        F0168_DUNGEON_DecodeText(L0099_auc_InscriptionString, G0290_T_DungeonView_InscriptionThing, C2_TEXT_TYPE_SCROLL);
#endif
                }
#ifdef MEDIA137_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
#ifndef NOCOPYPROTECTION
                F0106_DUNGEONVIEW_TestResetToStep1_CPSF(C0_USELESS); /* BUG0_01 Coding error without consequence. Function call with wrong number of parameters. It should be called with 0 parameters. No consequence because additional parameters are ignored */
#endif
#endif
#ifdef MEDIA626_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
                F0106_DUNGEONVIEW_TestResetToStep1_CPSF();
#endif
#endif
                if (P0117_i_ViewWallIndex >= M585_VIEW_WALL_D1L_RIGHT) {
                        if (P0117_i_ViewWallIndex == M587_VIEW_WALL_D1C_FRONT) {
                                if (L0095_B_IsInscription) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                                        F0132_VIDEO_Blit(G0700_puc_Bitmap_WallSet_Wall_D1LCR, G0296_puc_Bitmap_Viewport, G0202_auc_Graphic558_Box_WallPatchBehindInscription, 94, 28, G0163_aauc_Graphic558_Frame_Walls[M606_VIEW_SQUARE_D1C][C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                        F0132_VIDEO_Blit(G0700_puc_Bitmap_WallSet_Wall_D1LCR, G0296_puc_Bitmap_Viewport, G0202_auc_Graphic558_Box_WallPatchBehindInscription, 94, 28, G0163_aauc_Graphic558_Frame_Walls[M606_VIEW_SQUARE_D1C][C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, CM1_COLOR_NO_TRANSPARENCY, G0163_aauc_Graphic558_Frame_Walls[M606_VIEW_SQUARE_D1C][C5_HEIGHT], C136_HEIGHT_VIEWPORT);
#endif
                                        AL0090_puc_String = L0099_auc_InscriptionString;
                                        L0092_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(M648_GRAPHIC_INSCRIPTION_FONT);
                                        L0097_i_TextLineIndex = 0;
                                        do {
                                                AP0116_i_CharacterCount = 0;
                                                AL0091_puc_Character = AL0090_puc_String;
                                                while (*AL0091_puc_Character++ < 128) { /* Hexadecimal: 0x80 (Megamax C does not support hexadecimal character constants) */
                                                        AP0116_i_CharacterCount++;
                                                }
                                                L0098_auc_Frame[C1_X2] = (L0098_auc_Frame[C0_X1] = 112 - (AP0116_i_CharacterCount << 2)) + 7;
                                                L0098_auc_Frame[C2_Y1] = (L0098_auc_Frame[C3_Y2] = G0203_auc_Graphic558_InscriptionLineY[L0097_i_TextLineIndex++]) - 7;
                                                while (AP0116_i_CharacterCount--) {
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                                                        F0132_VIDEO_Blit(L0092_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0098_auc_Frame, *AL0090_puc_String++ << 3, 0, C144_BYTE_WIDTH, C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                        F0132_VIDEO_Blit(L0092_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0098_auc_Frame, *AL0090_puc_String++ << 3, 0, C144_BYTE_WIDTH, C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH, 8, C136_HEIGHT_VIEWPORT);
#endif
                                                        L0098_auc_Frame[C0_X1] += 8;
                                                        L0098_auc_Frame[C1_X2] += 8;
                                                }
                                        } while (*AL0090_puc_String++ != 129); /* Hexadecimal: 0x81 (Megamax C does not support hexadecimal character constants) */
#endif
#ifdef MEDIA459_P20JA_P20JB_P31J
                                        F0791_DUNGEONVIEW_DrawBitmapXX(F0489_MEMORY_GetNativeBitmapOrGraphic(++AL0088_i_NativeBitmapIndex), G0296_puc_Bitmap_Viewport, AL0089_i_ZoneIndex, MASK0x0000_NO_FLIP, C10_COLOR_FLESH);
#endif
#ifdef MEDIA575_F20J_X30J_F31J_X31J
                                        F0791_DUNGEONVIEW_DrawBitmapXX(F1005_(++AL0088_i_NativeBitmapIndex, CM1_DERIVED_BITMAP_NONE, MASK0x0000_NO_FLIP), G0296_puc_Bitmap_Viewport, AL0089_i_ZoneIndex, MASK0x0000_NO_FLIP, C10_COLOR_FLESH);
#endif
#ifdef MEDIA571_F20J_X30J_P20JA_P20JB_F31J_X31J_P31J
                                        L2455_i_ = 0;
                                        L2456_i_TextLineIndex = 0;
                                        while (L0099_auc_InscriptionString[L2455_i_] && (L2456_i_TextLineIndex < 3)) {
                                                L2453_i_Height = G2338_i_JapaneseCharacterMaximumHeight;
                                                L2452_i_Width = F0646_GetLargestPrintableSubString(M772_CAST_PC(L0099_auc_InscriptionString), M772_CAST_PC(L2457_auc_), &L2455_i_, G2005_GraphicWidthHeight[AL0088_i_NativeBitmapIndex].Width);
#ifdef MEDIA689_F31J_X31J_P31J
                                                if (L2452_i_Width != 0) {
#endif
                                                        F0635_(NULL, L2454_ai_XYZ, L2456_i_TextLineIndex + C1000_ZONE_INSCRIPTION, &L2452_i_Width, &L2453_i_Height);
#ifdef MEDIA569_F20J_X30J_P20JA_P20JB
                                                        M704_ZONE_LEFT(L2454_ai_XYZ)++;
                                                        M707_ZONE_BOTTOM(L2454_ai_XYZ)++;
                                                        F0644_PrintTextAlt(G0296_puc_Bitmap_Viewport, G2073_C224_ViewportPixelWidth, M704_ZONE_LEFT(L2454_ai_XYZ), M707_ZONE_BOTTOM(L2454_ai_XYZ), C15_COLOR_WHITE, MASK0x4000_TRANSPARENT | C13_COLOR_LIGHTEST_GRAY, M772_CAST_PC(L2457_auc_));
                                                        M704_ZONE_LEFT(L2454_ai_XYZ)--;
                                                        M707_ZONE_BOTTOM(L2454_ai_XYZ)--;
#endif
#ifdef MEDIA689_F31J_X31J_P31J
                                                        F0644_PrintTextAlt(G0296_puc_Bitmap_Viewport, G2073_C224_ViewportPixelWidth, M704_ZONE_LEFT(L2454_ai_XYZ) + 1, M706_ZONE_TOP(L2454_ai_XYZ) + M709_ZONE_HEIGHT(L2454_ai_XYZ), C15_COLOR_WHITE, MASK0x4000_TRANSPARENT | C13_COLOR_LIGHTEST_GRAY, M772_CAST_PC(L2457_auc_));
#endif
                                                        F0644_PrintTextAlt(G0296_puc_Bitmap_Viewport, G2073_C224_ViewportPixelWidth, M704_ZONE_LEFT(L2454_ai_XYZ), M707_ZONE_BOTTOM(L2454_ai_XYZ), C02_COLOR_LIGHT_GRAY, MASK0x4000_TRANSPARENT | C13_COLOR_LIGHTEST_GRAY, M772_CAST_PC(L2457_auc_));
#ifdef MEDIA689_F31J_X31J_P31J
                                                }
#endif
                                                if (L0099_auc_InscriptionString[L2455_i_] == '\n') {
                                                        L2455_i_++;
                                                }
                                                L2456_i_TextLineIndex++;
                                        }
#endif
#ifdef MEDIA562_F20E_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E
#ifdef MEDIA487_F20E
                                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(M712_NEGGRAPHIC_, C731_ZONE);
#endif
#ifdef MEDIA718_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E
                                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(M712_NEGGRAPHIC_, C735_ZONE);
#endif
                                        L0092_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(M648_GRAPHIC_INSCRIPTION_FONT);
                                        AL0097_i_TextLineIndex = 0;
                                        AL0091_puc_Character = L0099_auc_InscriptionString;
                                        do {
                                                AP0116_i_CharacterCount = 0;
                                                while (AL0091_puc_Character[AP0116_i_CharacterCount] < 128) { /* Hexadecimal: 0x80 (Megamax C does not support hexadecimal character constants) */
                                                        AP0116_i_CharacterCount++;
                                                }
#ifdef MEDIA718_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E
                                                if (AP0116_i_CharacterCount) { /* ANOMALY_ASSEMBLY_COMPILATION_DIFFERENCE jmp */
#endif
                                                        L2452_i_Width = G2089_C8_InscriptionCharacterWidth * AP0116_i_CharacterCount;
                                                        L2453_i_Height = G2090_C8_InscriptionLineHeight;
                                                        F0635_(NULL, L2454_ai_XYZ, AL0097_i_TextLineIndex + C1000_ZONE_INSCRIPTION, &L2452_i_Width, &L2453_i_Height);
#ifdef MEDIA487_F20E
                                                        M705_ZONE_RIGHT(L2454_ai_XYZ) = M704_ZONE_LEFT(L2454_ai_XYZ) + G2089_C8_InscriptionCharacterWidth - 1;
#endif
#ifdef MEDIA718_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E
                                                        M708_ZONE_WIDTH(L2454_ai_XYZ) = G2089_C8_InscriptionCharacterWidth;
#endif
                                                        while (AP0116_i_CharacterCount--) {
                                                                F0654_Call_F0132_VIDEO_Blit(M772_CAST_PC(L0092_puc_Bitmap), M772_CAST_PC(G0296_puc_Bitmap_Viewport), L2454_ai_XYZ, *AL0091_puc_Character++ * G2089_C8_InscriptionCharacterWidth, 0, C10_COLOR_FLESH);
                                                                M704_ZONE_LEFT(L2454_ai_XYZ) += G2089_C8_InscriptionCharacterWidth;
#ifdef MEDIA487_F20E
                                                                M705_ZONE_RIGHT(L2454_ai_XYZ) += G2089_C8_InscriptionCharacterWidth;
#endif
                                                        }
#ifdef MEDIA718_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E
                                                }
#endif
                                                AL0097_i_TextLineIndex++;
                                        } while (*AL0091_puc_Character++ != 129); /* Hexadecimal: 0x81 (Megamax C does not support hexadecimal character constants) */
#endif
                                        goto T0107031;
                                }
#ifdef MEDIA365_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J /* ANOMALY_ST_BRANCH */
                                else {
#endif
                                        AL0088_i_NativeBitmapIndex++;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                        F0007_MAIN_CopyBytes(AL0090_puc_CoordinateSet, G0291_aauc_DungeonViewClickableBoxes[C05_VIEW_CELL_DOOR_BUTTON_OR_WALL_ORNAMENT], sizeof(G0291_aauc_DungeonViewClickableBoxes[C05_VIEW_CELL_DOOR_BUTTON_OR_WALL_ORNAMENT]));
#endif
                                        G0286_B_FacingAlcove = L0096_B_IsAlcove;
                                        G0287_B_FacingViAltar =
#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
                                        G0078_B_FuzzyBitFound_CPSF && /* Prevent rebirth at Vi Altar if copy protection failed */
#endif
#endif
                                        (AP0116_i_WallOrnamentIndex == G0266_i_CurrentMapViAltarWallOrnamentIndex);
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
                                        G0288_B_FacingFountain = C0_FALSE;
                                        for (AL9992_i_FountainOrnamentIndex = 0; AL9992_i_FountainOrnamentIndex < C001_FOUNTAIN_ORNAMENT_COUNT; AL9992_i_FountainOrnamentIndex++) {
                                                if (G0268_ai_CurrentMapFountainOrnamentIndices[AL9992_i_FountainOrnamentIndex] == AP0116_i_WallOrnamentIndex) {
                                                        G0288_B_FacingFountain = C1_TRUE;
                                                        break;
                                                }
                                        }
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                        G0288_B_FacingFountain = F0601_IsWallOrnamentAFountain(AP0116_i_WallOrnamentIndex);
#endif
#ifdef MEDIA365_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                }
#endif
                        }
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        if (P0117_i_ViewWallIndex == M586_VIEW_WALL_D1R_LEFT) {
                                L0094_B_FlipHorizontal = C1_TRUE;
                        }
#endif
#ifdef MEDIA012_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_P20JA_P20JB_I34E_I34M_P31J
                        AL0091_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(AL0088_i_NativeBitmapIndex);
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        AL0091_puc_Bitmap = F1005_(AL0088_i_NativeBitmapIndex, CM1_DERIVED_BITMAP_NONE, L0094_B_FlipHorizontal);
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        if (P0117_i_ViewWallIndex == M586_VIEW_WALL_D1R_LEFT) {
                                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(AL0091_puc_Bitmap, G0074_puc_Bitmap_Temporary, AL0090_puc_CoordinateSet[C4_BYTE_WIDTH], AL0090_puc_CoordinateSet[C5_HEIGHT]);
                                AL0091_puc_Bitmap = G0074_puc_Bitmap_Temporary;
                        }
                        AL0089_i_X = 0;
#endif
                } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        L0093_i_CoordinateSetOffset = 0;
                        if (L0094_B_FlipHorizontal = (P0117_i_ViewWallIndex == M581_VIEW_WALL_D2R_LEFT) || (P0117_i_ViewWallIndex == M576_VIEW_WALL_D3R_LEFT)) {
                                AL0091_puc_CoordinateSet = G0205_aaauc_Graphic558_WallOrnamentCoordinateSets[AL0089_i_WallOrnamentCoordinateSetIndex][M586_VIEW_WALL_D1R_LEFT];
                        } else {
                                if ((P0117_i_ViewWallIndex == M580_VIEW_WALL_D2L_RIGHT) || (P0117_i_ViewWallIndex == M575_VIEW_WALL_D3L_RIGHT)) {
                                        AL0091_puc_CoordinateSet = G0205_aaauc_Graphic558_WallOrnamentCoordinateSets[AL0089_i_WallOrnamentCoordinateSetIndex][M585_VIEW_WALL_D1L_RIGHT];
                                } else {
                                        AL0088_i_NativeBitmapIndex++;
                                        AL0091_puc_CoordinateSet = G0205_aaauc_Graphic558_WallOrnamentCoordinateSets[AL0089_i_WallOrnamentCoordinateSetIndex][M587_VIEW_WALL_D1C_FRONT];
                                        if (P0117_i_ViewWallIndex == M582_VIEW_WALL_D2L_FRONT) {
                                                L0093_i_CoordinateSetOffset = 6;
                                        } else {
                                                if (P0117_i_ViewWallIndex == M584_VIEW_WALL_D2R_FRONT) {
                                                        L0093_i_CoordinateSetOffset = -6;
                                                }
                                        }
                                }
                        }
                        AL0089_i_PixelWidth = (AL0090_puc_CoordinateSet + L0093_i_CoordinateSetOffset)[C1_X2] - (AL0090_puc_CoordinateSet + L0093_i_CoordinateSetOffset)[C0_X1];
                        if (!F0491_CACHE_IsDerivedBitmapInCache(AP0116_i_WallOrnamentIndex = C004_DERIVED_BITMAP_FIRST_WALL_ORNAMENT + (AP0116_i_WallOrnamentIndex << 2) + G0190_auc_Graphic558_WallOrnamentDerivedBitmapIndexIncrement[P0117_i_ViewWallIndex])) {
                                L0092_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(AL0088_i_NativeBitmapIndex);
                                F0129_VIDEO_BlitShrinkWithPaletteChanges(L0092_puc_Bitmap, F0492_CACHE_GetDerivedBitmap(AP0116_i_WallOrnamentIndex), AL0091_puc_CoordinateSet[C4_BYTE_WIDTH] << 1, AL0091_puc_CoordinateSet[C5_HEIGHT], AL0089_i_PixelWidth + 1, AL0090_puc_CoordinateSet[C5_HEIGHT], (P0117_i_ViewWallIndex <= M579_VIEW_WALL_D3R_FRONT) ? G0198_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D3 : G0199_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D2);
                                F0493_CACHE_AddDerivedBitmap(AP0116_i_WallOrnamentIndex);
                        }
                        AL0091_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(AP0116_i_WallOrnamentIndex);
                        if (L0094_B_FlipHorizontal) {
                                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(AL0091_puc_Bitmap, G0074_puc_Bitmap_Temporary, AL0090_puc_CoordinateSet[C4_BYTE_WIDTH], AL0090_puc_CoordinateSet[C5_HEIGHT]);
                                AL0091_puc_Bitmap = G0074_puc_Bitmap_Temporary;
                                AL0089_i_X = 15 - (AL0089_i_X & 0x000F);
                        } else {
                                if (P0117_i_ViewWallIndex == M582_VIEW_WALL_D2L_FRONT) {
                                        AL0089_i_X -= AL0090_puc_CoordinateSet[C1_X2] - AL0090_puc_CoordinateSet[C0_X1];
                                } else {
                                        AL0089_i_X = 0;
                                }
                        }
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        if ((P0117_i_ViewWallIndex == M581_VIEW_WALL_D2R_LEFT) || (P0117_i_ViewWallIndex == M576_VIEW_WALL_D3R_LEFT)) {
                                L0094_B_FlipHorizontal = C1_TRUE;
                        } else {
                                if ((P0117_i_ViewWallIndex != M580_VIEW_WALL_D2L_RIGHT) && (P0117_i_ViewWallIndex != M575_VIEW_WALL_D3L_RIGHT)) {
                                        AL0088_i_NativeBitmapIndex++;
                                }
                        }
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        if ((P0117_i_ViewWallIndex == M581_VIEW_WALL_D2R_LEFT) || (P0117_i_ViewWallIndex == M576_VIEW_WALL_D3R_LEFT) || (P0117_i_ViewWallIndex == C01_VIEW_WALL_D3R2_LEFT)) {
                                L0094_B_FlipHorizontal = C1_TRUE;
                        } else {
                                if ((P0117_i_ViewWallIndex >= M577_VIEW_WALL_D3L_FRONT) && (P0117_i_ViewWallIndex != M580_VIEW_WALL_D2L_RIGHT)) {
                                        AL0088_i_NativeBitmapIndex++;
                                }
                        }
                        if (P0117_i_ViewWallIndex <= C01_VIEW_WALL_D3R2_LEFT) {
#ifdef MEDIA709_I34E_I34M_P31J
                                AL0091_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(AL0088_i_NativeBitmapIndex, CM1_DERIVED_BITMAP_NONE, C30_SCALE_, C14_SCALE_, &G0198_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D3);
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                                AL0091_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(AL0088_i_NativeBitmapIndex, CM1_DERIVED_BITMAP_NONE, L0094_B_FlipHorizontal, CM1_DERIVED_BITMAP_NONE, C30_SCALE_, C14_SCALE_, G0198_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D3);
#endif
                        } else {
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                if (P0117_i_ViewWallIndex <= M579_VIEW_WALL_D3R_FRONT) {
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                        AL0097_i_Scale = C16_SCALE_;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                        AL0097_i_Scale = C14_SCALE_;
#endif
                                        L0092_puc_Bitmap = G0198_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D3;
                                } else {
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                        AL0097_i_Scale = C20_SCALE_;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                        AL0097_i_Scale = C21_SCALE_;
#endif
                                        L0092_puc_Bitmap = G0199_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D2;
                                }
                                AP0116_i_WallOrnamentIndex = C004_DERIVED_BITMAP_FIRST_WALL_ORNAMENT + (AP0116_i_WallOrnamentIndex << 2) + G0190_auc_Graphic558_WallOrnamentDerivedBitmapIndexIncrement[P0117_i_ViewWallIndex];
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                                AL0091_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(AL0088_i_NativeBitmapIndex, AP0116_i_WallOrnamentIndex, AL0097_i_Scale, AL0097_i_Scale, L0092_puc_Bitmap);
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                                AL0091_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(AL0088_i_NativeBitmapIndex, CM1_DERIVED_BITMAP_NONE, L0094_B_FlipHorizontal, AP0116_i_WallOrnamentIndex, AL0097_i_Scale, AL0097_i_Scale, L0092_puc_Bitmap);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        }
#endif
                }
#ifdef MEDIA061_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E
                if (L0095_B_IsInscription) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        L0092_puc_Bitmap = AL0090_puc_CoordinateSet;
                        AL0090_puc_String = L0099_auc_InscriptionString;
                        AL0088_i_UnreadableTextLineCount = 0;
                        do {
                                while (*AL0090_puc_String < 128) { /* Hexadecimal: 0x80 (Megamax C does not support hexadecimal character constants) */
                                        AL0090_puc_String++;
                                }
                                AL0088_i_UnreadableTextLineCount++;
                        } while (*AL0090_puc_String++ != 129); /* Hexadecimal: 0x81 (Megamax C does not support hexadecimal character constants) */
                        AL0090_puc_CoordinateSet = L0092_puc_Bitmap;
                        if (AL0088_i_UnreadableTextLineCount < 4) {
                                F0007_MAIN_CopyBytes(AL0090_puc_CoordinateSet, L0098_auc_Frame, sizeof(L0098_auc_Frame));
                                AL0090_puc_CoordinateSet = L0098_auc_Frame;
                                AL0090_puc_CoordinateSet[C3_Y2] = G0204_auc_Graphic558_UnreadableInscriptionBoxY2[G0190_auc_Graphic558_WallOrnamentDerivedBitmapIndexIncrement[P0117_i_ViewWallIndex] * 3 + AL0088_i_UnreadableTextLineCount - 1];
                        }
#endif
#ifdef MEDIA562_F20E_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E
                        AL0090_puc_String = AL0091_puc_Bitmap;
                        AL0091_puc_Character = L0099_auc_InscriptionString;
                        AL0097_i_TextLineIndex = 0;
                        do {
                                while (*AL0091_puc_Character < 128) { /* Hexadecimal: 0x80 (Megamax C does not support hexadecimal character constants) */
                                        AL0091_puc_Character++;
                                }
                                AL0097_i_TextLineIndex++;
                        } while (*AL0091_puc_Character++ != 129); /* Hexadecimal: 0x81 (Megamax C does not support hexadecimal character constants) */
                        AL0091_puc_Bitmap = AL0090_puc_String;
                        if (AL0097_i_TextLineIndex < 4) {
#ifdef MEDIA563_F20E_A36M_A31E_A31M_A33M_A35E_A35M_F31E
                                AL0089_i_ZoneIndex |= MASK0x4000_SHIFT_UNREADABLE_INSCRIPTION_AND_OPEN_VERTICAL_DOOR;
#endif
#ifdef MEDIA707_I34E_I34M
                                AL0089_i_ZoneIndex = AL0089_i_ZoneIndex | MASK0x4000_SHIFT_UNREADABLE_INSCRIPTION_AND_OPEN_VERTICAL_DOOR; /* Is variable unsigned to fix PC version ? */
#endif
                                G2154_i_ZoneShiftX = M100_PIXEL_WIDTH(AL0091_puc_Bitmap);
                                G2155_i_ZoneShiftY = G0204_auc_Graphic558_UnreadableInscriptionBoxY2[G0190_auc_Graphic558_WallOrnamentDerivedBitmapIndexIncrement[P0117_i_ViewWallIndex] * 3 + AL0097_i_TextLineIndex - 1];
                        }
#endif
                }
#endif
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                F0132_VIDEO_Blit(AL0091_puc_Bitmap, G0296_puc_Bitmap_Viewport, AL0090_puc_CoordinateSet, AL0089_i_X, 0, AL0090_puc_CoordinateSet[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0132_VIDEO_Blit(AL0091_puc_Bitmap, G0296_puc_Bitmap_Viewport, AL0090_puc_CoordinateSet, AL0089_i_X, 0, AL0090_puc_CoordinateSet[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH, AL0090_puc_CoordinateSet[C5_HEIGHT], C136_HEIGHT_VIEWPORT);
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                if ((P0117_i_ViewWallIndex == M587_VIEW_WALL_D1C_FRONT) && G0289_i_DungeonView_ChampionPortraitOrdinal--) { /* BUG0_05 A champion portrait sensor on a wall square is visible on all sides of the wall. If there is another sensor with a wall ornament on one side of the wall then the champion portrait is drawn over that wall ornament */
#endif
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                        F0132_VIDEO_Blit(F0489_MEMORY_GetNativeBitmapOrGraphic(C026_GRAPHIC_CHAMPION_PORTRAITS), G0296_puc_Bitmap_Viewport, G0109_auc_Graphic558_Box_ChampionPortraitOnWall, (G0289_i_DungeonView_ChampionPortraitOrdinal & 0x0007) << 5, (G0289_i_DungeonView_ChampionPortraitOrdinal >> 3) * 29, C128_BYTE_WIDTH, C112_BYTE_WIDTH_VIEWPORT, C01_COLOR_DARK_GRAY); /* A portrait is 32x29 pixels */
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0132_VIDEO_Blit(F0489_MEMORY_GetNativeBitmapOrGraphic(C026_GRAPHIC_CHAMPION_PORTRAITS), G0296_puc_Bitmap_Viewport, G0109_auc_Graphic558_Box_ChampionPortraitOnWall, (G0289_i_DungeonView_ChampionPortraitOrdinal & 0x0007) << 5, (G0289_i_DungeonView_ChampionPortraitOrdinal >> 3) * 29, C128_BYTE_WIDTH, C112_BYTE_WIDTH_VIEWPORT, C01_COLOR_DARK_GRAY, 87, C136_HEIGHT_VIEWPORT); /* A portrait is 32x29 pixels */
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0791_DUNGEONVIEW_DrawBitmapXX(AL0091_puc_Bitmap, G0296_puc_Bitmap_Viewport, AL0089_i_ZoneIndex, L0094_B_FlipHorizontal, C10_COLOR_FLESH);
                if (P0117_i_ViewWallIndex == M587_VIEW_WALL_D1C_FRONT) { /* BUG0_05 A champion portrait sensor on a wall square is visible on all sides of the wall. If there is another sensor with a wall ornament on one side of the wall then the champion portrait is drawn over that wall ornament */
                        F0007_MAIN_CopyBytes((char*)G2032_ai_XYZ, (char*)G2210_aai_XYZ_DungeonViewClickable[C05_VIEW_CELL_DOOR_BUTTON_OR_WALL_ORNAMENT], (long)sizeof(G2210_aai_XYZ_DungeonViewClickable[C05_VIEW_CELL_DOOR_BUTTON_OR_WALL_ORNAMENT]));
                        if (G0289_i_DungeonView_ChampionPortraitOrdinal--) {
                                L2452_i_Width = G2078_C32_PortraitWidth;
                                L2453_i_Height = G2079_C29_PortraitHeight;
                                F0654_Call_F0132_VIDEO_Blit(M772_CAST_PC(F0489_MEMORY_GetNativeBitmapOrGraphic(C026_GRAPHIC_CHAMPION_PORTRAITS)), M772_CAST_PC(G0296_puc_Bitmap_Viewport), F0635_(NULL, L2454_ai_XYZ, M635_ZONE_PORTRAIT_ON_WALL, &L2452_i_Width, &L2453_i_Height), (G0289_i_DungeonView_ChampionPortraitOrdinal & 0x0007) * G2078_C32_PortraitWidth, (G0289_i_DungeonView_ChampionPortraitOrdinal >> 3) * G2079_C29_PortraitHeight, C01_COLOR_DARK_GRAY);
                        }
#endif
                }
                T0107031:
                return L0096_B_IsAlcove;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        }
        return C0_FALSE;
#endif
}

STATICFUNCTION void F0108_DUNGEONVIEW_DrawFloorOrnament(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0118_ui_FloorOrnamentOrdinal, P0119_ui_ViewFloorIndex)
#endif
REGISTER unsigned int16_t P0118_ui_FloorOrnamentOrdinal SEPARATOR
REGISTER unsigned int16_t P0119_ui_ViewFloorIndex       FINAL_SEPARATOR
#define AP0118_ui_FloorOrnamentIndex P0118_ui_FloorOrnamentOrdinal
{
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        REGISTER unsigned char* L0102_puc_Bitmap;
        REGISTER unsigned char* L0103_puc_CoordinateSet;
        REGISTER int16_t L0100_i_NativeBitmapIndex;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER int16_t L2458_i_Flip;
#endif
        REGISTER BOOLEAN L0101_B_DrawFootprints;


        if (P0118_ui_FloorOrnamentOrdinal) {
                if (L0101_B_DrawFootprints = M007_GET(P0118_ui_FloorOrnamentOrdinal, MASK0x8000_FOOTPRINTS)) {
                        if (!M009_CLEAR(P0118_ui_FloorOrnamentOrdinal, MASK0x8000_FOOTPRINTS))
                                goto T0108005;
                }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                L0100_i_NativeBitmapIndex = G0102_as_CurrentMapFloorOrnamentsInfo[--AP0118_ui_FloorOrnamentIndex].NativeBitmapIndex + G0191_auc_Graphic558_FloorOrnamentNativeBitmapIndexIncrements[P0119_ui_ViewFloorIndex];
                L0103_puc_CoordinateSet = G0206_aaauc_Graphic558_FloorOrnamentCoordinateSets[G0102_as_CurrentMapFloorOrnamentsInfo[AP0118_ui_FloorOrnamentIndex].CoordinateSet][P0119_ui_ViewFloorIndex];
                if ((P0119_ui_ViewFloorIndex == M596_VIEW_FLOOR_D1R) || (P0119_ui_ViewFloorIndex == M593_VIEW_FLOOR_D2R) || (P0119_ui_ViewFloorIndex == M590_VIEW_FLOOR_D3R) || ((AP0118_ui_FloorOrnamentIndex == C15_FLOOR_ORNAMENT_FOOTPRINTS) && G0076_B_UseFlippedWallAndFootprintsBitmaps && ((P0119_ui_ViewFloorIndex == M595_VIEW_FLOOR_D1C) || (P0119_ui_ViewFloorIndex == M592_VIEW_FLOOR_D2C) || (P0119_ui_ViewFloorIndex == M589_VIEW_FLOOR_D3C)))) {
                        F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(F0489_MEMORY_GetNativeBitmapOrGraphic(L0100_i_NativeBitmapIndex), L0102_puc_Bitmap = G0074_puc_Bitmap_Temporary, L0103_puc_CoordinateSet[C4_BYTE_WIDTH], L0103_puc_CoordinateSet[C5_HEIGHT]);
                } else {
                        L0102_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(L0100_i_NativeBitmapIndex);
                }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                AP0118_ui_FloorOrnamentIndex--;
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                if ((P0119_ui_ViewFloorIndex == M596_VIEW_FLOOR_D1R) || (P0119_ui_ViewFloorIndex == M593_VIEW_FLOOR_D2R) || (P0119_ui_ViewFloorIndex == M590_VIEW_FLOOR_D3R) || ((AP0118_ui_FloorOrnamentIndex == C15_FLOOR_ORNAMENT_FOOTPRINTS) && G0076_B_UseFlippedWallAndFootprintsBitmaps && ((P0119_ui_ViewFloorIndex == M595_VIEW_FLOOR_D1C) || (P0119_ui_ViewFloorIndex == M592_VIEW_FLOOR_D2C) || (P0119_ui_ViewFloorIndex == M589_VIEW_FLOOR_D3C)))) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                if ((P0119_ui_ViewFloorIndex == M596_VIEW_FLOOR_D1R) || (P0119_ui_ViewFloorIndex == M593_VIEW_FLOOR_D2R) || (P0119_ui_ViewFloorIndex == M590_VIEW_FLOOR_D3R) || (P0119_ui_ViewFloorIndex == C01_VIEW_FLOOR_D3R2) || ((AP0118_ui_FloorOrnamentIndex == C15_FLOOR_ORNAMENT_FOOTPRINTS) && G0076_B_UseFlippedWallAndFootprintsBitmaps && ((P0119_ui_ViewFloorIndex == M595_VIEW_FLOOR_D1C) || (P0119_ui_ViewFloorIndex == M592_VIEW_FLOOR_D2C) || (P0119_ui_ViewFloorIndex == M589_VIEW_FLOOR_D3C)))) {
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        L2458_i_Flip = MASK0x0001_FLIP_HORIZONTAL;
                } else {
                        L2458_i_Flip = MASK0x0000_NO_FLIP;
                }
#endif
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                F0132_VIDEO_Blit(L0102_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0103_puc_CoordinateSet, 0, 0, L0103_puc_CoordinateSet[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0132_VIDEO_Blit(L0102_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0103_puc_CoordinateSet, 0, 0, L0103_puc_CoordinateSet[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH, L0103_puc_CoordinateSet[C5_HEIGHT], C136_HEIGHT_VIEWPORT);
#endif
#ifdef MEDIA458_P20JA_P20JB
                F0791_DUNGEONVIEW_DrawBitmapXX(F0489_MEMORY_GetNativeBitmapOrGraphic(G0102_as_CurrentMapFloorOrnamentsInfo[AP0118_ui_FloorOrnamentIndex].NativeBitmapIndex + G0191_auc_Graphic558_FloorOrnamentNativeBitmapIndexIncrements[P0119_ui_ViewFloorIndex]), G0296_puc_Bitmap_Viewport, G0102_as_CurrentMapFloorOrnamentsInfo[AP0118_ui_FloorOrnamentIndex].CoordinateSet * 9 + P0119_ui_ViewFloorIndex + C1500_ZONE_FLOOR_ORNAMENT, L2458_i_Flip, C10_COLOR_FLESH);
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                F0791_DUNGEONVIEW_DrawBitmapXX(F0489_MEMORY_GetNativeBitmapOrGraphic(G0102_as_CurrentMapFloorOrnamentsInfo[AP0118_ui_FloorOrnamentIndex].NativeBitmapIndex + G0191_auc_Graphic558_FloorOrnamentNativeBitmapIndexIncrements[P0119_ui_ViewFloorIndex]), G0296_puc_Bitmap_Viewport, G0102_as_CurrentMapFloorOrnamentsInfo[AP0118_ui_FloorOrnamentIndex].CoordinateSet * 11 + P0119_ui_ViewFloorIndex + C1500_ZONE_FLOOR_ORNAMENT, L2458_i_Flip, C10_COLOR_FLESH);
#endif
#ifdef MEDIA506_F20E_F20J_X30J
                F0791_DUNGEONVIEW_DrawBitmapXX(F1005_(G0102_as_CurrentMapFloorOrnamentsInfo[AP0118_ui_FloorOrnamentIndex].NativeBitmapIndex + G0191_auc_Graphic558_FloorOrnamentNativeBitmapIndexIncrements[P0119_ui_ViewFloorIndex], CM1_DERIVED_BITMAP_NONE, L2458_i_Flip), G0296_puc_Bitmap_Viewport, C1500_ZONE_FLOOR_ORNAMENT + G0102_as_CurrentMapFloorOrnamentsInfo[AP0118_ui_FloorOrnamentIndex].CoordinateSet * 9 + P0119_ui_ViewFloorIndex, L2458_i_Flip, C10_COLOR_FLESH);
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                F0791_DUNGEONVIEW_DrawBitmapXX(F1005_(G0102_as_CurrentMapFloorOrnamentsInfo[AP0118_ui_FloorOrnamentIndex].NativeBitmapIndex + G0191_auc_Graphic558_FloorOrnamentNativeBitmapIndexIncrements[P0119_ui_ViewFloorIndex], CM1_DERIVED_BITMAP_NONE, L2458_i_Flip), G0296_puc_Bitmap_Viewport, C1500_ZONE_FLOOR_ORNAMENT + G0102_as_CurrentMapFloorOrnamentsInfo[AP0118_ui_FloorOrnamentIndex].CoordinateSet * 11 + P0119_ui_ViewFloorIndex, L2458_i_Flip, C10_COLOR_FLESH);
#endif
                T0108005:
                if (L0101_B_DrawFootprints) {
                        F0108_DUNGEONVIEW_DrawFloorOrnament(M000_INDEX_TO_ORDINAL(C15_FLOOR_ORNAMENT_FOOTPRINTS), P0119_ui_ViewFloorIndex);
                }
        }
}

STATICFUNCTION void F0109_DUNGEONVIEW_DrawDoorOrnament(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0120_i_DoorOrnamentOrdinal, P0121_i_ViewDoorOrnamentIndex)
#endif
REGISTER int16_t P0120_i_DoorOrnamentOrdinal   SEPARATOR
REGISTER int16_t P0121_i_ViewDoorOrnamentIndex FINAL_SEPARATOR
#define AP0120_i_Height P0120_i_DoorOrnamentOrdinal
#define AP0121_i_ByteWidth P0121_i_ViewDoorOrnamentIndex
{
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        REGISTER unsigned char* L0106_puc_CoordinateSet;
#endif
        REGISTER unsigned char* L0107_puc_Multiple;
#define AL0107_puc_Bitmap        L0107_puc_Multiple
#define AL0107_puc_CoordinateSet L0107_puc_Multiple
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER unsigned char* L2459_puc_PaletteChange;
#endif
        REGISTER int16_t L0104_i_NativeBitmapIndex;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        REGISTER int16_t L0105_i_CoordinateSet;
        unsigned char* L0108_puc_Bitmap_Native;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER int16_t L2460_i_HorizontalScale;
        REGISTER int16_t L2461_i_VerticalScale;
#endif


        if (P0120_i_DoorOrnamentOrdinal) {
                P0120_i_DoorOrnamentOrdinal--;
                L0104_i_NativeBitmapIndex = G0103_as_CurrentMapDoorOrnamentsInfo[P0120_i_DoorOrnamentOrdinal].NativeBitmapIndex;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                L0106_puc_CoordinateSet = G0207_aaauc_Graphic558_DoorOrnamentCoordinateSets[L0105_i_CoordinateSet = G0103_as_CurrentMapDoorOrnamentsInfo[P0120_i_DoorOrnamentOrdinal].CoordinateSet][P0121_i_ViewDoorOrnamentIndex];
#endif
                if (P0121_i_ViewDoorOrnamentIndex == C2_VIEW_DOOR_ORNAMENT_D1LCR) {
                        AL0107_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(L0104_i_NativeBitmapIndex);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        AP0121_i_ByteWidth = C048_BYTE_WIDTH;
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        AP0120_i_Height = 88;
#endif
                } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        if (!F0491_CACHE_IsDerivedBitmapInCache(P0120_i_DoorOrnamentOrdinal = C068_DERIVED_BITMAP_FIRST_DOOR_ORNAMENT_D3 + (P0120_i_DoorOrnamentOrdinal * 2) + P0121_i_ViewDoorOrnamentIndex)) {
                                AL0107_puc_CoordinateSet = G0207_aaauc_Graphic558_DoorOrnamentCoordinateSets[L0105_i_CoordinateSet][C2_VIEW_DOOR_ORNAMENT_D1LCR];
                                L0108_puc_Bitmap_Native = F0489_MEMORY_GetNativeBitmapOrGraphic(L0104_i_NativeBitmapIndex);
                                F0129_VIDEO_BlitShrinkWithPaletteChanges(L0108_puc_Bitmap_Native, F0492_CACHE_GetDerivedBitmap(P0120_i_DoorOrnamentOrdinal), AL0107_puc_CoordinateSet[C4_BYTE_WIDTH] << 1, AL0107_puc_CoordinateSet[C5_HEIGHT], L0106_puc_CoordinateSet[C1_X2] - L0106_puc_CoordinateSet[C0_X1] + 1, L0106_puc_CoordinateSet[C5_HEIGHT], (P0121_i_ViewDoorOrnamentIndex == C0_VIEW_DOOR_ORNAMENT_D3LCR) ? G0200_auc_Graphic558_PaletteChanges_DoorOrnament_D3 : G0201_auc_Graphic558_PaletteChanges_DoorOrnament_D2);
                                F0493_CACHE_AddDerivedBitmap(P0120_i_DoorOrnamentOrdinal);
                        }
                        AL0107_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(P0120_i_DoorOrnamentOrdinal);
#endif
                        if (P0121_i_ViewDoorOrnamentIndex == C0_VIEW_DOOR_ORNAMENT_D3LCR) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                AP0121_i_ByteWidth = C024_BYTE_WIDTH;
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                AP0120_i_Height = 41;
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                L2460_i_HorizontalScale = L2461_i_VerticalScale = C16_SCALE_;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                L2460_i_HorizontalScale = L2461_i_VerticalScale = C14_SCALE_;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                L2459_puc_PaletteChange = G0200_auc_Graphic558_PaletteChanges_DoorOrnament_D3;
#endif
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                AP0121_i_ByteWidth = C032_BYTE_WIDTH;
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                AP0120_i_Height = 61;
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                L2460_i_HorizontalScale = C22_SCALE_;
                                L2461_i_VerticalScale = C23_SCALE_;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                L2460_i_HorizontalScale = L2461_i_VerticalScale = C21_SCALE_;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                L2459_puc_PaletteChange = G0201_auc_Graphic558_PaletteChanges_DoorOrnament_D2;
#endif
                        }
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        AL0107_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(L0104_i_NativeBitmapIndex, C068_DERIVED_BITMAP_FIRST_DOOR_ORNAMENT_D3 + (P0120_i_DoorOrnamentOrdinal * 2) + P0121_i_ViewDoorOrnamentIndex, L2460_i_HorizontalScale, L2461_i_VerticalScale, L2459_puc_PaletteChange);
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        AL0107_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(L0104_i_NativeBitmapIndex, CM1_DERIVED_BITMAP_NONE, MASK0x0000_NO_FLIP, C068_DERIVED_BITMAP_FIRST_DOOR_ORNAMENT_D3 + (P0120_i_DoorOrnamentOrdinal * 2) + P0121_i_ViewDoorOrnamentIndex, L2460_i_HorizontalScale, L2461_i_VerticalScale, L2459_puc_PaletteChange);
#endif
                }
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                F0132_VIDEO_Blit(AL0107_puc_Bitmap, G0074_puc_Bitmap_Temporary, L0106_puc_CoordinateSet, 0, 0, L0106_puc_CoordinateSet[C4_BYTE_WIDTH], AP0121_i_ByteWidth, C09_COLOR_GOLD);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0132_VIDEO_Blit(AL0107_puc_Bitmap, G0074_puc_Bitmap_Temporary, L0106_puc_CoordinateSet, 0, 0, L0106_puc_CoordinateSet[C4_BYTE_WIDTH], AP0121_i_ByteWidth, C09_COLOR_GOLD, L0106_puc_CoordinateSet[C5_HEIGHT], AP0120_i_Height);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0791_DUNGEONVIEW_DrawBitmapXX(AL0107_puc_Bitmap, G0074_puc_Bitmap_Temporary, C2000_ZONE_DOOR_ORNAMENT + G0103_as_CurrentMapDoorOrnamentsInfo[P0120_i_DoorOrnamentOrdinal].CoordinateSet * 3 + P0121_i_ViewDoorOrnamentIndex, 0, C09_COLOR_GOLD);
#endif
        }
}

STATICFUNCTION void F0110_DUNGEONVIEW_DrawDoorButton(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0122_i_DoorButtonOrdinal, P0123_i_ViewDoorButtonIndex)
#endif
REGISTER int16_t P0122_i_DoorButtonOrdinal   SEPARATOR
#ifdef MEDIA070_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J_P31J
REGISTER int16_t P0123_i_ViewDoorButtonIndex FINAL_SEPARATOR
#endif
#ifdef MEDIA551_F20E_F20J_F31E_F31J
register int16_t P0123_i_ViewDoorButtonIndex FINAL_SEPARATOR
#endif
{
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        REGISTER unsigned char* L0111_puc_CoordinateSet;
#endif
#ifdef MEDIA070_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J_P31J
        REGISTER unsigned char* L0112_puc_Multiple;
#endif
#ifdef MEDIA551_F20E_F20J_F31E_F31J
        register unsigned char* L0112_puc_Multiple;
#endif
#define AL0112_puc_Bitmap         L0112_puc_Multiple
#define AL0112_puc_CoordinateSet  L0112_puc_Multiple
#define AL0112_puc_PaletteChanges L0112_puc_Multiple
        REGISTER int16_t L0109_i_NativeBitmapIndex;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        REGISTER int16_t L0110_i_CoordinateSet;
        unsigned char* L0113_puc_Bitmap_Native;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER int16_t L2462_i_DerivedBitmapIndex;
#ifdef MEDIA595_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J_P31J
        REGISTER int16_t L2463_i_Scale;
#endif
#ifdef MEDIA551_F20E_F20J_F31E_F31J
        register int16_t L2463_i_Scale;
#endif
#endif


        if (P0122_i_DoorButtonOrdinal) {
                P0122_i_DoorButtonOrdinal--;
                L0109_i_NativeBitmapIndex = P0122_i_DoorButtonOrdinal + M634_GRAPHIC_FIRST_DOOR_BUTTON;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                L0111_puc_CoordinateSet = G0208_aaauc_Graphic558_DoorButtonCoordinateSets[L0110_i_CoordinateSet = G0197_auc_Graphic558_DoorButtonCoordinateSet[P0122_i_DoorButtonOrdinal]][P0123_i_ViewDoorButtonIndex];
#endif
                if (P0123_i_ViewDoorButtonIndex == C3_VIEW_DOOR_BUTTON_D1C) {
                        AL0112_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(L0109_i_NativeBitmapIndex);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0007_MAIN_CopyBytes(L0111_puc_CoordinateSet, G0291_aauc_DungeonViewClickableBoxes[C05_VIEW_CELL_DOOR_BUTTON_OR_WALL_ORNAMENT], sizeof(G0291_aauc_DungeonViewClickableBoxes[C05_VIEW_CELL_DOOR_BUTTON_OR_WALL_ORNAMENT]));
#endif
                } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        if (!F0491_CACHE_IsDerivedBitmapInCache(P0122_i_DoorButtonOrdinal = C102_DERIVED_BITMAP_FIRST_DOOR_BUTTON + (P0122_i_DoorButtonOrdinal * 2) + ((!P0123_i_ViewDoorButtonIndex) ? 0 : P0123_i_ViewDoorButtonIndex - 1))) {
                                AL0112_puc_CoordinateSet = G0208_aaauc_Graphic558_DoorButtonCoordinateSets[L0110_i_CoordinateSet][C3_VIEW_DOOR_BUTTON_D1C];
                                L0113_puc_Bitmap_Native = F0489_MEMORY_GetNativeBitmapOrGraphic(L0109_i_NativeBitmapIndex);
                                F0129_VIDEO_BlitShrinkWithPaletteChanges(L0113_puc_Bitmap_Native, F0492_CACHE_GetDerivedBitmap(P0122_i_DoorButtonOrdinal), AL0112_puc_CoordinateSet[C4_BYTE_WIDTH] << 1, AL0112_puc_CoordinateSet[C5_HEIGHT], L0111_puc_CoordinateSet[C1_X2] - L0111_puc_CoordinateSet[C0_X1] + 1, L0111_puc_CoordinateSet[C5_HEIGHT], (P0123_i_ViewDoorButtonIndex == C2_VIEW_DOOR_BUTTON_D2C) ? G0199_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D2 : G0198_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D3);
                                F0493_CACHE_AddDerivedBitmap(P0122_i_DoorButtonOrdinal);
                        }
                        AL0112_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(P0122_i_DoorButtonOrdinal);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        L2462_i_DerivedBitmapIndex = C102_DERIVED_BITMAP_FIRST_DOOR_BUTTON + (P0122_i_DoorButtonOrdinal * 2);
                        if (P0123_i_ViewDoorButtonIndex == C2_VIEW_DOOR_BUTTON_D2C) {
                                AL0112_puc_PaletteChanges = G0199_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D2;
                                L2463_i_Scale = C21_SCALE_;
                                L2462_i_DerivedBitmapIndex++;
                        } else {
                                AL0112_puc_PaletteChanges = G0198_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D3;
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                L2463_i_Scale = C16_SCALE_;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                L2463_i_Scale = C14_SCALE_;
#endif
                        }
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        AL0112_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(L0109_i_NativeBitmapIndex, L2462_i_DerivedBitmapIndex, L2463_i_Scale, L2463_i_Scale, AL0112_puc_PaletteChanges);
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        AL0112_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(L0109_i_NativeBitmapIndex, CM1_DERIVED_BITMAP_NONE, MASK0x0000_NO_FLIP, L2462_i_DerivedBitmapIndex, L2463_i_Scale, L2463_i_Scale, AL0112_puc_PaletteChanges);
#endif
                }
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                F0132_VIDEO_Blit(AL0112_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0111_puc_CoordinateSet, 0, 0, L0111_puc_CoordinateSet[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0132_VIDEO_Blit(AL0112_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0111_puc_CoordinateSet, 0, 0, L0111_puc_CoordinateSet[C4_BYTE_WIDTH], C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH, L0111_puc_CoordinateSet[C5_HEIGHT], C136_HEIGHT_VIEWPORT);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0791_DUNGEONVIEW_DrawBitmapXX(AL0112_puc_Bitmap, G0296_puc_Bitmap_Viewport, C1950_ZONE_DOOR_BUTTON + G0197_auc_Graphic558_DoorButtonCoordinateSet[P0122_i_DoorButtonOrdinal] + P0123_i_ViewDoorButtonIndex, 0, C10_COLOR_FLESH);
                if (P0123_i_ViewDoorButtonIndex == C3_VIEW_DOOR_BUTTON_D1C) {
                        F0007_MAIN_CopyBytes((char*)G2032_ai_XYZ, (char*)G2210_aai_XYZ_DungeonViewClickable[C05_VIEW_CELL_DOOR_BUTTON_OR_WALL_ORNAMENT], (long)sizeof(G2210_aai_XYZ_DungeonViewClickable[C05_VIEW_CELL_DOOR_BUTTON_OR_WALL_ORNAMENT]));
                }
#endif
        }
}

STATICFUNCTION void F0111_DUNGEONVIEW_DrawDoor(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0124_ui_DoorThingIndex, P0125_ui_DoorState, P0126_pi_DoorNativeBitmapIndices, P0127_i_ByteCount, P0128_i_ViewDoorOrnamentIndex, P0129_ps_DoorFrames)
#endif
unsigned int16_t          P0124_ui_DoorThingIndex          SEPARATOR
REGISTER unsigned int16_t P0125_ui_DoorState               SEPARATOR
int16_t*                  P0126_pi_DoorNativeBitmapIndices SEPARATOR
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
int16_t                   P0127_i_ByteCount                SEPARATOR
#endif
int16_t                   P0128_i_ViewDoorOrnamentIndex    SEPARATOR
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
register DOOR_FRAMES*     P0129_ps_DoorFrames              FINAL_SEPARATOR
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
REGISTER int16_t          P2084_i_ZoneIndex                FINAL_SEPARATOR
#endif
{
        REGISTER DOOR* L0116_ps_Door;
        REGISTER unsigned int16_t L0114_ui_Multiple;
#define AL0114_ui_DoorType L0114_ui_Multiple
#define AL0114_ui_Flip     L0114_ui_Multiple
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        int16_t L2464_i_X;
        int16_t L2465_i_Y;
        int16_t L2469_ai_XYZ[4];
#endif


#ifdef MEDIA034_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (P0125_ui_DoorState != C0_DOOR_STATE_OPEN) {
#endif
#ifdef MEDIA744_A36M
        if (P0125_ui_DoorState == C0_DOOR_STATE_OPEN) {
                return;
        }
#endif
                L0116_ps_Door = (DOOR*)(G0284_apuc_ThingData[C00_THING_TYPE_DOOR]) + P0124_ui_DoorThingIndex;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0007_MAIN_CopyBytes(F0489_MEMORY_GetNativeBitmapOrGraphic(P0126_pi_DoorNativeBitmapIndices[AL0114_ui_DoorType = L0116_ps_Door->Type]), G0074_puc_Bitmap_Temporary, P0127_i_ByteCount);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0616_CopyBitmap(F0489_MEMORY_GetNativeBitmapOrGraphic(P0126_pi_DoorNativeBitmapIndices[AL0114_ui_DoorType = L0116_ps_Door->Type]), G0074_puc_Bitmap_Temporary);
#endif
                F0109_DUNGEONVIEW_DrawDoorOrnament(L0116_ps_Door->OrnamentOrdinal, P0128_i_ViewDoorOrnamentIndex);
                if (M007_GET(G0275_as_CurrentMapDoorInfo[AL0114_ui_DoorType].Attributes, MASK0x0004_ANIMATED)) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        if (M005_RANDOM(2)) {
                                F0130_VIDEO_FlipHorizontal(G0074_puc_Bitmap_Temporary, P0129_ps_DoorFrames->ClosedOrDestroyed[C4_BYTE_WIDTH], P0129_ps_DoorFrames->ClosedOrDestroyed[C5_HEIGHT]);
                        }
                        if (M005_RANDOM(2)) {
                                F0131_VIDEO_FlipVertical(G0074_puc_Bitmap_Temporary, P0129_ps_DoorFrames->ClosedOrDestroyed[C4_BYTE_WIDTH], P0129_ps_DoorFrames->ClosedOrDestroyed[C5_HEIGHT]);
                        }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        AL0114_ui_Flip = M004_RANDOM(4);
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        if (M007_GET(AL0114_ui_Flip, MASK0x0001_FLIP_HORIZONTAL)) {
                                F1006_(G0074_puc_Bitmap_Temporary);
                        }
                        if (M007_GET(AL0114_ui_Flip, MASK0x0002_FLIP_VERTICAL)) {
                                F1030_(G0074_puc_Bitmap_Temporary);
                        }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                } else {
                        AL0114_ui_Flip = MASK0x0000_NO_FLIP;
#endif
                }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                if ((P0129_ps_DoorFrames == &G0186_s_Graphic558_Frames_Door_D1C) && G0407_s_Party.Event73Count_ThievesEye) {
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                if ((P2084_i_ZoneIndex == M631_ZONE_DOOR_D1C) && G0407_s_Party.Event73Count_ThievesEye) {
#endif
                        F0109_DUNGEONVIEW_DrawDoorOrnament(M000_INDEX_TO_ORDINAL(C16_DOOR_ORNAMENT_THIEVES_EYE_MASK), C2_VIEW_DOOR_ORNAMENT_D1LCR); /* BUG0_83: The hole created by the Window action or the Thieve's Eye spell moves with opening doors. The hole mask is applied before the door is drawn on screen so that if you open the door, the 'hole' moves with the opening door instead of remaining in the center of the view */
                }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                if (P0125_ui_DoorState == C4_DOOR_STATE_CLOSED) {
                        F0102_DUNGEONVIEW_DrawDoorBitmap(P0129_ps_DoorFrames->ClosedOrDestroyed);
                } else {
#endif
                        if (P0125_ui_DoorState == C5_DOOR_STATE_DESTROYED) {
                                F0109_DUNGEONVIEW_DrawDoorOrnament(M000_INDEX_TO_ORDINAL(C15_DOOR_ORNAMENT_DESTROYED_MASK), P0128_i_ViewDoorOrnamentIndex);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0102_DUNGEONVIEW_DrawDoorBitmap(P0129_ps_DoorFrames->ClosedOrDestroyed);
#endif
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                P0125_ui_DoorState--;
                                if (L0116_ps_Door->Vertical) {
                                        F0102_DUNGEONVIEW_DrawDoorBitmap(P0129_ps_DoorFrames->Vertical[P0125_ui_DoorState]);
                                } else {
                                        F0102_DUNGEONVIEW_DrawDoorBitmap(P0129_ps_DoorFrames->LeftHorizontal[P0125_ui_DoorState]);
                                        F0102_DUNGEONVIEW_DrawDoorBitmap(P0129_ps_DoorFrames->RightHorizontal[P0125_ui_DoorState]);
                                }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                if (P0125_ui_DoorState != C4_DOOR_STATE_CLOSED) {
                                        P2084_i_ZoneIndex += P0125_ui_DoorState;
                                        if (!L0116_ps_Door->Vertical) {
                                                G2154_i_ZoneShiftX = L2464_i_X = M100_PIXEL_WIDTH(G0074_puc_Bitmap_Temporary) >> 1;
                                                G2155_i_ZoneShiftY = L2465_i_Y = 0;
                                                if (F0635_(G0074_puc_Bitmap_Temporary, L2469_ai_XYZ, P2084_i_ZoneIndex + C6_UNKNOWN, &L2464_i_X, &L2465_i_Y)) {
                                                        F0654_Call_F0132_VIDEO_Blit(M772_CAST_PC(G0074_puc_Bitmap_Temporary), M772_CAST_PC(G0296_puc_Bitmap_Viewport), L2469_ai_XYZ, L2464_i_X + G2154_i_ZoneShiftX, L2465_i_Y, C10_COLOR_FLESH);
                                                }
                                                P2084_i_ZoneIndex += (unsigned int16_t)(3 | MASK0x4000_SHIFT_UNREADABLE_INSCRIPTION_AND_OPEN_VERTICAL_DOOR);
                                        }
                                }
#endif
                        }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0791_DUNGEONVIEW_DrawBitmapXX(G0074_puc_Bitmap_Temporary, G0296_puc_Bitmap_Viewport, P2084_i_ZoneIndex, AL0114_ui_Flip, C10_COLOR_FLESH);
#endif
#ifdef MEDIA034_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        }
#endif
}

STATICFUNCTION void F0112_DUNGEONVIEW_DrawCeilingPit(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0130_i_NativeBitmapIndex, P0131_puc_Frame, P0132_i_MapX, P0133_i_MapY, P0134_B_FlipHorizontal)
#endif
int16_t          P0130_i_NativeBitmapIndex SEPARATOR
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
unsigned char*   P0131_puc_Frame           SEPARATOR
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
unsigned int16_t P2085_ui_ZoneIndex        SEPARATOR
#endif
int16_t          P0132_i_MapX              SEPARATOR
int16_t          P0133_i_MapY              SEPARATOR
BOOLEAN          P0134_B_FlipHorizontal    FINAL_SEPARATOR
{
        REGISTER int16_t L0117_i_Multiple;
#define AL0117_i_MapIndex L0117_i_Multiple
#define AL0117_i_Square   L0117_i_Multiple


        if (((AL0117_i_MapIndex = F0154_DUNGEON_GetLocationAfterLevelChange(G0272_i_CurrentMapIndex, -1, &P0132_i_MapX, &P0133_i_MapY)) >= 0) &&
            (M034_SQUARE_TYPE(AL0117_i_Square = G0279_pppuc_DungeonMapData[AL0117_i_MapIndex][P0132_i_MapX][P0133_i_MapY]) == C02_ELEMENT_PIT) &&
            M007_GET(AL0117_i_Square, MASK0x0008_PIT_OPEN)) {
                if (P0134_B_FlipHorizontal) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(P0130_i_NativeBitmapIndex, P0131_puc_Frame);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(P0130_i_NativeBitmapIndex, P2085_ui_ZoneIndex);
#endif
                } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(P0130_i_NativeBitmapIndex, P0131_puc_Frame);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(P0130_i_NativeBitmapIndex, P2085_ui_ZoneIndex);
#endif
                }
        }
}

void F0113_DUNGEONVIEW_DrawField(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0135_puc_FieldAspect, P0136_puc_Box)
#endif
REGISTER unsigned char* P0135_puc_FieldAspect SEPARATOR
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
unsigned char*          P0136_puc_Box         FINAL_SEPARATOR
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t                 P2086_i_ZoneIndex     FINAL_SEPARATOR
#endif
{
        REGISTER unsigned char* L0118_puc_Bitmap_Mask;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        unsigned char* L0119_puc_Bitmap;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER unsigned char* L0119_puc_Bitmap;
        int16_t L2470_i_Width;
        int16_t L2471_i_Height;
        int16_t L2472_ai_XYZ[4];
        REGISTER int16_t L2473_i_X;


        L2470_i_Width = M732_BYTE_WIDTH(P0135_puc_FieldAspect);
        L2471_i_Height = M733_HEIGHT(P0135_puc_FieldAspect);
        if (!F0635_(NULL, L2472_ai_XYZ, P2086_i_ZoneIndex, &L2470_i_Width, &L2471_i_Height)) {
                return;
        }
        L2473_i_X = 0;
#endif
        if (M731_MASK(P0135_puc_FieldAspect) == C255_NO_MASK) {
                L0118_puc_Bitmap_Mask = NULL;
        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0007_MAIN_CopyBytes(F0489_MEMORY_GetNativeBitmapOrGraphic(M652_GRAPHIC_FIRST_FIELD_MASK + M007_GET(M731_MASK(P0135_puc_FieldAspect), MASK0x007F_MASK_INDEX)), L0118_puc_Bitmap_Mask = G0074_puc_Bitmap_Temporary, M732_BYTE_WIDTH(P0135_puc_FieldAspect) * M733_HEIGHT(P0135_puc_FieldAspect));
                if (M007_GET(M731_MASK(P0135_puc_FieldAspect), MASK0x0080_FLIP_MASK)) {
                        F0130_VIDEO_FlipHorizontal(L0118_puc_Bitmap_Mask, M732_BYTE_WIDTH(P0135_puc_FieldAspect), M733_HEIGHT(P0135_puc_FieldAspect));
                }
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                F0655_CopyBitmapAndFlip(F0489_MEMORY_GetNativeBitmapOrGraphic(M652_GRAPHIC_FIRST_FIELD_MASK + M007_GET(M731_MASK(P0135_puc_FieldAspect), MASK0x007F_MASK_INDEX)), L0118_puc_Bitmap_Mask = G0074_puc_Bitmap_Temporary, (M007_GET(M731_MASK(P0135_puc_FieldAspect), MASK0x0080_FLIP_MASK)) ? MASK0x0001_FLIP_HORIZONTAL : MASK0x0000_NO_FLIP);
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                F0616_CopyBitmap(F0489_MEMORY_GetNativeBitmapOrGraphic(M652_GRAPHIC_FIRST_FIELD_MASK + M007_GET(M731_MASK(P0135_puc_FieldAspect), MASK0x007F_MASK_INDEX)), L0118_puc_Bitmap_Mask = G0074_puc_Bitmap_Temporary);
                if (M007_GET(M731_MASK(P0135_puc_FieldAspect), MASK0x0080_FLIP_MASK)) {
                        F1006_(L0118_puc_Bitmap_Mask);
#ifdef MEDIA577_X30J
                        if (M100_PIXEL_WIDTH(L0118_puc_Bitmap_Mask) & 1) {
                                L2473_i_X = 2 - (M100_PIXEL_WIDTH(L0118_puc_Bitmap_Mask) & 1);
#endif
#ifdef MEDIA488_F20E_F20J
                        if (M100_PIXEL_WIDTH(L0118_puc_Bitmap_Mask) & 31) {
                                L2473_i_X = 32 - (M100_PIXEL_WIDTH(L0118_puc_Bitmap_Mask) & 31);
#endif
#ifdef MEDIA692_X31J
                        if (L2473_i_X = M100_PIXEL_WIDTH(L0118_puc_Bitmap_Mask) & 1) {
                                L2473_i_X = 2 - L2473_i_X;
#endif
#ifdef MEDIA670_F31E_F31J
                        if (L2473_i_X = M100_PIXEL_WIDTH(L0118_puc_Bitmap_Mask) & 31) {
                                L2473_i_X = 32 - L2473_i_X;
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                        if (L2473_i_X = M100_PIXEL_WIDTH(L0118_puc_Bitmap_Mask) & 15) {
                                L2473_i_X = 16 - L2473_i_X;
#endif
                        }
                }
#endif
        }
        F0491_CACHE_IsDerivedBitmapInCache(C000_DERIVED_BITMAP_VIEWPORT);
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        L0119_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(C073_GRAPHIC_FIELD_TELEPORTER + M728_NATIVE_BITMAP_RELATIVE_INDEX(P0135_puc_FieldAspect));
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        L0119_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(C076_GRAPHIC_FIRST_FIELD + M728_NATIVE_BITMAP_RELATIVE_INDEX(P0135_puc_FieldAspect));
#endif
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
        F0133_VIDEO_BlitBoxFilledWithMaskedBitmap(L0119_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0118_puc_Bitmap_Mask, F0492_CACHE_GetDerivedBitmap(C000_DERIVED_BITMAP_VIEWPORT), P0136_puc_Box, M005_RANDOM(2) + M729_BASE_START_UNIT_INDEX(P0135_puc_FieldAspect), M003_RANDOM(32), C112_BYTE_WIDTH_VIEWPORT, M730_TRANSPARENT_COLOR(P0135_puc_FieldAspect), M734_X(P0135_puc_FieldAspect), 0);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        F0133_VIDEO_BlitBoxFilledWithMaskedBitmap(L0119_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0118_puc_Bitmap_Mask, F0492_CACHE_GetDerivedBitmap(C000_DERIVED_BITMAP_VIEWPORT), P0136_puc_Box, M005_RANDOM(2) + M729_BASE_START_UNIT_INDEX(P0135_puc_FieldAspect), M003_RANDOM(32), C112_BYTE_WIDTH_VIEWPORT, M730_TRANSPARENT_COLOR(P0135_puc_FieldAspect), M734_X(P0135_puc_FieldAspect), 0, 136, M735_BITPLANE_WORD_COUNT(P0135_puc_FieldAspect));
#endif
#ifdef MEDIA525_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_F31E_F31J_X31J_P31J
        F0133_VIDEO_BlitBoxFilledWithMaskedBitmap(L0119_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0118_puc_Bitmap_Mask, F0492_CACHE_GetDerivedBitmap(C000_DERIVED_BITMAP_VIEWPORT), L2472_ai_XYZ, M005_RANDOM(2) + M729_BASE_START_UNIT_INDEX(P0135_puc_FieldAspect), M003_RANDOM(32), G2073_C224_ViewportPixelWidth, M730_TRANSPARENT_COLOR(P0135_puc_FieldAspect), L2473_i_X, 0);
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
        F0133_VIDEO_BlitBoxFilledWithMaskedBitmap(L0119_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0118_puc_Bitmap_Mask, F0492_CACHE_GetDerivedBitmap(C000_DERIVED_BITMAP_VIEWPORT), L2472_ai_XYZ, M005_RANDOM(2) + M729_BASE_START_UNIT_INDEX(P0135_puc_FieldAspect), M003_RANDOM(32), G2073_C224_ViewportPixelWidth, M730_TRANSPARENT_COLOR(P0135_puc_FieldAspect), L2473_i_X, 0, G2074_C136_ViewportHeight, M735_BITPLANE_WORD_COUNT(P0135_puc_FieldAspect));
#endif
        F0493_CACHE_AddDerivedBitmap(C000_DERIVED_BITMAP_VIEWPORT);
        F0480_CACHE_ReleaseBlock(C000_DERIVED_BITMAP_VIEWPORT | MASK0x8000_DERIVED_BITMAP);
}

STATICFUNCTION unsigned char* F0114_DUNGEONVIEW_GetExplosionBitmap(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0137_ui_ExplosionAspectIndex, P0138_ui_Scale, P0139_pi_ByteWidth, P0140_pi_Height)
#endif
REGISTER unsigned int16_t P0137_ui_ExplosionAspectIndex SEPARATOR
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
unsigned int16_t          P0138_ui_Scale                SEPARATOR
int16_t*                  P0139_pi_ByteWidth            SEPARATOR
int16_t*                  P0140_pi_Height               FINAL_SEPARATOR
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
REGISTER unsigned int16_t P0138_Scale                   SEPARATOR
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
REGISTER int16_t          P0138_Scale                   SEPARATOR
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t                   P2783_i_Flip                  FINAL_SEPARATOR
#endif
{
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        REGISTER unsigned char* L0123_puc_Bitmap;
        REGISTER EXPLOSION_ASPECT* L0124_ps_ExplosionAspect;
        REGISTER int16_t L0120_i_ByteWidth;
        REGISTER int16_t L0121_i_Height;
        REGISTER int16_t L0122_i_DerivedBitmapIndex;
        unsigned char* L0125_puc_Bitmap_Native;


        L0124_ps_ExplosionAspect = &G0211_as_Graphic558_ExplosionAspects[P0137_ui_ExplosionAspectIndex];
        if (P0138_ui_Scale > C32_SCALE_D1) {
                P0138_ui_Scale = C32_SCALE_D1;
        }
        L0120_i_ByteWidth = M078_SCALED_DIMENSION(L0124_ps_ExplosionAspect->ByteWidth, P0138_ui_Scale);
        L0121_i_Height = M078_SCALED_DIMENSION(L0124_ps_ExplosionAspect->Height, P0138_ui_Scale);
        if ((P0138_ui_Scale == 32) && (P0137_ui_ExplosionAspectIndex != C3_EXPLOSION_ASPECT_SMOKE)) {
                L0123_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(P0137_ui_ExplosionAspectIndex + M614_GRAPHIC_FIRST_EXPLOSION);
        } else {
                if (F0491_CACHE_IsDerivedBitmapInCache(L0122_i_DerivedBitmapIndex = (P0137_ui_ExplosionAspectIndex * 14) + (P0138_ui_Scale >> 1) + (M538_DERIVED_BITMAP_FIRST_EXPLOSION - 2))) { /* Minimum scale is 4 */
                        L0123_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(L0122_i_DerivedBitmapIndex);
                } else {
                        L0125_puc_Bitmap_Native = F0489_MEMORY_GetNativeBitmapOrGraphic(F0024_MAIN_GetMinimumValue(P0137_ui_ExplosionAspectIndex, C2_EXPLOSION_ASPECT_POISON) + M614_GRAPHIC_FIRST_EXPLOSION);
                        F0129_VIDEO_BlitShrinkWithPaletteChanges(L0125_puc_Bitmap_Native, L0123_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(L0122_i_DerivedBitmapIndex), L0124_ps_ExplosionAspect->ByteWidth << 1, L0124_ps_ExplosionAspect->Height, L0120_i_ByteWidth << 1, L0121_i_Height, (P0137_ui_ExplosionAspectIndex == C3_EXPLOSION_ASPECT_SMOKE) ? G0212_auc_Graphic558_PaletteChanges_Smoke : G0017_auc_Graphic562_PaletteChanges_NoChanges);
                        F0493_CACHE_AddDerivedBitmap(L0122_i_DerivedBitmapIndex);
                }
        }
        *P0139_pi_ByteWidth = L0120_i_ByteWidth;
        *P0140_pi_Height = L0121_i_Height;
        return L0123_puc_Bitmap;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
        if (P0138_Scale > C32_SCALE_D1) {
                P0138_Scale = C32_SCALE_D1;
        }
#endif
#ifdef MEDIA709_I34E_I34M_P31J
        P0138_Scale = F0026_MAIN_GetBoundedValue(4, P0138_Scale & 0xFFFE, 32);
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
        P0138_Scale = F0026_MAIN_GetBoundedValue(4, P0138_Scale & -2, 32);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
        return F0675_DUNGEONVIEW_GetScaledBitmap(M614_GRAPHIC_FIRST_EXPLOSION + F0024_MAIN_GetMinimumValue(P0137_ui_ExplosionAspectIndex, C2_EXPLOSION_ASPECT_POISON), M538_DERIVED_BITMAP_FIRST_EXPLOSION - 2 + (P0137_ui_ExplosionAspectIndex * 14) + (P0138_Scale >> 1), P0138_Scale, P0138_Scale, (P0137_ui_ExplosionAspectIndex == C3_EXPLOSION_ASPECT_SMOKE) ? G0212_auc_Graphic558_PaletteChanges_Smoke : NULL);
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
        return F0675_DUNGEONVIEW_GetScaledBitmap(M614_GRAPHIC_FIRST_EXPLOSION + F0024_MAIN_GetMinimumValue(P0137_ui_ExplosionAspectIndex, C2_EXPLOSION_ASPECT_POISON), CM1_DERIVED_BITMAP_NONE, P2783_i_Flip, (P0137_ui_ExplosionAspectIndex * 14) + (P0138_Scale >> 1) + (M538_DERIVED_BITMAP_FIRST_EXPLOSION - 2), P0138_Scale, P0138_Scale, (P0137_ui_ExplosionAspectIndex == C3_EXPLOSION_ASPECT_SMOKE) ? G0212_auc_Graphic558_PaletteChanges_Smoke : NULL);
#endif
#endif
}

STATICFUNCTION void F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0141_T_Thing, P0142_i_Direction, P0143_i_MapX, P0144_i_MapY, P0145_i_ViewSquareIndex, P0146_ui_OrderedViewCellOrdinals)
#endif
REGISTER THING   P0141_T_Thing                    SEPARATOR
int16_t          P0142_i_Direction                SEPARATOR
int16_t          P0143_i_MapX                     SEPARATOR
int16_t          P0144_i_MapY                     SEPARATOR
REGISTER int16_t P0145_i_ViewSquareIndex          SEPARATOR
unsigned int16_t P0146_ui_OrderedViewCellOrdinals FINAL_SEPARATOR
#define AP0141_ui_CreatureIndex       P0141_T_Thing
#define AP0141_ui_CreatureGraphicInfo P0141_T_Thing
#define AP0141_ui_CreatureX           P0141_T_Thing
#define AP0145_i_ViewSquareExplosionIndex P0145_i_ViewSquareIndex
/* Contains 4 nibbles processed from the least significant to the most significant nibble
If the first nibble is 0, then the function call is to draw objects in an alcove on a wall square.
If bit 3 of the first nibble is set, then the function call is to draw a door square viewed from the front. In this case, there are two calls to this function to draw objects behind the door frame (pass 1) and then in front of the door frame (pass 2). The value of bits 2-0 indicate which pass to perform (1 or 2)
The remaining nibbles contain ordinals of square view cells to draw (values 1, 2, 3 or 4). Objects are drawn on the specified view cells and in the order specified. Ordinals are processed until the next nibble value is 0.
Here is the general structure of this huge function:

do {
  do {
    if there is a projectile, explosion or creature, take note of it, but do not draw them yet
    draw each object found
  } while there are things on square at processed cell

  Draw one creature at the cell being processed (or maybe 2 if half square sized)

  do { (Start over from the first thing on the square)
        Draw only projectiles at specified cell. For projectiles drawn as objects, a goto is made to the corresponding routine and then back from there.
  } while there are things on square at processed cell
} while there are cells left to process
do { (Start over from the first thing on the square)
        Draw only explosions at specified cell, except for Fluxcages (take note if a Fluxcage is present)
} while there are things on square at processed cell
If a Fluxcage is present, draw the fluxcage */
{
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        REGISTER int16_t L0126_i_Multiple;
#endif
#define AL0126_i_ViewCell      L0126_i_Multiple
#define AL0126_i_Cell          L0126_i_Multiple
#define AL0126_i_ExplosionSize L0126_i_Multiple
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
REGISTER unsigned char* L0128_puc_Multiple;
REGISTER OBJECT_ASPECT* L0129_ps_ObjectAspect;
#endif
#define AL0128_puc_Bitmap L0128_puc_Multiple
#define AL0128_puc_Box    L0128_puc_Multiple
#define AL0128_pi_XYZ     L0128_puc_Multiple
REGISTER int16_t L0127_i_Multiple;
#define AL0127_i_ThingType            L0127_i_Multiple
#define AL0127_i_NativeBitmapIndex    L0127_i_Multiple
#define AL0127_i_X                    L0127_i_Multiple
#define AL0127_i_GroupCells           L0127_i_Multiple
#define AL0127_i_NormalizedByteWidth  L0127_i_Multiple
#define AL0127_i_Y                    L0127_i_Multiple
#define AL0127_i_ProjectileAspect     L0127_i_Multiple
#define AL0127_i_ExplosionType        L0127_i_Multiple
#define AL0127_i_ExplosionAspectIndex L0127_i_Multiple
#define AL0127_i_ObjectAspectIndex    L0127_i_Multiple
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
REGISTER int16_t L0126_i_Multiple;
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        REGISTER unsigned char* L0128_puc_Multiple;
        REGISTER OBJECT_ASPECT* L0129_ps_ObjectAspect;
        unsigned long L0130_ul_RemainingViewCellOrdinalsToProcess;
        unsigned char* L0131_puc_PaletteChanges;
        unsigned char* L0132_puc_Bitmap;
        unsigned char* L0133_puc_CoordinateSet;
        int16_t L0134_i_DerivedBitmapIndex;
        BOOLEAN L0135_B_DrawAlcoveObjects;
        int16_t L0136_i_ByteWidth;
        int16_t L0137_i_Height;
        int16_t L0138_i_ViewLane; /* The lane (center/left/right) that the specified square is part of */
        int16_t L0139_i_Cell;
        int16_t L0140_i_PaddingPixelCount;
        int16_t L0141_i_Height;
        BOOLEAN L0142_B_UseAlcoveObjectImage; /* C1_TRUE for objects that have a special graphic when drawn in an alcove, like the Chest */
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER int16_t L0134_i_DerivedBitmapIndex;
#endif
BOOLEAN L0143_B_FlipHorizontal;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        BOOLEAN L0144_B_DrawingGrabbableObject;
        unsigned char L0145_auc_Box[4];
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER unsigned char* L0131_puc_PaletteChanges;
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
        unsigned long L0130_ul_RemainingViewCellOrdinalsToProcess;
#endif
        THING L0146_T_FirstThingToDraw; /* Initialized to P0141_T_Thing and never changed afterwards. Used as a backup of the specified first object to draw */
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
        int16_t L2474_i_ZoneIndex;
        int16_t L0176_i_Scale;
        BOOLEAN L0135_B_DrawAlcoveObjects;
        int16_t L0138_i_ViewLane; /* The lane (center/left/right) that the specified square is part of */
        int16_t L0139_i_Cell;
        int16_t L0141_i_Height;
#endif
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        unsigned int16_t L0147_ui_Multiple;
#define AL0147_ui_ViewSquareIndexBackup L0147_ui_Multiple
#define AL0147_ui_ExplosionScaleIndex   L0147_ui_Multiple
        int16_t L0148_i_CellCounter;
        unsigned int16_t L0149_ui_ObjectShiftIndex;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        int16_t L0138_i_ViewLane; /* The lane (center/left/right) that the specified square is part of */
        int16_t L2475_i_ViewDepth;
        int16_t L0175_i_DoorFrontViewDrawingPass; /* Value 0, 1 or 2 */
#endif
        unsigned int16_t L0150_ui_Multiple;
#define AL0150_ui_ShiftSetIndex        L0150_ui_Multiple
#define AL0150_ui_ProjectileScaleIndex L0150_ui_Multiple
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        THING L0151_T_GroupThing;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        unsigned long L0130_ul_RemainingViewCellOrdinalsToProcess;
        int16_t L2474_i_ZoneIndex;
        int16_t L0176_i_Scale;
        BOOLEAN L0135_B_DrawAlcoveObjects;
        int16_t L0139_i_Cell;
        int16_t L0141_i_Height;
        int16_t L2476_i_;
        int16_t L0148_i_CellCounter;
        unsigned int16_t L0149_ui_ObjectShiftIndex;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        BOOLEAN L0142_B_UseAlcoveObjectImage; /* C1_TRUE for objects that have a special graphic when drawn in an alcove, like the Chest */
        BOOLEAN L0144_B_DrawingGrabbableObject;
#endif
        GROUP* L0152_ps_Group;
        ACTIVE_GROUP* L0153_ps_ActiveGroup;
        CREATURE_INFO* L0154_ps_CreatureInfo;
        CREATURE_ASPECT* L0155_ps_CreatureAspect;
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        THING L0151_T_GroupThing;
#endif
        int16_t L0156_i_CreatureSize;
        int16_t L0157_i_CreatureDirectionDelta;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        int16_t L0158_i_CreatureGraphicInfo;
#endif
        int16_t L0159_i_CreatureAspect;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        int16_t L0160_i_Unreferenced1; /* BUG0_00 Useless code */
#endif
        int16_t L0161_i_CreatureIndex;
        int16_t L0162_i_TransparentColor;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        int16_t L0163_i_SourceByteWidth;
        int16_t L0164_i_SourceHeight;
        int16_t L0165_i_CreaturePaddingPixelCount;
        int16_t L0166_i_Unreferenced2; /* BUG0_00 Useless code */
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
        int16_t L0175_i_DoorFrontViewDrawingPass; /* Value 0, 1 or 2 */
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        int16_t L2477_i_;
#endif
        BOOLEAN L0167_B_TwoHalfSquareCreaturesFrontView;
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        BOOLEAN L0174_B_DrawCreaturesCompleted; /* Set to C1_TRUE when the last creature that the function should draw is being drawn. This is used to avoid processing the code to draw creatures for the remaining square cells */
#endif
        BOOLEAN L0168_B_DrawingLastBackRowCell;
        BOOLEAN L0169_B_UseCreatureSideBitmap;
        BOOLEAN L0170_B_UseCreatureBackBitmap;
        BOOLEAN L0171_B_UseCreatureSpecialD2FrontBitmap;
        BOOLEAN L0172_B_UseCreatureAttackBitmap;
        BOOLEAN L0173_B_UseFlippedHorizontallyCreatureFrontImage;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        BOOLEAN L0174_B_DrawCreaturesCompleted; /* Set to C1_TRUE when the last creature that the function should draw is being drawn. This is used to avoid processing the code to draw creatures for the remaining square cells */
        int16_t L0175_i_DoorFrontViewDrawingPass; /* Value 0, 1 or 2 */
        int16_t L0176_i_Scale;
        BOOLEAN L0177_B_DerivedBitmapInCache;
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
        int16_t L2478_i_DerivedBitmapIndex;
#endif
        PROJECTILE* L0178_ps_Projectile;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        unsigned char L0179_auc_ProjectileCoordinates[2];
        int16_t L0180_i_ProjectileX;
#endif
        int16_t L0181_i_ProjectileDirection;
        int16_t L0182_i_ProjectileAspectType;
        int16_t L0183_i_ProjectileBitmapIndexDelta;
        BOOLEAN L0184_B_DoNotScaleWithKineticEnergy;
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        unsigned int16_t L0187_ui_CurrentViewCellToDraw;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        int16_t L2479_i_;
#endif
        BOOLEAN L0185_B_DrawProjectileAsObject; /* When true, the code section to draw an object is called (with a goto) to draw the projectile, then the code section goes back to projectile processing with another goto */
        BOOLEAN L0186_B_SquareHasProjectile;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        unsigned int16_t L0187_ui_CurrentViewCellToDraw;
#endif
        BOOLEAN L0188_B_ProjectileFlipVertical;
        BOOLEAN L0189_B_ProjectileAspectTypeHasBackGraphicAndRotation;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        BOOLEAN L0190_B_FlipVertical;
#endif
        EXPLOSION* L0191_ps_Explosion;
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        EXPLOSION* L0192_ps_FluxcageExplosion;
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        int16_t* L0193_pi_ExplosionCoordinates;
#endif
        int16_t L0194_i_ExplosionScale;
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        int16_t L2480_i_;
#endif
        BOOLEAN L0195_B_SquareHasExplosion;
        BOOLEAN L0196_B_RebirthExplosion;
        BOOLEAN L0197_B_Smoke;
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        int16_t L2481_ai_XYZ[4];
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        EXPLOSION* L0192_ps_FluxcageExplosion;
        int16_t L2482_i_FieldAspectIndex;
#endif
        unsigned char L0198_auc_FieldAspect[8];
#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
        BOOLEAN L0199_B_ProceedToNextState_CPSF;
#endif
#endif


        if (P0141_T_Thing == C0xFFFE_THING_ENDOFLIST)
                return;
        L0152_ps_Group = NULL;
        L0151_T_GroupThing = C0xFFFF_THING_NONE;
        L0174_B_DrawCreaturesCompleted = L0186_B_SquareHasProjectile = L0195_B_SquareHasExplosion = C0_FALSE;
        L0148_i_CellCounter = 0;
        L0146_T_FirstThingToDraw = P0141_T_Thing;
        if (M007_GET(P0146_ui_OrderedViewCellOrdinals, MASK0x0008_DOOR_FRONT)) { /* If the function call is to draw objects on a door square viewed from the front */
                L0175_i_DoorFrontViewDrawingPass = (P0146_ui_OrderedViewCellOrdinals & 0x0001) + 1; /* Two function calls are made in that case to draw objects on both sides of the door frame. The door and its frame are drawn between the two calls. This value indicates the drawing pass so that creatures are drawn in the right order and so that Fluxcages are not drawn twice */
                P0146_ui_OrderedViewCellOrdinals >>= 4; /* Remove the first nibble that was used for the door front view pass */
        } else {
                L0175_i_DoorFrontViewDrawingPass = 0; /* The function call is not to draw objects on a door square viewed from the front */
        }
        L0135_B_DrawAlcoveObjects = !(L0130_ul_RemainingViewCellOrdinalsToProcess = P0146_ui_OrderedViewCellOrdinals);
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        AL0147_ui_ViewSquareIndexBackup = P0145_i_ViewSquareIndex;
        L0138_i_ViewLane = (P0145_i_ViewSquareIndex + 3) % 3;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        L0138_i_ViewLane = G2026_ac_ViewSquareIndexToViewLane[P0145_i_ViewSquareIndex]; /* Values range from -3 to 3 from left to right */
        L2475_i_ViewDepth = G2027_ac_ViewSquareIndexToViewDepth[P0145_i_ViewSquareIndex]; /* Values range from 0 to 4 from closest to farthest */
        if (L0135_B_DrawAlcoveObjects) {
                L2476_i_ = G2029_ac_ViewSquareIndexTo[P0145_i_ViewSquareIndex];
        } else {
                L2476_i_ = G2028_ac_ViewSquareIndexTo[P0145_i_ViewSquareIndex];
        }
#endif
#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
        L0199_B_ProceedToNextState_CPSF = ((G0069_ui_State_CPSF & 0x00FE) == 10) && G0070_B_FuzzySectorAnalyzed_CPSF;
#endif
#endif
        do {
/* Draw objects */
                if (L0135_B_DrawAlcoveObjects) {
                        AL0126_i_ViewCell = C04_VIEW_CELL_ALCOVE; /* Index of coordinates to draw objects in alcoves */
                        L0139_i_Cell = M018_OPPOSITE(P0142_i_Direction); /* Alcove is on the opposite direction of the viewing direction */
                        L0149_ui_ObjectShiftIndex = 2;
                } else {
                        AL0126_i_ViewCell = M001_ORDINAL_TO_INDEX((int16_t)L0130_ul_RemainingViewCellOrdinalsToProcess & 0x000F); /* View cell is the index of coordinates to draw object */
                        L0187_ui_CurrentViewCellToDraw = AL0126_i_ViewCell;
                        L0130_ul_RemainingViewCellOrdinalsToProcess >>= 4; /* Proceed to the next cell ordinal */
                        L0148_i_CellCounter++;
                        L0139_i_Cell = M021_NORMALIZE(AL0126_i_ViewCell + P0142_i_Direction); /* Convert view cell to absolute cell */
                        P0141_T_Thing = L0146_T_FirstThingToDraw;
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
                        P0145_i_ViewSquareIndex = AL0147_ui_ViewSquareIndexBackup; /* Restore value as it may have been modified while drawing a creature */
#endif
                        L0149_ui_ObjectShiftIndex = 0;
                }
                L0149_ui_ObjectShiftIndex += (L0139_i_Cell & 0x0001) << 3;
                L0185_B_DrawProjectileAsObject = C0_FALSE;
                do {
                        if ((AL0127_i_ThingType = M012_TYPE(P0141_T_Thing)) == C04_THING_TYPE_GROUP) {
                                L0151_T_GroupThing = P0141_T_Thing;
                                continue;
                        }
                        if (AL0127_i_ThingType == C14_THING_TYPE_PROJECTILE) {
                                L0186_B_SquareHasProjectile = C1_TRUE;
                                continue;
                        }
                        if (AL0127_i_ThingType == C15_THING_TYPE_EXPLOSION) {
                                L0195_B_SquareHasExplosion = C1_TRUE;
                                continue;
                        }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        if ((P0145_i_ViewSquareIndex >= M600_VIEW_SQUARE_D3C) && (P0145_i_ViewSquareIndex <= M609_VIEW_SQUARE_D0C) && (M011_CELL(P0141_T_Thing) == L0139_i_Cell)) { /* Square where objects are visible and object is located on cell being processed */
                                L0129_ps_ObjectAspect = &(G0209_as_Graphic558_ObjectAspects[G0237_as_Graphic559_ObjectInfo[F0141_DUNGEON_GetObjectInfoIndex(P0141_T_Thing)].ObjectAspectIndex]);
                                AL0127_i_NativeBitmapIndex = M612_GRAPHIC_FIRST_OBJECT + L0129_ps_ObjectAspect->FirstNativeBitmapRelativeIndex;
                                if (L0142_B_UseAlcoveObjectImage = (L0135_B_DrawAlcoveObjects && M007_GET(L0129_ps_ObjectAspect->GraphicInfo, MASK0x0010_ALCOVE) && !L0138_i_ViewLane)) {
                                        AL0127_i_NativeBitmapIndex++;
                                }
                                L0133_puc_CoordinateSet = G0218_aaaauc_Graphic558_ObjectCoordinateSets[L0129_ps_ObjectAspect->CoordinateSet][P0145_i_ViewSquareIndex][AL0126_i_ViewCell];
                                if (!L0133_puc_CoordinateSet[C1_Y]) /* If object is not visible */
                                        continue;
                                T0115015_DrawProjectileAsObject:
                                L0143_B_FlipHorizontal = M007_GET(L0129_ps_ObjectAspect->GraphicInfo, MASK0x0001_FLIP_ON_RIGHT) &&
                                                         !L0142_B_UseAlcoveObjectImage &&
                                                         ((L0138_i_ViewLane == C2_VIEW_LANE_RIGHT) || (!L0138_i_ViewLane && ((AL0126_i_ViewCell == C01_VIEW_CELL_FRONT_RIGHT) || (AL0126_i_ViewCell == C02_VIEW_CELL_BACK_RIGHT))));
                                                         /* Flip horizontally if object graphic requires it and is not being drawn in an alcove and the object is either on the right lane or on the right column of the center lane */
                                L0140_i_PaddingPixelCount = 0;
                                if ((P0145_i_ViewSquareIndex == M609_VIEW_SQUARE_D0C) || ((P0145_i_ViewSquareIndex >= M606_VIEW_SQUARE_D1C) && (AL0126_i_ViewCell >= C02_VIEW_CELL_BACK_RIGHT))) {
                                        L0144_B_DrawingGrabbableObject = (!L0138_i_ViewLane && !L0185_B_DrawProjectileAsObject); /* If object is in the center lane (only D0C or D1C with condition above) and is not a projectile */
                                        AL0150_ui_ShiftSetIndex = C0_SHIFT_SET_D0_BACK_OR_D1_FRONT;
                                        AL0128_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(AL0127_i_NativeBitmapIndex); /* Use base graphic, no resizing */
                                        L0136_i_ByteWidth = L0129_ps_ObjectAspect->ByteWidth;
                                        L0137_i_Height = L0129_ps_ObjectAspect->Height;
                                        if (L0143_B_FlipHorizontal) {
                                                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(AL0128_puc_Bitmap, G0074_puc_Bitmap_Temporary, L0136_i_ByteWidth, L0137_i_Height);
                                                AL0128_puc_Bitmap = G0074_puc_Bitmap_Temporary;
                                        }
                                } else {
                                        L0144_B_DrawingGrabbableObject = C0_FALSE;
                                        L0134_i_DerivedBitmapIndex = C104_DERIVED_BITMAP_FIRST_OBJECT + L0129_ps_ObjectAspect->FirstDerivedBitmapRelativeIndex;
                                        if ((P0145_i_ViewSquareIndex >= M606_VIEW_SQUARE_D1C) || ((P0145_i_ViewSquareIndex >= M603_VIEW_SQUARE_D2C) && (AL0126_i_ViewCell >= C02_VIEW_CELL_BACK_RIGHT))) {
                                                L0134_i_DerivedBitmapIndex++;
                                                AL0150_ui_ShiftSetIndex = C1_SHIFT_SET_D1_BACK_OR_D2_FRONT;
                                                L0136_i_ByteWidth = M078_SCALED_DIMENSION(L0129_ps_ObjectAspect->ByteWidth, C20_SCALE_D2);
                                                L0137_i_Height = M078_SCALED_DIMENSION(L0129_ps_ObjectAspect->Height, C20_SCALE_D2);
                                                L0131_puc_PaletteChanges = G0214_auc_Graphic558_PaletteChanges_FloorOrnament_D2;
                                        } else {
                                                AL0150_ui_ShiftSetIndex = C2_SHIFT_SET_D2_BACK_OR_D3_FRONT;
                                                L0136_i_ByteWidth = M078_SCALED_DIMENSION(L0129_ps_ObjectAspect->ByteWidth, C16_SCALE_D3);
                                                L0137_i_Height = M078_SCALED_DIMENSION(L0129_ps_ObjectAspect->Height, C16_SCALE_D3);
                                                L0131_puc_PaletteChanges = G0213_auc_Graphic558_PaletteChanges_FloorOrnament_D3;
                                        }
                                        if (L0143_B_FlipHorizontal) {
                                                L0134_i_DerivedBitmapIndex += 2;
                                                L0140_i_PaddingPixelCount = (7 - ((L0136_i_ByteWidth - 1) & 0x0007)) << 1;
                                        } else {
                                                if (L0142_B_UseAlcoveObjectImage) {
                                                        L0134_i_DerivedBitmapIndex += 4;
                                                }
                                        }
                                        if (F0491_CACHE_IsDerivedBitmapInCache(L0134_i_DerivedBitmapIndex)) {
                                                AL0128_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(L0134_i_DerivedBitmapIndex);
                                        } else {
                                                L0132_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(AL0127_i_NativeBitmapIndex);
                                                F0129_VIDEO_BlitShrinkWithPaletteChanges(L0132_puc_Bitmap, AL0128_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(L0134_i_DerivedBitmapIndex), L0129_ps_ObjectAspect->ByteWidth << 1, L0129_ps_ObjectAspect->Height, L0136_i_ByteWidth << 1, L0137_i_Height, L0131_puc_PaletteChanges);
                                                if (L0143_B_FlipHorizontal) {
                                                        F0130_VIDEO_FlipHorizontal(AL0128_puc_Bitmap, M077_NORMALIZED_BYTE_WIDTH(L0136_i_ByteWidth), L0137_i_Height);
                                                }
                                                F0493_CACHE_AddDerivedBitmap(L0134_i_DerivedBitmapIndex);
                                        }
                                }
                                AL0127_i_X = L0133_puc_CoordinateSet[C0_X];
                                M771_BOX_BOTTOM(L0145_auc_Box) = L0133_puc_CoordinateSet[C1_Y];
                                if (!L0185_B_DrawProjectileAsObject) { /* If drawing an object that is not a projectile */
                                        AL0127_i_X += G0223_aac_Graphic558_ShiftSets[AL0150_ui_ShiftSetIndex][G0217_aauc_Graphic558_ObjectPileShiftSetIndices[L0149_ui_ObjectShiftIndex][C0_X_SHIFT_INDEX]];
                                        M771_BOX_BOTTOM(L0145_auc_Box) += G0223_aac_Graphic558_ShiftSets[AL0150_ui_ShiftSetIndex][G0217_aauc_Graphic558_ObjectPileShiftSetIndices[L0149_ui_ObjectShiftIndex][C1_Y_SHIFT_INDEX]];
                                        L0149_ui_ObjectShiftIndex++; /* The next object drawn will use the next shift values */
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        if ((AL0127_i_ThingType >= C05_THING_TYPE_WEAPON) && (AL0127_i_ThingType <= C10_THING_TYPE_JUNK) && (P0145_i_ViewSquareIndex >= M600_VIEW_SQUARE_D3C) && (P0145_i_ViewSquareIndex <= M609_VIEW_SQUARE_D0C) && (M011_CELL(P0141_T_Thing) == L0139_i_Cell) && ((P0145_i_ViewSquareIndex > M602_VIEW_SQUARE_D3R) || (AL0126_i_ViewCell > C01_VIEW_CELL_FRONT_RIGHT)) && ((P0145_i_ViewSquareIndex <= M606_VIEW_SQUARE_D1C) || !L0135_B_DrawAlcoveObjects) && ((P0145_i_ViewSquareIndex != M609_VIEW_SQUARE_D0C) || (AL0126_i_ViewCell < C02_VIEW_CELL_BACK_RIGHT))) { /* Square where objects are visible and object is located on cell being processed */
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        if ((AL0127_i_ThingType >= C05_THING_TYPE_WEAPON) && (AL0127_i_ThingType <= C10_THING_TYPE_JUNK) && (L2476_i_ >= 0) && (M011_CELL(P0141_T_Thing) == L0139_i_Cell) && ((L2475_i_ViewDepth != 3) || (AL0126_i_ViewCell > C01_VIEW_CELL_FRONT_RIGHT)) && ((L2475_i_ViewDepth != 0) || (AL0126_i_ViewCell < C02_VIEW_CELL_BACK_RIGHT))) { /* Square where objects are visible and object is located on cell being processed */
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                L0142_B_UseAlcoveObjectImage = L0135_B_DrawAlcoveObjects && !L0138_i_ViewLane;
                                AL0127_i_ObjectAspectIndex = G0237_as_Graphic559_ObjectInfo[F0141_DUNGEON_GetObjectInfoIndex(P0141_T_Thing)].ObjectAspectIndex;
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                L2474_i_ZoneIndex = C2500_ZONE_;
#endif
                                T0115015_DrawProjectileAsObject:
                                L0129_ps_ObjectAspect = &(G0209_as_Graphic558_ObjectAspects[AL0127_i_ObjectAspectIndex]);
                                AL0127_i_NativeBitmapIndex = M612_GRAPHIC_FIRST_OBJECT + L0129_ps_ObjectAspect->FirstNativeBitmapRelativeIndex;
                                if (L0142_B_UseAlcoveObjectImage) {
                                        if ((L0142_B_UseAlcoveObjectImage = M007_GET(L0129_ps_ObjectAspect->GraphicInfo, MASK0x0010_ALCOVE)) != C0_FALSE) {
                                                AL0127_i_NativeBitmapIndex++;
                                        }
                                }
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                if (M007_GET(L0129_ps_ObjectAspect->GraphicInfo, MASK0x0001_FLIP_ON_RIGHT) && !L0142_B_UseAlcoveObjectImage && ((L0138_i_ViewLane == C2_VIEW_LANE_RIGHT) || (!L0138_i_ViewLane && ((AL0126_i_ViewCell == C01_VIEW_CELL_FRONT_RIGHT) || (AL0126_i_ViewCell == C02_VIEW_CELL_BACK_RIGHT))))) { /* Flip horizontally if object graphic requires it and is not being drawn in an alcove and the object is either on the right lane or on the right column of the center lane */
                                        L0143_B_FlipHorizontal = MASK0x0001_FLIP_HORIZONTAL;
                                } else {
                                        L0143_B_FlipHorizontal = MASK0x0000_NO_FLIP;
                                }
                                if ((P0145_i_ViewSquareIndex == M609_VIEW_SQUARE_D0C) || ((P0145_i_ViewSquareIndex >= M606_VIEW_SQUARE_D1C) && (AL0126_i_ViewCell >= C02_VIEW_CELL_BACK_RIGHT))) {
                                        L0144_B_DrawingGrabbableObject = !L0138_i_ViewLane;
                                        AL0150_ui_ShiftSetIndex = C0_SHIFT_SET_D0_BACK_OR_D1_FRONT;
#endif
#ifdef MEDIA458_P20JA_P20JB
                                        AL0128_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(AL0127_i_NativeBitmapIndex); /* Use base graphic, no resizing */
#endif
#ifdef MEDIA506_F20E_F20J_X30J
                                        AL0128_puc_Bitmap = F1005_(AL0127_i_NativeBitmapIndex, CM1_DERIVED_BITMAP_NONE, L0143_B_FlipHorizontal);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                } else {
                                        L0144_B_DrawingGrabbableObject = C0_FALSE;
                                        L0134_i_DerivedBitmapIndex = C104_DERIVED_BITMAP_FIRST_OBJECT + L0129_ps_ObjectAspect->FirstDerivedBitmapRelativeIndex;
                                        if ((P0145_i_ViewSquareIndex >= M606_VIEW_SQUARE_D1C) || ((P0145_i_ViewSquareIndex >= M603_VIEW_SQUARE_D2C) && (AL0126_i_ViewCell >= C02_VIEW_CELL_BACK_RIGHT))) {
                                                L0134_i_DerivedBitmapIndex++;
                                                AL0150_ui_ShiftSetIndex = C1_SHIFT_SET_D1_BACK_OR_D2_FRONT;
                                                L0176_i_Scale = C20_SCALE_;
                                                L0131_puc_PaletteChanges = G0214_auc_Graphic558_PaletteChanges_FloorOrnament_D2;
                                        } else {
                                                AL0150_ui_ShiftSetIndex = C2_SHIFT_SET_D2_BACK_OR_D3_FRONT;
                                                L0176_i_Scale = C16_SCALE_;
                                                L0131_puc_PaletteChanges = G0213_auc_Graphic558_PaletteChanges_FloorOrnament_D3;
                                        }
                                        if (L0142_B_UseAlcoveObjectImage) {
                                                L0134_i_DerivedBitmapIndex += 4;
                                        }
#ifdef MEDIA458_P20JA_P20JB
                                        AL0128_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(AL0127_i_NativeBitmapIndex, L0134_i_DerivedBitmapIndex, L0176_i_Scale, L0176_i_Scale, L0131_puc_PaletteChanges);
#endif
#ifdef MEDIA506_F20E_F20J_X30J
                                        AL0128_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(AL0127_i_NativeBitmapIndex, L0134_i_DerivedBitmapIndex + 2, L0143_B_FlipHorizontal, L0134_i_DerivedBitmapIndex, L0176_i_Scale, L0176_i_Scale, L0131_puc_PaletteChanges);
#endif
                                }
                                if (L0135_B_DrawAlcoveObjects) {
                                        L2474_i_ZoneIndex = (L0129_ps_ObjectAspect->CoordinateSet * 7) + C2540_ZONE_ALCOVE_OBJECT + (P0145_i_ViewSquareIndex * 1);
                                } else {
                                        L2474_i_ZoneIndex += (P0145_i_ViewSquareIndex * 4) + AL0126_i_ViewCell;
                                }
                                if (!L0185_B_DrawProjectileAsObject) {
                                        L2474_i_ZoneIndex |= MASK0x8000_SHIFT_OBJECTS_AND_CREATURES;
                                        G2154_i_ZoneShiftX = G0223_aac_Graphic558_ShiftSets[AL0150_ui_ShiftSetIndex][G0217_aauc_Graphic558_ObjectPileShiftSetIndices[L0149_ui_ObjectShiftIndex][C0_X_SHIFT_INDEX]]; /* ANOMALY_FMT ebx bx usage */
                                        G2155_i_ZoneShiftY = G0223_aac_Graphic558_ShiftSets[AL0150_ui_ShiftSetIndex][G0217_aauc_Graphic558_ObjectPileShiftSetIndices[L0149_ui_ObjectShiftIndex][C1_Y_SHIFT_INDEX]]; /* ANOMALY_FMT ebx bx usage */
                                        L0149_ui_ObjectShiftIndex++;
#ifdef MEDIA488_F20E_F20J
                                _inline(0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90);
#endif
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                if (M007_GET(L0129_ps_ObjectAspect->GraphicInfo, MASK0x0001_FLIP_ON_RIGHT) && !L0142_B_UseAlcoveObjectImage && ((L0138_i_ViewLane >= 1) || ((L0138_i_ViewLane == 0) && ((AL0126_i_ViewCell == C01_VIEW_CELL_FRONT_RIGHT) || (AL0126_i_ViewCell == C02_VIEW_CELL_BACK_RIGHT))))) { /* Flip horizontally if object graphic requires it and is not being drawn in an alcove and the object is either on the right lane or on the right column of the center lane */
                                        L0143_B_FlipHorizontal = MASK0x0001_FLIP_HORIZONTAL;
                                } else {
                                        L0143_B_FlipHorizontal = MASK0x0000_NO_FLIP;
                                }
#ifdef MEDIA671_F31E_F31J_P31J
                                if ((L2475_i_ViewDepth == 0) || ((L2475_i_ViewDepth == 1) && (AL0126_i_ViewCell >= C02_VIEW_CELL_BACK_RIGHT))) {
                                        L0144_B_DrawingGrabbableObject = (L0138_i_ViewLane == 0);
#endif
#ifdef MEDIA721_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J
                                if (L2475_i_ViewDepth == 0) {
#endif
                                        AL0150_ui_ShiftSetIndex = C0_SHIFT_SET_D0_BACK_OR_D1_FRONT;
#ifdef MEDIA709_I34E_I34M_P31J
                                        AL0128_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(AL0127_i_NativeBitmapIndex);
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                                        AL0128_puc_Bitmap = F1005_(AL0127_i_NativeBitmapIndex, CM1_DERIVED_BITMAP_NONE, L0143_B_FlipHorizontal);
#endif
                                } else {
#ifdef MEDIA671_F31E_F31J_P31J
                                        L0144_B_DrawingGrabbableObject = 0;
                                        L0134_i_DerivedBitmapIndex = C104_DERIVED_BITMAP_FIRST_OBJECT + (L0129_ps_ObjectAspect->FirstDerivedBitmapRelativeIndex << 1);
                                        if ((L2475_i_ViewDepth == 1) || ((L2475_i_ViewDepth == 2) && (AL0126_i_ViewCell >= C02_VIEW_CELL_BACK_RIGHT))) {
                                                L0134_i_DerivedBitmapIndex++;
                                                AL0150_ui_ShiftSetIndex = C1_SHIFT_SET_D1_BACK_OR_D2_FRONT;
                                                L0176_i_Scale = C21_SCALE_;
                                                L0131_puc_PaletteChanges = G0214_auc_Graphic558_PaletteChanges_FloorOrnament_D2;
                                        } else {
                                                AL0150_ui_ShiftSetIndex = C2_SHIFT_SET_D2_BACK_OR_D3_FRONT;
                                                L0176_i_Scale = C14_SCALE_;
                                                L0131_puc_PaletteChanges = G0213_auc_Graphic558_PaletteChanges_FloorOrnament_D3;
                                        }
#endif
#ifdef MEDIA721_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J
                                        AL0150_ui_ShiftSetIndex = (L2475_i_ViewDepth * 2) - 1;
                                        if (AL0126_i_ViewCell == C04_VIEW_CELL_ALCOVE) {
                                                AL0150_ui_ShiftSetIndex--;
                                        } else {
                                                AL0150_ui_ShiftSetIndex -= AL0126_i_ViewCell >> 1;
                                        }
                                        L0134_i_DerivedBitmapIndex = C104_DERIVED_BITMAP_FIRST_OBJECT + (L0129_ps_ObjectAspect->FirstDerivedBitmapRelativeIndex * 5) + AL0150_ui_ShiftSetIndex;
                                        L0176_i_Scale = G2030_auc_ObjectScales[AL0150_ui_ShiftSetIndex];
                                        AL0150_ui_ShiftSetIndex = (AL0150_ui_ShiftSetIndex + 1) >> 1;
                                        L0131_puc_PaletteChanges = G2031_apuc_PaletteChanges_FloorOrnament[AL0150_ui_ShiftSetIndex];
#endif
                                        if (L0142_B_UseAlcoveObjectImage) {
                                                if (M007_GET(L0129_ps_ObjectAspect->GraphicInfo, MASK0x0001_FLIP_ON_RIGHT)) {
#ifdef MEDIA671_F31E_F31J_P31J
                                                        L0134_i_DerivedBitmapIndex += 4;
#endif
#ifdef MEDIA721_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J
                                                        L0134_i_DerivedBitmapIndex += 10;
#endif
                                                } else {
#ifdef MEDIA671_F31E_F31J_P31J
                                                        L0134_i_DerivedBitmapIndex += 2;
#endif
#ifdef MEDIA721_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J
                                                        L0134_i_DerivedBitmapIndex += 5;
#endif
                                                }
                                        }
#ifdef MEDIA709_I34E_I34M_P31J
                                        AL0128_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(AL0127_i_NativeBitmapIndex, L0134_i_DerivedBitmapIndex, L0176_i_Scale, L0176_i_Scale, L0131_puc_PaletteChanges);
#endif
#ifdef MEDIA749_A36M_A31E_A31M_A33M_A35E_A35M_X31J
                                        AL0128_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(AL0127_i_NativeBitmapIndex, L0134_i_DerivedBitmapIndex + 5, L0143_B_FlipHorizontal, L0134_i_DerivedBitmapIndex, L0176_i_Scale, L0176_i_Scale, L0131_puc_PaletteChanges);
#endif
#ifdef MEDIA670_F31E_F31J
                                        AL0128_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(AL0127_i_NativeBitmapIndex, L0134_i_DerivedBitmapIndex + 2, L0143_B_FlipHorizontal, L0134_i_DerivedBitmapIndex, L0176_i_Scale, L0176_i_Scale, L0131_puc_PaletteChanges);
#endif
                                }
#ifdef MEDIA721_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J
                                L0144_B_DrawingGrabbableObject = !AL0150_ui_ShiftSetIndex && (L0138_i_ViewLane == 0);
#endif
                                if (!L0185_B_DrawProjectileAsObject) {
                                        if (L0135_B_DrawAlcoveObjects) {
                                                L2474_i_ZoneIndex = (C2548_ZONE_ | MASK0x8000_SHIFT_OBJECTS_AND_CREATURES) + (L0129_ps_ObjectAspect->CoordinateSet * 7) + (L2476_i_ * 1);
                                        } else {
                                                L2474_i_ZoneIndex = (C2500_ZONE_ | MASK0x8000_SHIFT_OBJECTS_AND_CREATURES) + (L2476_i_ * 4) + AL0126_i_ViewCell;
                                        }
                                        G2154_i_ZoneShiftX = G0223_aac_Graphic558_ShiftSets[AL0150_ui_ShiftSetIndex][G0217_aauc_Graphic558_ObjectPileShiftSetIndices[L0149_ui_ObjectShiftIndex][C0_X_SHIFT_INDEX]]; /* ANOMALY_FMT ebx bx usage */
                                        G2155_i_ZoneShiftY = G0223_aac_Graphic558_ShiftSets[AL0150_ui_ShiftSetIndex][G0217_aauc_Graphic558_ObjectPileShiftSetIndices[L0149_ui_ObjectShiftIndex][C1_Y_SHIFT_INDEX]]; /* ANOMALY_FMT ebx bx usage */
#ifdef MEDIA670_F31E_F31J
                                        _inline(0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90);
#endif
                                        L0149_ui_ObjectShiftIndex++;
#endif
                                        if (L0135_B_DrawAlcoveObjects) {
                                                if (L0149_ui_ObjectShiftIndex >= 14) {
                                                        L0149_ui_ObjectShiftIndex = 2;
                                                }
                                        } else {
                                                L0149_ui_ObjectShiftIndex &= 0x000F;
                                        }
                                }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                M770_BOX_TOP(L0145_auc_Box) = M771_BOX_BOTTOM(L0145_auc_Box) - (L0137_i_Height - 1);
                                if (M771_BOX_BOTTOM(L0145_auc_Box) > 135) {
                                        M771_BOX_BOTTOM(L0145_auc_Box) = 135;
                                }
                                M769_BOX_RIGHT(L0145_auc_Box) = F0024_MAIN_GetMinimumValue(223, AL0127_i_X + L0136_i_ByteWidth);
                                if (M768_BOX_LEFT(L0145_auc_Box) = F0025_MAIN_GetMaximumValue(0, AL0127_i_X - L0136_i_ByteWidth + 1)) {
                                        if (L0143_B_FlipHorizontal) {
                                                AL0127_i_X = L0140_i_PaddingPixelCount;
                                        } else {
                                                AL0127_i_X = 0;
                                        }
                                } else {
                                        AL0127_i_X = L0136_i_ByteWidth - AL0127_i_X - 1;
                                }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0791_DUNGEONVIEW_DrawBitmapXX(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, L2474_i_ZoneIndex, L0143_B_FlipHorizontal, C10_COLOR_FLESH);
                                if (L0185_B_DrawProjectileAsObject)
                                        goto T0115171_BackFromT0115015_DrawProjectileAsObject;
#endif
                                if (L0144_B_DrawingGrabbableObject) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                        L0132_puc_Bitmap = AL0128_puc_Bitmap;
                                        AL0128_puc_Box = G0291_aauc_DungeonViewClickableBoxes[AL0126_i_ViewCell];
                                        if (M768_BOX_LEFT(AL0128_puc_Box) == 255) { /* If the grabbable object is the first */
                                                F0007_MAIN_CopyBytes(L0145_auc_Box, AL0128_puc_Box, sizeof(L0145_auc_Box));
                                                if ((L0141_i_Height = M771_BOX_BOTTOM(AL0128_puc_Box) - M770_BOX_TOP(AL0128_puc_Box)) < 14) { /* If the box is too small then enlarge it a little */
                                                        L0141_i_Height = L0141_i_Height >> 1;
                                                        M770_BOX_TOP(AL0128_puc_Box) += L0141_i_Height - 7;
                                                        if (L0141_i_Height < 4) {
                                                                M771_BOX_BOTTOM(AL0128_puc_Box) -= L0141_i_Height - 3;
                                                        }
                                                }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                        AL0128_pi_XYZ = (unsigned char*)G2210_aai_XYZ_DungeonViewClickable[AL0126_i_ViewCell];
                                        if (M704_ZONE_LEFT(((int16_t*)AL0128_pi_XYZ)) == -1) { /* If the grabbable object is the first */
                                                F0007_MAIN_CopyBytes((char*)G2032_ai_XYZ, M772_CAST_PC(AL0128_pi_XYZ), (long)sizeof(G2032_ai_XYZ));
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                                if ((L0141_i_Height = M707_ZONE_BOTTOM(((int16_t*)AL0128_pi_XYZ)) - M706_ZONE_TOP(((int16_t*)AL0128_pi_XYZ))) < 14) {
                                                        L0141_i_Height >>= 1;
                                                        M706_ZONE_TOP(((int16_t*)AL0128_pi_XYZ)) += L0141_i_Height - 7;
                                                        if (L0141_i_Height < 4) {
                                                                M707_ZONE_BOTTOM(((int16_t*)AL0128_pi_XYZ)) -= L0141_i_Height - 3;
                                                        }
                                                }
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                if ((L0141_i_Height = M709_ZONE_HEIGHT(((int16_t*)AL0128_pi_XYZ))) < 15) {
                                                        if (L0141_i_Height < 11) {
                                                                M709_ZONE_HEIGHT(((int16_t*)AL0128_pi_XYZ)) = 11;
                                                        }
                                                        M706_ZONE_TOP(((int16_t*)AL0128_pi_XYZ)) += (L0141_i_Height >> 1) - 7;
                                                }
                                                if ((L0141_i_Height = M708_ZONE_WIDTH(((int16_t*)AL0128_pi_XYZ))) < 14) {
                                                        M708_ZONE_WIDTH(((int16_t*)AL0128_pi_XYZ)) = 14;
                                                        M704_ZONE_LEFT(((int16_t*)AL0128_pi_XYZ)) += (L0141_i_Height >> 1) - 7;
                                                }
#endif
                                        } else { /* If there are several grabbable objects then enlarge the box so it includes all objects */
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                M768_BOX_LEFT(AL0128_puc_Box) = F0024_MAIN_GetMinimumValue(M768_BOX_LEFT(AL0128_puc_Box), M768_BOX_LEFT(L0145_auc_Box));
                                                M769_BOX_RIGHT(AL0128_puc_Box) = F0025_MAIN_GetMaximumValue(M769_BOX_RIGHT(AL0128_puc_Box), M769_BOX_RIGHT(L0145_auc_Box));
                                                M770_BOX_TOP(AL0128_puc_Box) = F0024_MAIN_GetMinimumValue(M770_BOX_TOP(AL0128_puc_Box), M770_BOX_TOP(L0145_auc_Box));
                                                M771_BOX_BOTTOM(AL0128_puc_Box) = F0025_MAIN_GetMaximumValue(M771_BOX_BOTTOM(AL0128_puc_Box), M771_BOX_BOTTOM(L0145_auc_Box));
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                                M768_BOX_LEFT(((int16_t*)AL0128_puc_Box)) = F0024_MAIN_GetMinimumValue(M768_BOX_LEFT(((int16_t*)AL0128_puc_Box)), M704_ZONE_LEFT(G2032_ai_XYZ));
                                                M769_BOX_RIGHT(((int16_t*)AL0128_puc_Box)) = F0025_MAIN_GetMaximumValue(M769_BOX_RIGHT(((int16_t*)AL0128_puc_Box)), M705_ZONE_RIGHT(G2032_ai_XYZ));
                                                M770_BOX_TOP(((int16_t*)AL0128_puc_Box)) = F0024_MAIN_GetMinimumValue(M770_BOX_TOP(((int16_t*)AL0128_puc_Box)), M706_ZONE_TOP(G2032_ai_XYZ));
                                                M771_BOX_BOTTOM(((int16_t*)AL0128_puc_Box)) = F0025_MAIN_GetMaximumValue(M771_BOX_BOTTOM(((int16_t*)AL0128_puc_Box)), M707_ZONE_BOTTOM(G2032_ai_XYZ));
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                L0127_i_Multiple = F0025_MAIN_GetMaximumValue(M704_ZONE_LEFT(((int16_t*)AL0128_pi_XYZ)) + M708_ZONE_WIDTH(((int16_t*)AL0128_pi_XYZ)), M704_ZONE_LEFT(G2032_ai_XYZ) + M708_ZONE_WIDTH(G2032_ai_XYZ));
                                                M704_ZONE_LEFT(((int16_t*)AL0128_pi_XYZ)) = F0024_MAIN_GetMinimumValue(M704_ZONE_LEFT(((int16_t*)AL0128_pi_XYZ)), M704_ZONE_LEFT(G2032_ai_XYZ));
                                                M708_ZONE_WIDTH(((int16_t*)AL0128_pi_XYZ)) = L0127_i_Multiple - M704_ZONE_LEFT(((int16_t*)AL0128_pi_XYZ));
                                                L0127_i_Multiple = F0025_MAIN_GetMaximumValue(M706_ZONE_TOP(((int16_t*)AL0128_pi_XYZ)) + M709_ZONE_HEIGHT(((int16_t*)AL0128_pi_XYZ)), M706_ZONE_TOP(G2032_ai_XYZ) + M709_ZONE_HEIGHT(G2032_ai_XYZ));
                                                M706_ZONE_TOP(((int16_t*)AL0128_pi_XYZ)) = F0024_MAIN_GetMinimumValue(M706_ZONE_TOP(((int16_t*)AL0128_pi_XYZ)), M706_ZONE_TOP(G2032_ai_XYZ));
                                                M709_ZONE_HEIGHT(((int16_t*)AL0128_pi_XYZ)) = L0127_i_Multiple - M706_ZONE_TOP(((int16_t*)AL0128_pi_XYZ));
#endif
                                        }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                        AL0128_puc_Bitmap = L0132_puc_Bitmap;
#endif
                                        G0292_aT_PileTopObject[AL0126_i_ViewCell] = P0141_T_Thing; /* The object is at the top of the pile */
                                }
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                                F0132_VIDEO_Blit(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0145_auc_Box, AL0127_i_X, 0, M077_NORMALIZED_BYTE_WIDTH(L0136_i_ByteWidth), C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0132_VIDEO_Blit(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0145_auc_Box, AL0127_i_X, 0, M077_NORMALIZED_BYTE_WIDTH(L0136_i_ByteWidth), C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH, L0137_i_Height, C136_HEIGHT_VIEWPORT);
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                if (L0185_B_DrawProjectileAsObject)
                                        goto T0115171_BackFromT0115015_DrawProjectileAsObject;
#endif
                        }
                } while ((P0141_T_Thing = F0159_DUNGEON_GetNextThing(P0141_T_Thing)) != C0xFFFE_THING_ENDOFLIST);
                if (AL0126_i_ViewCell == C04_VIEW_CELL_ALCOVE)
                        break; /* End of processing when drawing objects in an alcove */
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
                if (P0145_i_ViewSquareIndex < M600_VIEW_SQUARE_D3C)
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                if (L2475_i_ViewDepth > 3)
#endif
                        break; /* End of processing if square is too far away at D4 */
/* Draw creatures */
                L0168_B_DrawingLastBackRowCell = ((AL0126_i_ViewCell <= C01_VIEW_CELL_FRONT_RIGHT) || (L0148_i_CellCounter == 1)) && (!L0130_ul_RemainingViewCellOrdinalsToProcess || ((L0130_ul_RemainingViewCellOrdinalsToProcess & 0x0000000F) >= 3)); /* If (draw cell on the back row or second cell being processed) and (no more cells to draw or next cell to draw is a cell on the front row) */
                if ((L0151_T_GroupThing == C0xFFFF_THING_NONE) || L0174_B_DrawCreaturesCompleted
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                || (P0145_i_ViewSquareIndex == M609_VIEW_SQUARE_D0C)
#endif
                   )
                        goto T0115129_DrawProjectiles; /* Skip code to draw creatures */
                if (L0152_ps_Group == NULL) { /* If all creature data and info has not already been gathered */ /* ANOMALY_ASSEMBLY_COMPILATION_DIFFERENCE jmp */
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        if ((L2477_i_ = G2033_ac_ViewSquareIndexTo[P0145_i_ViewSquareIndex]) < 0) {
                                L0174_B_DrawCreaturesCompleted = C1_TRUE;
                                goto T0115129_DrawProjectiles; /* Skip code to draw creatures */
                        }
#endif
#ifdef MEDIA001_S10EA_S10EB /* CHANGE2_01_OPTIMIZATION Inline code replaced by function calls */
                        L0152_ps_Group = &((GROUP*)G0284_apuc_ThingData[C04_THING_TYPE_GROUP])[M013_INDEX(L0151_T_GroupThing)];
#endif
#ifdef MEDIA227_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J /* CHANGE2_01_OPTIMIZATION Inline code replaced by function calls */
                        L0152_ps_Group = (GROUP*)F0156_DUNGEON_GetThingData(L0151_T_GroupThing);
#endif
                        L0153_ps_ActiveGroup = &G0375_ps_ActiveGroups[L0152_ps_Group->ActiveGroupIndex];
                        L0154_ps_CreatureInfo = &G0243_as_Graphic559_CreatureInfo[L0152_ps_Group->Type];
                        L0155_ps_CreatureAspect = &G0219_as_Graphic558_CreatureAspects[L0154_ps_CreatureInfo->CreatureAspectIndex];
                        L0156_i_CreatureSize = M007_GET(L0154_ps_CreatureInfo->Attributes, MASK0x0003_SIZE);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        L0158_i_CreatureGraphicInfo = L0154_ps_CreatureInfo->GraphicInfo;
#endif
                }
                L0129_ps_ObjectAspect = (OBJECT_ASPECT*)L0155_ps_CreatureAspect;
                if (AP0141_ui_CreatureIndex = F0176_GROUP_GetCreatureOrdinalInCell(L0152_ps_Group, L0139_i_Cell)) { /* If there is a creature on the cell being processed */
                        AP0141_ui_CreatureIndex--; /* Convert ordinal to index */
                        L0161_i_CreatureIndex = (int16_t)AP0141_ui_CreatureIndex;
                } else {
                        if (L0156_i_CreatureSize == C1_SIZE_HALF_SQUARE) {
                                AP0141_ui_CreatureIndex = 0;
                                L0161_i_CreatureIndex = -1;
                        } else {
                                goto T0115129_DrawProjectiles; /* No creature to draw at cell, skip to projectiles */
                        }
                }
                L0157_i_CreatureDirectionDelta = M021_NORMALIZE(P0142_i_Direction - M050_CREATURE_VALUE(L0153_ps_ActiveGroup->Directions, AP0141_ui_CreatureIndex));
                L0167_B_TwoHalfSquareCreaturesFrontView = C0_FALSE;
                if ((AL0127_i_GroupCells = L0153_ps_ActiveGroup->Cells) == C0xFF_SINGLE_CENTERED_CREATURE) { /* If there is a single centered creature in the group */
                        if (L0130_ul_RemainingViewCellOrdinalsToProcess || (L0175_i_DoorFrontViewDrawingPass == 1))
                                goto T0115129_DrawProjectiles; /* Do not draw a single centered creature now, wait until second pass (for a front view door) or until all cells have been drawn so the creature is drawn over all the objects on the floor */
                        L0174_B_DrawCreaturesCompleted = C1_TRUE;
                        if ((L0156_i_CreatureSize == C1_SIZE_HALF_SQUARE) && (L0157_i_CreatureDirectionDelta & 0x0001)) { /* Side view of half square creature */
                                AL0126_i_ViewCell = C03_VIEW_CELL_CENTER_COLUMN;
                        } else {
#ifdef PC_FIX_CODE_SIZE
        AL0127_i_ThingType++;
        AL0127_i_ThingType = 50;
#endif
                                AL0126_i_ViewCell = C04_VIEW_CELL_FRONT_ROW;
                        }
                } else {
                        if ((L0156_i_CreatureSize == C1_SIZE_HALF_SQUARE) && (L0168_B_DrawingLastBackRowCell || !L0130_ul_RemainingViewCellOrdinalsToProcess || (L0161_i_CreatureIndex < 0))) {
                                if (L0168_B_DrawingLastBackRowCell && (L0175_i_DoorFrontViewDrawingPass != 2)) {
                                        if ((L0161_i_CreatureIndex >= 0) && (L0157_i_CreatureDirectionDelta & 0x0001)) {
                                                AL0126_i_ViewCell = C02_VIEW_CELL_BACK_ROW; /* Side view of a half square creature on the back row. Drawn during pass 1 for a door square */
                                        } else {
                                                goto T0115129_DrawProjectiles;
                                        }
                                } else {
                                        if ((L0175_i_DoorFrontViewDrawingPass != 1) && !L0130_ul_RemainingViewCellOrdinalsToProcess) {
                                                if (L0157_i_CreatureDirectionDelta & 0x0001) {
                                                        if (L0161_i_CreatureIndex >= 0) {
                                                                AL0126_i_ViewCell = C04_VIEW_CELL_FRONT_ROW; /* Side view of a half square creature on the front row. Drawn during pass 2 for a door square */
                                                        } else {
                                                                goto T0115129_DrawProjectiles;
                                                        }
                                                } else {
                                                        L0174_B_DrawCreaturesCompleted = C1_TRUE;
                                                        if (L0161_i_CreatureIndex < 0) {
                                                                L0161_i_CreatureIndex = 0;
                                                        }
                                                        L0167_B_TwoHalfSquareCreaturesFrontView = L0152_ps_Group->Count;
                                                        if (((AL0127_i_GroupCells = M050_CREATURE_VALUE(AL0127_i_GroupCells, AP0141_ui_CreatureIndex)) == P0142_i_Direction) || (AL0127_i_GroupCells == M020_PREVIOUS(P0142_i_Direction))) {
                                                                AL0126_i_ViewCell = C00_VIEW_CELL_LEFT_COLUMN;
                                                        } else {
                                                                AL0126_i_ViewCell = C01_VIEW_CELL_RIGHT_COLUMN;
                                                        }
                                                }
                                        } else {
                                                goto T0115129_DrawProjectiles;
                                        }
                                }
                        } else {
                                if (L0156_i_CreatureSize != C0_SIZE_QUARTER_SQUARE)
                                        goto T0115129_DrawProjectiles;
                        }
                }
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                if ((L0156_i_CreatureSize == C0_SIZE_QUARTER_SQUARE) && (((P0145_i_ViewSquareIndex == M610_VIEW_SQUARE_D0L) && (AL0126_i_ViewCell != C02_VIEW_CELL_BACK_RIGHT)) || ((P0145_i_ViewSquareIndex == M611_VIEW_SQUARE_D0R) && (AL0126_i_ViewCell != C03_VIEW_CELL_BACK_LEFT)))) {
                        goto T0115129_DrawProjectiles;
                }
#endif
                L0159_i_CreatureAspect = L0153_ps_ActiveGroup->Aspect[L0161_i_CreatureIndex];
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
                if (P0145_i_ViewSquareIndex > M609_VIEW_SQUARE_D0C) {
                        P0145_i_ViewSquareIndex--;
                }
#endif
                T0115077_DrawSecondHalfSquareCreature:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                L0133_puc_CoordinateSet = G0224_aaaauc_Graphic558_CreatureCoordinateSets[M071_COORDINATE_SET((CREATURE_ASPECT*)L0129_ps_ObjectAspect)][P0145_i_ViewSquareIndex][AL0126_i_ViewCell];
                if (!L0133_puc_CoordinateSet[C1_Y])
                        goto T0115126_CreatureNotVisible;
                AP0141_ui_CreatureGraphicInfo = L0158_i_CreatureGraphicInfo;
                AL0127_i_NativeBitmapIndex = M618_GRAPHIC_FIRST_CREATURE + ((CREATURE_ASPECT*)L0129_ps_ObjectAspect)->FirstNativeBitmapRelativeIndex; /* By default, assume using the front image */
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                AP0141_ui_CreatureGraphicInfo = L0154_ps_CreatureInfo->GraphicInfo;
                AL0127_i_NativeBitmapIndex = M618_GRAPHIC_FIRST_CREATURE + ((CREATURE_ASPECT*)L0129_ps_ObjectAspect)->FirstNativeBitmapRelativeIndex; /* By default, assume using the front image */
#endif
                L0134_i_DerivedBitmapIndex = ((CREATURE_ASPECT*)L0129_ps_ObjectAspect)->FirstDerivedBitmapIndex;
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                L2478_i_DerivedBitmapIndex = CM1_DERIVED_BITMAP_NONE;
#endif
                if (L0169_B_UseCreatureSideBitmap = M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0008_SIDE) && (L0157_i_CreatureDirectionDelta & 0x0001)) {
                        L0172_B_UseCreatureAttackBitmap = L0173_B_UseFlippedHorizontallyCreatureFrontImage = L0170_B_UseCreatureBackBitmap = C0_FALSE;
                        AL0127_i_NativeBitmapIndex++; /* Skip the front image. Side image is right after the front image */
                        L0134_i_DerivedBitmapIndex += 2;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        L0163_i_SourceByteWidth = L0136_i_ByteWidth = ((CREATURE_ASPECT*)L0129_ps_ObjectAspect)->ByteWidthSide;
                        L0164_i_SourceHeight = L0137_i_Height = ((CREATURE_ASPECT*)L0129_ps_ObjectAspect)->HeightSide;
#endif
                } else {
                        L0170_B_UseCreatureBackBitmap = M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0010_BACK) && (L0157_i_CreatureDirectionDelta == 0);
                        if (L0172_B_UseCreatureAttackBitmap = !L0170_B_UseCreatureBackBitmap && M007_GET(L0159_i_CreatureAspect, MASK0x0080_IS_ATTACKING) && M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0020_ATTACK)) {
                                L0173_B_UseFlippedHorizontallyCreatureFrontImage = C0_FALSE;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                L0163_i_SourceByteWidth = L0136_i_ByteWidth = ((CREATURE_ASPECT*)L0129_ps_ObjectAspect)->ByteWidthAttack;
                                L0164_i_SourceHeight = L0137_i_Height = ((CREATURE_ASPECT*)L0129_ps_ObjectAspect)->HeightAttack;
#endif
                                AL0127_i_NativeBitmapIndex++; /* Skip the front image */
                                L0134_i_DerivedBitmapIndex += 2;
                                if (M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0008_SIDE)) {
                                        AL0127_i_NativeBitmapIndex++; /* If the creature has a side image, it preceeds the attack image */
                                        L0134_i_DerivedBitmapIndex += 2;
                                }
                                if (M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0010_BACK)) {
                                        AL0127_i_NativeBitmapIndex++; /* If the creature has a back image, it preceeds the attack image */
#ifdef PC_FIX_CODE_SIZE
        AL0127_i_ThingType++;
        AL0127_i_ThingType = 51;
#endif
                                        L0134_i_DerivedBitmapIndex += 2;
                                }
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                L0163_i_SourceByteWidth = L0136_i_ByteWidth = ((CREATURE_ASPECT*)L0129_ps_ObjectAspect)->ByteWidthFront;
                                L0164_i_SourceHeight = L0137_i_Height = ((CREATURE_ASPECT*)L0129_ps_ObjectAspect)->HeightFront;
#endif
                                if (L0170_B_UseCreatureBackBitmap) {
                                        L0173_B_UseFlippedHorizontallyCreatureFrontImage = C0_FALSE;
                                        if (M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0008_SIDE)) {
                                                AL0127_i_NativeBitmapIndex += 2; /* If the creature has a side image, it preceeds the back image */
                                                L0134_i_DerivedBitmapIndex += 4;
                                        } else {
#ifdef PC_FIX_CODE_SIZE
        AL0127_i_ThingType++;
        AL0127_i_ThingType = 52;
#endif
                                                AL0127_i_NativeBitmapIndex++; /* If the creature does not have a side image, the back image follows the front image */
                                                L0134_i_DerivedBitmapIndex += 2;
                                        }
                                } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                        if (L0173_B_UseFlippedHorizontallyCreatureFrontImage = M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0004_FLIP_NON_ATTACK) && M007_GET(L0159_i_CreatureAspect, MASK0x0040_FLIP_BITMAP)) {
                                                L0134_i_DerivedBitmapIndex += 2;
                                                if (M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0008_SIDE)) {
                                                        L0134_i_DerivedBitmapIndex += 2;
                                                }
                                                if (M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0010_BACK)) {
                                                        L0134_i_DerivedBitmapIndex += 2;
                                                }
                                                if (M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0020_ATTACK)) {
                                                        L0134_i_DerivedBitmapIndex += 2;
                                                }
                                        }
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                                        L0173_B_UseFlippedHorizontallyCreatureFrontImage = M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0004_FLIP_NON_ATTACK) && M007_GET(L0159_i_CreatureAspect, MASK0x0040_FLIP_BITMAP);
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                                        if (L0173_B_UseFlippedHorizontallyCreatureFrontImage = M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0004_FLIP_NON_ATTACK) && M007_GET(L0159_i_CreatureAspect, MASK0x0040_FLIP_BITMAP)) {
                                                L2478_i_DerivedBitmapIndex = L0134_i_DerivedBitmapIndex + 2;
                                                if (M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0008_SIDE)) {
                                                        L2478_i_DerivedBitmapIndex += 2;
                                                }
                                                if (M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0010_BACK)) {
                                                        L2478_i_DerivedBitmapIndex += 2;
                                                }
                                                if (M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0020_ATTACK)) {
                                                        L2478_i_DerivedBitmapIndex += 2;
                                                }
                                        }
#endif
                                }
                        }
                }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                if (P0145_i_ViewSquareIndex >= M606_VIEW_SQUARE_D1C) { /* Creature is on D1 */
                        L0165_i_CreaturePaddingPixelCount = 0;
                        AL0150_ui_ShiftSetIndex = C0_SHIFT_SET_D0_BACK_OR_D1_FRONT;
                        L0162_i_TransparentColor = M072_TRANSPARENT_COLOR((CREATURE_ASPECT*)L0129_ps_ObjectAspect);
                        if (L0169_B_UseCreatureSideBitmap) {
                                AL0128_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(AL0127_i_NativeBitmapIndex);
                                if (L0157_i_CreatureDirectionDelta == 1) {
                                        F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(AL0128_puc_Bitmap, G0074_puc_Bitmap_Temporary, L0136_i_ByteWidth, L0137_i_Height);
                                        AL0128_puc_Bitmap = G0074_puc_Bitmap_Temporary;
                                }
                        } else {
                                if (L0170_B_UseCreatureBackBitmap || !L0173_B_UseFlippedHorizontallyCreatureFrontImage) {
                                        AL0128_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(AL0127_i_NativeBitmapIndex);
                                        if (L0172_B_UseCreatureAttackBitmap && M007_GET(L0159_i_CreatureAspect, MASK0x0040_FLIP_BITMAP)) {
                                                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(AL0128_puc_Bitmap, G0074_puc_Bitmap_Temporary, L0136_i_ByteWidth, L0137_i_Height);
                                                AL0128_puc_Bitmap = G0074_puc_Bitmap_Temporary;
                                        }
                                } else { /* Use first additional derived graphic: front D1 */
                                        if (F0491_CACHE_IsDerivedBitmapInCache(L0134_i_DerivedBitmapIndex)) { /* If derived graphic is already in memory */
                                                AL0128_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(L0134_i_DerivedBitmapIndex);
                                        } else {
                                                L0132_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(AL0127_i_NativeBitmapIndex);
                                                if (M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0004_FLIP_NON_ATTACK)) {
                                                        F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(L0132_puc_Bitmap, AL0128_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(L0134_i_DerivedBitmapIndex), L0136_i_ByteWidth, L0137_i_Height);
                                                }
                                                F0493_CACHE_AddDerivedBitmap(L0134_i_DerivedBitmapIndex);
                                        }
                                }
                        }
                } else { /* Creature is on D2 or D3 */
                        if (L0173_B_UseFlippedHorizontallyCreatureFrontImage) {
                                L0134_i_DerivedBitmapIndex++; /* Skip front D1 image in additional graphics */
                        }
                        if (P0145_i_ViewSquareIndex >= M603_VIEW_SQUARE_D2C) { /* Creature is on D2 */
                                L0134_i_DerivedBitmapIndex++; /* Skip front D3 image in additional graphics */
                                AL0150_ui_ShiftSetIndex = C1_SHIFT_SET_D1_BACK_OR_D2_FRONT;
                                L0171_B_UseCreatureSpecialD2FrontBitmap = M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0080_SPECIAL_D2_FRONT) && !L0169_B_UseCreatureSideBitmap && !L0170_B_UseCreatureBackBitmap && !L0172_B_UseCreatureAttackBitmap;
                                L0131_puc_PaletteChanges = G0222_auc_Graphic558_PaletteChanges_Creature_D2;
                                L0176_i_Scale = C20_SCALE_D2;
                        } else { /* Creature is on D3 */
                                AL0150_ui_ShiftSetIndex = C2_SHIFT_SET_D2_BACK_OR_D3_FRONT;
                                L0171_B_UseCreatureSpecialD2FrontBitmap = C0_FALSE;
                                L0131_puc_PaletteChanges = G0221_auc_Graphic558_PaletteChanges_Creature_D3;
                                L0176_i_Scale = C16_SCALE_D3;
                        }
                        L0136_i_ByteWidth = M078_SCALED_DIMENSION(L0163_i_SourceByteWidth, L0176_i_Scale);
                        L0137_i_Height = M078_SCALED_DIMENSION(L0164_i_SourceHeight, L0176_i_Scale);
#ifdef MEDIA137_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        L0162_i_TransparentColor = L0131_puc_PaletteChanges[M072_TRANSPARENT_COLOR((CREATURE_ASPECT*)L0129_ps_ObjectAspect)] / 10;
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
                        L0162_i_TransparentColor = L0131_puc_PaletteChanges[M072_TRANSPARENT_COLOR((CREATURE_ASPECT*)L0129_ps_ObjectAspect)];
#endif
                        if (L0177_B_DerivedBitmapInCache = F0491_CACHE_IsDerivedBitmapInCache(L0134_i_DerivedBitmapIndex)) {
                                AL0128_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(L0134_i_DerivedBitmapIndex);
                        } else {
                                L0132_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(AL0127_i_NativeBitmapIndex);
                                F0129_VIDEO_BlitShrinkWithPaletteChanges(L0132_puc_Bitmap, AL0128_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(L0134_i_DerivedBitmapIndex), L0163_i_SourceByteWidth << 1, L0164_i_SourceHeight, L0136_i_ByteWidth << 1, L0137_i_Height, L0131_puc_PaletteChanges);
                                F0493_CACHE_AddDerivedBitmap(L0134_i_DerivedBitmapIndex);
                        }
                        if ((L0169_B_UseCreatureSideBitmap && (L0157_i_CreatureDirectionDelta == 1)) || /* If creature is viewed from the right, the side view must be flipped */
                            (L0172_B_UseCreatureAttackBitmap && M007_GET(L0159_i_CreatureAspect, MASK0x0040_FLIP_BITMAP)) ||
                            (L0171_B_UseCreatureSpecialD2FrontBitmap && M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0100_SPECIAL_D2_FRONT_IS_FLIPPED_FRONT)) ||
                            (L0173_B_UseFlippedHorizontallyCreatureFrontImage && M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0004_FLIP_NON_ATTACK))) { /* If the graphic should be flipped */
                                if (!L0173_B_UseFlippedHorizontallyCreatureFrontImage || !L0177_B_DerivedBitmapInCache) {
                                        AL0127_i_NormalizedByteWidth = M077_NORMALIZED_BYTE_WIDTH(L0136_i_ByteWidth);
                                        if (!L0173_B_UseFlippedHorizontallyCreatureFrontImage) {
                                                F0007_MAIN_CopyBytes(AL0128_puc_Bitmap, G0074_puc_Bitmap_Temporary, AL0127_i_NormalizedByteWidth * L0137_i_Height);
                                                AL0128_puc_Bitmap = G0074_puc_Bitmap_Temporary;
                                        }
                                        F0130_VIDEO_FlipHorizontal(AL0128_puc_Bitmap, AL0127_i_NormalizedByteWidth, L0137_i_Height);
                                }
                                L0165_i_CreaturePaddingPixelCount = (7 - ((L0136_i_ByteWidth - 1) & 0x0007)) << 1;
                        } else {
                                L0165_i_CreaturePaddingPixelCount = 0;
                        }
                }
                AL0127_i_Y = L0133_puc_CoordinateSet[C1_Y];
                AL0127_i_Y += G0223_aac_Graphic558_ShiftSets[AL0150_ui_ShiftSetIndex][M023_VERTICAL_OFFSET(L0159_i_CreatureAspect)];
                M771_BOX_BOTTOM(L0145_auc_Box) = F0024_MAIN_GetMinimumValue(AL0127_i_Y, 135);
                M770_BOX_TOP(L0145_auc_Box) = F0025_MAIN_GetMaximumValue(0, AL0127_i_Y - (L0137_i_Height - 1));
                AL0127_i_X = L0133_puc_CoordinateSet[C0_X];
                AL0127_i_X += G0223_aac_Graphic558_ShiftSets[AL0150_ui_ShiftSetIndex][M022_HORIZONTAL_OFFSET(L0159_i_CreatureAspect)];
                if (L0138_i_ViewLane == C1_VIEW_LANE_LEFT) {
                        AL0127_i_X -= 100;
                } else {
                        if (L0138_i_ViewLane) { /* Lane right */
                                AL0127_i_X += 100;
                        }
                }
                if (!(M769_BOX_RIGHT(L0145_auc_Box) = F0026_MAIN_GetBoundedValue(0, AL0127_i_X + L0136_i_ByteWidth, 223)))
                        goto T0115126_CreatureNotVisible;
                if (M768_BOX_LEFT(L0145_auc_Box) = F0026_MAIN_GetBoundedValue(0, AL0127_i_X - L0136_i_ByteWidth + 1, 223)) {
                        if (M768_BOX_LEFT(L0145_auc_Box) == 223)
                                goto T0115126_CreatureNotVisible;
#ifdef MEDIA353_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G /* ANOMALY_ST_BRANCH */
                        else {
#endif
                                AP0141_ui_CreatureX = L0165_i_CreaturePaddingPixelCount;
#ifdef MEDIA353_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        }
#endif
                } else {
                        AP0141_ui_CreatureX = L0165_i_CreaturePaddingPixelCount + (L0136_i_ByteWidth - AL0127_i_X - 1);
                }
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                F0132_VIDEO_Blit(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0145_auc_Box, AP0141_ui_CreatureX, 0, M077_NORMALIZED_BYTE_WIDTH(L0136_i_ByteWidth), C112_BYTE_WIDTH_VIEWPORT, L0162_i_TransparentColor);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0132_VIDEO_Blit(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0145_auc_Box, AP0141_ui_CreatureX, 0, M077_NORMALIZED_BYTE_WIDTH(L0136_i_ByteWidth), C112_BYTE_WIDTH_VIEWPORT, L0162_i_TransparentColor, L0137_i_Height, 136);
#endif
                T0115126_CreatureNotVisible:
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                if ((P0145_i_ViewSquareIndex >= M603_VIEW_SQUARE_D2C) && (P0145_i_ViewSquareIndex < M606_VIEW_SQUARE_D1C)) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                if (L2475_i_ViewDepth == 2) {
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        L0171_B_UseCreatureSpecialD2FrontBitmap = M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0080_SPECIAL_D2_FRONT) && !L0169_B_UseCreatureSideBitmap && !L0170_B_UseCreatureBackBitmap && !L0172_B_UseCreatureAttackBitmap;
                } else {
                        L0171_B_UseCreatureSpecialD2FrontBitmap = C0_FALSE;
                }
                if ((L0169_B_UseCreatureSideBitmap && (L0157_i_CreatureDirectionDelta == 1)) || (L0172_B_UseCreatureAttackBitmap && M007_GET(L0159_i_CreatureAspect, MASK0x0040_FLIP_BITMAP)) || (L0171_B_UseCreatureSpecialD2FrontBitmap && M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0100_SPECIAL_D2_FRONT_IS_FLIPPED_FRONT)) || (L0173_B_UseFlippedHorizontallyCreatureFrontImage && M007_GET(AP0141_ui_CreatureGraphicInfo, MASK0x0004_FLIP_NON_ATTACK))) {
                        L0143_B_FlipHorizontal = MASK0x0001_FLIP_HORIZONTAL;
                } else {
                        L0143_B_FlipHorizontal = MASK0x0000_NO_FLIP;
                }
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                if (P0145_i_ViewSquareIndex >= M606_VIEW_SQUARE_D1C) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                if (L2475_i_ViewDepth <= 1) {
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        AL0150_ui_ShiftSetIndex = C0_SHIFT_SET_D0_BACK_OR_D1_FRONT;
                        L0162_i_TransparentColor = M072_TRANSPARENT_COLOR((CREATURE_ASPECT*)L0129_ps_ObjectAspect);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        AL0128_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(AL0127_i_NativeBitmapIndex);
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        AL0128_puc_Bitmap = F1005_(AL0127_i_NativeBitmapIndex, L2478_i_DerivedBitmapIndex, L0143_B_FlipHorizontal);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                } else {
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        if ((L2478_i_DerivedBitmapIndex != CM1_DERIVED_BITMAP_NONE) && L0173_B_UseFlippedHorizontallyCreatureFrontImage) {
                                L2478_i_DerivedBitmapIndex++;
                        }
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        if (P0145_i_ViewSquareIndex >= M603_VIEW_SQUARE_D2C) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        if (L2475_i_ViewDepth == 2) {
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                L0134_i_DerivedBitmapIndex++;
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                                if (L2478_i_DerivedBitmapIndex != CM1_DERIVED_BITMAP_NONE) {
                                        L2478_i_DerivedBitmapIndex++;
                                }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                AL0150_ui_ShiftSetIndex = C1_SHIFT_SET_D1_BACK_OR_D2_FRONT;
                                L0131_puc_PaletteChanges = G0222_auc_Graphic558_PaletteChanges_Creature_D2;
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                L0176_i_Scale = C20_SCALE_;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                L0176_i_Scale = C21_SCALE_;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        } else {
                                AL0150_ui_ShiftSetIndex = C2_SHIFT_SET_D2_BACK_OR_D3_FRONT;
                                L0131_puc_PaletteChanges = G0221_auc_Graphic558_PaletteChanges_Creature_D3;
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                L0176_i_Scale = C16_SCALE_;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                L0176_i_Scale = C14_SCALE_;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        }
#endif
#ifdef MEDIA489_F20E_F20J_P20JA_P20JB
                        L0162_i_TransparentColor = L0131_puc_PaletteChanges[M072_TRANSPARENT_COLOR((CREATURE_ASPECT*)L0129_ps_ObjectAspect)] / 10;
#endif
#ifdef MEDIA609_X30J_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        L0162_i_TransparentColor = L0131_puc_PaletteChanges[M072_TRANSPARENT_COLOR((CREATURE_ASPECT*)L0129_ps_ObjectAspect)];
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        AL0128_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(AL0127_i_NativeBitmapIndex, L0134_i_DerivedBitmapIndex, L0176_i_Scale, L0176_i_Scale, L0131_puc_PaletteChanges);
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        AL0128_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(AL0127_i_NativeBitmapIndex, L2478_i_DerivedBitmapIndex, L0143_B_FlipHorizontal, L0134_i_DerivedBitmapIndex, L0176_i_Scale, L0176_i_Scale, L0131_puc_PaletteChanges);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                }
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                L2474_i_ZoneIndex = (C3200_ZONE_ | MASK0x8000_SHIFT_OBJECTS_AND_CREATURES) + (M071_COORDINATE_SET((CREATURE_ASPECT*)L0129_ps_ObjectAspect) * 55) + (P0145_i_ViewSquareIndex * 5) + AL0126_i_ViewCell;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                L2474_i_ZoneIndex = (C3200_ZONE_ | MASK0x8000_SHIFT_OBJECTS_AND_CREATURES) + (M071_COORDINATE_SET((CREATURE_ASPECT*)L0129_ps_ObjectAspect) * 65) + (L2477_i_ * 5) + AL0126_i_ViewCell;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                G2154_i_ZoneShiftX = G0223_aac_Graphic558_ShiftSets[AL0150_ui_ShiftSetIndex][M022_HORIZONTAL_OFFSET(L0159_i_CreatureAspect)]; /* ANOMALY_FMT ebx bx usage */
                G2155_i_ZoneShiftY = G0223_aac_Graphic558_ShiftSets[AL0150_ui_ShiftSetIndex][M023_VERTICAL_OFFSET(L0159_i_CreatureAspect)]; /* ANOMALY_FMT ebx bx usage */
#ifdef MEDIA488_F20E_F20J
                                _inline(0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90);
#endif
#ifdef MEDIA670_F31E_F31J
                                _inline(0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90);
#endif
                F0791_DUNGEONVIEW_DrawBitmapXX(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, L2474_i_ZoneIndex, L0143_B_FlipHorizontal, L0162_i_TransparentColor);
#ifdef MEDIA670_F31E_F31J
                                _inline(0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90);
#endif
#endif
#ifdef MEDIA744_A36M
                T0115xxx: /* Unreferenced label but required for D36M */
#endif
                if (L0167_B_TwoHalfSquareCreaturesFrontView) {
                        L0167_B_TwoHalfSquareCreaturesFrontView = C0_FALSE;
                        L0159_i_CreatureAspect = L0153_ps_ActiveGroup->Aspect[!L0161_i_CreatureIndex]; /* Aspect of the other creature in the pair */
                        if (AL0126_i_ViewCell == C01_VIEW_CELL_RIGHT_COLUMN) {
                                AL0126_i_ViewCell = C00_VIEW_CELL_LEFT_COLUMN;
                        } else {
                                AL0126_i_ViewCell = C01_VIEW_CELL_RIGHT_COLUMN;
                        }
                        goto T0115077_DrawSecondHalfSquareCreature;
                }
/* Draw projectiles */
                T0115129_DrawProjectiles:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                if (!L0186_B_SquareHasProjectile || ((P0145_i_ViewSquareIndex = AL0147_ui_ViewSquareIndexBackup) > M609_VIEW_SQUARE_D0C) || (!(L0180_i_ProjectileX = G0218_aaaauc_Graphic558_ObjectCoordinateSets[0][P0145_i_ViewSquareIndex][AL0126_i_ViewCell = L0187_ui_CurrentViewCellToDraw][C0_X]))) /* If there is no projectile to draw or if projectiles are not visible on the specified square or on the cell being drawn */
                        continue;
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                P0145_i_ViewSquareIndex = AL0147_ui_ViewSquareIndexBackup; /* Restore value as it may have been modified while drawing a creature */
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                AL0126_i_ViewCell = L0187_ui_CurrentViewCellToDraw;
                if (!L0186_B_SquareHasProjectile)
                        continue;
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                if ((P0145_i_ViewSquareIndex <= M602_VIEW_SQUARE_D3R) && (AL0126_i_ViewCell <= C01_VIEW_CELL_RIGHT_COLUMN))
                        continue;
                if (P0145_i_ViewSquareIndex > M609_VIEW_SQUARE_D0C)
                        continue;
                if ((P0145_i_ViewSquareIndex == M609_VIEW_SQUARE_D0C) && (AL0126_i_ViewCell >= C02_VIEW_CELL_BACK_RIGHT))
                        continue;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                if ((L2479_i_ = G2028_ac_ViewSquareIndexTo[P0145_i_ViewSquareIndex]) < 0) {
                        L0186_B_SquareHasProjectile = C0_FALSE;
                        continue;
                }
                if ((L2475_i_ViewDepth == 3) && (AL0126_i_ViewCell <= C01_VIEW_CELL_FRONT_RIGHT)) {
                        continue;
                }
                if ((L2475_i_ViewDepth == 0) && (AL0126_i_ViewCell >= C02_VIEW_CELL_BACK_RIGHT)) {
                        continue;
                }
#endif
                P0141_T_Thing = L0146_T_FirstThingToDraw; /* Restart processing list of objects from the beginning. The next loop draws only projectile objects among the list */
                do {
                        if ((M012_TYPE(P0141_T_Thing) == C14_THING_TYPE_PROJECTILE) && (M011_CELL(P0141_T_Thing) == L0139_i_Cell)) {
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                L2474_i_ZoneIndex = C2900_ZONE_ + ((unsigned int16_t)L2479_i_ * 4) + AL0126_i_ViewCell;
#endif
#ifdef MEDIA001_S10EA_S10EB /* CHANGE2_01_OPTIMIZATION Inline code replaced by function calls */
                                L0178_ps_Projectile = &((PROJECTILE*)G0284_apuc_ThingData[C14_THING_TYPE_PROJECTILE])[M013_INDEX(P0141_T_Thing)];
#endif
#ifdef MEDIA227_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J /* CHANGE2_01_OPTIMIZATION Inline code replaced by function calls */
                                L0178_ps_Projectile = (PROJECTILE*)F0156_DUNGEON_GetThingData(P0141_T_Thing);
#endif
                                if ((AL0127_i_ProjectileAspect = F0142_DUNGEON_GetProjectileAspect(L0178_ps_Projectile->Slot)) < 0) { /* Negative value: projectile aspect is the ordinal of a PROJECTIL_ASPECT */
                                        L0129_ps_ObjectAspect = (OBJECT_ASPECT*)&G0210_as_Graphic558_ProjectileAspects[M001_ORDINAL_TO_INDEX(-AL0127_i_ProjectileAspect)];
                                        AL0127_i_NativeBitmapIndex = ((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->FirstNativeBitmapRelativeIndex + M613_GRAPHIC_FIRST_PROJECTILE;
                                        L0182_i_ProjectileAspectType = M007_GET(((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->GraphicInfo, MASK0x0003_ASPECT_TYPE);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                        if (((L0184_B_DoNotScaleWithKineticEnergy = !M007_GET(((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->GraphicInfo, MASK0x0100_SCALE_WITH_KINETIC_ENERGY)) || (L0178_ps_Projectile->KineticEnergy == 255)) && (P0145_i_ViewSquareIndex == M609_VIEW_SQUARE_D0C)) {
                                                L0176_i_Scale = 0; /* Use native bitmap without resizing */
                                                L0136_i_ByteWidth = ((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->ByteWidth;
                                                L0137_i_Height = ((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->Height;
                                        } else {
                                                AL0150_ui_ProjectileScaleIndex = ((P0145_i_ViewSquareIndex / 3) << 1) + (AL0126_i_ViewCell >> 1);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                        if ((((L0184_B_DoNotScaleWithKineticEnergy = !M007_GET(((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->GraphicInfo, MASK0x0100_SCALE_WITH_KINETIC_ENERGY)) != 0) || (L0178_ps_Projectile->KineticEnergy == 255)) && (P0145_i_ViewSquareIndex == M609_VIEW_SQUARE_D0C)) {
                                                L0176_i_Scale = C32_SCALE_D1; /* Use native bitmap without resizing */
                                        } else {
                                                AL0150_ui_ProjectileScaleIndex = ((P0145_i_ViewSquareIndex / 3) << 1) + (AL0126_i_ViewCell >> 1);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                        if ((((L0184_B_DoNotScaleWithKineticEnergy = !M007_GET(((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->GraphicInfo, MASK0x0100_SCALE_WITH_KINETIC_ENERGY)) != 0) || (L0178_ps_Projectile->KineticEnergy == 255)) && (L2475_i_ViewDepth == 0)) {
                                                L0176_i_Scale = C32_SCALE_D1; /* Use native bitmap without resizing */
                                        } else {
                                                AL0150_ui_ProjectileScaleIndex = (L2475_i_ViewDepth << 1) - (AL0126_i_ViewCell >> 1);
#endif
                                                L0176_i_Scale = G0215_auc_Graphic558_ProjectileScales[AL0150_ui_ProjectileScaleIndex];
                                                if (!L0184_B_DoNotScaleWithKineticEnergy) {
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
                                                        L0176_i_Scale = (L0176_i_Scale * F0025_MAIN_GetMaximumValue(96, L0178_ps_Projectile->KineticEnergy + 1)) >> 8;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                        L0176_i_Scale = F0025_MAIN_GetMaximumValue(2, (L0176_i_Scale * F0025_MAIN_GetMaximumValue(96, L0178_ps_Projectile->KineticEnergy + 1)) >> 8);
#endif
                                                }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                L0136_i_ByteWidth = M078_SCALED_DIMENSION(((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->ByteWidth, L0176_i_Scale);
                                                L0137_i_Height = M078_SCALED_DIMENSION(((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->Height, L0176_i_Scale);
#endif
                                        }
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                        L0143_B_FlipHorizontal = C0_FALSE;
#endif
                                        if (L0189_B_ProjectileAspectTypeHasBackGraphicAndRotation = (L0182_i_ProjectileAspectType == C0_PROJECTILE_ASPECT_TYPE_HAS_BACK_GRAPHIC_AND_ROTATION)) {
                                                L0188_B_ProjectileFlipVertical = ((P0143_i_MapX + P0144_i_MapY) & 0x0001);
                                        }
                                        if (L0182_i_ProjectileAspectType == C3_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_NO_ROTATION) {
                                                L0183_i_ProjectileBitmapIndexDelta = 0;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                L0190_B_FlipVertical = L0143_B_FlipHorizontal = C0_FALSE;
#endif
                                        } else {
                                                if (M016_IS_ORIENTED_WEST_EAST(L0181_i_ProjectileDirection = G0370_ps_Events[L0178_ps_Projectile->EventIndex].C.Projectile.Direction) != M016_IS_ORIENTED_WEST_EAST(P0142_i_Direction)) {
                                                        if (L0182_i_ProjectileAspectType == C2_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_ROTATION) {
                                                                L0183_i_ProjectileBitmapIndexDelta = 1;
                                                        } else {
                                                                L0183_i_ProjectileBitmapIndexDelta = 2;
                                                        }
                                                        if (L0189_B_ProjectileAspectTypeHasBackGraphicAndRotation) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                                L0143_B_FlipHorizontal = !AL0126_i_ViewCell || (AL0126_i_ViewCell == C03_VIEW_CELL_BACK_LEFT);
                                                                if (!(L0190_B_FlipVertical = L0188_B_ProjectileFlipVertical)) {
                                                                        L0143_B_FlipHorizontal = !L0143_B_FlipHorizontal;
                                                                }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                                if (!AL0126_i_ViewCell || (AL0126_i_ViewCell == C03_VIEW_CELL_BACK_LEFT)) {
                                                                        L0143_B_FlipHorizontal |= MASK0x0001_FLIP_HORIZONTAL;
                                                                }
                                                                if (L0188_B_ProjectileFlipVertical) {
                                                                        L0143_B_FlipHorizontal |= MASK0x0002_FLIP_VERTICAL;
                                                                } else {
                                                                        L0143_B_FlipHorizontal ^= MASK0x0001_FLIP_HORIZONTAL;
                                                                }
#endif
                                                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                                L0190_B_FlipVertical = C0_FALSE;
                                                                L0143_B_FlipHorizontal = (M017_NEXT(P0142_i_Direction) == L0181_i_ProjectileDirection);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                                if (M017_NEXT(P0142_i_Direction) == L0181_i_ProjectileDirection) {
#ifdef PC_FIX_CODE_SIZE
        AL0127_i_ThingType++;
        AL0127_i_ThingType++;
        AL0127_i_ThingType = 53;
#endif
                                                                        L0143_B_FlipHorizontal |= MASK0x0001_FLIP_HORIZONTAL;
                                                                }
#endif
                                                        }
                                                } else {
                                                        if ((L0182_i_ProjectileAspectType >= C2_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_ROTATION) || ((L0182_i_ProjectileAspectType == C1_PROJECTILE_ASPECT_TYPE_HAS_BACK_GRAPHIC_AND_NO_ROTATION) && (L0181_i_ProjectileDirection != P0142_i_Direction)) || (L0189_B_ProjectileAspectTypeHasBackGraphicAndRotation && L0188_B_ProjectileFlipVertical)) { /* If the projectile does not have a back graphic or has one but is not seen from the back or if it has a back graphic and rotation and should be flipped vertically */
                                                                L0183_i_ProjectileBitmapIndexDelta = 0;
                                                        } else {
                                                                L0183_i_ProjectileBitmapIndexDelta = 1;
                                                        }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                        L0190_B_FlipVertical = L0189_B_ProjectileAspectTypeHasBackGraphicAndRotation && (AL0126_i_ViewCell < C02_VIEW_CELL_BACK_RIGHT);
                                                        L0143_B_FlipHorizontal = M007_GET(((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->GraphicInfo, MASK0x0010_SIDE) && !((L0138_i_ViewLane == C2_VIEW_LANE_RIGHT) || (!L0138_i_ViewLane && ((AL0126_i_ViewCell == C01_VIEW_CELL_FRONT_RIGHT) || (AL0126_i_ViewCell == C02_VIEW_CELL_BACK_RIGHT))));
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                        if (L0189_B_ProjectileAspectTypeHasBackGraphicAndRotation && (AL0126_i_ViewCell < C02_VIEW_CELL_BACK_RIGHT)) {
                                                                L0143_B_FlipHorizontal |= MASK0x0002_FLIP_VERTICAL;
                                                        }
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                                        if (M007_GET(((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->GraphicInfo, MASK0x0010_SIDE) && !((L0138_i_ViewLane == C2_VIEW_LANE_RIGHT) || (!L0138_i_ViewLane && ((AL0126_i_ViewCell == C01_VIEW_CELL_FRONT_RIGHT) || (AL0126_i_ViewCell == C02_VIEW_CELL_BACK_RIGHT))))) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                        if (M007_GET(((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->GraphicInfo, MASK0x0010_SIDE) && !((L0138_i_ViewLane >= 1) || ((L0138_i_ViewLane == 0) && ((AL0126_i_ViewCell == C01_VIEW_CELL_FRONT_RIGHT) || (AL0126_i_ViewCell == C02_VIEW_CELL_BACK_RIGHT))))) {
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                                L0143_B_FlipHorizontal |= MASK0x0001_FLIP_HORIZONTAL;
                                                        }
#endif
                                                }
                                        }
                                        AL0127_i_NativeBitmapIndex += L0183_i_ProjectileBitmapIndexDelta;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                        L0140_i_PaddingPixelCount = 0;
                                        if (!L0176_i_Scale) {
                                                AL0128_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(AL0127_i_NativeBitmapIndex);
                                        } else {
                                                if (L0143_B_FlipHorizontal) {
                                                        L0140_i_PaddingPixelCount = (7 - ((L0136_i_ByteWidth - 1) & 0x0007)) << 1;
                                                }
                                                if (L0184_B_DoNotScaleWithKineticEnergy && F0491_CACHE_IsDerivedBitmapInCache(L0134_i_DerivedBitmapIndex = M537_DERIVED_BITMAP_FIRST_PROJECTILE + ((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->FirstDerivedBitmapRelativeIndex + (L0183_i_ProjectileBitmapIndexDelta * 6) + AL0150_ui_ProjectileScaleIndex)) {
                                                        AL0128_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(L0134_i_DerivedBitmapIndex);
                                                } else {
                                                        L0132_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(AL0127_i_NativeBitmapIndex);
                                                        if (L0184_B_DoNotScaleWithKineticEnergy) {
                                                                AL0128_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(L0134_i_DerivedBitmapIndex);
                                                        } else {
                                                                AL0128_puc_Bitmap = G0074_puc_Bitmap_Temporary;
                                                        }
                                                        F0129_VIDEO_BlitShrinkWithPaletteChanges(L0132_puc_Bitmap, AL0128_puc_Bitmap, ((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->ByteWidth << 1, ((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->Height, L0136_i_ByteWidth << 1, L0137_i_Height, G0075_apuc_PaletteChanges_Projectile[AL0150_ui_ProjectileScaleIndex >> 1]);
                                                        if (L0184_B_DoNotScaleWithKineticEnergy) {
                                                                F0493_CACHE_AddDerivedBitmap(L0134_i_DerivedBitmapIndex);
                                                        }
                                                }
                                        }
                                        if (L0143_B_FlipHorizontal || L0190_B_FlipVertical) {
                                                AL0127_i_NormalizedByteWidth = M077_NORMALIZED_BYTE_WIDTH(L0136_i_ByteWidth);
                                                if (AL0128_puc_Bitmap != G0074_puc_Bitmap_Temporary) {
                                                        F0007_MAIN_CopyBytes(AL0128_puc_Bitmap, G0074_puc_Bitmap_Temporary, AL0127_i_NormalizedByteWidth * L0137_i_Height);
                                                        AL0128_puc_Bitmap = G0074_puc_Bitmap_Temporary;
                                                }
                                                if (L0190_B_FlipVertical) {
                                                        F0131_VIDEO_FlipVertical(AL0128_puc_Bitmap, AL0127_i_NormalizedByteWidth, L0137_i_Height);
                                                }
                                                if (L0143_B_FlipHorizontal) {
                                                        F0130_VIDEO_FlipHorizontal(AL0128_puc_Bitmap, AL0127_i_NormalizedByteWidth, L0137_i_Height);
                                                }
                                        }
                                        M771_BOX_BOTTOM(L0145_auc_Box) = (L0137_i_Height >> 1) + 47;
                                        M770_BOX_TOP(L0145_auc_Box) = 47 - (L0137_i_Height >> 1) + !(L0137_i_Height & 0x0001);
                                        M769_BOX_RIGHT(L0145_auc_Box) = F0024_MAIN_GetMinimumValue(223, L0180_i_ProjectileX + L0136_i_ByteWidth);
                                        if (M768_BOX_LEFT(L0145_auc_Box) = F0025_MAIN_GetMaximumValue(0, L0180_i_ProjectileX - L0136_i_ByteWidth + 1)) {
                                                if (L0143_B_FlipHorizontal) {
                                                        AL0127_i_X = L0140_i_PaddingPixelCount;
                                                } else {
                                                        AL0127_i_X = 0;
                                                }
                                        } else {
                                                AL0127_i_X = F0025_MAIN_GetMaximumValue(L0140_i_PaddingPixelCount, L0136_i_ByteWidth - L0180_i_ProjectileX - 1); /* BUG0_06 Graphical glitch when drawing projectiles or explosions. If a projectile or explosion bitmap is cropped because it is only partly visible on the left side of the viewport (M768_BOX_LEFT(L0145_auc_Box) = 0) and the bitmap is flipped horizontally (L0143_B_FlipHorizontal = C1_TRUE) then a wrong part of the bitmap is drawn on screen. To fix this bug, "+ L0140_i_PaddingPixelCount" must be added to the second parameter of this function call */

                                        }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                        L0134_i_DerivedBitmapIndex = CM1_DERIVED_BITMAP_NONE;
                                        if (L0176_i_Scale == C32_SCALE_D1) {
                                                L0131_puc_PaletteChanges = NULL;
                                        } else {
                                                L0131_puc_PaletteChanges = G0075_apuc_PaletteChanges_Projectile[AL0150_ui_ProjectileScaleIndex >> 1];
                                                if (L0184_B_DoNotScaleWithKineticEnergy) {
                                                        L0134_i_DerivedBitmapIndex = M537_DERIVED_BITMAP_FIRST_PROJECTILE + ((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->FirstDerivedBitmapRelativeIndex + (L0183_i_ProjectileBitmapIndexDelta * 6) + AL0150_ui_ProjectileScaleIndex;
                                                }
                                        }
#endif
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                                        F0132_VIDEO_Blit(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0145_auc_Box, AL0127_i_X, 0, M077_NORMALIZED_BYTE_WIDTH(L0136_i_ByteWidth), C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                        F0132_VIDEO_Blit(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0145_auc_Box, AL0127_i_X, 0, M077_NORMALIZED_BYTE_WIDTH(L0136_i_ByteWidth), C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH, L0137_i_Height, C136_HEIGHT_VIEWPORT);
#endif
#ifdef MEDIA458_P20JA_P20JB
                                        F0791_DUNGEONVIEW_DrawBitmapXX(F0675_DUNGEONVIEW_GetScaledBitmap(AL0127_i_NativeBitmapIndex, L0134_i_DerivedBitmapIndex, L0176_i_Scale, L0176_i_Scale, L0131_puc_PaletteChanges), G0296_puc_Bitmap_Viewport, (P0145_i_ViewSquareIndex * 4) + AL0126_i_ViewCell + C2900_ZONE_, L0143_B_FlipHorizontal, C10_COLOR_FLESH);
#endif
#ifdef MEDIA506_F20E_F20J_X30J
                                        F0791_DUNGEONVIEW_DrawBitmapXX(F0675_DUNGEONVIEW_GetScaledBitmap(AL0127_i_NativeBitmapIndex, CM1_DERIVED_BITMAP_NONE, L0143_B_FlipHorizontal, L0134_i_DerivedBitmapIndex, L0176_i_Scale, L0176_i_Scale, L0131_puc_PaletteChanges), G0296_puc_Bitmap_Viewport, C2900_ZONE_ + (P0145_i_ViewSquareIndex * 4) + AL0126_i_ViewCell, L0143_B_FlipHorizontal, C10_COLOR_FLESH);
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                                        F0791_DUNGEONVIEW_DrawBitmapXX(F0675_DUNGEONVIEW_GetScaledBitmap(AL0127_i_NativeBitmapIndex, L0134_i_DerivedBitmapIndex, L0176_i_Scale, L0176_i_Scale, L0131_puc_PaletteChanges), G0296_puc_Bitmap_Viewport, L2474_i_ZoneIndex, L0143_B_FlipHorizontal, C10_COLOR_FLESH);
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                                        F0791_DUNGEONVIEW_DrawBitmapXX(F0675_DUNGEONVIEW_GetScaledBitmap(AL0127_i_NativeBitmapIndex, CM1_DERIVED_BITMAP_NONE, L0143_B_FlipHorizontal, L0134_i_DerivedBitmapIndex, L0176_i_Scale, L0176_i_Scale, L0131_puc_PaletteChanges), G0296_puc_Bitmap_Viewport, L2474_i_ZoneIndex, L0143_B_FlipHorizontal, C10_COLOR_FLESH);
#endif
                                } else { /* Positive value: projectile aspect is the index of a OBJECT_ASPECT */
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                        L2474_i_ZoneIndex = C2900_ZONE_;
#endif
                                        L0142_B_UseAlcoveObjectImage = C0_FALSE;
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                        L0179_auc_ProjectileCoordinates[C0_X] = L0180_i_ProjectileX;
                                        L0179_auc_ProjectileCoordinates[C1_Y] = 47;
                                        L0133_puc_CoordinateSet = L0179_auc_ProjectileCoordinates;
                                        L0129_ps_ObjectAspect = &G0209_as_Graphic558_ObjectAspects[AL0127_i_ProjectileAspect];
                                        AL0127_i_NativeBitmapIndex = L0129_ps_ObjectAspect->FirstNativeBitmapRelativeIndex + M612_GRAPHIC_FIRST_OBJECT;
#endif
                                        L0185_B_DrawProjectileAsObject = C1_TRUE;
                                        goto T0115015_DrawProjectileAsObject; /* Go to code section to draw an object. Once completed, it jumps back to T0115171_BackFromT0115015_DrawProjectileAsObject below */
                                }
                        }
                        T0115171_BackFromT0115015_DrawProjectileAsObject: ;
                } while ((P0141_T_Thing = F0159_DUNGEON_GetNextThing(P0141_T_Thing)) != C0xFFFE_THING_ENDOFLIST);
#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
                if (L0199_B_ProceedToNextState_CPSF) { /* If G0069_ui_State_CPSF = 10 or 11 */
                        L0199_B_ProceedToNextState_CPSF = C0_FALSE;
                        if ((G0069_ui_State_CPSF += 6) > 16) {
                                G0069_ui_State_CPSF -= 3;
                        }
                } /* If G0069_ui_State_CPSF was 10 it is now 16, if it was 11 it is now 13 */
#endif
#endif
        } while (L0130_ul_RemainingViewCellOrdinalsToProcess);
/* Draw explosions */
        if (!L0195_B_SquareHasExplosion)
                goto T0115214_Return;
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        L2480_i_ = G2034_ac_ViewSquareIndexTo[P0145_i_ViewSquareIndex];
        L2482_i_FieldAspectIndex = G2035_ac_ViewSquareIndexToFieldAspectIndex[P0145_i_ViewSquareIndex];
        if ((L2480_i_ < 0) && (L2482_i_FieldAspectIndex < 0)) {
                return;
        }
#endif
        L0192_ps_FluxcageExplosion = NULL;
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        AP0145_i_ViewSquareExplosionIndex = AL0147_ui_ViewSquareIndexBackup + 3; /* Convert square index to square index for explosions */
        AL0147_ui_ExplosionScaleIndex = AP0145_i_ViewSquareExplosionIndex / 3;
#endif
        P0141_T_Thing = L0146_T_FirstThingToDraw; /* Restart processing list of things from the beginning. The next loop draws only explosion things among the list */
        do {
                if (M012_TYPE(P0141_T_Thing) == C15_THING_TYPE_EXPLOSION) {
                        AL0126_i_Cell = M011_CELL(P0141_T_Thing);
#ifdef MEDIA002_S10EA_S10EB_S11E /* CHANGE3_02_OPTIMIZATION Inline code replaced by function calls */
                        L0191_ps_Explosion = &((EXPLOSION*)G0284_apuc_ThingData[C15_THING_TYPE_EXPLOSION])[M013_INDEX(P0141_T_Thing)];
#endif
#ifdef MEDIA240_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J /* CHANGE3_02_OPTIMIZATION Inline code replaced by function calls */
                        L0191_ps_Explosion = (EXPLOSION*)F0156_DUNGEON_GetThingData(P0141_T_Thing);
#endif
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
                        if ((L0196_B_RebirthExplosion = ((AL0127_i_ExplosionType = L0191_ps_Explosion->Type) >= C100_EXPLOSION_REBIRTH_STEP1)) && ((AP0145_i_ViewSquareExplosionIndex < C03_VIEW_SQUARE_D3C_EXPLOSION) || (AP0145_i_ViewSquareExplosionIndex > C09_VIEW_SQUARE_D1C_EXPLOSION) || (AL0126_i_Cell != L0139_i_Cell))) /* If explosion is rebirth and is not visible */
#endif
#ifdef MEDIA358_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
                        if ((L0196_B_RebirthExplosion = ((AL0127_i_ExplosionType = L0191_ps_Explosion->Type) >= (unsigned int16_t)C100_EXPLOSION_REBIRTH_STEP1)) && ((AP0145_i_ViewSquareExplosionIndex < C03_VIEW_SQUARE_D3C_EXPLOSION) || (AP0145_i_ViewSquareExplosionIndex > C09_VIEW_SQUARE_D1C_EXPLOSION) || (AL0126_i_Cell != L0139_i_Cell))) /* If explosion is rebirth and is not visible */
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        if (((L0196_B_RebirthExplosion = ((AL0127_i_ExplosionType = L0191_ps_Explosion->Type) >= (unsigned int16_t)C100_EXPLOSION_REBIRTH_STEP1))) && ((L2476_i_ < 0) || (AL0126_i_Cell != L0139_i_Cell))) /* If explosion is rebirth and is not visible */
#endif
                                continue;
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        L0143_B_FlipHorizontal = M004_RANDOM(4);
#endif
                        L0197_B_Smoke = C0_FALSE;
                        if ((AL0127_i_ExplosionType == C000_EXPLOSION_FIREBALL) || (AL0127_i_ExplosionType == C002_EXPLOSION_LIGHTNING_BOLT) || (AL0127_i_ExplosionType == C101_EXPLOSION_REBIRTH_STEP2)) {
                                AL0127_i_ExplosionAspectIndex = C0_EXPLOSION_ASPECT_FIRE;
                        } else {
                                if ((AL0127_i_ExplosionType == C006_EXPLOSION_POISON_BOLT) || (AL0127_i_ExplosionType == C007_EXPLOSION_POISON_CLOUD)) {
                                        AL0127_i_ExplosionAspectIndex = C2_EXPLOSION_ASPECT_POISON;
                                } else {
                                        if (AL0127_i_ExplosionType == C040_EXPLOSION_SMOKE) {
                                                L0197_B_Smoke = C1_TRUE;
                                                AL0127_i_ExplosionAspectIndex = C3_EXPLOSION_ASPECT_SMOKE;
                                        } else {
                                                if (AL0127_i_ExplosionType == C100_EXPLOSION_REBIRTH_STEP1) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                        L0129_ps_ObjectAspect = (OBJECT_ASPECT*)&G0210_as_Graphic558_ProjectileAspects[M001_ORDINAL_TO_INDEX(-F0142_DUNGEON_GetProjectileAspect(C0xFF82_THING_EXPLOSION_LIGHTNING_BOLT))];
                                                        AL0128_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->FirstNativeBitmapRelativeIndex + (M613_GRAPHIC_FIRST_PROJECTILE + 1));
                                                        L0193_pi_ExplosionCoordinates = G0228_aai_Graphic558_RebirthStep1ExplosionCoordinates[AP0145_i_ViewSquareExplosionIndex - 3];
                                                        L0136_i_ByteWidth = M078_SCALED_DIMENSION((((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->ByteWidth), L0193_pi_ExplosionCoordinates[C2_SCALE]);
                                                        L0137_i_Height = M078_SCALED_DIMENSION((((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->Height), L0193_pi_ExplosionCoordinates[C2_SCALE]);
                                                        if (AP0145_i_ViewSquareExplosionIndex != C09_VIEW_SQUARE_D1C_EXPLOSION) {
                                                                F0129_VIDEO_BlitShrinkWithPaletteChanges(AL0128_puc_Bitmap, G0074_puc_Bitmap_Temporary, ((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->ByteWidth << 1, ((PROJECTIL_ASPECT*)L0129_ps_ObjectAspect)->Height, L0136_i_ByteWidth << 1, L0137_i_Height, G0017_auc_Graphic562_PaletteChanges_NoChanges);
                                                                AL0128_puc_Bitmap = G0074_puc_Bitmap_Temporary;
                                                        }
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                        AL0127_i_NativeBitmapIndex = G0210_as_Graphic558_ProjectileAspects[M001_ORDINAL_TO_INDEX(-F0142_DUNGEON_GetProjectileAspect(C0xFF82_THING_EXPLOSION_LIGHTNING_BOLT))].FirstNativeBitmapRelativeIndex + (M613_GRAPHIC_FIRST_PROJECTILE + 1);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                                        L0194_i_ExplosionScale = G2037_auc_RebirthStep1ExplosionScale[AP0145_i_ViewSquareExplosionIndex - 3];
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                        L0194_i_ExplosionScale = G2037_auc_RebirthStep1ExplosionScale[L2476_i_];
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                                                        AL0128_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(AL0127_i_NativeBitmapIndex, CM1_DERIVED_BITMAP_NONE, L0194_i_ExplosionScale, L0194_i_ExplosionScale, NULL);
#endif
#ifdef MEDIA548_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                                                        AL0128_puc_Bitmap = F0675_DUNGEONVIEW_GetScaledBitmap(AL0127_i_NativeBitmapIndex, CM1_DERIVED_BITMAP_NONE, L0143_B_FlipHorizontal, CM1_DERIVED_BITMAP_NONE, L0194_i_ExplosionScale, L0194_i_ExplosionScale, NULL);
#endif
#ifdef MEDIA579_X30J_P20JA_P20JB
                                                        L2474_i_ZoneIndex = C3000_ZONE_ + (unsigned int16_t)(AP0145_i_ViewSquareExplosionIndex - 3);
#endif
#ifdef MEDIA488_F20E_F20J
                                                        L2474_i_ZoneIndex = AP0145_i_ViewSquareExplosionIndex + C3000_ZONE_ - 3;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                        L2474_i_ZoneIndex = C3000_ZONE_ + L2476_i_;
#endif
                                                        goto T0115200_DrawExplosion;
                                                }
#ifdef MEDIA365_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J /* ANOMALY_ST_BRANCH */
                                                else {
#endif
                                                        if (AL0127_i_ExplosionType == C050_EXPLOSION_FLUXCAGE) {
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
                                                                if (AP0145_i_ViewSquareExplosionIndex >= C04_VIEW_SQUARE_D3L_EXPLOSION) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                                if (L2475_i_ViewDepth < 4) {
#endif
                                                                        L0192_ps_FluxcageExplosion = L0191_ps_Explosion;
                                                                }
                                                                continue;
                                                        }
#ifdef MEDIA365_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J /* ANOMALY_ST_BRANCH */
                                                        else {
#endif
                                                                AL0127_i_ExplosionAspectIndex = C1_EXPLOSION_ASPECT_SPELL;
#ifdef MEDIA365_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                        }
                                                }
#endif
                                        }
                                }
                        }
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
                        if (AP0145_i_ViewSquareExplosionIndex == C12_VIEW_SQUARE_D0C_EXPLOSION) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        if (L2480_i_ < 0) {
                                continue;
                        }
                        if (AP0145_i_ViewSquareExplosionIndex == M609_VIEW_SQUARE_D0C) {
#endif
                                if (L0197_B_Smoke) {
                                        AL0127_i_ExplosionAspectIndex--; /* Smoke uses the same graphics as Poison Cloud, but with palette changes */
                                }
                                AL0127_i_ExplosionAspectIndex *= 3; /* 3 graphics per explosion pattern */
                                if (AL0126_i_ExplosionSize = (L0191_ps_Explosion->Attack >> 5)) {
                                        AL0127_i_ExplosionAspectIndex++; /* Use second graphic in the pattern for medium explosion attack */
                                        if (AL0126_i_ExplosionSize > 3) {
                                                AL0127_i_ExplosionAspectIndex++; /* Use third graphic in the pattern for large explosion attack */
                                        }
                                }
                                F0491_CACHE_IsDerivedBitmapInCache(C000_DERIVED_BITMAP_VIEWPORT);
                                AL0128_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(AL0127_i_ExplosionAspectIndex + M636_GRAPHIC_FIRST_EXPLOSION_PATTERN);
                                if (L0197_B_Smoke) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                        F0129_VIDEO_BlitShrinkWithPaletteChanges(AL0128_puc_Bitmap, G0074_puc_Bitmap_Temporary, 48, 32, 48, 32, G0212_auc_Graphic558_PaletteChanges_Smoke);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                        F0663_CopyBitmapWithPaletteChanges(AL0128_puc_Bitmap, G0074_puc_Bitmap_Temporary, G0212_auc_Graphic558_PaletteChanges_Smoke);
#endif
                                        AL0128_puc_Bitmap = G0074_puc_Bitmap_Temporary;
                                }
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                                F0133_VIDEO_BlitBoxFilledWithMaskedBitmap(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, NULL, F0492_CACHE_GetDerivedBitmap(C000_DERIVED_BITMAP_VIEWPORT), G0105_auc_Graphic558_Box_ExplosionPattern_D0C, M004_RANDOM(4) + 87, M003_RANDOM(64), C112_BYTE_WIDTH_VIEWPORT, MASK0x0080_DO_NOT_USE_MASK | C10_COLOR_FLESH, 0, 0);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0133_VIDEO_BlitBoxFilledWithMaskedBitmap(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, NULL, F0492_CACHE_GetDerivedBitmap(C000_DERIVED_BITMAP_VIEWPORT), G0105_auc_Graphic558_Box_ExplosionPattern_D0C, M004_RANDOM(4) + 87, M003_RANDOM(64), C112_BYTE_WIDTH_VIEWPORT, MASK0x0080_DO_NOT_USE_MASK | C10_COLOR_FLESH, 0, 0, 136, 93);
#endif
#ifdef MEDIA525_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_F31E_F31J_X31J_P31J
                                F0133_VIDEO_BlitBoxFilledWithMaskedBitmap(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, NULL, F0492_CACHE_GetDerivedBitmap(C000_DERIVED_BITMAP_VIEWPORT), F0638_GetZone(C004_ZONE_EXPLOSION_PATTERN_D0C, L2481_ai_XYZ), M004_RANDOM(4) + 87, M003_RANDOM(64), G2073_C224_ViewportPixelWidth, MASK0x0080_DO_NOT_USE_MASK | C10_COLOR_FLESH, 0, 0);
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                                F0133_VIDEO_BlitBoxFilledWithMaskedBitmap(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, NULL, F0492_CACHE_GetDerivedBitmap(C000_DERIVED_BITMAP_VIEWPORT), F0638_GetZone(C004_ZONE_EXPLOSION_PATTERN_D0C, L2481_ai_XYZ), M004_RANDOM(4) + 87, M003_RANDOM(64), G2073_C224_ViewportPixelWidth, MASK0x0080_DO_NOT_USE_MASK | C10_COLOR_FLESH, 0, 0, G2074_C136_ViewportHeight, 93);
#endif
                                F0493_CACHE_AddDerivedBitmap(C000_DERIVED_BITMAP_VIEWPORT);
                                F0480_CACHE_ReleaseBlock(C000_DERIVED_BITMAP_VIEWPORT | MASK0x8000_DERIVED_BITMAP);
#ifdef MEDIA067_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_P20JA_P20JB_A31E_A31M_A33M_A35E_A35M_X31J
#ifndef NOCOPYPROTECTION
                                if ((G0031_i_Graphic562_FuzzySectorAnalyzed_CPSE != C00136_TRUE) && (!F0277_CPSE_IsFuzzySectorValid_FuzzyBits(M517_FuzzySectorReadingBuffer_CPSE))) {
                                        G0189_i_Graphic558_StopAddingEvents_CPSE = C00136_TRUE;
                                }
#endif
#endif
                        } else {
                                if (L0196_B_RebirthExplosion) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                        L0193_pi_ExplosionCoordinates = G0227_aai_Graphic558_RebirthStep2ExplosionCoordinates[AP0145_i_ViewSquareExplosionIndex - 3];
                                        L0194_i_ExplosionScale = L0193_pi_ExplosionCoordinates[C2_SCALE];
#endif
#ifdef MEDIA579_X30J_P20JA_P20JB
                                        L2474_i_ZoneIndex = C3007_ZONE_ + (unsigned int16_t)(AP0145_i_ViewSquareExplosionIndex - 3);
#endif
#ifdef MEDIA488_F20E_F20J
                                        L2474_i_ZoneIndex = AP0145_i_ViewSquareExplosionIndex + C3007_ZONE_ - 3;
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                        L0194_i_ExplosionScale = G2036_auc_RebirthStep2ExplosionScale[AP0145_i_ViewSquareExplosionIndex - 3];
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                        L2474_i_ZoneIndex = C3007_ZONE_ + L2476_i_;
                                        L0194_i_ExplosionScale = G2036_auc_RebirthStep2ExplosionScale[L2476_i_];
#endif
                                } else {
                                        if (L0191_ps_Explosion->Centered) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                L0193_pi_ExplosionCoordinates = G0225_aai_Graphic558_CenteredExplosionCoordinates[AP0145_i_ViewSquareExplosionIndex];
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                                L2474_i_ZoneIndex = C3014_ZONE_ + AP0145_i_ViewSquareExplosionIndex; /* G0225_aai_Graphic558_CenteredExplosionCoordinates */
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                L2474_i_ZoneIndex = C3014_ZONE_ + L2480_i_; /* G0225_aai_Graphic558_CenteredExplosionCoordinates */
#endif
                                        } else {
                                                if ((AL0126_i_Cell == P0142_i_Direction) || (AL0126_i_Cell == M020_PREVIOUS(P0142_i_Direction))) {
                                                        AL0126_i_ViewCell = C00_VIEW_CELL_FRONT_LEFT;
                                                } else {
                                                        AL0126_i_ViewCell = C01_VIEW_CELL_FRONT_RIGHT;
                                                }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                                L0193_pi_ExplosionCoordinates = G0226_aaai_Graphic558_ExplosionCoordinates[AP0145_i_ViewSquareExplosionIndex][AL0126_i_ViewCell];
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                                L2474_i_ZoneIndex = C3029_ZONE_ + (AP0145_i_ViewSquareExplosionIndex << 1) + AL0126_i_ViewCell; /* G0226_aaai_Graphic558_ExplosionCoordinates */
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                                L2474_i_ZoneIndex = C3031_ZONE_ + ((unsigned int16_t)L2480_i_ * 2) + AL0126_i_ViewCell; /* G0226_aaai_Graphic558_ExplosionCoordinates */
#endif
                                        }
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
                                        L0194_i_ExplosionScale = F0025_MAIN_GetMaximumValue(4, (F0025_MAIN_GetMaximumValue(48, L0191_ps_Explosion->Attack + 1) * G0216_auc_Graphic558_ExplosionBaseScales[AL0147_ui_ExplosionScaleIndex]) >> 8) & (int16_t)0xFFFE;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                        L0194_i_ExplosionScale = F0025_MAIN_GetMaximumValue(48, L0191_ps_Explosion->Attack + 1) * G0216_auc_Graphic558_ExplosionBaseScales[L2475_i_ViewDepth] >> 8;
#endif
                                }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                AL0128_puc_Bitmap = F0114_DUNGEONVIEW_GetExplosionBitmap(AL0127_i_ExplosionAspectIndex, L0194_i_ExplosionScale, &L0136_i_ByteWidth, &L0137_i_Height);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                AL0128_puc_Bitmap = F0114_DUNGEONVIEW_GetExplosionBitmap(AL0127_i_ExplosionAspectIndex, L0194_i_ExplosionScale, L0143_B_FlipHorizontal);
#endif
                                T0115200_DrawExplosion:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                L0190_B_FlipVertical = M005_RANDOM(2);
#ifdef MEDIA224_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G /* CHANGE2_02_FIX The variable is always set so that explosions are drawn correctly */
                                L0140_i_PaddingPixelCount = 0;
#endif
                                if (L0143_B_FlipHorizontal = M005_RANDOM(2)) {
                                        L0140_i_PaddingPixelCount = (7 - ((L0136_i_ByteWidth - 1) & 0x0007)) << 1; /* Number of unused pixels in the units on the right of the bitmap */
                                }
                                M771_BOX_BOTTOM(L0145_auc_Box) = F0024_MAIN_GetMinimumValue(135, L0193_pi_ExplosionCoordinates[C1_Y] + (L0137_i_Height >> 1));
                                AL0127_i_Y = F0025_MAIN_GetMaximumValue(0, L0193_pi_ExplosionCoordinates[C1_Y] - (L0137_i_Height >> 1) + !(L0137_i_Height & 0x0001));
                                if (AL0127_i_Y >= 136)
                                        continue;
                                M770_BOX_TOP(L0145_auc_Box) = AL0127_i_Y;
                                if ((AL0127_i_X = F0024_MAIN_GetMinimumValue(223, L0193_pi_ExplosionCoordinates[C0_X] + L0136_i_ByteWidth)) < 0)
                                        continue;
                                M769_BOX_RIGHT(L0145_auc_Box) = AL0127_i_X;
                                AL0127_i_X = L0193_pi_ExplosionCoordinates[C0_X];
                                if (M768_BOX_LEFT(L0145_auc_Box) = F0026_MAIN_GetBoundedValue(0, AL0127_i_X - L0136_i_ByteWidth + 1, 223)) {
#ifdef MEDIA001_S10EA_S10EB /* CHANGE2_02_FIX */
                                        if (L0143_B_FlipHorizontal) {
                                                AL0127_i_X = L0140_i_PaddingPixelCount;
                                        } else {
                                                AL0127_i_X = 0;
                                        }
#endif
#ifdef MEDIA224_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G /* CHANGE2_02_FIX */
                                        AL0127_i_X = L0140_i_PaddingPixelCount;
#endif
                                } else {
                                        AL0127_i_X = F0025_MAIN_GetMaximumValue(L0140_i_PaddingPixelCount, L0136_i_ByteWidth - AL0127_i_X - 1); /* BUG0_07 Graphical glitch when drawing explosions. If an explosion bitmap is cropped because it is only partly visible on the left side of the viewport (M768_BOX_LEFT(L0145_auc_Box) = 0) and the bitmap is not flipped horizontally (L0143_B_FlipHorizontal = C0_FALSE) then the variable L0140_i_PaddingPixelCount is not set before being used here. Its previous value (defined while drawing something else) is used and may cause an incorrect bitmap to be drawn */

                                        /* BUG0_06 Graphical glitch when drawing projectiles or explosions. If a projectile or explosion bitmap is cropped because it is only partly visible on the left side of the viewport (M768_BOX_LEFT(L0145_auc_Box) = 0) and the bitmap is flipped horizontally (L0143_B_FlipHorizontal = C1_TRUE) then a wrong part of the bitmap is drawn on screen. To fix this bug, "+ L0140_i_PaddingPixelCount" must be added to the second parameter of this function call */
                                }
                                if (M769_BOX_RIGHT(L0145_auc_Box) <= M768_BOX_LEFT(L0145_auc_Box))
                                        continue;
                                L0136_i_ByteWidth = M077_NORMALIZED_BYTE_WIDTH(L0136_i_ByteWidth);
                                if (L0143_B_FlipHorizontal || L0190_B_FlipVertical) {
                                        F0007_MAIN_CopyBytes(AL0128_puc_Bitmap, G0074_puc_Bitmap_Temporary, L0136_i_ByteWidth * L0137_i_Height);
                                        AL0128_puc_Bitmap = G0074_puc_Bitmap_Temporary;
                                }
                                if (L0143_B_FlipHorizontal) {
                                        F0130_VIDEO_FlipHorizontal(AL0128_puc_Bitmap, L0136_i_ByteWidth, L0137_i_Height);
                                }
                                if (L0190_B_FlipVertical) {
                                        F0131_VIDEO_FlipVertical(AL0128_puc_Bitmap, L0136_i_ByteWidth, L0137_i_Height);
                                }
#ifdef MEDIA008_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E
                                F0132_VIDEO_Blit(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0145_auc_Box, AL0127_i_X, 0, L0136_i_ByteWidth, C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH);
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0132_VIDEO_Blit(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, L0145_auc_Box, AL0127_i_X, 0, L0136_i_ByteWidth, C112_BYTE_WIDTH_VIEWPORT, C10_COLOR_FLESH, L0137_i_Height, C136_HEIGHT_VIEWPORT);
#endif
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0791_DUNGEONVIEW_DrawBitmapXX(AL0128_puc_Bitmap, G0296_puc_Bitmap_Viewport, L2474_i_ZoneIndex, L0143_B_FlipHorizontal, C10_COLOR_FLESH);
#endif
                        }
                }
        } while ((P0141_T_Thing = F0159_DUNGEON_GetNextThing(P0141_T_Thing)) != C0xFFFE_THING_ENDOFLIST);
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if ((L0192_ps_FluxcageExplosion != NULL) && (L0175_i_DoorFrontViewDrawingPass != 1) && !G0077_B_DoNotDrawFluxcagesDuringEndgame) { /* Fluxcage is an explosion displayed as a field (like teleporters), above all other graphics */
                AP0145_i_ViewSquareExplosionIndex -= 3; /* Convert square index for explosions back to square index */
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if ((L0192_ps_FluxcageExplosion != NULL) && (L2482_i_FieldAspectIndex >= 0) && (L0175_i_DoorFrontViewDrawingPass != 1) && !G0077_B_DoNotDrawFluxcagesDuringEndgame) { /* Fluxcage is an explosion displayed as a field (like teleporters), above all other graphics */
#endif
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
                F0007_MAIN_CopyBytes(M772_CAST_PC(G0188_aauc_Graphic558_FieldAspects[P0145_i_ViewSquareIndex]), M772_CAST_PC(L0198_auc_FieldAspect), M543_BYTE_COUNT_INT(sizeof(L0198_auc_FieldAspect)));
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0007_MAIN_CopyBytes((char*)G0188_aauc_Graphic558_FieldAspects[L2482_i_FieldAspectIndex], (char*)L0198_auc_FieldAspect, (long)sizeof(L0198_auc_FieldAspect));
#endif
                (M728_NATIVE_BITMAP_RELATIVE_INDEX(L0198_auc_FieldAspect))++; /* NativeBitmapRelativeIndex is now the index of the Fluxcage field graphic */
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0113_DUNGEONVIEW_DrawField(L0198_auc_FieldAspect, G0163_aauc_Graphic558_Frame_Walls[P0145_i_ViewSquareIndex]);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0113_DUNGEONVIEW_DrawField(L0198_auc_FieldAspect, C704_ZONE_WALL_D3C + P0145_i_ViewSquareIndex);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0113_DUNGEONVIEW_DrawField(L0198_auc_FieldAspect, C702_ZONE_WALL_D3L2 + L2482_i_FieldAspectIndex);
#endif
        }
        T0115214_Return: ;
}

#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
void F0676_DrawD3L2(
REGISTER int16_t P2087_i_Direction SEPARATOR
REGISTER int16_t P2088_i_MapX      SEPARATOR
REGISTER int16_t P2089_i_MapY      FINAL_SEPARATOR
{
        REGISTER int16_t L2483_i_Order;
        int16_t L2484_ai_SquareAspect[7];


        F0172_DUNGEON_SetSquareAspect(L2484_ai_SquareAspect, P2087_i_Direction, P2088_i_MapX, P2089_i_MapY);
        switch (L2484_ai_SquareAspect[C0_ELEMENT]) {
                case C19_ELEMENT_STAIRS_FRONT:
                        if (L2484_ai_SquareAspect[M555_STAIRS_UP]) {
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(M714_NEGGRAPHIC_STAIRS_UP_D3L2, C800_ZONE_STAIRS_UP_FRONT_D3L2);
                        } else {
#ifdef PC_FIX_CODE_SIZE
        L2483_i_Order++;
        L2483_i_Order++;
        L2483_i_Order++;
        L2483_i_Order++;
        L2483_i_Order++;
        L2483_i_Order++;
        L2483_i_Order++;
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(M716_NEGGRAPHIC_STAIRS_DOWN_D3L2, C813_ZONE_STAIRS_DOWN_FRONT_D3L2);
                        }
                        goto T0676015;
                case C00_ELEMENT_WALL:
#ifdef MEDIA709_I34E_I34M_P31J
                        if (G0076_B_UseFlippedWallAndFootprintsBitmaps) {
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2107_WallSet[C10_WALL_D3R2], C702_ZONE_WALL_D3L2);
                        } else {
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2107_WallSet[C11_WALL_D3L2], C702_ZONE_WALL_D3L2);
#ifdef MEDIA709_I34E_I34M_P31J
                        }
#endif
                        F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L2484_ai_SquareAspect[M551_RIGHT_WALL_ORNAMENT_ORDINAL], C00_VIEW_WALL_D3L2_RIGHT);
                        return;
                case C16_ELEMENT_DOOR_SIDE:
                case C18_ELEMENT_STAIRS_SIDE:
                        L2483_i_Order = C0x0321_CELL_ORDER_BACKLEFT_BACKRIGHT_FRONTRIGHT;
                        goto T0676016;
                case C17_ELEMENT_DOOR_FRONT:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L2484_ai_SquareAspect[M552_FRONT_WALL_ORNAMENT_ORDINAL], C00_VIEW_FLOOR_D3L2);
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L2484_ai_SquareAspect[M550_FIRST_THING], P2087_i_Direction, P2088_i_MapX, P2089_i_MapY, C14_VIEW_SQUARE_D3L2, C0x0218_CELL_ORDER_DOORPASS1_BACKLEFT_BACKRIGHT);
                        F0111_DUNGEONVIEW_DrawDoor(L2484_ai_SquareAspect[M557_DOOR_THING_INDEX], L2484_ai_SquareAspect[M556_DOOR_STATE], G0693_ai_DoorNativeBitmapIndex_Front_D3LCR, C0_VIEW_DOOR_ORNAMENT_D3LCR, C3700_ZONE_DOOR_D3L2);
                        L2483_i_Order = C0x0349_CELL_ORDER_DOORPASS2_FRONTLEFT_FRONTRIGHT;
                        goto T0676017;
                case C02_ELEMENT_PIT:
                        if (!L2484_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(C049_GRAPHIC_FLOOR_PIT_D3L2, C850_ZONE_FLOORPIT_D3L2);
                        }
                case C05_ELEMENT_TELEPORTER:
                case C01_ELEMENT_CORRIDOR:
                        T0676015:
                        L2483_i_Order = C0x3421_CELL_ORDER_BACKLEFT_BACKRIGHT_FRONTLEFT_FRONTRIGHT;
                        T0676016:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L2484_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], C00_VIEW_FLOOR_D3L2); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
                        T0676017:
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L2484_ai_SquareAspect[M550_FIRST_THING], P2087_i_Direction, P2088_i_MapX, P2089_i_MapY, C14_VIEW_SQUARE_D3L2, L2483_i_Order);
        }
        if (L2484_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) {
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[C14_VIEW_SQUARE_D3L2]], C702_ZONE_WALL_D3L2);
        }
}

void F0677_DrawD3R2(
REGISTER int16_t P2090_i_Direction SEPARATOR
REGISTER int16_t P2091_i_MapX      SEPARATOR
REGISTER int16_t P2092_i_MapY      FINAL_SEPARATOR
{
        REGISTER int16_t L2485_i_Order;
        int16_t L2486_ai_SquareAspect[7];


        F0172_DUNGEON_SetSquareAspect(L2486_ai_SquareAspect, P2090_i_Direction, P2091_i_MapX, P2092_i_MapY);
        switch (L2486_ai_SquareAspect[C0_ELEMENT]) {
                case C19_ELEMENT_STAIRS_FRONT:
                        if (L2486_ai_SquareAspect[M555_STAIRS_UP]) {
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(M715_NEGGRAPHIC_STAIRS_UP_D3R2, C801_ZONE_STAIRS_UP_FRONT_D3R2);
                        } else {
#ifdef PC_FIX_CODE_SIZE
        L2485_i_Order++;
        L2485_i_Order++;
        L2485_i_Order++;
        L2485_i_Order++;
        L2485_i_Order++;
        L2485_i_Order++;
        L2485_i_Order++;
#endif
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(M717_NEGGRAPHIC_STAIRS_DOWN_D3R2, C814_ZONE_STAIRS_DOWN_FRONT_D3R2);
                        }
                        goto T0677016;
                case C00_ELEMENT_WALL:
#ifdef MEDIA709_I34E_I34M_P31J
                        if (G0076_B_UseFlippedWallAndFootprintsBitmaps) {
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2107_WallSet[C11_WALL_D3L2], C703_ZONE_WALL_D3R2);
                        } else {
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2107_WallSet[C10_WALL_D3R2], C703_ZONE_WALL_D3R2);
#ifdef MEDIA709_I34E_I34M_P31J
                        }
#endif
                        F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L2486_ai_SquareAspect[M553_LEFT_WALL_ORNAMENT_ORDINAL], C01_VIEW_WALL_D3R2_LEFT);
                        return;
                case C16_ELEMENT_DOOR_SIDE:
                case C18_ELEMENT_STAIRS_SIDE:
                        L2485_i_Order = C0x0412_CELL_ORDER_BACKRIGHT_BACKLEFT_FRONTLEFT;
                        goto T0677017;
                case C17_ELEMENT_DOOR_FRONT:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L2486_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], C01_VIEW_FLOOR_D3R2);
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L2486_ai_SquareAspect[M550_FIRST_THING], P2090_i_Direction, P2091_i_MapX, P2092_i_MapY, C15_VIEW_SQUARE_D3R2, C0x0128_CELL_ORDER_DOORPASS1_BACKRIGHT_BACKLEFT);
                        F0111_DUNGEONVIEW_DrawDoor(L2486_ai_SquareAspect[M557_DOOR_THING_INDEX], L2486_ai_SquareAspect[M556_DOOR_STATE], G0693_ai_DoorNativeBitmapIndex_Front_D3LCR, C0_VIEW_DOOR_ORNAMENT_D3LCR, C3710_ZONE_DOOR_D3R2);
                        L2485_i_Order = C0x0439_CELL_ORDER_DOORPASS2_FRONTRIGHT_FRONTLEFT;
                        goto T0677018;
                case C02_ELEMENT_PIT:
                        if (!L2486_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(C049_GRAPHIC_FLOOR_PIT_D3L2, C851_ZONE_FLOORPIT_D3R2);
                        }
                case C05_ELEMENT_TELEPORTER:
                case C01_ELEMENT_CORRIDOR:
                        T0677016:
                        L2485_i_Order = C0x4312_CELL_ORDER_BACKRIGHT_BACKLEFT_FRONTRIGHT_FRONTLEFT;
                        T0677017:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L2486_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], C01_VIEW_FLOOR_D3R2); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
                        T0677018:
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L2486_ai_SquareAspect[M550_FIRST_THING], P2090_i_Direction, P2091_i_MapX, P2092_i_MapY, C15_VIEW_SQUARE_D3R2, L2485_i_Order);
        }
        if (L2486_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) {
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[C15_VIEW_SQUARE_D3R2]], C703_ZONE_WALL_D3R2);
        }
}
#endif

STATICFUNCTION void F0116_DUNGEONVIEW_DrawSquareD3L(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0147_i_Direction, P0148_i_MapX, P0149_i_MapY)
#endif
REGISTER int16_t P0147_i_Direction SEPARATOR
REGISTER int16_t P0148_i_MapX      SEPARATOR
REGISTER int16_t P0149_i_MapY      FINAL_SEPARATOR
{
        int16_t L0201_ai_SquareAspect[M559_SQUARE_ASPECT_INT_COUNT];
        REGISTER int16_t L0200_i_Order;


        F0172_DUNGEON_SetSquareAspect(L0201_ai_SquareAspect, P0147_i_Direction, P0148_i_MapX, P0149_i_MapY);
        switch (L0201_ai_SquareAspect[C0_ELEMENT]) {
                case C19_ELEMENT_STAIRS_FRONT:
                        if (L0201_ai_SquareAspect[M555_STAIRS_UP]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0675_i_StairsNativeBitmapIndex_Up_Front_D3L, G0110_auc_Graphic558_Frame_StairsUpFront_D3L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0675_i_StairsNativeBitmapIndex_Up_Front_D3L, C800_ZONE_STAIRS_UP_FRONT_D3L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C00_STAIRS_BITMAP_UP_FRONT_D3L], C802_ZONE_STAIRS_UP_FRONT_D3L);
#endif
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0682_i_StairsNativeBitmapIndex_Down_Front_D3L, G0121_auc_Graphic558_Frame_StairsDownFront_D3L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0682_i_StairsNativeBitmapIndex_Down_Front_D3L, C811_ZONE_STAIRS_DOWN_FRONT_D3L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef PC_FIX_CODE_SIZE
        L0200_i_Order++;
        L0200_i_Order++;
        L0200_i_Order++;
        L0200_i_Order++;
        L0200_i_Order++;
        L0200_i_Order++;
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C07_STAIRS_BITMAP_DOWN_FRONT_D3L], C815_ZONE_STAIRS_DOWN_FRONT_D3L);
#endif
                        }
                        goto T0116015;
                case C00_ELEMENT_WALL:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0698_puc_Bitmap_WallSet_Wall_D3LCR, G0163_aauc_Graphic558_Frame_Walls[M601_VIEW_SQUARE_D3L]);
#endif
#ifdef MEDIA458_P20JA_P20JB
                        if (G0076_B_UseFlippedWallAndFootprintsBitmaps) {
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G3005_i_WallSet_Wall_D3R, C705_ZONE_WALL_D3L);
                        } else {
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G3004_i_WallSet_Wall_D3L, C705_ZONE_WALL_D3L);
#endif
#ifdef MEDIA458_P20JA_P20JB
                        }
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                        if (G0076_B_UseFlippedWallAndFootprintsBitmaps) {
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2107_WallSet[C12_WALL_D3R], C705_ZONE_WALL_D3L);
                        } else {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2107_WallSet[C13_WALL_D3L], C705_ZONE_WALL_D3L);
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                        }
#endif
                        F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L0201_ai_SquareAspect[M551_RIGHT_WALL_ORNAMENT_ORDINAL], M575_VIEW_WALL_D3L_RIGHT);
                        if (F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L0201_ai_SquareAspect[M552_FRONT_WALL_ORNAMENT_ORDINAL], M577_VIEW_WALL_D3L_FRONT)) {
                                L0200_i_Order = C0x0000_CELL_ORDER_ALCOVE;
                                goto T0116017;
                        }
                        return;
                case C16_ELEMENT_DOOR_SIDE:
                case C18_ELEMENT_STAIRS_SIDE:
                        L0200_i_Order = C0x0321_CELL_ORDER_BACKLEFT_BACKRIGHT_FRONTRIGHT;
                        goto T0116016;
                case C17_ELEMENT_DOOR_FRONT:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0201_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M588_VIEW_FLOOR_D3L);
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0201_ai_SquareAspect[M550_FIRST_THING], P0147_i_Direction, P0148_i_MapX, P0149_i_MapY, M601_VIEW_SQUARE_D3L, C0x0218_CELL_ORDER_DOORPASS1_BACKLEFT_BACKRIGHT);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0705_puc_Bitmap_WallSet_DoorFrameLeft_D3L, G0164_auc_Graphic558_Frame_DoorFrameLeft_D3L);
                        F0111_DUNGEONVIEW_DrawDoor(L0201_ai_SquareAspect[M557_DOOR_THING_INDEX], L0201_ai_SquareAspect[M556_DOOR_STATE], G0693_ai_DoorNativeBitmapIndex_Front_D3LCR, M075_BITMAP_BYTE_COUNT(48, 41), C0_VIEW_DOOR_ORNAMENT_D3LCR, &G0179_s_Graphic558_Frames_Door_D3L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2120_DoorFrameLeftD3L, C716_ZONE_DOOR_FRAME_LEFT_D3L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2120_DoorFrameLeftD3L, C718_ZONE_DOOR_FRAME_LEFT_D3L);
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2121_, C719_ZONE_DOOR_FRAME_RIGHT_D3L);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0111_DUNGEONVIEW_DrawDoor(L0201_ai_SquareAspect[M557_DOOR_THING_INDEX], L0201_ai_SquareAspect[M556_DOOR_STATE], G0693_ai_DoorNativeBitmapIndex_Front_D3LCR, C0_VIEW_DOOR_ORNAMENT_D3LCR, M624_ZONE_DOOR_D3L);
#endif
                        L0200_i_Order = C0x0349_CELL_ORDER_DOORPASS2_FRONTLEFT_FRONTRIGHT;
                        goto T0116017;
                case C02_ELEMENT_PIT:
                        if (!L0201_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(M754_GRAPHIC_FLOOR_PIT_D3L, G0140_auc_Graphic558_Frame_FloorPit_D3L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(M754_GRAPHIC_FLOOR_PIT_D3L, C850_ZONE_FLOORPIT_D3L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(M754_GRAPHIC_FLOOR_PIT_D3L, C852_ZONE_FLOORPIT_D3L);
#endif
                        }
                case C05_ELEMENT_TELEPORTER:
                case C01_ELEMENT_CORRIDOR:
                        T0116015:
                        L0200_i_Order = C0x3421_CELL_ORDER_BACKLEFT_BACKRIGHT_FRONTLEFT_FRONTRIGHT;
                        T0116016:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0201_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M588_VIEW_FLOOR_D3L); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
                        T0116017:
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0201_ai_SquareAspect[M550_FIRST_THING], P0147_i_Direction, P0148_i_MapX, P0149_i_MapY, M601_VIEW_SQUARE_D3L, L0200_i_Order);
        }
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if ((L0201_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) && L0201_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (L0201_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) {
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M601_VIEW_SQUARE_D3L], G0163_aauc_Graphic558_Frame_Walls[M601_VIEW_SQUARE_D3L]);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M601_VIEW_SQUARE_D3L], C705_ZONE_WALL_D3L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[M601_VIEW_SQUARE_D3L]], C705_ZONE_WALL_D3L);
#endif
        }
}

STATICFUNCTION void F0117_DUNGEONVIEW_DrawSquareD3R(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0150_i_Direction, P0151_i_MapX, P0152_i_MapY)
#endif
REGISTER int16_t P0150_i_Direction SEPARATOR
REGISTER int16_t P0151_i_MapX      SEPARATOR
REGISTER int16_t P0152_i_MapY      FINAL_SEPARATOR
{
        int16_t L0203_ai_SquareAspect[M559_SQUARE_ASPECT_INT_COUNT];
        REGISTER int16_t L0202_i_Order;


        F0172_DUNGEON_SetSquareAspect(L0203_ai_SquareAspect, P0150_i_Direction, P0151_i_MapX, P0152_i_MapY);
        switch (L0203_ai_SquareAspect[C0_ELEMENT]) {
                case C19_ELEMENT_STAIRS_FRONT:
                        if (L0203_ai_SquareAspect[M555_STAIRS_UP]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0675_i_StairsNativeBitmapIndex_Up_Front_D3L, G0112_auc_Graphic558_Frame_StairsUpFront_D3R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0675_i_StairsNativeBitmapIndex_Up_Front_D3L, C802_ZONE_STAIRS_UP_FRONT_D3R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0079_ai_StairsNativeBitmapIndices[C00_STAIRS_BITMAP_UP_FRONT_D3L], C804_ZONE_STAIRS_UP_FRONT_D3R);
#endif
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0682_i_StairsNativeBitmapIndex_Down_Front_D3L, G0123_auc_Graphic558_Frame_StairsDownFront_D3R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0682_i_StairsNativeBitmapIndex_Down_Front_D3L, C813_ZONE_STAIRS_DOWN_FRONT_D3R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef PC_FIX_CODE_SIZE
        L0202_i_Order++;
        L0202_i_Order++;
        L0202_i_Order++;
        L0202_i_Order++;
        L0202_i_Order++;
        L0202_i_Order++;
#endif
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0079_ai_StairsNativeBitmapIndices[C07_STAIRS_BITMAP_DOWN_FRONT_D3L], C817_ZONE_STAIRS_DOWN_FRONT_D3R);
#endif
                        }
                        goto T0117016;
                case C00_ELEMENT_WALL:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0698_puc_Bitmap_WallSet_Wall_D3LCR, G0163_aauc_Graphic558_Frame_Walls[M602_VIEW_SQUARE_D3R]);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        if (G0076_B_UseFlippedWallAndFootprintsBitmaps) {
#ifdef MEDIA458_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G3004_i_WallSet_Wall_D3L, C706_ZONE_WALL_D3R);
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2107_WallSet[C13_WALL_D3L], C706_ZONE_WALL_D3R);
#endif
                        } else {
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G3005_i_WallSet_Wall_D3R, C706_ZONE_WALL_D3R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2107_WallSet[C12_WALL_D3R], C706_ZONE_WALL_D3R);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        }
#endif
                        F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L0203_ai_SquareAspect[M553_LEFT_WALL_ORNAMENT_ORDINAL], M576_VIEW_WALL_D3R_LEFT);
                        if (F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L0203_ai_SquareAspect[M552_FRONT_WALL_ORNAMENT_ORDINAL], M579_VIEW_WALL_D3R_FRONT)) {
                                L0202_i_Order = C0x0000_CELL_ORDER_ALCOVE;
                                goto T0117018;
                        }
                        return;
                case C16_ELEMENT_DOOR_SIDE:
                case C18_ELEMENT_STAIRS_SIDE:
                        L0202_i_Order = C0x0412_CELL_ORDER_BACKRIGHT_BACKLEFT_FRONTLEFT;
                        goto T0117017;
                case C17_ELEMENT_DOOR_FRONT:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0203_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M590_VIEW_FLOOR_D3R);
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0203_ai_SquareAspect[M550_FIRST_THING], P0150_i_Direction, P0151_i_MapX, P0152_i_MapY, M602_VIEW_SQUARE_D3R, C0x0128_CELL_ORDER_DOORPASS1_BACKRIGHT_BACKLEFT);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0007_MAIN_CopyBytes(G0705_puc_Bitmap_WallSet_DoorFrameLeft_D3L, G0074_puc_Bitmap_Temporary, M075_BITMAP_BYTE_COUNT(32, 44));
                        F0103_DUNGEONVIEW_DrawDoorFrameBitmapFlippedHorizontally(G0074_puc_Bitmap_Temporary, G0165_auc_Graphic558_Frame_DoorFrameRight_D3R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2120_DoorFrameLeftD3L, C717_ZONE_DOOR_FRAME_LEFT_D3R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2122_, C720_ZONE_DOOR_FRAME_LEFT_D3R);
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2120_DoorFrameLeftD3L, C721_ZONE_DOOR_FRAME_RIGHT_D3R);
#endif
                        if (((DOOR*)G0284_apuc_ThingData[C00_THING_TYPE_DOOR])[L0203_ai_SquareAspect[M557_DOOR_THING_INDEX]].Button) {
                                F0110_DUNGEONVIEW_DrawDoorButton(M000_INDEX_TO_ORDINAL(C0_DOOR_BUTTON), C0_VIEW_DOOR_BUTTON_D3R);
                        }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0111_DUNGEONVIEW_DrawDoor(L0203_ai_SquareAspect[M557_DOOR_THING_INDEX], L0203_ai_SquareAspect[M556_DOOR_STATE], G0693_ai_DoorNativeBitmapIndex_Front_D3LCR, M075_BITMAP_BYTE_COUNT(48, 41), C0_VIEW_DOOR_ORNAMENT_D3LCR, &G0181_s_Graphic558_Frames_Door_D3R);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0111_DUNGEONVIEW_DrawDoor(L0203_ai_SquareAspect[M557_DOOR_THING_INDEX], L0203_ai_SquareAspect[M556_DOOR_STATE], G0693_ai_DoorNativeBitmapIndex_Front_D3LCR, C0_VIEW_DOOR_ORNAMENT_D3LCR, M626_ZONE_DOOR_D3R);
#endif
                        L0202_i_Order = C0x0439_CELL_ORDER_DOORPASS2_FRONTRIGHT_FRONTLEFT;
                        goto T0117018;
                case C02_ELEMENT_PIT:
                        if (!L0203_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(M754_GRAPHIC_FLOOR_PIT_D3L, G0142_auc_Graphic558_Frame_FloorPit_D3R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(M754_GRAPHIC_FLOOR_PIT_D3L, C852_ZONE_FLOORPIT_D3R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(M754_GRAPHIC_FLOOR_PIT_D3L, C854_ZONE_FLOORPIT_D3R);
#endif
                        }
                case C05_ELEMENT_TELEPORTER:
                case C01_ELEMENT_CORRIDOR:
                        T0117016:
                        L0202_i_Order = C0x4312_CELL_ORDER_BACKRIGHT_BACKLEFT_FRONTRIGHT_FRONTLEFT;
                        T0117017:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0203_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M590_VIEW_FLOOR_D3R); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
                        T0117018:
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0203_ai_SquareAspect[M550_FIRST_THING], P0150_i_Direction, P0151_i_MapX, P0152_i_MapY, M602_VIEW_SQUARE_D3R, L0202_i_Order);
        }
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if ((L0203_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) && L0203_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (L0203_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) {
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M602_VIEW_SQUARE_D3R], G0163_aauc_Graphic558_Frame_Walls[M602_VIEW_SQUARE_D3R]);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M602_VIEW_SQUARE_D3R], C706_ZONE_WALL_D3R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[M602_VIEW_SQUARE_D3R]], C706_ZONE_WALL_D3R);
#endif
        }
}

STATICFUNCTION void F0118_DUNGEONVIEW_DrawSquareD3C_CPSF(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0153_i_Direction, P0154_i_MapX, P0155_i_MapY)
#endif
REGISTER int16_t P0153_i_Direction SEPARATOR
REGISTER int16_t P0154_i_MapX      SEPARATOR
REGISTER int16_t P0155_i_MapY      FINAL_SEPARATOR
{
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_08_OPTIMIZATION Variable definition changed */
#ifndef NOCOPYPROTECTION
        REGISTER void (*L0205_pfv_Function_CPSF)();
#endif
#endif
#ifdef MEDIA315_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M /* CHANGE7_08_OPTIMIZATION Variable definition changed */
#ifndef NOCOPYPROTECTION
        REGISTER char* L0205_pfv_Function_CPSF;
#endif
#endif
        int16_t L0206_ai_SquareAspect[M559_SQUARE_ASPECT_INT_COUNT];
        REGISTER int16_t L0204_i_Order;


        F0172_DUNGEON_SetSquareAspect(L0206_ai_SquareAspect, P0153_i_Direction, P0154_i_MapX, P0155_i_MapY);
        switch (L0206_ai_SquareAspect[C0_ELEMENT]) {
                case C19_ELEMENT_STAIRS_FRONT:
                        if (L0206_ai_SquareAspect[M555_STAIRS_UP]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0676_i_StairsNativeBitmapIndex_Up_Front_D3C, G0111_auc_Graphic558_Frame_StairsUpFront_D3C);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0676_i_StairsNativeBitmapIndex_Up_Front_D3C, C801_ZONE_STAIRS_UP_FRONT_D3C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C01_STAIRS_BITMAP_UP_FRONT_D3C], C803_ZONE_STAIRS_UP_FRONT_D3C);
#endif
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0683_i_StairsNativeBitmapIndex_Down_Front_D3C, G0122_auc_Graphic558_Frame_StairsDownFront_D3C);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0683_i_StairsNativeBitmapIndex_Down_Front_D3C, C812_ZONE_STAIRS_DOWN_FRONT_D3C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef PC_FIX_CODE_SIZE
        L0204_i_Order++;
        L0204_i_Order++;
        L0204_i_Order++;
        L0204_i_Order++;
        L0204_i_Order++;
        L0204_i_Order++;
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C08_STAIRS_BITMAP_DOWN_FRONT_D3C], C816_ZONE_STAIRS_DOWN_FRONT_D3C);
#endif
                        }
                        goto T0118027;
                case C00_ELEMENT_WALL:
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_15_OPTIMIZATION */
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0698_puc_Bitmap_WallSet_Wall_D3LCR, G0163_aauc_Graphic558_Frame_Walls[M600_VIEW_SQUARE_D3C]);
#endif
#ifdef MEDIA267_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G /* CHANGE7_15_OPTIMIZATION */
                        F0101_DUNGEONVIEW_DrawWallSetBitmapWithoutTransparency(G0698_puc_Bitmap_WallSet_Wall_D3LCR, G0163_aauc_Graphic558_Frame_Walls[M600_VIEW_SQUARE_D3C]);
#endif
#ifdef MEDIA458_P20JA_P20JB
                        F0792_DUNGEONVIEW_DrawBitmapYYY(G3011_i_WallSet_Wall_D3C, C704_ZONE_WALL_D3C, G0076_B_UseFlippedWallAndFootprintsBitmaps);
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                        F0792_DUNGEONVIEW_DrawBitmapYYY(G2107_WallSet[C14_WALL_D3C], C704_ZONE_WALL_D3C, G0076_B_UseFlippedWallAndFootprintsBitmaps);
#endif
#ifdef MEDIA506_F20E_F20J_X30J
                        F0765_DUNGEONVIEW_DrawBitmapWithoutTransparency(G3011_i_WallSet_Wall_D3C, C704_ZONE_WALL_D3C);
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        F0765_DUNGEONVIEW_DrawBitmapWithoutTransparency(G2107_WallSet[C14_WALL_D3C], C704_ZONE_WALL_D3C);
#endif
                        if (F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L0206_ai_SquareAspect[M552_FRONT_WALL_ORNAMENT_ORDINAL], M578_VIEW_WALL_D3C_FRONT)) {
                                L0204_i_Order = C0x0000_CELL_ORDER_ALCOVE;
                                goto T0118028;
                        }
                        return;
                case C17_ELEMENT_DOOR_FRONT:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0206_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M589_VIEW_FLOOR_D3C);
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0206_ai_SquareAspect[M550_FIRST_THING], P0153_i_Direction, P0154_i_MapX, P0155_i_MapY, M600_VIEW_SQUARE_D3C, C0x0218_CELL_ORDER_DOORPASS1_BACKLEFT_BACKRIGHT);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0706_puc_Bitmap_WallSet_DoorFrameLeft_D3C, G0166_auc_Graphic558_Frame_DoorFrameLeft_D3C);
                        F0007_MAIN_CopyBytes(G0706_puc_Bitmap_WallSet_DoorFrameLeft_D3C, G0074_puc_Bitmap_Temporary, M075_BITMAP_BYTE_COUNT(32, 44));
                        F0103_DUNGEONVIEW_DrawDoorFrameBitmapFlippedHorizontally(G0074_puc_Bitmap_Temporary, G0167_auc_Graphic558_Frame_DoorFrameRight_D3C);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2119_DoorFrameLeftD3C, C718_ZONE_DOOR_FRAME_LEFT_D3C);
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2119_DoorFrameLeftD3C, C719_ZONE_DOOR_FRAME_RIGHT_D3C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2119_DoorFrameLeftD3C, C722_ZONE_DOOR_FRAME_LEFT_D3C);
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2119_DoorFrameLeftD3C, C723_ZONE_DOOR_FRAME_RIGHT_D3C);
#endif
                        if (((DOOR*)G0284_apuc_ThingData[C00_THING_TYPE_DOOR])[L0206_ai_SquareAspect[M557_DOOR_THING_INDEX]].Button) {
                                F0110_DUNGEONVIEW_DrawDoorButton(M000_INDEX_TO_ORDINAL(C0_DOOR_BUTTON), C1_VIEW_DOOR_BUTTON_D3C);
                        }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0111_DUNGEONVIEW_DrawDoor(L0206_ai_SquareAspect[M557_DOOR_THING_INDEX], L0206_ai_SquareAspect[M556_DOOR_STATE], G0693_ai_DoorNativeBitmapIndex_Front_D3LCR, M075_BITMAP_BYTE_COUNT(48, 41), C0_VIEW_DOOR_ORNAMENT_D3LCR, &G0180_s_Graphic558_Frames_Door_D3C);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0111_DUNGEONVIEW_DrawDoor(L0206_ai_SquareAspect[M557_DOOR_THING_INDEX], L0206_ai_SquareAspect[M556_DOOR_STATE], G0693_ai_DoorNativeBitmapIndex_Front_D3LCR, C0_VIEW_DOOR_ORNAMENT_D3LCR, M625_ZONE_DOOR_D3C);
#endif
                        L0204_i_Order = C0x0349_CELL_ORDER_DOORPASS2_FRONTLEFT_FRONTRIGHT;
                        goto T0118028;
                case C02_ELEMENT_PIT:
                        if (!L0206_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(M755_GRAPHIC_FLOOR_PIT_D3C, G0141_auc_Graphic558_Frame_FloorPit_D3C);
#endif
#ifdef MEDIA507_F20E_F20J_X30J_P20JA
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(M755_GRAPHIC_FLOOR_PIT_D3C, C801_ZONE_STAIRS_UP_FRONT_D3C); /* BUGX_XX */
#endif
#ifdef MEDIA469_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(M755_GRAPHIC_FLOOR_PIT_D3C, C851_ZONE_FLOORPIT_D3C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(M755_GRAPHIC_FLOOR_PIT_D3C, C853_ZONE_FLOORPIT_D3C);
#endif
                        }
                case C05_ELEMENT_TELEPORTER:
#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
                        /* If square D3C is a visible teleporter and criteria is met and there is no ongoing disk activity and the player either (loaded the current game before 66531 ticks of total play time and more than 65530 ticks of total play time have now passed) or (played for at least 8192 ticks since the game was loaded) */
                        if ((G0069_ui_State_CPSF >= 15) &&
                            !G0625_i_FloppyDriveDMATimeout_CPSDF &&
                            (((G0319_ul_LoadGameTime < 66531L) && (G0313_ul_GameTime > 65530L)) || (G0313_ul_GameTime > G0319_ul_LoadGameTime + 8192))) {
                                switch (M004_RANDOM(4)) {
                                        case 0:
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_08_OPTIMIZATION */
                                                L0205_pfv_Function_CPSF = F0123_DUNGEONVIEW_DrawSquareD1R;
#endif
#ifdef MEDIA315_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M /* CHANGE7_08_OPTIMIZATION */
                                                L0205_pfv_Function_CPSF = (char*)F0123_DUNGEONVIEW_DrawSquareD1R;
#endif
                                                break;
                                        case 1:
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_08_OPTIMIZATION */
                                                L0205_pfv_Function_CPSF = F0124_DUNGEONVIEW_DrawSquareD1C;
#endif
#ifdef MEDIA315_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M /* CHANGE7_08_OPTIMIZATION */
                                                L0205_pfv_Function_CPSF = (char*)F0124_DUNGEONVIEW_DrawSquareD1C;
#endif
                                                break;
                                        case 2:
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_08_OPTIMIZATION */
                                                L0205_pfv_Function_CPSF = F0122_DUNGEONVIEW_DrawSquareD1L;
#endif
#ifdef MEDIA315_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M /* CHANGE7_08_OPTIMIZATION */
                                                L0205_pfv_Function_CPSF = (char*)F0122_DUNGEONVIEW_DrawSquareD1L;
#endif
                                                break;
                                        case 3:
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_08_OPTIMIZATION */
                                                L0205_pfv_Function_CPSF = F0126_DUNGEONVIEW_DrawSquareD0R;
#endif
#ifdef MEDIA315_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M /* CHANGE7_08_OPTIMIZATION */
                                                L0205_pfv_Function_CPSF = (char*)F0126_DUNGEONVIEW_DrawSquareD0R;
#endif
                                }
                                F0137_CPSEF_PatchFunctionWithHiddenCodeLauncher(L0205_pfv_Function_CPSF, F0489_MEMORY_GetNativeBitmapOrGraphic, M718_GRAPHIC_READ_FUZZY_SECTOR, G0643_puc_FloppyDiskReadBuffer_CPSDF, &G0625_i_FloppyDriveDMATimeout_CPSDF, G0104_api_CodePatches_CPSF, 3); /* &G0625_i_FloppyDriveDMATimeout_CPSDF is also used by graphic #538 to access G0624_B_FloppyDriveTurnedOn_CPSDF (Atari ST) and G1053_ps_DiscResourceUnit_CPSX, G1054_ps_DiskResource_CPSX (Amiga) */
                                M008_SET(G0644_i_FloppyDiskReadBufferContentType_CPSDF, MASK0x0001_BUFFER_CONTAINS_CPS_FUZZY_SECTOR);
                                M008_SET(G0314_i_SectorsReadRequested_CPSDF, MASK0x0001_CPS_FUZZY_SECTOR);
                                G0069_ui_State_CPSF -= 10;
                                G0071_B_FuzzySectorReadingInitiated_CPSF = C0_FALSE;
                        }
#endif
#endif
                case C01_ELEMENT_CORRIDOR:
                        T0118027:
                        L0204_i_Order = C0x3421_CELL_ORDER_BACKLEFT_BACKRIGHT_FRONTLEFT_FRONTRIGHT;
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0206_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M589_VIEW_FLOOR_D3C); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
                        T0118028:
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0206_ai_SquareAspect[M550_FIRST_THING], P0153_i_Direction, P0154_i_MapX, P0155_i_MapY, M600_VIEW_SQUARE_D3C, L0204_i_Order);
        }
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if ((L0206_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) && L0206_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (L0206_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) {
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M600_VIEW_SQUARE_D3C], G0163_aauc_Graphic558_Frame_Walls[M600_VIEW_SQUARE_D3C]);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M600_VIEW_SQUARE_D3C], C704_ZONE_WALL_D3C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[M600_VIEW_SQUARE_D3C]], C704_ZONE_WALL_D3C);
#endif
        }
}

#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
STATICFUNCTION void F0678_DrawD2L2(
REGISTER int16_t P2093_i_Direction SEPARATOR
REGISTER int16_t P2094_i_MapX      SEPARATOR
REGISTER int16_t P2095_i_MapY      FINAL_SEPARATOR
{
        REGISTER int16_t L2487_i_Order_Unreferenced;
        int16_t L2488_ai_SquareAspect[7];


        F0172_DUNGEON_SetSquareAspect(L2488_ai_SquareAspect, P2093_i_Direction, P2094_i_MapX, P2095_i_MapY);
        switch (L2488_ai_SquareAspect[C0_ELEMENT]) {
                case C00_ELEMENT_WALL:
#ifdef MEDIA709_I34E_I34M_P31J
                        if (G0076_B_UseFlippedWallAndFootprintsBitmaps) {
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2107_WallSet[C05_WALL_D2R2], C707_ZONE_WALL_D2L2);
                        } else {
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2107_WallSet[C06_WALL_D2L2]
#ifdef PC_FIX_CODE_SIZE
+ 2
#endif
, C707_ZONE_WALL_D2L2);
#ifdef MEDIA709_I34E_I34M_P31J
                        }
#endif
                        return;
                case C05_ELEMENT_TELEPORTER:
                        F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[C09_VIEW_SQUARE_D2L2]], C707_ZONE_WALL_D2L2);
        }
}

STATICFUNCTION void F0679_DrawD2R2(
REGISTER int16_t P2096_i_Direction SEPARATOR
REGISTER int16_t P2097_i_MapX      SEPARATOR
REGISTER int16_t P2098_i_MapY      FINAL_SEPARATOR
{
        REGISTER int16_t L2489_i_Order_Unreferenced;
        int16_t L2490_ai_SquareAspect[7];


        F0172_DUNGEON_SetSquareAspect(L2490_ai_SquareAspect, P2096_i_Direction, P2097_i_MapX, P2098_i_MapY);
        switch (L2490_ai_SquareAspect[C0_ELEMENT]) {
                case C00_ELEMENT_WALL:
#ifdef MEDIA709_I34E_I34M_P31J
                        if (G0076_B_UseFlippedWallAndFootprintsBitmaps) {
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2107_WallSet[C06_WALL_D2L2], C708_ZONE_WALL_D2R2);
                        } else {
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2107_WallSet[C05_WALL_D2R2]
#ifdef PC_FIX_CODE_SIZE
+ 2
#endif
, C708_ZONE_WALL_D2R2);
#ifdef MEDIA709_I34E_I34M_P31J
                        }
#endif
                        return;
                case C05_ELEMENT_TELEPORTER:
                        F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[C10_VIEW_SQUARE_D2R2]], C708_ZONE_WALL_D2R2);
        }
}
#endif

STATICFUNCTION void F0119_DUNGEONVIEW_DrawSquareD2L(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0156_i_Direction, P0157_i_MapX, P0158_i_MapY)
#endif
REGISTER int16_t P0156_i_Direction SEPARATOR
REGISTER int16_t P0157_i_MapX      SEPARATOR
REGISTER int16_t P0158_i_MapY      FINAL_SEPARATOR
{
        int16_t L0208_ai_SquareAspect[M559_SQUARE_ASPECT_INT_COUNT];
        REGISTER int16_t L0207_i_Order;


        F0172_DUNGEON_SetSquareAspect(L0208_ai_SquareAspect, P0156_i_Direction, P0157_i_MapX, P0158_i_MapY);
        switch (L0208_ai_SquareAspect[C0_ELEMENT]) {
                case C19_ELEMENT_STAIRS_FRONT:
                        if (L0208_ai_SquareAspect[M555_STAIRS_UP]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0677_i_StairsNativeBitmapIndex_Up_Front_D2L, G0113_auc_Graphic558_Frame_StairsUpFront_D2L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0677_i_StairsNativeBitmapIndex_Up_Front_D2L, C803_ZONE_STAIRS_UP_FRONT_D2L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C02_STAIRS_BITMAP_UP_FRONT_D2L], C805_ZONE_STAIRS_UP_FRONT_D2L);
#endif
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0684_i_StairsNativeBitmapIndex_Down_Front_D2L, G0124_auc_Graphic558_Frame_StairsDownFront_D2L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0684_i_StairsNativeBitmapIndex_Down_Front_D2L, C814_ZONE_STAIRS_DOWN_FRONT_D2L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef PC_FIX_CODE_SIZE
        L0207_i_Order++;
        L0207_i_Order++;
        L0207_i_Order++;
        L0207_i_Order++;
        L0207_i_Order++;
        L0207_i_Order++;
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C09_STAIRS_BITMAP_DOWN_FRONT_D2L], C818_ZONE_STAIRS_DOWN_FRONT_D2L);
#endif
                        }
                        goto T0119018;
                case C00_ELEMENT_WALL:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0699_puc_Bitmap_WallSet_Wall_D2LCR, G0163_aauc_Graphic558_Frame_Walls[M604_VIEW_SQUARE_D2L]);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        if (G0076_B_UseFlippedWallAndFootprintsBitmaps) {
#ifdef MEDIA458_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G3007_i_WallSet_Wall_D2R, C708_ZONE_WALL_D2L);
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2107_WallSet[C07_WALL_D2R], C710_ZONE_WALL_D2L);
#endif
                        } else {
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G3006_i_WallSet_Wall_D2L, C708_ZONE_WALL_D2L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2107_WallSet[C08_WALL_D2L], C710_ZONE_WALL_D2L);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        }
#endif
                        F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L0208_ai_SquareAspect[M551_RIGHT_WALL_ORNAMENT_ORDINAL], M580_VIEW_WALL_D2L_RIGHT);
                        if (F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L0208_ai_SquareAspect[M552_FRONT_WALL_ORNAMENT_ORDINAL], M582_VIEW_WALL_D2L_FRONT)) {
                                L0207_i_Order = C0x0000_CELL_ORDER_ALCOVE;
                                goto T0119020;
                        }
                        return;
                case C18_ELEMENT_STAIRS_SIDE:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0689_i_StairsNativeBitmapIndex_Side_D2L, G0132_auc_Graphic558_Frame_StairsSide_D2L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0689_i_StairsNativeBitmapIndex_Side_D2L, C822_ZONE_STAIRS_SIDE_D2L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C14_STAIRS_BITMAP_SIDE_D2L], C826_ZONE_STAIRS_SIDE_D2L);
#endif
                case C16_ELEMENT_DOOR_SIDE:
                        L0207_i_Order = C0x0342_CELL_ORDER_BACKRIGHT_FRONTLEFT_FRONTRIGHT;
                        goto T0119019;
                case C17_ELEMENT_DOOR_FRONT:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0208_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M591_VIEW_FLOOR_D2L);
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0208_ai_SquareAspect[M550_FIRST_THING], P0156_i_Direction, P0157_i_MapX, P0158_i_MapY, M604_VIEW_SQUARE_D2L, C0x0218_CELL_ORDER_DOORPASS1_BACKLEFT_BACKRIGHT);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0703_puc_Bitmap_WallSet_DoorFrameTop_D2LCR, G0173_auc_Graphic558_Frame_DoorFrameTop_D2L);
                        F0111_DUNGEONVIEW_DrawDoor(L0208_ai_SquareAspect[M557_DOOR_THING_INDEX], L0208_ai_SquareAspect[M556_DOOR_STATE], G0694_ai_DoorNativeBitmapIndex_Front_D2LCR, M075_BITMAP_BYTE_COUNT(64, 61), C1_VIEW_DOOR_ORNAMENT_D2LCR, &G0182_s_Graphic558_Frames_Door_D2L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2114_DoorFrameTopD2L, C725_ZONE_DOOR_FRAME_TOP_D2L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2114_DoorFrameTopD2L, C729_ZONE_DOOR_FRAME_TOP_D2L);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0111_DUNGEONVIEW_DrawDoor(L0208_ai_SquareAspect[M557_DOOR_THING_INDEX], L0208_ai_SquareAspect[M556_DOOR_STATE], G0694_ai_DoorNativeBitmapIndex_Front_D2LCR, C1_VIEW_DOOR_ORNAMENT_D2LCR, M627_ZONE_DOOR_D2L);
#endif
                        L0207_i_Order = C0x0349_CELL_ORDER_DOORPASS2_FRONTLEFT_FRONTRIGHT;
                        goto T0119020;
                case C02_ELEMENT_PIT:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0208_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M762_GRAPHIC_FLOOR_PIT_INVISIBLE_D2L : M756_GRAPHIC_FLOOR_PIT_D2L, G0143_auc_Graphic558_Frame_FloorPit_D2L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0208_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M762_GRAPHIC_FLOOR_PIT_INVISIBLE_D2L : M756_GRAPHIC_FLOOR_PIT_D2L, C853_ZONE_FLOORPIT_D2L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0208_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M762_GRAPHIC_FLOOR_PIT_INVISIBLE_D2L : M756_GRAPHIC_FLOOR_PIT_D2L, C855_ZONE_FLOORPIT_D2L);
#endif
                case C05_ELEMENT_TELEPORTER:
                case C01_ELEMENT_CORRIDOR:
                        T0119018:
                        L0207_i_Order = C0x3421_CELL_ORDER_BACKLEFT_BACKRIGHT_FRONTLEFT_FRONTRIGHT;
                        T0119019:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0208_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M591_VIEW_FLOOR_D2L); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
                        T0119020:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0112_DUNGEONVIEW_DrawCeilingPit(C063_GRAPHIC_CEILING_PIT_D2L, G0152_auc_Graphic558_Frame_CeilingPit_D2L, P0157_i_MapX, P0158_i_MapY, C0_FALSE);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0112_DUNGEONVIEW_DrawCeilingPit(C063_GRAPHIC_CEILING_PIT_D2L, C862_ZONE_CEILING_PIT_D2L, P0157_i_MapX, P0158_i_MapY, C0_FALSE);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0112_DUNGEONVIEW_DrawCeilingPit(C064_GRAPHIC_CEILING_PIT_D2L, C864_ZONE_CEILING_PIT_D2L, P0157_i_MapX, P0158_i_MapY, C0_FALSE);
#endif
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0208_ai_SquareAspect[M550_FIRST_THING], P0156_i_Direction, P0157_i_MapX, P0158_i_MapY, M604_VIEW_SQUARE_D2L, L0207_i_Order);
        }
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if ((L0208_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) && L0208_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (L0208_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) {
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M604_VIEW_SQUARE_D2L], G0163_aauc_Graphic558_Frame_Walls[M604_VIEW_SQUARE_D2L]);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M604_VIEW_SQUARE_D2L], C708_ZONE_WALL_D2L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[M604_VIEW_SQUARE_D2L]], C710_ZONE_WALL_D2L);
#endif
        }
}

STATICFUNCTION void F0120_DUNGEONVIEW_DrawSquareD2R_CPSF(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0159_i_Direction, P0160_i_MapX, P0161_i_MapY)
#endif
REGISTER int16_t P0159_i_Direction SEPARATOR
REGISTER int16_t P0160_i_MapX      SEPARATOR
REGISTER int16_t P0161_i_MapY      FINAL_SEPARATOR
{
        int16_t L0210_ai_SquareAspect[M559_SQUARE_ASPECT_INT_COUNT];
        REGISTER int16_t L0209_i_Order;


        F0172_DUNGEON_SetSquareAspect(L0210_ai_SquareAspect, P0159_i_Direction, P0160_i_MapX, P0161_i_MapY);
        switch (L0210_ai_SquareAspect[C0_ELEMENT]) {
                case C19_ELEMENT_STAIRS_FRONT:
                        if (L0210_ai_SquareAspect[M555_STAIRS_UP]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0677_i_StairsNativeBitmapIndex_Up_Front_D2L, G0115_auc_Graphic558_Frame_StairsUpFront_D2R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0677_i_StairsNativeBitmapIndex_Up_Front_D2L, C805_ZONE_STAIRS_UP_FRONT_D2R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0079_ai_StairsNativeBitmapIndices[C02_STAIRS_BITMAP_UP_FRONT_D2L], C807_ZONE_STAIRS_UP_FRONT_D2R);
#endif
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0684_i_StairsNativeBitmapIndex_Down_Front_D2L, G0126_auc_Graphic558_Frame_StairsDownFront_D2R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0684_i_StairsNativeBitmapIndex_Down_Front_D2L, C816_ZONE_STAIRS_DOWN_FRONT_D2R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef PC_FIX_CODE_SIZE
        L0209_i_Order++;
        L0209_i_Order++;
        L0209_i_Order++;
        L0209_i_Order++;
        L0209_i_Order++;
        L0209_i_Order++;
#endif
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0079_ai_StairsNativeBitmapIndices[C09_STAIRS_BITMAP_DOWN_FRONT_D2L], C820_ZONE_STAIRS_DOWN_FRONT_D2R);
#endif
                        }
                        goto T0120027;
                case C00_ELEMENT_WALL:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0699_puc_Bitmap_WallSet_Wall_D2LCR, G0163_aauc_Graphic558_Frame_Walls[M605_VIEW_SQUARE_D2R]);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        if (G0076_B_UseFlippedWallAndFootprintsBitmaps) {
#ifdef MEDIA458_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G3006_i_WallSet_Wall_D2L, C709_ZONE_WALL_D2R);
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2107_WallSet[C08_WALL_D2L], C711_ZONE_WALL_D2R);
#endif
                        } else {
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G3007_i_WallSet_Wall_D2R, C709_ZONE_WALL_D2R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2107_WallSet[C07_WALL_D2R], C711_ZONE_WALL_D2R);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        }
#endif
                        F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L0210_ai_SquareAspect[M553_LEFT_WALL_ORNAMENT_ORDINAL], M581_VIEW_WALL_D2R_LEFT);
                        if (F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L0210_ai_SquareAspect[M552_FRONT_WALL_ORNAMENT_ORDINAL], M584_VIEW_WALL_D2R_FRONT)) {
                                L0209_i_Order = C0x0000_CELL_ORDER_ALCOVE;
                                goto T0120029;
                        }
#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
                        if ((G0069_ui_State_CPSF <= 6) && G0071_B_FuzzySectorReadingInitiated_CPSF && !G0625_i_FloppyDriveDMATimeout_CPSDF) {
                        /* If sector 7 reading operation was initiated and has completed */
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
                                if (M007_GET(G0315_i_SectorsReadFailure_CPSDF, MASK0x0001_CPS_FUZZY_SECTOR) || !M007_GET(G0644_i_FloppyDiskReadBufferContentType_CPSDF, MASK0x0001_BUFFER_CONTAINS_CPS_FUZZY_SECTOR)) {
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                if (M007_GET(G0315_i_SectorsReadFailure_CPSDF, MASK0x0001_CPS_FUZZY_SECTOR) || !M007_GET(G0644_i_FloppyDiskReadBufferContentType_CPSDF, MASK0x0001_BUFFER_CONTAINS_CPS_FUZZY_SECTOR) || (G1011_i_CopyProtectionCounter_CPSDF && ((M007_GET(((unsigned int16_t*)G0643_puc_FloppyDiskReadBuffer_CPSDF)[510], MASK0x5555_MFM_DATA_BITS) != 0x1014) /* 'F' */ || (M007_GET(((unsigned int16_t*)G0643_puc_FloppyDiskReadBuffer_CPSDF)[511], MASK0x5555_MFM_DATA_BITS) != 0x1004)))) { /* 'B' */
#endif
#ifdef MEDIA626_A31E_A31M_A33M_A35E_A35M
                                if (M007_GET(G0315_i_SectorsReadFailure_CPSDF, MASK0x0001_CPS_FUZZY_SECTOR) || !M007_GET(G0644_i_FloppyDiskReadBufferContentType_CPSDF, MASK0x0001_BUFFER_CONTAINS_CPS_FUZZY_SECTOR) || (G1011_i_CopyProtectionCounter_CPSDF && ((M007_GET(((unsigned int16_t*)G0643_puc_FloppyDiskReadBuffer_CPSDF)[1125], MASK0x5555_MFM_DATA_BITS) != 0x1014) /* 'F' */ || (M007_GET(((unsigned int16_t*)G0643_puc_FloppyDiskReadBuffer_CPSDF)[1126], MASK0x5555_MFM_DATA_BITS) != 0x1004)))) { /* 'B' */
#endif
                                /* If sector 7 reading failed */
#ifdef MEDIA423_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
                                        G1011_i_CopyProtectionCounter_CPSDF--;
#endif
                                        if (M007_GET(G0316_i_SectorsReadPreviousFailure_CPSDF, MASK0x0001_CPS_FUZZY_SECTOR)) {
                                                if (M007_GET(G0315_i_SectorsReadFailure_CPSDF, MASK0x0001_CPS_FUZZY_SECTOR)) {
                                                        G0072_ui_GraceReadRetryCount_CPSF++;
                                                        M009_CLEAR(G0315_i_SectorsReadFailure_CPSDF, MASK0x0001_CPS_FUZZY_SECTOR);
                                                }
                                                M009_CLEAR(G0316_i_SectorsReadPreviousFailure_CPSDF, MASK0x0001_CPS_FUZZY_SECTOR);
                                        } else {
                                                goto T0120011;
                                        }
                                        G0069_ui_State_CPSF += 10; /* Go back to previous step */
                                        T0120011: ;
                                } else {
                                        G0070_B_FuzzySectorAnalyzed_CPSF = C0_FALSE;
#ifdef MEDIA315_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M /* CHANGE7_10_IMPROVEMENT */
                                        G0073_i_StopFreeingMemory_CPSF = C00555_TRUE; /* This variable will be reset to C00512_FALSE by graphic #21 by the time its value is checked in F0128_DUNGEONVIEW_Draw_CPSF if the next call and patched function executes normally */
#endif
#ifdef MEDIA423_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
                                        G1011_i_CopyProtectionCounter_CPSDF = 2;
#endif
                                        F0137_CPSEF_PatchFunctionWithHiddenCodeLauncher(M005_RANDOM(2) ? (char*)F0124_DUNGEONVIEW_DrawSquareD1C : (char*)F0125_DUNGEONVIEW_DrawSquareD0L, F0489_MEMORY_GetNativeBitmapOrGraphic, C021_GRAPHIC_CHECK_FUZZY_BITS_IN_FUZZY_SECTOR, G0643_puc_FloppyDiskReadBuffer_CPSDF, G0083_api_Graphic21Result_CPSF, G0104_api_CodePatches_CPSF, 3);
                                        G0069_ui_State_CPSF += 5;
                                }
                        }
#endif
#endif
                        return;
                case C18_ELEMENT_STAIRS_SIDE:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0689_i_StairsNativeBitmapIndex_Side_D2L, G0133_auc_Graphic558_Frame_StairsSide_D2R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0689_i_StairsNativeBitmapIndex_Side_D2L, C823_ZONE_STAIRS_SIDE_D2R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0079_ai_StairsNativeBitmapIndices[C14_STAIRS_BITMAP_SIDE_D2L], C827_ZONE_STAIRS_SIDE_D2R);
#endif
                case C16_ELEMENT_DOOR_SIDE:
                        L0209_i_Order = C0x0431_CELL_ORDER_BACKLEFT_FRONTRIGHT_FRONTLEFT;
                        goto T0120028;
                case C17_ELEMENT_DOOR_FRONT:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0210_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M593_VIEW_FLOOR_D2R);
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0210_ai_SquareAspect[M550_FIRST_THING], P0159_i_Direction, P0160_i_MapX, P0161_i_MapY, M605_VIEW_SQUARE_D2R, C0x0128_CELL_ORDER_DOORPASS1_BACKRIGHT_BACKLEFT);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0703_puc_Bitmap_WallSet_DoorFrameTop_D2LCR, G0175_auc_Graphic558_Frame_DoorFrameTop_D2R);
                        F0111_DUNGEONVIEW_DrawDoor(L0210_ai_SquareAspect[M557_DOOR_THING_INDEX], L0210_ai_SquareAspect[M556_DOOR_STATE], G0694_ai_DoorNativeBitmapIndex_Front_D2LCR, M075_BITMAP_BYTE_COUNT(64, 61), C1_VIEW_DOOR_ORNAMENT_D2LCR, &G0184_s_Graphic558_Frames_Door_D2R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2113_DoorFrameTopD2R, C727_ZONE_DOOR_FRAME_TOP_D2R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2113_DoorFrameTopD2R, C731_ZONE_DOOR_FRAME_TOP_D2R);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0111_DUNGEONVIEW_DrawDoor(L0210_ai_SquareAspect[M557_DOOR_THING_INDEX], L0210_ai_SquareAspect[M556_DOOR_STATE], G0694_ai_DoorNativeBitmapIndex_Front_D2LCR, C1_VIEW_DOOR_ORNAMENT_D2LCR, M629_ZONE_DOOR_D2R);
#endif
                        L0209_i_Order = C0x0439_CELL_ORDER_DOORPASS2_FRONTRIGHT_FRONTLEFT;
                        goto T0120029;
                case C02_ELEMENT_PIT:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(L0210_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M762_GRAPHIC_FLOOR_PIT_INVISIBLE_D2L : M756_GRAPHIC_FLOOR_PIT_D2L, G0145_auc_Graphic558_Frame_FloorPit_D2R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(L0210_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M762_GRAPHIC_FLOOR_PIT_INVISIBLE_D2L : M756_GRAPHIC_FLOOR_PIT_D2L, C855_ZONE_FLOORPIT_D2R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(L0210_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M762_GRAPHIC_FLOOR_PIT_INVISIBLE_D2L : M756_GRAPHIC_FLOOR_PIT_D2L, C857_ZONE_FLOORPIT_D2R);
#endif
                case C05_ELEMENT_TELEPORTER:
                case C01_ELEMENT_CORRIDOR:
                        T0120027:
                        L0209_i_Order = C0x4312_CELL_ORDER_BACKRIGHT_BACKLEFT_FRONTRIGHT_FRONTLEFT;
                        T0120028:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0210_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M593_VIEW_FLOOR_D2R); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0112_DUNGEONVIEW_DrawCeilingPit(C063_GRAPHIC_CEILING_PIT_D2L, G0154_auc_Graphic558_Frame_CeilingPit_D2R, P0160_i_MapX, P0161_i_MapY, C1_TRUE);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0112_DUNGEONVIEW_DrawCeilingPit(C063_GRAPHIC_CEILING_PIT_D2L, C864_ZONE_CEILING_PIT_D2R, P0160_i_MapX, P0161_i_MapY, C1_TRUE);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0112_DUNGEONVIEW_DrawCeilingPit(C064_GRAPHIC_CEILING_PIT_D2L, C866_ZONE_CEILING_PIT_D2R, P0160_i_MapX, P0161_i_MapY, C1_TRUE);
#endif
                        T0120029:
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0210_ai_SquareAspect[M550_FIRST_THING], P0159_i_Direction, P0160_i_MapX, P0161_i_MapY, M605_VIEW_SQUARE_D2R, L0209_i_Order);
        }
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if ((L0210_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) && L0210_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (L0210_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) {
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M605_VIEW_SQUARE_D2R], G0163_aauc_Graphic558_Frame_Walls[M605_VIEW_SQUARE_D2R]);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M605_VIEW_SQUARE_D2R], C709_ZONE_WALL_D2R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[M605_VIEW_SQUARE_D2R]], C711_ZONE_WALL_D2R);
#endif
        }
}

STATICFUNCTION void F0121_DUNGEONVIEW_DrawSquareD2C(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0162_i_Direction, P0163_i_MapX, P0164_i_MapY)
#endif
REGISTER int16_t P0162_i_Direction SEPARATOR
REGISTER int16_t P0163_i_MapX      SEPARATOR
REGISTER int16_t P0164_i_MapY      FINAL_SEPARATOR
{
        int16_t L0212_ai_SquareAspect[M559_SQUARE_ASPECT_INT_COUNT];
        REGISTER int16_t L0211_i_Order;


        F0172_DUNGEON_SetSquareAspect(L0212_ai_SquareAspect, P0162_i_Direction, P0163_i_MapX, P0164_i_MapY);
        switch (L0212_ai_SquareAspect[C0_ELEMENT]) {
                case C19_ELEMENT_STAIRS_FRONT:
                        if (L0212_ai_SquareAspect[M555_STAIRS_UP]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0678_i_StairsNativeBitmapIndex_Up_Front_D2C, G0114_auc_Graphic558_Frame_StairsUpFront_D2C);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0678_i_StairsNativeBitmapIndex_Up_Front_D2C, C804_ZONE_STAIRS_UP_FRONT_D2C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C03_STAIRS_BITMAP_UP_FRONT_D2C], C806_ZONE_STAIRS_UP_FRONT_D2C);
#endif
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0685_i_StairsNativeBitmapIndex_Down_Front_D2C, G0125_auc_Graphic558_Frame_StairsDownFront_D2C);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0685_i_StairsNativeBitmapIndex_Down_Front_D2C, C815_ZONE_STAIRS_DOWN_FRONT_D2C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef PC_FIX_CODE_SIZE
        L0211_i_Order++;
        L0211_i_Order++;
        L0211_i_Order++;
        L0211_i_Order++;
        L0211_i_Order++;
        L0211_i_Order++;
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C10_STAIRS_BITMAP_DOWN_FRONT_D2C], C819_ZONE_STAIRS_DOWN_FRONT_D2C);
#endif
                        }
                        goto T0121015;
                case C00_ELEMENT_WALL:
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_15_OPTIMIZATION */
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0699_puc_Bitmap_WallSet_Wall_D2LCR, G0163_aauc_Graphic558_Frame_Walls[M603_VIEW_SQUARE_D2C]);
#endif
#ifdef MEDIA267_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G /* CHANGE7_15_OPTIMIZATION */
                        F0101_DUNGEONVIEW_DrawWallSetBitmapWithoutTransparency(G0699_puc_Bitmap_WallSet_Wall_D2LCR, G0163_aauc_Graphic558_Frame_Walls[M603_VIEW_SQUARE_D2C]);
#endif
#ifdef MEDIA458_P20JA_P20JB
                        F0792_DUNGEONVIEW_DrawBitmapYYY(G3012_i_WallSet_Wall_D2C, C707_ZONE_WALL_D2C, G0076_B_UseFlippedWallAndFootprintsBitmaps);
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                        F0792_DUNGEONVIEW_DrawBitmapYYY(G2107_WallSet[C09_WALL_D2C], C709_ZONE_WALL_D2C, G0076_B_UseFlippedWallAndFootprintsBitmaps);
#endif
#ifdef MEDIA506_F20E_F20J_X30J
                        F0765_DUNGEONVIEW_DrawBitmapWithoutTransparency(G3012_i_WallSet_Wall_D2C, C707_ZONE_WALL_D2C);
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        F0765_DUNGEONVIEW_DrawBitmapWithoutTransparency(G2107_WallSet[C09_WALL_D2C], C709_ZONE_WALL_D2C);
#endif
                        if (F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L0212_ai_SquareAspect[M552_FRONT_WALL_ORNAMENT_ORDINAL], M583_VIEW_WALL_D2C_FRONT)) {
                                L0211_i_Order = C0x0000_CELL_ORDER_ALCOVE;
                                goto T0121016;
                        }
                        return;
                case C17_ELEMENT_DOOR_FRONT:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0212_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M592_VIEW_FLOOR_D2C);
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0212_ai_SquareAspect[M550_FIRST_THING], P0162_i_Direction, P0163_i_MapX, P0164_i_MapY, M603_VIEW_SQUARE_D2C, C0x0218_CELL_ORDER_DOORPASS1_BACKLEFT_BACKRIGHT);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0703_puc_Bitmap_WallSet_DoorFrameTop_D2LCR, G0174_auc_Graphic558_Frame_DoorFrameTop_D2C);
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0707_puc_Bitmap_WallSet_DoorFrameLeft_D2C, G0168_auc_Graphic558_Frame_DoorFrameLeft_D2C);
                        F0007_MAIN_CopyBytes(G0707_puc_Bitmap_WallSet_DoorFrameLeft_D2C, G0074_puc_Bitmap_Temporary, M075_BITMAP_BYTE_COUNT(48, 65));
                        F0103_DUNGEONVIEW_DrawDoorFrameBitmapFlippedHorizontally(G0074_puc_Bitmap_Temporary, G0169_auc_Graphic558_Frame_DoorFrameRight_D2C);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2115_DoorFrameTopD2LCR, C726_ZONE_DOOR_FRAME_TOP_D2C);
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2118_DoorFrameLeftD2C, C720_ZONE_DOOR_FRAME_LEFT_D2C);
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2118_DoorFrameLeftD2C, C721_ZONE_DOOR_FRAME_RIGHT_D2C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2115_DoorFrameTopD2LCR, C730_ZONE_DOOR_FRAME_TOP_D2C);
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2118_DoorFrameLeftD2C, C724_ZONE_DOOR_FRAME_LEFT_D2C);
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2118_DoorFrameLeftD2C, C725_ZONE_DOOR_FRAME_RIGHT_D2C);
#endif
                        if (((DOOR*)G0284_apuc_ThingData[C00_THING_TYPE_DOOR])[L0212_ai_SquareAspect[M557_DOOR_THING_INDEX]].Button) {
                                F0110_DUNGEONVIEW_DrawDoorButton(M000_INDEX_TO_ORDINAL(C0_DOOR_BUTTON), C2_VIEW_DOOR_BUTTON_D2C);
                        }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0111_DUNGEONVIEW_DrawDoor(L0212_ai_SquareAspect[M557_DOOR_THING_INDEX], L0212_ai_SquareAspect[M556_DOOR_STATE], G0694_ai_DoorNativeBitmapIndex_Front_D2LCR, M075_BITMAP_BYTE_COUNT(64, 61), C1_VIEW_DOOR_ORNAMENT_D2LCR, &G0183_s_Graphic558_Frames_Door_D2C);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0111_DUNGEONVIEW_DrawDoor(L0212_ai_SquareAspect[M557_DOOR_THING_INDEX], L0212_ai_SquareAspect[M556_DOOR_STATE], G0694_ai_DoorNativeBitmapIndex_Front_D2LCR, C1_VIEW_DOOR_ORNAMENT_D2LCR, M628_ZONE_DOOR_D2C);
#endif
                        L0211_i_Order = C0x0349_CELL_ORDER_DOORPASS2_FRONTLEFT_FRONTRIGHT;
                        goto T0121016;
                case C02_ELEMENT_PIT:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0212_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M763_GRAPHIC_FLOOR_PIT_INVISIBLE_D2C : M757_GRAPHIC_FLOOR_PIT_D2C, G0144_auc_Graphic558_Frame_FloorPit_D2C);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0212_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M763_GRAPHIC_FLOOR_PIT_INVISIBLE_D2C : M757_GRAPHIC_FLOOR_PIT_D2C, C854_ZONE_FLOORPIT_D2C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0212_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M763_GRAPHIC_FLOOR_PIT_INVISIBLE_D2C : M757_GRAPHIC_FLOOR_PIT_D2C, C856_ZONE_FLOORPIT_D2C);
#endif
                case C05_ELEMENT_TELEPORTER:
                case C01_ELEMENT_CORRIDOR:
                        T0121015:
                        L0211_i_Order = C0x3421_CELL_ORDER_BACKLEFT_BACKRIGHT_FRONTLEFT_FRONTRIGHT;
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0212_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M592_VIEW_FLOOR_D2C); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0112_DUNGEONVIEW_DrawCeilingPit(C064_GRAPHIC_CEILING_PIT_D2C, G0153_auc_Graphic558_Frame_CeilingPit_D2C, P0163_i_MapX, P0164_i_MapY, C0_FALSE);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0112_DUNGEONVIEW_DrawCeilingPit(C064_GRAPHIC_CEILING_PIT_D2C, C863_ZONE_CEILING_PIT_D2C, P0163_i_MapX, P0164_i_MapY, C0_FALSE);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0112_DUNGEONVIEW_DrawCeilingPit(C065_GRAPHIC_CEILING_PIT_D2C, C865_ZONE_CEILING_PIT_D2C, P0163_i_MapX, P0164_i_MapY, C0_FALSE);
#endif
                        T0121016:
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0212_ai_SquareAspect[M550_FIRST_THING], P0162_i_Direction, P0163_i_MapX, P0164_i_MapY, M603_VIEW_SQUARE_D2C, L0211_i_Order);
        }
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if ((L0212_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) && L0212_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (L0212_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) {
#endif
#ifdef MEDIA088_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A22G
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M603_VIEW_SQUARE_D2C], G0163_aauc_Graphic558_Frame_Walls[M603_VIEW_SQUARE_D2C], L0212_ai_SquareAspect); /* BUG0_01 Coding error without consequence. Function call with wrong number of parameters. It should be called with 2 parameters. No consequence because additional parameters are ignored */
#endif
#ifdef MEDIA448_A21E_A22E
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M603_VIEW_SQUARE_D2C], G0163_aauc_Graphic558_Frame_Walls[M603_VIEW_SQUARE_D2C]);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M603_VIEW_SQUARE_D2C], C707_ZONE_WALL_D2C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[M603_VIEW_SQUARE_D2C]], C709_ZONE_WALL_D2C);
#endif
        }
}

STATICFUNCTION void F0122_DUNGEONVIEW_DrawSquareD1L(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0165_i_Direction, P0166_i_MapX, P0167_i_MapY)
#endif
REGISTER int16_t P0165_i_Direction SEPARATOR
REGISTER int16_t P0166_i_MapX      SEPARATOR
REGISTER int16_t P0167_i_MapY      FINAL_SEPARATOR
{
        int16_t L0214_ai_SquareAspect[M559_SQUARE_ASPECT_INT_COUNT];
        REGISTER int16_t L0213_i_Order;


        F0172_DUNGEON_SetSquareAspect(L0214_ai_SquareAspect, P0165_i_Direction, P0166_i_MapX, P0167_i_MapY);
        switch (L0214_ai_SquareAspect[C0_ELEMENT]) {
                case C19_ELEMENT_STAIRS_FRONT:
                        if (L0214_ai_SquareAspect[M555_STAIRS_UP]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0679_i_StairsNativeBitmapIndex_Up_Front_D1L, G0116_auc_Graphic558_Frame_StairsUpFront_D1L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0679_i_StairsNativeBitmapIndex_Up_Front_D1L, C806_ZONE_STAIRS_UP_FRONT_D1L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C04_STAIRS_BITMAP_UP_FRONT_D1L], C808_ZONE_STAIRS_UP_FRONT_D1L);
#endif
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0686_i_StairsNativeBitmapIndex_Down_Front_D1L, G0127_auc_Graphic558_Frame_StairsDownFront_D1L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0686_i_StairsNativeBitmapIndex_Down_Front_D1L, C817_ZONE_STAIRS_DOWN_FRONT_D1L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef PC_FIX_CODE_SIZE
        L0213_i_Order++;
        L0213_i_Order++;
        L0213_i_Order++;
        L0213_i_Order++;
        L0213_i_Order++;
        L0213_i_Order++;
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C11_STAIRS_BITMAP_DOWN_FRONT_D1L], C821_ZONE_STAIRS_DOWN_FRONT_D1L);
#endif
                        }
                        goto T0122019;
                case C00_ELEMENT_WALL:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0700_puc_Bitmap_WallSet_Wall_D1LCR, G0163_aauc_Graphic558_Frame_Walls[M607_VIEW_SQUARE_D1L]);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        if (G0076_B_UseFlippedWallAndFootprintsBitmaps) {
#ifdef MEDIA458_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G3009_i_WallSet_Wall_D1R, C711_ZONE_WALL_D1L);
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2107_WallSet[C02_WALL_D1R], C713_ZONE_WALL_D1L);
#endif
                        } else {
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G3008_i_WallSet_Wall_D1L, C711_ZONE_WALL_D1L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2107_WallSet[C03_WALL_D1L], C713_ZONE_WALL_D1L);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        }
#endif
                        F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L0214_ai_SquareAspect[M551_RIGHT_WALL_ORNAMENT_ORDINAL], M585_VIEW_WALL_D1L_RIGHT);
                        return;
                case C18_ELEMENT_STAIRS_SIDE:
                        if (L0214_ai_SquareAspect[M555_STAIRS_UP]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0690_i_StairsNativeBitmapIndex_Up_Side_D1L, G0134_auc_Graphic558_Frame_StairsUpSide_D1L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0690_i_StairsNativeBitmapIndex_Up_Side_D1L, C824_ZONE_STAIRS_UP_SIDE_D1L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C15_STAIRS_BITMAP_UP_SIDE_D1L], C828_ZONE_STAIRS_UP_SIDE_D1L);
#endif
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0691_i_StairsNativeBitmapIndex_Down_Side_D1L, G0136_auc_Graphic558_Frame_StairsDownSide_D1L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0691_i_StairsNativeBitmapIndex_Down_Side_D1L, C826_ZONE_STAIRS_DOWN_SIDE_D1L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef PC_FIX_CODE_SIZE
        L0213_i_Order++;
        L0213_i_Order++;
        L0213_i_Order++;
        L0213_i_Order++;
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C16_STAIRS_BITMAP_DOWN_SIDE_D1L], C830_ZONE_STAIRS_DOWN_SIDE_D1L);
#endif
                        }
                case C16_ELEMENT_DOOR_SIDE:
                        L0213_i_Order = C0x0032_CELL_ORDER_BACKRIGHT_FRONTRIGHT;
                        goto T0122020;
                case C17_ELEMENT_DOOR_FRONT:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0214_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M594_VIEW_FLOOR_D1L);
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0214_ai_SquareAspect[M550_FIRST_THING], P0165_i_Direction, P0166_i_MapX, P0167_i_MapY, M607_VIEW_SQUARE_D1L, C0x0028_CELL_ORDER_DOORPASS1_BACKRIGHT);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0704_puc_Bitmap_WallSet_DoorFrameTop_D1LCR, G0176_auc_Graphic558_Frame_DoorFrameTop_D1L);
                        F0111_DUNGEONVIEW_DrawDoor(L0214_ai_SquareAspect[M557_DOOR_THING_INDEX], L0214_ai_SquareAspect[M556_DOOR_STATE], G0695_ai_DoorNativeBitmapIndex_Front_D1LCR, M075_BITMAP_BYTE_COUNT(96, 88), C2_VIEW_DOOR_ORNAMENT_D1LCR, &G0185_s_Graphic558_Frames_Door_D1L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2111_DoorFrameTopD1L, C728_ZONE_DOOR_FRAME_TOP_D1L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2111_DoorFrameTopD1L, C732_ZONE_DOOR_FRAME_TOP_D1L);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0111_DUNGEONVIEW_DrawDoor(L0214_ai_SquareAspect[M557_DOOR_THING_INDEX], L0214_ai_SquareAspect[M556_DOOR_STATE], G0695_ai_DoorNativeBitmapIndex_Front_D1LCR, C2_VIEW_DOOR_ORNAMENT_D1LCR, M630_ZONE_DOOR_D1L);
#endif
                        L0213_i_Order = C0x0039_CELL_ORDER_DOORPASS2_FRONTRIGHT;
                        goto T0122021;
                case C02_ELEMENT_PIT:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0214_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M764_GRAPHIC_FLOOR_PIT_INVISIBLE_D1L : M758_GRAPHIC_FLOOR_PIT_D1L, G0146_auc_Graphic558_Frame_FloorPit_D1L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0214_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M764_GRAPHIC_FLOOR_PIT_INVISIBLE_D1L : M758_GRAPHIC_FLOOR_PIT_D1L, C856_ZONE_FLOORPIT_D1L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0214_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M764_GRAPHIC_FLOOR_PIT_INVISIBLE_D1L : M758_GRAPHIC_FLOOR_PIT_D1L, C858_ZONE_FLOORPIT_D1L);
#endif
                case C05_ELEMENT_TELEPORTER:
                case C01_ELEMENT_CORRIDOR:
                        T0122019:
                        L0213_i_Order = C0x0032_CELL_ORDER_BACKRIGHT_FRONTRIGHT;
                        T0122020:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0214_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M594_VIEW_FLOOR_D1L); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0112_DUNGEONVIEW_DrawCeilingPit(C065_GRAPHIC_CEILING_PIT_D1L, G0155_auc_Graphic558_Frame_CeilingPit_D1L, P0166_i_MapX, P0167_i_MapY, C0_FALSE);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0112_DUNGEONVIEW_DrawCeilingPit(C065_GRAPHIC_CEILING_PIT_D1L, C865_ZONE_CEILING_PIT_D1L, P0166_i_MapX, P0167_i_MapY, C0_FALSE);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0112_DUNGEONVIEW_DrawCeilingPit(C066_GRAPHIC_CEILING_PIT_D1L, C867_ZONE_CEILING_PIT_D1L, P0166_i_MapX, P0167_i_MapY, C0_FALSE);
#endif
                        T0122021:
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0214_ai_SquareAspect[M550_FIRST_THING], P0165_i_Direction, P0166_i_MapX, P0167_i_MapY, M607_VIEW_SQUARE_D1L, L0213_i_Order);
        }
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if ((L0214_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) && L0214_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (L0214_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) {
#endif
#ifdef MEDIA088_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A22G
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M607_VIEW_SQUARE_D1L], G0163_aauc_Graphic558_Frame_Walls[M607_VIEW_SQUARE_D1L], L0214_ai_SquareAspect); /* BUG0_01 Coding error without consequence. Function call with wrong number of parameters. It should be called with 2 parameters. No consequence because additional parameters are ignored */
#endif
#ifdef MEDIA448_A21E_A22E
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M607_VIEW_SQUARE_D1L], G0163_aauc_Graphic558_Frame_Walls[M607_VIEW_SQUARE_D1L]);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M607_VIEW_SQUARE_D1L], C711_ZONE_WALL_D1L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[M607_VIEW_SQUARE_D1L]], C713_ZONE_WALL_D1L);
#endif
        }
}

STATICFUNCTION void F0123_DUNGEONVIEW_DrawSquareD1R(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0168_i_Direction, P0169_i_MapX, P0170_i_MapY)
#endif
REGISTER int16_t P0168_i_Direction SEPARATOR
REGISTER int16_t P0169_i_MapX      SEPARATOR
REGISTER int16_t P0170_i_MapY      FINAL_SEPARATOR
{
        int16_t L0216_ai_SquareAspect[M559_SQUARE_ASPECT_INT_COUNT];
        REGISTER int16_t L0215_i_Order;


        F0172_DUNGEON_SetSquareAspect(L0216_ai_SquareAspect, P0168_i_Direction, P0169_i_MapX, P0170_i_MapY);
        switch (L0216_ai_SquareAspect[C0_ELEMENT]) {
                case C19_ELEMENT_STAIRS_FRONT:
                        if (L0216_ai_SquareAspect[M555_STAIRS_UP]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0679_i_StairsNativeBitmapIndex_Up_Front_D1L, G0118_auc_Graphic558_Frame_StairsUpFront_D1R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0679_i_StairsNativeBitmapIndex_Up_Front_D1L, C808_ZONE_STAIRS_UP_FRONT_D1R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0079_ai_StairsNativeBitmapIndices[C04_STAIRS_BITMAP_UP_FRONT_D1L], C810_ZONE_STAIRS_UP_FRONT_D1R);
#endif
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0686_i_StairsNativeBitmapIndex_Down_Front_D1L, G0129_auc_Graphic558_Frame_StairsDownFront_D1R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0686_i_StairsNativeBitmapIndex_Down_Front_D1L, C819_ZONE_STAIRS_DOWN_FRONT_D1R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef PC_FIX_CODE_SIZE
        L0215_i_Order++;
        L0215_i_Order++;
        L0215_i_Order++;
        L0215_i_Order++;
        L0215_i_Order++;
        L0215_i_Order++;
#endif
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0079_ai_StairsNativeBitmapIndices[C11_STAIRS_BITMAP_DOWN_FRONT_D1L], C823_ZONE_STAIRS_DOWN_FRONT_D1R);
#endif
                        }
                        goto T0123019;
                case C00_ELEMENT_WALL:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0700_puc_Bitmap_WallSet_Wall_D1LCR, G0163_aauc_Graphic558_Frame_Walls[M608_VIEW_SQUARE_D1R]);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        if (G0076_B_UseFlippedWallAndFootprintsBitmaps) {
#ifdef MEDIA458_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G3008_i_WallSet_Wall_D1L, C712_ZONE_WALL_D1R);
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2107_WallSet[C03_WALL_D1L], C714_ZONE_WALL_D1R);
#endif
                        } else {
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G3009_i_WallSet_Wall_D1R, C712_ZONE_WALL_D1R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2107_WallSet[C02_WALL_D1R], C714_ZONE_WALL_D1R);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        }
#endif
                        F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L0216_ai_SquareAspect[M553_LEFT_WALL_ORNAMENT_ORDINAL], M586_VIEW_WALL_D1R_LEFT);
                        return;
                case C18_ELEMENT_STAIRS_SIDE:
                        if (L0216_ai_SquareAspect[M555_STAIRS_UP]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0690_i_StairsNativeBitmapIndex_Up_Side_D1L, G0135_auc_Graphic558_Frame_StairsUpSide_D1R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0690_i_StairsNativeBitmapIndex_Up_Side_D1L, C825_ZONE_STAIRS_UP_SIDE_D1R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0079_ai_StairsNativeBitmapIndices[C15_STAIRS_BITMAP_UP_SIDE_D1L], C829_ZONE_STAIRS_UP_SIDE_D1R);
#endif
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0691_i_StairsNativeBitmapIndex_Down_Side_D1L, G0137_auc_Graphic558_Frame_StairsDownSide_D1R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0691_i_StairsNativeBitmapIndex_Down_Side_D1L, C827_ZONE_STAIRS_DOWN_SIDE_D1R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef PC_FIX_CODE_SIZE
        L0215_i_Order++;
        L0215_i_Order++;
        L0215_i_Order++;
        L0215_i_Order++;
#endif
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0079_ai_StairsNativeBitmapIndices[C16_STAIRS_BITMAP_DOWN_SIDE_D1L], C831_ZONE_STAIRS_DOWN_SIDE_D1R);
#endif
                        }
                case C16_ELEMENT_DOOR_SIDE:
                        L0215_i_Order = C0x0041_CELL_ORDER_BACKLEFT_FRONTLEFT;
                        goto T0123020;
                case C17_ELEMENT_DOOR_FRONT:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0216_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M596_VIEW_FLOOR_D1R);
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0216_ai_SquareAspect[M550_FIRST_THING], P0168_i_Direction, P0169_i_MapX, P0170_i_MapY, M608_VIEW_SQUARE_D1R, C0x0018_CELL_ORDER_DOORPASS1_BACKLEFT);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0704_puc_Bitmap_WallSet_DoorFrameTop_D1LCR, G0178_auc_Graphic558_Frame_DoorFrameTop_D1R);
                        F0111_DUNGEONVIEW_DrawDoor(L0216_ai_SquareAspect[M557_DOOR_THING_INDEX], L0216_ai_SquareAspect[M556_DOOR_STATE], G0695_ai_DoorNativeBitmapIndex_Front_D1LCR, M075_BITMAP_BYTE_COUNT(96, 88), C2_VIEW_DOOR_ORNAMENT_D1LCR, &G0187_s_Graphic558_Frames_Door_D1R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2110_DoorFrameTopD1R, C730_ZONE_DOOR_FRAME_TOP_D1R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2110_DoorFrameTopD1R, C734_ZONE_DOOR_FRAME_TOP_D1R);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0111_DUNGEONVIEW_DrawDoor(L0216_ai_SquareAspect[M557_DOOR_THING_INDEX], L0216_ai_SquareAspect[M556_DOOR_STATE], G0695_ai_DoorNativeBitmapIndex_Front_D1LCR, C2_VIEW_DOOR_ORNAMENT_D1LCR, M632_ZONE_DOOR_D1R);
#endif
                        L0215_i_Order = C0x0049_CELL_ORDER_DOORPASS2_FRONTLEFT;
                        goto T0123021;
                case C02_ELEMENT_PIT:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(L0216_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M764_GRAPHIC_FLOOR_PIT_INVISIBLE_D1L : M758_GRAPHIC_FLOOR_PIT_D1L, G0148_auc_Graphic558_Frame_FloorPit_D1R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(L0216_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M764_GRAPHIC_FLOOR_PIT_INVISIBLE_D1L : M758_GRAPHIC_FLOOR_PIT_D1L, C858_ZONE_FLOORPIT_D1R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(L0216_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M764_GRAPHIC_FLOOR_PIT_INVISIBLE_D1L : M758_GRAPHIC_FLOOR_PIT_D1L, C860_ZONE_FLOORPIT_D1R);
#endif
                case C05_ELEMENT_TELEPORTER:
                case C01_ELEMENT_CORRIDOR:
                        T0123019:
                        L0215_i_Order = C0x0041_CELL_ORDER_BACKLEFT_FRONTLEFT;
                        T0123020:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0216_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M596_VIEW_FLOOR_D1R); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0112_DUNGEONVIEW_DrawCeilingPit(C065_GRAPHIC_CEILING_PIT_D1L, G0157_auc_Graphic558_Frame_CeilingPit_D1R, P0169_i_MapX, P0170_i_MapY, C1_TRUE);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0112_DUNGEONVIEW_DrawCeilingPit(C065_GRAPHIC_CEILING_PIT_D1L, C867_ZONE_CEILING_PIT_D1R, P0169_i_MapX, P0170_i_MapY, C1_TRUE);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0112_DUNGEONVIEW_DrawCeilingPit(C066_GRAPHIC_CEILING_PIT_D1L, C869_ZONE_CEILING_PIT_D1R, P0169_i_MapX, P0170_i_MapY, C1_TRUE);
#endif
                        T0123021:
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0216_ai_SquareAspect[M550_FIRST_THING], P0168_i_Direction, P0169_i_MapX, P0170_i_MapY, M608_VIEW_SQUARE_D1R, L0215_i_Order);
        }
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if ((L0216_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) && L0216_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (L0216_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) {
#endif
#ifdef MEDIA088_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A22G
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M608_VIEW_SQUARE_D1R], G0163_aauc_Graphic558_Frame_Walls[M608_VIEW_SQUARE_D1R], L0216_ai_SquareAspect); /* BUG0_01 Coding error without consequence. Function call with wrong number of parameters. It should be called with 2 parameters. No consequence because additional parameters are ignored */
#endif
#ifdef MEDIA448_A21E_A22E
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M608_VIEW_SQUARE_D1R], G0163_aauc_Graphic558_Frame_Walls[M608_VIEW_SQUARE_D1R]);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M608_VIEW_SQUARE_D1R], C712_ZONE_WALL_D1R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[M608_VIEW_SQUARE_D1R]], C714_ZONE_WALL_D1R);
#endif
        }
}

STATICFUNCTION void F0124_DUNGEONVIEW_DrawSquareD1C(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0171_i_Direction, P0172_i_MapX, P0173_i_MapY)
#endif
REGISTER int16_t P0171_i_Direction SEPARATOR
REGISTER int16_t P0172_i_MapX      SEPARATOR
REGISTER int16_t P0173_i_MapY      FINAL_SEPARATOR
{
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER int16_t L0217_i_Order;
#endif
        int16_t L0218_ai_SquareAspect[M559_SQUARE_ASPECT_INT_COUNT];
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        unsigned char* L0219_puc_Bitmap;
        REGISTER int16_t L0217_i_Order;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        REGISTER unsigned char* L0219_puc_Bitmap;
        REGISTER unsigned char* L2491_puc_Bitmap;
        STRUCT2 L2493_s_Struct2;
        int16_t L2494_ai_XYZ[4];
#endif


        F0172_DUNGEON_SetSquareAspect(L0218_ai_SquareAspect, P0171_i_Direction, P0172_i_MapX, P0173_i_MapY);
        switch (G0285_i_SquareAheadElement = L0218_ai_SquareAspect[C0_ELEMENT]) {
                case C19_ELEMENT_STAIRS_FRONT:
                        if (L0218_ai_SquareAspect[M555_STAIRS_UP]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0680_i_StairsNativeBitmapIndex_Up_Front_D1C, G0117_auc_Graphic558_Frame_StairsUpFront_D1C);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0680_i_StairsNativeBitmapIndex_Up_Front_D1C, C807_ZONE_STAIRS_UP_FRONT_D1C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C05_STAIRS_BITMAP_UP_FRONT_D1C], C809_ZONE_STAIRS_UP_FRONT_D1C);
#endif
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0687_i_StairsNativeBitmapIndex_Down_Front_D1C, G0128_auc_Graphic558_Frame_StairsDownFront_D1C);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0687_i_StairsNativeBitmapIndex_Down_Front_D1C, C818_ZONE_STAIRS_DOWN_FRONT_D1C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef PC_FIX_CODE_SIZE
        P0173_i_MapY++;
        P0173_i_MapY++;
        P0173_i_MapY++;
        P0173_i_MapY++;
        P0173_i_MapY++;
        P0173_i_MapY++;
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C12_STAIRS_BITMAP_DOWN_FRONT_D1C], C822_ZONE_STAIRS_DOWN_FRONT_D1C);
#endif
                        }
                        goto T0124017;
                case C00_ELEMENT_WALL:
                        G0286_B_FacingAlcove = C0_FALSE;
                        G0287_B_FacingViAltar = C0_FALSE;
                        G0288_B_FacingFountain = C0_FALSE;
#ifdef MEDIA128_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G20E_G21E_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        if (G0407_s_Party.Event73Count_ThievesEye) {
                                F0491_CACHE_IsDerivedBitmapInCache(C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA);
#ifdef MEDIA113_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G20E_G21E
                                F0132_VIDEO_Blit(G0296_puc_Bitmap_Viewport, F0492_CACHE_GetDerivedBitmap(C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA), G0107_auc_Graphic558_Box_ThievesEye_VisibleArea, M768_BOX_LEFT(G0106_auc_Graphic558_Box_ThievesEye_ViewportVisibleArea), M770_BOX_TOP(G0106_auc_Graphic558_Box_ThievesEye_ViewportVisibleArea), C112_BYTE_WIDTH_VIEWPORT, C048_BYTE_WIDTH, CM1_COLOR_NO_TRANSPARENCY);
#endif
#ifdef MEDIA433_A20E_A20F_A20G_A21E_A22E_A22G
                                F0132_VIDEO_Blit(G0296_puc_Bitmap_Viewport, F0492_CACHE_GetDerivedBitmap(C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA), G0107_auc_Graphic558_Box_ThievesEye_VisibleArea, M768_BOX_LEFT(G0106_auc_Graphic558_Box_ThievesEye_ViewportVisibleArea), M770_BOX_TOP(G0106_auc_Graphic558_Box_ThievesEye_ViewportVisibleArea), C112_BYTE_WIDTH_VIEWPORT, C048_BYTE_WIDTH, CM1_COLOR_NO_TRANSPARENCY, 136, 95);
#endif
                                L0219_puc_Bitmap = F0489_MEMORY_GetNativeBitmapOrGraphic(C041_GRAPHIC_HOLE_IN_WALL);
#ifdef MEDIA113_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G20E_G21E
                                F0132_VIDEO_Blit(L0219_puc_Bitmap, F0492_CACHE_GetDerivedBitmap(C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA), G0107_auc_Graphic558_Box_ThievesEye_VisibleArea, 0, 0, C048_BYTE_WIDTH, C048_BYTE_WIDTH, C10_COLOR_FLESH); /* BUG0_74 Creatures are drawn with wrong colors when viewed through a wall with the 'Thieve's Eye' spell. The 'hole in wall' graphic is applied to the visible area with transparency on color 10. However the visible area may contain creature graphics that use color 9. When the bitmap is drawn below with transparency on color 9 then the creature graphic is alterated: pixels using color 9 are transparent and the background wall is visible through the creature graphic (grey/white pixels). To fix this bug, the 'hole in wall' graphic should be applied to the wall graphic first (in a temporary buffer) and then the wall with the hole should be drawn over the visible area */
#endif
#ifdef MEDIA433_A20E_A20F_A20G_A21E_A22E_A22G
                                F0132_VIDEO_Blit(L0219_puc_Bitmap, F0492_CACHE_GetDerivedBitmap(C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA), G0107_auc_Graphic558_Box_ThievesEye_VisibleArea, 0, 0, C048_BYTE_WIDTH, C048_BYTE_WIDTH, C10_COLOR_FLESH, 95, 95); /* BUG0_74 Creatures are drawn with wrong colors when viewed through a wall with the 'Thieve's Eye' spell. The 'hole in wall' graphic is applied to the visible area with transparency on color 10. However the visible area may contain creature graphics that use color 9. When the bitmap is drawn below with transparency on color 9 then the creature graphic is alterated: pixels using color 9 are transparent and the background wall is visible through the creature graphic (grey/white pixels). To fix this bug, the 'hole in wall' graphic should be applied to the wall graphic first (in a temporary buffer) and then the wall with the hole should be drawn over the visible area */
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0615_CopyBitmapDimensions(L0219_puc_Bitmap, L2491_puc_Bitmap = F0492_CACHE_GetDerivedBitmap(C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA));
                                F0632_COORD_SetNegativeBitmapPointer(M710_NEGGRAPHIC_THIEVES_EYE_VISIBLE_AREA, L2491_puc_Bitmap);
                                F0630_InitBitmapStruct2(M710_NEGGRAPHIC_THIEVES_EYE_VISIBLE_AREA, &L2493_s_Struct2);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                M704_ZONE_LEFT(L2494_ai_XYZ) = 0;
                                M705_ZONE_RIGHT(L2494_ai_XYZ) = L2493_s_Struct2.Width - 1;
                                M706_ZONE_TOP(L2494_ai_XYZ) = 0;
                                M707_ZONE_BOTTOM(L2494_ai_XYZ) = L2493_s_Struct2.Height - 1;
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0625_GetZoneInitializedFromDimensions(L2494_ai_XYZ, L2493_s_Struct2.Width, L2493_s_Struct2.Height);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0654_Call_F0132_VIDEO_Blit(M772_CAST_PC(G0296_puc_Bitmap_Viewport), M772_CAST_PC(L2491_puc_Bitmap), L2494_ai_XYZ, L2493_s_Struct2.X, L2493_s_Struct2.Y, CM1_COLOR_NO_TRANSPARENCY);
                                F0654_Call_F0132_VIDEO_Blit(M772_CAST_PC(L0219_puc_Bitmap), M772_CAST_PC(L2491_puc_Bitmap), L2494_ai_XYZ, 0, 0, C10_COLOR_FLESH);
#endif
                        }
#endif
#ifdef MEDIA006_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB /* CHANGE7_15_OPTIMIZATION */
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0700_puc_Bitmap_WallSet_Wall_D1LCR, G0163_aauc_Graphic558_Frame_Walls[M606_VIEW_SQUARE_D1C]);
#endif
#ifdef MEDIA267_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G /* CHANGE7_15_OPTIMIZATION */
                        F0101_DUNGEONVIEW_DrawWallSetBitmapWithoutTransparency(G0700_puc_Bitmap_WallSet_Wall_D1LCR, G0163_aauc_Graphic558_Frame_Walls[M606_VIEW_SQUARE_D1C]);
#endif
#ifdef MEDIA458_P20JA_P20JB
                        F0792_DUNGEONVIEW_DrawBitmapYYY(G3013_i_WallSet_Wall_D1C, C710_ZONE_WALL_D1C, G0076_B_UseFlippedWallAndFootprintsBitmaps);
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                        F0792_DUNGEONVIEW_DrawBitmapYYY(G2107_WallSet[C04_WALL_D1C], C712_ZONE_WALL_D1C, G0076_B_UseFlippedWallAndFootprintsBitmaps);
#endif
#ifdef MEDIA506_F20E_F20J_X30J
                        F0765_DUNGEONVIEW_DrawBitmapWithoutTransparency(G3013_i_WallSet_Wall_D1C, C710_ZONE_WALL_D1C);
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        F0765_DUNGEONVIEW_DrawBitmapWithoutTransparency(G2107_WallSet[C04_WALL_D1C], C712_ZONE_WALL_D1C);
#endif
                        if (F0107_DUNGEONVIEW_IsDrawnWallOrnamentAnAlcove_CPSF(L0218_ai_SquareAspect[M552_FRONT_WALL_ORNAMENT_ORDINAL], M587_VIEW_WALL_D1C_FRONT)) {
                                F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0218_ai_SquareAspect[M550_FIRST_THING], P0171_i_Direction, P0172_i_MapX, P0173_i_MapY, M606_VIEW_SQUARE_D1C, C0x0000_CELL_ORDER_ALCOVE);
                        }
#ifdef MEDIA128_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G20E_G21E_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        if (G0407_s_Party.Event73Count_ThievesEye) {
#ifdef MEDIA113_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G20E_G21E
                                F0132_VIDEO_Blit(F0492_CACHE_GetDerivedBitmap(C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA), G0296_puc_Bitmap_Viewport, G0106_auc_Graphic558_Box_ThievesEye_ViewportVisibleArea, 0, 0, C048_BYTE_WIDTH, C112_BYTE_WIDTH_VIEWPORT, C09_COLOR_GOLD); /* BUG0_74 */
#endif
#ifdef MEDIA433_A20E_A20F_A20G_A21E_A22E_A22G
                                F0132_VIDEO_Blit(F0492_CACHE_GetDerivedBitmap(C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA), G0296_puc_Bitmap_Viewport, G0106_auc_Graphic558_Box_ThievesEye_ViewportVisibleArea, 0, 0, C048_BYTE_WIDTH, C112_BYTE_WIDTH_VIEWPORT, C09_COLOR_GOLD, 95, C136_HEIGHT_VIEWPORT); /* BUG0_74 */
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                M704_ZONE_LEFT(L2494_ai_XYZ) += L2493_s_Struct2.X;
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                M705_ZONE_RIGHT(L2494_ai_XYZ) += L2493_s_Struct2.X;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                M706_ZONE_TOP(L2494_ai_XYZ) += L2493_s_Struct2.Y;
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                M707_ZONE_BOTTOM(L2494_ai_XYZ) += L2493_s_Struct2.Y;
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0654_Call_F0132_VIDEO_Blit(M772_CAST_PC(F0492_CACHE_GetDerivedBitmap(C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA)), M772_CAST_PC(G0296_puc_Bitmap_Viewport), L2494_ai_XYZ, 0, 0, C09_COLOR_GOLD);
#endif
                                F0493_CACHE_AddDerivedBitmap(C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA);
                                F0480_CACHE_ReleaseBlock(C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA | MASK0x8000_DERIVED_BITMAP);
                        }
#endif
                        return;
                case C17_ELEMENT_DOOR_FRONT:
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0218_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M595_VIEW_FLOOR_D1C);
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0218_ai_SquareAspect[M550_FIRST_THING], P0171_i_Direction, P0172_i_MapX, P0173_i_MapY, M606_VIEW_SQUARE_D1C, C0x0218_CELL_ORDER_DOORPASS1_BACKLEFT_BACKRIGHT);
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0704_puc_Bitmap_WallSet_DoorFrameTop_D1LCR, G0177_auc_Graphic558_Frame_DoorFrameTop_D1C);
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0708_puc_Bitmap_WallSet_DoorFrameLeft_D1C, G0170_auc_Graphic558_Frame_DoorFrameLeft_D1C);
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0710_puc_Bitmap_WallSet_DoorFrameRight_D1C, G0171_auc_Graphic558_Frame_DoorFrameRight_D1C);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2112_DoorFrameTopD1LCR, C729_ZONE_DOOR_FRAME_TOP_D1C);
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2117_DoorFrameLeftD1C, C722_ZONE_DOOR_FRAME_LEFT_D1C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2112_DoorFrameTopD1LCR, C733_ZONE_DOOR_FRAME_TOP_D1C);
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2117_DoorFrameLeftD1C, C726_ZONE_DOOR_FRAME_LEFT_D1C);
#endif
#ifdef MEDIA458_P20JA_P20JB
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2117_DoorFrameLeftD1C, C723_ZONE_DOOR_FRAME_RIGHT_D1C);
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2117_DoorFrameLeftD1C, C727_ZONE_DOOR_FRAME_RIGHT_D1C);
#endif
#ifdef MEDIA506_F20E_F20J_X30J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2196_DoorFrameRightD1C, C723_ZONE_DOOR_FRAME_RIGHT_D1C);
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2196_DoorFrameRightD1C, C727_ZONE_DOOR_FRAME_RIGHT_D1C);
#endif
                        if (((DOOR*)G0284_apuc_ThingData[C00_THING_TYPE_DOOR])[L0218_ai_SquareAspect[M557_DOOR_THING_INDEX]].Button) {
                                F0110_DUNGEONVIEW_DrawDoorButton(M000_INDEX_TO_ORDINAL(C0_DOOR_BUTTON), C3_VIEW_DOOR_BUTTON_D1C);
                        }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0111_DUNGEONVIEW_DrawDoor(L0218_ai_SquareAspect[M557_DOOR_THING_INDEX], L0218_ai_SquareAspect[M556_DOOR_STATE], G0695_ai_DoorNativeBitmapIndex_Front_D1LCR, M075_BITMAP_BYTE_COUNT(96, 88), C2_VIEW_DOOR_ORNAMENT_D1LCR, &G0186_s_Graphic558_Frames_Door_D1C);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0111_DUNGEONVIEW_DrawDoor(L0218_ai_SquareAspect[M557_DOOR_THING_INDEX], L0218_ai_SquareAspect[M556_DOOR_STATE], G0695_ai_DoorNativeBitmapIndex_Front_D1LCR, C2_VIEW_DOOR_ORNAMENT_D1LCR, M631_ZONE_DOOR_D1C);
#endif
                        L0217_i_Order = C0x0349_CELL_ORDER_DOORPASS2_FRONTLEFT_FRONTRIGHT;
                        goto T0124018;
                case C02_ELEMENT_PIT:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0218_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M765_GRAPHIC_FLOOR_PIT_INVISIBLE_D1C : M759_GRAPHIC_FLOOR_PIT_D1C, G0147_auc_Graphic558_Frame_FloorPit_D1C);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0218_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M765_GRAPHIC_FLOOR_PIT_INVISIBLE_D1C : M759_GRAPHIC_FLOOR_PIT_D1C, C857_ZONE_FLOORPIT_D1C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0218_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M765_GRAPHIC_FLOOR_PIT_INVISIBLE_D1C : M759_GRAPHIC_FLOOR_PIT_D1C, C859_ZONE_FLOORPIT_D1C);
#endif
                case C05_ELEMENT_TELEPORTER:
                case C01_ELEMENT_CORRIDOR:
                        T0124017:
                        L0217_i_Order = C0x3421_CELL_ORDER_BACKLEFT_BACKRIGHT_FRONTLEFT_FRONTRIGHT;
                        F0108_DUNGEONVIEW_DrawFloorOrnament(L0218_ai_SquareAspect[M558_FLOOR_ORNAMENT_ORDINAL], M595_VIEW_FLOOR_D1C); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0112_DUNGEONVIEW_DrawCeilingPit(C066_GRAPHIC_CEILING_PIT_D1C, G0156_auc_Graphic558_Frame_CeilingPit_D1C, P0172_i_MapX, P0173_i_MapY, C0_FALSE);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0112_DUNGEONVIEW_DrawCeilingPit(C066_GRAPHIC_CEILING_PIT_D1C, C866_ZONE_CEILING_PIT_D1C, P0172_i_MapX, P0173_i_MapY, C0_FALSE);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0112_DUNGEONVIEW_DrawCeilingPit(C067_GRAPHIC_CEILING_PIT_D1C, C868_ZONE_CEILING_PIT_D1C, P0172_i_MapX, P0173_i_MapY, C0_FALSE);
#endif
                        T0124018:
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0218_ai_SquareAspect[M550_FIRST_THING], P0171_i_Direction, P0172_i_MapX, P0173_i_MapY, M606_VIEW_SQUARE_D1C, L0217_i_Order);
        }
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if ((L0218_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) && L0218_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (L0218_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) {
#endif
#ifdef MEDIA088_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A22G
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M606_VIEW_SQUARE_D1C], G0163_aauc_Graphic558_Frame_Walls[M606_VIEW_SQUARE_D1C], L0218_ai_SquareAspect); /* BUG0_01 Coding error without consequence. Function call with wrong number of parameters. It should be called with 2 parameters. No consequence because additional parameters are ignored */
#endif
#ifdef MEDIA448_A21E_A22E
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M606_VIEW_SQUARE_D1C], G0163_aauc_Graphic558_Frame_Walls[M606_VIEW_SQUARE_D1C]);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M606_VIEW_SQUARE_D1C], C710_ZONE_WALL_D1C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[M606_VIEW_SQUARE_D1C]], C712_ZONE_WALL_D1C);
#endif
        }
}

STATICFUNCTION void F0125_DUNGEONVIEW_DrawSquareD0L(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0174_i_Direction, P0175_i_MapX, P0176_i_MapY)
REGISTER int16_t P0174_i_Direction SEPARATOR
REGISTER int16_t P0175_i_MapX      SEPARATOR
REGISTER int16_t P0176_i_MapY      FINAL_SEPARATOR
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t          P0174_i_Direction SEPARATOR
int16_t          P0175_i_MapX      SEPARATOR
int16_t          P0176_i_MapY      FINAL_SEPARATOR
#endif
{
        int16_t L0220_ai_SquareAspect[M559_SQUARE_ASPECT_INT_COUNT];


        F0172_DUNGEON_SetSquareAspect(L0220_ai_SquareAspect, P0174_i_Direction, P0175_i_MapX, P0176_i_MapY);
        switch (L0220_ai_SquareAspect[C0_ELEMENT]) {
                case C18_ELEMENT_STAIRS_SIDE:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0692_i_StairsNativeBitmapIndex_Side_D0L, G0138_auc_Graphic558_Frame_StairsSide_D0L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0692_i_StairsNativeBitmapIndex_Side_D0L, C828_ZONE_STAIRS_SIDE_D0L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C17_STAIRS_BITMAP_SIDE_D0L], C832_ZONE_STAIRS_SIDE_D0L);
#endif
                        return;
                case C02_ELEMENT_PIT:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0220_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M766_GRAPHIC_FLOOR_PIT_INVISIBLE_D0L : M760_GRAPHIC_FLOOR_PIT_D0L, G0149_auc_Graphic558_Frame_FloorPit_D0L);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0220_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M766_GRAPHIC_FLOOR_PIT_INVISIBLE_D0L : M760_GRAPHIC_FLOOR_PIT_D0L, C859_ZONE_FLOORPIT_D0L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0220_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M766_GRAPHIC_FLOOR_PIT_INVISIBLE_D0L : M760_GRAPHIC_FLOOR_PIT_D0L, C861_ZONE_FLOORPIT_D0L);
#endif
                case C01_ELEMENT_CORRIDOR:
                case C16_ELEMENT_DOOR_SIDE:
                case C05_ELEMENT_TELEPORTER:
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0112_DUNGEONVIEW_DrawCeilingPit(C068_GRAPHIC_CEILING_PIT_D0L, C870_ZONE_CEILING_PIT_D0L, P0175_i_MapX, P0176_i_MapY, C0_FALSE);
#endif
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0220_ai_SquareAspect[M550_FIRST_THING], P0174_i_Direction, P0175_i_MapX, P0176_i_MapY, M610_VIEW_SQUARE_D0L, C0x0002_CELL_ORDER_BACKRIGHT);
                        break;
                case C00_ELEMENT_WALL:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0701_puc_Bitmap_WallSet_Wall_D0L, G0163_aauc_Graphic558_Frame_Walls[M610_VIEW_SQUARE_D0L]);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        if (G0076_B_UseFlippedWallAndFootprintsBitmaps) {
#ifdef MEDIA458_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G3015_i_WallSet_Wall_D0R, C714_ZONE_WALL_D0L);
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2107_WallSet[C00_WALL_D0R], C716_ZONE_WALL_D0L);
#endif
                        } else {
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G3014_i_WallSet_Wall_D0L, C714_ZONE_WALL_D0L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef PC_FIX_CODE_SIZE
        P0176_i_MapY++;
        P0176_i_MapY++;
        P0176_i_MapY++;
        P0176_i_MapY++;
        P0176_i_MapY++;
        P0176_i_MapY++;
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2107_WallSet[C01_WALL_D0L], C716_ZONE_WALL_D0L);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        }
#endif
                        return;
        }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        F0112_DUNGEONVIEW_DrawCeilingPit(C067_GRAPHIC_CEILING_PIT_D0L, G0158_auc_Graphic558_Frame_CeilingPit_D0L, P0175_i_MapX, P0176_i_MapY, C0_FALSE);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
        F0112_DUNGEONVIEW_DrawCeilingPit(C067_GRAPHIC_CEILING_PIT_D0L, C868_ZONE_CEILING_PIT_D0L, P0175_i_MapX, P0176_i_MapY, C0_FALSE);
#endif
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if ((L0220_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) && L0220_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (L0220_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) {
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M610_VIEW_SQUARE_D0L], G0163_aauc_Graphic558_Frame_Walls[M610_VIEW_SQUARE_D0L]);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M610_VIEW_SQUARE_D0L], C714_ZONE_WALL_D0L);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[M610_VIEW_SQUARE_D0L]], C716_ZONE_WALL_D0L);
#endif
        }
}

STATICFUNCTION void F0126_DUNGEONVIEW_DrawSquareD0R(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0177_i_Direction, P0178_i_MapX, P0179_i_MapY)
REGISTER int16_t P0177_i_Direction SEPARATOR
REGISTER int16_t P0178_i_MapX      SEPARATOR
REGISTER int16_t P0179_i_MapY      FINAL_SEPARATOR
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t          P0177_i_Direction SEPARATOR
int16_t          P0178_i_MapX      SEPARATOR
int16_t          P0179_i_MapY      FINAL_SEPARATOR
#endif
{
        int16_t L0221_ai_SquareAspect[M559_SQUARE_ASPECT_INT_COUNT];


        F0172_DUNGEON_SetSquareAspect(L0221_ai_SquareAspect, P0177_i_Direction, P0178_i_MapX, P0179_i_MapY);
        switch (L0221_ai_SquareAspect[C0_ELEMENT]) {
                case C18_ELEMENT_STAIRS_SIDE:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0692_i_StairsNativeBitmapIndex_Side_D0L, G0139_auc_Graphic558_Frame_StairsSide_D0R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0692_i_StairsNativeBitmapIndex_Side_D0L, C829_ZONE_STAIRS_SIDE_D0R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0079_ai_StairsNativeBitmapIndices[C17_STAIRS_BITMAP_SIDE_D0L], C833_ZONE_STAIRS_SIDE_D0R);
#endif
                        return;
                case C02_ELEMENT_PIT:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(L0221_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M766_GRAPHIC_FLOOR_PIT_INVISIBLE_D0L : M760_GRAPHIC_FLOOR_PIT_D0L, G0151_auc_Graphic558_Frame_FloorPit_D0R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(L0221_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M766_GRAPHIC_FLOOR_PIT_INVISIBLE_D0L : M760_GRAPHIC_FLOOR_PIT_D0L, C861_ZONE_FLOORPIT_D0R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(L0221_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M766_GRAPHIC_FLOOR_PIT_INVISIBLE_D0L : M760_GRAPHIC_FLOOR_PIT_D0L, C863_ZONE_FLOORPIT_D0R);
#endif
                case C01_ELEMENT_CORRIDOR:
                case C16_ELEMENT_DOOR_SIDE:
                case C05_ELEMENT_TELEPORTER:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0112_DUNGEONVIEW_DrawCeilingPit(C067_GRAPHIC_CEILING_PIT_D0L, G0160_auc_Graphic558_Frame_CeilingPit_D0R, P0178_i_MapX, P0179_i_MapY, C1_TRUE);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0112_DUNGEONVIEW_DrawCeilingPit(C067_GRAPHIC_CEILING_PIT_D0L, C870_ZONE_CEILING_PIT_D0R, P0178_i_MapX, P0179_i_MapY, C1_TRUE);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0112_DUNGEONVIEW_DrawCeilingPit(C068_GRAPHIC_CEILING_PIT_D0L, C872_ZONE_CEILING_PIT_D0R, P0178_i_MapX, P0179_i_MapY, C1_TRUE);
#endif
                        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0221_ai_SquareAspect[M550_FIRST_THING], P0177_i_Direction, P0178_i_MapX, P0179_i_MapY, M611_VIEW_SQUARE_D0R, C0x0001_CELL_ORDER_BACKLEFT);
                        break;
                case C00_ELEMENT_WALL:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0702_puc_Bitmap_WallSet_Wall_D0R, G0163_aauc_Graphic558_Frame_Walls[M611_VIEW_SQUARE_D0R]);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        if (G0076_B_UseFlippedWallAndFootprintsBitmaps) {
#ifdef MEDIA458_P20JA_P20JB
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G3014_i_WallSet_Wall_D0L, C715_ZONE_WALL_D0R);
#endif
#ifdef MEDIA709_I34E_I34M_P31J
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2107_WallSet[C01_WALL_D0L], C717_ZONE_WALL_D0R);
#endif
                        } else {
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G3015_i_WallSet_Wall_D0R, C715_ZONE_WALL_D0R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef PC_FIX_CODE_SIZE
        P0179_i_MapY++;
        P0179_i_MapY++;
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2107_WallSet[C00_WALL_D0R], C717_ZONE_WALL_D0R);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        }
#endif
                        return;
        }
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if ((L0221_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) && L0221_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (L0221_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) {
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M611_VIEW_SQUARE_D0R], G0163_aauc_Graphic558_Frame_Walls[M611_VIEW_SQUARE_D0R]);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M611_VIEW_SQUARE_D0R], C715_ZONE_WALL_D0R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[M611_VIEW_SQUARE_D0R]], C717_ZONE_WALL_D0R);
#endif
        }
}

STATICFUNCTION void F0127_DUNGEONVIEW_DrawSquareD0C(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0180_i_Direction, P0181_i_MapX, P0182_i_MapY)
REGISTER int16_t P0180_i_Direction SEPARATOR
REGISTER int16_t P0181_i_MapX      SEPARATOR
REGISTER int16_t P0182_i_MapY      FINAL_SEPARATOR
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
int16_t          P0180_i_Direction SEPARATOR
int16_t          P0181_i_MapX      SEPARATOR
int16_t          P0182_i_MapY      FINAL_SEPARATOR
#endif
{
        int16_t L0222_ai_SquareAspect[M559_SQUARE_ASPECT_INT_COUNT];
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        STRUCT2 L2495_s_Struct2; /* ThievesEye_ViewportVisibleArea */
        int16_t L2496_ai_XYZ[4];
#endif


        F0172_DUNGEON_SetSquareAspect(L0222_ai_SquareAspect, P0180_i_Direction, P0181_i_MapX, P0182_i_MapY);
        switch (L0222_ai_SquareAspect[C0_ELEMENT]) {
                case C16_ELEMENT_DOOR_SIDE:
#ifdef MEDIA128_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G20E_G21E_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        if (G0407_s_Party.Event73Count_ThievesEye) {
#ifdef MEDIA117_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G20E_G21E_A20E_A20F_A20G_A21E_A22E_A22G
                                F0007_MAIN_CopyBytes(G0709_puc_Bitmap_WallSet_DoorFrameFront, G0074_puc_Bitmap_Temporary, M075_BITMAP_BYTE_COUNT(32, 123));
#ifdef MEDIA113_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G20E_G21E
                                F0132_VIDEO_Blit(F0489_MEMORY_GetNativeBitmapOrGraphic(C041_GRAPHIC_HOLE_IN_WALL), G0074_puc_Bitmap_Temporary, G0108_auc_Graphic558_Box_ThievesEye_HoleInDoorFrame, G0172_auc_Graphic558_Frame_DoorFrame_D0C[C0_X1] - M768_BOX_LEFT(G0106_auc_Graphic558_Box_ThievesEye_ViewportVisibleArea), 0, C048_BYTE_WIDTH, C016_BYTE_WIDTH, C09_COLOR_GOLD);
#endif
#ifdef MEDIA433_A20E_A20F_A20G_A21E_A22E_A22G
                                F0132_VIDEO_Blit(F0489_MEMORY_GetNativeBitmapOrGraphic(C041_GRAPHIC_HOLE_IN_WALL), G0074_puc_Bitmap_Temporary, G0108_auc_Graphic558_Box_ThievesEye_HoleInDoorFrame, G0172_auc_Graphic558_Frame_DoorFrame_D0C[C0_X1] - M768_BOX_LEFT(G0106_auc_Graphic558_Box_ThievesEye_ViewportVisibleArea), 0, C048_BYTE_WIDTH, C016_BYTE_WIDTH, C09_COLOR_GOLD, 95, 123);
#endif
                                F0100_DUNGEONVIEW_DrawWallSetBitmap(G0074_puc_Bitmap_Temporary, G0172_auc_Graphic558_Frame_DoorFrame_D0C);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0616_CopyBitmap(F0631_GetBitmapPointer(G2116_DoorFrameFrontD0C), G0074_puc_Bitmap_Temporary);
                                F0630_InitBitmapStruct2(M711_NEGGRAPHIC_HOLE_IN_WALL, &L2495_s_Struct2);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0635_(NULL, L2496_ai_XYZ, C732_ZONE_THIEVES_EYE_HOLE_IN_DOOR_FRAME, &L2495_s_Struct2.Width, &L2495_s_Struct2.Height);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0635_(NULL, L2496_ai_XYZ, C736_ZONE_THIEVES_EYE_HOLE_IN_DOOR_FRAME, &L2495_s_Struct2.Width, &L2495_s_Struct2.Height);
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0654_Call_F0132_VIDEO_Blit(M772_CAST_PC(L2495_s_Struct2.s2m1), M772_CAST_PC(G0074_puc_Bitmap_Temporary), L2496_ai_XYZ, L2495_s_Struct2.Width + L2495_s_Struct2.X, L2495_s_Struct2.Height + L2495_s_Struct2.Y, C09_COLOR_GOLD);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0656_BlitBitmapToViewportZoneIndexWithTransparency(G0074_puc_Bitmap_Temporary, C724_ZONE_DOOR_FRAME_D0C, C10_COLOR_FLESH);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0656_BlitBitmapToViewportZoneIndexWithTransparency(G0074_puc_Bitmap_Temporary, C728_ZONE_DOOR_FRAME_D0C, C10_COLOR_FLESH);
#endif
                        } else {
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0100_DUNGEONVIEW_DrawWallSetBitmap(G0709_puc_Bitmap_WallSet_DoorFrameFront, G0172_auc_Graphic558_Frame_DoorFrame_D0C);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2116_DoorFrameFrontD0C, C724_ZONE_DOOR_FRAME_D0C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
#ifdef PC_FIX_CODE_SIZE
        P0182_i_MapY++;
        P0182_i_MapY++;
        P0182_i_MapY++;
        P0182_i_MapY++;
        P0182_i_MapY++;
        P0182_i_MapY++;
#endif
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G2116_DoorFrameFrontD0C, C728_ZONE_DOOR_FRAME_D0C);
#endif
#ifdef MEDIA128_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G20E_G21E_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        }
#endif
                        break;
                case C19_ELEMENT_STAIRS_FRONT:
                        if (L0222_ai_SquareAspect[M555_STAIRS_UP]) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0681_i_StairsNativeBitmapIndex_Up_Front_D0C_Left, G0119_auc_Graphic558_Frame_StairsUpFront_D0L);
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0681_i_StairsNativeBitmapIndex_Up_Front_D0C_Left, G0120_auc_Graphic558_Frame_StairsUpFront_D0R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0681_i_StairsNativeBitmapIndex_Up_Front_D0C_Left, C809_ZONE_STAIRS_UP_FRONT_D0L);
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0681_i_StairsNativeBitmapIndex_Up_Front_D0C_Left, C810_ZONE_STAIRS_UP_FRONT_D0R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C06_STAIRS_BITMAP_UP_FRONT_D0C_LEFT], C811_ZONE_STAIRS_UP_FRONT_D0L);
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0079_ai_StairsNativeBitmapIndices[C06_STAIRS_BITMAP_UP_FRONT_D0C_LEFT], C812_ZONE_STAIRS_UP_FRONT_D0R);
#endif
                        } else {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0688_i_StairsNativeBitmapIndex_Down_Front_D0C_Left, G0130_auc_Graphic558_Frame_StairsDownFront_D0L);
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0688_i_StairsNativeBitmapIndex_Down_Front_D0C_Left, G0131_auc_Graphic558_Frame_StairsDownFront_D0R);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0688_i_StairsNativeBitmapIndex_Down_Front_D0C_Left, C820_ZONE_STAIRS_DOWN_FRONT_D0L);
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0688_i_StairsNativeBitmapIndex_Down_Front_D0C_Left, C821_ZONE_STAIRS_DOWN_FRONT_D0R);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G0079_ai_StairsNativeBitmapIndices[C13_STAIRS_BITMAP_DOWN_FRONT_D0C_LEFT], C824_ZONE_STAIRS_DOWN_FRONT_D0L);
#ifdef PC_FIX_CODE_SIZE
        P0182_i_MapY++;
        P0182_i_MapY++;
#endif
                                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G0079_ai_StairsNativeBitmapIndices[C13_STAIRS_BITMAP_DOWN_FRONT_D0C_LEFT], C825_ZONE_STAIRS_DOWN_FRONT_D0R);
#endif
                        }
                        break;
                case C02_ELEMENT_PIT:
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0222_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M767_GRAPHIC_FLOOR_PIT_INVISIBLE_D0C : M761_GRAPHIC_FLOOR_PIT_D0C, G0150_auc_Graphic558_Frame_FloorPit_D0C);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0222_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M767_GRAPHIC_FLOOR_PIT_INVISIBLE_D0C : M761_GRAPHIC_FLOOR_PIT_D0C, C860_ZONE_FLOORPIT_D0C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                        F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(L0222_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE] ? M767_GRAPHIC_FLOOR_PIT_INVISIBLE_D0C : M761_GRAPHIC_FLOOR_PIT_D0C, C862_ZONE_FLOORPIT_D0C);
#endif
        }
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        F0112_DUNGEONVIEW_DrawCeilingPit(C068_GRAPHIC_CEILING_PIT_D0C, G0159_auc_Graphic558_Frame_CeilingPit_D0C, P0181_i_MapX, P0182_i_MapY, C0_FALSE);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
        F0112_DUNGEONVIEW_DrawCeilingPit(C068_GRAPHIC_CEILING_PIT_D0C, C869_ZONE_CEILING_PIT_D0C, P0181_i_MapX, P0182_i_MapY, C0_FALSE);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        F0112_DUNGEONVIEW_DrawCeilingPit(C069_GRAPHIC_CEILING_PIT_D0C, C871_ZONE_CEILING_PIT_D0C, P0181_i_MapX, P0182_i_MapY, C0_FALSE);
#endif
        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(L0222_ai_SquareAspect[M550_FIRST_THING], P0180_i_Direction, P0181_i_MapX, P0182_i_MapY, M609_VIEW_SQUARE_D0C, C0x0021_CELL_ORDER_BACKLEFT_BACKRIGHT);
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if ((L0222_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) && L0222_ai_SquareAspect[M554_PIT_OR_TELEPORTER_VISIBLE]) {
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (L0222_ai_SquareAspect[C0_ELEMENT] == C05_ELEMENT_TELEPORTER) {
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M609_VIEW_SQUARE_D0C], G0163_aauc_Graphic558_Frame_Walls[M609_VIEW_SQUARE_D0C]);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[M609_VIEW_SQUARE_D0C], C713_ZONE_WALL_D0C);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
                F0113_DUNGEONVIEW_DrawField(G0188_aauc_Graphic558_FieldAspects[G2035_ac_ViewSquareIndexToFieldAspectIndex[M609_VIEW_SQUARE_D0C]], C715_ZONE_WALL_D0C);
#endif
        }
}

#ifdef MEDIA423_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#include "COPYPRO4.C"
#include "COPYPRO3.C"
#endif

void F0128_DUNGEONVIEW_Draw_CPSF(
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
P0183_i_Direction, P0184_i_MapX, P0185_i_MapY)
#endif
REGISTER int16_t P0183_i_Direction SEPARATOR
REGISTER int16_t P0184_i_MapX      SEPARATOR
REGISTER int16_t P0185_i_MapY      FINAL_SEPARATOR
{
#ifdef MEDIA055_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
        REGISTER BOOLEAN L0223_B_FlipWalls;
#endif
        int16_t L0224_i_MapX;
        int16_t L0225_i_MapY;


#ifdef MEDIA055_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
        L0223_B_FlipWalls = C0_FALSE;
#endif
#ifdef MEDIA142_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J_P31J
        if (G0297_B_DrawFloorAndCeilingRequested) {
                F0098_DUNGEONVIEW_DrawFloorAndCeiling();
        }
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        G0578_B_UseByteBoxCoordinates = C1_TRUE;
        F0008_MAIN_ClearBytes(G0291_aauc_DungeonViewClickableBoxes, sizeof(G0291_aauc_DungeonViewClickableBoxes));
        F0009_MAIN_WriteSpacedBytes(G0291_aauc_DungeonViewClickableBoxes, 6, 255, 4);
        G0074_puc_Bitmap_Temporary = F0468_MEMORY_Allocate((long)M075_BITMAP_BYTE_COUNT(160, 111), C0_ALLOCATION_TEMPORARY_ON_TOP_OF_HEAP); /* Dimensions of an explosion bitmap which is the largest bitmap to store */
#endif
#ifdef MEDIA529_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        F0008_MAIN_ClearBytes(M772_CAST_PC(G2210_aai_XYZ_DungeonViewClickable), (long)sizeof(G2210_aai_XYZ_DungeonViewClickable));
        F0010_MAIN_WriteSpacedWords(M773_CAST_PI(G2210_aai_XYZ_DungeonViewClickable), 6, 0xFFFF, 8);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
        G0074_puc_Bitmap_Temporary = F0468_MEMORY_Allocate((long)G3003_ui_LargestCacheableNativeBitmapByteCount, MASK0x8000_ALLOCATE_BITMAP | C0_ALLOCATION_TEMPORARY_ON_TOP_OF_HEAP);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        G0074_puc_Bitmap_Temporary = F0606_AllocateMemForGraphic(G2140_i_LargestCacheableNativeBitmapWidth, G2141_i_LargestCacheableNativeBitmapHeight, C0_ALLOCATION_TEMPORARY_ON_TOP_OF_HEAP);
#endif
        if (G0076_B_UseFlippedWallAndFootprintsBitmaps = (P0184_i_MapX + P0185_i_MapY + P0183_i_Direction) & 0x0001) {
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
                F0130_VIDEO_FlipHorizontal(G0087_puc_Bitmap_ViewportFloorArea, C112_BYTE_WIDTH_VIEWPORT, 70); /* Height of floor bitmap is 70 lines */
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0100_DUNGEONVIEW_DrawWallSetBitmap(G0085_puc_Bitmap_Ceiling, G1012_auc_Frame_Ceiling);
                F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(G0084_puc_Bitmap_Floor, G0074_puc_Bitmap_Temporary, C112_BYTE_WIDTH_VIEWPORT, 70); /* Height of floor bitmap is 70 lines */
                F0100_DUNGEONVIEW_DrawWallSetBitmap(G0074_puc_Bitmap_Temporary, G1013_auc_Frame_Floor);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                F0674_F0128_sub(G2109_Ceiling, G0296_puc_Bitmap_Viewport);
                F0792_DUNGEONVIEW_DrawBitmapYYY(G2108_Floor, C701_ZONE_VIEWPORT_FLOOR_AREA, G0076_B_UseFlippedWallAndFootprintsBitmaps = MASK0x0001_FLIP_HORIZONTAL);
#endif
#ifdef MEDIA544_F20E_F20J_X30J_X31J
                F0130_VIDEO_FlipHorizontal(G0087_puc_Bitmap_ViewportFloorArea, G2073_C224_ViewportPixelWidth, G2005_GraphicWidthHeight[M650_GRAPHIC_FLOOR_SET_0_FLOOR].Height);
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                F0765_DUNGEONVIEW_DrawBitmapWithoutTransparency(G2109_Ceiling, C700_ZONE_VIEWPORT_CEILING_AREA);
                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2108_Floor, C701_ZONE_VIEWPORT_FLOOR_AREA);
#endif
#ifdef MEDIA050_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_A31E_A31M_A33M_F31E_F31J_X31J
                if (L0223_B_FlipWalls = G0661_B_LargeHeapMemory) {
#endif
#ifdef MEDIA758_A36M_A35E_A35M
                if (G2040_auc_MemoryFlags[C1_MEM_FLIPPED_WALS]) {
                        L0223_B_FlipWalls = C1_TRUE;
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
                        G0084_puc_Bitmap_Floor = G4050_puc_Bitmap_Floor_Flipped;
                        G0085_puc_Bitmap_Ceiling = G4051_puc_Bitmap_Ceiling_Flipped;
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        G0698_puc_Bitmap_WallSet_Wall_D3LCR = G0090_puc_Bitmap_WallD3LCR_Flipped;
                        G0699_puc_Bitmap_WallSet_Wall_D2LCR = G0091_puc_Bitmap_WallD2LCR_Flipped;
                        G0700_puc_Bitmap_WallSet_Wall_D1LCR = G0092_puc_Bitmap_WallD1LCR_Flipped;
                        G0701_puc_Bitmap_WallSet_Wall_D0L = G0093_puc_Bitmap_WallD0L_Flipped;
                        G0702_puc_Bitmap_WallSet_Wall_D0R = G0094_puc_Bitmap_WallD0R_Flipped;
#endif
#ifdef MEDIA506_F20E_F20J_X30J
                        G3011_i_WallSet_Wall_D3C = G3049_i_WallSetFlipped_Wall_D3C;
                        G3004_i_WallSet_Wall_D3L = G3050_i_WallSetFlipped_Wall_D3L;
                        G3005_i_WallSet_Wall_D3R = G3051_i_WallSetFlipped_Wall_D3R;
                        G3012_i_WallSet_Wall_D2C = G3052_i_WallSetFlipped_Wall_D2C;
                        G3006_i_WallSet_Wall_D2L = G3053_i_WallSetFlipped_Wall_D2L;
                        G3007_i_WallSet_Wall_D2R = G3054_i_WallSetFlipped_Wall_D2R;
                        G3013_i_WallSet_Wall_D1C = G3055_i_WallSetFlipped_Wall_D1C;
                        G3008_i_WallSet_Wall_D1L = G3056_i_WallSetFlipped_Wall_D1L;
                        G3009_i_WallSet_Wall_D1R = G3057_i_WallSetFlipped_Wall_D1R;
                        G3014_i_WallSet_Wall_D0L = G3058_i_WallSetFlipped_Wall_D0L;
                        G3015_i_WallSet_Wall_D0R = G3059_i_WallSetFlipped_Wall_D0R;
#endif
#ifdef MEDIA670_F31E_F31J
                        G2108_Floor = G3048_WallSetFlipped[15];
                        G2109_Ceiling = G3048_WallSetFlipped[16];
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        F0007_MAIN_CopyBytes(M772_CAST_PC(G3048_WallSetFlipped), M772_CAST_PC(G2107_WallSet), sizeof(G2107_WallSet));
#endif
#ifdef MEDIA055_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                }
#endif
        }
#ifdef MEDIA142_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J_P31J
        else {
#ifdef MEDIA007_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E
                        F0130_VIDEO_FlipHorizontal(G0296_puc_Bitmap_Viewport, C112_BYTE_WIDTH_VIEWPORT, 29); /* Height of ceiling bitmap is 29 lines */
#endif
#ifdef MEDIA413_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        F0099_DUNGEONVIEW_CopyBitmapAndFlipHorizontal(G0085_puc_Bitmap_Ceiling, G0074_puc_Bitmap_Temporary, C112_BYTE_WIDTH_VIEWPORT, 29); /* Height of ceiling bitmap is 29 lines */
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0074_puc_Bitmap_Temporary, G1012_auc_Frame_Ceiling);
                        F0100_DUNGEONVIEW_DrawWallSetBitmap(G0084_puc_Bitmap_Floor, G1013_auc_Frame_Floor);
#endif
#ifdef MEDIA463_P20JA_P20JB_I34E_I34M_P31J
                        F0792_DUNGEONVIEW_DrawBitmapYYY(G2109_Ceiling, C700_ZONE_VIEWPORT_CEILING_AREA, MASK0x0001_FLIP_HORIZONTAL);
                        F0674_F0128_sub(G2108_Floor, G0087_puc_Bitmap_ViewportFloorArea);
#endif
#ifdef MEDIA544_F20E_F20J_X30J_X31J
                        F0130_VIDEO_FlipHorizontal(G0296_puc_Bitmap_Viewport, G2073_C224_ViewportPixelWidth, G2005_GraphicWidthHeight[M651_GRAPHIC_FLOOR_SET_0_CEILING].Height);
#endif
#ifdef MEDIA746_A36M_A31E_A31M_A33M_A35E_A35M
                        F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G2109_Ceiling, C700_ZONE_VIEWPORT_CEILING_AREA);
                        F0765_DUNGEONVIEW_DrawBitmapWithoutTransparency(G2108_Floor, C701_ZONE_VIEWPORT_FLOOR_AREA);
#endif
                }
#endif
#ifdef MEDIA380_G14ED_G20E_G21E_F31E_F31J
        F0098_DUNGEONVIEW_DrawFloorAndCeiling();
#endif
#ifdef MEDIA020_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB
        if (F0153_DUNGEON_GetRelativeSquareType(P0183_i_Direction, 3, -2, P0184_i_MapX, P0185_i_MapY) == C00_ELEMENT_WALL) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0100_DUNGEONVIEW_DrawWallSetBitmap(G0697_puc_Bitmap_WallSet_Wall_D3L2, G0711_auc_Graphic558_Frame_Wall_D3L2);
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G3010_i_WallSet_Wall_D3L2, C702_ZONE_WALL_D3L2);
#endif
        }
        if (F0153_DUNGEON_GetRelativeSquareType(P0183_i_Direction, 3, 2, P0184_i_MapX, P0185_i_MapY) == C00_ELEMENT_WALL) {
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                F0100_DUNGEONVIEW_DrawWallSetBitmap(G0696_puc_Bitmap_WallSet_Wall_D3R2, G0712_auc_Graphic558_Frame_Wall_D3R2);
#endif
#ifdef MEDIA458_P20JA_P20JB
                F0105_DUNGEONVIEW_DrawFloorPitOrStairsBitmapFlippedHorizontally(G3010_i_WallSet_Wall_D3L2, C703_ZONE_WALL_D3R2);
#endif
#ifdef MEDIA506_F20E_F20J_X30J
                F0104_DUNGEONVIEW_DrawFloorPitOrStairsBitmap(G3072_i_WallSet_Wall_D3R2, C703_ZONE_WALL_D3R2);
#endif
        }
#endif
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 4, -1, &L0224_i_MapX, &L0225_i_MapY);
        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(F0162_DUNGEON_GetSquareFirstObject(L0224_i_MapX, L0225_i_MapY), P0183_i_Direction, L0224_i_MapX, L0225_i_MapY, M598_VIEW_SQUARE_D4L, C0x0001_CELL_ORDER_BACKLEFT);
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 4, 1, &L0224_i_MapX, &L0225_i_MapY);
        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(F0162_DUNGEON_GetSquareFirstObject(L0224_i_MapX, L0225_i_MapY), P0183_i_Direction, L0224_i_MapX, L0225_i_MapY, M599_VIEW_SQUARE_D4R, C0x0001_CELL_ORDER_BACKLEFT);
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 4, 0, &L0224_i_MapX, &L0225_i_MapY);
        F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF(F0162_DUNGEON_GetSquareFirstObject(L0224_i_MapX, L0225_i_MapY), P0183_i_Direction, L0224_i_MapX, L0225_i_MapY, M597_VIEW_SQUARE_D4C, C0x0001_CELL_ORDER_BACKLEFT);
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 3, -2, &L0224_i_MapX, &L0225_i_MapY);
        F0676_DrawD3L2(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 3, 2, &L0224_i_MapX, &L0225_i_MapY);
        F0677_DrawD3R2(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
#endif
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 3, -1, &L0224_i_MapX, &L0225_i_MapY);
        F0116_DUNGEONVIEW_DrawSquareD3L(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 3, 1, &L0224_i_MapX, &L0225_i_MapY);
        F0117_DUNGEONVIEW_DrawSquareD3R(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 3, 0, &L0224_i_MapX, &L0225_i_MapY);
        F0118_DUNGEONVIEW_DrawSquareD3C_CPSF(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 2, -2, &L0224_i_MapX, &L0225_i_MapY);
        F0678_DrawD2L2(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 2, 2, &L0224_i_MapX, &L0225_i_MapY);
        F0679_DrawD2R2(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
#endif
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 2, -1, &L0224_i_MapX, &L0225_i_MapY);
        F0119_DUNGEONVIEW_DrawSquareD2L(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 2, 1, &L0224_i_MapX, &L0225_i_MapY);
        F0120_DUNGEONVIEW_DrawSquareD2R_CPSF(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 2, 0, &L0224_i_MapX, &L0225_i_MapY);
        F0121_DUNGEONVIEW_DrawSquareD2C(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 1, -1, &L0224_i_MapX, &L0225_i_MapY);
        F0122_DUNGEONVIEW_DrawSquareD1L(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 1, 1, &L0224_i_MapX, &L0225_i_MapY);
        F0123_DUNGEONVIEW_DrawSquareD1R(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 1, 0, &L0224_i_MapX, &L0225_i_MapY);
        F0124_DUNGEONVIEW_DrawSquareD1C(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 0, -1, &L0224_i_MapX, &L0225_i_MapY);
        F0125_DUNGEONVIEW_DrawSquareD0L(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
        L0224_i_MapX = P0184_i_MapX;
        L0225_i_MapY = P0185_i_MapY;
        F0150_DUNGEON_UpdateMapCoordinatesAfterRelativeMovement(P0183_i_Direction, 0, 1, &L0224_i_MapX, &L0225_i_MapY);
        F0126_DUNGEONVIEW_DrawSquareD0R(P0183_i_Direction, L0224_i_MapX, L0225_i_MapY);
        F0127_DUNGEONVIEW_DrawSquareD0C(P0183_i_Direction, P0184_i_MapX, P0185_i_MapY);
#ifdef MEDIA050_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_A31E_A31M_A33M_F31E_F31J_X31J
        if (L0223_B_FlipWalls) {
#endif
#ifdef MEDIA758_A36M_A35E_A35M
        if (L0223_B_FlipWalls && G2040_auc_MemoryFlags[C1_MEM_FLIPPED_WALS]) {
#endif
#ifdef MEDIA351_G14ED_G20E_G21E
                        G0084_puc_Bitmap_Floor = G4052_puc_Bitmap_Floor_Native;
                        G0085_puc_Bitmap_Ceiling = G4053_puc_Bitmap_Ceiling_Native;
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
                        G0698_puc_Bitmap_WallSet_Wall_D3LCR = G0095_puc_Bitmap_WallD3LCR_Native;
                        G0699_puc_Bitmap_WallSet_Wall_D2LCR = G0096_puc_Bitmap_WallD2LCR_Native;
                        G0700_puc_Bitmap_WallSet_Wall_D1LCR = G0097_puc_Bitmap_WallD1LCR_Native;
                        G0701_puc_Bitmap_WallSet_Wall_D0L = G0098_puc_Bitmap_WallD0L_Native;
                        G0702_puc_Bitmap_WallSet_Wall_D0R = G0099_puc_Bitmap_WallD0R_Native;
#endif
#ifdef MEDIA506_F20E_F20J_X30J
                        G3011_i_WallSet_Wall_D3C = G3060_i_WallSet_Wall_D3C;
                        G3004_i_WallSet_Wall_D3L = G3061_i_WallSet_Wall_D3L;
                        G3005_i_WallSet_Wall_D3R = G3062_i_WallSet_Wall_D3R;
                        G3012_i_WallSet_Wall_D2C = G3063_i_WallSet_Wall_D2C;
                        G3006_i_WallSet_Wall_D2L = G3064_i_WallSet_Wall_D2L;
                        G3007_i_WallSet_Wall_D2R = G3065_i_WallSet_Wall_D2R;
                        G3013_i_WallSet_Wall_D1C = G3066_i_WallSet_Wall_D1C;
                        G3008_i_WallSet_Wall_D1L = G3067_i_WallSet_Wall_D1L;
                        G3009_i_WallSet_Wall_D1R = G3068_i_WallSet_Wall_D1R;
                        G3014_i_WallSet_Wall_D0L = G3069_i_WallSet_Wall_D0L;
                        G3015_i_WallSet_Wall_D0R = G3070_i_WallSet_Wall_D0R;
#endif
#ifdef MEDIA670_F31E_F31J
                        G2108_Floor = G4141_;
                        G2109_Ceiling = G4142_;
#endif
#ifdef MEDIA747_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
                        F0007_MAIN_CopyBytes(M772_CAST_PC(G3071_WallSetNotFlipped), M772_CAST_PC(G2107_WallSet), sizeof(G2107_WallSet));
#endif
#ifdef MEDIA055_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J
        }
#endif
#ifdef MEDIA153_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M
#ifndef NOCOPYPROTECTION
#ifdef MEDIA315_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A31E_A31M_A33M_A35E_A35M /* CHANGE7_10_IMPROVEMENT */
        if (!G0071_B_FuzzySectorReadingInitiated_CPSF && (G0073_i_StopFreeingMemory_CPSF != C00512_FALSE)) { /* Memory is not freed and the game will eventually run out of memory and stop */
                goto T0128001;
        }
#endif
        G0071_B_FuzzySectorReadingInitiated_CPSF = C1_TRUE; /* At this step the function patched with graphic #21 has necessarily been executed */
#endif
#endif
#ifdef MEDIA009_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G
        F0469_MEMORY_FreeAtHeapTop((long)M075_BITMAP_BYTE_COUNT(160, 111));
#endif
#ifdef MEDIA508_F20E_F20J_X30J_P20JA_P20JB
        F0469_MEMORY_FreeAtHeapTop((long)G3003_ui_LargestCacheableNativeBitmapByteCount + 4);
#endif
#ifdef MEDIA720_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        M100_PIXEL_WIDTH(G0074_puc_Bitmap_Temporary) = G2140_i_LargestCacheableNativeBitmapWidth;
        M101_PIXEL_HEIGHT(G0074_puc_Bitmap_Temporary) = G2141_i_LargestCacheableNativeBitmapHeight;
        F0607_FreeMemForGraphic(G0074_puc_Bitmap_Temporary);
#endif
        T0128001: /* Unreferenced label but required for D36M */
#ifdef MEDIA064_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_G14ED_G20E_G21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_X30J_P20JA_P20JB
        F0097_DUNGEONVIEW_DrawViewport(G0309_i_PartyMapIndex != C255_MAP_INDEX_ENTRANCE);
#endif
#ifdef MEDIA556_F20E_F20J_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_F31E_F31J_X31J_P31J
        if (G0309_i_PartyMapIndex != C255_MAP_INDEX_ENTRANCE) {
                F0097_DUNGEONVIEW_DrawViewport(C1_VIEWPORT_DUNGEON_VIEW);
        }
#endif
#ifdef MEDIA142_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_F20E_F20J_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J_P31J
        if (G0309_i_PartyMapIndex != C255_MAP_INDEX_ENTRANCE) { /* If not in entrance then anticipate the next call to draw the dungeon view by drawing the floor and ceiling in the viewport */
                F0098_DUNGEONVIEW_DrawFloorAndCeiling();
        }
#endif
}
#endif
