#ifdef MEDIA551_F20E_F20J_F31E_F31J
typedef struct {
        long ItemOffset;
        int16_t LoopCount;
} FOR_LOOP;

#if EXETYPE == C04_SWITCH
/* IMAGE2.C */
extern unsigned char* G2160_puc_Bitmap_Destination;
extern unsigned char* G2159_puc_Bitmap_Source;
extern unsigned char G4108_DEC_BUF[32000];

/* BLIT.C */
/* FILLBOX.C */
/* TOWNSSCR.C */
/* SWITCH.C */
extern COLOR_DEF G8147_CREDITS[17];
extern COLOR_DEF G8148_ENTRANCE[17];
extern COLOR_DEF G8149_ICON[17];
extern COLOR_DEF G8150_INVENTORY[17];
extern COLOR_DEF G8151_LIGHT0[17];
extern COLOR_DEF G8152_LIGHT1[17];
extern COLOR_DEF G8153_LIGHT2[17];
extern COLOR_DEF G8154_LIGHT3[17];
extern COLOR_DEF G8155_LIGHT4[17];
extern COLOR_DEF G8156_LIGHT5[17];
extern COLOR_DEF G8157_BLACK[33];
extern COLOR_DEF G8158_BLUE[33];
extern COLOR_DEF G8159_PRESENTS[17];
extern COLOR_DEF G8160_DUNGEON[9];
extern COLOR_DEF G8161_MASTER[2];
extern COLOR_DEF G8162_SWOOSH1[2];
extern COLOR_DEF G8163_SWOOSH2[2];
extern COLOR_DEF G8164_SWOOSH3[2];
extern COLOR_DEF G8165_SWOOSH4[2];
extern COLOR_DEF G8166_SWOOSH5[2];
extern COLOR_DEF G8167_SWOOSH6[2];
extern COLOR_DEF G8168_SWOOSH7[2];
extern COLOR_DEF G8169_SWOOSH8[5];
extern COLOR_DEF G8170_SWOOSH9[5];
extern COLOR_DEF G8171_SWOOSH10[3];
extern COLOR_DEF G8172_[17];
extern COLOR_DEF G8173_[17];
extern COLOR_DEF G8174_[17];
extern COLOR_DEF* G8176_PaletteTable[29];
extern COLOR_DEF G8175_CREAT_PAL[14][6];
extern unsigned char G4169_auc_Bitmap[499];
extern unsigned char G4170_auc_Bitmap[315];
extern unsigned char G4171_auc_Bitmap[698];
extern unsigned char G4172_auc_Bitmap_Japanese[304];
extern unsigned char G4173_auc_Bitmap_English[108];
extern unsigned char G4167_auc_Bitmap_SwitchMenu_Japanese[7314];
extern unsigned char G4168_auc_Bitmap_SwitchMenu_English[6541];
extern unsigned char G4105_WORK[2048];
extern unsigned char G4104_SWORK[16384];
extern unsigned char G4106_EGBPARA[150];
extern int G4103_WRITE_PAGE;
extern char G4196_i_Unreferenced[4];
extern char G8183_aac_FullPalette[32][3];
extern char G4148_ac_Unreferenced[3];
extern char G4094_CURTAIN_FLAG;
extern int16_t G8204_;
extern int16_t G4157_i_MouseX;
extern int16_t G4159_i_MouseY;
extern int16_t G4158_i_MouseButtonsStatus;
extern UDSTA G4161_as_ButtonBitmaps[6];
extern int16_t G4160_i_ButtonBitmapCount;

/* CEDT026.C */
extern unsigned char G0042_auc_Graphic562_Bitmap_ArrowPointer[M075_BITMAP_BYTE_COUNT(18, 18)];
extern char G4079_MWORK[MosWorkSize];
extern int16_t G4071_i_MSE_STATE;
extern unsigned char G4075_aauc_MSE_CURSOR[4][512];
extern long G4073_ai_HOT_X[4];
extern long G4074_ai_HOT_Y[4];
extern int16_t G8092_MousePointerType;
extern int G4155_i_CurrentMouseButtonsStatus;
extern int G4153_i_CurrentMouseX;
extern int G4154_i_CurrentMouseY;
extern int G4152_i_CurrentMouseButtonsStatus;
extern int G4156_i_CurrentMouseButtonsStatus;

#else
#if EXETYPE == C05_ANIM
/* ANIM.C */
extern unsigned char* G8210_puc_Bitmap;
extern unsigned char* G8206_;
extern FOR_LOOP G8200_[15];
extern unsigned char* G4127_[16];
extern int16_t G4146_[18];

/* TOWNSSCR.C */
/* FILLBOX.C */
/* BLIT.C */
/* ANIMTOWN.C */
extern COLOR_DEF G8147_CREDITS[17];
extern COLOR_DEF G8148_ENTRANCE[17];
extern COLOR_DEF G8149_ICON[17];
extern COLOR_DEF G8150_INVENTORY[17];
extern COLOR_DEF G8151_LIGHT0[17];
extern COLOR_DEF G8152_LIGHT1[17];
extern COLOR_DEF G8153_LIGHT2[17];
extern COLOR_DEF G8154_LIGHT3[17];
extern COLOR_DEF G8155_LIGHT4[17];
extern COLOR_DEF G8156_LIGHT5[17];
extern COLOR_DEF G8157_BLACK[33];
extern COLOR_DEF G8158_BLUE[33];
extern COLOR_DEF G8159_PRESENTS[17];
extern COLOR_DEF G8160_DUNGEON[9];
extern COLOR_DEF G8161_MASTER[2];
extern COLOR_DEF G8162_SWOOSH1[2];
extern COLOR_DEF G8163_SWOOSH2[2];
extern COLOR_DEF G8164_SWOOSH3[2];
extern COLOR_DEF G8165_SWOOSH4[2];
extern COLOR_DEF G8166_SWOOSH5[2];
extern COLOR_DEF G8167_SWOOSH6[2];
extern COLOR_DEF G8168_SWOOSH7[2];
extern COLOR_DEF G8169_SWOOSH8[5];
extern COLOR_DEF G8170_SWOOSH9[5];
extern COLOR_DEF G8171_SWOOSH10[3];
extern COLOR_DEF G8172_[17];
extern COLOR_DEF G8173_[17];
extern COLOR_DEF G8174_[17];
extern COLOR_DEF* G8176_PaletteTable[29];
extern COLOR_DEF G8175_CREAT_PAL[14][6];
extern unsigned char G4105_WORK[2048];
extern unsigned char G4104_SWORK[16384];
extern unsigned char G4106_EGBPARA[150];
extern int G4103_WRITE_PAGE;
extern char G4196_i_Unreferenced[4];
extern char G8183_aac_FullPalette[32][3];
extern char G4148_ac_Unreferenced[3];
extern char G4094_CURTAIN_FLAG;
extern unsigned char G4096_PLAY_BUF[32000];
extern int16_t G4126_;
extern BOOLEAN G2024_B_PendingMusicOn;
extern unsigned int16_t G0526_ui_DungeonID;
extern int16_t G4117_;
extern int16_t G4116_;
extern int16_t G8204_;

/* SWSH.C */
extern unsigned char G8187_Graphic_FTLLogo[2310];
extern unsigned int16_t G0745_SwooshSoundDataByteCount;
extern unsigned char G0746_auc_SwooshSoundData[4451];

/* IMAGE2.C */
extern unsigned char* G2160_puc_Bitmap_Destination;
extern unsigned char* G2159_puc_Bitmap_Source;
extern unsigned char G4108_DEC_BUF[32000];

/* MUSIC.C */
extern BOOLEAN G4093_B_CD_PROTECT_CPSX;
extern unsigned char G2038_auc_MusicIndexToMusicTrack[4];
extern int G4090_CD_TYPE;
extern int G4091_START_TRACK;
extern int G4092_END_TRACK;
extern int G4082_CDDeviceNumber;
extern int16_t G4083_MUSIC_TRACKS_count;
extern struct TIMEADRS G4084_TRACK_TIME[100];
extern struct TIMEADRS G4086_DISK_TIME;
extern BOOLEAN G4085_MUSIC_PLAYING;
extern BOOLEAN G4097_MusicPaused;
extern int16_t G2125_i_MusicPlayingMapIndex;
extern BOOLEAN G2126_PendingMusicState;
extern unsigned char G4099_SquareCoordinatesToMusicTrack[10][32][32];
extern int16_t G4098_SelectedOneBytePerDungeonSquare;
extern int16_t G4102_;
extern int16_t G4101_;
extern int16_t G4087_CountdownBeforeMusicStart;

#else
#if EXETYPE == C06_CEDT
/* CEDT001.C */

/* CEDT002.C */

/* COMMAND.C */
extern INPUT_INFO** G7002_pps_InputInfoList;
extern int16_t G0433_i_CommandQueueFirstIndex;
extern int16_t G0434_i_CommandQueueLastIndex;
extern BOOLEAN G0436_B_PendingClickPresent;
extern int16_t G0437_i_PendingClickX;
extern int16_t G0438_i_PendingClickY;
extern int16_t G0439_i_PendingClickButtonsStatus;
/*        extern UD_COMMAND_STRUCT G4195_;*/
/*#define G2247_CommandQueue G4195_.as_CommandQueue*/
extern UD_COMMAND G2247_CommandQueue[6];
extern char G4175_ac_Unreferenced[4];
extern INPUT_INFO* G7100_as_InputInfo[6];

/* CEDT004.C */
extern unsigned char G2270_ObjectInfoIndexToIconIndex[180];

/* CEDT005.C */
extern MEMBLOCK G2245_apuc_AllocatedMemoryBlocks[200];
extern int16_t G2253_i_AllocatedBlockCount;
extern int16_t G4176_i_Unreferenced;

/* CEDT006.C */
extern int16_t G7108_BlinkingCursorTimer;
extern int16_t G7107_SelectedColorIndex;
extern int16_t G7109_SelectedChampionIndex;
extern ON_DISK_PORTRAIT G2248_as_OnDiskPortraits[4];
extern int16_t G2271_ai_Box_EditText[4];
extern BOOLEAN G7104_TextCursorVisible;
extern int16_t G7106_EditChampionNameOrTitle;
extern int16_t G7105_EditChampionNameOrTitleCharacterIndex;
extern int16_t G2274_ColorPalette[16];
extern char* G7003_;
extern int16_t G7102_;
extern int16_t G7103_;

/* CEDT007.C */
extern volatile int16_t G7004_SavedGameFileHandle;

