diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2022-05-16 19:21:37 +0430 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2022-05-19 20:17:10 +0430 |
commit | 2f58fe00bdd22899f0fe0638faec65d5004b5baa (patch) | |
tree | da4a1bf522d847229163a8a76943ad872b8241ed | |
parent | c92ec097c01e5e97837acb9b46c5a22ec4ec6028 (diff) | |
download | serenity-2f58fe00bdd22899f0fe0638faec65d5004b5baa.zip |
Ports: Update genemu's patches to use git patches
This required splitting the single patch file up, which was done with
_some_ degree of accuracy (but not entirely so).
-rw-r--r-- | Ports/genemu/patches/0001-Manually-link-against-SDL2.patch | 40 | ||||
-rw-r--r-- | Ports/genemu/patches/0002-Disable-logging.patch | 25 | ||||
-rw-r--r-- | Ports/genemu/patches/0003-Add-a-missing-cstdlib-include.patch | 24 | ||||
-rw-r--r-- | Ports/genemu/patches/0004-Use-SDL2-for-SDL-includes.patch | 51 | ||||
-rw-r--r-- | Ports/genemu/patches/0005-Use-software-rendering.patch | 32 | ||||
-rw-r--r-- | Ports/genemu/patches/ReadMe.md | 27 | ||||
-rw-r--r-- | Ports/genemu/patches/genemu.patch | 111 |
7 files changed, 199 insertions, 111 deletions
diff --git a/Ports/genemu/patches/0001-Manually-link-against-SDL2.patch b/Ports/genemu/patches/0001-Manually-link-against-SDL2.patch new file mode 100644 index 0000000000..442a121c4a --- /dev/null +++ b/Ports/genemu/patches/0001-Manually-link-against-SDL2.patch @@ -0,0 +1,40 @@ +From 056b239a373a1ff7dafd50e75f5c08331d1fcb52 Mon Sep 17 00:00:00 2001 +From: aabajyan <arsen.abajyan@pm.me> +Date: Sun, 7 Mar 2021 22:30:13 +0400 +Subject: [PATCH 1/5] Manually link against SDL2 + +--- + CMakeLists.txt | 18 ++++++++++++------ + 1 file changed, 12 insertions(+), 6 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 94ae8ef..a9a974c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,11 +1,17 @@ + cmake_minimum_required(VERSION 2.6) +-set(CMAKE_BUILD_TYPE "Debug") +- + + INCLUDE(FindPkgConfig) +-PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2) +-INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS}) ++find_package(SDL2 REQUIRED) + +-set_source_files_properties( mem.cpp PROPERTIES COMPILE_FLAGS " -O0 -UNDEBUG " ) ++set_source_files_properties( mem.cpp PROPERTIES COMPILE_FLAGS " -Og") + add_executable(genemu genemu.cpp cpu.cpp vdp.cpp mem.cpp state.cpp gfx.cpp ioports.cpp hw.c Z80/Z80.c m68k/m68kcpu.c m68k/m68kops.c m68k/m68kopac.c m68k/m68kopdm.c m68k/m68kopnz.c m68k/m68kdasm.c ym2612/ym2612.c) +-target_link_libraries(genemu ${SDL2_LIBRARIES}) ++target_include_directories(genemu SYSTEM PRIVATE ${SDL2_INCLUDE_DIRS}) ++ ++if("${SDL2_LIBRARIES}" STREQUAL "") ++ message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2") ++ set(SDL2_LIBRARIES "SDL2::SDL2") ++endif() ++ ++target_link_libraries(genemu PRIVATE ${SDL2_LIBRARIES}) ++ ++install(TARGETS genemu RUNTIME DESTINATION bin) +-- +2.36.1 + diff --git a/Ports/genemu/patches/0002-Disable-logging.patch b/Ports/genemu/patches/0002-Disable-logging.patch new file mode 100644 index 0000000000..627c3f94ae --- /dev/null +++ b/Ports/genemu/patches/0002-Disable-logging.patch @@ -0,0 +1,25 @@ +From bf9d28049d0c69604f968eb23b1a1509f449946a Mon Sep 17 00:00:00 2001 +From: Ali Mohammad Pur <ali.mpfard@gmail.com> +Date: Mon, 16 May 2022 15:31:45 +0430 +Subject: [PATCH 2/5] Disable logging + +--- + mem.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mem.h b/mem.h +index 8c96952..6c39fd6 100644 +--- a/mem.h ++++ b/mem.h +@@ -7,7 +7,7 @@ + #define MAX(a,b) ((a)>(b)?(a):(b)) + #define MIN(a,b) ((a)<(b)?(a):(b)) + +-#define DISABLE_LOGGING 0 ++#define DISABLE_LOGGING 1 + + void mem_init(int romsize); + int load_bin(const char *fn); +-- +2.36.1 + diff --git a/Ports/genemu/patches/0003-Add-a-missing-cstdlib-include.patch b/Ports/genemu/patches/0003-Add-a-missing-cstdlib-include.patch new file mode 100644 index 0000000000..443b7cc402 --- /dev/null +++ b/Ports/genemu/patches/0003-Add-a-missing-cstdlib-include.patch @@ -0,0 +1,24 @@ +From 0c4abad4174c3b12d5a42b62a47718896961610a Mon Sep 17 00:00:00 2001 +From: aabajyan <arsen.abajyan@pm.me> +Date: Sun, 7 Mar 2021 22:30:13 +0400 +Subject: [PATCH 3/5] Add a missing cstdlib include + +--- + mem.cpp | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/mem.cpp b/mem.cpp +index fd36d68..4cf0b30 100644 +--- a/mem.cpp ++++ b/mem.cpp +@@ -10,6 +10,7 @@ extern "C" { + #include "vdp.h" + #include "cpu.h" + #include "ioports.h" ++#include <cstdlib> + + uint8_t *ROM; + uint8_t RAM[0x10000]; +-- +2.36.1 + diff --git a/Ports/genemu/patches/0004-Use-SDL2-for-SDL-includes.patch b/Ports/genemu/patches/0004-Use-SDL2-for-SDL-includes.patch new file mode 100644 index 0000000000..06a88ece30 --- /dev/null +++ b/Ports/genemu/patches/0004-Use-SDL2-for-SDL-includes.patch @@ -0,0 +1,51 @@ +From 426933aab1632c89ecb75918f23baa9f0c279581 Mon Sep 17 00:00:00 2001 +From: Ali Mohammad Pur <ali.mpfard@gmail.com> +Date: Mon, 16 May 2022 15:32:01 +0430 +Subject: [PATCH 4/5] Use <SDL2> for SDL includes + +--- + gfx.cpp | 2 +- + ioports.cpp | 2 +- + state.cpp | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/gfx.cpp b/gfx.cpp +index 04daf6e..2848422 100644 +--- a/gfx.cpp ++++ b/gfx.cpp +@@ -3,7 +3,7 @@ + #include <assert.h> + #include <memory.h> + #include <stdio.h> +-#include <SDL.h> ++#include <SDL2/SDL.h> + extern "C" { + #include "hw.h" + } +diff --git a/ioports.cpp b/ioports.cpp +index 9c3f14f..9295163 100644 +--- a/ioports.cpp ++++ b/ioports.cpp +@@ -1,5 +1,5 @@ + #include "mem.h" +-#include <SDL.h> ++#include <SDL2/SDL.h> + extern "C" { + #include "hw.h" + } +diff --git a/state.cpp b/state.cpp +index 38bc547..aa70962 100644 +--- a/state.cpp ++++ b/state.cpp +@@ -3,7 +3,7 @@ + #include "vdp.h" + #include "cpu.h" + #include "hw.h" +-#include <SDL.h> ++#include <SDL2/SDL.h> + + extern "C" { + #include "m68k/m68k.h" +-- +2.36.1 + diff --git a/Ports/genemu/patches/0005-Use-software-rendering.patch b/Ports/genemu/patches/0005-Use-software-rendering.patch new file mode 100644 index 0000000000..6091bd4702 --- /dev/null +++ b/Ports/genemu/patches/0005-Use-software-rendering.patch @@ -0,0 +1,32 @@ +From ca395dd67bfc14dcfe769b42f2ec2d3107987cab Mon Sep 17 00:00:00 2001 +From: Ali Mohammad Pur <ali.mpfard@gmail.com> +Date: Mon, 16 May 2022 15:32:14 +0430 +Subject: [PATCH 5/5] Use software rendering + +--- + hw.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/hw.c b/hw.c +index 6b864df..1f34423 100644 +--- a/hw.c ++++ b/hw.c +@@ -1,5 +1,5 @@ + #include "hw.h" +-#include <SDL.h> ++#include <SDL2/SDL.h> + #include <assert.h> + #include <time.h> + +@@ -105,7 +105,7 @@ void hw_enable_video(int enable) + screen = SDL_CreateWindow("Genemu - Sega Genesis Emulator", + SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, + WINDOW_WIDTH, WINDOW_WIDTH*3/4, SDL_WINDOW_RESIZABLE); +- renderer = SDL_CreateRenderer(screen, -1, SDL_RENDERER_PRESENTVSYNC); ++ renderer = SDL_CreateRenderer(screen, -1, SDL_RENDERER_SOFTWARE); + + SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest"); // make the scaled rendering look smoother. + SDL_RenderSetLogicalSize(renderer, 320, 240); +-- +2.36.1 + diff --git a/Ports/genemu/patches/ReadMe.md b/Ports/genemu/patches/ReadMe.md new file mode 100644 index 0000000000..5ca207e54d --- /dev/null +++ b/Ports/genemu/patches/ReadMe.md @@ -0,0 +1,27 @@ +# Patches for genemu on SerenityOS + +## `0001-Manually-link-against-SDL2.patch` + +Manually link against SDL2 + + +## `0002-Disable-logging.patch` + +Disable logging + + +## `0003-Add-a-missing-cstdlib-include.patch` + +Add a missing cstdlib include + + +## `0004-Use-SDL2-for-SDL-includes.patch` + +Use <SDL2> for SDL includes + + +## `0005-Use-software-rendering.patch` + +Use software rendering + + diff --git a/Ports/genemu/patches/genemu.patch b/Ports/genemu/patches/genemu.patch deleted file mode 100644 index 612533cf40..0000000000 --- a/Ports/genemu/patches/genemu.patch +++ /dev/null @@ -1,111 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 94ae8ef..bfb4631 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1,11 +1,17 @@ - cmake_minimum_required(VERSION 2.6) --set(CMAKE_BUILD_TYPE "Debug") -- - - INCLUDE(FindPkgConfig) --PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2) --INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS}) -+find_package(SDL2 REQUIRED) - --set_source_files_properties( mem.cpp PROPERTIES COMPILE_FLAGS " -O0 -UNDEBUG " ) -+set_source_files_properties( mem.cpp PROPERTIES COMPILE_FLAGS " -Og") - add_executable(genemu genemu.cpp cpu.cpp vdp.cpp mem.cpp state.cpp gfx.cpp ioports.cpp hw.c Z80/Z80.c m68k/m68kcpu.c m68k/m68kops.c m68k/m68kopac.c m68k/m68kopdm.c m68k/m68kopnz.c m68k/m68kdasm.c ym2612/ym2612.c) --target_link_libraries(genemu ${SDL2_LIBRARIES}) -+target_include_directories(genemu SYSTEM PRIVATE ${SDL2_INCLUDE_DIRS}) -+ -+if("${SDL2_LIBRARIES}" STREQUAL "") -+ message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2") -+ set(SDL2_LIBRARIES "SDL2::SDL2") -+endif() -+ -+target_link_libraries(genemu PRIVATE ${SDL2_LIBRARIES}) -+ -+install(TARGETS genemu RUNTIME DESTINATION bin) -\ No newline at end of file -diff --git a/gfx.cpp b/gfx.cpp -index 04daf6e..2848422 100644 ---- a/gfx.cpp -+++ b/gfx.cpp -@@ -3,7 +3,7 @@ - #include <assert.h> - #include <memory.h> - #include <stdio.h> --#include <SDL.h> -+#include <SDL2/SDL.h> - extern "C" { - #include "hw.h" - } -diff --git a/hw.c b/hw.c -index 6b864df..1f34423 100644 ---- a/hw.c -+++ b/hw.c -@@ -1,5 +1,5 @@ - #include "hw.h" --#include <SDL.h> -+#include <SDL2/SDL.h> - #include <assert.h> - #include <time.h> - -@@ -105,7 +105,7 @@ void hw_enable_video(int enable) - screen = SDL_CreateWindow("Genemu - Sega Genesis Emulator", - SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, - WINDOW_WIDTH, WINDOW_WIDTH*3/4, SDL_WINDOW_RESIZABLE); -- renderer = SDL_CreateRenderer(screen, -1, SDL_RENDERER_PRESENTVSYNC); -+ renderer = SDL_CreateRenderer(screen, -1, SDL_RENDERER_SOFTWARE); - - SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest"); // make the scaled rendering look smoother. - SDL_RenderSetLogicalSize(renderer, 320, 240); -diff --git a/ioports.cpp b/ioports.cpp -index 9c3f14f..9295163 100644 ---- a/ioports.cpp -+++ b/ioports.cpp -@@ -1,5 +1,5 @@ - #include "mem.h" --#include <SDL.h> -+#include <SDL2/SDL.h> - extern "C" { - #include "hw.h" - } -diff --git a/mem.cpp b/mem.cpp -index fd36d68..4cf0b30 100644 ---- a/mem.cpp -+++ b/mem.cpp -@@ -10,6 +10,7 @@ extern "C" { - #include "vdp.h" - #include "cpu.h" - #include "ioports.h" -+#include <cstdlib> - - uint8_t *ROM; - uint8_t RAM[0x10000]; -diff --git a/mem.h b/mem.h -index 8c96952..6c39fd6 100644 ---- a/mem.h -+++ b/mem.h -@@ -7,7 +7,7 @@ - #define MAX(a,b) ((a)>(b)?(a):(b)) - #define MIN(a,b) ((a)<(b)?(a):(b)) - --#define DISABLE_LOGGING 0 -+#define DISABLE_LOGGING 1 - - void mem_init(int romsize); - int load_bin(const char *fn); -diff --git a/state.cpp b/state.cpp -index 38bc547..aa70962 100644 ---- a/state.cpp -+++ b/state.cpp -@@ -3,7 +3,7 @@ - #include "vdp.h" - #include "cpu.h" - #include "hw.h" --#include <SDL.h> -+#include <SDL2/SDL.h> - - extern "C" { - #include "m68k/m68k.h" |