X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=frontend%2Fplugin.c;h=2492f4ae237eac2dfe3150a3e4b1f83f8e56898e;hp=c11a1f05a793589d1cda9273ca57bf7a7a53673f;hb=76d1d09c1224af8d663ce63dc5b32425bd62cb29;hpb=c5061935e3f7b91d889d7546b06c4515c3004cb2 diff --git a/frontend/plugin.c b/frontend/plugin.c index c11a1f05..2492f4ae 100644 --- a/frontend/plugin.c +++ b/frontend/plugin.c @@ -38,20 +38,26 @@ extern long SPUtest(void); extern void SPUabout(void); extern long SPUfreeze(unsigned int, void *); extern void SPUasync(unsigned int); -extern void SPUplayCDDAchannel(short *, int); +extern int SPUplayCDDAchannel(short *, int); /* PAD */ static long PADreadPort1(PadDataS *pad) { - pad->controllerType = PSE_PAD_TYPE_STANDARD; - pad->buttonStatus = ~keystate; + pad->controllerType = in_type1; + pad->buttonStatus = ~in_keystate; + if (in_type1 == PSE_PAD_TYPE_ANALOGPAD) { + pad->leftJoyX = in_a1[0]; + pad->leftJoyY = in_a1[1]; + pad->rightJoyX = in_a2[0]; + pad->rightJoyY = in_a2[1]; + } return 0; } static long PADreadPort2(PadDataS *pad) { - pad->controllerType = PSE_PAD_TYPE_STANDARD; - pad->buttonStatus = ~keystate >> 16; + pad->controllerType = in_type2; + pad->buttonStatus = ~in_keystate >> 16; return 0; } @@ -69,6 +75,8 @@ extern void GPUreadDataMem(uint32_t *, int); extern long GPUdmaChain(uint32_t *,uint32_t); extern void GPUupdateLace(void); extern long GPUfreeze(uint32_t, void *); +extern void GPUvBlank(int, uint32_t *, uint32_t *); +extern void GPUrearmedCallbacks(const struct rearmed_cbs *cbs); #define DUMMY(id, name) \ @@ -160,6 +168,8 @@ static const struct { DIRECT_GPU(GPUwriteDataMem), DIRECT_GPU(GPUdmaChain), DIRECT_GPU(GPUfreeze), + DIRECT_GPU(GPUvBlank), + DIRECT_GPU(GPUrearmedCallbacks), DUMMY_GPU(GPUdisplayText), /* @@ -172,7 +182,6 @@ static const struct { DIRECT_GPU(GPUshowScreenPic), */ // DIRECT_GPU(GPUclearDynarec), -// DIRECT_GPU(GPUvBlank), }; void *plugin_link(enum builtint_plugins_e id, const char *sym) @@ -253,7 +262,7 @@ pc_hook_func (SPU_writeDMAMem, (unsigned short *a0, int a1), (a0, a pc_hook_func (SPU_readDMAMem, (unsigned short *a0, int a1), (a0, a1), PCNT_SPU) pc_hook_func (SPU_playADPCMchannel, (void *a0), (a0), PCNT_SPU) pc_hook_func (SPU_async, (unsigned int a0), (a0), PCNT_SPU) -pc_hook_func (SPU_playCDDAchannel, (short *a0, int a1), (a0, a1), PCNT_SPU) +pc_hook_func_ret(int, SPU_playCDDAchannel, (short *a0, int a1), (a0, a1), PCNT_SPU) #define hook_it(name) { \ o_##name = name; \ @@ -262,8 +271,7 @@ pc_hook_func (SPU_playCDDAchannel, (short *a0, int a1), (a0, a1), P void pcnt_hook_plugins(void) { - /* test it first */ - pcnt_get(); + pcnt_init(); hook_it(GPU_writeStatus); hook_it(GPU_writeData);