X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fplugin.c;h=c83da729eaaec2de2675d4be2108c3e74665e060;hp=d6aca8a53c7c1b1f52bf24649db6b7056a2416cb;hb=69af03a2c2fccc06cb836f42a10b490a48f29c15;hpb=14dffdb7a0457fc647103deafa5f1cac12e888fb;ds=sidebyside diff --git a/frontend/plugin.c b/frontend/plugin.c index d6aca8a5..c83da729 100644 --- a/frontend/plugin.c +++ b/frontend/plugin.c @@ -9,6 +9,7 @@ #include #include +#include "plugin_lib.h" #include "plugin.h" static int dummy_func() { @@ -42,18 +43,22 @@ extern void SPUasync(unsigned int); extern void SPUplayCDDAchannel(short *, int); /* PAD */ -static uint8_t CurByte; +static uint8_t pad_buf[] = { 0x41, 0x5A, 0xFF, 0xFF }; +static uint8_t pad_byte; static unsigned char PADstartPoll(int pad) { - CurByte = 0; + pad_byte = 0; + pad_buf[2] = keystate; + pad_buf[3] = keystate >> 8; + return 0xFF; } static unsigned char PADpoll(unsigned char value) { - static uint8_t buf[] = {0x41, 0x5A, 0xFF, 0xFF, 0x80, 0x80, 0x80, 0x80}; - if (CurByte >= 4) + if (pad_byte >= 4) return 0; - return buf[CurByte++]; + + return pad_buf[pad_byte++]; } /* GPU */ @@ -199,6 +204,8 @@ void *plugin_link(enum builtint_plugins_e id, const char *sym) return NULL; } +#ifdef PCNT + /* basic profile stuff */ #include "pcnt.h" @@ -253,6 +260,9 @@ pc_hook_func (SPU_playCDDAchannel, (short *a0, int a1), (a0, a1), P void pcnt_hook_plugins(void) { + /* test it first */ + pcnt_get(); + hook_it(GPU_writeStatus); hook_it(GPU_writeData); hook_it(GPU_writeDataMem); @@ -272,3 +282,4 @@ void pcnt_hook_plugins(void) hook_it(SPU_playCDDAchannel); } +#endif