Merge remote-tracking branch 'upstream/master' into feature/machine_z150

This commit is contained in:
Jasmine Iwanek
2022-09-28 00:31:20 -04:00
15 changed files with 57 additions and 60 deletions

View File

@@ -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)

View File

@@ -2050,10 +2050,13 @@ save_general(void)
static void
save_monitor(int monitor_index)
{
char cat[sizeof("Monitor #") + 12] = { [0] = 0 };
char temp[512];
ini_section_t cat;
char name[sizeof("Monitor #") + 12] = { [0] = 0 };
char temp[512];
snprintf(name, sizeof(name), "Monitor #%i", monitor_index + 1);
cat = ini_find_or_create_section(config, name);
snprintf(cat, sizeof(cat), "Monitor #%i", monitor_index + 1);
if (window_remember) {
sprintf(temp, "%i, %i, %i, %i",
monitor_settings[monitor_index].mon_window_x, monitor_settings[monitor_index].mon_window_y,
@@ -2069,6 +2072,8 @@ save_monitor(int monitor_index)
ini_section_delete_var(cat, "window_coordinates");
ini_section_delete_var(cat, "window_maximized");
}
ini_delete_section_if_empty(config, cat);
}
/* Save "Machine" section. */

View File

@@ -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

View File

@@ -1111,12 +1111,10 @@ mo_pre_execution_check(mo_t *dev, uint8_t *cdb)
{
int ready = 0;
if (dev->drv->bus_type == MO_BUS_SCSI) {
if ((cdb[0] != GPCMD_REQUEST_SENSE) && (dev->cur_lun == SCSI_LUN_USE_CDB) && (cdb[1] & 0xe0)) {
mo_log("MO %i: Attempting to execute a unknown command targeted at SCSI LUN %i\n", dev->id, ((dev->request_length >> 5) & 7));
mo_invalid_lun(dev);
return 0;
}
if ((cdb[0] != GPCMD_REQUEST_SENSE) && (dev->cur_lun == SCSI_LUN_USE_CDB) && (cdb[1] & 0xe0)) {
mo_log("MO %i: Attempting to execute a unknown command targeted at SCSI LUN %i\n", dev->id, ((dev->request_length >> 5) & 7));
mo_invalid_lun(dev);
return 0;
}
if (!(mo_command_flags[cdb[0]] & IMPLEMENTED)) {

View File

@@ -1182,12 +1182,10 @@ zip_pre_execution_check(zip_t *dev, uint8_t *cdb)
{
int ready = 0;
if (dev->drv->bus_type == ZIP_BUS_SCSI) {
if ((cdb[0] != GPCMD_REQUEST_SENSE) && (dev->cur_lun == SCSI_LUN_USE_CDB) && (cdb[1] & 0xe0)) {
zip_log("ZIP %i: Attempting to execute a unknown command targeted at SCSI LUN %i\n", dev->id, ((dev->request_length >> 5) & 7));
zip_invalid_lun(dev);
return 0;
}
if ((cdb[0] != GPCMD_REQUEST_SENSE) && (dev->cur_lun == SCSI_LUN_USE_CDB) && (cdb[1] & 0xe0)) {
zip_log("ZIP %i: Attempting to execute a unknown command targeted at SCSI LUN %i\n", dev->id, ((dev->request_length >> 5) & 7));
zip_invalid_lun(dev);
return 0;
}
if (!(zip_command_flags[cdb[0]] & IMPLEMENTED)) {

View File

@@ -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;

View File

@@ -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;

View File

@@ -1152,13 +1152,11 @@ scsi_cdrom_pre_execution_check(scsi_cdrom_t *dev, uint8_t *cdb)
{
int ready = 0;
if (dev->drv->bus_type == CDROM_BUS_SCSI) {
if ((cdb[0] != GPCMD_REQUEST_SENSE) && (dev->cur_lun == SCSI_LUN_USE_CDB) && (cdb[1] & 0xe0)) {
scsi_cdrom_log("CD-ROM %i: Attempting to execute a unknown command targeted at SCSI LUN %i\n",
dev->id, ((dev->request_length >> 5) & 7));
scsi_cdrom_invalid_lun(dev);
return 0;
}
if ((cdb[0] != GPCMD_REQUEST_SENSE) && (dev->cur_lun == SCSI_LUN_USE_CDB) && (cdb[1] & 0xe0)) {
scsi_cdrom_log("CD-ROM %i: Attempting to execute a unknown command targeted at SCSI LUN %i\n",
dev->id, ((dev->request_length >> 5) & 7));
scsi_cdrom_invalid_lun(dev);
return 0;
}
if (!(scsi_cdrom_command_flags[cdb[0]] & IMPLEMENTED)) {

View File

@@ -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)

View File

@@ -208,24 +208,22 @@ 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)
{
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);
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
{
@@ -251,6 +248,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,13 +264,16 @@ static const device_config_t pssj_isa_config[] = {
.description = "0x2C0",
.value = 0x2C0
},
{
.description = "0x2E0",
.value = 0x2E0
},
{ .description = "" }
}
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
};
#endif
const device_t pssj_device = {
.name = "Tandy PSSJ",
@@ -295,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",
@@ -309,4 +316,3 @@ const device_t pssj_isa_device = {
.force_redraw = NULL,
.config = pssj_isa_config
};
#endif

View File

@@ -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
{
@@ -259,6 +257,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,13 +273,16 @@ static const device_config_t tndy_config[] = {
.description = "0x2C0",
.value = 0x2C0
},
{
.description = "0x2E0",
.value = 0x2E0
},
{ .description = "" }
}
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
};
#endif
const device_t sn76489_device = {
.name = "TI SN74689 PSG",
@@ -303,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",
@@ -317,4 +325,3 @@ const device_t tndy_device = {
.force_redraw = NULL,
.config = tndy_config
};
#endif

View File

@@ -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 },

View File

@@ -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);

View File

@@ -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);
}
}

View File

@@ -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