mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 18:02:05 -05:00
Ports: Update mgba's patches to use git patches
This commit is contained in:
parent
79dc62af61
commit
e1a5f63e1a
5 changed files with 75 additions and 30 deletions
35
Ports/mgba/patches/0001-Remove-use-of-futime-n-s.patch
Normal file
35
Ports/mgba/patches/0001-Remove-use-of-futime-n-s.patch
Normal file
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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);
|
Loading…
Add table
Reference in a new issue