#ifndef GLOBAL_H #define GLOBAL_H #include #include "CORE_console.h" #include "CORE_turbo_keys.h" #include "CORE_ds2key_compat.h" #include "CORE_network.h" #include "CORE_power.h" /* Screen descriptors */ #define BOTH 2 #define USCR 1 #define DSCR 0 /* Application States */ typedef enum state_e{ APP_SPLASH = 0, // dev compo splash APP_MAIN, // main selection menu APP_CONNECT, // connect and play! APP_PLAY, // enjoy ! APP_CONFIG, // config panel APP_CREDITS, // view credits APP_SAVE, // save config /* Sub states */ APP_CONNECT_MORE, // chose more than 2 players APP_CONFIG_POWER, // auto light off APP_CONFIG_KEYS, // turbo keys APP_CONFIG_NET, // network config (see below...) /* Subsub states (no more!) */ APP_CONFIG_NET_LOCALPORT, APP_CONFIG_NET_SERVPORT, APP_CONFIG_NET_SERVIP } state_t; /* This struct contains all the needed global datas. */ typedef struct env_s{ state_t current_state; // current application state state_t next_state; u8 pad_number; s8 uscr_bright; // up screen brightness s8 dscr_bright; // down screen brightness u8 fat_enabled:1; u8 has_changed:1; // config changes? u8 tmp_has_changed:1; u8 ds2key_compat:1; // compatibility mode flag console_t console; // the ds keys status! turbo_keys_t turbo; // individual turbo keys ds2key_t ds2key; // compatibility mode structure network_t network; // all network stuff (ports, sockets, etc...) power_t power; // energy related } env_t; /* Effective declaration */ #ifndef __MAIN_FILE__ extern env_t Env; extern env_t* tmpEnv; #else env_t Env; env_t* tmpEnv; #endif /*******************************************/ /* general functions */ /*******************************************/ /* Set all default values */ extern void Env_init(void); /* Set pad number */ extern void Env_SetPad(u8 pad); /* Perform screen fade in/out Return 1 if in progress 0 if finished */ extern u8 fadein(u8 screen); extern u8 fadeout(u8 screen); /* Check power... */ extern void env_power_check(void); #endif /* GLOBAL_H */