Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Update mupen64plus to latest upstream version #4117

Draft
wants to merge 48 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
0aee174
Bumpy ride incoming
Morilli Jul 1, 2024
08c614b
Working video output
Morilli Jul 2, 2024
d858bb8
fix video and improve attribute handling
Morilli Jul 2, 2024
11d76c5
audio support (theres absolutely nothing wrong with the audio)
Morilli Jul 2, 2024
62c1015
fix audio, need to actually change mupen source :/
Morilli Jul 2, 2024
80e1150
Implement input (crashes on close welp)
Morilli Jul 3, 2024
7141c93
remove SDL_PumpEvents
Morilli Jul 3, 2024
2360e98
improve video buffer size handling
Morilli Jul 7, 2024
388d97c
Implement savestates
Morilli Jul 7, 2024
438216f
Disable vsync in OpenGL contexts
Morilli Jul 7, 2024
35ef7f9
Update mupen64plus-video-GLideN64.dll
Morilli Jul 7, 2024
716b64f
Fix potential freeze due to race condition
Morilli Jul 7, 2024
5e6b425
it is necessary
Morilli Jul 7, 2024
6eb21ff
Disable mupen speed limiter to enable fast forward
Morilli Jul 7, 2024
74d2cdd
just rebuild dlls for the 1000th time
Morilli Jul 7, 2024
ee880cd
Implement IRegionable
Morilli Jul 7, 2024
86f9620
remove unnecessary dlls
Morilli Jul 7, 2024
6718b86
Implement reset and power buttons
Morilli Jul 7, 2024
71a0539
Possibly fix potential crash on reload
Morilli Jul 7, 2024
82225dd
Implement ISaveRam
Morilli Jul 8, 2024
a6d823e
Implement IInputPollable
Morilli Jul 13, 2024
d7ad123
Actually set some settings
Morilli Jul 13, 2024
dd2eab7
Implement IMemoryDomains
Morilli Jul 13, 2024
612f122
change default coretype to dynarec, fix sysbus read/write
Morilli Jul 13, 2024
2fe87fd
this might be more correct
Morilli Jul 14, 2024
b629e69
fix syncsettings enum display names
Morilli Jul 14, 2024
5e73591
Initial diassemble and trace support, lots missing
Morilli Jul 14, 2024
dc4ec97
this fixes crashes in multithreaded GLideN64, but it's ugly
Morilli Jul 17, 2024
84a3da0
Update Mupen64Plus version
Morilli Jul 17, 2024
4971162
Don't use Thread.Join in mupen dispose method
Morilli Oct 18, 2024
544a4c1
update dlls
Morilli Nov 2, 2024
7559b07
remove unneeded dlls
Morilli Nov 2, 2024
67358c2
make CI (more) happy
Morilli Nov 2, 2024
b99ca53
minimal edits
Morilli Nov 3, 2024
b89296c
implement in-memory savestate *saving*
Morilli Nov 5, 2024
eba8759
fix excepetion in debug due to invalid axis reads
Morilli Nov 5, 2024
2e8867d
fully implement in-memory savestates
Morilli Nov 5, 2024
ef95d4e
actually compile mupen with debugger
Morilli Nov 9, 2024
f6c50c0
remove configs
Morilli Nov 9, 2024
bec1640
remove dlls
Morilli Nov 9, 2024
a335991
update dll to decrease size
Morilli Nov 9, 2024
624e537
strip dlls
Morilli Nov 9, 2024
fa59851
unregister ITraceable when in dynarec
Morilli Nov 9, 2024
7fc0d04
fix Disassemble length value
Morilli Nov 16, 2024
dccbc71
Initial IDebuggable work
Morilli Nov 16, 2024
a0bcbd5
uncomment this
Morilli Nov 16, 2024
d1c545c
Initial linux binaries
Morilli Nov 17, 2024
1569450
add angrylion-plus
Morilli Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed Assets/dll/freetype.dll
Binary file not shown.
Binary file removed Assets/dll/libgcc_s_seh-1.dll
Binary file not shown.
Binary file added Assets/dll/libmupen64plus-audio-bkm.so
Binary file not shown.
Binary file added Assets/dll/libmupen64plus-input-bkm.so
Binary file not shown.
Binary file added Assets/dll/libmupen64plus-rsp-cxd4-sse2.so
Binary file not shown.
Binary file added Assets/dll/libmupen64plus-rsp-hle.so
Binary file not shown.
Binary file added Assets/dll/libmupen64plus-video-GLideN64.so
Binary file not shown.
Binary file not shown.
Binary file added Assets/dll/libmupen64plus.so
Binary file not shown.
Binary file removed Assets/dll/libstdc++-6.dll
Binary file not shown.
Binary file modified Assets/dll/mupen64plus-input-bkm.dll
Binary file not shown.
Binary file modified Assets/dll/mupen64plus-rsp-cxd4-sse2.dll
Binary file not shown.
Binary file modified Assets/dll/mupen64plus-rsp-hle.dll
Binary file not shown.
Binary file modified Assets/dll/mupen64plus-video-GLideN64.dll
Binary file not shown.
Binary file added Assets/dll/mupen64plus-video-angrylion-plus.dll
Binary file not shown.
Binary file removed Assets/dll/mupen64plus-video-glide64mk2.dll
Binary file not shown.
Binary file modified Assets/dll/mupen64plus.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ public class DefaultSetterGenerator : ISourceGenerator
{
public class SyntaxReceiver : ISyntaxContextReceiver
{
public readonly List<(ClassDeclarationSyntax, SemanticModel)> ClassDeclarations = new();
public readonly List<(TypeDeclarationSyntax, SemanticModel)> TypeDeclarations = new();

public void OnVisitSyntaxNode(GeneratorSyntaxContext context)
{
if (context.Node is ClassDeclarationSyntax cds)
if (context.Node is TypeDeclarationSyntax cds)
{
ClassDeclarations.Add((cds, context.SemanticModel));
TypeDeclarations.Add((cds, context.SemanticModel));
}
}
}
Expand Down Expand Up @@ -94,12 +94,12 @@ namespace BizHawk.Common
public static partial class SettingsUtil
{");

foreach (var (cds, semanticModel) in syntaxReceiver.ClassDeclarations)
foreach (var (tds, semanticModel) in syntaxReceiver.TypeDeclarations)
{
if (cds.AttributeLists.SelectMany(e => e.Attributes)
if (tds.AttributeLists.SelectMany(e => e.Attributes)
.Any(e => e.Name.NormalizeWhitespace().ToFullString() == "CoreSettings"))
{
var symbol = semanticModel.GetDeclaredSymbol(cds, context.CancellationToken);
var symbol = semanticModel.GetDeclaredSymbol(tds, context.CancellationToken);
if (symbol is not null) // probably never happens?
{
CreateDefaultSetter(source, symbol);
Expand Down
Binary file modified References/BizHawk.SrcGen.SettingsUtil.dll
Binary file not shown.
19 changes: 19 additions & 0 deletions libmupen64plus/mupen64plus-audio-bkm/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

#define M64P_PLUGIN_PROTOTYPES 1
#include "m64p_types.h"
Expand All @@ -36,6 +37,24 @@
#include "main.h"
#include "osal_dynamiclib.h"

#ifdef max
#undef max
#endif
#define max(a, b) __extension__ ({ \
__typeof__(a) _a = (a); \
__typeof__(b) _b = (b); \
_a > _b ? _a : _b; \
})

#ifdef min
#undef min
#endif
#define min(a, b) __extension__ ({ \
__typeof__(a) _a = (a); \
__typeof__(b) _b = (b); \
_a < _b ? _a : _b; \
})

/* This sets default frequency what is used if rom doesn't want to change it.
Probably only game that needs this is Zelda: Ocarina Of Time Master Quest
*NOTICE* We should try to find out why Demos' frequencies are always wrong
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>..\..\src;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.13\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.39\include;..\..\..\mupen64plus-win32-deps\freetype-2.13.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DBG;WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;DYNAREC;M64P_OSD;M64P_PARALLEL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>DBG;WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;M64P_OSD;M64P_PARALLEL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
Expand All @@ -87,7 +87,7 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>..\..\src;..\..\..\mupen64plus-win32-deps\SDL2-2.26.3\include;..\..\..\mupen64plus-win32-deps\zlib-1.2.13\include;..\..\..\mupen64plus-win32-deps\libpng-1.6.39\include;..\..\..\mupen64plus-win32-deps\freetype-2.13.0\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>DBG;WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;DYNAREC;M64P_OSD;M64P_PARALLEL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>DBG;WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;M64P_OSD;M64P_PARALLEL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
Expand Down Expand Up @@ -241,4 +241,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
26 changes: 13 additions & 13 deletions libmupen64plus/mupen64plus-core/src/main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ m64p_error main_core_state_query(m64p_core_param param, int *rval)
case M64CORE_AUDIO_VOLUME:
{
if (!g_EmulatorRunning)
return M64ERR_INVALID_STATE;
return M64ERR_INVALID_STATE;
return main_volume_get_level(rval);
}
case M64CORE_AUDIO_MUTE:
Expand Down Expand Up @@ -481,7 +481,7 @@ m64p_error main_core_state_set(m64p_core_param param, int val)
if (!g_EmulatorRunning)
return M64ERR_INVALID_STATE;
if (val == M64EMU_STOPPED)
{
{
/* this stop function is asynchronous. The emulator may not terminate until later */
main_stop();
return M64ERR_SUCCESS;
Expand All @@ -493,7 +493,7 @@ m64p_error main_core_state_set(m64p_core_param param, int val)
return M64ERR_SUCCESS;
}
else if (val == M64EMU_PAUSED)
{
{
if (!main_is_paused())
main_toggle_pause();
return M64ERR_SUCCESS;
Expand Down Expand Up @@ -687,7 +687,7 @@ void new_vi(void)
double VILimitMilliseconds = 1000.0 / ROM_PARAMS.vilimit;
double AdjustedLimit = VILimitMilliseconds * 100.0 / l_SpeedFactor; // adjust for selected emulator speed
int time;

start_section(IDLE_SECTION);
VI_Counter++;

Expand All @@ -701,10 +701,10 @@ void new_vi(void)
return;
}
CurrentFPSTime = SDL_GetTicks();

Dif = CurrentFPSTime - LastFPSTime;
if (Dif < AdjustedLimit)

if (Dif < AdjustedLimit)
{
CalculatedTime = (unsigned int) (CounterTime + AdjustedLimit * VI_Counter);
time = (int)(CalculatedTime - CurrentFPSTime);
Expand All @@ -716,12 +716,12 @@ void new_vi(void)
CurrentFPSTime = CurrentFPSTime + time;
}

if (CurrentFPSTime - CounterTime >= 1000.0 )
if (CurrentFPSTime - CounterTime >= 1000.0 )
{
CounterTime = SDL_GetTicks();
VI_Counter = 0 ;
}

LastFPSTime = CurrentFPSTime ;
*/
end_section(IDLE_SECTION);
Expand Down Expand Up @@ -840,7 +840,7 @@ void main_stop(void)
{
/* note: this operation is asynchronous. It may be called from a thread other than the
main emulator thread, and may return before the emulator is completely stopped */
if (!g_EmulatorRunning)
if (!g_EmulatorRunning)
return;

//DebugMessage(M64MSG_STATUS, "Stopping emulation.");
Expand All @@ -859,19 +859,20 @@ void main_stop(void)
osd_delete_message(l_msgVol);
l_msgVol = NULL;
}
DebugMessage(M64MSG_INFO, "stopping the emulator via main_stop...\n");
stop = 1;
//if (rompause)
//{
// rompause = 0;
ReleaseSemaphore(rompausesem, 1, NULL);
StateChanged(M64CORE_EMU_STATE, M64EMU_RUNNING);
//}
//}
#ifdef DBG
if(g_DebuggerActive)
{
debugger_step();
}
#endif
#endif
}

/*********************************************************************************************************
Expand All @@ -881,4 +882,3 @@ int main(int argc, char *argv[])
{
return 1;
}

30 changes: 30 additions & 0 deletions libmupen64plus/mupen64plus-input-bkm/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus-core - api/config.h *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2009 Richard Goedeken *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/* This file contains the Core configuration functions
*/

#include "m64p_types.h"

/* these functions are only to be used within the Core library */

m64p_error ConfigInit(const char *ConfigDirOverride, const char *DataDirOverride);
m64p_error ConfigShutdown(void);
90 changes: 90 additions & 0 deletions libmupen64plus/mupen64plus-input-bkm/m64p_common.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Mupen64plus-core - m64p_common.h *
* Mupen64Plus homepage: https://mupen64plus.org/ *
* Copyright (C) 2009 Richard Goedeken *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/* This header file defines typedefs for function pointers to common Core
* and plugin functions, for use by the front-end and plugin modules to attach
* to the dynamic libraries.
*/

#if !defined(M64P_COMMON_H)
#define M64P_COMMON_H

#include "m64p_types.h"

#ifdef __cplusplus
extern "C" {
#endif

/* PluginGetVersion()
*
* This function retrieves version information from a library. This
* function is the same for the core library and the plugins.
*/
typedef m64p_error (*ptr_PluginGetVersion)(m64p_plugin_type *, int *, int *, const char **, int *);
#if defined(M64P_PLUGIN_PROTOTYPES) || defined(M64P_CORE_PROTOTYPES)
EXPORT m64p_error CALL PluginGetVersion(m64p_plugin_type *, int *, int *, const char **, int *);
#endif

/* CoreGetAPIVersions()
*
* This function retrieves API version information from the core.
*/
typedef m64p_error (*ptr_CoreGetAPIVersions)(int *, int *, int *, int *);
#if defined(M64P_CORE_PROTOTYPES)
EXPORT m64p_error CALL CoreGetAPIVersions(int *, int *, int *, int *);
#endif

/* CoreErrorMessage()
*
* This function returns a pointer to a NULL-terminated string giving a
* human-readable description of the error.
*/
typedef const char * (*ptr_CoreErrorMessage)(m64p_error);
#if defined(M64P_CORE_PROTOTYPES)
EXPORT const char * CALL CoreErrorMessage(m64p_error);
#endif

/* PluginStartup()
*
* This function initializes a plugin for use by allocating memory, creating
* data structures, and loading the configuration data.
*/
typedef m64p_error (*ptr_PluginStartup)(m64p_dynlib_handle, void *, void (*)(void *, int, const char *));
#if defined(M64P_PLUGIN_PROTOTYPES) || defined(M64P_CORE_PROTOTYPES)
EXPORT m64p_error CALL PluginStartup(m64p_dynlib_handle, void *, void (*)(void *, int, const char *));
#endif

/* PluginShutdown()
*
* This function destroys data structures and releases memory allocated by
* the plugin library.
*/
typedef m64p_error (*ptr_PluginShutdown)(void);
#if defined(M64P_PLUGIN_PROTOTYPES) || defined(M64P_CORE_PROTOTYPES)
EXPORT m64p_error CALL PluginShutdown(void);
#endif

#ifdef __cplusplus
}
#endif

#endif /* #define M64P_COMMON_H */

Loading