Merge remote-tracking branch 'origin/master' into version/4.1

This commit is contained in:
OBattler
2023-10-10 00:23:30 +02:00
36 changed files with 1153 additions and 400 deletions

View File

@@ -411,8 +411,15 @@ jobs:
slug: -Qt
packages: >-
qt@5
src-packages: >-
libsndfile
steps:
- name: Install source dependencies
run: >-
brew reinstall -s
${{ matrix.ui.src-packages }}
- name: Install dependencies
run: >-
brew install
@@ -458,12 +465,10 @@ jobs:
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
- name: Generate package
if: 0
run: |
cmake --install build
- name: Upload artifact
if: 0
uses: actions/upload-artifact@v3
with:
name: '86Box${{ matrix.ui.slug }}${{ matrix.dynarec.slug }}${{ matrix.build.slug }}-macOS-x86_64-gha${{ github.run_number }}'

View File

@@ -1212,10 +1212,6 @@ pc_close(UNUSED(thread_t *ptr))
/* Terminate the UI thread. */
is_quit = 1;
#if (defined(USE_DYNAREC) && defined(USE_NEW_DYNAREC))
codegen_close();
#endif
nvr_save();
config_save();

View File

@@ -898,7 +898,6 @@ cdrom_get_audio_status_pioneer(cdrom_t *dev, uint8_t *b)
{
uint8_t ret;
subchannel_t subc;
uint32_t dat;
dev->ops->get_subchannel(dev, dev->seek_pos, &subc);
@@ -960,7 +959,6 @@ cdrom_get_audio_status_sony(cdrom_t *dev, uint8_t *b, int msf)
void
cdrom_get_current_subcodeq(cdrom_t *dev, uint8_t *b)
{
uint8_t ret;
subchannel_t subc;
dev->ops->get_subchannel(dev, dev->seek_pos, &subc);

View File

@@ -68,7 +68,6 @@ typedef struct _piix_ {
uint8_t no_mirq0;
uint8_t regs[4][256];
uint8_t readout_regs[256];
uint8_t board_config[2];
uint16_t func0_id;
uint16_t nvr_io_base;
uint16_t acpi_io_base;
@@ -1189,9 +1188,7 @@ board_write(uint16_t port, uint8_t val, void *priv)
{
piix_t *dev = (piix_t *) priv;
if (port == 0x0078)
dev->board_config[0] = val;
else if (port == 0x00e0)
if (port == 0x00e0)
dev->cur_readout_reg = val;
else if (port == 0x00e1)
dev->readout_regs[dev->cur_readout_reg] = val;
@@ -1203,11 +1200,7 @@ board_read(uint16_t port, void *priv)
const piix_t *dev = (piix_t *) priv;
uint8_t ret = 0x64;
if (port == 0x0078)
ret = dev->board_config[0];
else if (port == 0x0079)
ret = dev->board_config[1];
else if (port == 0x00e0)
if (port == 0x00e0)
ret = dev->cur_readout_reg;
else if (port == 0x00e1)
ret = dev->readout_regs[dev->cur_readout_reg];
@@ -1662,37 +1655,8 @@ piix_init(const device_t *info)
else if (cpu_dmulti > 2.5)
dev->readout_regs[1] |= 0x80;
io_sethandler(0x0078, 0x0002, board_read, NULL, NULL, board_write, NULL, NULL, dev);
io_sethandler(0x00e0, 0x0002, board_read, NULL, NULL, board_write, NULL, NULL, dev);
dev->board_config[0] = 0xff;
/* Register 0x0079: */
/* Bit 7: 0 = Clear password, 1 = Keep password. */
/* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */
/* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */
/* Bit 4: External CPU clock (Switch 8). */
/* Bit 3: External CPU clock (Switch 7). */
/* 50 MHz: Switch 7 = Off, Switch 8 = Off. */
/* 60 MHz: Switch 7 = On, Switch 8 = Off. */
/* 66 MHz: Switch 7 = Off, Switch 8 = On. */
/* Bit 2: 0 = On-board audio absent, 1 = On-board audio present. */
/* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */
/* Bit 0: 0 = 1.5x multiplier, 1 = 2x multiplier (Switch 6). */
/* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */
dev->board_config[1] = 0xe0;
if (cpu_busspeed <= 50000000)
dev->board_config[1] |= 0x10;
else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000))
dev->board_config[1] |= 0x18;
else if (cpu_busspeed > 60000000)
dev->board_config[1] |= 0x00;
if (cpu_dmulti <= 1.5)
dev->board_config[1] |= 0x01;
else
dev->board_config[1] |= 0x00;
#if 0
device_add(&i8254_sec_device);
#endif

View File

@@ -103,25 +103,11 @@
#include <86box/timer.h>
#include <86box/io.h>
#include <86box/device.h>
#include <86box/mem.h>
#include <86box/pci.h>
#include <86box/plat_unused.h>
#include <86box/port_92.h>
#include <86box/smram.h>
#ifdef USE_DYNAREC
# include "codegen_public.h"
#else
# ifdef USE_NEW_DYNAREC
# define PAGE_MASK_SHIFT 6
# else
# define PAGE_MASK_INDEX_MASK 3
# define PAGE_MASK_INDEX_SHIFT 10
# define PAGE_MASK_SHIFT 4
# endif
# define PAGE_MASK_MASK 63
#endif
#include <86box/chipset.h>
#ifdef ENABLE_HB4_LOG

View File

@@ -290,7 +290,6 @@ codegen_mark_code_present(codeblock_t *block, uint32_t start_pc, int len)
}
extern void codegen_init(void);
extern void codegen_close(void);
extern void codegen_reset(void);
extern void codegen_block_init(uint32_t phys_addr);
extern void codegen_block_remove(void);

View File

@@ -229,33 +229,6 @@ codegen_init(void)
#endif
}
void
codegen_close(void)
{
#ifdef DEBUG_EXTRA
pclog("Instruction counts :\n");
while (1) {
int c;
uint32_t highest_num = 0, highest_idx = 0;
for (c = 0; c < 256 * 256; c++) {
if (instr_counts[c] > highest_num) {
highest_num = instr_counts[c];
highest_idx = c;
}
}
if (!highest_num)
break;
instr_counts[highest_idx] = 0;
if (highest_idx > 256)
pclog(" %02x %02x = %u\n", highest_idx >> 8, highest_idx & 0xff, highest_num);
else
pclog(" %02x = %u\n", highest_idx & 0xff, highest_num);
}
#endif
}
void
codegen_reset(void)
{

View File

@@ -92,9 +92,6 @@ static uint16_t mem_addr = 0;
static int schedule_fetch = 1;
static int pasv = 0;
static int pfq_idle = 1;
static int pfq_delay = 0;
#define BUS_OUT 1
#define BUS_HIGH 2
#define BUS_WIDE 4
@@ -1268,7 +1265,6 @@ intr_routine(uint16_t intr, int skip_first)
uint16_t tempf = cpu_state.flags & (is_nec ? 0x8fd7 : 0x0fd7);
uint16_t new_cs;
uint16_t new_ip;
uint16_t old_ip;
if (!skip_first)
wait(1, 0);
@@ -1368,7 +1364,6 @@ custom_nmi(void)
uint16_t tempf = cpu_state.flags & (is_nec ? 0x8fd7 : 0x0fd7);
uint16_t new_cs;
uint16_t new_ip;
uint16_t old_ip;
wait(1, 0);
wait(2, 0);
@@ -2155,7 +2150,6 @@ execx86(int cycs)
uint16_t old_flags;
uint16_t tmpa;
int bits;
uint32_t dest_seg;
uint32_t i;
uint32_t carry;
uint32_t nibble;

View File

@@ -50,9 +50,6 @@
#endif
extern void codegen_init(void);
#ifdef USE_NEW_DYNAREC
extern void codegen_close(void);
#endif
extern void codegen_flush(void);
/*Current physical page of block being recompiled. -1 if no recompilation taking place */

View File

@@ -183,7 +183,7 @@ isapnp_reset_ld_config(isapnp_device_t *ld)
/* Populate configuration registers. */
ld->regs[0x30] = !!config->activate;
uint8_t reg_base;
uint8_t reg_base;
uint32_t size;
for (uint8_t i = 0; i < 4; i++) {
reg_base = 0x40 + (8 * i);
@@ -795,22 +795,28 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size)
#ifdef ENABLE_ISAPNP_LOG
uint16_t vendor = (card->rom[0] << 8) | card->rom[1];
isapnp_log("ISAPnP: Parsing ROM resources for card %c%c%c%02X%02X (serial %08X)\n", '@' + ((vendor >> 10) & 0x1f), '@' + ((vendor >> 5) & 0x1f), '@' + (vendor & 0x1f), card->rom[2], card->rom[3], (card->rom[7] << 24) | (card->rom[6] << 16) | (card->rom[5] << 8) | card->rom[4]);
const char *df_priority[] = { "good", "acceptable", "sub-optimal", "unknown priority" };
const char *mem_control[] = { "8-bit", "16-bit", "8/16-bit", "32-bit" };
const char *dma_transfer[] = { "8-bit", "8/16-bit", "16-bit", "unknown" };
const char *dma_speed[] = { "compatibility", "Type A", "Type B", "Type F" };
#endif
uint16_t i = 9;
uint8_t existing = 0;
uint8_t ldn = 0;
uint8_t ldn = 0;
uint8_t res;
uint8_t in_df = 0;
uint8_t irq = 0;
uint8_t io = 0;
uint8_t mem_range = 0;
uint8_t mem_range_32 = 0;
uint8_t irq_df = 0;
uint8_t io_df = 0;
uint8_t mem_range_df = 0;
uint8_t in_df = 0;
uint8_t irq = 0;
uint8_t dma = 0;
uint8_t io = 0;
uint8_t mem_range = 0;
uint8_t mem_range_32 = 0;
uint8_t irq_df = 0;
uint8_t dma_df = 0;
uint8_t io_df = 0;
uint8_t mem_range_df = 0;
uint8_t mem_range_32_df = 0;
uint32_t len;
isapnp_device_t *ld = NULL;
isapnp_device_t *ld = NULL;
isapnp_device_t *prev_ld = NULL;
/* Check if this is an existing card which already has logical devices.
@@ -838,7 +844,10 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size)
break;
}
isapnp_log("ISAPnP: >>%s Memory range %d uses upper limit = ", in_df ? ">" : "", mem_range);
isapnp_log("ISAPnP: >>%s Memory range %d with %d bytes at %06X-%06X, align %d",
in_df ? ">" : "", mem_range,
*((uint16_t *) &card->rom[i + 10]) << 8, *((uint16_t *) &card->rom[i + 4]) << 8, ((card->rom[i + 3] & 0x4) ? 0 : (*((uint16_t *) &card->rom[i + 4]) << 8)) + (*((uint16_t *) &card->rom[i + 6]) << 8),
(*((uint16_t *) &card->rom[i + 8]) + 1) << 16);
res = 1 << mem_range;
mem_range++;
} else {
@@ -852,18 +861,27 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size)
break;
}
isapnp_log("ISAPnP: >>%s 32-bit memory range %d uses upper limit = ", in_df ? ">" : "", mem_range_32);
isapnp_log("ISAPnP: >>%s 32-bit memory range %d with %d bytes at %08X-%08X, align %d", in_df ? ">" : "", mem_range_32,
*((uint32_t *) &card->rom[i + 16]) << 8, *((uint32_t *) &card->rom[i + 4]) << 8, ((card->rom[i + 3] & 0x4) ? 0 : (*((uint32_t *) &card->rom[i + 4]) << 8)) + (*((uint32_t *) &card->rom[i + 8]) << 8),
*((uint32_t *) &card->rom[i + 12]));
res = 1 << (4 + mem_range_32);
mem_range_32++;
}
if (card->rom[i + 3] & 0x4) {
isapnp_log("yes\n");
#ifdef ENABLE_ISAPNP_LOG
isapnp_log(" bytes, %swritable, %sread cacheable, %s, %sshadowable, %sexpansion ROM\n",
(card->rom[i + 3] & 0x01) ? "not " : "",
(card->rom[i + 3] & 0x02) ? "not " : "",
(card->rom[i + 3] & 0x04) ? "upper limit" : "range length",
mem_control[(card->rom[i + 3] >> 3) & 0x03],
(card->rom[i + 3] & 0x20) ? "not " : "",
(card->rom[i + 3] & 0x40) ? "not " : "");
#endif
if (card->rom[i + 3] & 0x4)
ld->mem_upperlimit |= res;
} else {
isapnp_log("no\n");
else
ld->mem_upperlimit &= ~res;
}
break;
@@ -874,14 +892,11 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size)
isapnp_log("ISAPnP: >%s ANSI identifier: \"%s\"\n", ldn ? ">" : "", &card->rom[i + 3]);
card->rom[i + 3 + len] = res;
break;
#endif
default:
isapnp_log("ISAPnP: >%s%s Large resource %02X (length %d)\n", ldn ? ">" : "", in_df ? ">" : "", res, (card->rom[i + 2] << 8) | card->rom[i + 1]);
break;
#else
default:
break;
#endif
}
i += 3; /* header */
@@ -890,7 +905,13 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size)
len = card->rom[i] & 0x07;
switch (res) {
case 0x02:
#ifdef ENABLE_ISAPNP_LOG
case 0x01: /* PnP version */
isapnp_log("ISAPnP: > PnP version %d.%d, vendor-specific version %02X\n", card->rom[i + 1] >> 4, card->rom[i + 1] & 0x0f, card->rom[i + 2]);
break;
#endif
case 0x02: /* logical device */
#ifdef ENABLE_ISAPNP_LOG
vendor = (card->rom[i + 1] << 8) | card->rom[i + 2];
isapnp_log("ISAPnP: > Logical device %02X: %c%c%c%02X%02X\n", ldn, '@' + ((vendor >> 10) & 0x1f), '@' + ((vendor >> 5) & 0x1f), '@' + (vendor & 0x1f), card->rom[i + 3], card->rom[i + 4]);
@@ -931,7 +952,7 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size)
ld->number = ldn++;
/* Start the position counts over. */
irq = io = mem_range = mem_range_32 = irq_df = io_df = mem_range_df = mem_range_32_df = 0;
irq = dma = io = mem_range = mem_range_32 = irq_df = dma_df = io_df = mem_range_df = mem_range_32_df = 0;
break;
@@ -963,7 +984,7 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size)
else /* specific */
res = card->rom[i + 3] & 0x0f;
isapnp_log("ISAPnP: >>%s IRQ index %d interrupt types = %01X\n", in_df ? ">" : "", irq, res);
isapnp_log("ISAPnP: >>%s IRQ index %d with mask %04X, types %01X\n", in_df ? ">" : "", irq, *((uint16_t *) &card->rom[i + 1]), res);
ld->irq_types &= ~(0x0f << (4 * irq));
ld->irq_types |= res << (4 * irq);
@@ -972,24 +993,39 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size)
break;
#ifdef ENABLE_ISAPNP_LOG
case 0x05: /* DMA */
isapnp_log("ISAPnP: >>%s DMA index %d with mask %02X, %s, %sbus master, %scount by byte, %scount by word, %s speed\n", in_df ? ">" : "", dma++, card->rom[i + 1],
dma_transfer[card->rom[i + 2] & 3],
(card->rom[i + 2] & 0x04) ? "not " : "",
(card->rom[i + 2] & 0x08) ? "not " : "",
(card->rom[i + 2] & 0x10) ? "not " : "",
dma_speed[(card->rom[i + 2] >> 5) & 3]);
break;
#endif
case 0x06: /* start dependent function */
if (!ld) {
isapnp_log("ISAPnP: >> Start dependent function with no logical device\n");
break;
}
isapnp_log("ISAPnP: >> Start dependent function: %s\n", (((len == 0) || (card->rom[i + 1] == 1)) ? "acceptable" : ((card->rom[i + 1] == 0) ? "good" : ((card->rom[i + 1] == 2) ? "sub-optimal" : "unknown priority"))));
#ifdef ENABLE_ISAPNP_LOG
isapnp_log("ISAPnP: >> Start dependent function: %s\n", df_priority[(len < 1) ? 1 : (card->rom[i + 1] & 3)]);
#endif
if (in_df) {
/* We're in a dependent function and this is the next one starting.
Walk positions back to the saved values. */
irq = irq_df;
dma = dma_df;
io = io_df;
mem_range = mem_range_df;
mem_range_32 = mem_range_32_df;
} else {
/* Save current positions to restore at the next DF. */
irq_df = irq;
dma_df = dma;
io_df = io;
mem_range_df = mem_range;
mem_range_32_df = mem_range_32;
@@ -1014,7 +1050,7 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size)
break;
}
isapnp_log("ISAPnP: >>%s I/O range %d %d-bit decode, %d ports\n", in_df ? ">" : "", io, (card->rom[i + 1] & 0x01) ? 16 : 10, card->rom[i + 7]);
isapnp_log("ISAPnP: >>%s I/O range %d with %d ports at %04X-%04X, align %d, %d-bit decode\n", in_df ? ">" : "", io, card->rom[i + 7], *((uint16_t *) &card->rom[i + 2]), *((uint16_t *) &card->rom[i + 4]), card->rom[i + 6], (card->rom[i + 1] & 0x01) ? 16 : 10);
if (card->rom[i + 1] & 0x01)
ld->io_16bit |= 1 << io;
@@ -1042,9 +1078,7 @@ isapnp_update_card_rom(void *priv, uint8_t *rom, uint16_t rom_size)
break;
default:
#ifdef ENABLE_ISAPNP_LOG
isapnp_log("ISAPnP: >%s%s Small resource %02X (length %d)\n", ldn ? ">" : "", in_df ? ">" : "", res, card->rom[i] & 0x07);
#endif
break;
}

