X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=loader%2Fhost.c;fp=loader%2Fhost.c;h=96639640c3f2d8a3870c39d4c2f3b0e6fbb3b5ba;hb=ad439e71e25f709a1e2b6f72f36119432593f34a;hp=0000000000000000000000000000000000000000;hpb=eb058b482d306017c5efa176351c36180c6c8b85;p=ginge.git diff --git a/loader/host.c b/loader/host.c new file mode 100644 index 0000000..9663964 --- /dev/null +++ b/loader/host.c @@ -0,0 +1,51 @@ +// vim:shiftwidth=2:expandtab + +#define _GNU_SOURCE // for plat.c +#include +#include + +#include "header.h" +#include "realfuncs.h" + +#define IN_EVDEV +#include "../common/common/input.c" +#include "../common/linux/plat.c" +#include "../common/linux/in_evdev.c" + +#ifdef PND +#include "host_pnd.c" +#elif defined(WIZ) +#include "host_wiz.c" +#endif + +// for plat.c +char **g_argv; + +int host_init(void) +{ + in_init(); + in_probe(); + + return 0; +} + +int host_read_btns(void) +{ + int actions[IN_BINDTYPE_COUNT] = { 0, }; + + in_update(actions); + host_actions(actions); + + return actions[IN_BINDTYPE_PLAYER12]; +} + +void host_forced_exit(void) +{ + // exit() might not be enough because loader and app data is out of sync, + // and other threads (which are really processes on this old glibc used) + // might not exit properly. + system("killall ginge_sloader"); + usleep(300000); + system("killall -9 ginge_sloader"); + exit(1); +}