Skip to content

Commit e0ddc9d

Browse files
authored
Merge pull request #19 from AlwinEsch/Matrix-change
Final Matrix release changes (rework and fix, description text, version increase)
2 parents 4908e41 + c01c498 commit e0ddc9d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2183
-1193
lines changed

CMakeLists.txt

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,30 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR})
55

66
find_package(Kodi REQUIRED)
77

8-
add_subdirectory(lib/nosefart)
8+
include_directories(${PROJECT_SOURCE_DIR}/lib
9+
${PROJECT_SOURCE_DIR}/lib/nosefart/src/
10+
${PROJECT_SOURCE_DIR}/lib/nosefart/src/cpu/nes6502
11+
${PROJECT_SOURCE_DIR}/lib/nosefart/src/machine
12+
${PROJECT_SOURCE_DIR}/lib/nosefart/src/sndhrdw
13+
${KODI_INCLUDE_DIR}/..)
914

10-
include_directories(${KODI_INCLUDE_DIR}/..
11-
${PROJECT_SOURCE_DIR}/lib/nosefart/src)
15+
add_subdirectory(lib/nosefart)
1216

1317
set(NOSEFART_SOURCES src/NSFCodec.cpp)
18+
set(NOSEFART_HEADERS src/NSFCodec.h)
19+
20+
add_definitions(-DNSF_PLAYER -DNES6502_MEM_ACCESS_CTRL)
21+
add_definitions(-DLIBRARY_PREFIX="${CMAKE_SHARED_LIBRARY_PREFIX}"
22+
-DLIBRARY_SUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}")
23+
24+
set(NOSEFART_ADDITIONAL_BINARY $<TARGET_FILE:nosefart_tag> $<TARGET_FILE:nosefart_0> $<TARGET_FILE:nosefart_1>)
1425

15-
set(DEPLIBS nosefart)
26+
if(WIN32)
27+
find_package(dlfcn-win32 REQUIRED)
28+
list(APPEND DEPLIBS ${dlfcn-win32_LIBRARIES})
29+
include_directories(${dlfcn-win32_INCLUDE_DIRS})
30+
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
31+
endif()
1632

1733
build_addon(audiodecoder.nosefart NOSEFART DEPLIBS)
1834

audiodecoder.nosefart/addon.xml.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<addon
33
id="audiodecoder.nosefart"
4-
version="2.1.0"
4+
version="2.2.0"
55
name="Nosefart Audio Decoder"
66
provider-name="spiff">
77
<requires>@ADDON_DEPENDS@</requires>
@@ -14,7 +14,7 @@
1414
library_@PLATFORM@="@LIBRARY_FILENAME@"/>
1515
<extension point="xbmc.addon.metadata">
1616
<summary lang="en">Nosefart (NSF) Audio Decoder</summary>
17-
<description lang="en">Nosefart (NSF) Audio Decoder</description>
17+
<description lang="en">The Nintendo Sound Format (NSF) is a container format, that holds audio code ripped from the ROMs of games for the Nintendo Entertainment System. The NES had a pretty good sound engine for its time supporting 2 pulse-waves, 1 triangle wave, a noise channel, and DPCM channel which is a raw 7-bit counter raw sample playback.</description>
1818
<platform>@PLATFORM@</platform>
1919
</extension>
2020
</addon>

audiodecoder.nosefart/icon.png