/* CEDT008.C */
extern unsigned char G0235_auc_Graphic559_ThingDataByteCount[16];
extern unsigned char* G7117_Bitmap_Mirror;
extern unsigned char* G7116_Bitmap_FilePickerArrows;
extern int16_t G7114_LoadedChampionCount;
extern CMP G2246_CMPData;
extern long G7110_RandomSeed;
extern GAME* G7111_Games;
extern int16_t G7113_DialogBitmapIndex;
extern int16_t G7112_HideMousePointerCount;
extern unsigned char* G2244_apuc_DialogBitmaps[2];
extern long G7115_DialogByteCount;
extern BACKUP_PORTRAIT G2329_s_UndoPortrait;
extern BACKUP_PORTRAIT G2328_s_TempPortrait;
extern unsigned char* G2243_OnScreenPortraitBitmaps[4];
extern FILE_PICKER G4186_s_FilePicker;
/*extern int16_t G7005_FilePickerOnScreen;
extern FILE_LIST* G7006_;
extern unsigned char* G7007_FilePickerFileListBitmap;
extern long G7008_FilePickerFileListBitmapByteCount;
extern int16_t G7009_FilePickerFileListWidth;
extern int16_t G7010_FilePickerFileListHeight;
extern int16_t G2286_ai_Box_FilePickerFileList[4];
extern unsigned int16_t G7011_FilePickerFileListTopOnScreen;
extern unsigned int16_t G7012_FilePickerFirstFileNameIndex;
extern INPUT_INFO** G7013_;
extern INPUT_INFO* G7014_[6];*/
extern int16_t G2301_Unreferenced;
extern FILE_PICKER_FILENAME G4187_FilePickerFileName;
extern char G2331_Unreferenced;

/* STRING.C */
extern char G2295_IntegerToHexDigit[16];

/* CEDT010.C */
extern long G7118_;
extern char G4178_[120];
extern CEDT10STRUCT G4185_;
extern char G4179_[120];

/* CEDT011.C */
extern PROGRAM_STATE* G7128_LastProgramState;
extern int16_t G7129_ProgramStateOrdinal;
extern int16_t (*G7125_)();
extern unsigned int16_t G7126_;
extern unsigned int16_t G7127_CleanupHandlerCount;
extern CLEANUP_HANDLER G2252_CleanupHandlers[5];

/* CEDT012.C */
extern int16_t G7149_;
extern int16_t (*G7130_)(UDSTRUCT44* Pxxxx_ps_);
extern int16_t G7131_Date;
extern int16_t G7132_;
extern char G7133_;
extern char G7134_;
extern char G7135_;
extern unsigned char G7136_;
extern int16_t G7137_;
extern int16_t G7138_;
extern char G7139_;
extern char G7140_;
extern unsigned int16_t G7141_SegmentCount;
extern UDSTRUCTA G4188_;
/*extern unsigned int16_t G7142_;       Probably a bigger structure from G7130_ to G7148_
extern UDSTRUCT55** G7143_;
extern unsigned long G7144_;
extern UDSTRUCT1** G7145_;
extern int16_t G7146_;*/
extern int16_t G7147_;
extern int16_t G7148_;

/* CEDT013.C */
extern char G2300_FileNamesList[200][32];

/* CEDT014.C */
extern FILE_LIST G7151_;
extern char G2322_Unreferenced[4];
extern unsigned int16_t G7150_;
extern UDSTRUCT8 G2296_[1];
extern unsigned int16_t G7152_;

/* UTMEMORY.C */
extern UDSTRUCTB G4189_;
/*extern int16_t G2332_Unreferenced;
extern UTM_BLOCK_PREFIX* G7153_;
extern int16_t G7154_;*/
extern MEMORY_REGION* G7155_pc_FirstMemoryArea;
extern MEMORY_REGION* G7156_pc_LastMemoryArea;
extern unsigned int16_t G7157_MemoryAreaCount;

/* CEDT016.C */
extern int16_t G7017_;
extern int16_t G7018_;
extern int16_t G7019_;

/* CEDTDATA.C */
extern ERRMSG G2241_ErrorMessages[12];
extern char* G7054_LOAD_CHAMPIONS;
extern char* G7055_SAVE_CHAMPIONS;
extern char* G7056_MAKE_NEW_ADVENTURE;
extern char* G7057_REVERT;
extern char* G7058_UNDO;
extern char* G7059_QUIT;
extern int16_t G2302_ai_Box_DialogDimensions[4];
extern int16_t G2256_ai_Box_FilePickerDialog[4];
extern char* G7020_PORTRAIT;
extern char* G7068_YOU_MAY_LOAD_EITHER_A_SAVED_GAME_OR_A_CHAMPION_PORTRAIT;
extern char* G7069_YOU_MAY_SAVE_EITHER_THE_WHOLE_GAME_OR_THE_SELECTED_CHAMPIONS_PORTRAIT;
extern char* G7070_PLEASE_SELECT_A_PORTRAIT;
extern char* G7071_PLEASE_WAIT_LOADING_SAVED_GAME;
extern char* G7072_PLEASE_WAIT_SAVING_GAME;
extern char* G7073_PLEASE_WAIT_SAVING_CHAMPION;
extern char* G7074_PLEASE_WAIT_LOADING_CHAMPION;
extern char* G7077_ERROR_WHILE_SAVING_CHAMPION;
extern char* G7078_ERROR_WHILE_SAVING_GAME;
extern char* G7079_THIS_CHAMPION_IS_DAMAGED;
extern char* G7080_THIS_CHAMPION_CANNOT_BE_USED_WITH_THIS_ADVENTURE;
extern char* G7081_EACH_CHAMPION_MUST_HAVE_A_UNIQUE_FIRST_NAME;
extern char* G7075_PLEASE_WAIT_LOADING_NEW_ADVENTURE;
extern char* G7076_PLEASE_WAIT_SAVING_NEW_ADVENTURE;
extern char* G7083_THE_NEW_ADVENTURE_CAN_ONLY_BE_MADE_AFTER_A_SAVED_GAME_IS_LOADED;
extern char* G7084_CANT_MAKE_NEW_ADVENTURE_FROM_THIS_SAVED_GAME;
extern char* G7085_LOAD_WHICH_SAVED_GAME;
extern char* G7086_SYSTEM_ERROR_23001;
extern char* G7087_SYSTEM_ERROR_23002;
extern char* G7088_SYSTEM_ERROR_23003;
extern char* G7082_INCORRECT_OR_DAMAGED_SAVED_GAME;
extern char* G7060_OK;
extern char* G7061_OK_CANCEL;
extern char* G7062_RETRY_CANCEL;
extern char* G7063_OK_CANCEL_FORMAT;
extern char* G7064_GAME_PORTRAIT_CANCEL;
extern char* G7065_DUNGEON_MASTER_CHAOS_STRIKES_BACK_CANCEL;
extern char* G7066_NEW_DISK;
extern char* G7067_CANCEL;
extern KEY2BOARD_INPUT G2262_as_KeyboardInput_Dialog1Choice[2];
extern MOUSE2_INPUT G2258_as_MouseInput_Dialog1Choice[2];
extern MOUSE2_INPUT G2259_as_MouseInput_Dialog2Choices[3];
extern MOUSE2_INPUT G2261_as_MouseInput_Dialog3ChoicesB[4];
extern MOUSE2_INPUT G2260_as_MouseInput_Dialog3ChoicesA[4];
extern INPUT_INFO G2263_s_Input_Dialog1Choice;
extern INPUT_INFO G2264_s_Input_Dialog2Choices;
extern INPUT_INFO G2254_s_Input_Dialog3ChoicesB;
extern INPUT_INFO G2255_s_Input_Dialog3ChoicesA;
/*extern int16_t G4181_i_Unreferenced;*/
extern UD_COMMAND G2257_Command;
extern MOUSE2_INPUT G2285_as_FilePickerDialogButtons[5];
extern INPUT_INFO G2287_s_InputInfo_FilePickerDialog;
extern int16_t G2284_Box_FilePickerArrows[4];
extern unsigned int16_t G7035_PortraitWidth;
extern unsigned int16_t G7036_PortraitHeight;
extern int16_t G7037_MirrorBitmap_Width;
extern int16_t G7038_MirrorBitmap_Height;
extern int16_t G7039_MirrorPortraitLeftMargin;
extern int16_t G7040_MirrorPortraitTopMargin;
extern unsigned int16_t G7041_SelectedColorBoxHeight;
extern unsigned int16_t G7042_PortraitWidthZoomFactor;
extern unsigned int16_t G7043_PortraitHeightZoomFactor;
extern int16_t G7044_DialogWidth;
extern int16_t G7045_DialogHeight;
extern int16_t G7046_FilePickerArrowsWidth;
extern int16_t G7047_FilePickerArrowsHeight;
extern unsigned int16_t G7048_FilePickerFileListVisibleFileNameCount;
extern unsigned int16_t G7049_FilePickerFileListLineHeight;
extern int16_t G7050_FilePickerFileListLeft;
extern int16_t G7051_FilePickerFileListTop;
extern int16_t G2277_ai_Box_SelectedPortraitZoomed[4];
extern int16_t G7024_SelectedColorBoxX1;
extern int16_t G7025_SelectedColorBoxX2;
extern int16_t G7026_SelectedColorBoxY1Base;
extern int16_t G2304_Unreferenced;
extern int16_t G2278_ai_Box_ColorPalette[4];
extern int16_t G2273_aai_Box_ChampionNames[4][4];
extern int16_t G2275_aai_Box_Portraits[4][4];
extern int16_t G2276_ai_Box_Mirror[4];
extern int16_t G2279_ai_Box_SelectedPortraitSmall[4];
extern int16_t G2269_aai_Box_StatisticsArea[4];
extern MOUSE2_INPUT G2272_MouseInputs[18];
extern KEY2BOARD_INPUT G2305_KeyboardInputs[8];
extern INPUT_INFO G2280_;
extern char* G0417_apc_BaseSkillNames[4];
extern char* G0428_apc_SkillLevelNames[15];
extern char* G7021_HEALTH;
extern char* G7022_STAMINA;
extern char* G7023_MANA;
extern int16_t G7027_;
extern int16_t G7028_;
extern int16_t G7029_HealthStaminaManaScreenX;
extern int16_t G7030_HealthScreenY;
extern int16_t G7052_TextLineSpacing;
extern unsigned int16_t G7053_TextCharacterWidth;
extern int16_t G7031_;
extern int16_t G7032_;
extern int16_t G7033_FilePickerDialogTitleX;
extern int16_t G7034_FilePickerDialogTitleY;
extern char* G2242_[26];
extern FILE_INFO G2297_DataFiles[10];

/* CEDT017.C */
extern int G7159_ScreenBufferByteCount;
extern int16_t G7161_ScreenPixelWidth;
extern int16_t G7158_ScreenPixelHeight;
extern char G4190_ac_Unreferenced[8];

/* CEDT018.C */
extern unsigned char G2267_auc_Graphic_Mirror[247];
extern unsigned char G2268_auc_Graphic_FilePickerArrows[324];
extern long G7162_;
extern int16_t G2266_ai_Semaphores[1];

/* CEDT019.C */
/* _MWSTACK_LIMIT + another long + 5 longs. Linked with module containing main() */
extern long G4191_al_Unreferenced[4];
extern unsigned char G1103_auc_InterfaceAndScrollsFont[420];
extern long G0064_al_Graphic562_PrintTextMasks2[4];
extern long G0065_al_Graphic562_PrintTextMasks1[4];
extern char G4182_ac_Unreferenced[256]; /* CLIB data ? */

/* CEDT020.C */

/* CEDT021.C */

/* CEDT022.C */
extern char G7164_;
extern char G4192_ac_Unreferenced[4];

/* CEDT023.C */
extern char* G2282_[17];
extern UDSTRUCT7 G2298_[2];
extern UDSTRUCT6 G2299_[18];
extern CEDT_DRIVE_INFO G4194_;
/*extern int16_t G7166_DataDriveOrdinal;
extern int16_t G2283_[20];*/
extern UDSTRUCT8 G2281_[2];
extern unsigned int16_t G7165_;

