Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
49 changes: 49 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@ set(Impacto_Src
src/profile/games/cc/backlogmenu.cpp
src/profile/games/cc/dialoguebox.cpp
src/profile/games/cc/titlemenu.cpp
src/profile/games/sg0/titlemenu.cpp
src/profile/games/sg0/savemenu.cpp
src/profile/games/sg0/sysmesbox.cpp
src/profile/games/sg0/phone.cpp
src/profile/games/sg0/systemmenu.cpp
src/profile/games/sg0/helpmenu.cpp
src/profile/games/sg0/backlogmenu.cpp
src/profile/games/sg0/tipsmenu.cpp
src/profile/games/sg0/optionsmenu.cpp
src/profile/games/sg0/librarymenu.cpp
src/profile/games/sg0/clearlistmenu.cpp
src/profile/games/cc/sysmesbox.cpp

src/profile/games/cclcc/systemmenu.cpp
Expand Down Expand Up @@ -212,6 +223,19 @@ set(Impacto_Src

src/games/cc/backlogmenu.cpp
src/games/cc/titlemenu.cpp
src/games/sg0/titlemenu.cpp
src/games/sg0/savemenu.cpp
src/games/sg0/sysmesbox.cpp
src/games/sg0/phone.cpp
src/games/sg0/rine.cpp
src/games/sg0/systemmenu.cpp
src/games/sg0/helpmenu.cpp
src/games/sg0/backlogmenu.cpp
src/games/sg0/tipsmenu.cpp
src/games/sg0/optionsmenu.cpp
src/games/sg0/librarymenu.cpp
src/games/sg0/clearlistmenu.cpp
src/games/sg0/cutin.cpp
src/games/cc/sysmesbox.cpp

src/games/cclcc/commonmenu.cpp
Expand Down Expand Up @@ -522,6 +546,17 @@ set(Impacto_Header
src/profile/games/cc/backlogmenu.h
src/profile/games/cc/dialoguebox.h
src/profile/games/cc/titlemenu.h
src/profile/games/sg0/titlemenu.h
src/profile/games/sg0/savemenu.h
src/profile/games/sg0/sysmesbox.h
src/profile/games/sg0/phone.h
src/profile/games/sg0/systemmenu.h
src/profile/games/sg0/helpmenu.h
src/profile/games/sg0/backlogmenu.h
src/profile/games/sg0/tipsmenu.h
src/profile/games/sg0/optionsmenu.h
src/profile/games/sg0/librarymenu.h
src/profile/games/sg0/clearlistmenu.h
src/profile/games/cc/sysmesbox.h

src/profile/games/cclcc/titlemenu.h
Expand Down Expand Up @@ -586,6 +621,20 @@ set(Impacto_Header
src/games/chlcc/introsequence.h

src/games/cc/titlemenu.h
src/games/sg0/titlemenu.h
src/games/sg0/savemenu.h
src/games/sg0/sysmesbox.h
src/games/sg0/phone.h
src/games/sg0/rine.h
src/games/sg0/systemmenu.h
src/games/sg0/helpmenu.h
src/games/sg0/backlogmenu.h
src/games/sg0/tipsmenu.h
src/games/sg0/optionsmenu.h
src/games/sg0/librarymenu.h
src/games/sg0/clearlistmenu.h
src/games/sg0/cutin.h
src/games/sg0/fullwidth.h
src/games/cc/sysmesbox.h

src/games/cclcc/commonmenu.h
Expand Down
27 changes: 27 additions & 0 deletions portfiles/ffmpeg/0001-create-lib-libraries.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git a/configure b/configure
index 1f0b9497cb..3243e23021 100644
--- a/configure
+++ b/configure
@@ -5697,17 +5697,19 @@ case $target_os in
;;
win32|win64)
disable symver
- if enabled shared; then
+# if enabled shared; then
# Link to the import library instead of the normal static library
# for shared libs.
LD_LIB='%.lib'
# Cannot build both shared and static libs with MSVC or icl.
- disable static
- fi
+# disable static
+# fi
! enabled small && test_cmd $windres --version && enable gnu_windres
enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
add_cppflags -DWIN32_LEAN_AND_MEAN
shlibdir_default="$bindir_default"
+ LIBPREF=""
+ LIBSUF=".lib"
SLIBPREF=""
SLIBSUF=".dll"
SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
11 changes: 11 additions & 0 deletions portfiles/ffmpeg/0002-fix-msvc-link.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -6162,6 +6162,7 @@ EOF
test -n "$extern_prefix" && append X86ASMFLAGS "-DPREFIX"
case "$objformat" in
elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;;
+ win*) enabled debug && append X86ASMFLAGS "-g" ;;
esac

enabled avx512 && check_x86asm avx512_external "vmovdqa32 [eax]{k1}{z}, zmm0"
13 changes: 13 additions & 0 deletions portfiles/ffmpeg/0003-fix-windowsinclude.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -51,6 +51,8 @@
#include "fopen_utf8.h"
#include "opt_common.h"
#ifdef _WIN32
+#define _WIN32_WINNT 0x0502
+#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "compat/w32dlfcn.h"
#endif

65 changes: 65 additions & 0 deletions portfiles/ffmpeg/0004-dependencies.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
diff --git a/configure b/configure
index a8b74e0..c99f41c 100755
--- a/configure
+++ b/configure
@@ -6633,7 +6633,7 @@ fi

enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion ||
check_lib zlib zlib.h zlibVersion -lz; }
-enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
+enabled bzlib && require_pkg_config bzlib bzip2 bzlib.h BZ2_bzlibVersion
enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma

enabled zlib && test_exec $zlib_extralibs <<EOF && enable zlib_gzip
@@ -6757,7 +6757,8 @@ if enabled libmfx; then
fi

enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load
-enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs
+enabled libmp3lame && { check_lib libmp3lame lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs ||
+ require libmp3lame lame/lame.h lame_set_VBR_quality -llibmp3lame-static -llibmpghip-static $libm_extralibs; }
enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine ||
require libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine -lmysofa $zlib_extralibs; }
enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei -lnppif ||
@@ -6772,7 +6773,7 @@ require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
enabled libopenh264 && require_pkg_config libopenh264 "openh264 >= 1.3.0" wels/codec_api.h WelsGetCodecVersion
enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
{ require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
-enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
+enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create
enabled libopenvino && { { check_pkg_config libopenvino openvino openvino/c/openvino.h ov_core_create && enable openvino2; } ||
{ check_pkg_config libopenvino openvino c_api/ie_c_api.h ie_c_api_version ||
require libopenvino c_api/ie_c_api.h ie_c_api_version -linference_engine_c_api; } }
@@ -6796,8 +6797,8 @@ enabled libshaderc && require_pkg_config spirv_compiler "shaderc >= 2019.
enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
-enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
-enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
+enabled libsnappy && require_pkg_config libsnappy snappy snappy-c.h snappy_compress
+enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr $libm_extralibs
enabled libssh && require_pkg_config libssh "libssh >= 0.6.0" libssh/sftp.h sftp_init
enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
@@ -6880,6 +6881,8 @@ enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h"
enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel "-framework OpenCL" ||
check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
+ check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL -lAdvapi32 -lOle32 -lCfgmgr32||
+ check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL -pthread -ldl ||
die "ERROR: opencl not found"; } &&
{ test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
@@ -7204,10 +7207,10 @@ enabled amf &&
"(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400210000"

# Funny iconv installations are not unusual, so check it after all flags have been set
-if enabled libc_iconv; then
+if enabled libc_iconv && disabled iconv; then
check_func_headers iconv.h iconv
elif enabled iconv; then
- check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv
+ check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv || check_lib iconv iconv.h iconv -liconv -lcharset
fi

enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
78 changes: 78 additions & 0 deletions portfiles/ffmpeg/0005-fix-nasm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
diff --git a/libavcodec/x86/mlpdsp.asm b/libavcodec/x86/mlpdsp.asm
index 3dc641e..609b834 100644
--- a/libavcodec/x86/mlpdsp.asm
+++ b/libavcodec/x86/mlpdsp.asm
@@ -23,7 +23,9 @@

SECTION .text

-%if ARCH_X86_64
+%ifn ARCH_X86_64
+mlpdsp_placeholder: times 4 db 0
+%else

%macro SHLX 2
%if cpuflag(bmi2)
diff --git a/libavcodec/x86/proresdsp.asm b/libavcodec/x86/proresdsp.asm
index 65c9fad..5ad73f3 100644
--- a/libavcodec/x86/proresdsp.asm
+++ b/libavcodec/x86/proresdsp.asm
@@ -24,7 +24,10 @@

%include "libavutil/x86/x86util.asm"

-%if ARCH_X86_64
+%ifn ARCH_X86_64
+SECTION .rdata
+proresdsp_placeholder: times 4 db 0
+%else

SECTION_RODATA

diff --git a/libavcodec/x86/vvc/vvc_mc.asm b/libavcodec/x86/vvc/vvc_mc.asm
index 30aa97c..3975f98 100644
--- a/libavcodec/x86/vvc/vvc_mc.asm
+++ b/libavcodec/x86/vvc/vvc_mc.asm
@@ -31,7 +31,9 @@

SECTION_RODATA 32

-%if ARCH_X86_64
+%ifn ARCH_X86_64
+vvc_mc_placeholder: times 4 db 0
+%else

%if HAVE_AVX2_EXTERNAL

diff --git a/libavfilter/x86/vf_atadenoise.asm b/libavfilter/x86/vf_atadenoise.asm
index 4945ad3..748b65a 100644
--- a/libavfilter/x86/vf_atadenoise.asm
+++ b/libavfilter/x86/vf_atadenoise.asm
@@ -20,7 +20,10 @@
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
;******************************************************************************

-%if ARCH_X86_64
+%ifn ARCH_X86_64
+SECTION .rdata
+vf_atadenoise_placeholder: times 4 db 0
+%else

%include "libavutil/x86/x86util.asm"

diff --git a/libavfilter/x86/vf_nlmeans.asm b/libavfilter/x86/vf_nlmeans.asm
index 8f57801..9aef3a4 100644
--- a/libavfilter/x86/vf_nlmeans.asm
+++ b/libavfilter/x86/vf_nlmeans.asm
@@ -21,7 +21,10 @@

%include "libavutil/x86/x86util.asm"

-%if HAVE_AVX2_EXTERNAL && ARCH_X86_64
+%ifn HAVE_AVX2_EXTERNAL && ARCH_X86_64
+SECTION .rdata
+vf_nlmeans_placeholder: times 4 db 0
+%else

SECTION_RODATA 32

12 changes: 12 additions & 0 deletions portfiles/ffmpeg/0007-fix-lib-naming.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/configure b/configure
index d6c4388..75b96c3 100644
--- a/configure
+++ b/configure
@@ -4781,6 +4781,7 @@ msvc_common_flags(){
-mfp16-format=*) ;;
-lz) echo zlib.lib ;;
-lx264) echo libx264.lib ;;
+ -lmp3lame) echo libmp3lame.lib ;;
-lstdc++) ;;
-l*) echo ${flag#-l}.lib ;;
-LARGEADDRESSAWARE) echo $flag ;;
15 changes: 15 additions & 0 deletions portfiles/ffmpeg/0013-define-WINVER.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --color -Naur src_old/libavcodec/mf_utils.c src/libavcodec/mf_utils.c
--- src_old/libavcodec/mf_utils.c 2020-07-11 05:26:17.000000000 +0700
+++ src/libavcodec/mf_utils.c 2020-11-13 12:55:57.226976400 +0700
@@ -22,6 +22,11 @@
#define _WIN32_WINNT 0x0602
#endif

