From a6d5ff565b9ac3da082043b1af49da9931971d12 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Wed, 21 Sep 2022 18:12:05 -0400 Subject: [PATCH 1/5] Fix bug in PSSJ ISA clone --- src/sound/snd_pssj.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sound/snd_pssj.c b/src/sound/snd_pssj.c index e467f3238..4681d2f84 100644 --- a/src/sound/snd_pssj.c +++ b/src/sound/snd_pssj.c @@ -215,11 +215,11 @@ pssj_isa_init(const device_t *info) pssj_t *pssj = malloc(sizeof(pssj_t)); memset(pssj, 0, sizeof(pssj_t)); - sn76489_init(&pssj->sn76489, 0x00c0, 0x0004, PSSJ, 3579545); - uint16_t addr = device_get_config_hex16("base"); - io_sethandler(addr, 0x0004, pssj_read, NULL, NULL, pssj_write, NULL, NULL, pssj); + sn76489_init(&pssj->sn76489, addr, 0x0004, PSSJ, 3579545); + + io_sethandler(addr + 0x04, 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); From 436e8a20fedbb9f6dad86bad39611a82f213ba4d Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Wed, 21 Sep 2022 18:13:12 -0400 Subject: [PATCH 2/5] Add alternate addresses to PSSJ ISA clone --- src/sound/snd_pssj.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/sound/snd_pssj.c b/src/sound/snd_pssj.c index 4681d2f84..1c91a0231 100644 --- a/src/sound/snd_pssj.c +++ b/src/sound/snd_pssj.c @@ -251,6 +251,14 @@ static const device_config_t pssj_isa_config[] = { .description = "0x0C0", .value = 0x0C0 }, + { + .description = "0x0E0", + .value = 0x0E0 + }, + { + .description = "0x1C0", + .value = 0x1C0 + }, { .description = "0x1E0", .value = 0x1E0 @@ -259,6 +267,10 @@ static const device_config_t pssj_isa_config[] = { .description = "0x2C0", .value = 0x2C0 }, + { + .description = "0x2E0", + .value = 0x2E0 + }, { .description = "" } } }, From 09f8388a4391d65a42cfac7d4c1ea902be1af7e7 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Wed, 21 Sep 2022 18:13:39 -0400 Subject: [PATCH 3/5] Add alternate addreses to TNDY/PSG clone --- src/sound/snd_sn76489.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/sound/snd_sn76489.c b/src/sound/snd_sn76489.c index d63b34af6..6b799a88a 100644 --- a/src/sound/snd_sn76489.c +++ b/src/sound/snd_sn76489.c @@ -259,6 +259,14 @@ static const device_config_t tndy_config[] = { .description = "0x0C0", .value = 0x0C0 }, + { + .description = "0x0E0", + .value = 0x0E0 + }, + { + .description = "0x1C0", + .value = 0x1C0 + }, { .description = "0x1E0", .value = 0x1E0 @@ -267,6 +275,10 @@ static const device_config_t tndy_config[] = { .description = "0x2C0", .value = 0x2C0 }, + { + .description = "0x2E0", + .value = 0x2E0 + }, { .description = "" } } }, From 28ae786d62ad5ec014873c4edafb237807e22b0b Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Wed, 21 Sep 2022 18:14:17 -0400 Subject: [PATCH 4/5] PSG/PSSJ out of dev branch --- CMakeLists.txt | 1 - src/include/86box/sound.h | 4 ++-- src/sound/CMakeLists.txt | 4 ---- src/sound/snd_pssj.c | 6 ------ src/sound/snd_sn76489.c | 7 +------ src/sound/sound.c | 2 -- src/win/Makefile.mingw | 10 ---------- 7 files changed, 3 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e49ac784..caa4aaa90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -158,7 +158,6 @@ cmake_dependent_option(OLIVETTI "Olivetti M290" cmake_dependent_option(OPEN_AT "OpenAT" ON "DEV_BRANCH" OFF) cmake_dependent_option(PAS16 "Pro Audio Spectrum 16" ON "DEV_BRANCH" OFF) cmake_dependent_option(SIO_DETECT "Super I/O Detection Helper" ON "DEV_BRANCH" OFF) -cmake_dependent_option(TANDY_ISA "Tandy PSG ISA clone boards" ON "DEV_BRANCH" OFF) cmake_dependent_option(VGAWONDER "ATI VGA Wonder (ATI-18800)" ON "DEV_BRANCH" OFF) cmake_dependent_option(XL24 "ATI VGA Wonder XL24 (ATI-28800-6)" ON "DEV_BRANCH" OFF) diff --git a/src/include/86box/sound.h b/src/include/86box/sound.h index 71d4942d0..9d4ddff06 100644 --- a/src/include/86box/sound.h +++ b/src/include/86box/sound.h @@ -102,10 +102,10 @@ extern const device_t ps1snd_device; /* Tandy PSSJ */ extern const device_t pssj_device; -# if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) extern const device_t pssj_isa_device; + +/* Tandy PSG */ extern const device_t tndy_device; -# endif /* Creative Labs Sound Blaster */ extern const device_t sb_1_device; diff --git a/src/sound/CMakeLists.txt b/src/sound/CMakeLists.txt index 581f8d517..3f646a55f 100644 --- a/src/sound/CMakeLists.txt +++ b/src/sound/CMakeLists.txt @@ -117,9 +117,5 @@ if(GUSMAX) target_compile_definitions(snd PRIVATE USE_GUSMAX) endif() -if(TANDY_ISA) - target_compile_definitions(snd PRIVATE USE_TANDY_ISA) -endif() - add_subdirectory(resid-fp) target_link_libraries(86Box resid-fp) diff --git a/src/sound/snd_pssj.c b/src/sound/snd_pssj.c index 1c91a0231..80ef93e05 100644 --- a/src/sound/snd_pssj.c +++ b/src/sound/snd_pssj.c @@ -208,7 +208,6 @@ pssj_1e0_init(const device_t *info) return pssj; } -#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) void * pssj_isa_init(const device_t *info) { @@ -225,7 +224,6 @@ pssj_isa_init(const device_t *info) return pssj; } -#endif void pssj_close(void *p) @@ -235,7 +233,6 @@ pssj_close(void *p) free(pssj); } -#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) static const device_config_t pssj_isa_config[] = { // clang-format off { @@ -277,7 +274,6 @@ static const device_config_t pssj_isa_config[] = { { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; -#endif const device_t pssj_device = { .name = "Tandy PSSJ", @@ -307,7 +303,6 @@ const device_t pssj_1e0_device = { .config = NULL }; -#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) const device_t pssj_isa_device = { .name = "Tandy PSSJ Clone", .internal_name = "pssj_isa", @@ -321,4 +316,3 @@ const device_t pssj_isa_device = { .force_redraw = NULL, .config = pssj_isa_config }; -#endif diff --git a/src/sound/snd_sn76489.c b/src/sound/snd_sn76489.c index 6b799a88a..a29405429 100644 --- a/src/sound/snd_sn76489.c +++ b/src/sound/snd_sn76489.c @@ -209,6 +209,7 @@ sn76489_device_init(const device_t *info) return sn76489; } + void * ncr8496_device_init(const device_t *info) { @@ -220,7 +221,6 @@ ncr8496_device_init(const device_t *info) return sn76489; } -#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) void * tndy_device_init(const device_t *info) { @@ -233,7 +233,6 @@ tndy_device_init(const device_t *info) return sn76489; } -#endif void sn76489_device_close(void *p) @@ -243,7 +242,6 @@ sn76489_device_close(void *p) free(sn76489); } -#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) static const device_config_t tndy_config[] = { // clang-format off { @@ -285,7 +283,6 @@ static const device_config_t tndy_config[] = { { .name = "", .description = "", .type = CONFIG_END } // clang-format on }; -#endif const device_t sn76489_device = { .name = "TI SN74689 PSG", @@ -315,7 +312,6 @@ const device_t ncr8496_device = { .config = NULL }; -#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) const device_t tndy_device = { .name = "TNDY", .internal_name = "tndy", @@ -329,4 +325,3 @@ const device_t tndy_device = { .force_redraw = NULL, .config = tndy_config }; -#endif diff --git a/src/sound/sound.c b/src/sound/sound.c index 604dac38f..6d5e56cc0 100644 --- a/src/sound/sound.c +++ b/src/sound/sound.c @@ -131,10 +131,8 @@ static const SOUND_CARD sound_cards[] = { #if defined(DEV_BRANCH) && defined(USE_PAS16) { &pas16_device }, #endif -#if defined(DEV_BRANCH) && defined(USE_TANDY_ISA) { &pssj_isa_device }, { &tndy_device }, -#endif { &wss_device }, { &adlib_mca_device }, { &ncr_business_audio_device }, diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index cdc59e485..b1c298970 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -79,9 +79,6 @@ ifeq ($(DEV_BUILD), y) ifndef SIO_DETECT SIO_DETECT := y endif - ifndef TANDY_ISA - TANDY_ISA := y - endif ifndef VGAWONDER VGAWONDER := y endif @@ -143,9 +140,6 @@ else ifndef SIO_DETECT SIO_DETECT := n endif - ifndef TANDY_ISA - TANDY_ISA := n - endif ifndef VGAWONDER VGAWONDER := n endif @@ -495,10 +489,6 @@ OPTS += -DUSE_SIO_DETECT DEVBROBJ += sio_detect.o endif -ifeq ($(TANDY_ISA), y) -OPTS += -DUSE_TANDY_ISA -endif - ifeq ($(VGAWONDER), y) OPTS += -DUSE_VGAWONDER endif From ece9f7ec72a4a20f799ee00a8fb75b8553ccff63 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Wed, 21 Sep 2022 18:53:41 -0400 Subject: [PATCH 5/5] Fix some compile warns while I'm at it --- src/cpu/386.c | 2 ++ src/ini.c | 2 +- src/video/vid_xga.c | 2 +- src/video/video.c | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/cpu/386.c b/src/cpu/386.c index 662850318..48c45d342 100644 --- a/src/cpu/386.c +++ b/src/cpu/386.c @@ -69,6 +69,7 @@ x386_log(const char *fmt, ...) #include "x86_flags.h" +/* #define getbytef() \ ((uint8_t) (fetchdat)); \ cpu_state.pc++ @@ -81,6 +82,7 @@ x386_log(const char *fmt, ...) #define getword2f() \ ((uint16_t) (fetchdat >> 8)); \ cpu_state.pc += 2 +*/ #define OP_TABLE(name) ops_##name diff --git a/src/ini.c b/src/ini.c index b3c7295cb..923d50ca9 100644 --- a/src/ini.c +++ b/src/ini.c @@ -275,7 +275,7 @@ ini_detect_bom(char *fn) #endif if (f == NULL) return (0); - fread(bom, 1, 3, f); + (void) !fread(bom, 1, 3, f); if (bom[0] == 0xEF && bom[1] == 0xBB && bom[2] == 0xBF) { fclose(f); return 1; diff --git a/src/video/vid_xga.c b/src/video/vid_xga.c index b83d6467d..cbec48739 100644 --- a/src/video/vid_xga.c +++ b/src/video/vid_xga.c @@ -2688,7 +2688,7 @@ static void rom = malloc(xga->bios_rom.sz); memset(rom, 0xff, xga->bios_rom.sz); - (void) fread(rom, xga->bios_rom.sz, 1, f); + (void) !fread(rom, xga->bios_rom.sz, 1, f); temp -= xga->bios_rom.sz; (void) fclose(f); diff --git a/src/video/video.c b/src/video/video.c index 2dfe48ab9..eb4997574 100644 --- a/src/video/video.c +++ b/src/video/video.c @@ -996,9 +996,9 @@ loadfont_common(FILE *f, int format) for (d = 0; d < 4; d++) { /* There are 4 fonts in the ROM */ for (c = 0; c < 256; c++) /* 8x14 MDA in 8x16 cell */ - fread(&fontdatm[256 * d + c][0], 1, 16, f); + (void) !fread(&fontdatm[256 * d + c][0], 1, 16, f); for (c = 0; c < 256; c++) { /* 8x8 CGA in 8x16 cell */ - fread(&fontdat[256 * d + c][0], 1, 8, f); + (void) !fread(&fontdat[256 * d + c][0], 1, 8, f); fseek(f, 8, SEEK_CUR); } }