Merge remote-tracking branch 'origin/master' into feature/machine_and_kb

This commit is contained in:
OBattler
2021-10-19 18:21:36 +02:00
4 changed files with 46 additions and 4 deletions

View File

@@ -82,7 +82,11 @@ if(MINGW)
elseif(WIN32) elseif(WIN32)
target_link_libraries(86Box SDL2::SDL2) target_link_libraries(86Box SDL2::SDL2)
else() 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() endif()
find_package(PNG REQUIRED) find_package(PNG REQUIRED)

View File

@@ -859,8 +859,8 @@ machine_pcjr_init(const machine_t *model)
keyboard_set_table(scancode_xt); keyboard_set_table(scancode_xt);
keyboard_send = kbd_adddata_ex; keyboard_send = kbd_adddata_ex;
/* Technically it's the SN76496N, but the NCR 8496 is a drop-in replacement for it. */ /* Technically it's the SN76496N, but the SN76489 is identical to the SN76496N. */
device_add(&ncr8496_device); device_add(&sn76489_device);
nmi_mask = 0x80; nmi_mask = 0x80;

View File

@@ -201,6 +201,20 @@ void *pssj_init(const device_t *info)
return pssj; 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) void pssj_close(void *p)
{ {
pssj_t *pssj = (pssj_t *)p; pssj_t *pssj = (pssj_t *)p;
@@ -219,3 +233,15 @@ const device_t pssj_device =
NULL, NULL,
NULL NULL
}; };
const device_t pssj_1e0_device =
{
"Tandy PSSJ (port 1e0h)",
0, 0,
pssj_1e0_init,
pssj_close,
NULL,
{ NULL },
NULL,
NULL
};

View File

@@ -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) add_library(ui STATIC unix.c unix_sdl.c unix_cdrom.c)
target_compile_definitions(ui PUBLIC _FILE_OFFSET_BITS=64) target_compile_definitions(ui PUBLIC _FILE_OFFSET_BITS=64)
target_link_libraries(ui dl) 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) if (ALSA_FOUND)
target_link_libraries(plat ALSA::ALSA) target_link_libraries(plat ALSA::ALSA)
endif() endif()
set(THREADS_PREFER_PTHREAD_FLAG TRUE) set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
target_link_libraries(86Box Threads::Threads) target_link_libraries(86Box Threads::Threads)