#ifndef COMPILE_H
#include "COMPILE.H"
#endif
#ifdef MEDIA551_F20E_F20J_F31E_F31J
void F2259_INIT_TOWNS_SCREEN(
void
)
{
        EGB_init(G4105_WORK, 2048);
        EGB_resolution(G4105_WORK, 0, 3);
        EGB_init(G4105_WORK, 2048);
        EGB_resolution(G4105_WORK, 1, 3);
        EGB_writePage(G4105_WORK, 1);
        EGB_writeMode(G4105_WORK, 0);
        EGB_displayStart(G4105_WORK, 2, 2, 2);
        EGB_displayStart(G4105_WORK, 1, 0, -20);
        EGB_paintMode(G4105_WORK, 32);
        EGB_writePage(G4105_WORK, 0);
        EGB_displayStart(G4105_WORK, 2, 2, 2);
        EGB_displayStart(G4105_WORK, 1, 0, -20);
        WORD(G4106_EGBPARA + 0) = 0;
        WORD(G4106_EGBPARA + 2) = 0;
        WORD(G4106_EGBPARA + 4) = 639;
        WORD(G4106_EGBPARA + 6) = 479;
        EGB_viewport(G4105_WORK, G4106_EGBPARA);
        EGB_writeMode(G4105_WORK, 0);
        EGB_displayPage(G4105_WORK, 0, 3);
        EGB_paintMode(G4105_WORK, 34);
        EGB_color(G4105_WORK, 0, 255);
        EGB_color(G4105_WORK, 1, 255);
}

void F2260_RESTORE_TOWNS_SCREEN(
void
)
{
        EGB_init(G4105_WORK, 1536);
        EGB_resolution(G4105_WORK, 0, 3);
        EGB_resolution(G4105_WORK, 1, 3);
        EGB_displayPage(G4105_WORK, 0, 3);
        WORD(G4106_EGBPARA + 0) = 0;
        WORD(G4106_EGBPARA + 2) = 0;
        WORD(G4106_EGBPARA + 4) = 640;
        WORD(G4106_EGBPARA + 6) = 480;
        EGB_viewport(G4105_WORK, G4106_EGBPARA);
        EGB_color(G4105_WORK, 0, 255);
        EGB_color(G4105_WORK, 1, 255);
        EGB_color(G4105_WORK, 3, 0);
        EGB_writeMode(G4105_WORK, 0);
}

#if ((EXETYPE == C03_GAME) || (EXETYPE == C06_CEDT))
void F0697_HatchScreenBox(
int16_t* P2372_pi_XYZ,
unsigned int16_t  P2373_ui_Color)
{
        EGB_writePage(G4105_WORK, G4103_WRITE_PAGE);
        EGB_writeMode(G4105_WORK, 0);
        EGB_color(G4105_WORK, 2, P2373_ui_Color);
        EGB_hatchingPattern(G4105_WORK, 2, 4, 2, G4107_HATCH_DATA);
        EGB_paintMode(G4105_WORK, 128);
        WORD(G4106_EGBPARA + 0) = M704_ZONE_LEFT(P2372_pi_XYZ);
        WORD(G4106_EGBPARA + 2) = M706_ZONE_TOP(P2372_pi_XYZ);
        WORD(G4106_EGBPARA + 4) = M705_ZONE_RIGHT(P2372_pi_XYZ);
        WORD(G4106_EGBPARA + 6) = M707_ZONE_BOTTOM(P2372_pi_XYZ);
        EGB_viewport(G4105_WORK, G4106_EGBPARA);
        EGB_rectangle(G4105_WORK, G4106_EGBPARA);
}

void F0698_InvertBox(
#if (defined(MEDIA508_F20E_F20J_X30J_P20JA_P20JB) || (defined(MEDIA670_F31E_F31J) && ((EXETYPE == C06_CEDT) || (EXETYPE == C05_ANIM))))
int16_t P2377_i_X1,
int16_t P2378_i_X2,
int16_t P2379_i_Y1,
int16_t P2380_i_Y2)
#else
int16_t* P2374_pi_XYZ)
#endif
{
        EGB_writePage(G4105_WORK, G4103_WRITE_PAGE);
        EGB_writeMode(G4105_WORK, 4);
        EGB_color(G4105_WORK, 2, 4);
        EGB_paintMode(G4105_WORK, 32);
#if (defined(MEDIA488_F20E_F20J) || (defined(MEDIA670_F31E_F31J) && (EXETYPE == C06_CEDT)))
        WORD(G4106_EGBPARA + 0) = P2377_i_X1;
        WORD(G4106_EGBPARA + 2) = P2379_i_Y1;
        WORD(G4106_EGBPARA + 4) = P2378_i_X2;
        WORD(G4106_EGBPARA + 6) = P2380_i_Y2;
#endif
#if (defined(MEDIA670_F31E_F31J) && (EXETYPE == C03_GAME))
        WORD(G4106_EGBPARA + 0) = M704_ZONE_LEFT(P2374_pi_XYZ);
        WORD(G4106_EGBPARA + 2) = M706_ZONE_TOP(P2374_pi_XYZ);
        WORD(G4106_EGBPARA + 4) = M705_ZONE_RIGHT(P2374_pi_XYZ);
        WORD(G4106_EGBPARA + 6) = M707_ZONE_BOTTOM(P2374_pi_XYZ);
#endif
        EGB_viewport(G4105_WORK, G4106_EGBPARA);
        EGB_rectangle(G4105_WORK, G4106_EGBPARA);
}
#endif
#endif