/* CPCLRBYT.C */

/* CEDT025.C */
extern UDSTRUCT6 G2265_KeyboardInputSpecialCharacters[19];

/* CEDT028.C */
extern unsigned char* G7169_puc_AvailableRAMBottom;
extern long G7168_AvailableRAMByteCount;

/* CEDT029.C */
extern BOOLEAN G0567_B_GameAndSaveDiskUseSameDrive;
extern char* G2321_[4];
extern FILE_HANDLE G4081_i_FileHandle;
extern unsigned char G2048_auc_GameDiskDriveLetter[3];
extern unsigned char G2049_auc_SavedGameDiskDriveLetter[3];
extern char G0575_ac_SavedGameFileName[14];
extern char G0576_ac_SavedGameBackupFileName[14];
extern int16_t G2145_i_GameDiskDriveOrdinal;
extern int16_t G2146_i_SaveDiskDriveOrdinal;

/* CEDT026.C */
extern unsigned char G0042_auc_Graphic562_Bitmap_ArrowPointer[162];
extern char G4079_MWORK[MosWorkSize];
extern int16_t G4071_i_MSE_STATE;
extern unsigned char G4075_aauc_MSE_CURSOR[4][512];
extern long G4073_ai_HOT_X[4];
extern long G4074_ai_HOT_Y[4];
extern int16_t G8092_MousePointerType;
extern int G4155_i_CurrentMouseButtonsStatus;
extern int G4153_i_CurrentMouseX;
extern int G4154_i_CurrentMouseY;
extern int G4152_i_CurrentMouseButtonsStatus;
extern int G4156_i_CurrentMouseButtonsStatus;

/* CEDTFNT.C */
extern int16_t G7091_;
extern int16_t G7092_;
extern int16_t G7093_;
extern int16_t G7094_;
extern char G7170_[1728]; /* 1728 = 6 * 288 = size of font in F31x */
extern unsigned char* G2148_puc_InterfaceAndScrollsFontCustomColors;
extern int16_t G2104_i_InterfaceAndScrollsFontCurrentTextColor;
extern int16_t G2105_i_InterfaceAndScrollsFontCurrentBackgroundColor;
extern char G4184_ac_Unreferenced[2048];

/* CEDTTXT.C */

/* CEDT030.C */

/* CEDT027.C */
extern COLOR_DEF G8147_CREDITS[17];
extern COLOR_DEF G8148_ENTRANCE[17];
extern COLOR_DEF G8149_ICON[17];
extern COLOR_DEF G8150_INVENTORY[17];
extern COLOR_DEF G8151_LIGHT0[17];
extern COLOR_DEF G8152_LIGHT1[17];
extern COLOR_DEF G8153_LIGHT2[17];
extern COLOR_DEF G8154_LIGHT3[17];
extern COLOR_DEF G8155_LIGHT4[17];
extern COLOR_DEF G8156_LIGHT5[17];
extern COLOR_DEF G8157_BLACK[33];
extern COLOR_DEF G8158_BLUE[33];
extern COLOR_DEF G8159_PRESENTS[17];
extern COLOR_DEF G8160_DUNGEON[9];
extern COLOR_DEF G8161_MASTER[2];
extern COLOR_DEF G8162_SWOOSH1[2];
extern COLOR_DEF G8163_SWOOSH2[2];
extern COLOR_DEF G8164_SWOOSH3[2];
extern COLOR_DEF G8165_SWOOSH4[2];
extern COLOR_DEF G8166_SWOOSH5[2];
extern COLOR_DEF G8167_SWOOSH6[2];
extern COLOR_DEF G8168_SWOOSH7[2];
extern COLOR_DEF G8169_SWOOSH8[5];
extern COLOR_DEF G8170_SWOOSH9[5];
extern COLOR_DEF G8171_SWOOSH10[3];
extern COLOR_DEF G8172_[17];
extern COLOR_DEF G8173_[17];
extern COLOR_DEF G8174_[17];
extern COLOR_DEF* G8176_PaletteTable[29];
extern COLOR_DEF G8175_CREAT_PAL[14][6];
extern unsigned char G4105_WORK[2048];
extern unsigned char G4104_SWORK[16384];
extern unsigned char G4106_EGBPARA[150];
extern int G4103_WRITE_PAGE;
extern unsigned char* G0348_Bitmap_Screen;
extern int G4107_HATCH_DATA[2];
extern char G8183_aac_FullPalette[32][3];
extern char G4148_ac_Unreferenced[3];
extern char G4094_CURTAIN_FLAG;
extern int16_t G4118_;
extern unsigned char* G2160_puc_Bitmap_Destination;
extern unsigned char* G2159_puc_Bitmap_Source;
extern unsigned char G4108_DEC_BUF[32000];

#else

/* PROJEXPL.C */
extern long G0361_l_LastCreatureAttackTime;
extern long G0362_l_LastPartyMovementTime;
extern int16_t G0363_i_SecondaryDirectionToOrFromParty;
extern int16_t G0364_i_CreatureDamageOutcome;
extern BOOLEAN G0365_B_CreateLauncherProjectile;
extern int16_t G0366_i_ProjectilePoisonAttack;
extern int16_t G0367_i_ProjectileAttackType;

/* DIALOG.C */
#ifdef MEDIA670_F31E_F31J
extern int16_t G2062_DialogSetIndex;
extern unsigned int16_t G0335_ui_SelectedDialogChoice;
#endif
extern int16_t G2064_[2];

/* DUNGEON.C */
extern int16_t G0233_ai_Graphic559_DirectionToStepEastCount[4];
extern int16_t G0234_ai_Graphic559_DirectionToStepNorthCount[4];
extern unsigned char G0235_auc_Graphic559_ThingDataByteCount[16];
extern unsigned char G0236_auc_Graphic559_AdditionalThingCounts[16];
extern OBJECT_INFO G0237_as_Graphic559_ObjectInfo[180];
extern unsigned int16_t G0245_aui_Graphic559_FixedPossessionsCreature12Skeleton[3];
extern unsigned int16_t G0246_aui_Graphic559_FixedPossessionsCreature09StoneGolem[2];
extern unsigned int16_t G0247_aui_Graphic559_FixedPossessionsCreature16Trolin_Antman[2];
extern unsigned int16_t G0248_aui_Graphic559_FixedPossessionsCreature18AnimatedArmour_DethKnight[7];
extern unsigned int16_t G0249_aui_Graphic559_FixedPossessionsCreature07Rock_RockPile[5];
extern unsigned int16_t G0250_aui_Graphic559_FixedPossessionsCreature04PainRat_Hellhound[3];
extern unsigned int16_t G0251_aui_Graphic559_FixedPossessionsCreature06Screamer[3];
extern unsigned int16_t G0252_aui_Graphic559_FixedPossessionsCreature15MagentaWorm_Worm[4];
extern unsigned int16_t G0253_aui_Graphic559_FixedPossessionsCreature24RedDragon[11];
extern WEAPON_INFO G0238_as_Graphic559_WeaponInfo[46];
extern ARMOUR_INFO G0239_as_Graphic559_ArmourInfo[58];
extern unsigned char G0241_auc_Graphic559_JunkInfo[53];
extern int16_t G0242_ai_Graphic559_FoodAmounts[8];
extern CREATURE_INFO G0243_as_Graphic559_CreatureInfo[C027_CREATURE_TYPE_COUNT];
#ifdef MEDIA488_F20E_F20J
extern unsigned char G0244_auc_Graphic559_CreatureAttackSounds[8];
#endif
#ifdef MEDIA670_F31E_F31J
extern char G2003_aauc_CreatureSounds[18][2];
#endif
extern DOOR_INFO G0254_as_Graphic559_DoorInfo[4];
#ifdef MEDIA670_F31E_F31J
extern char* G2214_apc_CreatureNames[27];
#endif
extern unsigned int16_t* G0260_pui_DungeonTextData;
extern unsigned char G0261_auc_CurrentMapWallOrnamentIndices[16];
extern unsigned char G0262_auc_CurrentMapFloorOrnamentIndices[16];
extern unsigned char G0263_auc_CurrentMapDoorOrnamentIndices[17];
extern unsigned char* G0264_puc_CurrentMapAllowedCreatureTypes;
extern int16_t G0265_i_CurrentMapInscriptionWallOrnamentIndex;
extern int16_t G0266_i_CurrentMapViAltarWallOrnamentIndex;
extern int16_t G0267_ai_CurrentMapAlcoveOrnamentIndices[C003_ALCOVE_ORNAMENT_COUNT];
extern int16_t G0268_ai_CurrentMapFountainOrnamentIndices[C001_FOUNTAIN_ORNAMENT_COUNT];
extern unsigned char* G0276_puc_DungeonRawMapData;
extern MAP* G0269_ps_CurrentMap;
extern unsigned int16_t* G0270_pui_CurrentMapColumnsCumulativeSquareFirstThingCount;
extern unsigned char** G0271_ppuc_CurrentMapData;
extern int16_t G0272_i_CurrentMapIndex;
extern int16_t G0273_i_CurrentMapWidth;
extern int16_t G0274_i_CurrentMapHeight;
extern DOOR_INFO G0275_as_CurrentMapDoorInfo[2];
extern MAP* G0277_ps_DungeonMaps;
extern DUNGEON_HEADER* G0278_ps_DungeonHeader;
extern unsigned char*** G0279_pppuc_DungeonMapData;
extern unsigned int16_t* G0280_pui_DungeonColumnsCumulativeSquareThingCount;
extern unsigned int16_t* G0281_pui_DungeonMapsFirstColumnIndex;
extern unsigned int16_t G0282_ui_DungeonColumnCount;
extern THING* G0283_pT_SquareFirstThings;
extern unsigned char* G0284_apuc_ThingData[16];
extern int16_t G0285_i_SquareAheadElement;
extern BOOLEAN G0286_B_FacingAlcove;
extern BOOLEAN G0287_B_FacingViAltar;
extern BOOLEAN G0288_B_FacingFountain;
extern int16_t G0289_i_DungeonView_ChampionPortraitOrdinal;
extern THING G0290_T_DungeonView_InscriptionThing;
extern int16_t G2210_aai_XYZ_DungeonViewClickable[6][4];
extern THING G0292_aT_PileTopObject[5];
extern char G0255_aac_Graphic559_MessageAndScrollEscapeReplacementStrings[32][8];
extern char G0256_aac_Graphic559_EscapeReplacementCharacters[32][2];
extern char G0257_aac_Graphic559_InscriptionEscapeReplacementStrings[32][8];
extern unsigned char G0258_auc_Graphic559_GroupDirections[4];
/*static unsigned char G0294_auc_LastDiscardedThingMapIndex[16];*/

/* MENUDRAW.C */
extern unsigned char G0498_auc_Graphic560_PaletteChanges_ActionAreaObjectIcon[16];

/* ENDGAME.C */
#ifdef MEDIA670_F31E_F31J
extern jmp_buf G2023_jmp_buf;
#endif

