From a041469ff8b2fd302d49815e6cbb1600848e51d1 Mon Sep 17 00:00:00 2001 From: Ompronce <88358700+Ompronce@users.noreply.github.com> Date: Sun, 17 Oct 2021 23:37:10 -0400 Subject: [PATCH 1/3] Added alternate Tandy PSSJ I/O port at 1E0h (used in Tandy 1000 RSX) --- src/sound/snd_pssj.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/sound/snd_pssj.c b/src/sound/snd_pssj.c index bdf013e2e..4eab5c856 100644 --- a/src/sound/snd_pssj.c +++ b/src/sound/snd_pssj.c @@ -201,6 +201,20 @@ void *pssj_init(const device_t *info) return pssj; } +void *pssj_1e0_init(const device_t *info) +{ + pssj_t *pssj = malloc(sizeof(pssj_t)); + memset(pssj, 0, sizeof(pssj_t)); + + sn76489_init(&pssj->sn76489, 0x01e0, 0x0004, PSSJ, 3579545); + + io_sethandler(0x01E4, 0x0004, pssj_read, NULL, NULL, pssj_write, NULL, NULL, pssj); + timer_add(&pssj->timer_count, pssj_callback, pssj, pssj->enable); + sound_add_handler(pssj_get_buffer, pssj); + + return pssj; +} + void pssj_close(void *p) { pssj_t *pssj = (pssj_t *)p; @@ -219,3 +233,15 @@ const device_t pssj_device = NULL, NULL }; + +const device_t pssj_1e0_device = +{ + "Tandy PSSJ (port 1e0h)", + 0, 0, + pssj_1e0_init, + pssj_close, + NULL, + { NULL }, + NULL, + NULL +}; From 549a477d19c92aa71c560066181f490181293b52 Mon Sep 17 00:00:00 2001 From: Ompronce <88358700+Ompronce@users.noreply.github.com> Date: Mon, 18 Oct 2021 00:32:21 -0400 Subject: [PATCH 2/3] Restored SN76489 back to IBM PCjr, as SN76496 and SN76489 are identical. --- src/machine/m_pcjr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/machine/m_pcjr.c b/src/machine/m_pcjr.c index c54c7f0c7..35ddfe6da 100644 --- a/src/machine/m_pcjr.c +++ b/src/machine/m_pcjr.c @@ -859,8 +859,8 @@ machine_pcjr_init(const machine_t *model) keyboard_set_table(scancode_xt); keyboard_send = kbd_adddata_ex; - /* Technically it's the SN76496N, but the NCR 8496 is a drop-in replacement for it. */ - device_add(&ncr8496_device); + /* Technically it's the SN76496N, but the SN76489 is identical to the SN76496N. */ + device_add(&sn76489_device); nmi_mask = 0x80; From 6dd744141c857e574d68db6841a5a7eb27bb797d Mon Sep 17 00:00:00 2001 From: "Andreas J. Reichel" Date: Sun, 17 Oct 2021 21:17:57 +0200 Subject: [PATCH 3/3] Make it build in arch linux and Debian * Probably unresolved external due to newer gcc, thus added libsdl to libui.a as well. * Make it work for all distros, which either have SDL2::SDL2 or ${SDL2_LIBRARIES}, provided by sdl2-config or FindSDL2.cmake. Signed-off-by: Andreas J. Reichel --- src/CMakeLists.txt | 6 +++++- src/unix/CMakeLists.txt | 14 +++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 47cb558db..49025d4dd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -82,7 +82,11 @@ if(MINGW) elseif(WIN32) target_link_libraries(86Box SDL2::SDL2) else() - target_link_libraries(86Box ${SDL2_LIBRARIES}) + if (TARGET SDL2::SDL2) + target_link_libraries(86Box SDL2::SDL2) + else() + target_link_libraries(86Box ${SDL2_LIBRARIES}) + endif() endif() find_package(PNG REQUIRED) diff --git a/src/unix/CMakeLists.txt b/src/unix/CMakeLists.txt index d0524e38b..e21265370 100644 --- a/src/unix/CMakeLists.txt +++ b/src/unix/CMakeLists.txt @@ -12,10 +12,22 @@ add_library(plat STATIC ${PLAT_SOURCES} unix_thread.c) add_library(ui STATIC unix.c unix_sdl.c unix_cdrom.c) target_compile_definitions(ui PUBLIC _FILE_OFFSET_BITS=64) target_link_libraries(ui dl) + +find_package(SDL2 REQUIRED) +include_directories(${SDL2_INCLUDE_DIRS}) +if(MINGW) + target_link_libraries(ui SDL2::SDL2-static) +else() + if (TARGET SDL2::SDL2) + target_link_libraries(ui SDL2::SDL2) + else() + target_link_libraries(ui ${SDL2_LIBRARIES}) + endif() +endif() if (ALSA_FOUND) target_link_libraries(plat ALSA::ALSA) endif() set(THREADS_PREFER_PTHREAD_FLAG TRUE) find_package(Threads REQUIRED) -target_link_libraries(86Box Threads::Threads) \ No newline at end of file +target_link_libraries(86Box Threads::Threads)