diff --git a/Source/3rdParty/mupen64plus-core/.gitrepo b/Source/3rdParty/mupen64plus-core/.gitrepo index 90af86716..162fc90d2 100644 --- a/Source/3rdParty/mupen64plus-core/.gitrepo +++ b/Source/3rdParty/mupen64plus-core/.gitrepo @@ -4,9 +4,9 @@ ; git-subrepo command. See https://github.com/ingydotnet/git-subrepo#readme ; [subrepo] - remote = git@github.com:/Rosalie241/mupen64plus-core.git - branch = RMG - commit = f97ae4ea33827657382ead773fa1a4550c96700e - parent = dc8d1a4b05de6a570d41781f494733aba665aaae + remote = git@github.com:mupen64plus/mupen64plus-core.git + branch = master + commit = 7d02ab97bd13be9b1b58ee11a1d3df6919d89f17 + parent = 422f7d08015d8964d39b878ad2a4b6807bb64f9a method = merge cmdver = 0.4.6 diff --git a/Source/3rdParty/mupen64plus-core/README b/Source/3rdParty/mupen64plus-core/README index 1045eef49..c346bff9e 100644 --- a/Source/3rdParty/mupen64plus-core/README +++ b/Source/3rdParty/mupen64plus-core/README @@ -70,8 +70,12 @@ Type 'make' by itself to view all available build options: WARNFLAGS=flag == compiler warning levels (default: -Wall) PIC=(1|0) == Force enable/disable of position independent code OSD=(1|0) == Enable/disable build of OpenGL On-screen display + NETPLAY=1 == Enable netplay functionality, requires SDL2_net NEW_DYNAREC=1 == Replace dynamic recompiler with Ari64's experimental dynarec + KEYBINDINGS=0 == Disables the default keybindings + ACCURATE_FPU=1 == Enables accurate FPU behavior (i.e correct cause bits) OPENCV=1 == Enable OpenCV support + VULKAN=0 == Disable vulkan support for the default video extension implementation POSTFIX=name == String added to the name of the the build (default: '') Install Options: PREFIX=path == install/uninstall prefix (default: /usr/local/) diff --git a/Source/3rdParty/mupen64plus-core/README.md b/Source/3rdParty/mupen64plus-core/README.md index b74e3aa24..c7c5fc64b 100644 --- a/Source/3rdParty/mupen64plus-core/README.md +++ b/Source/3rdParty/mupen64plus-core/README.md @@ -1,8 +1,8 @@ # Mupen64Plus-Core README -[![TravisCI Build Status](https://travis-ci.org/mupen64plus/mupen64plus-core.svg?branch=master)](https://travis-ci.org/mupen64plus/mupen64plus-core) +[![GitHub Actions Build Status](https://github.com/mupen64plus/mupen64plus-core/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/mupen64plus/mupen64plus-core/actions) [![Coverity Scan Build Status](https://scan.coverity.com/projects/4381/badge.svg)](https://scan.coverity.com/projects/mupen64plus-core) -[![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/a1ua5t87n2w8a7fc?svg=true)](https://ci.appveyor.com/project/Narann/mupen64plus-core) +[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/a1ua5t87n2w8a7fc?svg=true)](https://ci.appveyor.com/project/Narann/mupen64plus-core) More documentation can be found on the [Mupen64Plus website](https://mupen64plus.org/docs/) and you can find a more complete README file on the [wiki](https://mupen64plus.org/wiki/index.php/README). @@ -76,8 +76,12 @@ Type `make` by itself to view all available build options: WARNFLAGS=flag == compiler warning levels (default: -Wall) PIC=(1|0) == Force enable/disable of position independent code OSD=(1|0) == Enable/disable build of OpenGL On-screen display + NETPLAY=1 == Enable netplay functionality, requires SDL2_net NEW_DYNAREC=1 == Replace dynamic recompiler with Ari64's experimental dynarec + KEYBINDINGS=0 == Disables the default keybindings + ACCURATE_FPU=1 == Enables accurate FPU behavior (i.e correct cause bits) OPENCV=1 == Enable OpenCV support + VULKAN=0 == Disable vulkan support for the default video extension implementation POSTFIX=name == String added to the name of the the build (default: '') Install Options: PREFIX=path == install/uninstall prefix (default: /usr/local/) diff --git a/Source/3rdParty/mupen64plus-core/data/mupen64plus.ini b/Source/3rdParty/mupen64plus-core/data/mupen64plus.ini index df89d197c..d2e6be992 100644 --- a/Source/3rdParty/mupen64plus-core/data/mupen64plus.ini +++ b/Source/3rdParty/mupen64plus-core/data/mupen64plus.ini @@ -15036,6 +15036,11 @@ Players=1 Status=4 SaveType=Eeprom 4KB +[6614298A943234FD30885BD0B1383CBB] +GoodName=Super Mario 64 (J) [T+Kor1.0_Minio] +CRC=B36CF0BE A35F5C7B +RefMD5=85D61F5525AF708C9F1E84DCE6DC10E9 + [DBF7F4D881E1DF604C41367B04233E74] GoodName=Super Mario 64 (J) [h1C] CRC=4EAA3D0E 74757C24 @@ -15151,6 +15156,11 @@ Status=4 SaveType=Eeprom 4KB Rumble=Yes +[A00D0D095592113A279A27ACD785CE50] +GoodName=Super Mario 64 - Shindou Edition (J) [T+Kor1.0_Minio] +CRC=C1373DC8 ED88D197 +RefMD5=2D727C3278AA232D94F2FB45AEC4D303 + [23033085561CD331CC81F0026FCB2CE2] GoodName=Super Mario 64 - Shindou Edition (J) [b1] CRC=D6FBA4A8 6326AA2C @@ -17290,6 +17300,11 @@ SaveType=Eeprom 4KB Mempak=Yes Rumble=Yes +[ECC1692D12FDCB0C3F605E44DD54CE8C] +GoodName=Wave Race 64 - Shindou Edition (J) (V1.2) [T+Eng1.0_Zoinkity] +CRC=57AF893E 884A377C +RefMD5=FF67DF97476C210D158779AE6142F239 + [AFBC694A3BA5AE83D3CEEF906BF01839] GoodName=Wave Race 64 - Shindou Edition (J) (V1.2) [b1] CRC=535DF3E2 609789F1 diff --git a/Source/3rdParty/mupen64plus-core/src/backends/plugins_compat/input_plugin_compat.c b/Source/3rdParty/mupen64plus-core/src/backends/plugins_compat/input_plugin_compat.c index 2e8691334..ceb1128a4 100644 --- a/Source/3rdParty/mupen64plus-core/src/backends/plugins_compat/input_plugin_compat.c +++ b/Source/3rdParty/mupen64plus-core/src/backends/plugins_compat/input_plugin_compat.c @@ -78,11 +78,11 @@ static m64p_error input_plugin_get_input(void* opaque, uint32_t* input_) if (input.getKeys) input.getKeys(netplay_controller, &keys); - netplay_set_plugin(cin_compat->control_id, Controls[netplay_controller].Plugin); Controls[netplay_controller].Plugin = plugin; Controls[netplay_controller].Present = present; - cin_compat->last_input = keys.Value; //disable pak switching for netplay } + cin_compat->last_input = keys.Value; //disable pak switching for netplay + cin_compat->last_pak_type = Controls[cin_compat->control_id].Plugin; //disable pak switching for netplay } /* return an error if controller is not plugged */ diff --git a/Source/3rdParty/mupen64plus-core/src/device/cart/is_viewer.c b/Source/3rdParty/mupen64plus-core/src/device/cart/is_viewer.c index 4ab559b74..14dc2c882 100644 --- a/Source/3rdParty/mupen64plus-core/src/device/cart/is_viewer.c +++ b/Source/3rdParty/mupen64plus-core/src/device/cart/is_viewer.c @@ -67,13 +67,17 @@ void write_is_viewer(void* opaque, uint32_t address, uint32_t value, uint32_t ma memcpy(&is_viewer->output_buffer[is_viewer->buffer_pos], &is_viewer->data[0x20], word); is_viewer->buffer_pos += word; - char* newline = strpbrk_reverse("\n", is_viewer->output_buffer, is_viewer->buffer_pos); - if (newline) + + /* process new lines in buffer to prevent empty debug messages without losing data */ + char* newline = strchr(is_viewer->output_buffer, '\n'); + while (newline) { + size_t index = (newline - is_viewer->output_buffer) + 1; *newline = '\0'; DebugMessage(M64MSG_INFO, "IS64: %s", is_viewer->output_buffer); - memset(is_viewer->output_buffer, 0, is_viewer->buffer_pos); - is_viewer->buffer_pos = 0; + memcpy(&is_viewer->output_buffer, &is_viewer->output_buffer[index], IS_BUFFER_SIZE - index); + is_viewer->buffer_pos -= index; + newline = strchr(is_viewer->output_buffer, '\n'); } } } diff --git a/Source/3rdParty/mupen64plus-core/src/device/r4300/new_dynarec/arm/assem_arm.c b/Source/3rdParty/mupen64plus-core/src/device/r4300/new_dynarec/arm/assem_arm.c index af33de4e7..32a852a32 100644 --- a/Source/3rdParty/mupen64plus-core/src/device/r4300/new_dynarec/arm/assem_arm.c +++ b/Source/3rdParty/mupen64plus-core/src/device/r4300/new_dynarec/arm/assem_arm.c @@ -3125,69 +3125,63 @@ static void fconv_assemble_arm(int i,struct regstat *i_regs) save_regs(reglist); if(opcode2[i]==0x14&&(source[i]&0x3f)==0x20) { - if(fs>=0) emit_mov(fs,ARG1_REG); - else emit_loadreg(FSREG,ARG1_REG); + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>11)&0x1f],ARG2_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG3_REG); emit_call((int)cvt_s_w); } if(opcode2[i]==0x14&&(source[i]&0x3f)==0x21) { + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>11)&0x1f],ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>> 6)&0x1f],ARG2_REG); emit_call((int)cvt_d_w); } if(opcode2[i]==0x15&&(source[i]&0x3f)==0x20) { - if(fs>=0) emit_mov(fs,ARG1_REG); - else emit_loadreg(FSREG,ARG1_REG); + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG3_REG); emit_call((int)cvt_s_l); } if(opcode2[i]==0x15&&(source[i]&0x3f)==0x21) { - if(fs>=0) emit_mov(fs,ARG1_REG); - else emit_loadreg(FSREG,ARG1_REG); + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>> 6)&0x1f],ARG3_REG); emit_call((int)cvt_d_l); } if(opcode2[i]==0x10&&(source[i]&0x3f)==0x21) { + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>11)&0x1f],ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>> 6)&0x1f],ARG2_REG); emit_call((int)cvt_d_s); } if(opcode2[i]==0x10&&(source[i]&0x3f)==0x24) { - if(fs>=0) emit_mov(fs,ARG1_REG); - else emit_loadreg(FSREG,ARG1_REG); + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>11)&0x1f],ARG2_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG3_REG); emit_call((int)cvt_w_s); } if(opcode2[i]==0x10&&(source[i]&0x3f)==0x25) { - if(fs>=0) emit_mov(fs,ARG1_REG); - else emit_loadreg(FSREG,ARG1_REG); + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>11)&0x1f],ARG2_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>> 6)&0x1f],ARG3_REG); emit_call((int)cvt_l_s); } if(opcode2[i]==0x11&&(source[i]&0x3f)==0x20) { - if(fs>=0) emit_mov(fs,ARG1_REG); - else emit_loadreg(FSREG,ARG1_REG); + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG3_REG); emit_call((int)cvt_s_d); } if(opcode2[i]==0x11&&(source[i]&0x3f)==0x24) { - if(fs>=0) emit_mov(fs,ARG1_REG); - else emit_loadreg(FSREG,ARG1_REG); + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG3_REG); emit_call((int)cvt_w_d); } if(opcode2[i]==0x11&&(source[i]&0x3f)==0x25) { - if(fs>=0) emit_mov(fs,ARG1_REG); - else emit_loadreg(FSREG,ARG1_REG); + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>> 6)&0x1f],ARG3_REG); emit_call((int)cvt_l_d); @@ -3568,19 +3562,18 @@ static void float_assemble(int i,struct regstat *i_regs) switch(source[i]&0x3f) { case 0x00: case 0x01: case 0x02: case 0x03: - if(fs>=0) emit_mov(fs,ARG1_REG); - else emit_loadreg(FSREG,ARG1_REG); + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>11)&0x1f],ARG2_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>16)&0x1f],ARG3_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG4_REG); break; case 0x04: - if(fs>=0) emit_mov(fs,ARG1_REG); - else emit_loadreg(FSREG,ARG1_REG); + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>11)&0x1f],ARG2_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG3_REG); break; case 0x05: case 0x06: case 0x07: + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>>11)&0x1f],ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_simple[(source[i]>> 6)&0x1f],ARG2_REG); break; @@ -3604,19 +3597,18 @@ static void float_assemble(int i,struct regstat *i_regs) switch(source[i]&0x3f) { case 0x00: case 0x01: case 0x02: case 0x03: - if(fs>=0) emit_mov(fs,ARG1_REG); - else emit_loadreg(FSREG,ARG1_REG); + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>16)&0x1f],ARG3_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>> 6)&0x1f],ARG4_REG); break; case 0x04: - if(fs>=0) emit_mov(fs,ARG1_REG); - else emit_loadreg(FSREG,ARG1_REG); + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG2_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>> 6)&0x1f],ARG3_REG); break; case 0x05: case 0x06: case 0x07: + emit_addimm(FP,fp_fcr31,ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>>11)&0x1f],ARG1_REG); emit_readptr((u_int)&g_dev.r4300.new_dynarec_hot_state.cp1_regs_double[(source[i]>> 6)&0x1f],ARG2_REG); break; diff --git a/Source/3rdParty/mupen64plus-core/src/main/main.c b/Source/3rdParty/mupen64plus-core/src/main/main.c index b3c323d45..fbe9cfa13 100644 --- a/Source/3rdParty/mupen64plus-core/src/main/main.c +++ b/Source/3rdParty/mupen64plus-core/src/main/main.c @@ -545,6 +545,9 @@ static void main_set_speedlimiter(int enable) void main_speedlimiter_toggle(void) { + if (netplay_is_init()) + return; + l_MainSpeedLimit = !l_MainSpeedLimit; main_set_speedlimiter(l_MainSpeedLimit); @@ -1634,9 +1637,6 @@ m64p_error main_run(void) else disable_extra_mem = ConfigGetParamInt(g_CoreConfig, "DisableExtraMem"); - - rdram_size = (disable_extra_mem == 0) ? 0x800000 : 0x400000; - if (count_per_op <= 0) count_per_op = ROM_SETTINGS.countperop; @@ -1650,6 +1650,8 @@ m64p_error main_run(void) //During netplay, player 1 is the source of truth for these settings netplay_sync_settings(&count_per_op, &count_per_op_denom_pot, &disable_extra_mem, &si_dma_duration, &emumode, &no_compiled_jump); + rdram_size = (disable_extra_mem == 0) ? 0x800000 : 0x400000; + cheat_add_hacks(&g_cheat_ctx, ROM_PARAMS.cheats); /* do byte-swapping if it hasn't been done yet */ diff --git a/Source/3rdParty/mupen64plus-core/src/main/netplay.c b/Source/3rdParty/mupen64plus-core/src/main/netplay.c index 63c7bd908..0c5ae2f87 100644 --- a/Source/3rdParty/mupen64plus-core/src/main/netplay.c +++ b/Source/3rdParty/mupen64plus-core/src/main/netplay.c @@ -19,6 +19,8 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ +#define SETTINGS_SIZE 24 + #define M64P_CORE_PROTOTYPES 1 #include "api/callbacks.h" #include "main.h" @@ -53,6 +55,7 @@ static uint8_t l_player_lag[4]; #define UDP_SEND_KEY_INFO 0 #define UDP_RECEIVE_KEY_INFO 1 #define UDP_REQUEST_KEY_INFO 2 +#define UDP_RECEIVE_KEY_INFO_GRATUITOUS 3 #define UDP_SYNC_DATA 4 //TCP packet formats @@ -246,11 +249,13 @@ static void netplay_process() switch (packet->data[0]) { case UDP_RECEIVE_KEY_INFO: + case UDP_RECEIVE_KEY_INFO_GRATUITOUS: player = packet->data[1]; //current_status is a status update from the server //it will let us know if another player has disconnected, or the games have desynced current_status = packet->data[2]; - l_player_lag[player] = packet->data[3]; + if (packet->data[0] == UDP_RECEIVE_KEY_INFO) + l_player_lag[player] = packet->data[3]; if (current_status != l_status) { if (((current_status & 0x1) ^ (l_status & 0x1)) != 0) @@ -501,7 +506,7 @@ void netplay_sync_settings(uint32_t *count_per_op, uint32_t *count_per_op_denom_ if (!netplay_is_init()) return; - char output_data[25]; + char output_data[SETTINGS_SIZE + 1]; uint8_t request; if (l_netplay_control[0] != -1) //player 1 is the source of truth for settings { @@ -513,7 +518,7 @@ void netplay_sync_settings(uint32_t *count_per_op, uint32_t *count_per_op_denom_ SDLNet_Write32(*si_dma_duration, &output_data[13]); SDLNet_Write32(*emumode, &output_data[17]); SDLNet_Write32(*no_compiled_jump, &output_data[21]); - SDLNet_TCP_Send(l_tcpSocket, &output_data[0], 25); + SDLNet_TCP_Send(l_tcpSocket, &output_data[0], SETTINGS_SIZE + 1); } else { @@ -521,8 +526,8 @@ void netplay_sync_settings(uint32_t *count_per_op, uint32_t *count_per_op_denom_ memcpy(&output_data[0], &request, 1); SDLNet_TCP_Send(l_tcpSocket, &output_data[0], 1); int32_t recv = 0; - while (recv < 24) - recv += SDLNet_TCP_Recv(l_tcpSocket, &output_data[recv], 24 - recv); + while (recv < SETTINGS_SIZE) + recv += SDLNet_TCP_Recv(l_tcpSocket, &output_data[recv], SETTINGS_SIZE - recv); *count_per_op = SDLNet_Read32(&output_data[0]); *count_per_op_denom_pot = SDLNet_Read32(&output_data[4]); *disable_extra_mem = SDLNet_Read32(&output_data[8]); @@ -535,14 +540,14 @@ void netplay_sync_settings(uint32_t *count_per_op, uint32_t *count_per_op_denom_ void netplay_check_sync(struct cp0* cp0) { //This function is used to check if games have desynced - //Every 60 VIs, it sends the value of the CP0 registers to the server + //Every 600 VIs, it sends the value of the CP0 registers to the server //The server will compare the values, and update the status byte if it detects a desync if (!netplay_is_init()) return; const uint32_t* cp0_regs = r4300_cp0_regs(cp0); - if (l_vi_counter % 60 == 0) + if (l_vi_counter % 600 == 0) { uint32_t packet_len = (CP0_REGS_COUNT * 4) + 5; UDPpacket *packet = SDLNet_AllocPacket(packet_len); @@ -583,14 +588,19 @@ void netplay_read_registration(struct controller_input_compat* cin_compats) if (reg_id == 0) //No one registered to control this player { Controls[i].Present = 0; - Controls[i].Plugin = 1; + Controls[i].Plugin = PLUGIN_NONE; Controls[i].RawData = 0; curr += 2; } else { Controls[i].Present = 1; - Controls[i].Plugin = input_data[curr]; + if (i > 0 && input_data[curr] == PLUGIN_MEMPAK) // only P1 can use mempak + Controls[i].Plugin = PLUGIN_NONE; + else if (input_data[curr] == PLUGIN_TRANSFER_PAK) // Transferpak not supported during netplay + Controls[i].Plugin = PLUGIN_NONE; + else + Controls[i].Plugin = input_data[curr]; l_plugin[i] = Controls[i].Plugin; ++curr; Controls[i].RawData = input_data[curr]; @@ -657,12 +667,6 @@ void netplay_update_input(struct pif* pif) } } -void netplay_set_plugin(uint8_t control_id, uint8_t plugin) -{ - if (!(control_id > 0 && plugin == 2)) //Only P1 can use mempak - l_plugin[control_id] = plugin; -} - m64p_error netplay_send_config(char* data, int size) { if (!netplay_is_init()) diff --git a/Source/3rdParty/mupen64plus-core/src/main/netplay.h b/Source/3rdParty/mupen64plus-core/src/main/netplay.h index a5b8f310d..088d4a397 100644 --- a/Source/3rdParty/mupen64plus-core/src/main/netplay.h +++ b/Source/3rdParty/mupen64plus-core/src/main/netplay.h @@ -52,7 +52,6 @@ void netplay_check_sync(struct cp0* cp0); int netplay_next_controller(); void netplay_read_registration(struct controller_input_compat* cin_compats); void netplay_update_input(struct pif* pif); -void netplay_set_plugin(uint8_t control_id, uint8_t plugin); m64p_error netplay_send_config(char* data, int size); m64p_error netplay_receive_config(char* data, int size); diff --git a/Source/3rdParty/mupen64plus-core/src/main/rom.c b/Source/3rdParty/mupen64plus-core/src/main/rom.c index 0f02d3dd3..6e59cf9b9 100644 --- a/Source/3rdParty/mupen64plus-core/src/main/rom.c +++ b/Source/3rdParty/mupen64plus-core/src/main/rom.c @@ -885,6 +885,8 @@ void romdatabase_close(void) free(g_romdatabase.list); g_romdatabase.list = search; } + + g_romdatabase.have_database = 0; } static romdatabase_entry* ini_search_by_md5(md5_byte_t* md5)