Skip to content

Commit

Permalink
Merge branch '86Box:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
1ahmadbassam authored Mar 18, 2024
2 parents 092b238 + 11b645d commit a51aefc
Show file tree
Hide file tree
Showing 67 changed files with 1,131 additions and 240 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/codeql_windows_msys2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ jobs:
new: on
slug: -NDR
ui:
- name: Win32 GUI
qt: off
static: on
- name: Qt GUI
qt: on
static: off
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ option(RTMIDI "RtMidi"
option(FLUIDSYNTH "FluidSynth" ON)
option(MUNT "MUNT" ON)
option(VNC "VNC renderer" OFF)
option(DINPUT "DirectInput" OFF)
option(CPPTHREADS "C++11 threads" ON)
option(NEW_DYNAREC "Use the PCem v15 (\"new\") dynamic recompiler" OFF)
option(MINITRACE "Enable Chrome tracing using the modified minitrace library" OFF)
Expand Down
4 changes: 4 additions & 0 deletions src/86box.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ int gfxcard[2] = { 0, 0 }; /* (C) graphic
int show_second_monitors = 1; /* (C) show non-primary monitors */
int sound_is_float = 1; /* (C) sound uses FP values */
int voodoo_enabled = 0; /* (C) video option */
int lba_enhancer_enabled = 0; /* (C) enable Vision Systems LBA Enhancer */
int ibm8514_standalone_enabled = 0; /* (C) video option */
int xga_standalone_enabled = 0; /* (C) video option */
uint32_t mem_size = 0; /* (C) memory size (Installed on
Expand Down Expand Up @@ -1233,6 +1234,9 @@ pc_reset_hard_init(void)
device_add(&postcard_device);
if (unittester_enabled)
device_add(&unittester_device);

if (lba_enhancer_enabled)
device_add(&lba_enhancer_device);

if (IS_ARCH(machine, MACHINE_BUS_PCI)) {
pci_register_cards();
Expand Down
3 changes: 3 additions & 0 deletions src/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,9 @@ acpi_reg_write_sis_5595(int size, uint16_t addr, uint8_t val, void *priv)
break;
case 0x1c:
dev->regs.gpe_pin = ((dev->regs.gpe_pin & ~(0xff << shift32)) | ((val & 0xff) << shift32));
if (!strcmp(machine_get_internal_name(), "m747") && (val & 0x10) &&
!(dev->regs.gpe_io & 0x00000010))
resetx86();
break;
case 0x1d:
dev->regs.gpe_pin = ((dev->regs.gpe_pin & ~(0x0f << shift32)) | ((val & 0x0f) << shift32));
Expand Down
32 changes: 30 additions & 2 deletions src/chipset/sis_5513_p2i.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ typedef struct sis_5513_pci_to_isa_t {
port_92_t *port_92;
void *pit;
nvr_t *nvr;
char *fn;
ddma_t *ddma;
acpi_t *acpi;
void *smbus;
Expand Down Expand Up @@ -1077,7 +1078,6 @@ sis_5513_11_pci_to_isa_reset(sis_5513_pci_to_isa_t *dev)
dev->sis->ide_bits_1_3_writable = 0;
dev->sis->usb_enabled = 0;

sis_5513_apc_reset(dev);
sis_5513_apc_recalc(dev, 0);
}

Expand Down Expand Up @@ -1132,7 +1132,6 @@ sis_5513_b0_pci_to_isa_reset(sis_5513_pci_to_isa_t *dev)

dev->sis->usb_enabled = 0;

sis_5513_apc_reset(dev);
sis_5513_apc_recalc(dev, 0);

if (dev->rev == 0x81)
Expand Down Expand Up @@ -1196,6 +1195,17 @@ static void
sis_5513_pci_to_isa_close(void *priv)
{
sis_5513_pci_to_isa_t *dev = (sis_5513_pci_to_isa_t *) priv;
FILE *fp = NULL;

fp = nvr_fopen(dev->fn, "wb");

if (fp != NULL) {
(void) fwrite(dev->apc_regs, 256, 1, fp);
fclose(fp);
}

if (dev->fn != NULL)
free(dev->fn);

free(dev);
}
Expand All @@ -1205,6 +1215,8 @@ sis_5513_pci_to_isa_init(UNUSED(const device_t *info))
{
sis_5513_pci_to_isa_t *dev = (sis_5513_pci_to_isa_t *) calloc(1, sizeof(sis_5513_pci_to_isa_t));
uint8_t pit_is_fast = (((pit_mode == -1) && is486) || (pit_mode == 1));
FILE *fp = NULL;
int c;

dev->rev = info->local;

Expand Down Expand Up @@ -1272,6 +1284,22 @@ sis_5513_pci_to_isa_init(UNUSED(const device_t *info))
dev->sis->acpi->priv = dev->sis;
acpi_set_slot(dev->sis->acpi, dev->sis->sb_pci_slot);
acpi_set_nvr(dev->sis->acpi, dev->nvr);

/* Set up the NVR file's name. */
c = strlen(machine_get_internal_name()) + 9;
dev->fn = (char *) malloc(c + 1);
sprintf(dev->fn, "%s_apc.nvr", machine_get_internal_name());

fp = nvr_fopen(dev->fn, "rb");

memset(dev->apc_regs, 0x00, sizeof(dev->apc_regs));
sis_5513_apc_reset(dev);
if (fp != NULL) {
if (fread(dev->apc_regs, 1, 256, fp) != 256)
fatal("sis_5513_pci_to_isa_init(): Error reading APC data\n");
fclose(fp);
}

acpi_set_irq_mode(dev->sis->acpi, 2);
break;
}
Expand Down
3 changes: 2 additions & 1 deletion src/codegen/codegen_ops_fpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,10 @@ ropFCHS(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeb
ropFLD##name(uint8_t opcode, uint32_t fetchdat, uint32_t op_32, uint32_t op_pc, codeblock_t *block) \
{ \
static double fp_imm = v; \
static uint64_t *fptr = (uint64_t *) &fp_imm; \
\
FP_ENTER(); \
FP_LOAD_IMM_Q(*(uint64_t *) &fp_imm); \
FP_LOAD_IMM_Q(*fptr); \
\
return op_pc; \
}
Expand Down
7 changes: 7 additions & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,8 @@ load_storage_controllers(void)
path_normalize(cart_fns[c]);
}
}

