00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include <PA9.h>
00022 #include <dswifi9.h>
00023 #include <vector>
00024 #include <string>
00025 using std::vector;
00026 using std::string;
00027
00028 #include "macros.h"
00029 #include "spriteManager.h"
00030 #include "gameManager.h"
00031 #include "menuTitle.h"
00032 #include "menuBottom.h"
00033 #include "menuGBottom.h"
00034
00035
00036 #ifndef _ALLGRAPHICS_
00037 #define _ALLGRAPHICS_
00038 #include "../data/all_gfx_ed.c"
00039 #endif
00040
00041 #ifdef __WITHSOUND
00042 #include "boomflyF.h"
00043 #include "bootsF.h"
00044 #include "BulletReflect.h"
00045 #include "dunceF.h"
00046 #include "HookHit.h"
00047 #include "invisibleF.h"
00048 #include "lazerF.h"
00049 #include "lightningarmedF.h"
00050 #include "lightninghitF.h"
00051 #include "magnetF.h"
00052 #include "mineDrop.h"
00053 #include "mineExp.h"
00054 #include "net.h"
00055 #include "paraCloseF.h"
00056 #include "paraOpenF.h"
00057 #include "gotPickup.h"
00058 #include "skull.h"
00059 #include "skullPickup.h"
00060 #include "splashBig.h"
00061 #include "splashSmall.h"
00062 #include "teleF.h"
00063 #include "thrown.h"
00064 #include "visableF.h"
00065 #include "WeasAttack2.h"
00066 #include "WeasAttackF.h"
00067 #include "WeasRelease1.h"
00068 #include "WeasRelease2.h"
00069 #include "WeasRun1.h"
00070 #include "WeasRun2.h"
00071 #include "WeasRun3.h"
00072 #include "platformExplode.h"
00073 #include "spawnPuff.h"
00074 #include "menuMove.h"
00075 #include "menuOk.h"
00076 #include "menuCancel.h"
00077
00078
00079
00080 #endif
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179 int main(int argc, char ** argv)
00180 {
00181 PA_Init();
00182 PA_InitRand();
00183 #ifdef __WITHSOUND
00184 PA_InitSound();
00185 #endif
00186 PA_InitVBL();
00187
00188 #ifdef __MDDEBUG
00189 PA_WaitForVBL(); PA_WaitForVBL(); PA_WaitForVBL();
00190 fatInitDefault();
00191 FILE* logFile = fopen(LOGFILE, "a+");
00192 if (logFile)
00193 fprintf(logFile, "\n\n\n\n=========================================\nNEW GAME!\n\n\n\n");
00194 fclose(logFile);
00195 #endif
00196
00197
00198 StartTime(true);
00199
00200 PA_InitCustomText(0, 2, Font);
00201 PA_InitCustomText(1, 2, Font);
00202
00203
00204 gameManager *gm = new gameManager(1);
00205 menuTitle *menuTop = new menuTitle(1);
00206 menuBottom *menuBase = new menuBottom(0);
00207 menuGBottom *gameBase = new menuGBottom(0);
00208
00209 gm->statTimerID = NewTimer(true);
00210
00211 gm->loadEnvSpriteSet(envSprites_Pal, envSprites_Sprite);
00212 gm->loadPickupSpriteSet(pickupSprites_Pal, pickupSprites_Sprite);
00213 gm->loadFXSpriteSet(effectSprites_Pal, effectSprites_Sprite);
00214 gm->loadDunceSpriteSet(dunceHatSprite_Pal, dunceHatSprite_Sprite);
00215 gm->loadBootsSpriteSet(bootsSprite_Pal, bootsSprite_Sprite);
00216
00217 gm->player1000VPalleteData = player1000V_Pal;
00218
00219 menuBase->loadCursorSpriteSet(menuCursors_Pal, menuCursors_Sprite);
00220 menuBase->loadPickupSpriteSet(pickupSprites_Pal, pickupSprites_Sprite);
00221 menuBase->loadMenuSpriteSet(menuSprites_Pal, menuSprites_Sprite);
00222 menuBase->playerPallete1 = playerSprite1_Pal;
00223 menuBase->playerPallete2 = playerSprite3_Pal;
00224 menuBase->playerPallete3 = playerSprite2_Pal;
00225 menuBase->playerPallete4 = playerSprite4_Pal;
00226 menuBase->playerSprite1 = playerSprite1_Sprite;
00227 menuBase->playerSprite2 = playerSprite2_Sprite;
00228 menuBase->playerSprite3 = playerSprite3_Sprite;
00229
00230 gameBase->loadMenuSpriteSet(menuSprites_Pal, menuSprites_Sprite);
00231 gameBase->loadSpawnerSpriteSet(spawnerSpriteX_Pal, spawnerSpriteX_Sprite);
00232 gameBase->loadPickupSpriteSet(pickupSprites_Pal, pickupSprites_Sprite);
00233
00234 #ifdef __WITHSOUND
00235
00236
00237
00238 gm->loadSound(&gm->bigSplash, splashBig, splashBig_size);
00239 gm->loadSound(&gm->smallSplash, splashSmall, splashSmall_size);
00240 gm->loadSound(&gm->platformExplode, platformExplode, platformExplode_size);
00241 gm->loadSound(&gm->spawnPuff, spawnPuff, spawnPuff_size);
00242 gm->loadSound(&gm->gotPickup, gotPickup, gotPickup_size);
00243 gm->loadSound(&gm->teleport, teleF, teleF_size);
00244 gm->loadSound(&gm->skullLoop, skull, skull_size);
00245 gm->loadSound(&gm->skullPickup, skullPickup, skullPickup_size);
00246 gm->loadSound(&gm->lightningHit, lightninghitF, lightninghitF_size);
00247 gm->loadSound(&gm->lightningLoop, lightningarmedF, lightningarmedF_size);
00248 gm->loadSound(&gm->invisOn, invisibleF, invisibleF_size);
00249 gm->loadSound(&gm->invisOff, visableF, visableF_size);
00250 gm->loadSound(&gm->mineExp, mineExp, mineExp_size);
00251 gm->loadSound(&gm->mineDrop, mineDrop, mineDrop_size);
00252 gm->loadSound(&gm->gunFire, lazerF, lazerF_size);
00253 gm->loadSound(&gm->bootsJump, bootsF, bootsF_size);
00254 gm->loadSound(&gm->chutClose, paraCloseF, paraCloseF_size);
00255 gm->loadSound(&gm->chutOpen, paraOpenF, paraOpenF_size);
00256 gm->loadSound(&gm->hookHit, HookHit, HookHit_size);
00257 gm->loadSound(&gm->duncePickup, dunceF, dunceF_size);
00258 gm->loadSound(&gm->magnetLoop, magnetF, magnetF_size);
00259 gm->loadSound(&gm->netThrow, net, net_size);
00260 gm->loadSound(&gm->bulletReflect, BulletReflect, BulletReflect_size);
00261 gm->loadSound(&gm->boomerangLoop, boomflyF, boomflyF_size);
00262 gm->loadSound(&gm->throwSound, thrown, thrown_size);
00263
00264 gm->loadSound(&gm->weaselSounds[0], WeasAttack2, WeasAttack2_size);
00265 gm->loadSound(&gm->weaselSounds[1], WeasAttackF, WeasAttackF_size);
00266 gm->loadSound(&gm->weaselSounds[2], WeasRelease1, WeasRelease1_size);
00267 gm->loadSound(&gm->weaselSounds[3], WeasRelease2, WeasRelease2_size);
00268 gm->loadSound(&gm->weaselSounds[4], WeasRun1, WeasRun1_size);
00269 gm->loadSound(&gm->weaselSounds[5], WeasRun2, WeasRun2_size);
00270 gm->loadSound(&gm->weaselSounds[6], WeasRun3, WeasRun3_size);
00271
00272 menuBase->loadSound(&menuBase->menuMove, menuMove, menuMove_size);
00273 menuBase->loadSound(&menuBase->menuOk, menuOk, menuOk_size);
00274 menuBase->loadSound(&menuBase->menuCancel, menuCancel, menuCancel_size);
00275 #endif
00276
00277
00278 menuBase->menuTop = menuTop;
00279 menuBase->gameTop = gm;
00280 menuBase->gameBottom = gameBase;
00281
00282 gameBase->menuTop = menuTop;
00283 gameBase->menuBase = menuBase;
00284 gameBase->gameTop = gm;
00285
00286 gm->menuTop = menuTop;
00287 gm->menuBase = menuBase;
00288 gm->gameBottom = gameBase;
00289
00290
00291 menuTop->activate();
00292 menuBase->activate();
00293
00294
00295
00296 while (1)
00297 {
00298 if (menuTop->isActive())
00299 menuTop->gameTick();
00300 if (menuBase->isActive())
00301 menuBase->gameTick();
00302 if (gm->isActive())
00303 gm->gameTick();
00304 if (gameBase->isActive())
00305 gameBase->gameTick();
00306
00307 PA_CheckLid();
00308 PA_WaitForVBL();
00309 }
00310
00311
00312
00313
00314 return 0;
00315 }
00316