+#if !defined(WINVER) || WINVER < 0x0602
+#undef WINVER
+#define WINVER 0x0602
+#endif
+
#include "mf_utils.h"
#include "libavutil/pixdesc.h"

28 changes: 28 additions & 0 deletions portfiles/ffmpeg/0020-fix-aarch64-libswscale.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/libswscale/aarch64/yuv2rgb_neon.S b/libswscale/aarch64/yuv2rgb_neon.S
index 89d69e7f6c..4bc1607a7a 100644
--- a/libswscale/aarch64/yuv2rgb_neon.S
+++ b/libswscale/aarch64/yuv2rgb_neon.S
@@ -169,19 +169,19 @@ function ff_\ifmt\()_to_\ofmt\()_neon, export=1
sqdmulh v26.8h, v26.8h, v0.8h // ((Y1*(1<<3) - y_offset) * y_coeff) >> 15
sqdmulh v27.8h, v27.8h, v0.8h // ((Y2*(1<<3) - y_offset) * y_coeff) >> 15

-.ifc \ofmt,argb // 1 2 3 0
+.ifc \ofmt,argb
compute_rgba v5.8b,v6.8b,v7.8b,v4.8b, v17.8b,v18.8b,v19.8b,v16.8b
.endif

-.ifc \ofmt,rgba // 0 1 2 3
+.ifc \ofmt,rgba
compute_rgba v4.8b,v5.8b,v6.8b,v7.8b, v16.8b,v17.8b,v18.8b,v19.8b
.endif

