2019-11-16 11:44:09 +01:00
|
|
|
#include <gint/display.h>
|
|
|
|
#include <gint/keyboard.h>
|
|
|
|
#include <gint/timer.h>
|
|
|
|
|
2019-11-16 12:02:30 +01:00
|
|
|
#include "world.h"
|
2019-11-20 15:33:34 +01:00
|
|
|
#include "mario.h"
|
2019-11-16 12:02:30 +01:00
|
|
|
|
2019-11-20 18:31:20 +01:00
|
|
|
#include <gint/exc.h>
|
|
|
|
#include <gint/keyboard.h>
|
|
|
|
#include <gint/defs/attributes.h>
|
|
|
|
extern image_t img_error;
|
|
|
|
GNORETURN void system_error(uint32_t code)
|
|
|
|
{
|
|
|
|
timer_stop(0);
|
|
|
|
dimage(0,0,&img_error);
|
|
|
|
dupdate();
|
|
|
|
while(1) getkey();
|
|
|
|
}
|
|
|
|
|
2019-11-16 11:44:09 +01:00
|
|
|
int callback(volatile void *arg)
|
|
|
|
{
|
|
|
|
volatile int *has_ticked = arg;
|
|
|
|
*has_ticked = 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
2019-11-20 18:31:20 +01:00
|
|
|
gint_panic_set(system_error);
|
2019-11-16 11:44:09 +01:00
|
|
|
volatile int has_ticked = 1;
|
|
|
|
|
2019-11-21 19:56:37 +01:00
|
|
|
timer_setup(0, timer_delay(0, 20000), timer_Po_16, callback, &has_ticked);
|
2019-11-16 11:44:09 +01:00
|
|
|
timer_start(0);
|
|
|
|
|
2019-11-20 15:33:34 +01:00
|
|
|
while(global_quit==0)
|
2019-11-16 11:44:09 +01:00
|
|
|
{
|
|
|
|
has_ticked=0;
|
|
|
|
|
|
|
|
dclear(C_WHITE);
|
|
|
|
|
2019-11-21 19:30:23 +01:00
|
|
|
world_draw(mario.p.x,mario.p.y);
|
2019-11-16 11:44:09 +01:00
|
|
|
//ennemies_draw();
|
2019-11-20 15:33:34 +01:00
|
|
|
mario_draw();
|
2019-11-16 11:44:09 +01:00
|
|
|
//ingame_draw();
|
|
|
|
|
|
|
|
dupdate();
|
|
|
|
|
2019-11-16 12:02:30 +01:00
|
|
|
//keyboard_reload();
|
2019-11-20 15:33:34 +01:00
|
|
|
mario_move();
|
2019-11-16 11:44:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
timer_stop(0);
|
|
|
|
}
|