16 KB
Loading
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
f18a412e84d8b701e61a78252411fe8c72587f52417c1ef21ca93604de1b9c55
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dlfcn-win32 https://github.com/dlfcn-win32/dlfcn-win32/archive/v1.2.0.tar.gz
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-DBUILD_SHARED_LIBS=OFF
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
From f85366b1044fff7b4ea9162c3edcd8278c3e06ff Mon Sep 17 00:00:00 2001
2+
From: Alwin Esch <alwin.esch@web.de>
3+
Date: Thu, 22 Aug 2019 19:30:12 +0100
4+
Subject: [PATCH] [win10] fixed uwp build
5+
6+
---
7+
dlfcn.c | 43 ++++++++++++++++++++++++++++++++++++++-----
8+
1 file changed, 38 insertions(+), 5 deletions(-)
9+
10+
diff --git a/dlfcn.c b/dlfcn.c
11+
index 69670d1..2d77ca8 100644
12+
--- a/dlfcn.c
13+
+++ b/dlfcn.c
14+
@@ -19,6 +19,7 @@
15+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16+
*/
17+
18+
+#define _CRT_SECURE_NO_WARNINGS
19+
#ifdef _DEBUG
20+
#define _CRTDBG_MAP_ALLOC
21+
#include <stdlib.h>
22+
@@ -193,6 +194,7 @@ static void save_err_ptr_str( const void *ptr )
23+
/* Load Psapi.dll at runtime, this avoids linking caveat */
24+
static BOOL MyEnumProcessModules( HANDLE hProcess, HMODULE *lphModule, DWORD cb, LPDWORD lpcbNeeded )
25+
{
26+
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_APP)
27+
static BOOL (WINAPI *EnumProcessModulesPtr)(HANDLE, HMODULE *, DWORD, LPDWORD);
28+
HMODULE psapi;
29+
30+
@@ -206,20 +208,26 @@ static BOOL MyEnumProcessModules( HANDLE hProcess, HMODULE *lphModule, DWORD cb,
31+
}
32+
33+
return EnumProcessModulesPtr( hProcess, lphModule, cb, lpcbNeeded );
34+
+#else
35+
+ return 0;
36+
+#endif
37+
}
38+
39+
void *dlopen( const char *file, int mode )
40+
{
41+
- HMODULE hModule;
42+
- UINT uMode;
43+
+ HMODULE hModule = NULL;
44+
+ UINT uMode = 0;
45+
46+
current_error = NULL;
47+
48+
/* Do not let Windows display the critical-error-handler message box */
49+
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_APP)
50+
uMode = SetErrorMode( SEM_FAILCRITICALERRORS );
51+
+#endif
52+
53+
if( file == 0 )
54+
{
55+
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_APP) // what is replacement of GMH on UWP?
56+
/* POSIX says that if the value of file is 0, a handle on a global
57+
* symbol object must be provided. That object must be able to access
58+
* all symbols from the original program file, and any objects loaded
59+
@@ -234,6 +242,7 @@ void *dlopen( const char *file, int mode )
60+
61+
if( !hModule )
62+
save_err_ptr_str( file );
63+
+#endif
64+
}
65+
else
66+
{
67+
@@ -264,11 +273,29 @@ void *dlopen( const char *file, int mode )
68+
* to UNIX's search paths (start with system folders instead of current
69+
* folder).
70+
*/
71+
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
72+
+ int result = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, lpFileName, strlen(lpFileName), NULL, 0);
73+
+ if (result == 0)
74+
+ return NULL;
75+
+
76+
+ wchar_t* newStr = (wchar_t*)malloc(result*sizeof(wchar_t));
77+
+ result = MultiByteToWideChar( CP_UTF8, MB_ERR_INVALID_CHARS, lpFileName, strlen(lpFileName), newStr, result );
78+
+ if (result == 0)
79+
+ {
80+
+ free( newStr );
81+
+ return NULL;
82+
+ }
83+
+
84+
+ hModule = LoadPackagedLibrary( newStr, 0 );
85+
+ free( newStr );
86+
+ dwProcModsAfter = 0;
87+
+#else // WINAPI_PARTITION_DESKTOP
88+
hModule = LoadLibraryExA(lpFileName, NULL,
89+
LOAD_WITH_ALTERED_SEARCH_PATH );
90+
91+
if( MyEnumProcessModules( hCurrentProc, NULL, 0, &dwProcModsAfter ) == 0 )
92+
dwProcModsAfter = 0;
93+
+#endif
94+
95+
/* If the object was loaded with RTLD_LOCAL, add it to list of local
96+
* objects, so that its symbols cannot be retrieved even if the handle for
97+
@@ -288,7 +315,9 @@ void *dlopen( const char *file, int mode )
98+
}
99+
100+
/* Return to previous state of the error-mode bit flags. */
101+
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_APP)
102+
SetErrorMode( uMode );
103+
+#endif
104+
105+
return (void *) hModule;
106+
}
107+
@@ -321,12 +350,14 @@ void *dlsym( void *handle, const char *name )
108+
{
109+
FARPROC symbol;
110+
HMODULE hCaller;
111+
- HMODULE hModule;
112+
- HANDLE hCurrentProc;
113+
+ HMODULE hModule = 0;
114+
+ HANDLE hCurrentProc = 0;
115+
116+
current_error = NULL;
117+
symbol = NULL;
118+
hCaller = NULL;
119+
+
120+
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_APP) // what is replacement of GMH on UWP?
121+
hModule = GetModuleHandle( NULL );
122+
hCurrentProc = GetCurrentProcess( );
123+
124+
@@ -358,6 +389,7 @@ void *dlsym( void *handle, const char *name )
125+
if(!hCaller)
126+
goto end;
127+
}
128+
+#endif
129+
130+
if( handle != RTLD_NEXT )
131+
{
132+
@@ -370,7 +402,7 @@ void *dlsym( void *handle, const char *name )
133+
/* If the handle for the original program file is passed, also search
134+
* in all globally loaded objects.
135+
*/
136+
-
137+
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY != WINAPI_FAMILY_APP)
138+
if( hModule == handle || handle == RTLD_NEXT )
139+
{
140+
HMODULE *modules;
141+
@@ -410,6 +442,7 @@ void *dlsym( void *handle, const char *name )
142+
}
143+
}
144+
}
145+
+#endif
146+
147+
end:
148+
if( symbol == NULL )
149+
--
150+
2.19.2.windows.1
151+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
f18a412e84d8b701e61a78252411fe8c72587f52417c1ef21ca93604de1b9c55
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dlfcn-win32 https://github.com/dlfcn-win32/dlfcn-win32/archive/v1.2.0.tar.gz
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-DBUILD_SHARED_LIBS=OFF

0 commit comments

Comments
 (0)