summaryrefslogtreecommitdiff
path: root/Ports/mgba/patches
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2022-05-16 19:21:53 +0430
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2022-05-19 20:17:10 +0430
commite1a5f63e1ae838386fe838716092d82ec20cf189 (patch)
tree24528a4865c2e1b63986283bfcc97dbb68c473a5 /Ports/mgba/patches
parent79dc62af6185ee43714fb3b933aa0918345102a0 (diff)
downloadserenity-e1a5f63e1ae838386fe838716092d82ec20cf189.zip
Ports: Update mgba's patches to use git patches
Diffstat (limited to 'Ports/mgba/patches')
-rw-r--r--Ports/mgba/patches/0001-Remove-use-of-futime-n-s.patch35
-rw-r--r--Ports/mgba/patches/0002-Use-SDL-software-renderer-with-no-vsync.patch32
-rw-r--r--Ports/mgba/patches/ReadMe.md13
-rw-r--r--Ports/mgba/patches/serenity-does-not-support-futimens-or-futimes.patch14
-rw-r--r--Ports/mgba/patches/use-sdl-software-renderer-with-no-vsync.patch11
5 files changed, 75 insertions, 30 deletions
diff --git a/Ports/mgba/patches/0001-Remove-use-of-futime-n-s.patch b/Ports/mgba/patches/0001-Remove-use-of-futime-n-s.patch
new file mode 100644
index 0000000000..e107a96995
--- /dev/null
+++ b/Ports/mgba/patches/0001-Remove-use-of-futime-n-s.patch
@@ -0,0 +1,35 @@
+From 9a3372d695e0374821a0db6275b0b5c57111a341 Mon Sep 17 00:00:00 2001
+From: Luke Wilde <lukew@serenityos.org>
+Date: Wed, 13 Apr 2022 17:22:56 +0100
+Subject: [PATCH 1/2] Remove use of futime(n)s
+
+We do not currently support futimens or futimes. [futimens is a POSIX function,](https://pubs.opengroup.org/onlinepubs/9699919799/)
+so this is an issue on our side.
+
+- [ ] Local?
+- [ ] Should be merged to upstream?
+- [X] Resolves issue(s) with our side of things
+- [ ] Hack
+---
+ src/util/vfs/vfs-fd.c | 5 -----
+ 1 file changed, 5 deletions(-)
+
+diff --git a/src/util/vfs/vfs-fd.c b/src/util/vfs/vfs-fd.c
+index c15ab5c..8d8d5c8 100644
+--- a/src/util/vfs/vfs-fd.c
++++ b/src/util/vfs/vfs-fd.c
+@@ -200,11 +200,6 @@ static bool _vfdSync(struct VFile* vf, void* buffer, size_t size) {
+ UNUSED(size);
+ struct VFileFD* vfd = (struct VFileFD*) vf;
+ #ifndef _WIN32
+-#ifdef __HAIKU__
+- futimens(vfd->fd, NULL);
+-#else
+- futimes(vfd->fd, NULL);
+-#endif
+ if (buffer && size) {
+ return msync(buffer, size, MS_ASYNC) == 0;
+ }
+--
+2.36.1
+
diff --git a/Ports/mgba/patches/0002-Use-SDL-software-renderer-with-no-vsync.patch b/Ports/mgba/patches/0002-Use-SDL-software-renderer-with-no-vsync.patch
new file mode 100644
index 0000000000..1122488338
--- /dev/null
+++ b/Ports/mgba/patches/0002-Use-SDL-software-renderer-with-no-vsync.patch
@@ -0,0 +1,32 @@
+From 02fb21126fa6df66dabee40439fab341f2bdd6e8 Mon Sep 17 00:00:00 2001
+From: Luke Wilde <lukew@serenityos.org>
+Date: Wed, 13 Apr 2022 17:22:56 +0100
+Subject: [PATCH 2/2] Use SDL software renderer with no vsync
+
+This makes us use the SDL software renderer with no vsync, as our SDL2 port does not currently support accelerated rendering
+or vsync.
+
+- [ ] Local?
+- [ ] Should be merged to upstream?
+- [X] Resolves issue(s) with our side of things
+- [ ] Hack
+---
+ src/platform/sdl/sw-sdl2.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/platform/sdl/sw-sdl2.c b/src/platform/sdl/sw-sdl2.c
+index 48afc33..11bd58c 100644
+--- a/src/platform/sdl/sw-sdl2.c
++++ b/src/platform/sdl/sw-sdl2.c
+@@ -25,7 +25,7 @@ bool mSDLSWInit(struct mSDLRenderer* renderer) {
+ renderer->window = SDL_CreateWindow(projectName, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, renderer->viewportWidth, renderer->viewportHeight, SDL_WINDOW_OPENGL | (SDL_WINDOW_FULLSCREEN_DESKTOP * renderer->player.fullscreen));
+ SDL_GetWindowSize(renderer->window, &renderer->viewportWidth, &renderer->viewportHeight);
+ renderer->player.window = renderer->window;
+- renderer->sdlRenderer = SDL_CreateRenderer(renderer->window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
++ renderer->sdlRenderer = SDL_CreateRenderer(renderer->window, -1, SDL_RENDERER_SOFTWARE);
+ #ifdef COLOR_16_BIT
+ #ifdef COLOR_5_6_5
+ renderer->sdlTex = SDL_CreateTexture(renderer->sdlRenderer, SDL_PIXELFORMAT_RGB565, SDL_TEXTUREACCESS_STREAMING, width, height);
+--
+2.36.1
+
diff --git a/Ports/mgba/patches/ReadMe.md b/Ports/mgba/patches/ReadMe.md
index 018aca7f49..ea5fdbc326 100644
--- a/Ports/mgba/patches/ReadMe.md
+++ b/Ports/mgba/patches/ReadMe.md
@@ -1,23 +1,26 @@
-# Patches for mGBA on SerenityOS
+# Patches for mgba on SerenityOS
-## `serenity-does-not-support-futimens-or-futimes.patch`
+## `0001-Remove-use-of-futime-n-s.patch`
+
+Remove use of futime(n)s
We do not currently support futimens or futimes. [futimens is a POSIX function,](https://pubs.opengroup.org/onlinepubs/9699919799/)
so this is an issue on our side.
-### Status
- [ ] Local?
- [ ] Should be merged to upstream?
- [X] Resolves issue(s) with our side of things
- [ ] Hack
-## `use-sdl-software-renderer-with-no-vsync.patch`
+## `0002-Use-SDL-software-renderer-with-no-vsync.patch`
+
+Use SDL software renderer with no vsync
This makes us use the SDL software renderer with no vsync, as our SDL2 port does not currently support accelerated rendering
or vsync.
-### Status
- [ ] Local?
- [ ] Should be merged to upstream?
- [X] Resolves issue(s) with our side of things
- [ ] Hack
+
diff --git a/Ports/mgba/patches/serenity-does-not-support-futimens-or-futimes.patch b/Ports/mgba/patches/serenity-does-not-support-futimens-or-futimes.patch
deleted file mode 100644
index 694dc9f8ba..0000000000
--- a/Ports/mgba/patches/serenity-does-not-support-futimens-or-futimes.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- mgba-0.9.3/src/util/vfs/vfs-fd.c 2021-12-18 01:56:32.000000000 +0000
-+++ mgba-0.9.3.serenity/src/util/vfs/vfs-fd.c 2022-04-13 02:50:08.792765951 +0100
-@@ -200,11 +200,6 @@
- UNUSED(size);
- struct VFileFD* vfd = (struct VFileFD*) vf;
- #ifndef _WIN32
--#ifdef __HAIKU__
-- futimens(vfd->fd, NULL);
--#else
-- futimes(vfd->fd, NULL);
--#endif
- if (buffer && size) {
- return msync(buffer, size, MS_ASYNC) == 0;
- }
diff --git a/Ports/mgba/patches/use-sdl-software-renderer-with-no-vsync.patch b/Ports/mgba/patches/use-sdl-software-renderer-with-no-vsync.patch
deleted file mode 100644
index a53dcbc9bb..0000000000
--- a/Ports/mgba/patches/use-sdl-software-renderer-with-no-vsync.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- mgba-0.9.3/src/platform/sdl/sw-sdl2.c 2021-12-18 01:56:32.000000000 +0000
-+++ mgba-0.9.3.serenity/src/platform/sdl/sw-sdl2.c 2022-04-13 02:50:08.760766286 +0100
-@@ -25,7 +25,7 @@
- renderer->window = SDL_CreateWindow(projectName, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, renderer->viewportWidth, renderer->viewportHeight, SDL_WINDOW_OPENGL | (SDL_WINDOW_FULLSCREEN_DESKTOP * renderer->player.fullscreen));
- SDL_GetWindowSize(renderer->window, &renderer->viewportWidth, &renderer->viewportHeight);
- renderer->player.window = renderer->window;
-- renderer->sdlRenderer = SDL_CreateRenderer(renderer->window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
-+ renderer->sdlRenderer = SDL_CreateRenderer(renderer->window, -1, SDL_RENDERER_SOFTWARE);
- #ifdef COLOR_16_BIT
- #ifdef COLOR_5_6_5
- renderer->sdlTex = SDL_CreateTexture(renderer->sdlRenderer, SDL_PIXELFORMAT_RGB565, SDL_TEXTUREACCESS_STREAMING, width, height);