/* COMMAND.C */
extern MOUSE_INPUT* G0441_ps_PrimaryMouseInput;
extern MOUSE_INPUT* G0442_ps_SecondaryMouseInput;
#ifdef MEDIA488_F20E_F20J
extern MOUSE_INPUT G0445_as_Graphic561_PrimaryMouseInput_Entrance[5];
#endif
#ifdef MEDIA670_F31E_F31J
extern MOUSE_INPUT G0445_as_Graphic561_PrimaryMouseInput_Entrance[6];
#endif
#ifdef MEDIA488_F20E_F20J
extern MOUSE_INPUT G0446_as_Graphic561_PrimaryMouseInput_RestartGame[2];
#endif
#ifdef MEDIA670_F31E_F31J
extern MOUSE_INPUT G0446_as_Graphic561_PrimaryMouseInput_RestartGame[3];
#endif
extern MOUSE_INPUT G0447_as_Graphic561_PrimaryMouseInput_Interface[20];
extern MOUSE_INPUT G0448_as_Graphic561_SecondaryMouseInput_Movement[9];
extern MOUSE_INPUT G0449_as_Graphic561_SecondaryMouseInput_ChampionInventory[39];
extern MOUSE_INPUT G2045_as_MouseInput_PanelChampionRename[36];
extern MOUSE_INPUT G0454_as_Graphic561_MouseInput_SpellArea[10];
extern MOUSE_INPUT G0452_as_Graphic561_MouseInput_ActionAreaNames[5];
extern MOUSE_INPUT G0453_as_Graphic561_MouseInput_ActionAreaIcons[5];
extern KEYBOARD_INPUT* G0443_ps_PrimaryKeyboardInput;
extern KEYBOARD_INPUT* G0444_ps_SecondaryKeyboardInput;
#ifdef MEDIA670_F31E_F31J
extern KEYBOARD_INPUT G2195_as_PrimaryKeyboardInput_Entrance[3];
#endif
extern KEYBOARD_INPUT G0458_as_Graphic561_PrimaryKeyboardInput_Interface[8];
extern KEYBOARD_INPUT G0459_as_Graphic561_SecondaryKeyboardInput_Movement[7];
#ifdef MEDIA488_F20E_F20J
extern KEYBOARD_INPUT G2046_as_PrimaryKeyboardInput_PanelChampionRename[34];
#endif
#ifdef MEDIA670_F31E_F31J
extern KEYBOARD_INPUT G2046_as_PrimaryKeyboardInput_PanelChampionRename[60];
#endif
extern MOUSE_INPUT* G0480_aaps_PrimaryMouseInput_DialogSets[2][4];
extern COMMAND G0432_as_CommandQueue[M529_COMMAND_QUEUE_SIZE + 1];
extern int16_t G0433_i_CommandQueueFirstIndex;
extern int16_t G0434_i_CommandQueueLastIndex;
extern BOOLEAN G0435_B_CommandQueueLocked;
extern BOOLEAN G0436_B_PendingClickPresent;
extern int16_t G0437_i_PendingClickX;
extern int16_t G0438_i_PendingClickY;
extern int16_t G0439_i_PendingClickButtonsStatus;
extern MOUSE_INPUT G0450_as_Graphic561_PrimaryMouseInput_PartyResting[3];
extern MOUSE_INPUT G0451_as_Graphic561_PrimaryMouseInput_FrozenGame[3];
extern MOUSE_INPUT G0455_as_Graphic561_MouseInput_ChampionNamesHands[13];
extern MOUSE_INPUT G0456_as_Graphic561_MouseInput_PanelChest[9];
extern MOUSE_INPUT G0457_as_Graphic561_MouseInput_PanelResurrectReincarnateCancel[4];
extern KEYBOARD_INPUT G0460_as_Graphic561_PrimaryKeyboardInput_PartyResting[3];
extern KEYBOARD_INPUT G0461_as_Graphic561_PrimaryKeyboardInput_FrozenGame[2];
extern MOUSE_INPUT G0471_as_Graphic561_PrimaryMouseInput_ViewportDialog1Choice[2];
extern MOUSE_INPUT G0472_as_Graphic561_PrimaryMouseInput_ViewportDialog2Choices[3];
extern MOUSE_INPUT G0473_as_Graphic561_PrimaryMouseInput_ViewportDialog3Choices[4];
extern MOUSE_INPUT G0474_as_Graphic561_PrimaryMouseInput_ViewportDialog4Choices[5];
extern MOUSE_INPUT G0475_as_Graphic561_PrimaryMouseInput_ScreenDialog1Choice[2];
extern MOUSE_INPUT G0476_as_Graphic561_PrimaryMouseInput_ScreenDialog2Choices[3];
extern MOUSE_INPUT G0477_as_Graphic561_PrimaryMouseInput_ScreenDialog3Choices[4];
extern MOUSE_INPUT G0478_as_Graphic561_PrimaryMouseInput_ScreenDialog4Choices[5];
extern int G4147_i_Unreferenced;
/*static KEYBOARD_INPUT* G0481_ps_PrimaryKeyboardInputBackup;*/
/*static KEYBOARD_INPUT* G0482_ps_SecondaryKeyboardInputBackup;*/
/*static MOUSE_INPUT* G0483_ps_PrimaryMouseInputBackup;*/
/*static MOUSE_INPUT* G0484_ps_SecondaryMouseInputBackup;*/

/* GROUP.C */
extern ACTIVE_GROUP* G0375_ps_ActiveGroups;
extern unsigned int16_t G0376_ui_MaximumActiveGroupCount;
extern unsigned int16_t G0377_ui_CurrentActiveGroupCount;
extern int16_t G0378_i_CurrentGroupMapX;
extern int16_t G0379_i_CurrentGroupMapY;
extern THING G0380_T_CurrentGroupThing;
extern unsigned int16_t G0381_ui_CurrentGroupDistanceToParty;
extern int16_t G0382_i_CurrentGroupPrimaryDirectionToParty;
extern int16_t G0383_i_CurrentGroupSecondaryDirectionToParty;
extern unsigned char G0384_auc_GroupMovementTestedDirections[4];
extern char G0385_ac_FluxCages[4];
extern unsigned int16_t G0386_ui_FluxCageCount;
extern BOOLEAN G0387_B_GroupMovementBlockedByWallStairsPitFakeWallFluxcageTeleporter;
extern THING G0388_T_GroupMovementBlockedByGroupThing;
extern BOOLEAN G0389_B_GroupMovementBlockedByDoor;
extern BOOLEAN G0390_B_GroupMovementBlockedByParty;
extern unsigned int16_t G0391_ui_DropMovingCreatureFixedPossessionsCellCount;
extern unsigned char G0392_auc_DropMovingCreatureFixedPossessionsCells[4];
/*static unsigned char G0394_auc_StealFromSlotIndices[8];*/
/*static long G0395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime;*/
/*static ACTIVE_GROUP* G0396_ps_TwoHalfSquareSizedCreaturesGroupLastDirectionSetActiveGroup;*/

/* MEMORY.C */
extern int16_t G0631_i_GraphicsDatFileReferenceCount;
extern BOOLEAN G2232_B_GraphicMemoryInitialized;
extern BOOLEAN G0661_B_LargeHeapMemory;
extern long G0648_l_AvailableHeapMemoryByteCount;
extern unsigned int16_t* G0639_DerivedBitmapByteCount;
extern GRATTR* G2005_GraphicWidthHeight;
extern int16_t G0644_i_FloppyDiskReadBufferContentType_CPSDF;
extern unsigned char HUGE* G0643_puc_FloppyDiskReadBuffer_CPSDF;
extern FILE_HANDLE G0630_i_GraphicsDatFileHandle;
extern unsigned int16_t G0632_ui_GraphicCount;
extern long G0633_l_GraphicsDatFileSize;
extern unsigned int16_t* G0634_pui_GraphicCompressedByteCount;
extern unsigned int16_t* G0635_pui_GraphicDecompressedByteCount;
extern unsigned char HUGE** G0636_ppuc_Graphics;
extern unsigned int16_t* G0637_pui_NativeBitmapBlockIndices;
extern unsigned int16_t* G0638_pui_DerivedBitmapBlockIndices;
extern int16_t G0640_i_FloppyDiskReadBufferGraphicsDatChunkIndex;
#ifdef MEDIA670_F31E_F31J
extern int16_t G2065_GraphicsDatFileFormat;
#endif
extern unsigned char HUGE* G0641_puc_CacheMemoryBottom;
extern unsigned char HUGE* G0642_puc_GraphicMemoryBottom;
extern unsigned char HUGE* G0645_puc_HeapMemoryTop;
extern unsigned char HUGE* G0646_puc_AvailableHeapMemoryTop;
extern long G2209_Unreferenced;
extern unsigned char HUGE* G0649_puc_GraphicMemoryTop;
extern unsigned char HUGE* G0650_puc_GraphicMemoryBottomTemp;
extern unsigned char HUGE* G0651_puc_CacheMemoryTop;
extern unsigned char HUGE* G0652_puc_AvailableGEMMemoryBottom;
extern long G0653_l_AvailableGEMMemoryByteCount;
extern BOOLEAN G0654_B_GraphicMemoryInitialized;
extern unsigned char HUGE** G0655_ppuc_Blocks;
extern long G0656_l_AvailableCacheMemoryByteCount;
extern unsigned char HUGE* G0657_puc_FirstUnusedBlock;
extern unsigned char HUGE* G0658_puc_FirstUsedBlock;
extern unsigned char HUGE* G0659_puc_LastUsedBlock;
extern unsigned char HUGE* G0660_puc_FirstReferencedUsedBlock;
extern long G0662_l_LastResetCacheUsageCountsTime;

/* LOADSAVE.C */
extern char* G0536_pc_GAMELOADEDREADYTOPLAY;
extern char* G0560_pc_OK;
extern FILE_HANDLE G0521_i_GameFileHandle;
#ifdef MEDIA488_F20E_F20J
extern char G0534_ac_SaveHeaderAdditionalData[134];
#endif
#ifdef MEDIA670_F31E_F31J
extern char G0534_ac_SaveHeaderAdditionalData[132];
#endif
#ifdef MEDIA488_F20E_F20J
extern long G0522_l_Unreferenced;
extern long G0525_l_GameID;
#endif
extern unsigned int16_t G0526_ui_DungeonID;
#ifdef MEDIA670_F31E_F31J
extern long G0525_l_GameID;
#endif
extern int16_t G0527_i_Platform;
extern int16_t G0528_i_Format;
extern int16_t G0529_i_Useless; /* BUG0_00 Useless code */
extern BOOLEAN G0530_B_LoadingCompressedDungeon;
extern unsigned char* G0531_puc_DecompressedDungeonCurrentPosition;
extern long G0532_l_DecompressedDungeonRemainingByteCount;
extern char* G0537_pc_CANTMODIFYGAMEDISK;
extern char* G0538_pc_THATSNOTTHEMASTERDISK;
extern char* G0539_pc_CANTFINDSAVEDGAME;
extern char* G0540_pc_UNABLETOSAVEGAME;
#ifdef MEDIA488_F20E_F20J
extern char* G0541_pc_UNABLETOFORMATDISK;
#endif
extern char* G0542_pc_THATSTHEGAMEDISK;
extern char* G0543_pc_THATSAGAMESAVEDISK;
extern char* G0544_pc_THATDISKISWRITEPROTECTED;
extern char* G0545_pc_THATDISKISUNREADABLE;
extern char* G0546_pc_THATSNOTTHESAMEGAME;
extern char* G0547_pc_SAVEDGAMEDAMAGED;
extern char* G0548_pc_PUTTHEGAMESAVEDISKIN;
extern char* G0549_pc_PUTTHEGAMEDISKIN;
extern char* G0550_pc_PUTABLANKDISKIN;
extern char* G0551_pc_SAVINGGAME;
extern char* G0552_pc_LOADINGGAME;
#ifdef MEDIA488_F20E_F20J
extern char* G0553_pc_FORMATTINGDISK;
extern char* G0554_pc_FORMATDISKANYWAY;
#endif
extern char* G0555_pc_THEREISNODISKIN;
#ifdef MEDIA670_F31E_F31J
extern char* G2240_pc_GAMENOTSAVED;
#endif
extern char* G0556_pc_LOADSAVEDGAME;
extern char* G0557_pc_SAVEANDPLAY;
extern char* G0558_pc_SAVEANDQUIT;
extern char* G0561_pc_CANCEL;
#ifdef MEDIA670_F31E_F31J
extern unsigned long G2018_ul_LastSaveTime;
#endif

