X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fplugin.c;h=6c83a4477833cfc312dccc2455c60f0986f4a4e7;hp=e2c1ca3900933b36ca2678b080eb6ad08294202b;hb=201c21e2ad6be25a4b843d1434eabb432ce72884;hpb=47bf65ab6163fb70eb2ad309c9487229832bcaed diff --git a/frontend/plugin.c b/frontend/plugin.c index e2c1ca39..6c83a447 100644 --- a/frontend/plugin.c +++ b/frontend/plugin.c @@ -11,17 +11,14 @@ #include "plugin_lib.h" #include "plugin.h" +#include "../libpcsxcore/psemu_plugin_defs.h" +#include "../libpcsxcore/system.h" #include "../plugins/cdrcimg/cdrcimg.h" static int dummy_func() { return 0; } -static long CDRreadTrack(unsigned char *time) { - fprintf(stderr, "CDRreadTrack\n"); - return -1; -} - /* SPU */ extern long SPUopen(void); extern long SPUinit(void); @@ -44,22 +41,18 @@ extern void SPUasync(unsigned int); extern void SPUplayCDDAchannel(short *, int); /* PAD */ -static uint8_t pad_buf[] = { 0x41, 0x5A, 0xFF, 0xFF }; -static uint8_t pad_byte; - -static unsigned char PADstartPoll(int pad) { - pad_byte = 0; - pad_buf[2] = ~keystate; - pad_buf[3] = ~keystate >> 8; - - 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) { - if (pad_byte >= 4) - return 0; - - return pad_buf[pad_byte++]; +static long PADreadPort2(PadDataS *pad) +{ + pad->controllerType = PSE_PAD_TYPE_STANDARD; + pad->buttonStatus = ~keystate >> 16; + return 0; } /* GPU */ @@ -125,7 +118,6 @@ static const struct { DUMMY_CDR(CDRsetfilename), DUMMY_CDR(CDRreadCDDA), DUMMY_CDR(CDRgetTE), - DIRECT(PLUGIN_CDR, CDRreadTrack), /* SPU */ DIRECT_SPU(SPUconfigure), DIRECT_SPU(SPUabout), @@ -147,20 +139,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), @@ -204,10 +198,20 @@ 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; } +void plugin_call_rearmed_cbs(void) +{ + extern void *hGPUDriver; + void (*rearmed_set_cbs)(const struct rearmed_cbs *cbs); + + rearmed_set_cbs = SysLoadSym(hGPUDriver, "GPUrearmedCallbacks"); + if (rearmed_set_cbs != NULL) + rearmed_set_cbs(&pl_rearmed_cbs); +} + #ifdef PCNT /* basic profile stuff */