Skip to content

Commit

Permalink
3rdParty: experimental changes to mupen64plus-core
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosalie241 committed Mar 2, 2025
1 parent 750ac8f commit 2b32c03
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 23 deletions.
2 changes: 0 additions & 2 deletions Source/3rdParty/mupen64plus-core/src/api/m64p_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ typedef void (*ptr_ViWidthChanged)(void);
typedef void (*ptr_ReadScreen2)(void *dest, int *width, int *height, int front);
typedef void (*ptr_SetRenderingCallback)(void (*callback)(int));
typedef void (*ptr_ResizeVideoOutput)(int width, int height);
typedef void (*ptr_FullSync)(void);
#if defined(M64P_PLUGIN_PROTOTYPES)
EXPORT void CALL ChangeWindow(void);
EXPORT int CALL InitiateGFX(GFX_INFO Gfx_Info);
Expand All @@ -213,7 +212,6 @@ EXPORT void CALL ViWidthChanged(void);
EXPORT void CALL ReadScreen2(void *dest, int *width, int *height, int front);
EXPORT void CALL SetRenderingCallback(void (*callback)(int));
EXPORT void CALL ResizeVideoOutput(int width, int height);
EXPORT void CALL FullSync(void);
#endif

/* frame buffer plugin spec extension */
Expand Down
11 changes: 2 additions & 9 deletions Source/3rdParty/mupen64plus-core/src/device/rcp/rdp/rdp_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ static void update_dpc_status(struct rdp_core* dp, uint32_t w)

if (dp->do_on_unfreeze & DELAY_DP_INT)
{
gfx.fullSync();
dp->mi->r4300->cp0.interrupt_unsafe_state &= ~INTR_UNSAFE_RDP;

signal_rcp_interrupt(dp->mi, MI_INTR_DP);
Expand Down Expand Up @@ -132,8 +131,6 @@ void write_dpc_regs(void* opaque, uint32_t address, uint32_t value, uint32_t mas
return;
}

//masked_write(&dp->dpc_regs[reg], value, mask);

switch(reg)
{
case DPC_START_REG:
Expand All @@ -144,14 +141,15 @@ void write_dpc_regs(void* opaque, uint32_t address, uint32_t value, uint32_t mas
dp->dpc_regs[DPC_STATUS_REG] |= DPC_STATUS_START_VALID;
break;
case DPC_END_REG:
//unprotect_framebuffers(&dp->fb);
masked_write(&dp->dpc_regs[reg], value & UINT32_C(0xFFFFF8), mask);
if (dp->dpc_regs[DPC_STATUS_REG] & DPC_STATUS_START_VALID)
{
dp->dpc_regs[DPC_CURRENT_REG] = dp->dpc_regs[DPC_START_REG];
dp->dpc_regs[DPC_STATUS_REG] &= ~DPC_STATUS_START_VALID;
}
unprotect_framebuffers(&dp->fb);
gfx.processRDPList();
protect_framebuffers(&dp->fb);
if (dp->mi->regs[MI_INTR_REG] & MI_INTR_DP)
{
dp->mi->regs[MI_INTR_REG] &= ~MI_INTR_DP;
Expand All @@ -163,9 +161,6 @@ void write_dpc_regs(void* opaque, uint32_t address, uint32_t value, uint32_t mas
}
}
break;
//protect_framebuffers(&dp->fb);
//signal_rcp_interrupt(dp->mi, MI_INTR_DP);
break;
}
}

Expand Down Expand Up @@ -196,8 +191,6 @@ void rdp_interrupt_event(void* opaque)
{
struct rdp_core* dp = (struct rdp_core*)opaque;

gfx.fullSync();

dp->mi->r4300->cp0.interrupt_unsafe_state &= ~INTR_UNSAFE_RDP;
raise_rcp_interrupt(dp->mi, MI_INTR_DP);

Expand Down
3 changes: 0 additions & 3 deletions Source/3rdParty/mupen64plus-core/src/plugin/dummy_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,3 @@ void dummyvideo_ResizeVideoOutput(int width, int height)
{
}

void dummyvideo_FullSync(void)
{
}
7 changes: 0 additions & 7 deletions Source/3rdParty/mupen64plus-core/src/plugin/plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ static const gfx_plugin_functions dummy_gfx = {
dummyvideo_ReadScreen2,
dummyvideo_SetRenderingCallback,
dummyvideo_ResizeVideoOutput,
dummyvideo_FullSync,
dummyvideo_FBRead,
dummyvideo_FBWrite,
dummyvideo_FBGetFrameBufferInfo
Expand Down Expand Up @@ -199,7 +198,6 @@ static m64p_error plugin_connect_gfx(m64p_dynlib_handle plugin_handle)

/* set function pointers for optional functions */
gfx.resizeVideoOutput = (ptr_ResizeVideoOutput)osal_dynlib_getproc(plugin_handle, "ResizeVideoOutput");
gfx.fullSync = (ptr_FullSync)osal_dynlib_getproc(plugin_handle, "FullSync");

/* check the version info */
(*gfx.getVersion)(&PluginType, &PluginVersion, &APIVersion, NULL, NULL);
Expand All @@ -224,11 +222,6 @@ static m64p_error plugin_connect_gfx(m64p_dynlib_handle plugin_handle)
DebugMessage(M64MSG_WARNING, "Fallback for Video plugin API (%02i.%02i.%02i) < 2.2.0. Resizable video will not work", VERSION_PRINTF_SPLIT(APIVersion));
gfx.resizeVideoOutput = dummyvideo_ResizeVideoOutput;
}
if (APIVersion < 0x20201 || gfx.fullSync == NULL)
{
DebugMessage(M64MSG_WARNING, "Fallback for Video plugin API (%02i.%02i.%02i) < 2.2.1. No FullSync function", VERSION_PRINTF_SPLIT(APIVersion));
gfx.fullSync = dummyvideo_FullSync;
}

l_GfxAttached = 1;
}
Expand Down
3 changes: 1 addition & 2 deletions Source/3rdParty/mupen64plus-core/src/plugin/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern CONTROL Controls[NUM_CONTROLLER];

/*** Version requirement information ***/
#define RSP_API_VERSION 0x20000
#define GFX_API_VERSION 0x20201
#define GFX_API_VERSION 0x20200
#define AUDIO_API_VERSION 0x20000
#define INPUT_API_VERSION 0x20101

Expand All @@ -58,7 +58,6 @@ typedef struct _gfx_plugin_functions
ptr_ReadScreen2 readScreen;
ptr_SetRenderingCallback setRenderingCallback;
ptr_ResizeVideoOutput resizeVideoOutput;
ptr_FullSync fullSync;

/* frame buffer plugin spec extension */
ptr_FBRead fBRead;
Expand Down

0 comments on commit 2b32c03

Please sign in to comment.