/* OBJECT.C */
extern unsigned char* G0352_apc_ObjectNames[C199_OBJECT_NAME_COUNT];
extern int16_t G2007_ai_XYZ[4];
#ifdef MEDIA686_F31J
extern int16_t G2230_;
#endif

/* ENTRANCE.C */
#ifdef MEDIA488_F20E_F20J
extern unsigned char* G0562_apuc_Bitmap_EntranceDoorAnimationSteps[10];
#endif
#ifdef MEDIA670_F31E_F31J
extern int16_t G2226_i_EntranceGraphicCount;
extern unsigned char** G2220_ppuc_EntranceGraphics;
extern unsigned char* G2225_puc_Bitmap_InterfaceEntranceScreen;
extern unsigned char* G2219_puc_EntranceAnimationStep;
#endif
extern unsigned char* G0563_puc_Graphic4_InterfaceEntranceScreen;
extern unsigned char* G0564_puc_Graphic5_InterfaceCredits;
extern unsigned char* G0565_puc_Graphic535_Sound02DoorRattle;
extern unsigned char* G0566_puc_Graphic534_Sound01Switch;
#ifdef MEDIA670_F31E_F31J
extern int16_t G2221_ai_XYZ[4];
extern int16_t G2222_ai_XYZ[4];
#endif

/* MENU.C */
extern int16_t G0514_i_MagicCasterChampionIndex;
extern unsigned int16_t G0506_ui_ActingChampionOrdinal;
extern unsigned int16_t G0507_ui_ActionCount;
extern BOOLEAN G0508_B_RefreshActionArea;
extern BOOLEAN G0509_B_ActionAreaContainsIcons;
extern char G0495_ac_Graphic560_ActionDefense[44];
extern ACTION_LIST G0713_s_ActionList;
#ifdef MEDIA559_F20E_F31E
extern char G0490_ac_Graphic560_ActionNames[300];
#endif
#ifdef MEDIA576_F20J_F31J
extern char G0490_ac_Graphic560_ActionNames[360];
#endif
extern SPELL G0487_as_Graphic560_Spells[M530_SPELL_COUNT];
extern unsigned char G0485_aauc_Graphic560_SymbolBaseManaCost[4][6];
extern unsigned char G0486_auc_Graphic560_SymbolManaCostMultiplier[6];
extern ACTION_SET G0489_as_Graphic560_ActionSets[44];
extern unsigned char G0491_auc_Graphic560_ActionDisabledTicks[44];
extern unsigned char G0492_auc_Graphic560_ActionDamageFactor[44];
extern unsigned char G0493_auc_Graphic560_ActionHitProbability[44];
extern unsigned char G0494_auc_Graphic560_ActionStamina[44];
extern unsigned char G0496_auc_Graphic560_ActionSkillIndex[44];
extern unsigned char G0497_auc_Graphic560_ActionExperienceGain[44];
#ifdef MEDIA488_F20E_F20J
extern int16_t G0499_ai_Graphic560_Box_ActionArea3ActionsMenu[4];
extern int16_t G0500_ai_Graphic560_Box_ActionArea2ActionsMenu[4];
extern int16_t G0501_ai_Graphic560_Box_ActionArea1ActionMenu[4];
extern int16_t G0502_ai_Graphic560_Box_ActionAreaMediumDamage[4];
extern int16_t G0503_ai_Graphic560_Box_ActionAreaSmallDamage[4];
extern int16_t G0504_ai_Graphic560_Box_SpellAreaControls[4];
#endif
extern int16_t G0513_i_ActionDamage;
extern THING G0517_T_ActionTargetGroupThing;

/* IO.C */
extern int16_t G0587_i_HideMousePointerRequestCount;
extern int16_t G0588_i_MouseButtonsStatus;
extern int16_t G2010_;
extern int16_t G2011_;
extern int16_t G4128_VIS_MX;
extern int16_t G4129_VIS_MY;
extern unsigned char* G4130_MOUSE_SAVE;
extern unsigned char* G4131_MMOUSE_VECT;
extern unsigned char* G4132_BMOUSE_VECT;
extern BOOLEAN G0592_B_BuildMousePointerScreenAreaRequested;
extern BOOLEAN G0593_B_BuildMousePointerScreenAreaCompleted;
extern BOOLEAN G0594_B_BuildMousePointerScreenAreaRequestedInMouseException;
extern BOOLEAN G0595_B_MousePointerVisible;
extern BOOLEAN G0596_B_NoDrawInVerticalBlankWhileHidingMousePointer;
extern BOOLEAN G0597_B_IgnoreMouseMovements;
extern BOOLEAN G0598_B_MousePointerBitmapUpdated;
extern BOOLEAN G0600_B_UseObjectAsMousePointerBitmap;
extern BOOLEAN G0601_B_UseHandAsMousePointerBitmap;
extern unsigned int16_t G0599_ui_UseChampionIconOrdinalAsMousePointerBitmap;
extern char G4137_MSE_SHAPE[6];
extern int16_t G4138_CURSORFLAG;
extern unsigned char* G4139_CYAN_ARROW_CURSOR;
extern unsigned char* G4140_CYAN_HAND_CURSOR;
extern unsigned char* G0615_puc_Bitmap_MousePointerOriginalColorsObject;
extern unsigned char* G0616_puc_Bitmap_MousePointerModifiedColorsObject;
extern unsigned char* G0613_puc_Bitmap_MousePointerOriginalColorsChampionIcon;
extern int16_t G2164_i_MousePointerChampionIndex;
extern unsigned char G0042_auc_Graphic562_Bitmap_ArrowPointer[M075_BITMAP_BYTE_COUNT(18, 18)];
extern unsigned char G0043_auc_Graphic562_Bitmap_HandPointer[M075_BITMAP_BYTE_COUNT(18, 18)];
extern MOUSE_POINTER_SCREEN_REGION G2052_as_MousePointerScreenRegions[16];
extern int16_t G2051_ai_Zone_ChampionIconRegion[4];
extern char G4079_MWORK[MosWorkSize];
extern int16_t G4071_i_MSE_STATE;
extern unsigned char G4075_aauc_MSE_CURSOR[4][512];
extern long G4073_ai_HOT_X[4];
extern long G4074_ai_HOT_Y[4];
extern int16_t G3104_ai_XYZ_MouseBound[4];
extern BOOLEAN G3102_B_MouseBounded;
extern int16_t G8092_MousePointerType;
extern int16_t G4072_B_FORCED_UPDATE;
extern int16_t G3103_i_MouseBoundButtonsStatus;
extern long G4078_;
extern long G4076_;
extern long G4077_;
extern int16_t G2050_ai_Box_Impossible[4];
extern unsigned char G0045_auc_Graphic562_PaletteChanges_MousePointerIconShadow[16];
extern int16_t G2053_ai_XYZ[4];
extern int16_t G2054_ai_XYZ[4];
#ifdef MEDIA488_F20E_F20J
extern int16_t G0621_ai_Box_MousePointer_ChampionIconShadow[4];
extern int16_t G0622_ai_Box_MousePointer_ChampionIcon[4];
#endif
extern int16_t G2055_ai_XYZ_ChampionIcon[4];
extern int16_t G2056_ai_XYZ[4];
extern int16_t G2218_[4];

/* CHAMPION.C */
extern PARTY_INFO G0407_s_Party;
extern CHAMPION G1068_as_Champions[4];
extern LEADER_HAND_OBJECT G4055_s_LeaderHandObject;
extern unsigned int16_t G0415_ui_LeaderEmptyHanded;
extern int16_t G0416_i_DelayMouse_Useless;
extern int16_t G0411_i_LeaderIndex;
extern int16_t G2139_i_RenameCommand;
extern int16_t G0409_ai_ChampionPendingDamage[4];
extern unsigned int16_t G0410_ai_ChampionPendingWounds[4];

