X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fplugin.c;h=83eb14036342643e65f95f3d6e6aea6efec629bb;hp=bcf3885aaedbea6bc3c637b2c0bae31dbb2b745d;hb=bbd837c6d8a14e76c19028c84ef62a3b8cf0c1f0;hpb=fa9cfe0a7ff390f15bfdc6add7e57841173d1954 diff --git a/frontend/plugin.c b/frontend/plugin.c index bcf3885a..83eb1403 100644 --- a/frontend/plugin.c +++ b/frontend/plugin.c @@ -9,7 +9,10 @@ #include #include +#include "plugin_lib.h" #include "plugin.h" +#include "../libpcsxcore/psemu_plugin_defs.h" +#include "../plugins/cdrcimg/cdrcimg.h" static int dummy_func() { return 0; @@ -42,18 +45,18 @@ extern void SPUasync(unsigned int); extern void SPUplayCDDAchannel(short *, int); /* PAD */ -static uint8_t CurByte; - -static unsigned char PADstartPoll(int pad) { - CurByte = 0; - return 0xFF; +static long PADreadPort1(PadDataS *pad) +{ + pad->controllerType = PSE_PAD_TYPE_STANDARD; + pad->buttonStatus = ~keystate; + return 0; } -static unsigned char PADpoll(unsigned char value) { - static uint8_t buf[] = {0x41, 0x5A, 0xFF, 0xFF, 0x80, 0x80, 0x80, 0x80}; - if (CurByte >= 4) - return 0; - return buf[CurByte++]; +static long PADreadPort2(PadDataS *pad) +{ + pad->controllerType = PSE_PAD_TYPE_STANDARD; + pad->buttonStatus = ~keystate >> 16; + return 0; } /* GPU */ @@ -141,20 +144,22 @@ static const struct { DIRECT_SPU(SPUasync), DIRECT_SPU(SPUplayCDDAchannel), /* PAD */ - DUMMY_PAD(PADconfigure), - DUMMY_PAD(PADabout), DUMMY_PAD(PADinit), DUMMY_PAD(PADshutdown), - DUMMY_PAD(PADtest), DUMMY_PAD(PADopen), DUMMY_PAD(PADclose), + DUMMY_PAD(PADsetSensitive), + DIRECT_PAD(PADreadPort1), + DIRECT_PAD(PADreadPort2), +/* DUMMY_PAD(PADquery), - DUMMY_PAD(PADreadPort1), - DUMMY_PAD(PADreadPort2), + DUMMY_PAD(PADconfigure), + DUMMY_PAD(PADtest), + DUMMY_PAD(PADabout), DUMMY_PAD(PADkeypressed), - DUMMY_PAD(PADsetSensitive), - DIRECT_PAD(PADstartPoll), - DIRECT_PAD(PADpoll), + DUMMY_PAD(PADstartPoll), + DUMMY_PAD(PADpoll), +*/ /* GPU */ DIRECT_GPU(GPUupdateLace), DIRECT_GPU(GPUinit), @@ -185,6 +190,9 @@ void *plugin_link(enum builtint_plugins_e id, const char *sym) { int i; + if (id == PLUGIN_CDRCIMG) + return cdrcimg_get_sym(sym); + for (i = 0; i < ARRAY_SIZE(plugin_funcs); i++) { if (id != plugin_funcs[i].id) continue; @@ -195,7 +203,7 @@ void *plugin_link(enum builtint_plugins_e id, const char *sym) return plugin_funcs[i].func; } - fprintf(stderr, "plugin_link: missing symbol %d %s\n", id, sym); + //fprintf(stderr, "plugin_link: missing symbol %d %s\n", id, sym); return NULL; }