summaryrefslogtreecommitdiff
path: root/Ports/nesalizer
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-12-07 16:33:08 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-12-07 16:54:04 +0100
commitc399abe3e20091b5d0573069ecbc9b9429ede7a8 (patch)
treed23eea36f6e1df2c93f9aeab54e5af70f6221344 /Ports/nesalizer
parent1670ee5aba09e240580b68a727dc328880e8df13 (diff)
downloadserenity-c399abe3e20091b5d0573069ecbc9b9429ede7a8.zip
Ports: Make nesalizer build and run (still no sound)
The "nesalizer" emulator can now play NES games on Serenity. :^)
Diffstat (limited to 'Ports/nesalizer')
-rw-r--r--Ports/nesalizer/patches/Makefile-fix.patch2
-rw-r--r--Ports/nesalizer/patches/no-sound.patch35
2 files changed, 36 insertions, 1 deletions
diff --git a/Ports/nesalizer/patches/Makefile-fix.patch b/Ports/nesalizer/patches/Makefile-fix.patch
index c492b1d0e2..ba1e80b0a3 100644
--- a/Ports/nesalizer/patches/Makefile-fix.patch
+++ b/Ports/nesalizer/patches/Makefile-fix.patch
@@ -5,7 +5,7 @@
deps = $(addprefix $(BUILD_DIR)/,$(c_sources:=.d) $(cpp_sources:=.d))
-LDLIBS := $(shell sdl2-config --libs) -lrt
-+LDLIBS := -L../../SDL2/SDL-master-serenity -lSDL2 -lgui -lcore -ldraw
++LDLIBS := -lSDL2 -lgui -lipc -ldraw -lcore -lpthread
ifeq ($(INCLUDE_DEBUGGER),1)
LDLIBS += -lreadline
diff --git a/Ports/nesalizer/patches/no-sound.patch b/Ports/nesalizer/patches/no-sound.patch
new file mode 100644
index 0000000000..815bef0f2b
--- /dev/null
+++ b/Ports/nesalizer/patches/no-sound.patch
@@ -0,0 +1,35 @@
+diff -ru nesalizer-master/src/audio.cpp nesalizer-master-nosound/src/audio.cpp
+--- nesalizer-master/src/audio.cpp 2016-09-18 11:02:04.000000000 +0200
++++ nesalizer-master-nosound/src/audio.cpp 2019-12-07 16:32:11.814936331 +0100
+@@ -190,6 +190,8 @@
+ }
+
+ void end_audio_frame() {
++ return;
++
+ if (frame_offset == 0)
+ // No audio added; blip_end_frame() dislikes being called with an
+ // offset of 0
+diff -ru nesalizer-master/src/sdl_backend.cpp nesalizer-master-nosound/src/sdl_backend.cpp
+--- nesalizer-master/src/sdl_backend.cpp 2016-09-18 11:02:04.000000000 +0200
++++ nesalizer-master-nosound/src/sdl_backend.cpp 2019-12-07 16:31:58.158302177 +0100
+@@ -192,7 +192,7 @@
+ // Make this configurable later
+ SDL_DisableScreenSaver();
+
+- fail_if(SDL_Init(SDL_INIT_AUDIO | SDL_INIT_VIDEO) != 0,
++ fail_if(SDL_Init(SDL_INIT_VIDEO) != 0,
+ "failed to initialize SDL: %s", SDL_GetError());
+
+ fail_if(!(screen =
+@@ -252,8 +252,10 @@
+ want.samples = sdl_audio_buffer_size;
+ want.callback = audio_callback;
+
++#if 0
+ fail_if(!(audio_device_id = SDL_OpenAudioDevice(0, 0, &want, 0, 0)),
+ "failed to initialize audio: %s\n", SDL_GetError());
++#endif
+
+ // Input
+