/* DUNVIEW.C */
extern unsigned char* G0086_puc_Bitmap_ViewportBlackArea;
extern unsigned char* G0087_puc_Bitmap_ViewportFloorArea;
extern int16_t G2108_Floor;
extern int16_t G2109_Ceiling;
#ifdef MEDIA488_F20E_F20J
extern int16_t G3072_i_WallSet_Wall_D3R2;
extern int16_t G3010_i_WallSet_Wall_D3L2;
extern int16_t G3011_i_WallSet_Wall_D3C;
extern int16_t G3004_i_WallSet_Wall_D3L;
extern int16_t G3005_i_WallSet_Wall_D3R;
extern int16_t G3012_i_WallSet_Wall_D2C;
extern int16_t G3006_i_WallSet_Wall_D2L;
extern int16_t G3007_i_WallSet_Wall_D2R;
extern int16_t G3013_i_WallSet_Wall_D1C;
extern int16_t G3008_i_WallSet_Wall_D1L;
extern int16_t G3009_i_WallSet_Wall_D1R;
extern int16_t G3014_i_WallSet_Wall_D0L;
extern int16_t G3015_i_WallSet_Wall_D0R;
extern int16_t G2115_DoorFrameTopD2LCR;
extern int16_t G2114_DoorFrameTopD2L;
extern int16_t G2113_DoorFrameTopD2R;
extern int16_t G2112_DoorFrameTopD1LCR;
extern int16_t G2111_DoorFrameTopD1L;
extern int16_t G2110_DoorFrameTopD1R;
extern int16_t G2120_DoorFrameLeftD3L;
extern int16_t G2119_DoorFrameLeftD3C;
extern int16_t G2118_DoorFrameLeftD2C;
extern int16_t G2117_DoorFrameLeftD1C;
extern int16_t G2116_DoorFrameFrontD0C;
extern int16_t G2196_DoorFrameRightD1C;
extern int16_t G3049_i_WallSetFlipped_Wall_D3C;
extern int16_t G3050_i_WallSetFlipped_Wall_D3L;
extern int16_t G3051_i_WallSetFlipped_Wall_D3R;
extern int16_t G3052_i_WallSetFlipped_Wall_D2C;
extern int16_t G3053_i_WallSetFlipped_Wall_D2L;
extern int16_t G3054_i_WallSetFlipped_Wall_D2R;
extern int16_t G3055_i_WallSetFlipped_Wall_D1C;
extern int16_t G3056_i_WallSetFlipped_Wall_D1L;
extern int16_t G3057_i_WallSetFlipped_Wall_D1R;
extern int16_t G3058_i_WallSetFlipped_Wall_D0L;
extern int16_t G3059_i_WallSetFlipped_Wall_D0R;
#endif
#ifdef MEDIA670_F31E_F31J
extern int16_t G2107_WallSet[15];
extern int16_t G4151_i_Unreferenced;
extern int16_t G2110_DoorFrameTopD1R;
extern int16_t G2111_DoorFrameTopD1L;
extern int16_t G2112_DoorFrameTopD1LCR;
extern int16_t G2113_DoorFrameTopD2R;
extern int16_t G2114_DoorFrameTopD2L;
extern int16_t G2115_DoorFrameTopD2LCR;
extern int16_t G2116_DoorFrameFrontD0C;
extern int16_t G2196_DoorFrameRightD1C;
extern int16_t G2117_DoorFrameLeftD1C;
extern int16_t G2118_DoorFrameLeftD2C;
extern int16_t G2119_DoorFrameLeftD3C;
extern int16_t G2120_DoorFrameLeftD3L;
extern int16_t G2121_;
extern int16_t G2122_;
extern int16_t G3071_WallSetNotFlipped[15];
extern int16_t G3048_WallSetFlipped[17];
#endif
extern ORNAMENT_INFO G0101_as_CurrentMapWallOrnamentsInfo[16];
extern ORNAMENT_INFO G0102_as_CurrentMapFloorOrnamentsInfo[16];
extern ORNAMENT_INFO G0103_as_CurrentMapDoorOrnamentsInfo[17];
extern OBJECT_ASPECT G0209_as_Graphic558_ObjectAspects[C085_OBJECT_ASPECT_COUNT];
extern PROJECTIL_ASPECT G0210_as_Graphic558_ProjectileAspects[C014_PROJECTILE_ASPECT_COUNT];
extern CREATURE_ASPECT G0219_as_Graphic558_CreatureAspects[C027_CREATURE_TYPE_COUNT];
extern unsigned char* G0075_apuc_PaletteChanges_Projectile[4];
extern unsigned char G0215_auc_Graphic558_ProjectileScales[7];
extern unsigned char G0213_auc_Graphic558_PaletteChanges_FloorOrnament_D3[16];
extern unsigned char G0214_auc_Graphic558_PaletteChanges_FloorOrnament_D2[16];
extern unsigned char* G0074_puc_Bitmap_Temporary;
extern BOOLEAN G0076_B_UseFlippedWallAndFootprintsBitmaps;
extern BOOLEAN G0077_B_DoNotDrawFluxcagesDuringEndgame;
extern int16_t G2154_i_ZoneShiftX;
extern int16_t G2155_i_ZoneShiftY;
extern int16_t G2032_ai_XYZ[4];
#ifdef MEDIA488_F20E_F20J
extern int16_t G0675_i_StairsNativeBitmapIndex_Up_Front_D3L;
extern int16_t G0676_i_StairsNativeBitmapIndex_Up_Front_D3C;
extern int16_t G0677_i_StairsNativeBitmapIndex_Up_Front_D2L;
extern int16_t G0678_i_StairsNativeBitmapIndex_Up_Front_D2C;
extern int16_t G0679_i_StairsNativeBitmapIndex_Up_Front_D1L;
extern int16_t G0680_i_StairsNativeBitmapIndex_Up_Front_D1C;
extern int16_t G0681_i_StairsNativeBitmapIndex_Up_Front_D0C_Left;
extern int16_t G0682_i_StairsNativeBitmapIndex_Down_Front_D3L;
extern int16_t G0683_i_StairsNativeBitmapIndex_Down_Front_D3C;
extern int16_t G0684_i_StairsNativeBitmapIndex_Down_Front_D2L;
extern int16_t G0685_i_StairsNativeBitmapIndex_Down_Front_D2C;
extern int16_t G0686_i_StairsNativeBitmapIndex_Down_Front_D1L;
extern int16_t G0687_i_StairsNativeBitmapIndex_Down_Front_D1C;
extern int16_t G0688_i_StairsNativeBitmapIndex_Down_Front_D0C_Left;
extern int16_t G0689_i_StairsNativeBitmapIndex_Side_D2L;
extern int16_t G0690_i_StairsNativeBitmapIndex_Up_Side_D1L;
extern int16_t G0691_i_StairsNativeBitmapIndex_Down_Side_D1L;
extern int16_t G0692_i_StairsNativeBitmapIndex_Side_D0L;
#endif
#ifdef MEDIA670_F31E_F31J
extern int16_t G0079_ai_StairsNativeBitmapIndices[C018_STAIRS_GRAPHIC_COUNT];
#endif
extern int16_t G0693_ai_DoorNativeBitmapIndex_Front_D3LCR[2];
extern int16_t G0694_ai_DoorNativeBitmapIndex_Front_D2LCR[2];
extern int16_t G0695_ai_DoorNativeBitmapIndex_Front_D1LCR[2];
#ifdef MEDIA488_F20E_F20J
extern int16_t G3060_i_WallSet_Wall_D3C;
extern int16_t G3061_i_WallSet_Wall_D3L;
extern int16_t G3062_i_WallSet_Wall_D3R;
extern int16_t G3063_i_WallSet_Wall_D2C;
extern int16_t G3064_i_WallSet_Wall_D2L;
extern int16_t G3065_i_WallSet_Wall_D2R;
extern int16_t G3066_i_WallSet_Wall_D1C;
extern int16_t G3067_i_WallSet_Wall_D1L;
extern int16_t G3068_i_WallSet_Wall_D1R;
extern int16_t G3069_i_WallSet_Wall_D0L;
extern int16_t G3070_i_WallSet_Wall_D0R;
extern unsigned char G0188_aauc_Graphic558_FieldAspects[12][8];
extern unsigned char G0190_auc_Graphic558_WallOrnamentDerivedBitmapIndexIncrement[12];
extern unsigned char G0191_auc_Graphic558_FloorOrnamentNativeBitmapIndexIncrements[9];
#endif
#ifdef MEDIA670_F31E_F31J
extern int16_t G4141_;
extern int16_t G4142_;
extern char G2026_ac_ViewSquareIndexToViewLane[23];
extern char G2027_ac_ViewSquareIndexToViewDepth[23];
extern char G2028_ac_ViewSquareIndexTo[23];
extern char G2029_ac_ViewSquareIndexTo[23];
extern char G2033_ac_ViewSquareIndexTo[23];
extern char G2034_ac_ViewSquareIndexTo[23];
extern char G2035_ac_ViewSquareIndexToFieldAspectIndex[23];
extern unsigned char G0188_aauc_Graphic558_FieldAspects[16][8];
extern unsigned char G0190_auc_Graphic558_WallOrnamentDerivedBitmapIndexIncrement[14];
extern unsigned char G0191_auc_Graphic558_FloorOrnamentNativeBitmapIndexIncrements[11];
#endif
extern unsigned char G0192_auc_Graphic558_AlcoveOrnamentIndices[C003_ALCOVE_ORNAMENT_COUNT];
extern int G0193_ai_Graphic558_FountainOrnamentIndices[C001_FOUNTAIN_ORNAMENT_COUNT];
extern unsigned char G0194_auc_Graphic558_WallOrnamentCoordinateSetIndices[60];
extern unsigned char G0195_auc_Graphic558_FloorOrnamentCoordinateSetIndices[9];
extern unsigned char G0196_auc_Graphic558_DoorOrnamentCoordinateSetIndices[12];
extern unsigned char G0197_auc_Graphic558_DoorButtonCoordinateSet[1];
extern unsigned char G0198_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D3[16];
extern unsigned char G0199_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D2[16];
extern unsigned char G0200_auc_Graphic558_PaletteChanges_DoorOrnament_D3[16];
extern unsigned char G0201_auc_Graphic558_PaletteChanges_DoorOrnament_D2[16];
extern unsigned char G0204_auc_Graphic558_UnreadableInscriptionBoxY2[15];
extern unsigned char G0212_auc_Graphic558_PaletteChanges_Smoke[16];
extern unsigned char G0216_auc_Graphic558_ExplosionBaseScales[5];
extern unsigned char G0217_aauc_Graphic558_ObjectPileShiftSetIndices[16][2];
extern int16_t G2025_as_Graphic558_CreatureReplacementColorSets[13][2];
extern unsigned char G0221_auc_Graphic558_PaletteChanges_Creature_D3[16];
extern unsigned char G0222_auc_Graphic558_PaletteChanges_Creature_D2[16];
extern char G0223_aac_Graphic558_ShiftSets[3][8];
extern unsigned char G2036_auc_RebirthStep2ExplosionScale[7];
extern unsigned char G2037_auc_RebirthStep1ExplosionScale[7];
extern int16_t G0230_i_CurrentFloorSet;
extern int16_t G0231_i_CurrentWallSet;
/*static BOOLEAN G0232_B_FirstFunctionCall;*/

/* CHAMDRAW.C */
#ifdef MEDIA670_F31E_F31J
extern BOOLEAN G2016_ai_SkillRecentlyUpgraded[4][4];
#endif
extern char* G0417_apc_BaseSkillNames[4];
#ifdef MEDIA670_F31E_F31J
extern BOOLEAN G2149_;
#endif
extern BOOLEAN G0420_B_MousePointerHiddenToDrawChangedObjectIconOnScreen;
#ifdef MEDIA670_F31E_F31J
extern unsigned char G2362_auc_PaletteChanges_Invisibility[16];
#endif
/*static char G0419_ac_IntegerToStringConversionBuffer[5];*/

/* MOVESENS.C */
extern unsigned int16_t G0397_i_MoveResultMapX;
extern unsigned int16_t G0398_i_MoveResultMapY;
extern unsigned int16_t G0399_ui_MoveResultMapIndex;
extern unsigned int16_t G0401_ui_MoveResultCell;
extern unsigned int16_t G0400_i_MoveResultDirection;
extern BOOLEAN G0402_B_UseRopeToClimbDownPit;
extern int16_t G0403_i_SensorRotationEffect;
extern int16_t G0404_i_SensorRotationEffectMapX;
extern int16_t G0405_i_SensorRotationEffectMapY;
extern int16_t G0406_i_SensorRotationEffectCell;

