view game.c @ 51:46b8f2109d34

*** empty log message ***
author gongo
date Wed, 08 Nov 2006 06:50:47 +0000
parents d7e0a5c33540
children 8cef655f3bf9
line wrap: on
line source

/*
 * $Id$
 */

#include <stdio.h>
#include <stdlib.h>
#include "libps2.h"
#include "ps2util.h"
#include "controler.h"
#include "lindaapi.h"
#include "car.h"
#include "game.h"

/* schedule.c */
extern void schedule();
/* controler.c */
extern Bool padCheck();
/* linda.c */
#ifdef LINDA
extern int linda_init();
#else
define linda_init linda_init0
#endif

Game game;

extern void sche_game_init();
extern void set_schedule(void*);

static Bool
ret()
{
    return TRUE;
}

static int
linda_init0()
{
    game.linda_exec = &ret;
    return 1;
}

void
game_main()
{
    Bool flg = TRUE;
    set_schedule(sche_game_init);

    game.play_id = linda_init();

    while (1) {
	flg = padCheck();
	if (flg == FALSE) {
	    break;
	}
	schedule();

#ifdef LINDA
	psx_sync_n();
#endif
    }
}