X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=frontend%2Fplugin.c;h=5f9c5ffb064042c73a53ba7fd78b8d063d2167d4;hb=d5aeda23720ba9374312f8d387f299024fedb7e6;hp=e741a1ad1826708d1f8ed633439628c9c910a69a;hpb=82ed88ebe25a0312aab83623b5a983bd96f3d830;p=pcsx_rearmed.git diff --git a/frontend/plugin.c b/frontend/plugin.c index e741a1ad..5f9c5ffb 100644 --- a/frontend/plugin.c +++ b/frontend/plugin.c @@ -11,37 +11,42 @@ #include "plugin_lib.h" #include "plugin.h" -#include "../libpcsxcore/psemu_plugin_defs.h" +#include "psemu_plugin_defs.h" #include "../libpcsxcore/system.h" #include "../plugins/cdrcimg/cdrcimg.h" -static int dummy_func() { +// this can't be __stdcall like it was in PSEmu API as too many functions are mixed up +#undef CALLBACK +#define CALLBACK + +static long CALLBACK dummy_func() { return 0; } /* SPU */ -extern long SPUopen(void); -extern long SPUinit(void); -extern long SPUshutdown(void); -extern long SPUclose(void); -extern void SPUplaySample(unsigned char); -extern void SPUwriteRegister(unsigned long, unsigned short); -extern unsigned short SPUreadRegister(unsigned long); -extern void SPUwriteDMA(unsigned short); -extern unsigned short SPUreadDMA(void); -extern void SPUwriteDMAMem(unsigned short *, int); -extern void SPUreadDMAMem(unsigned short *, int); -extern void SPUplayADPCMchannel(void *); -extern void SPUregisterCallback(void (*callback)(void)); -extern long SPUconfigure(void); -extern long SPUtest(void); -extern void SPUabout(void); -extern long SPUfreeze(unsigned int, void *); -extern void SPUasync(unsigned int); -extern int SPUplayCDDAchannel(short *, int); +extern long CALLBACK SPUopen(void); +extern long CALLBACK SPUinit(void); +extern long CALLBACK SPUshutdown(void); +extern long CALLBACK SPUclose(void); +extern void CALLBACK SPUplaySample(unsigned char); +extern void CALLBACK SPUwriteRegister(unsigned long, unsigned short, unsigned int); +extern unsigned short CALLBACK SPUreadRegister(unsigned long); +extern void CALLBACK SPUwriteDMA(unsigned short); +extern unsigned short CALLBACK SPUreadDMA(void); +extern void CALLBACK SPUwriteDMAMem(unsigned short *, int, unsigned int); +extern void CALLBACK SPUreadDMAMem(unsigned short *, int, unsigned int); +extern void CALLBACK SPUplayADPCMchannel(void *, unsigned int, int); +extern void CALLBACK SPUregisterCallback(void (*cb)(void)); +extern void CALLBACK SPUregisterScheduleCb(void (*cb)(unsigned int)); +extern long CALLBACK SPUconfigure(void); +extern long CALLBACK SPUtest(void); +extern void CALLBACK SPUabout(void); +extern long CALLBACK SPUfreeze(unsigned int, void *, unsigned int); +extern void CALLBACK SPUasync(unsigned int, unsigned int); +extern int CALLBACK SPUplayCDDAchannel(short *, int, unsigned int, int); /* PAD */ -static long PADreadPort1(PadDataS *pad) +static long CALLBACK PADreadPort1(PadDataS *pad) { pad->controllerType = in_type1; pad->buttonStatus = ~in_keystate; @@ -54,7 +59,7 @@ static long PADreadPort1(PadDataS *pad) return 0; } -static long PADreadPort2(PadDataS *pad) +static long CALLBACK PADreadPort2(PadDataS *pad) { pad->controllerType = in_type2; pad->buttonStatus = ~in_keystate >> 16; @@ -75,7 +80,7 @@ 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 GPUvBlank(int, int); extern void GPUrearmedCallbacks(const struct rearmed_cbs *cbs); @@ -135,6 +140,7 @@ static const struct { DIRECT_SPU(SPUplayADPCMchannel), DIRECT_SPU(SPUfreeze), DIRECT_SPU(SPUregisterCallback), + DIRECT_SPU(SPUregisterScheduleCb), DIRECT_SPU(SPUasync), DIRECT_SPU(SPUplayCDDAchannel), /* PAD */ @@ -254,15 +260,15 @@ pc_hook_func (GPU_readDataMem, (uint32_t *a0, int a1), (a0, a1), PC pc_hook_func_ret(long, GPU_dmaChain, (uint32_t *a0, int32_t a1), (a0, a1), PCNT_GPU) pc_hook_func (GPU_updateLace, (void), (), PCNT_GPU) -pc_hook_func (SPU_writeRegister, (unsigned long a0, unsigned short a1), (a0, a1), PCNT_SPU) +pc_hook_func (SPU_writeRegister, (unsigned long a0, unsigned short a1, uint32_t a2), (a0, a1, a2), PCNT_SPU) pc_hook_func_ret(unsigned short,SPU_readRegister, (unsigned long a0), (a0), PCNT_SPU) pc_hook_func (SPU_writeDMA, (unsigned short a0), (a0), PCNT_SPU) pc_hook_func_ret(unsigned short,SPU_readDMA, (void), (), PCNT_SPU) -pc_hook_func (SPU_writeDMAMem, (unsigned short *a0, int a1), (a0, a1), PCNT_SPU) -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_ret(int, SPU_playCDDAchannel, (short *a0, int a1), (a0, a1), PCNT_SPU) +pc_hook_func (SPU_writeDMAMem, (unsigned short *a0, int a1, uint32_t a2), (a0, a1, a2), PCNT_SPU) +pc_hook_func (SPU_readDMAMem, (unsigned short *a0, int a1, uint32_t a2), (a0, a1, a2), PCNT_SPU) +pc_hook_func (SPU_playADPCMchannel, (void *a0, unsigned int a1, int a2), (a0, a1, a2), PCNT_SPU) +pc_hook_func (SPU_async, (uint32_t a0, uint32_t a1), (a0, a1), PCNT_SPU) +pc_hook_func_ret(int, SPU_playCDDAchannel, (short *a0, int a1, unsigned int a2, int a3), (a0, a1, a2, a3), PCNT_SPU) #define hook_it(name) { \ o_##name = name; \