Mercurial > hg > old > magoroku_racing
diff game.c @ 0:0fae5658fb0b
Initial revision
author | gongo |
---|---|
date | Thu, 02 Nov 2006 08:55:19 +0000 (2006-11-02) |
parents | |
children | b6a1385f19be |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/game.c Thu Nov 02 08:55:19 2006 +0000 @@ -0,0 +1,57 @@ +/* + * $Id$ + */ + +#include <stdio.h> +#include <stdlib.h> +#include "libps2.h" +#include "ps2util.h" + +#include "camera.h" +#include "controler.h" +#include "lindaapi.h" +#include "col.h" +#include "field.h" +#include "car.h" +#include "game.h" +#include "gSprite.h" +#include "gFont.h" + +/* schedule.c */ +extern void schedule(); +/* controler.c */ +extern Bool padCheck(); +/* linda.c */ +#ifdef LINDA +extern int linda_init(); +#else +#define linda_init() 1 +#endif +extern void linda_update(); + +Game game; + +void +game_main() +{ + Bool flg = TRUE; + game.state = GAME_INIT; + + game.play_id = linda_init(); + + while (flg) { + flg = padCheck(); + if (flg == FALSE && game.demo_flg == 1) { + game.state = GAME_FINISH; + flg = TRUE; + } + schedule(); + +#ifdef LINDA + if (game.demo_flg == 0) { + linda_update(); + psx_sync_n(); + } +#endif + } +}