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

This commit is contained in:
Jasmine Iwanek
2023-02-03 01:06:08 -05:00
5 changed files with 168 additions and 67 deletions

View File

@@ -2280,6 +2280,12 @@ fdc_reset(void *priv)
} else if (fdc->flags & FDC_FLAG_SEC) {
fdc->dma = 1;
fdc->specify[1] = 0;
} else if (fdc->flags & FDC_FLAG_TER) {
fdc->dma = 1;
fdc->specify[1] = 0;
} else if (fdc->flags & FDC_FLAG_QUA) {
fdc->dma = 1;
fdc->specify[1] = 0;
} else {
fdc->dma = 1;
fdc->specify[1] = 0;
@@ -2297,6 +2303,10 @@ fdc_reset(void *priv)
fdc_remove(fdc);
if (fdc->flags & FDC_FLAG_SEC) {
fdc_set_base(fdc, FDC_SECONDARY_ADDR);
} else if (fdc->flags & FDC_FLAG_TER) {
fdc_set_base(fdc, FDC_TERTIARY_ADDR);
} else if (fdc->flags & FDC_FLAG_QUA) {
fdc_set_base(fdc, FDC_QUATERNARY_ADDR);
} else {
fdc_set_base(fdc, (fdc->flags & FDC_FLAG_PCJR) ? FDC_PRIMARY_PCJR_ADDR : FDC_PRIMARY_ADDR);
}
@@ -2330,6 +2340,10 @@ fdc_init(const device_t *info)
if (fdc->flags & FDC_FLAG_SEC)
fdc->irq = FDC_SECONDARY_IRQ;
else if (fdc->flags & FDC_FLAG_TER)
fdc->irq = FDC_TERTIARY_IRQ;
else if (fdc->flags & FDC_FLAG_QUA)
fdc->irq = FDC_QUATERNARY_IRQ;
else
fdc->irq = FDC_PRIMARY_IRQ;
@@ -2337,6 +2351,10 @@ fdc_init(const device_t *info)
timer_add(&fdc->watchdog_timer, fdc_watchdog_poll, fdc, 0);
else if (fdc->flags & FDC_FLAG_SEC)
fdc->dma_ch = FDC_SECONDARY_DMA;
else if (fdc->flags & FDC_FLAG_TER)
fdc->dma_ch = FDC_TERTIARY_DMA;
else if (fdc->flags & FDC_FLAG_QUA)
fdc->dma_ch = FDC_QUATERNARY_DMA;
else
fdc->dma_ch = FDC_PRIMARY_DMA;
@@ -2378,7 +2396,7 @@ const device_t fdc_xt_device = {
const device_t fdc_xt_sec_device = {
.name = "PC/XT Floppy Drive Controller (Secondary)",
.internal_name = "fdc_xt",
.internal_name = "fdc_xt_sec",
.flags = FDC_FLAG_SEC,
.local = 0,
.init = fdc_init,
@@ -2390,6 +2408,34 @@ const device_t fdc_xt_sec_device = {
.config = NULL
};
const device_t fdc_xt_ter_device = {
.name = "PC/XT Floppy Drive Controller (Tertiary)",
.internal_name = "fdc_xt_ter",
.flags = FDC_FLAG_TER,
.local = 0,
.init = fdc_init,
.close = fdc_close,
.reset = fdc_reset,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t fdc_xt_qua_device = {
.name = "PC/XT Floppy Drive Controller (Quaternary)",
.internal_name = "fdc_xt_qua",
.flags = FDC_FLAG_QUA,
.local = 0,
.init = fdc_init,
.close = fdc_close,
.reset = fdc_reset,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t fdc_xt_t1x00_device = {
.name = "PC/XT Floppy Drive Controller (Toshiba)",
.internal_name = "fdc_xt_t1x00",
@@ -2474,6 +2520,34 @@ const device_t fdc_at_sec_device = {
.config = NULL
};
const device_t fdc_at_ter_device = {
.name = "PC/AT Floppy Drive Controller (Tertiary)",
.internal_name = "fdc_at_ter",
.flags = 0,
.local = FDC_FLAG_AT | FDC_FLAG_TER,
.init = fdc_init,
.close = fdc_close,
.reset = fdc_reset,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t fdc_at_qua_device = {
.name = "PC/AT Floppy Drive Controller (Quaternary)",
.internal_name = "fdc_at_qua",
.flags = 0,
.local = FDC_FLAG_AT | FDC_FLAG_QUA,
.init = fdc_init,
.close = fdc_close,
.reset = fdc_reset,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t fdc_at_actlow_device = {
.name = "PC/AT Floppy Drive Controller (Active low)",
.internal_name = "fdc_at_actlow",

View File

@@ -39,6 +39,8 @@
typedef struct
{
rom_t bios_rom;
fdc_t *fdc_pri;
fdc_t *fdc_sec;
} monster_fdc_t;
static void
@@ -57,14 +59,29 @@ monster_fdc_init(const device_t *info)
dev = (monster_fdc_t *)malloc(sizeof(monster_fdc_t));
memset(dev, 0, sizeof(monster_fdc_t));
#if 0
uint8_t sec_irq = device_get_config_int("sec_irq");
uint8_t sec_dma = device_get_config_int("sec_dma");
#endif
if (BIOS_ADDR != 0)
rom_init(&dev->bios_rom, ROM_MONSTER_FDC, BIOS_ADDR, 0x2000, 0x1ffff, 0, MEM_MAPPING_EXTERNAL);
// Primary FDC
device_add(&fdc_at_device);
dev->fdc_pri = device_add(&fdc_at_device);
#if 0
// Secondary FDC
// device_add(&fdc_at_sec_device);
uint8_t sec_enabled = device_get_config_int("sec_enabled");
if (sec_enabled)
dev->fdc_sec = device_add(&fdc_at_sec_device);
fdc_set_irq(dev->fdc_sec, sec_irq);
fdc_set_dma_ch(dev->fdc_sec, sec_dma);
#endif
#if 0
uint8_t rom_writes_enabled = device_get_config_int("rom_writes_enabled");
#endif
return dev;
}
@@ -76,7 +93,14 @@ static int monster_fdc_available(void)
static const device_config_t monster_fdc_config[] = {
// clang-format off
/*
#if 0
{
.name = "sec_enabled",
.description = "Enable Secondary Controller",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
},
{
.name = "sec_irq",
.description = "Secondary Controller IRQ",
@@ -137,7 +161,7 @@ static const device_config_t monster_fdc_config[] = {
{ .description = "" }
}
},
*/
#endif
{
.name = "bios_addr",
.description = "BIOS Address:",
@@ -157,7 +181,7 @@ static const device_config_t monster_fdc_config[] = {
{ .description = "" }
}
},
/*
#if 0
{
.name = "bios_size",
.description = "BIOS Size:",
@@ -172,8 +196,14 @@ static const device_config_t monster_fdc_config[] = {
{ .description = "" }
}
},
*/
// BIOS extension ROM writes: Enabled/Disabled
{
.name = "rom_writes_enabled",
.description = "Enable BIOS extension ROM Writes",
.type = CONFIG_BINARY,
.default_string = "",
.default_int = 0
},
#endif
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
};

View File

@@ -53,6 +53,8 @@ extern int fdc_type;
#define FDC_FLAG_UMC 0x400 /* UMC UM8398 */
#define FDC_FLAG_ALI 0x800 /* ALi M512x / M1543C */
#define FDC_FLAG_SEC 0x1000 /* Is Secondary */
#define FDC_FLAG_TER 0x2000 /* Is Tertiary */
#define FDC_FLAG_QUA 0x3000 /* Is Quaternary */
typedef struct {
uint8_t dor, stat, command, processed_cmd, dat, st0, swap, dtl;
@@ -187,12 +189,16 @@ extern uint8_t fdc_get_current_drive(void);
#ifdef EMU_DEVICE_H
extern const device_t fdc_xt_device;
extern const device_t fdc_xt_sec_device;
extern const device_t fdc_xt_ter_device;
extern const device_t fdc_xt_qua_device;
extern const device_t fdc_xt_t1x00_device;
extern const device_t fdc_xt_tandy_device;
extern const device_t fdc_xt_amstrad_device;
extern const device_t fdc_pcjr_device;
extern const device_t fdc_at_device;
extern const device_t fdc_at_sec_device;
extern const device_t fdc_at_ter_device;
extern const device_t fdc_at_qua_device;
extern const device_t fdc_at_actlow_device;
extern const device_t fdc_at_ps1_device;
extern const device_t fdc_at_smc_device;

View File

@@ -1,58 +1,60 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
* This file is part of the 86Box distribution.
*
* Definitions for project version, branding, and external links.
* Definitions for project version, branding, and external links.
*
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2020 Miran Grca.
*
* Authors: Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2020 Miran Grca.
*/
#define _LSTR(s) L ## s
#define LSTR(s) _LSTR(s)
/* Version info. */
#define EMU_NAME "@CMAKE_PROJECT_NAME@"
#define EMU_NAME_W LSTR(EMU_NAME)
#define EMU_NAME "@CMAKE_PROJECT_NAME@"
#define EMU_NAME_W LSTR(EMU_NAME)
#define EMU_VERSION "@CMAKE_PROJECT_VERSION@"
#define EMU_VERSION_W LSTR(EMU_VERSION)
#define EMU_VERSION_EX "3.50" /* frozen due to IDE re-detection behavior on Windows */
#define EMU_VERSION_MAJ @CMAKE_PROJECT_VERSION_MAJOR@
#define EMU_VERSION_MIN @CMAKE_PROJECT_VERSION_MINOR@
#define EMU_VERSION "@CMAKE_PROJECT_VERSION@"
#define EMU_VERSION_W LSTR(EMU_VERSION)
#define EMU_VERSION_EX "3.50" /* frozen due to IDE re-detection behavior on Windows */
#define EMU_VERSION_MAJ @CMAKE_PROJECT_VERSION_MAJOR@
#define EMU_VERSION_MIN @CMAKE_PROJECT_VERSION_MINOR@
#define EMU_VERSION_PATCH @CMAKE_PROJECT_VERSION_PATCH@
#cmakedefine EMU_BUILD "@EMU_BUILD@"
#define EMU_BUILD_NUM @EMU_BUILD_NUM@
#cmakedefine EMU_GIT_HASH "@EMU_GIT_HASH@"
#cmakedefine EMU_BUILD "@EMU_BUILD@"
#define EMU_BUILD_NUM @EMU_BUILD_NUM@
#cmakedefine EMU_GIT_HASH "@EMU_GIT_HASH@"
#ifdef EMU_BUILD
# define EMU_BUILD_W LSTR(EMU_BUILD)
# define EMU_VERSION_FULL EMU_VERSION " [" EMU_BUILD "]"
# define EMU_VERSION_FULL_W EMU_VERSION_W L" [" EMU_BUILD_W L"]"
# define EMU_BUILD_W LSTR(EMU_BUILD)
# define EMU_VERSION_FULL EMU_VERSION " [" EMU_BUILD "]"
# define EMU_VERSION_FULL_W EMU_VERSION_W L" [" EMU_BUILD_W L"]"
#else
# define EMU_VERSION_FULL EMU_VERSION
# define EMU_VERSION_FULL_W EMU_VERSION_W
# define EMU_VERSION_FULL EMU_VERSION
# define EMU_VERSION_FULL_W EMU_VERSION_W
#endif
#ifdef EMU_GIT_HASH
# define EMU_GIT_HASH_W LSTR(EMU_GIT_HASH)
# define EMU_GIT_HASH_W LSTR(EMU_GIT_HASH)
#endif
#define COPYRIGHT_YEAR "@EMU_COPYRIGHT_YEAR@"
#define COPYRIGHT_YEAR "@EMU_COPYRIGHT_YEAR@"
/* Web URL info. */
#define EMU_SITE "86box.net"
#define EMU_SITE_W LSTR(EMU_SITE)
#define EMU_ROMS_URL "https://github.com/86Box/roms/releases/latest"
#define EMU_ROMS_URL_W LSTR(EMU_ROMS_URL)
#define EMU_SITE "86box.net"
#define EMU_SITE_W LSTR(EMU_SITE)
#define EMU_ROMS_URL "https://github.com/86Box/roms/releases/latest"
#define EMU_ROMS_URL_W LSTR(EMU_ROMS_URL)
#ifdef RELEASE_BUILD
# define EMU_DOCS_URL "https://86box.readthedocs.io/en/v@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@/"
# define EMU_DOCS_URL "https://86box.readthedocs.io/en/v@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@/"
#else
# define EMU_DOCS_URL "https://86box.readthedocs.io"
# define EMU_DOCS_URL "https://86box.readthedocs.io"
#endif
#define EMU_DOCS_URL_W LSTR(EMU_DOCS_URL)
#define EMU_DOCS_URL_W LSTR(EMU_DOCS_URL)

View File

@@ -240,44 +240,33 @@ VPATH := $(EXPATH) . $(CODEGEN) minitrace cpu \
sound/munt/srchelper sound/munt/srchelper/srctools/src \
sound/resid-fp sound/ymfm \
scsi video network network/slirp win
WINDRES := windres
STRIP := strip
ifeq ($(X64), y)
TOOL_PREFIX := x86_64-w64-mingw32-
else
TOOL_PREFIX := i686-w64-mingw32-
endif
WINDRES := windres
STRIP := strip
ifeq ($(ARM64), y)
WINDRES := aarch64-w64-mingw32-windres
STRIP := aarch64-w64-mingw32-strip
endif
ifeq ($(ARM), y)
WINDRES := armv7-w64-mingw32-windres
STRIP := armv7-w64-mingw32-strip
endif
ifeq ($(CLANG), y)
CPP := clang++
CC := clang
ifeq ($(ARM64), y)
CPP := aarch64-w64-mingw32-clang++
CC := aarch64-w64-mingw32-clang
TOOL_PREFIX := aarch64-w64-mingw32-
WINDRES := ${TOOL_PREFIX}windres
STRIP := ${TOOL_PREFIX}strip
endif
ifeq ($(ARM), y)
CPP := armv7-w64-mingw32-clang++
CC := armv7-w64-mingw32-clang
TOOL_PREFIX := armv7-w64-mingw32-
WINDRES := ${TOOL_PREFIX}windres
STRIP := ${TOOL_PREFIX}strip
endif
TOOL_PREFIX := i686-w64-mingw32-
endif
ifeq ($(CLANG), y)
CPP := ${TOOL_PREFIX}clang++
CC := ${TOOL_PREFIX}clang
else
CPP := ${TOOL_PREFIX}g++
CC := ${TOOL_PREFIX}gcc
ifeq ($(ARM64), y)
CPP := aarch64-w64-mingw32-g++
CC := aarch64-w64-mingw32-gcc
endif
ifeq ($(ARM), y)
CPP := armv7-w64-mingw32-g++
CC := armv7-w64-mingw32-gcc
endif
endif
DEPS = -MMD -MF $*.d -c $<
DEPFILE := win/.depends