/* COORD.C */
extern int16_t G2067_i_ViewportScreenX;
extern int16_t G2068_i_ViewportScreenY;
extern unsigned int16_t G2069_LargestCacheableNativeBitmapByteCount;
extern unsigned int16_t G2183_CreditsBitmapByteCount;
extern int16_t G2071_C320_ScreenPixelWidth;
extern int16_t G2072_C200_ScreenPixelHeight;
extern unsigned int16_t G2070_ViewportBitmapByteCount;
extern int16_t G2073_C224_ViewportPixelWidth;
extern int16_t G2074_C136_ViewportHeight;
extern unsigned int16_t G2142_ViewportBlackAreaByteCount;
#ifdef MEDIA488_F20E_F20J
extern unsigned int16_t G3003_ui_LargestCacheableNativeBitmapByteCount;
#endif
#ifdef MEDIA670_F31E_F31J
extern int16_t G2140_i_LargestCacheableNativeBitmapWidth;
extern int16_t G2141_i_LargestCacheableNativeBitmapHeight;
#endif
extern int16_t G2184_ActionIconByteCount;
extern int16_t G2075_ObjectIconWidth;
extern int16_t G2076_ObjectIconHeight;
extern int16_t G2185_Unreferenced;
extern int16_t G2186_Unreferenced;
extern int16_t G2077_C1_TextMargin;
extern int16_t G2078_C32_PortraitWidth;
extern int16_t G2079_C29_PortraitHeight;
extern int16_t G2080_C19_ChampionIconWidth;
extern int16_t G2081_C14_ChampionIconHeight;
extern int16_t G2082_;
extern int16_t G2083_C6_;
extern int16_t G2084_C1_;
extern int16_t G2085_;
extern int16_t G2086_C1_;
extern int16_t G2087_C6_TextCharacterWidth;
extern int16_t G2088_C7_TextLineHeight;
extern int16_t G2089_C8_InscriptionCharacterWidth;
extern int16_t G2090_C8_InscriptionLineHeight;
#ifdef MEDIA576_F20J_F31J
extern int16_t G2337_i_JapaneseCharacterMaximumWidth;
extern int16_t G2338_i_JapaneseCharacterMaximumHeight;
extern int16_t G2339_;
extern int16_t G2340_;
extern int16_t G2341_;
extern int16_t G2217_;
extern int16_t G2342_C17_JapaneseTextLineHeight;
#endif
extern unsigned int16_t G2091_MessageAreaLineByteCount;
extern int16_t G2092_MessageAreaWidth;
extern int16_t G2187_MessageAreaHeight_Unreferenced;
extern int16_t G2093_DamageToCreatureMediumWidth;
extern int16_t G2094_DamageToCreatureMediumHeight;
extern int16_t G2095_DamageToCreatureSmallWidth;
extern int16_t G2096_DamageToCreatureSmallHeight;
extern int16_t G2097_FoodOrWaterBarShadowOffset;
#ifdef MEDIA670_F31E_F31J
extern int16_t G2343_i_MagicMapIconWidth;
extern int16_t G2344_i_MagicMapIconHeight;
extern int16_t G2345_;
extern int16_t G2346_;
extern int16_t G2347_;
extern int16_t G2348_;
extern int16_t G2349_;
#endif
typedef struct {
        unsigned int16_t RecordType;
        int16_t ParentRecordIndex;
        int16_t Data1;
        int16_t Data2;
} LAYOUT_RECORD;

typedef struct layout_range {
        struct layout_range* NextRange;
        int16_t FirstIndex;
        int16_t LastIndex;
#ifdef MEDIA595_X30J_P20JA_P20JB_I34E_I34M_A36M_A31E_A31M_A33M_A35E_A35M_X31J_P31J
        LAYOUT_RECORD Records[];
#endif
#ifdef MEDIA551_F20E_F20J_F31E_F31J
        LAYOUT_RECORD Records[1];
#endif
} LAYOUT_RANGE;

typedef struct {
        unsigned char s3m1; /* Type. 1: s3u contains a graphic index, 2: s3u contains a pointer to a bitmap */
        char s3m2;
        int16_t X;
        int16_t Y;
        int16_t Width; /* If 0, get the width of the bitmap */
        int16_t Height; /* If 0, get the height of the bitmap */
        union {
                int16_t GraphicIndex;
                unsigned char* Bitmap;
        } s3u;
} STRUCT3;

#ifdef MEDIA488_F20E_F20J
extern STRUCT3 G2002_NegativeBitmaps[47];
/* LayoutData structures
extern LAYOUT_RANGE* G2174_ps_LayoutData; */
#endif
#ifdef MEDIA670_F31E_F31J
extern STRUCT3 G2002_NegativeBitmaps[62];
extern int16_t G2001_TemporaryZoneIndex;
extern int16_t G2063_aai_XYZ_Temporary[8][4];
extern LAYOUT_RANGE* G2174_ps_LayoutData;
#endif

/* SOUND.C */
#ifdef MEDIA488_F20E_F20J
extern unsigned int16_t G4080_aui_SoundVolume[M513_SOUND_COUNT];
#endif
#ifdef MEDIA670_F31E_F31J
extern int16_t G4080_aui_SoundVolume[M513_SOUND_COUNT];
#endif

/* STARTUP2.C */
extern BOOLEAN G1147_B_LoadBonusDungeon;
extern BOOLEAN G0524_B_RestartGameAllowed;
extern BOOLEAN G0523_B_RestartGameRequested;
#ifdef MEDIA670_F31E_F31J
extern BOOLEAN G2167_B_DisabledMenusDrawn;
extern unsigned char* G2165_puc_BaseMemoryBottom;
extern long G2166_l_BaseMemorySize; /* Some memory size drawn when "mem" typed in game */
#endif

/* DATA.C */
extern int16_t G2189_i_EntrancePaletteIndex;
extern int16_t G2098_i_CreditsPaletteIndex;
#ifdef MEDIA488_F20E_F20J
extern int16_t G2099_i_InterfacePaletteIndex;
extern int16_t G2100_i_BlackPaletteIndex;
extern int16_t G2101_i_BluePaletteIndex;
#endif
extern int16_t G2190_i_TitlePresentsPaletteIndex;
extern int16_t G2191_i_TitleDungeonPaletteIndex;
extern int16_t G2192_i_TitleMasterPaletteIndex;
#ifdef MEDIA488_F20E_F20J
extern int16_t G0003_ai_Graphic562_Box_Title_StrikesBack_Destination[4];
extern int16_t G0004_ai_Graphic562_Box_Title_StrikesBack_Source[4];
extern int16_t G0005_ai_Graphic562_Box_Title_Presents[4];
extern int16_t G0006_ai_Graphic562_Box_Entrance_DungeonView[4];
extern int16_t G0007_ai_Graphic562_Box_Entrance_OpeningDoorLeft[4];
extern int16_t G0008_ai_Graphic562_Box_Entrance_OpeningDoorRight[4];
extern int16_t G0009_ai_Graphic562_Box_Entrance_Doors[4];
extern int16_t G0010_ai_Graphic562_Box_Entrance_ClosedDoorLeft[4];
extern int16_t G0011_ai_Graphic562_Box_Entrance_ClosedDoorRight[4];
extern int16_t G0013_ai_Graphic562_Box_Endgame_Restart_Outer[4];
extern int16_t G0014_ai_Graphic562_Box_Endgame_Restart_Inner[4];
extern int16_t G3000_ai_Box_Screen[4];
extern int16_t G0018_ai_Graphic562_MandatoryGraphicIndices[M531_MANDATORY_GRAPHIC_COUNT];
#endif
#ifdef MEDIA670_F31E_F31J
extern int16_t G2099_i_InterfacePaletteIndex;
extern int16_t G2100_i_BlackPaletteIndex;
extern int16_t G2101_i_BluePaletteIndex;
extern int16_t G2021_ai_XYZ_Endgame_Quit_Outer[4];
extern int16_t G2022_ai_XYZ_Endgame_Quit_Inner[4];
extern int16_t G2019_ai_XYZ_Endgame_Restart_Outer[4];
extern int16_t G2020_ai_XYZ_Endgame_Restart_Inner[4];
extern int16_t G0018_ai_Graphic562_MandatoryGraphicIndices[M531_MANDATORY_GRAPHIC_COUNT];
extern SOUND_DATA G0060_as_Graphic562_Sounds[M513_SOUND_COUNT];
#endif
extern SLOT_BOX G0030_as_Graphic562_SlotBoxes[46];
extern int16_t G0038_ai_Graphic562_SlotMasks[38];
extern int16_t G0039_ai_Graphic562_LightPowerToLightAmount[16];
extern char G0023_aac_Graphic562_OrderedCellsToAttack[8][4];
extern unsigned char G0024_auc_Graphic562_WoundProbabilityIndexToWoundMask[4];
extern unsigned char G0025_auc_Graphic562_StealFromSlotIndices[8];
extern int16_t G0026_ai_Graphic562_IconGraphicFirstIconIndex[7];
extern unsigned char G0029_auc_Graphic562_ChargeCountToTorchType[16];
extern int16_t G0040_ai_Graphic562_PaletteIndexToLightAmount[6];
extern unsigned char G0046_auc_Graphic562_ChampionColor[4];
extern unsigned char G0050_auc_Graphic562_WoundDefenseFactor[6];
extern char G0051_ac_Graphic562_UnderscoreCharacterString[2];
extern char G0052_ac_Graphic562_RenameChampionInputCharacterString[2];
extern char G2047_ac_ChampionRenameCharacters[31];
extern int16_t G0057_ai_Graphic562_SlotDropOrder[30];
extern unsigned char G0059_auc_Graphic562_SquareTypeToEventType[7];
#ifdef MEDIA488_F20E_F20J
extern SOUND_DATA G0060_as_Graphic562_Sounds[M513_SOUND_COUNT];
extern long G0064_al_Graphic562_PrintTextMasks2[4];
extern long G0065_al_Graphic562_PrintTextMasks1[4];
#endif
extern char G0066_ac_Graphic562_LineFeedCharacterString[2];

/* FLOPPY.C */
extern BOOLEAN G0567_B_GameAndSaveDiskUseSameDrive;
extern unsigned int16_t G0568_ui_DiskType;
extern char* G0569_pc_SavedGameFileName;
extern char* G0570_pc_SavedGameBackupFileName;
extern unsigned char* G0571_puc_GameDiskDriveName;
extern unsigned char* G0572_puc_SavedGameDiskDriveName;
extern FILE_HANDLE G4081_i_FileHandle;
extern unsigned char G2048_auc_GameDiskDriveLetter[3];
extern unsigned char G2049_auc_SavedGameDiskDriveLetter[3];
extern char G0575_ac_SavedGameFileName[];
extern char G0576_ac_SavedGameBackupFileName[];
extern int16_t G2145_i_GameDiskDriveOrdinal;
extern int16_t G2146_i_SaveDiskDriveOrdinal;
extern int16_t G2143_i_CurrentDefaultDriveOrdinal;

/* TEXT.C */
extern unsigned char* G0357_puc_InterfaceAndScrollsFont;
extern unsigned char* G0356_puc_Bitmap_MessageAreaNewRow;
extern char G0353_ac_StringBuildBuffer[150];
extern BOOLEAN G0355_B_ScrollMessageArea;
extern unsigned char* G2148_puc_InterfaceAndScrollsFontCustomColors;
extern int16_t G2104_i_InterfaceAndScrollsFontCurrentTextColor;
extern int16_t G2105_i_InterfaceAndScrollsFontCurrentBackgroundColor;
/*static int16_t G0358_i_MessageAreaCursorRow;*/
/*static int16_t G0359_i_MessageAreaCursorColumn;*/
/*extern long G0360_al_MessageAreaRowExpirationTime[M532_MESSAGE_AREA_ROW_COUNT]; Is probably static too */

