Return to previous page Return to menu Go to next page

The game sequence is the main function of C language and has the following form.
 Uint32 SMMA_MainMode; / * Game mode variable * /
Uint32 SMMA_MainLevel; / * Level in game mode * /
void main(void)
{
    SMMA_IniSystem (); / * System initialization * /
    SMV1_SprCmdStart();
    SMV1_SprCmdEnd();
    SCL_DisplayFrame();
    SMMA_MainMode = LOGO_MODE;
    SMMA_MainLevel = 0;
    for (;;) {/ * Infinite loop * /
          switch (SMMA_MainMode) {/ * What is the game mode? ** /
          case LOGO_MODE: / * When in Sega logo state * /
              SMLO_SegaLogo (); / * Sega logo display * /
              break;
          case TITLE_MODE: / * When in title state * /
              SMTI_Title (); / * Title display * /
              break;
          case SELECT_MODE: / * When program is selected * /
              SMSL_Select (); / * Execute program select * /
              break;
          }
    }
}

In the main function, it simply repeats calling the subroutine function with the game mode variable. The game mode variable determines the next operating state. Since game mode variables are defined as external variables, the state can be rewritten from any subroutine. Since it has LOGO_MODE as an initial value, it starts from the Sega logo display. The following shows the processing contents of each subroutine.


Return to previous page Return to menu Go to next page