-.ifc \ofmt,abgr // 3 2 1 0
+.ifc \ofmt,abgr
compute_rgba v7.8b,v6.8b,v5.8b,v4.8b, v19.8b,v18.8b,v17.8b,v16.8b
.endif

-.ifc \ofmt,bgra // 2 1 0 3
+.ifc \ofmt,bgra
compute_rgba v6.8b,v5.8b,v4.8b,v7.8b, v18.8b,v17.8b,v16.8b,v19.8b
.endif

15 changes: 15 additions & 0 deletions portfiles/ffmpeg/0024-fix-osx-host-c11.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/configure b/configure
index 4f5353f84b..dd9147c677 100755
--- a/configure
+++ b/configure
@@ -5607,8 +5607,8 @@ check_cppflags -D_FILE_OFFSET_BITS=64
check_cppflags -D_LARGEFILE_SOURCE

add_host_cppflags -D_ISOC11_SOURCE
check_host_cflags_cc -std=$stdc ctype.h "__STDC_VERSION__ >= 201112L" ||
- check_host_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L" || die "Host compiler lacks C11 support"
+ check_host_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L"

check_host_cflags -Wall
check_host_cflags $host_cflags_speed

Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index cd7b0d941c..b4a6dce885 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1169,7 +1169,11 @@ typedef struct AVStreamGroup {
} AVStreamGroup;

