diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2005-03-02 23:49:38 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2005-03-02 23:49:38 +0000 |
| commit | 384de102469fee4e0792df8fe38586d3206774ed (patch) | |
| tree | ee5342103e17738acfb8421328ea7c57433f55e6 /apps/plugins/rockboy/main.c | |
| parent | 48dad47df98bdec632e8930b6a97359dc2c428f5 (diff) | |
| download | rockbox-384de102469fee4e0792df8fe38586d3206774ed.zip rockbox-384de102469fee4e0792df8fe38586d3206774ed.tar.gz rockbox-384de102469fee4e0792df8fe38586d3206774ed.tar.bz2 rockbox-384de102469fee4e0792df8fe38586d3206774ed.tar.xz | |
Rockboy - gameboy emulation for rockbox, based on gnuboy. Still a bit early, but already playable on iRiver H1xx and the simulators. The archos recorder version is currently rather slow...
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6104 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/rockboy/main.c')
| -rw-r--r-- | apps/plugins/rockboy/main.c | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/apps/plugins/rockboy/main.c b/apps/plugins/rockboy/main.c new file mode 100644 index 0000000..ea5d628 --- /dev/null +++ b/apps/plugins/rockboy/main.c @@ -0,0 +1,83 @@ +#include <stdio.h> +#include <string.h> + +#include "rockmacros.h" +#include "input.h" +#include "rc.h" +#include "exports.h" +#include "emu.h" +#include "loader.h" +#include "hw.h" + +//#include "Version" + + +static char *defaultconfig[] = +{ + "bind up +up", + "bind down +down", + "bind left +left", + "bind right +right", + "bind joy0 +b", + "bind joy1 +a", + "bind joy2 +select", + "bind joy3 +start", + "bind ins savestate", + "bind del loadstate", + NULL +}; + + +void doevents() +{ + 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); + } +} + + + +int gnuboy_main(char *rom) +{ + int i; + + // Avoid initializing video if we don't have to + // If we have special perms, drop them ASAP! + rb->splash(HZ*1, true, "Init exports"); + init_exports(); + + rb->splash(HZ*1, true, "Loading default config"); + for (i = 0; defaultconfig[i]; i++) + rc_command(defaultconfig[i]); + +// sprintf(cmd, "source %s", rom); +// s = strchr(cmd, '.'); +// if (s) *s = 0; +// strcat(cmd, ".rc"); +// rc_command(cmd); + + // FIXME - make interface modules responsible for atexit() + rb->splash(HZ*1, true, "Init video"); + vid_init(); + rb->splash(HZ*1, true, "Init sound (nosound)"); + pcm_init(); + rb->splash(HZ*1, true, "Loading rom"); + loader_init(rom); + if(shut) + return PLUGIN_ERROR; + rb->splash(HZ*1, true, "Emu reset"); + emu_reset(); + rb->splash(HZ*1, true, "Emu run"); + emu_run(); + + // never reached + return PLUGIN_OK; +} |