Add the ADD-X Normerel Xenon - original patch by Kotochi, plus my fixes.

This commit is contained in:
OBattler
2026-02-04 02:35:35 +01:00
parent 419a3acb85
commit a0e6566eb8
6 changed files with 85 additions and 10 deletions

View File

@@ -28,6 +28,7 @@
#include <86box/device.h>
#include <86box/mem.h>
#include <86box/port_92.h>
#include <86box/plat_fallthrough.h>
#include <86box/plat_unused.h>
#include <86box/chipset.h>
@@ -176,6 +177,9 @@ opti499_write(uint16_t addr, uint8_t val, void *priv)
break;
case 0x22:
mem_a20_chipset = (val & 0x02);
mem_a20_recalc();
fallthrough;
case 0x23:
case 0x26:
case 0x2d:

View File

@@ -749,6 +749,9 @@ extern int machine_at_4gpv5_init(const machine_t *);
/* Contaq 82C597 */
extern int machine_at_greenb_init(const machine_t *);
/* OPTi 499 */
extern int machine_at_xenon_init(const machine_t *);
/* OPTi 895 */
#ifdef EMU_DEVICE_H
extern const device_t j403tg_device;

View File

@@ -307,6 +307,7 @@ extern int read_type;
extern int mem_a20_state;
extern int mem_a20_alt;
extern int mem_a20_chipset;
extern int mem_a20_key;
extern uint8_t read_mem_b(uint32_t addr);

View File

@@ -166,6 +166,29 @@ machine_at_greenb_init(const machine_t *model)
return ret;
}
/* OPTi 499 */
int
machine_at_xenon_init(const machine_t *model)
{
int ret;
ret = bios_load_linear("roms/machines/xenon/addx-bios-7-71-i28f001.bin",
0x000e0000, 131072, 0);
if (bios_only || !ret)
return ret;
machine_at_common_init(model);
device_add(&opti499_device);
device_add(&ide_vlb_device);
device_add_params(&fdc37c6xx_device, (void *) (FDC37C661 | FDC37C6XX_IDE_PRI));
device_add_params(machine_get_kbc_device(machine), (void *) model->kbc_params);
device_add(&intel_flash_bxt_device);
return ret;
}
/* OPTi 895 */
static const device_config_t j403tg_config[] = {
// clang-format off

View File

@@ -8761,6 +8761,50 @@ const machine_t machines[] = {
.snd_device = NULL,
.net_device = NULL
},
/* Has AMIKey F KBC firmware. */
{
.name = "[OPTi 499] ADD-X Normerel Xenon",
.internal_name = "xenon",
.type = MACHINE_TYPE_486_S3,
.chipset = MACHINE_CHIPSET_OPTI_499,
.init = machine_at_xenon_init,
.p1_handler = machine_generic_p1_handler,
.gpio_handler = NULL,
.available_flag = MACHINE_AVAILABLE,
.gpio_acpi_handler = NULL,
.cpu = {
.package = CPU_PKG_SOCKET3,
.block = CPU_BLOCK_NONE,
.min_bus = 0,
.max_bus = 0,
.min_voltage = 0,
.max_voltage = 0,
.min_multi = 0,
.max_multi = 0
},
.bus_flags = MACHINE_PS2_VLB,
.flags = MACHINE_IDE | MACHINE_APM,
.ram = {
.min = 1024,
.max = 65536,
.step = 1024
},
.nvrmask = 127,
.jumpered_ecp_dma = 0,
.default_jumpered_ecp_dma = -1,
.kbc_device = &kbc_at_device,
.kbc_params = KBC_VEN_AMI | 0x00004600,
.kbc_p1 = 0x00000cf0,
.gpio = 0xffffffff,
.gpio_acpi = 0xffffffff,
.device = NULL,
.kbd_device = NULL,
.fdc_device = NULL,
.sio_device = NULL,
.vid_device = NULL,
.snd_device = NULL,
.net_device = NULL
},
/* Version 1.0 has an AMIKEY-2, version 2.0 has a VIA VT82C42N KBC. */
{
.name = "[OPTi 895] Jetway J-403TG",
@@ -18511,11 +18555,10 @@ const machine_t machines[] = {
.block = CPU_BLOCK(CPU_CYRIX3S),
.min_bus = 66666667,
.max_bus = 83333333,
/* TODO: to find the actual voltage and multiplier bus speeds. */
.min_voltage = 1800,
.max_voltage = 3500,
.min_multi = 1.5,
.max_multi = 8.0
.min_voltage = 2050,
.max_voltage = 3100,
.min_multi = 3.5,
.max_multi = 5.0
},
.bus_flags = MACHINE_PS2_PCI | MACHINE_BUS_USB,
.flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI | MACHINE_USB,

View File

@@ -106,9 +106,10 @@ int cachesize = 256;
uint32_t get_phys_virt;
uint32_t get_phys_phys;
int mem_a20_key = 0;
int mem_a20_alt = 0;
int mem_a20_state = 0;
int mem_a20_key = 0;
int mem_a20_alt = 0;
int mem_a20_chipset = 0;
int mem_a20_state = 0;
int mmuflush = 0;
@@ -3109,12 +3110,12 @@ mem_a20_recalc(void)
if (!is286) {
rammask = 0xfffff;
flushmmucache();
mem_a20_key = mem_a20_alt = mem_a20_state = 0;
mem_a20_key = mem_a20_alt = mem_a20_state = mem_a20_chipset = 0;
return;
}
state = mem_a20_key | mem_a20_alt;
state = mem_a20_key | mem_a20_alt | mem_a20_chipset;
if (state && !mem_a20_state) {
rammask = cpu_16bitbus ? 0xffffff : 0xffffffff;
if (is6117)