Merge branch 'master' of https://github.com/86Box/86Box
This commit is contained in:
@@ -6,8 +6,7 @@
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of the ACC 2168 chipset
|
||||
* used by the Packard Bell Legend 760 Supreme (PB410A or PB430).
|
||||
* Implementation of the ACC 2168 chipset
|
||||
*
|
||||
*
|
||||
*
|
||||
@@ -24,52 +23,30 @@
|
||||
#include "cpu.h"
|
||||
#include <86box/timer.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/mouse.h>
|
||||
#include <86box/port_92.h>
|
||||
#include <86box/sio.h>
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/chipset.h>
|
||||
|
||||
#define enabled_shadow (MEM_READ_INTERNAL | ((dev->regs[0x02] & 0x20) ? MEM_WRITE_DISABLED : MEM_WRITE_INTERNAL))
|
||||
#define disabled_shadow (MEM_READ_EXTANY | MEM_WRITE_EXTANY)
|
||||
|
||||
typedef struct acc2168_t
|
||||
{
|
||||
int reg_idx;
|
||||
uint8_t regs[256];
|
||||
uint8_t port_78;
|
||||
} acc2168_t;
|
||||
|
||||
|
||||
/*
|
||||
Based on reverse engineering using the AMI 386DX Clone BIOS:
|
||||
Bit 0 of register 02 controls shadowing of C0000-C7FFF (1 = enabled, 0 = disabled);
|
||||
Bit 1 of register 02 controls shadowing of C8000-CFFFF (1 = enabled, 0 = disabled);
|
||||
Bit 2 of register 02 controls shadowing of D0000-DFFFF (1 = enabled, 0 = disabled);
|
||||
Bit 3 of register 02 controls shadowing of E0000-EFFFF (1 = enabled, 0 = disabled);
|
||||
Bit 4 of register 02 controls shadowing of F0000-FFFFF (1 = enabled, 0 = disabled);
|
||||
Bit 5 is most likely: 1 = shadow enabled, 0 = shadow disabled;
|
||||
Bit 6 of register 02 controls shadow RAM cacheability (1 = cacheable, 0 = non-cacheable).
|
||||
*/
|
||||
|
||||
static void
|
||||
acc2168_shadow_recalc(acc2168_t *dev)
|
||||
{
|
||||
int state;
|
||||
|
||||
if (dev->regs[0x02] & 0x20)
|
||||
state = (dev->regs[0x02] & 0x20) ? (MEM_READ_INTERNAL | MEM_WRITE_INTERNAL) : (MEM_READ_EXTANY | MEM_WRITE_EXTANY);
|
||||
|
||||
mem_set_mem_state(0xc0000, 0x08000, (dev->regs[0x02] & 0x01) ? state : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0xc8000, 0x08000, (dev->regs[0x02] & 0x02) ? state : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0xd0000, 0x10000, (dev->regs[0x02] & 0x04) ? state : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0xe0000, 0x10000, (dev->regs[0x02] & 0x08) ? state : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state(0xf0000, 0x10000, (dev->regs[0x02] & 0x10) ? state : (MEM_READ_EXTANY | MEM_WRITE_EXTANY));
|
||||
mem_set_mem_state_both(0xc0000, 0x8000, ((dev->regs[0x02] & 0x01) ? enabled_shadow : disabled_shadow));
|
||||
mem_set_mem_state_both(0xc8000, 0x8000, ((dev->regs[0x02] & 0x02) ? enabled_shadow : disabled_shadow));
|
||||
mem_set_mem_state_both(0xd0000, 0x10000, ((dev->regs[0x02] & 0x04) ? enabled_shadow : disabled_shadow));
|
||||
mem_set_mem_state_both(0xe0000, 0x10000, ((dev->regs[0x02] & 0x08) ? enabled_shadow : disabled_shadow));
|
||||
mem_set_mem_state_both(0xf0000, 0x10000, ((dev->regs[0x02] & 0x10) ? enabled_shadow : disabled_shadow));
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
acc2168_write(uint16_t addr, uint8_t val, void *p)
|
||||
{
|
||||
@@ -100,21 +77,6 @@ acc2168_read(uint16_t addr, void *p)
|
||||
return dev->regs[dev->reg_idx];
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Bit 7 = Super I/O chip: 1 = enabled, 0 = disabled;
|
||||
Bit 6 = Graphics card: 1 = standalone, 0 = on-board;
|
||||
Bit 5 = ???? (if 1, siren and hangs).
|
||||
*/
|
||||
static uint8_t
|
||||
acc2168_port_78_read(uint16_t addr, void *p)
|
||||
{
|
||||
acc2168_t *dev = (acc2168_t *)p;
|
||||
|
||||
return dev->port_78;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
acc2168_close(void *priv)
|
||||
{
|
||||
@@ -132,16 +94,9 @@ acc2168_init(const device_t *info)
|
||||
|
||||
io_sethandler(0x00f2, 0x0002,
|
||||
acc2168_read, NULL, NULL, acc2168_write, NULL, NULL, dev);
|
||||
io_sethandler(0x0078, 0x0001,
|
||||
acc2168_port_78_read, NULL, NULL, NULL, NULL, NULL, dev);
|
||||
|
||||
device_add(&port_92_inv_device);
|
||||
|
||||
if (gfxcard != VID_INTERNAL)
|
||||
dev->port_78 = 0x40;
|
||||
else
|
||||
dev->port_78 = 0;
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
|
107
src/device/phoenix_486_jumper.c
Normal file
107
src/device/phoenix_486_jumper.c
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* Implementation of the Phoenix 486 Jumper Readout
|
||||
*
|
||||
* Copyright 2020 Tiseno100
|
||||
*/
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wchar.h>
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
#include "cpu.h"
|
||||
#include <86box/timer.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/chipset.h>
|
||||
|
||||
/*
|
||||
Bit 7 = Super I/O
|
||||
Bit 6 = ???
|
||||
Bit 5 = ???
|
||||
Bit 4 = ???
|
||||
Bit 3 = ???
|
||||
Bit 2 = ???
|
||||
Bit 1 = ???
|
||||
Bit 0 = ???
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t jumper;
|
||||
} phoenix_486_jumper_t;
|
||||
|
||||
#ifdef ENABLE_PHOENIX_486_JUMPER_LOG
|
||||
int phoenix_486_jumper_do_log = ENABLE_PHOENIX_486_JUMPER_LOG;
|
||||
static void
|
||||
phoenix_486_jumper_log(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (phoenix_486_jumper_do_log) {
|
||||
va_start(ap, fmt);
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
#else
|
||||
#define phoenix_486_jumper_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
static void
|
||||
phoenix_486_jumper_write(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
phoenix_486_jumper_t *dev = (phoenix_486_jumper_t *) priv;
|
||||
phoenix_486_jumper_log("Phoenix 486 Jumper: Write %02x\n", val);
|
||||
dev->jumper = val;
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
phoenix_486_jumper_read(uint16_t addr, void *priv)
|
||||
{
|
||||
phoenix_486_jumper_t *dev = (phoenix_486_jumper_t *) priv;
|
||||
phoenix_486_jumper_log("Phoenix 486 Jumper: Read %02x\n", dev->jumper);
|
||||
return dev->jumper;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
phoenix_486_jumper_close(void *priv)
|
||||
{
|
||||
phoenix_486_jumper_t *dev = (phoenix_486_jumper_t *) priv;
|
||||
|
||||
free(dev);
|
||||
}
|
||||
|
||||
static void *
|
||||
phoenix_486_jumper_init(const device_t *info)
|
||||
{
|
||||
phoenix_486_jumper_t *dev = (phoenix_486_jumper_t *) malloc(sizeof(phoenix_486_jumper_t));
|
||||
memset(dev, 0, sizeof(phoenix_486_jumper_t));
|
||||
|
||||
dev->jumper = info->local;
|
||||
|
||||
io_sethandler(0x0078, 0x0001, phoenix_486_jumper_read, NULL, NULL, phoenix_486_jumper_write, NULL, NULL, dev);
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
const device_t phoenix_486_jumper_device = {
|
||||
"Phoenix 486 Jumper Readout",
|
||||
0,
|
||||
0,
|
||||
phoenix_486_jumper_init, phoenix_486_jumper_close, NULL,
|
||||
NULL, NULL, NULL,
|
||||
NULL
|
||||
};
|
@@ -131,6 +131,7 @@ extern const device_t vlsi_scamp_device;
|
||||
extern const device_t wd76c10_device;
|
||||
|
||||
/* Miscellaneous Hardware */
|
||||
extern const device_t phoenix_486_jumper_device;
|
||||
extern const device_t vpc2007_device;
|
||||
|
||||
#endif /*EMU_CHIPSET_H*/
|
||||
|
@@ -299,8 +299,8 @@ extern const device_t paradise_wd90c30_device;
|
||||
/* S3 9XX/8XX/Vision/Trio */
|
||||
extern const device_t s3_orchid_86c911_isa_device;
|
||||
extern const device_t s3_ami_86c924_isa_device;
|
||||
extern const device_t s3_metheus_premier_86c928_isa_device;
|
||||
extern const device_t s3_metheus_premier_86c928_vlb_device;
|
||||
extern const device_t s3_metheus_86c928_isa_device;
|
||||
extern const device_t s3_metheus_86c928_vlb_device;
|
||||
extern const device_t s3_v7mirage_86c801_isa_device;
|
||||
extern const device_t s3_phoenix_86c805_vlb_device;
|
||||
extern const device_t s3_bahamas64_vlb_device;
|
||||
@@ -318,6 +318,7 @@ extern const device_t s3_diamond_stealth64_pci_device;
|
||||
extern const device_t s3_diamond_stealth64_vlb_device;
|
||||
extern const device_t s3_diamond_stealth64_964_pci_device;
|
||||
extern const device_t s3_diamond_stealth64_964_vlb_device;
|
||||
extern const device_t s3_trio64v2_dx_pci_device;
|
||||
|
||||
/* S3 ViRGE */
|
||||
extern const device_t s3_virge_vlb_device;
|
||||
@@ -328,6 +329,7 @@ extern const device_t s3_virge_375_vlb_device;
|
||||
extern const device_t s3_virge_375_pci_device;
|
||||
extern const device_t s3_virge_375_4_vlb_device;
|
||||
extern const device_t s3_virge_375_4_pci_device;
|
||||
extern const device_t s3_trio3d_2x_pci_device;
|
||||
|
||||
/* Sigma Color 400 */
|
||||
extern const device_t sigma_device;
|
||||
|
@@ -200,6 +200,8 @@ machine_at_pb410a_init(const machine_t *model)
|
||||
device_add(&acc3221_device);
|
||||
device_add(&acc2168_device);
|
||||
|
||||
device_add(&phoenix_486_jumper_device);
|
||||
|
||||
if (gfxcard == VID_INTERNAL)
|
||||
device_add(&ht216_32_pb410a_device);
|
||||
|
||||
|
@@ -185,7 +185,7 @@ const machine_t machines[] = {
|
||||
{ "[MCA] IBM PS/2 model 55SX", "ibmps2_m55sx", MACHINE_TYPE_386SX, {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"IBM",cpus_IBM486SLC},{"", NULL}}, MACHINE_MCA | MACHINE_AT | MACHINE_PS2 | MACHINE_VIDEO, 1, 8, 1, 63, machine_ps2_model_55sx_init, NULL },
|
||||
|
||||
/* 386DX machines */
|
||||
{ "[ACC 2168] AMI 386DX clone", "acc386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT, 512, 16384, 128, 127, machine_at_acc386_init, NULL },
|
||||
{ "[ACC 2168] AMI 386DX clone", "acc386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT, 1, 16, 1, 127, machine_at_acc386_init, NULL },
|
||||
{ "[SiS 310] ASUS ISA-386C", "asus386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT, 512, 16384, 128, 127, machine_at_asus386_init, NULL },
|
||||
{ "[ISA] Compaq Portable III (386)", "portableiii386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT | MACHINE_HDC | MACHINE_VIDEO, 1, 14, 1, 127, machine_at_portableiii386_init, at_cpqiii_get_device },
|
||||
{ "[ISA] Micronics 386 clone", "micronics386", MACHINE_TYPE_386DX, {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, MACHINE_ISA | MACHINE_AT, 512, 8192, 128, 127, machine_at_micronics386_init, NULL },
|
||||
|
2639
src/video/vid_s3.c
2639
src/video/vid_s3.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -135,6 +135,8 @@ video_cards[] = {
|
||||
{ "[PCI] Phoenix S3 Vision864", "px_vision864_pci", &s3_phoenix_vision864_pci_device },
|
||||
{ "[PCI] Phoenix S3 Trio32", "px_trio32_pci", &s3_phoenix_trio32_pci_device },
|
||||
{ "[PCI] Phoenix S3 Trio64", "px_trio64_pci", &s3_phoenix_trio64_pci_device },
|
||||
{ "[PCI] S3 Trio3D/2X", "trio3d2x", &s3_trio3d_2x_pci_device },
|
||||
{ "[PCI] S3 Trio64V2/DX", "trio64v2dx_pci", &s3_trio64v2_dx_pci_device },
|
||||
{ "[PCI] S3 ViRGE/DX", "virge375_pci", &s3_virge_375_pci_device },
|
||||
{ "[PCI] S3 ViRGE/DX (VBE 2.0)", "virge375_vbe20_pci", &s3_virge_375_4_pci_device },
|
||||
{ "[PCI] STB Nitro 64V (CL-GD 5446)", "cl_gd5446_stb_pci", &gd5446_stb_pci_device },
|
||||
|
@@ -656,7 +656,8 @@ DEVOBJ := bugger.o hwm.o hwm_lm75.o hwm_lm78.o hwm_gl518sm.o ibm_5161.o isamem.
|
||||
keyboard_xt.o keyboard_at.o \
|
||||
mouse.o \
|
||||
mouse_bus.o \
|
||||
mouse_serial.o mouse_ps2.o
|
||||
mouse_serial.o mouse_ps2.o \
|
||||
phoenix_486_jumper.o
|
||||
|
||||
SIOOBJ := sio_acc3221.o \
|
||||
sio_f82c710.o sio_82091aa.o \
|
||||
|
Reference in New Issue
Block a user