View File

@@ -340,6 +340,7 @@ extern const machine_filter_t machine_chipsets[];
extern const machine_t machines[];
extern int bios_only;
extern int machine;
extern void * machine_snd;
/* Core functions. */
extern int machine_count(void);
@@ -371,16 +372,25 @@ extern void machine_close(void);
extern int machine_has_mouse(void);
extern int machine_is_sony(void);
extern uint8_t machine_get_p1_default(void);
extern uint8_t machine_get_p1(void);
extern void machine_set_p1_default(uint8_t val);
extern void machine_set_p1(uint8_t val);
extern void machine_and_p1(uint8_t val);
extern void machine_init_p1(void);
extern uint8_t machine_handle_p1(uint8_t write, uint8_t val);
extern uint32_t machine_get_gpio_default(void);
extern uint32_t machine_get_gpio(void);
extern void machine_set_gpio_default(uint32_t val);
extern void machine_set_gpio(uint32_t val);
extern void machine_and_gpio(uint32_t val);
extern void machine_init_gpio(void);
extern uint32_t machine_handle_gpio(uint8_t write, uint32_t val);
extern uint32_t machine_get_gpio_acpi_default(void);
extern uint32_t machine_get_gpio_acpi(void);
extern void machine_set_gpio_acpi(uint32_t gpio_val);
extern void machine_set_gpio_acpi_default(uint32_t val);
extern void machine_set_gpio_acpi(uint32_t val);
extern void machine_and_gpio_acpi(uint32_t val);
extern void machine_init_gpio_acpi(void);
extern uint32_t machine_handle_gpio_acpi(uint8_t write, uint32_t val);
@@ -613,6 +623,7 @@ extern int machine_at_exp8551_init(const machine_t *);
extern int machine_at_gw2katx_init(const machine_t *);
extern int machine_at_thor_init(const machine_t *);
extern int machine_at_mrthor_init(const machine_t *);
extern uint32_t machine_at_endeavor_gpio_handler(uint8_t write, uint32_t val);
extern int machine_at_endeavor_init(const machine_t *);
extern int machine_at_ms5119_init(const machine_t *);
extern int machine_at_pb640_init(const machine_t *);
@@ -637,6 +648,7 @@ extern int machine_at_p55t2p4_init(const machine_t *);
extern int machine_at_m7shi_init(const machine_t *);
extern int machine_at_tc430hx_init(const machine_t *);
extern int machine_at_infinia7200_init(const machine_t *);
extern int machine_at_cu430hx_init(const machine_t *);
extern int machine_at_equium5200_init(const machine_t *);
extern int machine_at_pcv90_init(const machine_t *);
extern int machine_at_p65up5_cp55t2d_init(const machine_t *);

View File

@@ -71,7 +71,6 @@ typedef struct sb_ct1345_mixer_t {
uint8_t index;
uint8_t regs[256];
} sb_ct1345_mixer_t;
/* SB16 and AWE32 */
@@ -147,6 +146,7 @@ typedef struct sb_t {
uint8_t pnp_rom[512];
uint16_t opl_pnp_addr;
uint16_t gameport_addr;
void *opl_mixer;
void (*opl_mix)(void*, double*, double*);

View File

@@ -81,6 +81,9 @@ extern void inital(void);
extern void givealbuffer(void *buf);
extern void givealbuffer_cd(void *buf);
#define sb_vibra16c_onboard_relocate_base sb_vibra16s_onboard_relocate_base
extern void sb_vibra16s_onboard_relocate_base(uint16_t new_addr, void *priv);
#ifdef EMU_DEVICE_H
/* AdLib and AdLib Gold */
extern const device_t adlib_device;
@@ -128,6 +131,11 @@ extern const device_t sb_pro_v2_device;
extern const device_t sb_pro_mcv_device;
extern const device_t sb_pro_compat_device;
extern const device_t sb_16_device;
extern const device_t sb_vibra16s_onboard_device;
extern const device_t sb_vibra16s_device;
extern const device_t sb_vibra16xv_device;
extern const device_t sb_vibra16c_onboard_device;
extern const device_t sb_vibra16c_device;
extern const device_t sb_16_pnp_device;
extern const device_t sb_16_compat_device;
extern const device_t sb_16_compat_nompu_device;

View File

@@ -1,3 +1,24 @@
/*
* 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.
*
* Thread API header.
*
*
*
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
*
* Copyright 2008-2023 Sarah Walker.
* Copyright 2016-2023 Miran Grca.
*/
#ifndef THREAD_H
# define THREAD_H
#ifdef __cplusplus
extern "C" {
#endif
@@ -44,3 +65,5 @@ extern int thread_release_mutex(mutex_t *mutex);
#ifdef __cplusplus
}
#endif
#endif /*THREAD_H*/

View File

@@ -15,7 +15,6 @@
*
* Copyright 2022 TheCollector1995.
*/
#ifndef VIDEO_8514A_H
#define VIDEO_8514A_H
@@ -203,4 +202,5 @@ typedef struct ibm8514_t {
int ext_pitch;
int ext_crt_pitch;
} ibm8514_t;
#endif /*VIDEO_8514A_H*/

View File

@@ -16,11 +16,6 @@
* Copyright 2008-2020 Sarah Walker.
* Copyright 2016-2020 Miran Grca.
*/
#include <86box/thread.h>
#include <86box/vid_8514a.h>
#include <86box/vid_xga.h>
#ifndef VIDEO_SVGA_H
# define VIDEO_SVGA_H
@@ -58,8 +53,6 @@ typedef union {
} latch_t;
typedef struct svga_t {
ibm8514_t dev8514;
xga_t xga;
mem_mapping_t mapping;
uint8_t fast;
@@ -269,11 +262,14 @@ typedef struct svga_t {
/* Pointer to monitor */
monitor_t *monitor;
void * dev8514;
void * xga;
} svga_t;
extern int vga_on;
extern void ibm8514_poll(ibm8514_t *dev, svga_t *svga);
extern void ibm8514_poll(void *priv, svga_t *svga);
extern void ibm8514_recalctimings(svga_t *svga);
extern uint8_t ibm8514_ramdac_in(uint16_t port, void *priv);
extern void ibm8514_ramdac_out(uint16_t port, uint8_t val, void *priv);
@@ -283,7 +279,7 @@ extern void ibm8514_accel_out_pixtrans(svga_t *svga, uint16_t port, uint16_t
extern void ibm8514_short_stroke_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, uint8_t ssv, int len);
extern void ibm8514_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, int len);
extern void xga_poll(xga_t *xga, svga_t *svga);
extern void xga_poll(void *priv, svga_t *svga);
extern void xga_recalctimings(svga_t *svga);
extern int svga_init(const device_t *info, svga_t *svga, void *priv, int memsize,

View File

@@ -14,7 +14,6 @@
*
* Copyright 2022 TheCollector1995.
*/
#ifndef VIDEO_XGA_H
#define VIDEO_XGA_H
@@ -232,4 +231,5 @@ typedef struct xga_t {
int big_endian_linear;
} xga_t;
#endif /*VIDEO_XGA_H*/

View File

@@ -177,6 +177,39 @@ machine_at_apollo_init(const machine_t *model)
return ret;
}
static void
machine_at_zappa_gpio_init(void)
{
uint32_t gpio = 0xffffe6ff;
/* Register 0x0079: */
/* Bit 7: 0 = Clear password, 1 = Keep password. */
/* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */
/* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */
/* Bit 4: External CPU clock (Switch 8). */
/* Bit 3: External CPU clock (Switch 7). */
/* 50 MHz: Switch 7 = Off, Switch 8 = Off. */
/* 60 MHz: Switch 7 = On, Switch 8 = Off. */
/* 66 MHz: Switch 7 = Off, Switch 8 = On. */
/* Bit 2: No Connect. */
/* Bit 1: No Connect. */
/* Bit 0: 2x multiplier, 1 = 1.5x multiplier (Switch 6). */
/* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */
if (cpu_busspeed <= 50000000)
gpio |= 0xffff10ff;
else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000))
gpio |= 0xffff18ff;
else if (cpu_busspeed > 60000000)
gpio |= 0xffff00ff;
if (cpu_dmulti <= 1.5)
gpio |= 0xffff01ff;
else
gpio |= 0xffff00ff;
machine_set_gpio_default(gpio);
}
int
machine_at_zappa_init(const machine_t *model)
{
@@ -190,6 +223,7 @@ machine_at_zappa_init(const machine_t *model)
return ret;
machine_at_common_init_ex(model, 2);
machine_at_zappa_gpio_init();
pci_init(PCI_CONFIG_TYPE_1);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);

View File

@@ -171,6 +171,42 @@ machine_at_m7shi_init(const machine_t *model)
return ret;
}
/* The Sony VAIO is an AG430HX, I'm assuming it has the same configuration bits
as the TC430HX, hence the #define. */
#define machine_at_ag430hx_gpio_init machine_at_tc430hx_gpio_init
/* The PB680 is a NV430VX, I'm assuming it has the same configuration bits as
the TC430HX, hence the #define. */
#define machine_at_nv430vx_gpio_init machine_at_tc430hx_gpio_init
static void
machine_at_tc430hx_gpio_init(void)
{
uint32_t gpio = 0xffffe1ff;
/* Register 0x0079: */
/* Bit 7: 0 = Clear password, 1 = Keep password. */
/* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */
/* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */
/* Bit 4: External CPU clock (Switch 8). */
/* Bit 3: External CPU clock (Switch 7). */
/* 50 MHz: Switch 7 = Off, Switch 8 = Off. */
/* 60 MHz: Switch 7 = On, Switch 8 = Off. */
/* 66 MHz: Switch 7 = Off, Switch 8 = On. */
/* Bit 2: 0 = On-board audio absent, 1 = On-board audio present. */
/* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */
/* Bit 0: 0 = Reserved. */
/* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */
if (cpu_busspeed <= 50000000)
gpio |= 0xffff10ff;
else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000))
gpio |= 0xffff18ff;
else if (cpu_busspeed > 60000000)
gpio |= 0xffff00ff;
machine_set_gpio_default(gpio);
}
int
machine_at_tc430hx_init(const machine_t *model)
{
@@ -187,6 +223,7 @@ machine_at_tc430hx_init(const machine_t *model)
return ret;
machine_at_common_init_ex(model, 2);
machine_at_tc430hx_gpio_init();
pci_init(PCI_CONFIG_TYPE_1);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
@@ -196,7 +233,10 @@ machine_at_tc430hx_init(const machine_t *model)
pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2);
pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3);
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
device_add(&s3_virge_375_pci_device);
if (gfxcard[0] == VID_INTERNAL)
device_add(machine_get_vid_device(machine));
device_add(&i430hx_device);
device_add(&piix3_device);
device_add(&keyboard_ps2_ami_pci_device);
@@ -222,6 +262,7 @@ machine_at_infinia7200_init(const machine_t *model)
return ret;
machine_at_common_init_ex(model, 2);
machine_at_tc430hx_gpio_init();
pci_init(PCI_CONFIG_TYPE_1);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
@@ -231,7 +272,10 @@ machine_at_infinia7200_init(const machine_t *model)
pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2);
pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3);
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
device_add(&s3_virge_375_pci_device);
if (gfxcard[0] == VID_INTERNAL)
device_add(machine_get_vid_device(machine));
device_add(&i430hx_device);
device_add(&piix3_device);
device_add(&keyboard_ps2_ami_pci_device);
@@ -241,7 +285,83 @@ machine_at_infinia7200_init(const machine_t *model)
return ret;
}
/* Information about that machine on machine.h */
static void
machine_at_cu430hx_gpio_init(void)
{
uint32_t gpio = 0xffffe1ff;
/* Register 0x0079: */
/* Bit 7: 0 = Clear password, 1 = Keep password. */
/* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */
/* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */
/* Bit 4: External CPU clock (Switch 8). */
/* Bit 3: External CPU clock (Switch 7). */
/* 50 MHz: Switch 7 = Off, Switch 8 = Off. */
/* 60 MHz: Switch 7 = On, Switch 8 = Off. */
/* 66 MHz: Switch 7 = Off, Switch 8 = On. */
/* Bit 2: 0 = On-board audio absent, 1 = On-board audio present. */
/* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */
/* Bit 0: 0 = Reserved. */
/* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */
if (cpu_busspeed <= 50000000)
gpio |= 0xffff10ff;
else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000))
gpio |= 0xffff18ff;
else if (cpu_busspeed > 60000000)
gpio |= 0xffff00ff;
if ((sound_card_current[0] == SOUND_INTERNAL) && machine_get_snd_device(machine)->available())
gpio |= 0xffff04ff;
machine_set_gpio_default(gpio);
}
static void
machine_at_cu430hx_common_init(const machine_t *model)
{
machine_at_common_init_ex(model, 2);
machine_at_cu430hx_gpio_init();
pci_init(PCI_CONFIG_TYPE_1);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0); // ATI VGA Graphics
pci_register_slot(0x0C, PCI_CARD_NETWORK, 4, 0, 0, 0); // Intel 82557 Ethernet Network
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4);
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1);
pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2);
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 0, 0, 0); // riser
if ((sound_card_current[0] == SOUND_INTERNAL) && machine_get_snd_device(machine)->available())
machine_snd = device_add(machine_get_snd_device(machine));
device_add(&i430hx_device);
device_add(&piix3_device);
device_add(&keyboard_ps2_ami_pci_device);
device_add(&pc87306_device);
device_add(&intel_flash_bxt_ami_device);
}
int
machine_at_cu430hx_init(const machine_t *model)
{
int ret;
ret = bios_load_linear_combined2("roms/machines/cu430hx/1006DK0_.BIO",
"roms/machines/cu430hx/1006DK0_.BI1",
"roms/machines/cu430hx/1006DK0_.BI2",
"roms/machines/cu430hx/1006DK0_.BI3",
"roms/machines/cu430hx/1006DK0_.RCV",
0x3a000, 128);
if (bios_only || !ret)
return ret;
machine_at_cu430hx_common_init(model);
return ret;
}
int
machine_at_equium5200_init(const machine_t *model)
{
@@ -257,21 +377,7 @@ machine_at_equium5200_init(const machine_t *model)
if (bios_only || !ret)
return ret;
machine_at_common_init_ex(model, 2);
pci_init(PCI_CONFIG_TYPE_1);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
pci_register_slot(0x08, PCI_CARD_VIDEO, 4, 0, 0, 0);
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 3, 4);
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1);
pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2);
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 0, 0, 0); // riser
device_add(&i430hx_device);
device_add(&piix3_device);
device_add(&keyboard_ps2_ami_pci_device);
device_add(&pc87306_device);
device_add(&intel_flash_bxt_ami_device);
machine_at_cu430hx_common_init(model);
return ret;
}
@@ -292,6 +398,7 @@ machine_at_pcv90_init(const machine_t *model)
return ret;
machine_at_common_init_ex(model, 2);
machine_at_ag430hx_gpio_init();
pci_init(PCI_CONFIG_TYPE_1);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
@@ -548,6 +655,7 @@ machine_at_pb680_init(const machine_t *model)
return ret;
machine_at_common_init_ex(model, 2);
machine_at_nv430vx_gpio_init();
pci_init(PCI_CONFIG_TYPE_1);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
@@ -556,6 +664,10 @@ machine_at_pb680_init(const machine_t *model)
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1);
pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2);
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
if (gfxcard[0] == VID_INTERNAL)
device_add(machine_get_vid_device(machine));
device_add(&i430vx_device);
device_add(&piix3_device);
device_add(&keyboard_ps2_ami_pci_device);