/* TIMELINE.C */
/*      If commented, F0237_TIMELINE_DeleteEvent compiles identically to original. But other functions in TIMELINE.C do not compile fine. */
/*      If not commented, F0237_TIMELINE_DeleteEvent does not compile identically to original. But other functions in TIMELINE.C compile fine. */
#ifdef MEDIA488_F20E_F20J
extern unsigned int16_t G0369_EventMaximumCount;
#endif
#ifdef MEDIA670_F31E_F31J
extern int16_t G0369_EventMaximumCount;
extern int16_t G2009_i_LargestUsedEventOrdinal;
#endif
extern EVENT* G0370_ps_Events;
extern unsigned int16_t* G0371_pui_Timeline;
extern unsigned int16_t G0372_ui_EventCount;
extern unsigned int16_t G0373_ui_FirstUnusedEventIndex;

/* BASE.C */
extern unsigned char* G0296_puc_Bitmap_Viewport;
extern BOOLEAN G0297_B_DrawFloorAndCeilingRequested;
extern BOOLEAN G0298_B_NewGame;
extern unsigned int16_t G0299_ui_CandidateChampionOrdinal;
extern BOOLEAN G0300_B_PartyIsResting;
extern BOOLEAN G0301_B_GameTimeTicking;
extern BOOLEAN G0302_B_GameWon;
extern BOOLEAN G0303_B_PartyDead;
extern int16_t G0304_i_DungeonViewPaletteIndex;
extern unsigned int16_t G0305_ui_PartyChampionCount;
extern int16_t G0308_i_PartyDirection;
extern int16_t G0306_i_PartyMapX;
extern int16_t G0307_i_PartyMapY;
extern int16_t G0309_i_PartyMapIndex;
extern int16_t G0310_i_DisabledMovementTicks;
extern int16_t G0311_i_ProjectileDisabledMovementTicks;
extern unsigned int16_t G0312_i_LastProjectileDisabledMovementDirection;
extern unsigned long G0313_ul_GameTime;
extern BOOLEAN G2024_B_PendingMusicOn;
#ifdef MEDIA670_F31E_F31J
extern int16_t G2106_B_ShowMusicState;
/* ????????? align because next variable is long? or because unreferenced variable is here ? */
/*#ifdef MEDIA171_S10EA_S10EB_S11E_S12E_S12G_S13FA_S13FB_S20E_S21E_A31E_A31M_A33M_A35E_A35M*/
/*extern int16_t G0320_i_Unreferenced; *//* BUG0_00 Useless code */
/*#endif*/
#endif
extern unsigned long G0349_ul_LastRandomNumber;
extern int16_t G0317_i_WaitForInputVerticalBlankCount;
extern int16_t G0318_i_WaitForInputMaximumVerticalBlankCount;
extern unsigned long G0319_ul_LoadGameTime;
extern BOOLEAN G0321_B_StopWaitingForPlayerInput;
extern BOOLEAN G0322_B_PaletteSwitchingEnabled;
extern BOOLEAN G0323_B_EnablePaletteSwitchingRequested;
extern BOOLEAN G0324_B_DrawViewportRequested;
extern BOOLEAN G0325_B_SetMousePointerToObjectInMainLoop;
extern BOOLEAN G0326_B_RefreshMousePointerInMainLoop;
extern int16_t G0327_i_NewPartyMapIndex;
extern BOOLEAN G0331_B_PressingEye;
extern BOOLEAN G0332_B_StopPressingEye;
extern BOOLEAN G0333_B_PressingMouth;
extern BOOLEAN G0334_B_StopPressingMouth;
#ifdef MEDIA488_F20E_F20J
extern unsigned int16_t G0335_ui_SelectedDialogChoice;
extern int16_t G0336_i_HighlightBoxX1;
extern int16_t G0337_i_HighlightBoxX2;
extern int16_t G0338_i_HighlightBoxY1;
extern int16_t G0339_i_HighlightBoxY2;
extern BOOLEAN G0340_B_HighlightBoxInversionRequested;
#endif
#ifdef MEDIA670_F31E_F31J
extern int16_t G2152_B_PressingClosedImaginaryFakeWall;
extern BOOLEAN G2229_B_StopPressingClosedImaginaryFakeWall;
extern int16_t G2012_HighlightedZone[4];
extern BOOLEAN G2150_B_;
#endif
extern BOOLEAN G0341_B_HighlightBoxEnabled;
extern BOOLEAN G0342_B_RefreshDungeonViewPaletteRequested;
extern unsigned char* G0343_puc_Graphic_DialogBox;
extern int16_t G4144_HPAL1[16];
extern int16_t G4145_HPAL2[16];
extern unsigned int16_t G0345_aui_BlankBuffer[32];

/* PANEL.C */
extern int16_t G0423_i_InventoryChampionOrdinal;
#ifdef MEDIA670_F31E_F31J
extern int16_t G2008_i_PanelContent;
#endif
extern int16_t G0424_i_PanelContent;
extern THING G0425_aT_ChestSlots[8];
extern THING G0426_T_OpenChest;
extern char* G0428_apc_SkillLevelNames[15];
extern int16_t G0421_i_ObjectDescriptionTextX;
extern int16_t G0422_i_ObjectDescriptionTextY;
#ifdef MEDIA670_F31E_F31J
extern char* G2213_apc_CreatureNameScrollText;
extern char* G2212_apc_MagicMapScrollText;
#endif
/*static char* G0430_apc_DirectionNames[4];*/
/*static char* G0431_apc_StatisticNames[7];*/

/* CLIKMENU.C */
/*static int16_t G0465_ai_Graphic561_MovementArrowToStepForwardCount[4];*/
/*static int16_t G0466_ai_Graphic561_MovementArrowToStepRightCount[4];*/

/* IMAGE2.C */
extern unsigned char* G2160_puc_Bitmap_Destination;
extern unsigned char* G2159_puc_Bitmap_Source;
extern unsigned char G4108_DEC_BUF[32000];

/* DRAWVIEW.C */
extern unsigned char* G0348_Bitmap_Screen;
extern COLOR_DEF G8147_CREDITS[17];
extern COLOR_DEF G8148_ENTRANCE[17];
extern COLOR_DEF G8149_ICON[17];
extern COLOR_DEF G8150_INVENTORY[17];
extern COLOR_DEF G8151_LIGHT0[17];
extern COLOR_DEF G8152_LIGHT1[17];
extern COLOR_DEF G8153_LIGHT2[17];
extern COLOR_DEF G8154_LIGHT3[17];
extern COLOR_DEF G8155_LIGHT4[17];
extern COLOR_DEF G8156_LIGHT5[17];
extern COLOR_DEF G8157_BLACK[33];
extern COLOR_DEF G8158_BLUE[33];
extern COLOR_DEF G8159_PRESENTS[17];
extern COLOR_DEF G8160_DUNGEON[9];
extern COLOR_DEF G8161_MASTER[2];
extern COLOR_DEF G8162_SWOOSH1[2];
extern COLOR_DEF G8163_SWOOSH2[2];
extern COLOR_DEF G8164_SWOOSH3[2];
extern COLOR_DEF G8165_SWOOSH4[2];
extern COLOR_DEF G8166_SWOOSH5[2];
extern COLOR_DEF G8167_SWOOSH6[2];
extern COLOR_DEF G8168_SWOOSH7[2];
extern COLOR_DEF G8169_SWOOSH8[5];
extern COLOR_DEF G8170_SWOOSH9[5];
extern COLOR_DEF G8171_SWOOSH10[3];
#ifdef MEDIA670_F31E_F31J
extern COLOR_DEF G8172_[17];
extern COLOR_DEF G8173_[17];
extern COLOR_DEF G8174_[17];
#endif
#ifdef MEDIA488_F20E_F20J
extern COLOR_DEF* G8176_PaletteTable[26];
#endif
#ifdef MEDIA670_F31E_F31J
extern COLOR_DEF* G8176_PaletteTable[29];
#endif
extern COLOR_DEF G8175_CREAT_PAL[14][6];
extern unsigned char G4105_WORK[2048];
extern unsigned char G4104_SWORK[16384];
extern unsigned char G4106_EGBPARA[150];
extern int G4103_WRITE_PAGE;
extern int G4107_HATCH_DATA[2];
extern unsigned char G4114_[256];
extern BOOLEAN G4113_B_FlipHorizontalInitialized;
#ifdef MEDIA488_F20E_F20J
extern unsigned char G2304_ac_BlitShrink_PaletteChanges[16];
#endif
#ifdef MEDIA670_F31E_F31J
extern unsigned char* G2042_puc_BlitShrink_PaletteChanges;
#endif
extern unsigned char* G2043_puc_BlitShrink_BitmapSource;
extern unsigned char* G2044_puc_BlitShrink_BitmapDestination;
extern char G8183_aac_FullPalette[32][3];
extern char G4148_ac_Unreferenced[3];
extern char G4094_CURTAIN_FLAG;
extern int16_t G2123_;
extern int16_t G4149_i_Unreferenced;
extern int16_t G2061_DungeonViewPaletteIndices[6];
extern unsigned char G4096_PLAY_BUF[32000];
extern int16_t G4126_;
#ifdef MEDIA670_F31E_F31J
extern int16_t G4117_;
extern int16_t G4116_;
extern int16_t G8204_;
extern int16_t G2350_;
#endif
extern int16_t G4118_;

/* SWSH.C */
#ifdef MEDIA488_F20E_F20J
extern unsigned char G8187_Graphic_FTLLogo[2310];
extern unsigned int16_t G0745_SwooshSoundDataByteCount;
extern unsigned char G0746_auc_SwooshSoundData[4451];
#endif

/* MUSIC.C */
extern BOOLEAN G4093_B_CD_PROTECT_CPSX;
extern unsigned char G2038_auc_MusicIndexToMusicTrack[4];
extern int G4090_CD_TYPE;
extern int G4091_START_TRACK;
extern int G4092_END_TRACK;
extern int G4082_CDDeviceNumber;
extern int16_t G4083_MUSIC_TRACKS_count;
extern struct TIMEADRS G4084_TRACK_TIME[100];
extern struct TIMEADRS G4086_DISK_TIME;
extern BOOLEAN G4085_MUSIC_PLAYING;
#ifdef MEDIA670_F31E_F31J
extern BOOLEAN G4097_MusicPaused;
#endif
extern int16_t G2125_i_MusicPlayingMapIndex;
#ifdef MEDIA488_F20E_F20J
extern int16_t G2039_ai_MapIndexToMusicTrack[14];
extern int16_t G4150_i_Unreferenced;
#endif
#ifdef MEDIA670_F31E_F31J
extern BOOLEAN G2126_PendingMusicState;
extern unsigned char G4099_SquareCoordinatesToMusicTrack[10][32][32];
extern int16_t G4098_SelectedOneBytePerDungeonSquare;
extern int16_t G4102_;
extern int16_t G4101_;
#endif
extern int16_t G4087_CountdownBeforeMusicStart;
#ifdef MEDIA488_F20E_F20J
extern int16_t G4088_PendingMusicTrackIndex;
extern int16_t G4089_MusicPlayingTrackIndex;
extern BOOLEAN G3073_B_MusicOn;
#endif

/* ANIM.C */
#ifdef MEDIA670_F31E_F31J
extern unsigned char* G8210_puc_Bitmap;
extern unsigned char* G8206_;
extern FOR_LOOP G8200_[16];
extern unsigned char* G4127_[16];
extern int16_t G4146_[20];
#endif

#endif
#endif
#endif
#endif