lba_enhancer_enabled = !!ini_section_get_int(cat, "lba_enhancer_enabled", 0);
}

/* Load "Hard Disks" section. */
Expand Down Expand Up @@ -2344,6 +2346,11 @@ save_storage_controllers(void)
else
ini_section_set_string(cat, temp, cart_fns[c]);
}

if (lba_enhancer_enabled == 0)
ini_section_delete_var(cat, "lba_enhancer_enabled");
else
ini_section_set_int(cat, "lba_enhancer_enabled", 1);
}

/* Save "Other Peripherals" section. */
Expand Down
107 changes: 107 additions & 0 deletions src/device/isamem.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
#define ISAMEM_RAMPAGEXT_CARD 11
#define ISAMEM_ABOVEBOARD_CARD 12
#define ISAMEM_BRAT_CARD 13
#define ISAMEM_EV165A_CARD 14

#define ISAMEM_DEBUG 0

Expand Down Expand Up @@ -452,6 +453,16 @@ isamem_init(const device_t *info)
dev->frame_addr = 0xE0000;
break;

case ISAMEM_EV165A_CARD: /* Everex Maxi Magic EV-165A */
dev->base_addr = device_get_config_hex16("base");
dev->total_size = device_get_config_int("size");
dev->start_addr = device_get_config_int("start");
tot = device_get_config_int("length");
if (!!device_get_config_int("ems"))
dev->flags |= FLAG_EMS;
dev->frame_addr = 0xE0000;
break;

case ISAMEM_RAMPAGEXT_CARD: /* AST RAMpage/XT */
case ISAMEM_ABOVEBOARD_CARD: /* Intel AboveBoard */
case ISAMEM_BRAT_CARD: /* BocaRAM/AT */
Expand Down Expand Up @@ -1238,6 +1249,101 @@ static const device_t ev159_device = {
.config = ev159_config
};

static const device_config_t ev165a_config[] = {
// clang-format off
{
.name = "size",
.description = "Memory Size",
.type = CONFIG_SPINNER,
.default_string = "",
.default_int = 512,
.file_filter = "",
.spinner = {
.min = 0,
.max = 2048,
.step = 512
},
.selection = { { 0 } }
},
{
.name = "start",
.description = "Start Address",
.type = CONFIG_SPINNER,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = {
.min = 0,
.max = 896,
.step = 128
},
.selection = { { 0 } }
},
{
.name = "length",
.description = "Contiguous Size",
.type = CONFIG_SPINNER,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = {
.min = 0,
.max = 16384,
.step = 128
},
.selection = { { 0 } }
},
{
.name = "ems",
.description = "EMS mode",
.type = CONFIG_SELECTION,
.default_string = "",
.default_int = 0,
.file_filter = "",
.spinner = { 0 },
.selection = {
{ .description = "Disabled", .value = 0 },
{ .description = "Enabled", .value = 1 },
{ .description = "" }
},
},
{
.name = "base",
.description = "Address",
.type = CONFIG_HEX16,
.default_string = "",
.default_int = 0x0258,
.file_filter = "",
.spinner = { 0 },
.selection = {
{ .description = "208H", .value = 0x0208 },
{ .description = "218H", .value = 0x0218 },
{ .description = "258H", .value = 0x0258 },
{ .description = "268H", .value = 0x0268 },
{ .description = "2A8H", .value = 0x02A8 },
{ .description = "2B8H", .value = 0x02B8 },
{ .description = "2E8H", .value = 0x02E8 },
{ .description = "" }
},
},
{ .name = "", .description = "", .type = CONFIG_END }
// clang-format on
};

static const device_t ev165a_device = {
.name = "Everex Magi Magic EV-165A",
.internal_name = "ev165a",
.flags = DEVICE_ISA,
.local = ISAMEM_EV165A_CARD,
.init = isamem_init,
.close = isamem_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = ev165a_config
};

#if defined(DEV_BRANCH) && defined(USE_ISAMEM_BRAT)
static const device_config_t brat_config[] = {
// clang-format off
Expand Down Expand Up @@ -1560,6 +1666,7 @@ static const struct {
{ &a6pak_device },
{ &ems5150_device },
{ &ev159_device },
{ &ev165a_device },
#if defined(DEV_BRANCH) && defined(USE_ISAMEM_BRAT)
{ &brat_device },
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/disk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
add_library(hdd OBJECT hdd.c hdd_image.c hdd_table.c hdc.c hdc_st506_xt.c
hdc_st506_at.c hdc_xta.c hdc_esdi_at.c hdc_esdi_mca.c hdc_xtide.c
hdc_ide.c hdc_ide_ali5213.c hdc_ide_opti611.c hdc_ide_cmd640.c hdc_ide_cmd646.c
hdc_ide_sff8038i.c hdc_ide_um8673f.c hdc_ide_w83769f.c)
hdc_ide_sff8038i.c hdc_ide_um8673f.c hdc_ide_w83769f.c lba_enhancer.c)

add_library(zip OBJECT zip.c)

Expand Down
Loading

0 comments on commit a51aefc

Please sign in to comment.