struct AVCodecParserContext *av_stream_get_parser(const AVStream *s);

+// Chromium: We use the internal field first_dts vvv
+int64_t av_stream_get_first_dts(const AVStream *st);
+// Chromium: We use the internal field first_dts ^^^
+
#define AV_PROGRAM_RUNNING 1

/**
diff --git a/libavformat/mux_utils.c b/libavformat/mux_utils.c
index de7580c32d..0ef0fe530e 100644
--- a/libavformat/mux_utils.c
+++ b/libavformat/mux_utils.c
@@ -29,7 +29,14 @@ #include "avformat.h"
#include "avio.h"
#include "internal.h"
#include "mux.h"

+// Chromium: We use the internal field first_dts vvv
+int64_t av_stream_get_first_dts(const AVStream *st)
+{
+ return cffstream(st)->first_dts;
+}
+// Chromium: We use the internal field first_dts ^^^
+
int avformat_query_codec(const AVOutputFormat *ofmt, enum AVCodecID codec_id,
int std_compliance)
{
13 changes: 13 additions & 0 deletions portfiles/ffmpeg/0041-add-const-for-opengl-definition.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/libavdevice/opengl_enc.c b/libavdevice/opengl_enc.c
index b2ac6eb..6351614 100644
--- a/libavdevice/opengl_enc.c
+++ b/libavdevice/opengl_enc.c
@@ -116,7 +116,7 @@ typedef void (APIENTRY *FF_PFNGLATTACHSHADERPROC) (GLuint program, GLuint shad
typedef GLuint (APIENTRY *FF_PFNGLCREATESHADERPROC) (GLenum type);
typedef void (APIENTRY *FF_PFNGLDELETESHADERPROC) (GLuint shader);
typedef void (APIENTRY *FF_PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef void (APIENTRY *FF_PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const char* *string, const GLint *length);
+typedef void (APIENTRY *FF_PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const char* const *string, const GLint *length);
typedef void (APIENTRY *FF_PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
typedef void (APIENTRY *FF_PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, char *infoLog);

Loading