2005-03-02 23:49:38 +00:00
|
|
|
#include "rockmacros.h"
|
|
|
|
#include "input.h"
|
|
|
|
#include "emu.h"
|
|
|
|
#include "loader.h"
|
|
|
|
#include "hw.h"
|
|
|
|
|
|
|
|
void doevents()
|
|
|
|
{
|
2007-02-06 21:41:08 +00:00
|
|
|
event_t ev;
|
|
|
|
int st;
|
|
|
|
|
|
|
|
ev_poll();
|
|
|
|
while (ev_getevent(&ev))
|
|
|
|
{
|
|
|
|
if (ev.type != EV_PRESS && ev.type != EV_RELEASE)
|
|
|
|
continue;
|
|
|
|
st = (ev.type != EV_RELEASE);
|
|
|
|
pad_set(ev.code, st);
|
|
|
|
}
|
2005-03-02 23:49:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int gnuboy_main(char *rom)
|
|
|
|
{
|
2007-02-06 21:41:08 +00:00
|
|
|
rb->lcd_puts(0,0,"Init video");
|
|
|
|
vid_init();
|
|
|
|
rb->lcd_puts(0,1,"Init sound");
|
|
|
|
pcm_init();
|
|
|
|
rb->lcd_puts(0,2,"Loading rom");
|
|
|
|
loader_init(rom);
|
|
|
|
if(shut)
|
|
|
|
return PLUGIN_ERROR;
|
|
|
|
rb->lcd_puts(0,3,"Emu reset");
|
|
|
|
emu_reset();
|
|
|
|
rb->lcd_puts(0,4,"Emu run");
|
2005-11-16 22:59:28 +00:00
|
|
|
rb->lcd_clear_display();
|
|
|
|
rb->lcd_update();
|
2007-02-06 21:41:08 +00:00
|
|
|
emu_run();
|
2005-03-02 23:49:38 +00:00
|
|
|
|
2007-02-06 21:41:08 +00:00
|
|
|
/* never reached */
|
|
|
|
return PLUGIN_OK;
|
2005-03-02 23:49:38 +00:00
|
|
|
}
|