View File

@@ -41,11 +41,41 @@
#include <86box/fdc.h>
#include <86box/nvr.h>
#include <86box/plat_unused.h>
#include <86box/sound.h>
static void
machine_at_thor_common_init(const machine_t *model, UNUSED(int mr))
machine_at_thor_gpio_init(void)
{
uint32_t gpio = 0xffffe1ff;
/* Register 0x0079: */
/* Bit 7: 0 = Clear password, 1 = Keep password. */
/* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */
/* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */
/* Bit 4: External CPU clock (Switch 8). */
/* Bit 3: External CPU clock (Switch 7). */
/* 50 MHz: Switch 7 = Off, Switch 8 = Off. */
/* 60 MHz: Switch 7 = On, Switch 8 = Off. */
/* 66 MHz: Switch 7 = Off, Switch 8 = On. */
/* Bit 2: 0 = On-board audio absent, 1 = On-board audio present. */
/* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */
/* Bit 0: 0 = Reserved. */
/* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */
if (cpu_busspeed <= 50000000)
gpio |= 0xffff10ff;
else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000))
gpio |= 0xffff18ff;
else if (cpu_busspeed > 60000000)
gpio |= 0xffff00ff;
machine_set_gpio_default(gpio);
}
static void
machine_at_thor_common_init(const machine_t *model, int has_video)
{
machine_at_common_init_ex(model, 2);
machine_at_thor_gpio_init();
pci_init(PCI_CONFIG_TYPE_1);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
@@ -56,8 +86,8 @@ machine_at_thor_common_init(const machine_t *model, UNUSED(int mr))
pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 3, 2, 1);
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
if (gfxcard[0] == VID_INTERNAL)
device_add(&s3_phoenix_trio64vplus_onboard_pci_device);
if (has_video && (gfxcard[0] == VID_INTERNAL))
device_add(machine_get_vid_device(machine));
device_add(&keyboard_ps2_intel_ami_pci_device);
device_add(&i430fx_device);
@@ -175,7 +205,7 @@ machine_at_thor_init(const machine_t *model)
if (bios_only || !ret)
return ret;
machine_at_thor_common_init(model, 0);
machine_at_thor_common_init(model, 1);
return ret;
}
@@ -191,7 +221,93 @@ machine_at_mrthor_init(const machine_t *model)
if (bios_only || !ret)
return ret;
machine_at_thor_common_init(model, 1);
machine_at_thor_common_init(model, 0);
return ret;
}
static void
machine_at_endeavor_gpio_init(void)
{
uint32_t gpio = 0xffffe0cf;
uint16_t addr;
/* Register 0x0078: */
/* Bit 5,4: Vibra 16S base address: 0 = 220h, 1 = 260h, 2 = 240h, 3 = 280h. */
device_context(machine_get_snd_device(machine));
addr = device_get_config_hex16("base");
switch (addr) {
case 0x0220:
gpio |= 0xffff00cf;
break;
case 0x0240:
gpio |= 0xffff00ef;
break;
case 0x0260:
gpio |= 0xffff00df;
break;
case 0x0280:
gpio |= 0xffff00ff;
break;
}
device_context_restore();
/* Register 0x0079: */
/* Bit 7: 0 = Clear password, 1 = Keep password. */
/* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */
/* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */
/* Bit 4: External CPU clock (Switch 8). */
/* Bit 3: External CPU clock (Switch 7). */
/* 50 MHz: Switch 7 = Off, Switch 8 = Off. */
/* 60 MHz: Switch 7 = On, Switch 8 = Off. */
/* 66 MHz: Switch 7 = Off, Switch 8 = On. */
/* Bit 2: 0 = On-board audio absent, 1 = On-board audio present. */
/* Bit 1: 0 = Soft-off capable power supply present, 1 = Soft-off capable power supply absent. */
/* Bit 0: 0 = 2x multiplier, 1 = 1.5x multiplier (Switch 6). */
/* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */
if (cpu_busspeed <= 50000000)
gpio |= 0xffff10cf;
else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000))
gpio |= 0xffff18cf;
else if (cpu_busspeed > 60000000)
gpio |= 0xffff00cf;
if (sound_card_current[0] == SOUND_INTERNAL)
gpio |= 0xffff04cf;
if (cpu_dmulti <= 1.5)
gpio |= 0xffff01cf;
else
gpio |= 0xffff00cf;
machine_set_gpio_default(gpio);
}
uint32_t
machine_at_endeavor_gpio_handler(uint8_t write, uint32_t val)
{
uint32_t ret = machine_get_gpio_default();
if (write) {
ret &= ((val & 0xffffffcf) | 0xffff0000);
ret |= (val & 0x00000030);
if (machine_snd != NULL) switch ((val >> 4) & 0x03) {
case 0x00:
sb_vibra16s_onboard_relocate_base(0x0220, machine_snd);
break;
case 0x01:
sb_vibra16s_onboard_relocate_base(0x0260, machine_snd);
break;
case 0x02:
sb_vibra16s_onboard_relocate_base(0x0240, machine_snd);
break;
case 0x03:
sb_vibra16s_onboard_relocate_base(0x0280, machine_snd);
break;
}
machine_set_gpio(ret);
} else
ret = machine_get_gpio();
return ret;
}
@@ -209,6 +325,7 @@ machine_at_endeavor_init(const machine_t *model)
return ret;
machine_at_common_init_ex(model, 2);
machine_at_endeavor_gpio_init();
pci_init(PCI_CONFIG_TYPE_1);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
@@ -220,7 +337,10 @@ machine_at_endeavor_init(const machine_t *model)
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
if (gfxcard[0] == VID_INTERNAL)
device_add(&s3_phoenix_trio64_onboard_pci_device);
device_add(machine_get_vid_device(machine));
if (sound_card_current[0] == SOUND_INTERNAL)
machine_snd = device_add(machine_get_snd_device(machine));
device_add(&keyboard_ps2_intel_ami_pci_device);
device_add(&i430fx_device);
@@ -260,6 +380,41 @@ machine_at_ms5119_init(const machine_t *model)
return ret;
}
static void
machine_at_pb640_gpio_init(void)
{
uint32_t gpio = 0xffffffff;
/* Register 0x0079: */
/* Bit 7: 0 = Clear password, 1 = Keep password. */
/* Bit 6: 0 = NVRAM cleared by jumper, 1 = NVRAM normal. */
/* Bit 5: 0 = CMOS Setup disabled, 1 = CMOS Setup enabled. */
/* Bit 4: External CPU clock (Switch 8). */
/* Bit 3: External CPU clock (Switch 7). */
/* 50 MHz: Switch 7 = Off, Switch 8 = Off. */
/* 60 MHz: Switch 7 = On, Switch 8 = Off. */
/* 66 MHz: Switch 7 = Off, Switch 8 = On. */
/* Bit 2: No Connect. */
/* Bit 1: No Connect. */
/* Bit 0: 2x multiplier, 1 = 1.5x multiplier (Switch 6). */
/* NOTE: A bit is read as 1 if switch is off, and as 0 if switch is on. */
gpio = 0xffffe6ff;
if (cpu_busspeed <= 50000000)
gpio |= 0xffff10ff;
else if ((cpu_busspeed > 50000000) && (cpu_busspeed <= 60000000))
gpio |= 0xffff18ff;
else if (cpu_busspeed > 60000000)
gpio |= 0xffff00ff;
if (cpu_dmulti <= 1.5)
gpio |= 0xffff01ff;
else
gpio |= 0xffff00ff;
machine_set_gpio_default(gpio);
}
int
machine_at_pb640_init(const machine_t *model)
{
@@ -272,6 +427,7 @@ machine_at_pb640_init(const machine_t *model)
return ret;
machine_at_common_init_ex(model, 2);
machine_at_pb640_gpio_init();
pci_init(PCI_CONFIG_TYPE_1);
pci_register_slot(0x00, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);

View File

@@ -72,7 +72,15 @@ machine_init_ex(int m)
if (!bios_only) {
machine_log("Initializing as \"%s\"\n", machine_getname());
machine_init_p1();
machine_init_gpio();
machine_init_gpio_acpi();
machine_snd = NULL;
is_vpc = 0;
standalone_gameport_type = NULL;
gameport_instance_id = 0;

View File

@@ -9110,7 +9110,7 @@ const machine_t machines[] = {
.device = NULL,
.fdc_device = NULL,
.sio_device = NULL,
.vid_device = &s3_phoenix_trio64vplus_onboard_pci_device,
.vid_device = NULL,
.snd_device = NULL,
.net_device = NULL
},
@@ -9124,7 +9124,7 @@ const machine_t machines[] = {
.chipset = MACHINE_CHIPSET_INTEL_430FX,
.init = machine_at_endeavor_init,
.p1_handler = NULL,
.gpio_handler = NULL,
.gpio_handler = machine_at_endeavor_gpio_handler,
.available_flag = MACHINE_AVAILABLE,
.gpio_acpi_handler = NULL,
.cpu = {
@@ -9138,7 +9138,7 @@ const machine_t machines[] = {
.max_multi = 3.0
},
.bus_flags = MACHINE_PS2_PCI,
.flags = MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_APM | MACHINE_ACPI,
.flags = MACHINE_IDE_DUAL | MACHINE_VIDEO | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI,
.ram = {
.min = 8192,
.max = 131072,
@@ -9153,7 +9153,7 @@ const machine_t machines[] = {
.fdc_device = NULL,
.sio_device = NULL,
.vid_device = &s3_phoenix_trio64_onboard_pci_device,
.snd_device = NULL,
.snd_device = &sb_vibra16s_onboard_device,
.net_device = NULL
},
/* This has an AMIKey-2, which is an updated version of type 'H'. */
@@ -9809,12 +9809,11 @@ const machine_t machines[] = {
.device = NULL,
.fdc_device = NULL,
.sio_device = NULL,
.vid_device = NULL,
.vid_device = &s3_virge_375_pci_device,
.snd_device = NULL,
.net_device = NULL
},
/* OEM version of Intel TC430HX, has AMI MegaKey KBC firmware on the PC87306
Super I/O chip */
/* OEM version of Intel TC430HX, has AMI MegaKey KBC firmware on the PC87306 Super I/O chip. */
{
.name = "[i430HX] Toshiba Infinia 7200",
.internal_name = "infinia7200",
@@ -9850,13 +9849,51 @@ const machine_t machines[] = {
.device = NULL,
.fdc_device = NULL,
.sio_device = NULL,
.vid_device = NULL,
.vid_device = &s3_virge_375_pci_device,
.snd_device = NULL,
.net_device = NULL
},
/* According to tests from real hardware: This has AMI MegaKey KBC firmware on the
PC87306 Super I/O chip, command 0xA1 returns '5'.
Command 0xA0 copyright string: (C)1994 AMI . */
/* OEM-only Intel CU430HX, has AMI MegaKey KBC firmware on the PC87306 Super I/O chip. */
{
.name = "[i430HX] Intel CU430HX",
.internal_name = "cu430hx",
.type = MACHINE_TYPE_SOCKET7,
.chipset = MACHINE_CHIPSET_INTEL_430HX,
.init = machine_at_cu430hx_init,
.p1_handler = NULL,
.gpio_handler = NULL,
.available_flag = MACHINE_AVAILABLE,
.gpio_acpi_handler = NULL,
.cpu = {
.package = CPU_PKG_SOCKET5_7,
.block = CPU_BLOCK_NONE,
.min_bus = 50000000,
.max_bus = 66666667,
.min_voltage = 2800,
.max_voltage = 3520,
.min_multi = 1.5,
.max_multi = 3.0
},
.bus_flags = MACHINE_PS2_PCI,
.flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI,
.ram = {
.min = 8192,
.max = 196608,
.step = 8192
},
.nvrmask = 255,
.kbc_device = NULL,
.kbc_p1 = 0xff,
.gpio = 0xffffffff,
.gpio_acpi = 0xffffffff,
.device = NULL,
.fdc_device = NULL,
.sio_device = NULL,
.vid_device = NULL,
.snd_device = &sb_vibra16c_onboard_device,
.net_device = NULL
},
/* OEM-only Intel CU430HX, has AMI MegaKey KBC firmware on the PC87306 Super I/O chip. */
{
.name = "[i430HX] Toshiba Equium 5200D",
.internal_name = "equium5200",
@@ -9878,7 +9915,7 @@ const machine_t machines[] = {
.max_multi = 3.0
},
.bus_flags = MACHINE_PS2_PCI,
.flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI,
.flags = MACHINE_IDE_DUAL | MACHINE_SOUND | MACHINE_APM | MACHINE_ACPI,
.ram = {
.min = 8192,
.max = 196608,
@@ -9893,7 +9930,7 @@ const machine_t machines[] = {
.fdc_device = NULL,
.sio_device = NULL,
.vid_device = NULL,
.snd_device = NULL,
.snd_device = &sb_vibra16c_onboard_device,
.net_device = NULL
},
/* According to tests from real hardware: This has AMI MegaKey KBC firmware on the
@@ -10327,7 +10364,7 @@ const machine_t machines[] = {
.max_multi = 3.0
},
.bus_flags = MACHINE_PS2_PCI,
.flags = MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI,
.flags = MACHINE_VIDEO | MACHINE_IDE_DUAL | MACHINE_APM | MACHINE_ACPI,
.ram = {
.min = 8192,
.max = 131072,
@@ -10341,7 +10378,7 @@ const machine_t machines[] = {
.device = NULL,
.fdc_device = NULL,
.sio_device = NULL,
.vid_device = NULL,
.vid_device = &s3_phoenix_trio64vplus_onboard_pci_device,
.snd_device = NULL,
.net_device = NULL
},
@@ -13380,11 +13417,23 @@ const machine_t machines[] = {
/* Saved copies - jumpers get applied to these.
We use also machine_gpio to store IBM PC/XT jumpers as they need more than one byte. */
static uint8_t machine_p1_default;
static uint8_t machine_p1;
static uint32_t machine_gpio_default;
static uint32_t machine_gpio;
static uint32_t machine_gpio_acpi_default;
static uint32_t machine_gpio_acpi;
void *machine_snd = NULL;
uint8_t
machine_get_p1_default(void)
{
return machine_p1_default;
}
uint8_t
machine_get_p1(void)
{
@@ -13392,11 +13441,22 @@ machine_get_p1(void)
}
void
machine_set_p1(uint8_t val)
machine_set_p1_default(uint8_t val)
{
machine_p1 = machines[machine].kbc_p1 & val;
machine_p1 = machine_p1_default = val;
}
void
machine_set_p1(uint8_t val)
{
machine_p1 = val;
}
void
machine_and_p1(uint8_t val)
{
machine_p1 = machine_p1_default & val;
}
uint8_t
machine_handle_p1(uint8_t write, uint8_t val)
@@ -13407,7 +13467,7 @@ machine_handle_p1(uint8_t write, uint8_t val)
ret = machines[machine].p1_handler(write, val);
else {
if (write)
machine_p1 = machines[machine].kbc_p1 & val;
machine_p1 = machine_p1_default & val;
else
ret = machine_p1;
}
@@ -13418,7 +13478,13 @@ machine_handle_p1(uint8_t write, uint8_t val)
void
machine_init_p1(void)
{
machine_p1 = machines[machine].kbc_p1;
machine_p1 = machine_p1_default = machines[machine].kbc_p1;
}
uint32_t
machine_get_gpio_default(void)
{
return machine_gpio_default;
}
uint32_t
@@ -13427,10 +13493,22 @@ machine_get_gpio(void)
return machine_gpio;
}
void
machine_set_gpio_default(uint32_t val)
{
machine_gpio = machine_gpio_default = val;
}
void
machine_set_gpio(uint32_t val)
{
machine_gpio = machines[machine].gpio & val;
machine_gpio = val;
}
void
machine_and_gpio(uint32_t val)
{
machine_gpio = machine_gpio_default & val;
}
uint32_t
@@ -13442,7 +13520,7 @@ machine_handle_gpio(uint8_t write, uint32_t val)
ret = machines[machine].gpio_handler(write, val);
else {
if (write)
machine_gpio = machines[machine].gpio & val;
machine_gpio = machine_gpio_default & val;
else
ret = machine_gpio;
}
@@ -13453,7 +13531,13 @@ machine_handle_gpio(uint8_t write, uint32_t val)
void
machine_init_gpio(void)
{
machine_gpio = machines[machine].gpio;
machine_gpio = machine_gpio_default = machines[machine].gpio;
}
uint32_t
machine_get_gpio_acpi_default(void)
{
return machine_gpio_acpi_default;
}
uint32_t
@@ -13462,10 +13546,22 @@ machine_get_gpio_acpi(void)
return machine_gpio_acpi;
}
void
machine_set_gpio_acpi_default(uint32_t val)
{
machine_gpio_acpi = machine_gpio_acpi_default = val;
}
void
machine_set_gpio_acpi(uint32_t val)
{
machine_gpio_acpi = machines[machine].gpio_acpi & val;
machine_gpio_acpi = val;
}
void
machine_and_gpio_acpi(uint32_t val)
{
machine_gpio_acpi = machine_gpio_acpi_default & val;
}
uint32_t
@@ -13477,7 +13573,7 @@ machine_handle_gpio_acpi(uint8_t write, uint32_t val)
ret = machines[machine].gpio_acpi_handler(write, val);
else {
if (write)
machine_gpio_acpi = machines[machine].gpio_acpi & val;
machine_gpio_acpi = machine_gpio_acpi_default & val;
else
ret = machine_gpio_acpi;
}
@@ -13488,7 +13584,7 @@ machine_handle_gpio_acpi(uint8_t write, uint32_t val)
void
machine_init_gpio_acpi(void)
{
machine_gpio_acpi = machines[machine].gpio_acpi;
machine_gpio_acpi = machine_gpio_acpi_default = machines[machine].gpio_acpi;
}
int

View File

@@ -38,22 +38,6 @@
#include <86box/plat.h>
#include <86box/rom.h>
#include <86box/gdbstub.h>
#ifdef USE_DYNAREC
# include "codegen_public.h"
#else
# ifdef USE_NEW_DYNAREC
# define PAGE_MASK_SHIFT 6
# else
# define PAGE_MASK_INDEX_MASK 3
# define PAGE_MASK_INDEX_SHIFT 10
# define PAGE_MASK_SHIFT 4
# endif
# define PAGE_MASK_MASK 63
#endif
#if (!defined(USE_DYNAREC) && defined(USE_NEW_DYNAREC))
# define BLOCK_PC_INVALID 0xffffffff
# define BLOCK_INVALID 0
#endif
uint8_t
mem_readb_map(uint32_t addr)

View File

@@ -54,7 +54,6 @@ static pc_timer_t pic_timer;
static int shadow = 0;
static int elcr_enabled = 0;
static int tmr_inited = 0;
static int latched = 0;
static int pic_pci = 0;
static int kbd_latch = 0;
static int mouse_latch = 0;

View File

@@ -212,7 +212,7 @@ msgid "&Existing image..."
msgstr "既存のイメージを開く(&E)..."
msgid "Existing image (&Write-protected)..."
msgstr "既存のイメージを開く(書き込み保護)(&W)..."
msgstr "既存のイメージを開く(書き込み禁止)(&W)..."
msgid "&Record"
msgstr "録音(&R)"
@@ -311,7 +311,7 @@ msgid "Icon set:"
msgstr "アイコンセット:"
msgid "Gain"
msgstr "ゲイン値"
msgstr "音量"
msgid "File name:"
msgstr "ファイル名:"
@@ -335,7 +335,7 @@ msgid "Lock to this size"
msgstr "サイズを固定"
msgid "Machine type:"
msgstr "マシン タイプ:"
msgstr "マシンタイプ:"
msgid "Machine:"
msgstr "マシン:"
@@ -374,7 +374,7 @@ msgid "Enabled (UTC)"
msgstr "有効(UTC)"
msgid "Dynamic Recompiler"
msgstr "動的コンパイ"
msgstr "動的コンパイ"
msgid "Video:"
msgstr "ビデオカード:"
@@ -638,7 +638,7 @@ msgid " - PAUSED"
msgstr " - 一時停止"
msgid "Press Ctrl+Alt+PgDn to return to windowed mode."
msgstr "Ctrl+Alt+PgDnでウィンドウモードに戻ります。"
msgstr "Ctrl+Alt+PgDnでウィンドウ モードに戻ります。"
msgid "Speed"
msgstr "速度"
@@ -650,7 +650,7 @@ msgid "ZIP images"
msgstr "ZIPイメージ"
msgid "86Box could not find any usable ROM images.\n\nPlease <a href=\"https://github.com/86Box/roms/releases/latest\">download</a> a ROM set and extract it into the \"roms\" directory."
msgstr "86Boxで使用可能なROMイメージが見つかりませんでした。\n\nROMセットを<a href=\"https://github.com/86Box/roms/releases/latest\">ダウンロード</a>して、romsディレクトリに解凍してください。"
msgstr "86Boxで使用可能なROMイメージが見つかりません。\n\nROMセットを<a href=\"https://github.com/86Box/roms/releases/latest\">ダウンロード</a>して、roms ディレクトリに解凍してください。"
msgid "(empty)"
msgstr "(空)"
@@ -671,10 +671,10 @@ msgid "All images"
msgstr "すべてのイメージ"
msgid "Basic sector images"
msgstr "基本的なセクターイメージ"
msgstr "ベーシック セクター イメージ"
msgid "Surface images"
msgstr "表面イメージ"
msgstr "サーフェス イメージ"
msgid "Machine \"%hs\" is not available due to missing ROMs in the roms/machines directory. Switching to an available machine."
msgstr "roms/machines ディレクトリにROMがないため、マシン「%hs」は使用できません。使用可能なマシンに切り替えます。"
@@ -686,7 +686,7 @@ msgid "Machine"
msgstr "マシン"
msgid "Display"
msgstr "画面表示"
msgstr "ディスプレイ"
msgid "Input devices"
msgstr "入力デバイス"
@@ -701,28 +701,28 @@ msgid "Ports (COM & LPT)"
msgstr "ポート (COM/LPT)"
msgid "Storage controllers"
msgstr "ストレージ コントローラ"
msgstr "ストレージコントローラ"
msgid "Hard disks"
msgstr "ハード ディスク"
msgstr "ハードディスク"
msgid "Floppy & CD-ROM drives"
msgstr "フロッピー/CD-ROMドライブ"
msgstr "フロッピーCD-ROMドライブ"
msgid "Other removable devices"
msgstr "他のリムーバブル デバイス"
msgstr "他のリムーバブルデバイス"
msgid "Other peripherals"
msgstr "他の周辺デバイス"
msgid "Click to capture mouse"
msgstr "クリックするとマウスをキャプチャします"
msgstr "クリックマウスをキャプチャします"
msgid "Press F8+F12 to release mouse"
msgstr "F8+F12キーでマウスを解放します"
msgid "Press F8+F12 or middle button to release mouse"
msgstr "F8+F12キーまたはマウスの中ボタンを押してマウスを解放します"
msgstr "F8+F12キーまたは中クリックでマウスを解放します"
msgid "Bus"
msgstr "バス"
@@ -761,7 +761,7 @@ msgid "No PCap devices found"
msgstr "PCapデバイスがありません"
msgid "Invalid PCap device"
msgstr "不正なPCapデバイスです"
msgstr "不正なPCapデバイス"
msgid "Standard 2-button joystick(s)"
msgstr "標準ジョイスティック(2ボタン)"
@@ -899,7 +899,7 @@ msgid "CD-ROM images"
msgstr "CD-ROMイメージ"
msgid "%hs Device Configuration"
msgstr "%hs デバイス設定"
msgstr "%hs デバイス設定"
msgid "Monitor in sleep mode"
msgstr "モニターのスリープモード"
@@ -911,7 +911,7 @@ msgid "OpenGL options"
msgstr "OpenGL設定"
msgid "You are loading an unsupported configuration"
msgstr "サポートされていない設定を読み込んでいます"
msgstr "読み込んでいる設定がサポートされません"
msgid "CPU type filtering based on selected machine is disabled for this emulated machine.\n\nThis makes it possible to choose a CPU that is otherwise incompatible with the selected machine. However, you may run into incompatibilities with the machine BIOS or other software.\n\nEnabling this setting is not officially supported and any bug reports filed may be closed as invalid."
msgstr "選択したマシンに基づくCPUタイプのフィルター機能は、使用中のマシンでは無効になっています。\n\nこれにより、選択したマシンと互換性のないCPUが選択できます。しかし、マシンのBIOSや他のソフトウェアと互換性がない場合があります。\n\nこの設定を有効にすることは公式にはサポートされておらず、バグレポートは無効として中止される可能性があります。"
@@ -935,7 +935,7 @@ msgid "Error initializing renderer"
msgstr "レンダラーの初期化エラー"
msgid "OpenGL (3.0 Core) renderer could not be initialized. Use another renderer."
msgstr "OpenGL (3.0コア) レンダラーが初期化できませんでした。別のレンダラーを使用してください。"
msgstr "OpenGL (3.0コア) レンダラーが初期化できません。別のレンダラーを使用してください。"
msgid "Resume execution"
msgstr "実行を再開"
@@ -944,10 +944,10 @@ msgid "Pause execution"
msgstr "実行を一時停止"
msgid "Press Ctrl+Alt+Del"
msgstr "Ctrl+Alt+DELを押"
msgstr "Ctrl+Alt+DELを押"
msgid "Press Ctrl+Alt+Esc"
msgstr "Ctrl+Alt+Escを押"
msgstr "Ctrl+Alt+Escを押"
msgid "Hard reset"
msgstr "ハードリセット"
@@ -965,13 +965,13 @@ msgid "%01i"
msgstr "%01i"
msgid "MFM/RLL or ESDI CD-ROM drives never existed"
msgstr "MFM/RLLまたはESDICD-ROMドライブが存在しません"
msgstr "MFM/RLLESDI CD-ROMドライブが存在しません"
msgid "Custom..."
msgstr "カスタム..."
msgid "Custom (large)..."
msgstr "カスタム (大)..."
msgstr "カスタム (大容量)..."
msgid "Add New Hard Disk"
msgstr "新規のディスクを追加"
@@ -1181,7 +1181,7 @@ msgid "5.25\" 1.3 GB"
msgstr "5.25\" 1.3 GB"
msgid "Perfect RPM"
msgstr "規定のRPM"
msgstr "既定RPM"
msgid "1% below perfect RPM"
msgstr "1%低いRPM"

View File

@@ -35,6 +35,7 @@
#include <86box/fdc.h>
#include <86box/sio.h>
#include <86box/plat_unused.h>
#include <86box/machine.h>
typedef struct pc87306_t {
uint8_t tries;
@@ -51,16 +52,32 @@ static void
pc87306_gpio_write(uint16_t port, uint8_t val, void *priv)
{
pc87306_t *dev = (pc87306_t *) priv;
uint32_t gpio = 0xffff0000;
dev->gpio[port & 1] = val;
dev->gpio[port & 0x0001] = val;
if (port & 0x0001) {
gpio |= ((uint32_t) val) << 8;
gpio |= dev->gpio[0];
} else {
gpio |= ((uint32_t) dev->gpio[1]) << 8;
gpio |= val;
}
(void) machine_handle_gpio(1, gpio);
}
uint8_t
pc87306_gpio_read(uint16_t port, void *priv)
{
const pc87306_t *dev = (pc87306_t *) priv;
uint32_t ret = machine_handle_gpio(0, 0xffffffff);
return dev->gpio[port & 1];
if (port & 0x0001)
ret = (ret >> 8) & 0xff;
else
ret &= 0xff;
return ret;
}
static void
@@ -81,11 +98,11 @@ pc87306_gpio_init(pc87306_t *dev)
if (dev->gpioba != 0x0000) {
if ((dev->regs[0x12]) & 0x10)
io_sethandler(dev->regs[0x0f] << 2, 0x0001,
io_sethandler(dev->gpioba, 0x0001,
pc87306_gpio_read, NULL, NULL, pc87306_gpio_write, NULL, NULL, dev);
if ((dev->regs[0x12]) & 0x20)
io_sethandler((dev->regs[0x0f] << 2) + 1, 0x0001,
io_sethandler(dev->gpioba + 1, 0x0001,
pc87306_gpio_read, NULL, NULL, pc87306_gpio_write, NULL, NULL, dev);
}
}
@@ -236,8 +253,6 @@ pc87306_write(uint16_t port, uint8_t val, void *priv)
if ((dev->cur_reg <= 28) && (dev->cur_reg != 8)) {
if (dev->cur_reg == 0)
val &= 0x5f;
if (((dev->cur_reg == 0x0F) || (dev->cur_reg == 0x12)) && valxor)
pc87306_gpio_remove(dev);
dev->regs[dev->cur_reg] = val;
} else
return;
@@ -248,7 +263,7 @@ pc87306_write(uint16_t port, uint8_t val, void *priv)
}
switch (dev->cur_reg) {
case 0:
case 0x00:
if (valxor & 1) {
lpt1_remove();
if ((val & 1) && !(dev->regs[2] & 1))
@@ -270,7 +285,7 @@ pc87306_write(uint16_t port, uint8_t val, void *priv)
fdc_set_base(dev->fdc, (val & 0x20) ? FDC_SECONDARY_ADDR : FDC_PRIMARY_ADDR);
}
break;
case 1:
case 0x01:
if (valxor & 3) {
lpt1_remove();
if ((dev->regs[0] & 1) && !(dev->regs[2] & 1))
@@ -287,7 +302,7 @@ pc87306_write(uint16_t port, uint8_t val, void *priv)
serial_handler(dev, 1);
}
break;
case 2:
case 0x02:
if (valxor & 1) {
lpt1_remove();
serial_remove(dev->uart[0]);
@@ -311,23 +326,23 @@ pc87306_write(uint16_t port, uint8_t val, void *priv)
lpt1_handler(dev);
}
break;
case 4:
case 0x04:
if (valxor & 0x80)
nvr_lock_set(0x00, 256, !!(val & 0x80), dev->nvr);
break;
case 5:
case 0x05:
if (valxor & 0x08)
nvr_at_handler(!!(val & 0x08), 0x0070, dev->nvr);
if (valxor & 0x20)
nvr_bank_set(0, !!(val & 0x20), dev->nvr);
break;
case 9:
case 0x09:
if (valxor & 0x44) {
fdc_update_enh_mode(dev->fdc, (val & 4) ? 1 : 0);
fdc_update_densel_polarity(dev->fdc, (val & 0x40) ? 1 : 0);
}
break;
case 0xF:
case 0x0f:
if (valxor)
pc87306_gpio_handler(dev);
break;
@@ -394,7 +409,7 @@ pc87306_read(uint16_t port, void *priv)
}
void
pc87306_reset(void *priv)
pc87306_reset_common(void *priv)
{
pc87306_t *dev = (pc87306_t *) priv;
@@ -411,9 +426,6 @@ pc87306_reset(void *priv)
dev->regs[0x12] = 0x30;
dev->regs[0x19] = 0xEF;
dev->gpio[0] = 0xff;
dev->gpio[1] = 0xfb;
/*
0 = 360 rpm @ 500 kbps for 3.5"
1 = Default, 300 rpm @ 500, 300, 250, 1000 kbps for 3.5"
@@ -432,6 +444,17 @@ pc87306_reset(void *priv)
nvr_wp_set(0, 0, dev->nvr);
}
void
pc87306_reset(void *priv)
{
pc87306_t *dev = (pc87306_t *) priv;
pc87306_gpio_write(0x0000, 0xff, dev);
pc87306_gpio_write(0x0001, 0xff, dev);
pc87306_reset_common(dev);
}
static void
pc87306_close(void *priv)
{
@@ -453,7 +476,9 @@ pc87306_init(UNUSED(const device_t *info))
dev->nvr = device_add(&at_mb_nvr_device);
pc87306_reset(dev);
dev->gpio[0] = dev->gpio[1] = 0xff;
pc87306_reset_common(dev);
io_sethandler(0x02e, 0x0002,
pc87306_read, NULL, NULL, pc87306_write, NULL, NULL, dev);

View File

@@ -98,7 +98,7 @@ public:
memset(m_samples, 0, sizeof(m_samples));
memset(m_oldsamples, 0, sizeof(m_oldsamples));
m_rateratio = (samplerate << RSM_FRAC) / m_chip.sample_rate(m_clock);
m_clock_us = 1000000 / (double) m_clock;
m_clock_us = 1000000.0 / (double) m_clock;
m_subtract[0] = 80.0;
m_subtract[1] = 320.0;
m_type = type;
@@ -139,7 +139,7 @@ public:
virtual void set_clock(uint32_t clock) override
{
m_clock = clock;
m_clock_us = 1000000 / (double) m_clock;
m_clock_us = 1000000.0 / (double) m_clock;
m_rateratio = (m_samplerate << RSM_FRAC) / m_chip.sample_rate(m_clock);
ymfm_set_timer(0, m_duration_in_clocks[0]);
@@ -150,9 +150,14 @@ public:
{
for (uint32_t i = 0; i < num_samples; i++) {
m_chip.generate(&m_output);
if(m_type == FM_YMF278B) {
*data++ += m_output.data[4 % ChipType::OUTPUTS];
*data++ += m_output.data[5 % ChipType::OUTPUTS];
if ((m_type == FM_YMF278B) && (sizeof(m_output.data) > (4 * sizeof(int32_t)))) {
if (ChipType::OUTPUTS == 1) {
*data++ += m_output.data[4];
*data++ += m_output.data[4];
} else {
*data++ += m_output.data[4];
*data++ += m_output.data[5];
}
} else if (ChipType::OUTPUTS == 1) {
*data++ = m_output.data[0];
*data++ = m_output.data[0];
@@ -170,9 +175,14 @@ public:
m_oldsamples[0] = m_samples[0];
m_oldsamples[1] = m_samples[1];
m_chip.generate(&m_output);
if(m_type == FM_YMF278B) {
m_samples[0] += m_output.data[4 % ChipType::OUTPUTS];
m_samples[1] += m_output.data[5 % ChipType::OUTPUTS];
if ((m_type == FM_YMF278B) && (sizeof(m_output.data) > (4 * sizeof(int32_t)))) {
if (ChipType::OUTPUTS == 1) {
m_samples[0] += m_output.data[4];
m_samples[1] += m_output.data[4];
} else {
m_samples[0] += m_output.data[4];
m_samples[1] += m_output.data[5];
}
} else if (ChipType::OUTPUTS == 1) {
m_samples[0] = m_output.data[0];
m_samples[1] = m_output.data[0];
@@ -312,11 +322,13 @@ ymfm_drv_init(const device_t *info)
break;
case FM_YMF289B:
fm = (YMFMChipBase *) new YMFMChip<ymfm::ymf289b>(33868800, FM_YMF289B, OPL_FREQ);
/* According to the datasheet, we should be using 33868800, but YMFM appears
to cheat and does it using the same values as the YMF262. */
fm = (YMFMChipBase *) new YMFMChip<ymfm::ymf289b>(14318181, FM_YMF289B, 44100);
break;
case FM_YMF278B:
fm = (YMFMChipBase *) new YMFMChip<ymfm::ymf278b>(33868800, FM_YMF278B, 48000);
fm = (YMFMChipBase *) new YMFMChip<ymfm::ymf278b>(33868800, FM_YMF278B, 44100);
break;
}

View File

@@ -854,6 +854,15 @@ sb_ct1745_mixer_write(uint16_t addr, uint8_t val, void *priv)
case 0x84:
/* MPU Control register, per the Linux source code. */
/* Bits 2-1: MPU-401 address:
0, 0 = 330h;
0, 1 = Disabled;
1, 0 = 300h;
1, 1 = ???? (Reserved?)
Bit 0: Gameport address:
0, 0 = 200-207h;
0, 1 = Disabled
*/
if (sb->mpu != NULL) {
if ((val & 0x06) == 0x00)
mpu401_change_addr(sb->mpu, 0x330);
@@ -862,6 +871,12 @@ sb_ct1745_mixer_write(uint16_t addr, uint8_t val, void *priv)
else if ((val & 0x06) == 0x02)
mpu401_change_addr(sb->mpu, 0);
}
sb->gameport_addr = 0;
gameport_remap(sb->gameport, 0);
if (!(val & 0x01)) {
sb->gameport_addr = 0x200;
gameport_remap(sb->gameport, 0x200);
}
break;
default:
@@ -1055,6 +1070,8 @@ sb_ct1745_mixer_read(uint16_t addr, void *priv)
else
ret = 0x06; /* Should never happen. */
}
if (!sb->gameport_addr)
ret |= 0x01;
break;
case 0x90:
@@ -1375,6 +1392,45 @@ sb_16_reply_mca_write(int port, uint8_t val, void *priv)
sb_dsp_setdma16(&sb->dsp, high_dma);
}
void
sb_vibra16s_onboard_relocate_base(uint16_t new_addr, void *priv)
{
sb_t *sb = (sb_t *) priv;
uint16_t addr = sb->dsp.sb_addr;
io_removehandler(addr, 0x0004,
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
io_removehandler(addr + 8, 0x0002,
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
io_removehandler(addr + 4, 0x0002,
sb_ct1745_mixer_read, NULL, NULL,
sb_ct1745_mixer_write, NULL, NULL,
sb);
sb_dsp_setaddr(&sb->dsp, 0);
addr = new_addr;
io_sethandler(addr, 0x0004,
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
io_sethandler(addr + 8, 0x0002,
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
io_sethandler(addr + 4, 0x0002,
sb_ct1745_mixer_read, NULL, NULL,
sb_ct1745_mixer_write, NULL, NULL,
sb);
sb_dsp_setaddr(&sb->dsp, addr);
}
static void
sb_16_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv)
{
@@ -1481,6 +1537,100 @@ sb_16_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv)
}
}
static void
sb_vibra16_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv)
{
sb_t *sb = (sb_t *) priv;
uint16_t addr = sb->dsp.sb_addr;
uint8_t val;
switch (ld) {
case 0: /* Audio */
io_removehandler(addr, 0x0004,
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
io_removehandler(addr + 8, 0x0002,
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
io_removehandler(addr + 4, 0x0002,
sb_ct1745_mixer_read, NULL, NULL,
sb_ct1745_mixer_write, NULL, NULL,
sb);
addr = sb->opl_pnp_addr;
if (addr) {
sb->opl_pnp_addr = 0;
io_removehandler(addr, 0x0004,
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
}
sb_dsp_setaddr(&sb->dsp, 0);
sb_dsp_setirq(&sb->dsp, 0);
sb_dsp_setdma8(&sb->dsp, ISAPNP_DMA_DISABLED);
sb_dsp_setdma16(&sb->dsp, ISAPNP_DMA_DISABLED);
mpu401_change_addr(sb->mpu, 0);
if (config->activate) {
addr = config->io[0].base;
if (addr != ISAPNP_IO_DISABLED) {
io_sethandler(addr, 0x0004,
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
io_sethandler(addr + 8, 0x0002,
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
io_sethandler(addr + 4, 0x0002,
sb_ct1745_mixer_read, NULL, NULL,
sb_ct1745_mixer_write, NULL, NULL,
sb);
sb_dsp_setaddr(&sb->dsp, addr);
}
addr = config->io[1].base;
if (addr != ISAPNP_IO_DISABLED)
mpu401_change_addr(sb->mpu, addr);
addr = config->io[2].base;
if (addr != ISAPNP_IO_DISABLED) {
sb->opl_pnp_addr = addr;
io_sethandler(addr, 0x0004,
sb->opl.read, NULL, NULL,
sb->opl.write, NULL, NULL,
sb->opl.priv);
}
val = config->irq[0].irq;
if (val != ISAPNP_IRQ_DISABLED)
sb_dsp_setirq(&sb->dsp, val);
val = config->dma[0].dma;
if (val != ISAPNP_DMA_DISABLED)
sb_dsp_setdma8(&sb->dsp, val);
val = config->dma[1].dma;
if (val != ISAPNP_DMA_DISABLED)
sb_dsp_setdma16(&sb->dsp, val);
}
break;
case 1: /* Game */
gameport_remap(sb->gameport, (config->activate && (config->io[0].base != ISAPNP_IO_DISABLED)) ? config->io[0].base : 0);
break;
default:
break;
}
}
static void
sb_awe32_pnp_config_changed(uint8_t ld, isapnp_device_config_t *config, void *priv)
{
@@ -1926,7 +2076,7 @@ sb_16_init(UNUSED(const device_t *info))
sb->opl_enabled = device_get_config_int("opl");
if (sb->opl_enabled)
fm_driver_get(FM_YMF262, &sb->opl);
fm_driver_get(info->local, &sb->opl);
sb_dsp_init(&sb->dsp, SB16, SB_SUBTYPE_DEFAULT, sb);
sb_dsp_setaddr(&sb->dsp, addr);
@@ -1968,6 +2118,9 @@ sb_16_init(UNUSED(const device_t *info))
if (device_get_config_int("receive_input"))
midi_in_handler(1, sb_dsp_input_msg, sb_dsp_input_sysex, &sb->dsp);
sb->gameport = gameport_add(&gameport_pnp_device);
sb->gameport_addr = 0x200;
return sb;
}
@@ -2003,6 +2156,8 @@ sb_16_reply_mca_init(UNUSED(const device_t *info))
sb->pos_regs[0] = 0x38;
sb->pos_regs[1] = 0x51;
sb->gameport_addr = 0x200;
return sb;
}
@@ -2045,6 +2200,94 @@ sb_16_pnp_init(UNUSED(const device_t *info))
mpu401_change_addr(sb->mpu, 0);
ide_remove_handlers(2);
sb->gameport_addr = 0;
gameport_remap(sb->gameport, 0);
return sb;
}
static int
sb_vibra16xv_available(void)
{
return rom_present("roms/sound/CT4170 PnP.BIN");
}
static int
sb_vibra16c_available(void)
{
return rom_present("roms/sound/CT4180 PnP.BIN");
}
static void *
sb_vibra16_pnp_init(UNUSED(const device_t *info))
{
sb_t *sb = malloc(sizeof(sb_t));
memset(sb, 0x00, sizeof(sb_t));
sb->opl_enabled = 1;
fm_driver_get(FM_YMF262, &sb->opl);
sb_dsp_init(&sb->dsp, SB16, SB_SUBTYPE_DEFAULT, sb);
sb_ct1745_mixer_reset(sb);
sb->mixer_enabled = 1;
sb->mixer_sb16.output_filter = 1;
sound_add_handler(sb_get_buffer_sb16_awe32, sb);
sound_set_cd_audio_filter(sb16_awe32_filter_cd_audio, sb);
sb->mpu = (mpu_t *) malloc(sizeof(mpu_t));
memset(sb->mpu, 0, sizeof(mpu_t));
mpu401_init(sb->mpu, 0, 0, M_UART, device_get_config_int("receive_input401"));
sb_dsp_set_mpu(&sb->dsp, sb->mpu);
if (device_get_config_int("receive_input"))
midi_in_handler(1, sb_dsp_input_msg, sb_dsp_input_sysex, &sb->dsp);
sb->gameport = gameport_add(&gameport_pnp_device);
const char *pnp_rom_file = NULL;
switch (info->local) {
case 0:
pnp_rom_file = "roms/sound/CT4170 PnP.BIN";
break;
case 1:
pnp_rom_file = "roms/sound/CT4180 PnP.BIN";
break;
default:
break;
}
uint8_t *pnp_rom = NULL;
if (pnp_rom_file) {
FILE *fp = rom_fopen(pnp_rom_file, "rb");
if (fp) {
if (fread(sb->pnp_rom, 1, 512, fp) == 512)
pnp_rom = sb->pnp_rom;
fclose(fp);
}
}
switch (info->local) {
case 0:
case 1:
isapnp_add_card(pnp_rom, sizeof(sb->pnp_rom), sb_vibra16_pnp_config_changed,
NULL, NULL, NULL, sb);
break;
default:
break;
}
sb_dsp_setaddr(&sb->dsp, 0);
sb_dsp_setirq(&sb->dsp, 0);
sb_dsp_setdma8(&sb->dsp, ISAPNP_DMA_DISABLED);
sb_dsp_setdma16(&sb->dsp, ISAPNP_DMA_DISABLED);
mpu401_change_addr(sb->mpu, 0);
sb->gameport_addr = 0;
gameport_remap(sb->gameport, 0);
return sb;
@@ -2069,6 +2312,9 @@ sb_16_compat_init(const device_t *info)
mpu401_init(sb->mpu, 0, 0, M_UART, info->local);
sb_dsp_set_mpu(&sb->dsp, sb->mpu);
sb->gameport = gameport_add(&gameport_pnp_device);
sb->gameport_addr = 0x200;
return sb;
}
@@ -2165,6 +2411,9 @@ sb_awe32_init(UNUSED(const device_t *info))
if (device_get_config_int("receive_input"))
midi_in_handler(1, sb_dsp_input_msg, sb_dsp_input_sysex, &sb->dsp);
sb->gameport = gameport_add(&gameport_pnp_device);
sb->gameport_addr = 0x200;
return sb;
}
@@ -2264,6 +2513,8 @@ sb_awe32_pnp_init(const device_t *info)
emu8k_change_addr(&sb->emu8k, 0);
sb->gameport_addr = 0;
gameport_remap(sb->gameport, 0);
return sb;
@@ -3599,7 +3850,7 @@ const device_t sb_16_device = {
.name = "Sound Blaster 16",
.internal_name = "sb16",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.local = FM_YMF262,
.init = sb_16_init,
.close = sb_close,
.reset = NULL,
@@ -3609,6 +3860,76 @@ const device_t sb_16_device = {
.config = sb_16_config
};
const device_t sb_vibra16s_onboard_device = {
.name = "Sound Blaster Vibra 16S (On-Board)",
.internal_name = "sb_vibra16s_onboard",
.flags = DEVICE_ISA | DEVICE_AT,
.local = FM_YMF289B,
.init = sb_16_init,
.close = sb_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_16_config
};
const device_t sb_vibra16s_device = {
.name = "Sound Blaster Vibra 16S",
.internal_name = "sb_vibra16s",
.flags = DEVICE_ISA | DEVICE_AT,
.local = FM_YMF289B,
.init = sb_16_init,
.close = sb_close,
.reset = NULL,
{ .available = NULL },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_16_config
};
const device_t sb_vibra16xv_device = {
.name = "Sound Blaster Vibra 16XV",
.internal_name = "sb_vibra16xv",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 0,
.init = sb_vibra16_pnp_init,
.close = sb_close,
.reset = NULL,
{ .available = sb_vibra16xv_available },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_16_pnp_config
};
const device_t sb_vibra16c_onboard_device = {
.name = "Sound Blaster Vibra 16C (On-Board)",
.internal_name = "sb_vibra16c_onboard",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 1,
.init = sb_vibra16_pnp_init,
.close = sb_close,
.reset = NULL,
{ .available = sb_vibra16c_available },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_16_pnp_config
};
const device_t sb_vibra16c_device = {
.name = "Sound Blaster Vibra 16C",
.internal_name = "sb_vibra16c",
.flags = DEVICE_ISA | DEVICE_AT,
.local = 1,
.init = sb_vibra16_pnp_init,
.close = sb_close,
.reset = NULL,
{ .available = sb_vibra16c_available },
.speed_changed = sb_speed_changed,
.force_redraw = NULL,
.config = sb_16_pnp_config
};
const device_t sb_16_reply_mca_device = {
.name = "Sound Blaster 16 Reply MCA",
.internal_name = "sb16_reply_mca",

View File

@@ -134,6 +134,9 @@ static const SOUND_CARD sound_cards[] = {
{ &sb_awe64_value_device },
{ &sb_awe64_device },
{ &sb_awe64_gold_device },
{ &sb_vibra16c_device },
{ &sb_vibra16s_device },
{ &sb_vibra16xv_device },
{ &ssi2001_device },
#if defined(DEV_BRANCH) && defined(USE_PAS16)
{ &pas16_device },
@@ -219,7 +222,7 @@ sound_card_get_from_internal_name(const char *s)
void
sound_card_init(void)
{
if (sound_cards[sound_card_current[0]].device)
if ((sound_card_current[0] != SOUND_INTERNAL) && (sound_cards[sound_card_current[0]].device))
device_add(sound_cards[sound_card_current[0]].device);
if (sound_cards[sound_card_current[1]].device)
device_add(sound_cards[sound_card_current[1]].device);
@@ -512,14 +515,14 @@ sound_reset(void)
filter_cd_audio_p = NULL;
sound_set_cd_volume(65535, 65535);
/* Reset the MPU-401 already loaded flag and the chain of input/output handlers. */
midi_in_handlers_clear();
}
void
sound_card_reset(void)
{
/* Reset the MPU-401 already loaded flag and the chain of input/output handlers. */
midi_in_handlers_clear();
sound_card_init();
if (mpu401_standalone_enable)

View File

@@ -1523,7 +1523,7 @@ void fm_engine_base<RegisterType>::engine_timer_expired(uint32_t tnum)
}
// Make sure the array does not go out of bounds to keep gcc happy
if(tnum < 2) {
if ((tnum < 2) || (sizeof(m_timer_running) > (2 * sizeof(uint8_t)))) {
// reset
m_timer_running[tnum] = false;
}

View File

@@ -34,6 +34,8 @@
#include <86box/plat.h>
#include <86box/thread.h>
#include <86box/video.h>
#include <86box/vid_8514a.h>
#include <86box/vid_xga.h>
#include <86box/vid_svga.h>
#include <86box/vid_svga_render.h>
#include "cpu.h"
@@ -193,7 +195,7 @@ int ibm8514_active = 0;
int
ibm8514_cpu_src(svga_t *svga)
{
const ibm8514_t *dev = &svga->dev8514;
const ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
if (!(dev->accel.cmd & 0x100))
return 0;
@@ -207,7 +209,7 @@ ibm8514_cpu_src(svga_t *svga)
int
ibm8514_cpu_dest(svga_t *svga)
{
const ibm8514_t *dev = &svga->dev8514;
const ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
if (!(dev->accel.cmd & 0x100))
return 0;
@@ -221,7 +223,7 @@ ibm8514_cpu_dest(svga_t *svga)
void
ibm8514_accel_out_pixtrans(svga_t *svga, UNUSED(uint16_t port), uint16_t val, int len)
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
uint8_t nibble = 0;
uint32_t pixelxfer = 0;
uint32_t monoxfer = 0xffffffff;
@@ -443,7 +445,7 @@ regular_nibble:
static void
ibm8514_accel_out_fifo(svga_t *svga, uint16_t port, uint32_t val, int len)
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
switch (port) {
case 0x82e8:
@@ -845,7 +847,7 @@ ibm8514_io_set(svga_t *svga)
static void
ibm8514_accel_out(uint16_t port, uint32_t val, svga_t *svga, int len)
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
if (port & 0x8000) {
ibm8514_accel_out_fifo(svga, port, val, len);
@@ -993,7 +995,7 @@ ibm8514_accel_outw(uint16_t port, uint16_t val, void *priv)
static uint32_t
ibm8514_accel_in(uint16_t port, svga_t *svga, int len)
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
uint32_t temp = 0;
int cmd;
int vpos = 0;
@@ -1138,7 +1140,7 @@ ibm8514_accel_inw(uint16_t port, void *priv)
void
ibm8514_short_stroke_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, uint8_t ssv, int len)
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
if (!cpu_input) {
dev->accel.ssv_len = ssv & 0x0f;
@@ -1156,7 +1158,7 @@ ibm8514_short_stroke_start(int count, int cpu_input, uint32_t mix_dat, uint32_t
void
ibm8514_accel_start(int count, int cpu_input, uint32_t mix_dat, uint32_t cpu_dat, svga_t *svga, UNUSED(int len))
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
uint16_t *vram_w = (uint16_t *) dev->vram;
uint16_t src_dat = 0;
uint16_t dest_dat;
@@ -3817,7 +3819,7 @@ bitblt:
void
ibm8514_render_8bpp(svga_t *svga)
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
uint32_t *p;
uint32_t dat;
@@ -3855,7 +3857,7 @@ ibm8514_render_8bpp(svga_t *svga)
void
ibm8514_render_15bpp(svga_t *svga)
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
int x;
uint32_t *p;
uint32_t dat;
@@ -3896,7 +3898,7 @@ ibm8514_render_15bpp(svga_t *svga)
void
ibm8514_render_16bpp(svga_t *svga)
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
int x;
uint32_t *p;
uint32_t dat;
@@ -3937,7 +3939,7 @@ ibm8514_render_16bpp(svga_t *svga)
void
ibm8514_render_24bpp(svga_t *svga)
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
uint32_t *p;
uint32_t dat;
@@ -3973,7 +3975,7 @@ ibm8514_render_24bpp(svga_t *svga)
void
ibm8514_render_BGR(svga_t *svga)
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
uint32_t *p;
uint32_t dat;
@@ -4009,7 +4011,7 @@ ibm8514_render_BGR(svga_t *svga)
void
ibm8514_render_ABGR8888(svga_t *svga)
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
int x;
uint32_t *p;
uint32_t dat;
@@ -4036,7 +4038,7 @@ ibm8514_render_ABGR8888(svga_t *svga)
void
ibm8514_render_RGBA8888(svga_t *svga)
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
int x;
uint32_t *p;
uint32_t dat;
@@ -4090,8 +4092,9 @@ ibm8514_render_overscan_right(ibm8514_t *dev, svga_t *svga)
}
void
ibm8514_poll(ibm8514_t *dev, svga_t *svga)
ibm8514_poll(void *priv, svga_t *svga)
{
ibm8514_t *dev = (ibm8514_t *) priv;
uint32_t x;
int wx;
int wy;
@@ -4238,7 +4241,7 @@ ibm8514_poll(ibm8514_t *dev, svga_t *svga)
void
ibm8514_recalctimings(svga_t *svga)
{
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
if (dev->on) {
dev->h_disp = (dev->hdisp + 1) << 3;
@@ -4307,7 +4310,7 @@ static uint8_t
ibm8514_mca_read(int port, void *priv)
{
const svga_t *svga = (svga_t *) priv;
const ibm8514_t *dev = &svga->dev8514;
const ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
return (dev->pos_regs[port & 7]);
}
@@ -4316,7 +4319,7 @@ static void
ibm8514_mca_write(int port, uint8_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
/* MCA does not write registers below 0x0100. */
if (port < 0x0102)
@@ -4330,7 +4333,7 @@ static uint8_t
ibm8514_mca_feedb(void *priv)
{
const svga_t *svga = (svga_t *) priv;
const ibm8514_t *dev = &svga->dev8514;
const ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
return dev->pos_regs[2] & 1;
}
@@ -4341,8 +4344,10 @@ ibm8514_init(const device_t *info)
if (svga_get_pri() == NULL)
return NULL;
svga_t *svga = svga_get_pri();
ibm8514_t *dev = &svga->dev8514;
svga_t *svga = svga_get_pri();
ibm8514_t *dev = (ibm8514_t *) calloc(1, sizeof(ibm8514_t));
svga->dev8514 = dev;
dev->vram_size = 1024 << 10;
dev->vram = calloc(dev->vram_size, 1);
@@ -4368,11 +4373,13 @@ static void
ibm8514_close(void *priv)
{
svga_t *svga = (svga_t *) priv;
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
if (dev) {
free(dev->vram);
free(dev->changedvram);
free(dev);
}
}

View File

@@ -46,6 +46,7 @@
#include <86box/mem.h>
#include <86box/timer.h>
#include <86box/video.h>
#include <86box/vid_8514a.h>
#include <86box/vid_svga.h>
#include <86box/vid_svga_render.h>
#include <86box/plat_unused.h>
@@ -68,7 +69,7 @@ void
ati68860_ramdac_out(uint16_t addr, uint8_t val, void *priv, svga_t *svga)
{
ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) priv;
const ibm8514_t *dev = &svga->dev8514;
const ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
switch (addr) {
case 0:
@@ -172,7 +173,7 @@ uint8_t
ati68860_ramdac_in(uint16_t addr, void *priv, svga_t *svga)
{
const ati68860_ramdac_t *ramdac = (ati68860_ramdac_t *) priv;
const ibm8514_t *dev = &svga->dev8514;
const ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
uint8_t temp = 0;
switch (addr) {

View File

@@ -36,6 +36,7 @@
#include <86box/video.h>
#include <86box/i2c.h>
#include <86box/vid_ddc.h>
#include <86box/vid_8514a.h>
#include <86box/vid_svga.h>
#include <86box/vid_svga_render.h>
#include <86box/vid_ati_eeprom.h>
@@ -2299,7 +2300,7 @@ mach_out(uint16_t addr, uint8_t val, void *priv)
{
mach_t *mach = (mach_t *) priv;
svga_t *svga = &mach->svga;
const ibm8514_t *dev = &svga->dev8514;
const ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
uint8_t old;
uint8_t rs2;
uint8_t rs3;
@@ -2472,7 +2473,7 @@ mach_in(uint16_t addr, void *priv)
{
mach_t *mach = (mach_t *) priv;
svga_t *svga = &mach->svga;
const ibm8514_t *dev = &svga->dev8514;
const ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
uint8_t temp = 0xff;
uint8_t rs2;
uint8_t rs3;
@@ -2569,7 +2570,7 @@ static void
mach_recalctimings(svga_t *svga)
{
const mach_t *mach = (mach_t *) svga->priv;
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
int clock_sel;
clock_sel = ((svga->miscout >> 2) & 3) | ((mach->regs[0xbe] & 0x10) >> 1) | ((mach->regs[0xb9] & 2) << 1);
@@ -3622,7 +3623,7 @@ static void
mach_accel_out(uint16_t port, uint8_t val, mach_t *mach)
{
svga_t *svga = &mach->svga;
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
mach_log("Port accel out = %04x, val = %04x.\n", port, val);
@@ -4349,7 +4350,7 @@ static uint8_t
mach_accel_in(uint16_t port, mach_t *mach)
{
svga_t *svga = &mach->svga;
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
uint8_t temp = 0;
int vpos = 0;
int vblankend = svga->vblankstart + svga->crtc[0x16];
@@ -4550,7 +4551,7 @@ mach_accel_outb(uint16_t port, uint8_t val, void *priv)
svga_t *svga = &mach->svga;
if (port & 0x8000)
mach_accel_out_fifo(mach, svga, &svga->dev8514, port, val, 1);
mach_accel_out_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port, val, 1);
else
mach_accel_out(port, val, mach);
}
@@ -4562,7 +4563,7 @@ mach_accel_outw(uint16_t port, uint16_t val, void *priv)
svga_t *svga = &mach->svga;
if (port & 0x8000)
mach_accel_out_fifo(mach, svga, &svga->dev8514, port, val, 2);
mach_accel_out_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port, val, 2);
else {
mach_accel_out(port, val, mach);
mach_accel_out(port + 1, (val >> 8), mach);
@@ -4576,8 +4577,8 @@ mach_accel_outl(uint16_t port, uint32_t val, void *priv)
svga_t *svga = &mach->svga;
if (port & 0x8000) {
mach_accel_out_fifo(mach, svga, &svga->dev8514, port, val & 0xffff, 2);
mach_accel_out_fifo(mach, svga, &svga->dev8514, port + 2, val >> 16, 2);
mach_accel_out_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port, val & 0xffff, 2);
mach_accel_out_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port + 2, val >> 16, 2);
} else {
mach_accel_out(port, val, mach);
mach_accel_out(port + 1, (val >> 8), mach);
@@ -4593,7 +4594,7 @@ mach_accel_inb(uint16_t port, void *priv)
uint8_t temp;
if (port & 0x8000)
temp = mach_accel_in_fifo(mach, svga, &svga->dev8514, port, 1);
temp = mach_accel_in_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port, 1);
else
temp = mach_accel_in(port, mach);
@@ -4608,7 +4609,7 @@ mach_accel_inw(uint16_t port, void *priv)
uint16_t temp;
if (port & 0x8000)
temp = mach_accel_in_fifo(mach, svga, &svga->dev8514, port, 2);
temp = mach_accel_in_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port, 2);
else {
temp = mach_accel_in(port, mach);
temp |= (mach_accel_in(port + 1, mach) << 8);
@@ -4624,8 +4625,8 @@ mach_accel_inl(uint16_t port, void *priv)
uint32_t temp;
if (port & 0x8000) {
temp = mach_accel_in_fifo(mach, svga, &svga->dev8514, port, 2);
temp = (mach_accel_in_fifo(mach, svga, &svga->dev8514, port + 2, 2) << 16);
temp = mach_accel_in_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port, 2);
temp = (mach_accel_in_fifo(mach, svga, (ibm8514_t *) svga->dev8514, port + 2, 2) << 16);
} else {
temp = mach_accel_in(port, mach);
temp |= (mach_accel_in(port + 1, mach) << 8);
@@ -4639,7 +4640,7 @@ static void
mach32_write_linear(uint32_t addr, uint8_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
int writemask2 = svga->writemask;
int reset_wm = 0;
latch_t vall;
@@ -4802,7 +4803,7 @@ static uint8_t
mach32_read_linear(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
const ibm8514_t *dev = &svga->dev8514;
const ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
uint32_t latch_addr = 0;
int readplane = svga->readplane;
uint8_t count;
@@ -5066,7 +5067,7 @@ static void
mach32_updatemapping(mach_t *mach)
{
svga_t *svga = &mach->svga;
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
if (mach->pci_bus && (!(mach->pci_regs[PCI_REG_COMMAND] & PCI_COMMAND_MEM))) {
mem_mapping_disable(&svga->mapping);
@@ -5129,7 +5130,7 @@ static void
mach32_hwcursor_draw(svga_t *svga, int displine)
{
const mach_t *mach = (mach_t *) svga->priv;
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
uint16_t dat;
int comb;
int offset = dev->hwcursor_latch.x - dev->hwcursor_latch.xoff;
@@ -5452,7 +5453,7 @@ mach_mca_reset(void *priv)
{
mach_t *mach = (mach_t *) priv;
svga_t *svga = &mach->svga;
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
mem_mapping_disable(&mach->bios_rom.mapping);
mem_mapping_disable(&mach->bios_rom2.mapping);
@@ -5599,11 +5600,12 @@ mach8_init(const device_t *info)
svga_t *svga;
ibm8514_t *dev;
mach = malloc(sizeof(mach_t));
memset(mach, 0x00, sizeof(mach_t));
mach = calloc(1, sizeof(mach_t));
svga = &mach->svga;
dev = &svga->dev8514;
svga = &mach->svga;
dev = (ibm8514_t *) calloc(1, sizeof(ibm8514_t));
svga->dev8514 = dev;
mach->pci_bus = !!(info->flags & DEVICE_PCI);
mach->vlb_bus = !!(info->flags & DEVICE_VLB);
@@ -5800,11 +5802,13 @@ mach_close(void *priv)
{
mach_t *mach = (mach_t *) priv;
svga_t *svga = &mach->svga;
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
if (dev) {
free(dev->vram);
free(dev->changedvram);
free(dev);
}
svga_close(svga);

View File

@@ -39,6 +39,8 @@
#include <86box/plat.h>
#include <86box/ui.h>
#include <86box/video.h>
#include <86box/vid_8514a.h>
#include <86box/vid_xga.h>
#include <86box/vid_svga.h>
#include <86box/vid_svga_render.h>
#include <86box/vid_xga_device.h>
@@ -110,8 +112,8 @@ void
svga_out(uint16_t addr, uint8_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
ibm8514_t *dev = &svga->dev8514;
xga_t *xga = &svga->xga;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
xga_t *xga = (xga_t *) svga->xga;
uint8_t o;
uint8_t index;
@@ -357,7 +359,7 @@ uint8_t
svga_in(uint16_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
ibm8514_t *dev = &svga->dev8514;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
uint8_t index;
uint8_t ret = 0xff;
@@ -512,8 +514,8 @@ svga_in(uint16_t addr, void *priv)
void
svga_set_ramdac_type(svga_t *svga, int type)
{
ibm8514_t *dev = &svga->dev8514;
xga_t *xga = &svga->xga;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
xga_t *xga = (xga_t *) svga->xga;
if (svga->ramdac_type != type) {
svga->ramdac_type = type;
@@ -548,7 +550,7 @@ svga_set_ramdac_type(svga_t *svga, int type)
void
svga_recalctimings(svga_t *svga)
{
const ibm8514_t *dev = &svga->dev8514;
const ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
double crtcconst;
double _dispontime;
double _dispofftime;
@@ -816,8 +818,8 @@ void
svga_poll(void *priv)
{
svga_t *svga = (svga_t *) priv;
ibm8514_t *dev = &svga->dev8514;
xga_t *xga = &svga->xga;
ibm8514_t *dev = (ibm8514_t *) svga->dev8514;
xga_t *xga = (xga_t *) svga->xga;
uint32_t x;
uint32_t blink_delay;
int wx;
@@ -1229,7 +1231,7 @@ static __inline void
svga_write_common(uint32_t addr, uint8_t val, uint8_t linear, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
int writemask2 = svga->writemask;
int reset_wm = 0;
latch_t vall;
@@ -1449,7 +1451,7 @@ static __inline uint8_t
svga_read_common(uint32_t addr, uint8_t linear, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint32_t latch_addr = 0;
int readplane = svga->readplane;
uint8_t count;

View File

@@ -30,6 +30,7 @@
#include <86box/device.h>
#include <86box/timer.h>
#include <86box/video.h>
#include <86box/vid_xga.h>
#include <86box/vid_svga.h>
#include <86box/vid_svga_render.h>
#include <86box/vid_xga_device.h>
@@ -143,7 +144,7 @@ svga_xga_in(uint16_t addr, void *priv)
void
xga_updatemapping(svga_t *svga)
{
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
xga_log("OpMode = %x, linear base = %08x, aperture cntl = %d, access mode = %x, map = %x, "
"endian reverse = %d, a5test = %d, XGA on = %d.\n", xga->op_mode, xga->linear_base,
@@ -186,7 +187,7 @@ xga_updatemapping(svga_t *svga)
void
xga_recalctimings(svga_t *svga)
{
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
if (xga->on) {
xga->v_total = xga->vtotal + 1;
@@ -505,7 +506,7 @@ static void
xga_ext_outb(uint16_t addr, uint8_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
xga_log("[%04X:%08X]: EXT OUTB = %02x, val = %02x\n", CS, cpu_state.pc, addr, val);
@@ -567,7 +568,7 @@ static uint8_t
xga_ext_inb(uint16_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint8_t ret = 0;
uint8_t index;
@@ -906,7 +907,7 @@ xga_ext_inb(uint16_t addr, void *priv)
static uint32_t
xga_accel_read_pattern_map_pixel(svga_t *svga, int x, int y, int map, uint32_t base, int width)
{
const xga_t *xga = &svga->xga;
const xga_t *xga = (xga_t *) svga->xga;
uint32_t addr = base;
int bits;
uint8_t byte;
@@ -944,7 +945,7 @@ xga_accel_read_pattern_map_pixel(svga_t *svga, int x, int y, int map, uint32_t b
static uint32_t
xga_accel_read_map_pixel(svga_t *svga, int x, int y, int map, uint32_t base, int width, UNUSED(int usesrc))
{
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint32_t addr = base;
int bits;
uint32_t byte;
@@ -1024,7 +1025,7 @@ xga_accel_read_map_pixel(svga_t *svga, int x, int y, int map, uint32_t base, int
static void
xga_accel_write_map_pixel(svga_t *svga, int x, int y, int map, uint32_t base, uint32_t pixel, int width)
{
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint32_t addr = base;
uint8_t byte;
uint8_t mask;
@@ -1125,7 +1126,7 @@ xga_accel_write_map_pixel(svga_t *svga, int x, int y, int map, uint32_t base, ui
static void
xga_short_stroke(svga_t *svga, uint8_t ssv)
{
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint32_t src_dat;
uint32_t dest_dat;
uint32_t old_dest_dat;
@@ -1254,7 +1255,7 @@ xga_short_stroke(svga_t *svga, uint8_t ssv)
static void
xga_line_draw_write(svga_t *svga)
{
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint32_t src_dat;
uint32_t dest_dat;
uint32_t old_dest_dat;
@@ -1476,7 +1477,7 @@ xga_line_draw_write(svga_t *svga)
static void
xga_bitblt(svga_t *svga)
{
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint8_t area_state = 0;
uint32_t src_dat;
uint32_t dest_dat;
@@ -1499,7 +1500,6 @@ xga_bitblt(svga_t *svga)
int mix = 0;
int xdir;
int ydir;
int skip = 0;
int x = 0;
int y = 0;
@@ -2284,7 +2284,7 @@ static void
xga_memio_writeb(uint32_t addr, uint8_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
xga_mem_write(addr, val, xga, svga, 1);
@@ -2295,7 +2295,7 @@ static void
xga_memio_writew(uint32_t addr, uint16_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
xga_mem_write(addr, val, xga, svga, 2);
@@ -2306,7 +2306,7 @@ static void
xga_memio_writel(uint32_t addr, uint32_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
xga_mem_write(addr, val, xga, svga, 4);
@@ -2401,7 +2401,7 @@ static uint8_t
xga_memio_readb(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint8_t temp;
temp = xga_mem_read(addr, xga, svga);
@@ -2415,7 +2415,7 @@ static uint16_t
xga_memio_readw(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint16_t temp;
temp = xga_mem_read(addr, xga, svga);
@@ -2430,7 +2430,7 @@ static uint32_t
xga_memio_readl(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint32_t temp;
temp = xga_mem_read(addr, xga, svga);
@@ -2446,7 +2446,7 @@ xga_memio_readl(uint32_t addr, void *priv)
static void
xga_hwcursor_draw(svga_t *svga, int displine)
{
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint8_t dat = 0;
int offset = xga->hwcursor_latch.x - xga->hwcursor_latch.xoff;
int x_pos;
@@ -2532,7 +2532,7 @@ xga_render_overscan_right(xga_t *xga, svga_t *svga)
static void
xga_render_4bpp(svga_t *svga)
{
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint32_t *p;
uint32_t dat;
@@ -2573,7 +2573,7 @@ xga_render_4bpp(svga_t *svga)
static void
xga_render_8bpp(svga_t *svga)
{
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint32_t *p;
uint32_t dat;
@@ -2610,7 +2610,7 @@ xga_render_8bpp(svga_t *svga)
static void
xga_render_16bpp(svga_t *svga)
{
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
int x;
uint32_t *p;
uint32_t dat;
@@ -2651,7 +2651,7 @@ static void
xga_write(uint32_t addr, uint8_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
if (!xga->on) {
svga_write(addr, val, svga);
@@ -2679,7 +2679,7 @@ static void
xga_writew(uint32_t addr, uint16_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
if (!xga->on) {
svga_writew(addr, val, svga);
@@ -2694,7 +2694,7 @@ static void
xga_writel(uint32_t addr, uint32_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
if (!xga->on) {
svga_writel(addr, val, svga);
@@ -2711,7 +2711,7 @@ static uint8_t
xga_read(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint8_t ret = 0xff;
if (!xga->on) {
@@ -2741,7 +2741,7 @@ static uint16_t
xga_readw(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint16_t ret = 0xffff;
if (!xga->on) {
@@ -2759,7 +2759,7 @@ static uint32_t
xga_readl(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint32_t ret = 0xffffffff;
if (!xga->on) {
@@ -2779,7 +2779,7 @@ static void
xga_write_linear(uint32_t addr, uint8_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
if (!xga->on) {
svga_write_linear(addr, val, svga);
@@ -2811,7 +2811,7 @@ static void
xga_writew_linear(uint32_t addr, uint16_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
const xga_t *xga = &svga->xga;
const xga_t *xga = (xga_t *) svga->xga;
if (!xga->on) {
svga_writew_linear(addr, val, svga);
@@ -2826,7 +2826,7 @@ static void
xga_writel_linear(uint32_t addr, uint32_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
const xga_t *xga = &svga->xga;
const xga_t *xga = (xga_t *) svga->xga;
if (!xga->on) {
svga_writel_linear(addr, val, svga);
@@ -2843,7 +2843,7 @@ static uint8_t
xga_read_linear(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
const xga_t *xga = &svga->xga;
const xga_t *xga = (xga_t *) svga->xga;
uint8_t ret = 0xff;
if (!xga->on)
@@ -2873,7 +2873,7 @@ static uint16_t
xga_readw_linear(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
const xga_t *xga = &svga->xga;
const xga_t *xga = (xga_t *) svga->xga;
uint16_t ret;
if (!xga->on)
@@ -2889,7 +2889,7 @@ static uint32_t
xga_readl_linear(uint32_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
const xga_t *xga = &svga->xga;
const xga_t *xga = (xga_t *) svga->xga;
uint32_t ret;
if (!xga->on)
@@ -2906,7 +2906,7 @@ xga_readl_linear(uint32_t addr, void *priv)
static void
xga_do_render(svga_t *svga)
{
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
xga_log("DISPCNTL = %d, vga = %d.\n", xga->disp_cntl_2 & 7, vga_on);
switch (xga->disp_cntl_2 & 7) {
@@ -2937,8 +2937,9 @@ xga_do_render(svga_t *svga)
}
void
xga_poll(xga_t *xga, svga_t *svga)
xga_poll(void *priv, svga_t *svga)
{
xga_t *xga = (xga_t *) priv;
uint32_t x;
int wx;
int wy;
@@ -3076,7 +3077,7 @@ static uint8_t
xga_mca_read(int port, void *priv)
{
const svga_t *svga = (svga_t *) priv;
const xga_t *xga = &svga->xga;
const xga_t *xga = (xga_t *) svga->xga;
uint8_t ret = xga->pos_regs[port & 7];
if (((port & 7) == 3) && !(ret & 1)) /*Always enable the mapping.*/
@@ -3092,7 +3093,7 @@ static void
xga_mca_write(int port, uint8_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
/* MCA does not write registers below 0x0100. */
if (port < 0x0102)
@@ -3134,7 +3135,7 @@ static uint8_t
xga_mca_feedb(void *priv)
{
const svga_t *svga = (svga_t *) priv;
const xga_t *xga = &svga->xga;
const xga_t *xga = (xga_t *) svga->xga;
return xga->pos_regs[2] & 1;
}
@@ -3143,7 +3144,7 @@ static void
xga_mca_reset(void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
mem_mapping_disable(&xga->bios_rom.mapping);
mem_mapping_disable(&xga->memio_mapping);
@@ -3156,7 +3157,7 @@ static void
xga_reset(void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
mem_mapping_disable(&xga->bios_rom.mapping);
mem_mapping_disable(&xga->memio_mapping);
@@ -3170,7 +3171,7 @@ static uint8_t
xga_pos_in(uint16_t addr, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
uint8_t ret = 0xff;
if (!xga_standalone_enabled) {
@@ -3286,7 +3287,7 @@ static void
xga_pos_out(uint16_t addr, uint8_t val, void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
if (!xga_standalone_enabled) {
switch (addr) {
@@ -3338,10 +3339,12 @@ xga_init(const device_t *info)
if (svga_get_pri() == NULL)
return NULL;
svga_t *svga = svga_get_pri();
xga_t *xga = &svga->xga;
svga_t *svga = svga_get_pri();
xga_t *xga = (xga_t *) calloc(1, sizeof(xga_t));
FILE *fp;
uint8_t *rom = NULL;
uint8_t *rom = NULL;
svga->xga = xga;
xga->ext_mem_addr = device_get_config_hex16("ext_mem_addr");
xga->instance_isa = device_get_config_int("instance");
@@ -3428,8 +3431,7 @@ xga_init(const device_t *info)
static void *
svga_xga_init(const device_t *info)
{
svga_t *svga = malloc(sizeof(svga_t));
memset(svga, 0, sizeof(svga_t));
svga_t *svga = (svga_t *) calloc(1, sizeof(svga_t));
video_inform(VIDEO_FLAG_TYPE_XGA, &timing_xga_isa);
@@ -3452,11 +3454,13 @@ static void
xga_close(void *priv)
{
svga_t *svga = (svga_t *) priv;
xga_t *xga = &svga->xga;
xga_t *xga = (xga_t *) svga->xga;
if (svga) {
free(xga->vram);
free(xga->changedvram);
free(xga);
}
}

View File

@@ -140,7 +140,7 @@ BEGIN
MENUITEM "新規イメージ(&N)...", IDM_CASSETTE_IMAGE_NEW
MENUITEM SEPARATOR
MENUITEM "既存のイメージを開く(&E)...", IDM_CASSETTE_IMAGE_EXISTING
MENUITEM "既存のイメージを開く(書き込み保護)(&W)...", IDM_CASSETTE_IMAGE_EXISTING_WP
MENUITEM "既存のイメージを開く(書き込み禁止)(&W)...", IDM_CASSETTE_IMAGE_EXISTING_WP
MENUITEM SEPARATOR
MENUITEM "記録(&R)", IDM_CASSETTE_RECORD
MENUITEM "再生(&P)", IDM_CASSETTE_PLAY
@@ -168,7 +168,7 @@ BEGIN
MENUITEM "新規イメージ(&N)...", IDM_FLOPPY_IMAGE_NEW
MENUITEM SEPARATOR
MENUITEM "既存のイメージを開く(&E)...", IDM_FLOPPY_IMAGE_EXISTING
MENUITEM "既存のイメージを開く(書き込み保護)(&W)...", IDM_FLOPPY_IMAGE_EXISTING_WP
MENUITEM "既存のイメージを開く(書き込み禁止)(&W)...", IDM_FLOPPY_IMAGE_EXISTING_WP
MENUITEM SEPARATOR
MENUITEM "86Fイメージにエクスポート(&X)...", IDM_FLOPPY_EXPORT_TO_86F
MENUITEM SEPARATOR
@@ -197,7 +197,7 @@ BEGIN
MENUITEM "新規イメージ(&N)...", IDM_ZIP_IMAGE_NEW
MENUITEM SEPARATOR
MENUITEM "既存のイメージを開く(&E)...", IDM_ZIP_IMAGE_EXISTING
MENUITEM "既存のイメージを開く(書き込み保護)(&W)...", IDM_ZIP_IMAGE_EXISTING_WP
MENUITEM "既存のイメージを開く(書き込み禁止)(&W)...", IDM_ZIP_IMAGE_EXISTING_WP
MENUITEM SEPARATOR
MENUITEM "取り出す(&J)", IDM_ZIP_EJECT
MENUITEM "前のイメージを再読み込み(&R)", IDM_ZIP_RELOAD
@@ -211,7 +211,7 @@ BEGIN
MENUITEM "新規イメージ(&N)...", IDM_MO_IMAGE_NEW
MENUITEM SEPARATOR
MENUITEM "既存のイメージを開く(&E)...", IDM_MO_IMAGE_EXISTING
MENUITEM "既存のイメージを開く(書き込み保護)(&W)...", IDM_MO_IMAGE_EXISTING_WP
MENUITEM "既存のイメージを開く(書き込み禁止)(&W)...", IDM_MO_IMAGE_EXISTING_WP
MENUITEM SEPARATOR
MENUITEM "取り出す(&J)", IDM_MO_EJECT
MENUITEM "前のイメージを再読み込み(&R)", IDM_MO_RELOAD
@@ -253,7 +253,7 @@ END
#define STR_LANGUAGE "言語:"
#define STR_ICONSET "アイコン セット:"
#define STR_GAIN "ゲイン値"
#define STR_GAIN "音量"
#define STR_FILE_NAME "ファイル名:"
#define STR_DISK_SIZE "ディスク サイズ:"
@@ -262,7 +262,7 @@ END
#define STR_WIDTH "幅:"
#define STR_HEIGHT "高さ:"
#define STR_LOCK_TO_SIZE "このサイズを固定"
#define STR_LOCK_TO_SIZE "サイズを固定"
#define STR_MACHINE_TYPE "マシン タイプ:"
#define STR_MACHINE "マシン:"
@@ -277,7 +277,7 @@ END
#define STR_DISABLED "無効"
#define STR_ENABLED_LOCAL "有効(現地時間)"
#define STR_ENABLED_UTC "有効(UTC)"
#define STR_DYNAREC "動的コンパイ"
#define STR_DYNAREC "動的コンパイ"
#define STR_SOFTFLOAT "Softfloat FPU"
#define STR_VIDEO "ビデオカード:"
@@ -402,34 +402,34 @@ BEGIN
IDS_2053 "速度"
IDS_2054 "ZIP %03i %i (%s): %ls"
IDS_2055 "ZIPイメージ (*.IM?;*.ZDI)\0*.IM?;*.ZDI\0"
IDS_2056 "86Boxで使用可能なROMイメージが見つかりませんでした。\n\nROMセットを<a href=""https://github.com/86Box/roms/releases/latest"">ダウンロード</a>して、「roms」ディレクトリに解凍してください。"
IDS_2056 "86Boxで使用可能なROMイメージが見つかりません。\n\nROMセットを<a href=""https://github.com/86Box/roms/releases/latest"">ダウンロード</a>して、「roms」ディレクトリに解凍してください。"
IDS_2057 "(空)"
IDS_2058 "ZIPイメージ (*.IM?;*.ZDI)\0*.IM?;*.ZDI\0すべてのファイル (*.*)\0*.*\0"
IDS_2059 "高速"
IDS_2060 "オン"
IDS_2061 "オフ"
IDS_2062 "すべてのイメージ (*.86F;*.DSK;*.FLP;*.IM?;*.*FD?)\0*.86F;*.DSK;*.FLP;*.IM?;*.*FD?\0基本的なセクターイメージ (*.DSK;*.FLP;*.IM?;*.*FD?)\0*.DSK;*.FLP;*.IM?;*.IMG;*.*FD?\0表面イメージ (*.86F)\0*.86F\0"
IDS_2063 "roms/machinesディレクトリにROMがないため、マシン「%hs」は使用できません。使用可能なマシンに切り替えます。"
IDS_2062 "すべてのイメージ (*.86F;*.DSK;*.FLP;*.IM?;*.*FD?)\0*.86F;*.DSK;*.FLP;*.IM?;*.*FD?\0ベーシック セクター イメージ (*.DSK;*.FLP;*.IM?;*.*FD?)\0*.DSK;*.FLP;*.IM?;*.IMG;*.*FD?\0サーフェス イメージ (*.86F)\0*.86F\0"
IDS_2063 "roms/machines ディレクトリにROMがないため、マシン「%hs」は使用できません。使用可能なマシンに切り替えます。"
END
STRINGTABLE DISCARDABLE
BEGIN
IDS_2064 "roms/videoディレクトリにROMがないため、ビデオカード「%hs」は使用できません。使用可能なビデオカードに切り替えます。"
IDS_2064 "roms/video ディレクトリにROMがないため、ビデオカード「%hs」は使用できません。使用可能なビデオカードに切り替えます。"
IDS_2065 "マシン"
IDS_2066 "画面表示"
IDS_2066 "ディスプレイ"
IDS_2067 "入力デバイス"
IDS_2068 "サウンド"
IDS_2069 "ネットワーク"
IDS_2070 "ポート (COM/LPT)"
IDS_2071 "ストレージ コントローラ"
IDS_2072 "ハード ディスク"
IDS_2073 "フロッピー/CD-ROMドライブ"
IDS_2073 "フロッピーCD-ROMドライブ"
IDS_2074 "他のリムーバブル デバイス"
IDS_2075 "他の周辺デバイス"
IDS_2076 "表面イメージ (*.86F)\0*.86F\0"
IDS_2077 "クリックするとマウスをキャプチャします"
IDS_2076 "サーフェス イメージ (*.86F)\0*.86F\0"
IDS_2077 "クリックマウスをキャプチャします"
IDS_2078 "F8+F12キーを押してマウスを解放します"
IDS_2079 "F8+F12キーまたはマウスの中ボタンを押してマウスを解放します"
IDS_2079 "F8+F12キーまたは中クリックでマウスを解放します"
END
STRINGTABLE DISCARDABLE
@@ -449,7 +449,7 @@ BEGIN
IDS_2093 "タイプ"
IDS_2094 "PCapのセットアップに失敗しました"
IDS_2095 "PCapデバイスがありません"
IDS_2096 "不正なPCapデバイスです"
IDS_2096 "不正なPCapデバイス"
IDS_2097 "標準ジョイスティック(2ボタン)"
IDS_2098 "標準ジョイスティック(4ボタン)"
IDS_2099 "標準ジョイスティック(6ボタン)"
@@ -463,7 +463,7 @@ BEGIN
IDS_2107 "%u"
IDS_2108 "%u MB (CHS値: %i、%i、%i)"
IDS_2109 "フロッピー %i (%s): %ls"
IDS_2110 "すべてのイメージ (*.0??;*.1??;*.??0;*.86F;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.JSON;*.TD0;*.*FD?;*.MFM;*.XDF)\0*.0??;*.1??;*.??0;*.86F;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.JSON;*.TD0;*.*FD?;*.MFM;*.XDF\0アドバンスドセクターイメージ (*.IMD;*.JSON;*.TD0)\0*.IMD;*.JSON;*.TD0\0基本セクターイメージ (*.0??;*.1??;*.??0;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?)\0*.0??;*.1??;*.??0;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?\0フラックスイメージ (*.FDI)\0*.FDI\0表面イメージ (*.86F;*.MFM)\0*.86F;*.MFM\0すべてのファイル (*.*)\0*.*\0"
IDS_2110 "すべてのイメージ (*.0??;*.1??;*.??0;*.86F;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.JSON;*.TD0;*.*FD?;*.MFM;*.XDF)\0*.0??;*.1??;*.??0;*.86F;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.JSON;*.TD0;*.*FD?;*.MFM;*.XDF\0アドバンスド セクター イメージ (*.IMD;*.JSON;*.TD0)\0*.IMD;*.JSON;*.TD0\0ベーシック セクター イメージ (*.0??;*.1??;*.??0;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?)\0*.0??;*.1??;*.??0;*.BIN;*.CQ?;*.D??;*.FLP;*.HDM;*.IM?;*.XDF;*.*FD?\0フラックスイメージ (*.FDI)\0*.FDI\0サーフェス イメージ (*.86F;*.MFM)\0*.86F;*.MFM\0すべてのファイル (*.*)\0*.*\0"
IDS_2112 "SDLが初期化できません。SDL2.dllが必要です"
IDS_2113 "使用中のマシンをハードリ セットしますか?"
IDS_2114 "86Boxを終了しますか"
@@ -503,11 +503,11 @@ BEGIN
IDS_2139 "リセットしない"
IDS_2140 "光磁気イメージ (*.IM?;*.MDI)\0*.IM?;*.MDI\0すべてのファイル (*.*)\0*.*\0"
IDS_2141 "CD-ROMイメージ (*.ISO;*.CUE)\0*.ISO;*.CUE\0すべてのファイル (*.*)\0*.*\0"
IDS_2142 "%hs デバイス設定"
IDS_2142 "%hs デバイス設定"
IDS_2143 "モニターのスリープ モード"
IDS_2144 "OpenGLシェーダー (*.GLSL)\0*.GLSL\0すべてのファイル (*.*)\0*.*\0"
IDS_2145 "OpenGL設定"
IDS_2146 "サポートされていない設定を読み込んでいます"
IDS_2146 "読み込んでいる設定がサポートされません"
IDS_2147 "選択したマシンに基づくCPUタイプのフィルター機能は、使用中のマシンでは無効になっています。\n\nこれにより、選択したマシンと互換性のないCPUが選択できます。しかし、マシンのBIOSや他のソフトウェアと互換性がない場合があります。\n\nこの設定を有効にすることは公式にはサポートされておらず、バグレポートは無効として中止される可能性があります。"
IDS_2148 "続行"
IDS_2149 "カセット: %s"
@@ -515,18 +515,18 @@ BEGIN
IDS_2151 "カートリッジ %i: %ls"
IDS_2152 "カートリッジ イメージ (*.A;*.B;*.JRC)\0*.A;*.B;*.JRC\0すべてのファイル (*.*)\0*.*\0"
IDS_2153 "レンダラーの初期化エラー"
IDS_2154 "OpenGL (3.0コア) レンダラーが初期化できませんでした。別のレンダラーを使用してください。"
IDS_2154 "OpenGL (3.0コア) レンダラーが初期化できません。別のレンダラーを使用してください。"
IDS_2155 "実行を再開"
IDS_2156 "実行を一時停止"
IDS_2157 "Ctrl+Alt+DELを押"
IDS_2158 "Ctrl+Alt+Escを押"
IDS_2157 "Ctrl+Alt+DELを押"
IDS_2158 "Ctrl+Alt+Escを押"
IDS_2159 "ハードリセット"
IDS_2160 "ACPIシャットダウン"
IDS_2161 "設定"
IDS_2162 "タイプ"
IDS_2163 "Dynarecなし"
IDS_2164 "旧型Dynarec"
IDS_2165 "新型Dynarec"
IDS_2163 "動的再コンパイル禁止"
IDS_2164 "旧型の動的再コンパイル"
IDS_2165 "新型の動的再コンパイル"
IDS_2166 "「roms/video」ディレクトリにROMがないため、ビデオカード#2「%hs」は使用できません。2枚目のビデオカードを無効にします。"
IDS_2167 "ネットワーク ドライバの初期化に失敗しました。"
IDS_2168 "ネットワーク設定がヌル ドライバに切り替えられます"
@@ -537,7 +537,7 @@ BEGIN
IDS_4096 "ハード ディスク (%s)"
IDS_4097 "%01i:%01i"
IDS_4098 "%01i"
IDS_4099 "MFM/RLLまたはESDICD-ROMドライブが存在しません"
IDS_4099 "MFM/RLLESDI CD-ROMドライブが存在しません"
IDS_4100 "カスタム..."
IDS_4101 "カスタム (大容量)..."
IDS_4102 "新規のディスクを追加"
@@ -572,7 +572,7 @@ BEGIN
IDS_4131 "親VHDの選択"
IDS_4132 "親イメージが差分イメージの作成の後に変更される可能性があります。\n\nイメージ ファイルが移動またはコピーされたか、イメージ ファイルを作成したプログラムにバグが発生した可能性があります。\n\nタイム スタンプを修正しますか?"
IDS_4133 "親ディスクと子ディスクのタイム スタンプが一致しません"
IDS_4134 "VHD のタイム スタンプを修正できませんでした。"
IDS_4134 "VHD のタイム スタンプを修正できません。"
IDS_4135 "%01i:%02i"
IDS_4352 "MFM/RLL"
@@ -624,7 +624,7 @@ BEGIN
IDS_5910 "5.25"" 1 GB"
IDS_5911 "5.25"" 1.3 GB"
IDS_6144 "規定のRPM"
IDS_6144 "既定RPM"
IDS_6145 "1%低いRPM"
IDS_6146 "1.5%低いRPM"
IDS_6147 "2%低いRPM"