mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 01:25:33 -07:00
Merge branch 'master' of https://github.com/86Box/86Box
This commit is contained in:
@@ -221,7 +221,7 @@ if(NOT EMU_BUILD_NUM)
|
||||
set(EMU_BUILD_NUM 0)
|
||||
endif()
|
||||
if(NOT EMU_COPYRIGHT_YEAR)
|
||||
set(EMU_COPYRIGHT_YEAR 2024)
|
||||
set(EMU_COPYRIGHT_YEAR 2025)
|
||||
endif()
|
||||
|
||||
# Libasan
|
||||
@@ -230,4 +230,6 @@ if(LIBASAN)
|
||||
add_link_options(-fsanitize=address)
|
||||
endif()
|
||||
|
||||
set(CMAKE_TOP_LEVEL_PROCESSED TRUE)
|
||||
|
||||
add_subdirectory(src)
|
||||
|
||||
91
src/86box.c
91
src/86box.c
@@ -88,7 +88,7 @@
|
||||
#include <86box/scsi_device.h>
|
||||
#include <86box/cdrom.h>
|
||||
#include <86box/cdrom_interface.h>
|
||||
#include <86box/zip.h>
|
||||
#include <86box/rdisk.h>
|
||||
#include <86box/mo.h>
|
||||
#include <86box/scsi_disk.h>
|
||||
#include <86box/cdrom_image.h>
|
||||
@@ -1056,47 +1056,50 @@ usage:
|
||||
vmm_enabled = 1;
|
||||
pclog("# VM Manager enabled. Path: %s\n", vmm_path);
|
||||
}
|
||||
/*
|
||||
* We are about to read the configuration file, which MAY
|
||||
* put data into global variables (the hard- and floppy
|
||||
* disks are an example) so we have to initialize those
|
||||
* modules before we load the config..
|
||||
*/
|
||||
hdd_init();
|
||||
network_init();
|
||||
mouse_init();
|
||||
cdrom_global_init();
|
||||
zip_global_init();
|
||||
mo_global_init();
|
||||
|
||||
/* Initialize the keyboard accelerator list with default values */
|
||||
for (int x = 0; x < NUM_ACCELS; x++) {
|
||||
strcpy(acc_keys[x].name, def_acc_keys[x].name);
|
||||
strcpy(acc_keys[x].desc, def_acc_keys[x].desc);
|
||||
strcpy(acc_keys[x].seq, def_acc_keys[x].seq);
|
||||
}
|
||||
if (!vmm_enabled) {
|
||||
/*
|
||||
* We are about to read the configuration file, which MAY
|
||||
* put data into global variables (the hard- and floppy
|
||||
* disks are an example) so we have to initialize those
|
||||
* modules before we load the config..
|
||||
*/
|
||||
hdd_init();
|
||||
network_init();
|
||||
mouse_init();
|
||||
cdrom_global_init();
|
||||
rdisk_global_init();
|
||||
mo_global_init();
|
||||
|
||||
/* Load the configuration file. */
|
||||
config_load();
|
||||
/* Initialize the keyboard accelerator list with default values */
|
||||
for (int x = 0; x < NUM_ACCELS; x++) {
|
||||
strcpy(acc_keys[x].name, def_acc_keys[x].name);
|
||||
strcpy(acc_keys[x].desc, def_acc_keys[x].desc);
|
||||
strcpy(acc_keys[x].seq, def_acc_keys[x].seq);
|
||||
}
|
||||
|
||||
/* Clear the CMOS and/or BIOS flash file, if we were started with
|
||||
the relevant parameter(s). */
|
||||
if (clear_cmos) {
|
||||
delete_nvr_file(0);
|
||||
clear_cmos = 0;
|
||||
}
|
||||
/* Load the configuration file. */
|
||||
config_load();
|
||||
|
||||
if (clear_flash) {
|
||||
delete_nvr_file(1);
|
||||
clear_flash = 0;
|
||||
}
|
||||
/* Clear the CMOS and/or BIOS flash file, if we were started with
|
||||
the relevant parameter(s). */
|
||||
if (clear_cmos) {
|
||||
delete_nvr_file(0);
|
||||
clear_cmos = 0;
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < FDD_NUM; i++) {
|
||||
if (fn[i] != NULL) {
|
||||
if (strlen(fn[i]) <= 511)
|
||||
strncpy(floppyfns[i], fn[i], 511);
|
||||
free(fn[i]);
|
||||
fn[i] = NULL;
|
||||
if (clear_flash) {
|
||||
delete_nvr_file(1);
|
||||
clear_flash = 0;
|
||||
}
|
||||
|
||||
for (uint8_t i = 0; i < FDD_NUM; i++) {
|
||||
if (fn[i] != NULL) {
|
||||
if (strlen(fn[i]) <= 511)
|
||||
strncpy(floppyfns[i], fn[i], 511);
|
||||
free(fn[i]);
|
||||
fn[i] = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1395,7 +1398,7 @@ pc_reset_hard_close(void)
|
||||
|
||||
cdrom_close();
|
||||
|
||||
zip_close();
|
||||
rdisk_close();
|
||||
|
||||
mo_close();
|
||||
|
||||
@@ -1446,6 +1449,8 @@ pc_reset_hard_init(void)
|
||||
scsi_reset();
|
||||
scsi_device_init();
|
||||
|
||||
ide_hard_reset();
|
||||
|
||||
/* Initialize the actual machine and its basic modules. */
|
||||
machine_init();
|
||||
|
||||
@@ -1489,9 +1494,6 @@ pc_reset_hard_init(void)
|
||||
|
||||
fdd_reset();
|
||||
|
||||
/* Reset the CD-ROM Controller module. */
|
||||
cdrom_interface_reset();
|
||||
|
||||
/* Reset and reconfigure the SCSI layer. */
|
||||
scsi_card_init();
|
||||
|
||||
@@ -1499,9 +1501,12 @@ pc_reset_hard_init(void)
|
||||
|
||||
cdrom_hard_reset();
|
||||
|
||||
/* Reset the CD-ROM Controller module. */
|
||||
cdrom_interface_reset();
|
||||
|
||||
mo_hard_reset();
|
||||
|
||||
zip_hard_reset();
|
||||
rdisk_hard_reset();
|
||||
|
||||
|
||||
/* Reset any ISA ROM cards. */
|
||||
@@ -1664,7 +1669,7 @@ pc_close(UNUSED(thread_t *ptr))
|
||||
|
||||
cdrom_close();
|
||||
|
||||
zip_close();
|
||||
rdisk_close();
|
||||
|
||||
mo_close();
|
||||
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
# Copyright 2024 Jasmine Iwanek.
|
||||
#
|
||||
|
||||
if(NOT CMAKE_TOP_LEVEL_PROCESSED)
|
||||
message(FATAL_ERROR "Incorrect source directory specified. Delete your build directory and retry with the top-level directory instead")
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||
endif()
|
||||
@@ -99,7 +103,7 @@ if(INSTRUMENT)
|
||||
add_compile_definitions(USE_INSTRUMENT)
|
||||
endif()
|
||||
|
||||
target_link_libraries(86Box cpu chipset mch dev mem fdd game cdrom zip mo hdd
|
||||
target_link_libraries(86Box cpu chipset mch dev mem fdd game cdrom rdisk mo hdd
|
||||
net print scsi sio snd utils vid voodoo plat ui)
|
||||
|
||||
if(HAIKU)
|
||||
@@ -149,16 +153,6 @@ if(APPLE)
|
||||
target_link_libraries(86Box Freetype::Freetype)
|
||||
endif()
|
||||
|
||||
find_package(SDL2 REQUIRED)
|
||||
include_directories(${SDL2_INCLUDE_DIRS})
|
||||
if(STATIC_BUILD AND TARGET SDL2::SDL2-static)
|
||||
target_link_libraries(86Box SDL2::SDL2-static)
|
||||
elseif(TARGET SDL2::SDL2)
|
||||
target_link_libraries(86Box SDL2::SDL2)
|
||||
else()
|
||||
target_link_libraries(86Box ${SDL2_LIBRARIES})
|
||||
endif()
|
||||
|
||||
find_package(PNG REQUIRED)
|
||||
include_directories(${PNG_INCLUDE_DIRS})
|
||||
target_link_libraries(86Box PNG::PNG)
|
||||
|
||||
@@ -23,6 +23,7 @@ add_library(cdrom OBJECT
|
||||
cdrom.c
|
||||
cdrom_image.c
|
||||
cdrom_image_viso.c
|
||||
cdrom_mke.c
|
||||
)
|
||||
target_link_libraries(86Box PkgConfig::SNDFILE)
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#ifdef USE_CDROM_MITSUMI
|
||||
#include <86box/cdrom_mitsumi.h>
|
||||
#endif
|
||||
#include <86box/cdrom_mke.h>
|
||||
#include <86box/log.h>
|
||||
#include <86box/plat.h>
|
||||
#include <86box/plat_cdrom_ioctl.h>
|
||||
@@ -121,8 +122,10 @@ static const struct {
|
||||
// clang-format off
|
||||
{ &cdrom_interface_none_device },
|
||||
#ifdef USE_CDROM_MITSUMI
|
||||
{ &mitsumi_cdrom_device },
|
||||
{ &mitsumi_cdrom_device },
|
||||
#endif
|
||||
{ &mke_cdrom_noncreative_device },
|
||||
{ &mke_cdrom_device },
|
||||
{ NULL }
|
||||
// clang-format on
|
||||
};
|
||||
@@ -295,7 +298,7 @@ msf_to_bcd(int *m, int *s, int *f)
|
||||
void
|
||||
cdrom_compute_ecc_block(cdrom_t *dev, uint8_t *parity, const uint8_t *data,
|
||||
uint32_t major_count, uint32_t minor_count,
|
||||
uint32_t major_mult, uint32_t minor_inc)
|
||||
uint32_t major_mult, uint32_t minor_inc, int m2f1)
|
||||
{
|
||||
uint32_t size = major_count * minor_count;
|
||||
|
||||
@@ -308,6 +311,9 @@ cdrom_compute_ecc_block(cdrom_t *dev, uint8_t *parity, const uint8_t *data,
|
||||
for (uint32_t minor = 0; minor < minor_count; ++minor) {
|
||||
uint8_t temp = data[index];
|
||||
|
||||
if (m2f1 && (index < 4))
|
||||
temp = 0x00;
|
||||
|
||||
index += minor_inc;
|
||||
|
||||
if (index >= size)
|
||||
@@ -323,14 +329,14 @@ cdrom_compute_ecc_block(cdrom_t *dev, uint8_t *parity, const uint8_t *data,
|
||||
}
|
||||
}
|
||||
|
||||
extern void
|
||||
cdrom_generate_ecc_data(cdrom_t *dev, const uint8_t *data)
|
||||
static void
|
||||
cdrom_generate_ecc_data(cdrom_t *dev, const uint8_t *data, int m2f1)
|
||||
{
|
||||
/* Compute ECC P code. */
|
||||
cdrom_compute_ecc_block(dev, dev->p_parity, data, 86, 24, 2, 86);
|
||||
cdrom_compute_ecc_block(dev, dev->p_parity, data, 86, 24, 2, 86, m2f1);
|
||||
|
||||
/* Compute ECC Q code. */
|
||||
cdrom_compute_ecc_block(dev, dev->q_parity, data, 52, 43, 86, 88);
|
||||
cdrom_compute_ecc_block(dev, dev->q_parity, data, 52, 43, 86, 88, m2f1);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -338,21 +344,23 @@ cdrom_is_sector_good(cdrom_t *dev, const uint8_t *b, const uint8_t mode2, const
|
||||
{
|
||||
int ret = 1;
|
||||
|
||||
if (mode2 && (form == 1)) {
|
||||
const uint32_t crc = cdrom_crc32(0xffffffff, b, 2072) ^ 0xffffffff;
|
||||
if (!mode2 || (form != 1)) {
|
||||
if (mode2 && (form == 1)) {
|
||||
const uint32_t crc = cdrom_crc32(0xffffffff, &(b[16]), 2056) ^ 0xffffffff;
|
||||
|
||||
ret = ret && (crc == (*(uint32_t *) &(b[2072])));
|
||||
} else if (!mode2) {
|
||||
const uint32_t crc = cdrom_crc32(0xffffffff, b, 2064) ^ 0xffffffff;
|
||||
ret = ret && (crc == (*(uint32_t *) &(b[2072])));
|
||||
} else if (!mode2) {
|
||||
const uint32_t crc = cdrom_crc32(0xffffffff, b, 2064) ^ 0xffffffff;
|
||||
|
||||
ret = ret && (crc == (*(uint32_t *) &(b[2064])));
|
||||
ret = ret && (crc == (*(uint32_t *) &(b[2064])));
|
||||
}
|
||||
|
||||
cdrom_generate_ecc_data(dev, &(b[12]), mode2 && (form == 1));
|
||||
|
||||
ret = ret && !memcmp(dev->p_parity, &(b[2076]), 172);
|
||||
ret = ret && !memcmp(dev->q_parity, &(b[2248]), 104);
|
||||
}
|
||||
|
||||
cdrom_generate_ecc_data(dev, &(b[12]));
|
||||
|
||||
ret = ret && !memcmp(dev->p_parity, &(b[2076]), 172);
|
||||
ret = ret && !memcmp(dev->q_parity, &(b[2248]), 104);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -379,7 +387,7 @@ read_data(cdrom_t *dev, const uint32_t lba, int check)
|
||||
else if (dev->raw_buffer[dev->cur_buf ^ 1][0x0012] ==
|
||||
dev->raw_buffer[dev->cur_buf ^ 1][0x0016])
|
||||
form = ((dev->raw_buffer[dev->cur_buf ^ 1][0x0012] &
|
||||
0x20) >> 5) + 1;
|
||||
0x20) >> 5) + 1;
|
||||
} else if (dev->raw_buffer[dev->cur_buf ^ 1][0x000f] == 0x02)
|
||||
dev->mode2 = 1;
|
||||
|
||||
@@ -1184,6 +1192,12 @@ cdrom_is_early(const int type)
|
||||
return (cdrom_drive_types[type].scsi_std == 1);
|
||||
}
|
||||
|
||||
int
|
||||
cdrom_is_dvd(const int type)
|
||||
{
|
||||
return (cdrom_drive_types[type].is_dvd == 1);
|
||||
}
|
||||
|
||||
int
|
||||
cdrom_is_generic(const int type)
|
||||
{
|
||||
@@ -1235,6 +1249,26 @@ cdrom_get_type_count(void)
|
||||
return count;
|
||||
}
|
||||
|
||||
void
|
||||
cdrom_generate_name_mke(const int type, char *name)
|
||||
{
|
||||
char elements[2][512] = { 0 };
|
||||
|
||||
memcpy(elements[0], cdrom_drive_types[type].model,
|
||||
strlen(cdrom_drive_types[type].model) + 1);
|
||||
char *s = strstr(elements[0], " ");
|
||||
if (s != NULL)
|
||||
s[0] = 0x00;
|
||||
|
||||
memcpy(elements[1], cdrom_drive_types[type].revision,
|
||||
strlen(cdrom_drive_types[type].revision) + 1);
|
||||
s = strstr(elements[1], " ");
|
||||
if (s != NULL)
|
||||
s[0] = 0x00;
|
||||
|
||||
sprintf(name, "%s%s", elements[0], elements[1]);
|
||||
}
|
||||
|
||||
void
|
||||
cdrom_get_identify_model(const int type, char *name, const int id)
|
||||
{
|
||||
@@ -1673,7 +1707,7 @@ cdrom_audio_track_search(cdrom_t *dev, const uint32_t pos,
|
||||
dev->seek_pos = MSFtoLBA(ti.m, ti.s, ti.f) - 150;
|
||||
else {
|
||||
cdrom_log(dev->log, "Unable to get the starting position for "
|
||||
"track %08X\n", ismsf & 0xff);
|
||||
"track %08X\n", pos2 & 0xff);
|
||||
cdrom_stop(dev);
|
||||
}
|
||||
break;
|
||||
@@ -1791,7 +1825,7 @@ cdrom_audio_play_toshiba(cdrom_t *dev, const uint32_t pos, const int type)
|
||||
dev->cd_end = MSFtoLBA(ti.m, ti.s, ti.f) - 150;
|
||||
else {
|
||||
cdrom_log(dev->log, "Unable to get the starting position for "
|
||||
"track %08X\n", ismsf & 0xff);
|
||||
"track %08X\n", pos2 & 0xff);
|
||||
cdrom_stop(dev);
|
||||
}
|
||||
break;
|
||||
@@ -1824,7 +1858,7 @@ cdrom_audio_scan(cdrom_t *dev, const uint32_t pos)
|
||||
uint8_t ret = 0;
|
||||
|
||||
if (dev->cd_status & CD_STATUS_HAS_AUDIO) {
|
||||
cdrom_log(dev->log, "Audio Scan: MSF = %06x, type = %02x\n", pos, type);
|
||||
cdrom_log(dev->log, "Audio Scan: MSF = %06x\n", pos);
|
||||
|
||||
if (pos == 0xffffffff) {
|
||||
cdrom_log(dev->log, "(Type 0) Search from current position\n");
|
||||
@@ -2093,9 +2127,10 @@ cdrom_get_current_subcodeq_playstatus(cdrom_t *dev, uint8_t *b)
|
||||
cdrom_get_current_subcodeq(dev, b);
|
||||
|
||||
switch (dev->cd_status) {
|
||||
default: case CD_STATUS_EMPTY:
|
||||
case CD_STATUS_DATA_ONLY: case CD_STATUS_DVD:
|
||||
case CD_STATUS_STOPPED: case CD_STATUS_PLAYING_COMPLETED:
|
||||
default: case CD_STATUS_EMPTY:
|
||||
case CD_STATUS_DATA_ONLY: case CD_STATUS_DVD:
|
||||
case CD_STATUS_STOPPED: case CD_STATUS_PLAYING_COMPLETED:
|
||||
case CD_STATUS_DVD_REJECTED:
|
||||
ret = 0x03;
|
||||
break;
|
||||
case CD_STATUS_HOLD:
|
||||
@@ -2444,7 +2479,7 @@ cdrom_readsector_raw(cdrom_t *dev, uint8_t *buffer, const int sector, const int
|
||||
ecc_diff = 0;
|
||||
}
|
||||
|
||||
if (dev->cd_status != CD_STATUS_EMPTY) {
|
||||
if ((dev->cd_status != CD_STATUS_EMPTY) && (dev->cd_status != CD_STATUS_DVD_REJECTED)) {
|
||||
uint8_t *temp_b;
|
||||
uint8_t *b = temp_b = buffer;
|
||||
int audio = 0;
|
||||
@@ -2950,7 +2985,7 @@ cdrom_update_status(cdrom_t *dev)
|
||||
dev->cached_sector = -1;
|
||||
dev->cdrom_capacity = dev->ops->get_last_block(dev->local);
|
||||
|
||||
if (dev->cd_status != CD_STATUS_EMPTY) {
|
||||
if ((dev->cd_status != CD_STATUS_EMPTY) && (dev->cd_status != CD_STATUS_DVD_REJECTED)) {
|
||||
/* Signal media change to the emulated machine. */
|
||||
cdrom_insert(dev->id);
|
||||
|
||||
@@ -2992,9 +3027,14 @@ cdrom_load(cdrom_t *dev, const char *fn, const int skip_insert)
|
||||
|
||||
if ((dev->ops->is_empty != NULL) && dev->ops->is_empty(dev->local))
|
||||
dev->cd_status = CD_STATUS_EMPTY;
|
||||
else if (dev->ops->is_dvd(dev->local))
|
||||
dev->cd_status = CD_STATUS_DVD;
|
||||
else
|
||||
else if (dev->ops->is_dvd(dev->local)) {
|
||||
if (cdrom_is_dvd(dev->type))
|
||||
dev->cd_status = CD_STATUS_DVD;
|
||||
else {
|
||||
warning("DVD image \"%s\" in a CD-only drive, reporting as empty\n", fn);
|
||||
dev->cd_status = CD_STATUS_DVD_REJECTED;
|
||||
}
|
||||
} else
|
||||
dev->cd_status = dev->ops->has_audio(dev->local) ? CD_STATUS_STOPPED :
|
||||
CD_STATUS_DATA_ONLY;
|
||||
|
||||
@@ -3008,7 +3048,7 @@ cdrom_load(cdrom_t *dev, const char *fn, const int skip_insert)
|
||||
cdrom_toc_dump(dev);
|
||||
#endif
|
||||
|
||||
if (!skip_insert && (dev->cd_status != CD_STATUS_EMPTY)) {
|
||||
if (!skip_insert && (dev->cd_status != CD_STATUS_EMPTY) && (dev->cd_status != CD_STATUS_DVD_REJECTED)) {
|
||||
/* Signal media change to the emulated machine. */
|
||||
cdrom_insert(dev->id);
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#include <ctype.h>
|
||||
#include <inttypes.h>
|
||||
// #define ENABLE_IMAGE_LOG 1
|
||||
#ifdef ENABLE_IMAGE_LOG
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
@@ -144,6 +143,7 @@ typedef enum
|
||||
PW_INTERLEAVED = 0x08 /* 96-byte PW subchannel, interleaved */
|
||||
} mds_subch_mode_t;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
typedef struct
|
||||
{
|
||||
uint8_t file_sig[16];
|
||||
@@ -225,6 +225,7 @@ typedef struct
|
||||
uint32_t pad[2];
|
||||
uint32_t entries;
|
||||
} mds_dpm_block_t;
|
||||
#pragma pack(pop)
|
||||
|
||||
#ifdef ENABLE_IMAGE_LOG
|
||||
int image_do_log = ENABLE_IMAGE_LOG;
|
||||
@@ -1346,12 +1347,12 @@ image_set_track_subch_type(track_t *ct)
|
||||
static int
|
||||
image_load_iso(cd_image_t *img, const char *filename)
|
||||
{
|
||||
track_t *ct = NULL;
|
||||
track_index_t *ci = NULL;
|
||||
track_file_t *tf = NULL;
|
||||
int success = 1;
|
||||
int error = 1;
|
||||
int is_viso = 0;
|
||||
track_t *ct = NULL;
|
||||
track_index_t *ci = NULL;
|
||||
track_file_t *tf = NULL;
|
||||
int success = 1;
|
||||
int error = 1;
|
||||
int is_viso = 0;
|
||||
int sector_sizes[8] = { 2448, 2368, RAW_SECTOR_SIZE, 2336,
|
||||
2332, 2328, 2324, COOKED_SECTOR_SIZE };
|
||||
|
||||
@@ -1446,8 +1447,12 @@ image_load_iso(cd_image_t *img, const char *filename)
|
||||
if (success)
|
||||
image_process(img);
|
||||
else {
|
||||
image_log(img->log, " [ISO ] Unable to open image or folder \"%s\"\n",
|
||||
filename);
|
||||
#ifdef ENABLE_IMAGE_LOG
|
||||
log_warning(img->log, "Unable to open image or folder \"%s\"\n",
|
||||
filename);
|
||||
#else
|
||||
warning("Unable to open image or folder \"%s\"\n", filename);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1792,14 +1797,101 @@ image_load_cue(cd_image_t *img, const char *cuefile)
|
||||
|
||||
if (success)
|
||||
image_process(img);
|
||||
else {
|
||||
image_log(img->log, " [CUE ] Unable to open Cue sheet \"%s\"\n", cuefile);
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
#ifdef ENABLE_IMAGE_LOG
|
||||
log_warning(img->log, " [CUE ] Unable to open Cue sheet \"%s\"\n", cuefile);
|
||||
#else
|
||||
warning("Unable to open Cue sheet \"%s\"\n", cuefile);
|
||||
#endif
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
// Converts UTF-16 string into UTF-8 string.
|
||||
// If destination string is NULL returns total number of symbols that would've
|
||||
// been written (without null terminator). However, when actually writing into
|
||||
// destination string, it does include it. So, be sure to allocate extra byte
|
||||
// for destination string.
|
||||
// Params:
|
||||
// u16_str - source UTF-16 string
|
||||
// u16_str_len - length of source UTF-16 string
|
||||
// u8_str - destination UTF-8 string
|
||||
// u8_str_size - size of destination UTF-8 string in bytes
|
||||
// Return value:
|
||||
// 0 on success, -1 if encountered invalid surrogate pair, -2 if
|
||||
// encountered buffer overflow or length of destination UTF-8 string in bytes
|
||||
// (without including the null terminator).
|
||||
long int utf16_to_utf8(const uint16_t *u16_str, size_t u16_str_len,
|
||||
uint8_t *u8_str, size_t u8_str_size)
|
||||
{
|
||||
size_t i = 0, j = 0;
|
||||
|
||||
if (!u8_str) {
|
||||
u8_str_size = u16_str_len * 4;
|
||||
}
|
||||
|
||||
while (i < u16_str_len) {
|
||||
uint32_t codepoint = u16_str[i++];
|
||||
|
||||
// check for surrogate pair
|
||||
if (codepoint >= 0xD800 && codepoint <= 0xDBFF) {
|
||||
uint16_t high_surr = codepoint;
|
||||
uint16_t low_surr = u16_str[i++];
|
||||
|
||||
if (low_surr < 0xDC00 || low_surr > 0xDFFF)
|
||||
return -1;
|
||||
|
||||
codepoint = ((high_surr - 0xD800) << 10) +
|
||||
(low_surr - 0xDC00) + 0x10000;
|
||||
}
|
||||
|
||||
if (codepoint < 0x80) {
|
||||
if (j + 1 > u8_str_size) return -2;
|
||||
|
||||
if (u8_str) u8_str[j] = (char)codepoint;
|
||||
|
||||
j++;
|
||||
} else if (codepoint < 0x800) {
|
||||
if (j + 2 > u8_str_size) return -2;
|
||||
|
||||
if (u8_str) {
|
||||
u8_str[j + 0] = 0xC0 | (codepoint >> 6);
|
||||
u8_str[j + 1] = 0x80 | (codepoint & 0x3F);
|
||||
}
|
||||
|
||||
j += 2;
|
||||
} else if (codepoint < 0x10000) {
|
||||
if (j + 3 > u8_str_size) return -2;
|
||||
|
||||
if (u8_str) {
|
||||
u8_str[j + 0] = 0xE0 | (codepoint >> 12);
|
||||
u8_str[j + 1] = 0x80 | ((codepoint >> 6) & 0x3F);
|
||||
u8_str[j + 2] = 0x80 | (codepoint & 0x3F);
|
||||
}
|
||||
|
||||
j += 3;
|
||||
} else {
|
||||
if (j + 4 > u8_str_size) return -2;
|
||||
|
||||
if (u8_str) {
|
||||
u8_str[j + 0] = 0xF0 | (codepoint >> 18);
|
||||
u8_str[j + 1] = 0x80 | ((codepoint >> 12) & 0x3F);
|
||||
u8_str[j + 2] = 0x80 | ((codepoint >> 6) & 0x3F);
|
||||
u8_str[j + 3] = 0x80 | (codepoint & 0x3F);
|
||||
}
|
||||
|
||||
j += 4;
|
||||
}
|
||||
}
|
||||
|
||||
if (u8_str) {
|
||||
if (j >= u8_str_size) return -2;
|
||||
u8_str[j] = '\0';
|
||||
}
|
||||
|
||||
return (long int)j;
|
||||
}
|
||||
|
||||
static int
|
||||
image_load_mds(cd_image_t *img, const char *mdsfile)
|
||||
{
|
||||
@@ -1810,6 +1902,7 @@ image_load_mds(cd_image_t *img, const char *mdsfile)
|
||||
int last_t = -1;
|
||||
int error;
|
||||
char pathname[MAX_FILENAME_LENGTH];
|
||||
char ofn[2048] = { 0 };
|
||||
|
||||
mds_hdr_t mds_hdr = { 0 };
|
||||
mds_sess_block_t mds_sess_block = { 0 };
|
||||
@@ -1843,14 +1936,25 @@ image_load_mds(cd_image_t *img, const char *mdsfile)
|
||||
|
||||
fseek(fp, 0, SEEK_SET);
|
||||
fread(&mds_hdr, 1, sizeof(mds_hdr_t), fp);
|
||||
|
||||
if (memcmp(mds_hdr.file_sig, "MEDIA DESCRIPTOR", 16)) {
|
||||
image_log(img->log, " [MDS ] Not an actual MDF file \"%s\"\n", mdsfile);
|
||||
#ifdef ENABLE_IMAGE_LOG
|
||||
log_warning(img->log, " [MDS ] \"%s\"\n is not an actual MDF file",
|
||||
mdsfile);
|
||||
#else
|
||||
warning("\"%s\"\n is not an actual MDF file", mdsfile);
|
||||
#endif
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (mds_hdr.file_ver[0] == 0x02) {
|
||||
image_log(img->log, " [MDS ] Daemon tools encrypted MDS is not supported in file \"%s\"\n", mdsfile);
|
||||
#ifdef ENABLE_IMAGE_LOG
|
||||
log_warning(img->log, " [MDS ] \"%s\" is a Daemon Tools encrypted MDS which is not supported\n",
|
||||
mdsfile);
|
||||
#else
|
||||
warning("\"%s\" is a Daemon Tools encrypted MDS which is not supported\n", mdsfile);
|
||||
#endif
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
||||
@@ -1906,7 +2010,7 @@ image_load_mds(cd_image_t *img, const char *mdsfile)
|
||||
fread(&mds_dpm_block_offs, 1, sizeof(uint32_t), fp);
|
||||
|
||||
fseek(fp, mds_dpm_block_offs, SEEK_SET);
|
||||
fread(&mds_dpm_block, 1, 4 * sizeof(mds_dpm_block_t), fp);
|
||||
fread(&mds_dpm_block, 1, sizeof(mds_dpm_block_t), fp);
|
||||
|
||||
/* We currently only support the bad sectors block and not (yet) actual DPM. */
|
||||
if (mds_dpm_block.type == 0x00000002) {
|
||||
@@ -1946,8 +2050,6 @@ image_load_mds(cd_image_t *img, const char *mdsfile)
|
||||
last_t = mds_trk_block.point;
|
||||
ct = image_insert_track(img, mds_sess_block.sess_id, mds_trk_block.point);
|
||||
|
||||
tf = NULL;
|
||||
|
||||
if (img->is_dvd) {
|
||||
/* DVD images have no extra block - the extra block offset is the track length. */
|
||||
memset(&mds_trk_ex_block, 0x00, sizeof(mds_trk_ex_block_t));
|
||||
@@ -1967,14 +2069,24 @@ image_load_mds(cd_image_t *img, const char *mdsfile)
|
||||
fseek(fp, mds_trk_block.footer_offs + (ff * sizeof(mds_footer_t)), SEEK_SET);
|
||||
fread(&mds_footer, 1, sizeof(mds_footer_t), fp);
|
||||
|
||||
wchar_t wfn[2048] = { 0 };
|
||||
char fn[2048] = { 0 };
|
||||
uint16_t wfn[2048] = { 0 };
|
||||
char fn[2048] = { 0 };
|
||||
fseek(fp, mds_footer.fn_offs, SEEK_SET);
|
||||
if (mds_footer.fn_is_wide) {
|
||||
fgetws(wfn, 256, fp);
|
||||
wcstombs(fn, wfn, 256);
|
||||
} else
|
||||
fgets(fn, 512, fp);
|
||||
int len = 0;
|
||||
for (int i = 0; i < 256; i++) {
|
||||
fread(&(wfn[i]), 1, 2, fp);
|
||||
len++;
|
||||
if (wfn[i] == 0x0000)
|
||||
break;
|
||||
}
|
||||
(void) utf16_to_utf8(wfn, 2048, (uint8_t *) fn, 2048);
|
||||
} else for (int i = 0; i < 512; i++) {
|
||||
fread(&fn[i], 1, 1, fp);
|
||||
if (fn[i] == 0x00)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!stricmp(fn, "*.mdf")) {
|
||||
strcpy(fn, mdsfile);
|
||||
fn[strlen(mdsfile) - 3] = 'm';
|
||||
@@ -1988,7 +2100,10 @@ image_load_mds(cd_image_t *img, const char *mdsfile)
|
||||
else
|
||||
strcpy(filename, fn);
|
||||
|
||||
tf = index_file_init(img->dev->id, filename, &error, &is_viso);
|
||||
if (strcmp(ofn, filename) != 0) {
|
||||
tf = index_file_init(img->dev->id, filename, &error, &is_viso);
|
||||
strcpy(ofn, filename);
|
||||
}
|
||||
}
|
||||
|
||||
ct->sector_size = mds_trk_block.sector_len;
|
||||
@@ -2045,7 +2160,7 @@ image_load_mds(cd_image_t *img, const char *mdsfile)
|
||||
ci->file = tf;
|
||||
} else {
|
||||
ci->start = (mds_trk_block.pm * 60 * 75) + (mds_trk_block.ps * 75) + mds_trk_block.pf;
|
||||
ci->type = INDEX_ZERO;
|
||||
ci->type = INDEX_NONE;
|
||||
ci->file_start = 0;
|
||||
ci->file_length = 0;
|
||||
ci->file = NULL;
|
||||
@@ -2086,8 +2201,6 @@ image_load_mds(cd_image_t *img, const char *mdsfile)
|
||||
fclose(fp);
|
||||
|
||||
if (success) {
|
||||
// image_process(img);
|
||||
|
||||
#ifdef ENABLE_IMAGE_LOG
|
||||
image_log(img->log, "Final tracks list:\n");
|
||||
for (int i = 0; i < img->tracks_num; i++) {
|
||||
@@ -2107,10 +2220,12 @@ image_load_mds(cd_image_t *img, const char *mdsfile)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
image_log(img->log, " [MDS ] Unable to open MDS sheet \"%s\"\n", mdsfile);
|
||||
return 0;
|
||||
}
|
||||
} else
|
||||
#ifdef ENABLE_IMAGE_LOG
|
||||
log_warning(img->log, " [MDS ] Unable to open MDS sheet \"%s\"\n", mdsfile);
|
||||
#else
|
||||
warning("Unable to open MDS sheet \"%s\"\n", mdsfile);
|
||||
#endif
|
||||
|
||||
return success;
|
||||
}
|
||||
@@ -2166,8 +2281,8 @@ image_get_track_info(const void *local, const uint32_t track,
|
||||
}
|
||||
|
||||
if (ct != NULL) {
|
||||
const uint32_t pos = end ? ct->idx[1].start :
|
||||
(ct->idx[1].start + ct->idx[1].length);
|
||||
const uint32_t pos = end ? (ct->idx[1].start + ct->idx[1].length) :
|
||||
ct->idx[1].start;
|
||||
|
||||
ti->number = ct->point;
|
||||
ti->attr = ct->attr;
|
||||
@@ -2309,28 +2424,21 @@ image_read_sector(const void *local, uint8_t *buffer,
|
||||
if ((ret > 0) && (trk->attr & 0x04) && ((idx->type < INDEX_NORMAL) || !track_is_raw)) {
|
||||
uint32_t crc;
|
||||
|
||||
if ((trk->mode == 2) && (trk->form == 1))
|
||||
crc = cdrom_crc32(0xffffffff, buf, 2072) ^ 0xffffffff;
|
||||
else
|
||||
if ((trk->mode == 2) && (trk->form == 1)) {
|
||||
crc = cdrom_crc32(0xffffffff, &(buf[16]), 2056) ^ 0xffffffff;
|
||||
memcpy(&(buf[2072]), &crc, 4);
|
||||
} else {
|
||||
crc = cdrom_crc32(0xffffffff, buf, 2064) ^ 0xffffffff;
|
||||
memcpy(&(buf[2064]), &crc, 4);
|
||||
}
|
||||
|
||||
memcpy(&(buf[2064]), &crc, 4);
|
||||
int m2f1 = (trk->mode == 2) && (trk->form == 1);
|
||||
|
||||
#if 0
|
||||
/* Compute ECC P code. */
|
||||
cdrom_compute_ecc_block(dev, dev->p_parity, &(buf[12]), 86, 24, 2, 86);
|
||||
memcpy(&(buf[2076]), dev->p_parity, 172);
|
||||
cdrom_compute_ecc_block(dev, &(buf[2076]), &(buf[12]), 86, 24, 2, 86, m2f1);
|
||||
|
||||
/* Compute ECC Q code. */
|
||||
cdrom_compute_ecc_block(dev, dev->q_parity, &(buf[12]), 52, 43, 86, 88);
|
||||
memcpy(&(buf[2248]), dev->q_parity, 104);
|
||||
#else
|
||||
/* Compute ECC P code. */
|
||||
cdrom_compute_ecc_block(dev, &(buf[2076]), &(buf[12]), 86, 24, 2, 86);
|
||||
|
||||
/* Compute ECC Q code. */
|
||||
cdrom_compute_ecc_block(dev, &(buf[2248]), &(buf[12]), 52, 43, 86, 88);
|
||||
#endif
|
||||
cdrom_compute_ecc_block(dev, &(buf[2248]), &(buf[12]), 52, 43, 86, 88, m2f1);
|
||||
}
|
||||
|
||||
if ((ret > 0) && ((idx->type < INDEX_NORMAL) || (trk->subch_type != 0x08))) {
|
||||
@@ -2517,7 +2625,7 @@ image_open(cdrom_t *dev, const char *path)
|
||||
sprintf(n, "CD-ROM %i Image", dev->id + 1);
|
||||
img->log = log_open(n);
|
||||
|
||||
img->dev = dev;
|
||||
img->dev = dev;
|
||||
|
||||
if (is_mds) {
|
||||
ret = image_load_mds(img, path);
|
||||
@@ -2526,10 +2634,6 @@ image_open(cdrom_t *dev, const char *path)
|
||||
img->has_audio = 0;
|
||||
else if (ret)
|
||||
img->has_audio = 1;
|
||||
else {
|
||||
image_close(img);
|
||||
img = NULL;
|
||||
}
|
||||
} else if (is_cue) {
|
||||
ret = image_load_cue(img, path);
|
||||
|
||||
@@ -2537,25 +2641,30 @@ image_open(cdrom_t *dev, const char *path)
|
||||
img->has_audio = 0;
|
||||
else if (ret)
|
||||
img->has_audio = 1;
|
||||
else {
|
||||
image_close(img);
|
||||
img = NULL;
|
||||
}
|
||||
|
||||
if (ret >= 1)
|
||||
img->is_dvd = 2;
|
||||
} else {
|
||||
ret = image_load_iso(img, path);
|
||||
|
||||
if (!ret) {
|
||||
image_close(img);
|
||||
img = NULL;
|
||||
} else
|
||||
if (ret) {
|
||||
img->has_audio = 0;
|
||||
img->is_dvd = 2;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret)
|
||||
if (ret > 0) {
|
||||
if (img->is_dvd == 2) {
|
||||
uint32_t lb = image_get_last_block(img); /* Should be safer than previous way of doing it? */
|
||||
img->is_dvd = (lb >= 524287); /* Minimum 1 GB total capacity as threshold for DVD. */
|
||||
}
|
||||
|
||||
dev->ops = &image_ops;
|
||||
else {
|
||||
} else {
|
||||
log_warning(img->log, "Unable to load CD-ROM image: %s\n", path);
|
||||
log_close(img->log);
|
||||
|
||||
image_close(img);
|
||||
img = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
*
|
||||
* Mitsumi CD-ROM emulation for the ISA bus.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Jasmine Iwanek, <jriwanek@gmail.com>
|
||||
*
|
||||
* Copyright 2022 Miran Grca.
|
||||
* Copyright 2022 Miran Grca.
|
||||
* Copyright 2024-2025 Jasmine Iwanek.
|
||||
*/
|
||||
#include <inttypes.h>
|
||||
#include <stdarg.h>
|
||||
@@ -33,10 +33,6 @@
|
||||
#include <86box/plat.h>
|
||||
#include <86box/sound.h>
|
||||
|
||||
#define MCD_DEFAULT_IOPORT 0x310
|
||||
#define MCD_DEFAULT_IRQ 5
|
||||
#define MCD_DEFAULT_DMA 5
|
||||
|
||||
#define RAW_SECTOR_SIZE 2352
|
||||
#define COOKED_SECTOR_SIZE 2048
|
||||
|
||||
@@ -116,6 +112,8 @@ typedef struct mcd_t {
|
||||
int cur_toc_track;
|
||||
int pos;
|
||||
int newstat;
|
||||
|
||||
cdrom_t *cdrom_dev;
|
||||
} mcd_t;
|
||||
|
||||
#define CD_BCD(x) (((x) % 10) | (((x) / 10) << 4))
|
||||
@@ -140,17 +138,15 @@ mitsumi_cdrom_log(const char *fmt, ...)
|
||||
#endif
|
||||
|
||||
static int
|
||||
mitsumi_cdrom_is_ready(const cdrom_t *dev)
|
||||
mitsumi_cdrom_is_ready(const mcd_t *dev)
|
||||
{
|
||||
return (dev->image_path[0] != 0x00);
|
||||
return (dev->cdrom_dev->image_path[0] != 0x00);
|
||||
}
|
||||
|
||||
static void
|
||||
mitsumi_cdrom_reset(mcd_t *dev)
|
||||
{
|
||||
cdrom_t *cdrom = calloc(1, sizeof(cdrom_t));
|
||||
|
||||
dev->stat = mitsumi_cdrom_is_ready(cdrom) ? (STAT_READY | STAT_CHANGE) : 0;
|
||||
dev->stat = mitsumi_cdrom_is_ready(dev) ? (STAT_READY | STAT_CHANGE) : 0;
|
||||
dev->cmdrd_count = 0;
|
||||
dev->cmdbuf_count = 0;
|
||||
dev->buf_count = 0;
|
||||
@@ -168,12 +164,11 @@ mitsumi_cdrom_reset(mcd_t *dev)
|
||||
static int
|
||||
mitsumi_cdrom_read_sector(mcd_t *dev, int first)
|
||||
{
|
||||
cdrom_t *cdrom = calloc(1, sizeof(cdrom_t));
|
||||
uint8_t status;
|
||||
int ret = 0;
|
||||
|
||||
if (dev->drvmode == DRV_MODE_CDDA) {
|
||||
status = cdrom_mitsumi_audio_play(cdrom, dev->readmsf, dev->readcount);
|
||||
status = cdrom_mitsumi_audio_play(dev->cdrom_dev, dev->readmsf, dev->readcount);
|
||||
if (status == 1)
|
||||
return status;
|
||||
else
|
||||
@@ -187,15 +182,15 @@ mitsumi_cdrom_read_sector(mcd_t *dev, int first)
|
||||
dev->data = 0;
|
||||
return 0;
|
||||
}
|
||||
cdrom_stop(cdrom);
|
||||
ret = cdrom_readsector_raw(cdrom, dev->buf, cdrom->seek_pos, 0, 2, 0x10, (int *) &dev->readcount, 0);
|
||||
cdrom_stop(dev->cdrom_dev);
|
||||
ret = cdrom_readsector_raw(dev->cdrom_dev, dev->buf, dev->cdrom_dev->seek_pos, 0, 2, 0x10, (int *) &dev->readcount, 0);
|
||||
if (ret <= 0)
|
||||
return 0;
|
||||
if (dev->mode & 0x40) {
|
||||
dev->buf[12] = CD_BCD((dev->readmsf >> 16) & 0xff);
|
||||
dev->buf[13] = CD_BCD((dev->readmsf >> 8) & 0xff);
|
||||
}
|
||||
dev->readmsf = cdrom_lba_to_msf_accurate(cdrom->seek_pos + 1);
|
||||
dev->readmsf = cdrom_lba_to_msf_accurate(dev->cdrom_dev->seek_pos + 1);
|
||||
dev->buf_count = dev->dmalen + 1;
|
||||
dev->buf_idx = 0;
|
||||
dev->data = 1;
|
||||
@@ -258,7 +253,6 @@ static void
|
||||
mitsumi_cdrom_out(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
mcd_t *dev = (mcd_t *) priv;
|
||||
cdrom_t *cdrom = calloc(1, sizeof(cdrom_t));
|
||||
|
||||
pclog("Mitsumi CD-ROM OUT=%03x, val=%02x\n", port, val);
|
||||
switch (port & 1) {
|
||||
@@ -340,19 +334,19 @@ mitsumi_cdrom_out(uint16_t port, uint8_t val, void *priv)
|
||||
break;
|
||||
}
|
||||
if (!dev->cmdrd_count)
|
||||
dev->stat = mitsumi_cdrom_is_ready(cdrom) ? (STAT_READY | (dev->change ? STAT_CHANGE : 0)) : 0;
|
||||
dev->stat = mitsumi_cdrom_is_ready(dev) ? (STAT_READY | (dev->change ? STAT_CHANGE : 0)) : 0;
|
||||
return;
|
||||
}
|
||||
dev->cmd = val;
|
||||
dev->cmdbuf_idx = 0;
|
||||
dev->cmdrd_count = 0;
|
||||
dev->cmdbuf_count = 1;
|
||||
dev->cmdbuf[0] = mitsumi_cdrom_is_ready(cdrom) ? (STAT_READY | (dev->change ? STAT_CHANGE : 0)) : 0;
|
||||
dev->cmdbuf[0] = mitsumi_cdrom_is_ready(dev) ? (STAT_READY | (dev->change ? STAT_CHANGE : 0)) : 0;
|
||||
dev->data = 0;
|
||||
switch (val) {
|
||||
case CMD_GET_INFO:
|
||||
if (mitsumi_cdrom_is_ready(cdrom)) {
|
||||
cdrom_get_track_buffer(cdrom, &(dev->cmdbuf[1]));
|
||||
if (mitsumi_cdrom_is_ready(dev)) {
|
||||
cdrom_get_track_buffer(dev->cdrom_dev, &(dev->cmdbuf[1]));
|
||||
dev->cmdbuf_count = 10;
|
||||
dev->readcount = 0;
|
||||
} else {
|
||||
@@ -361,7 +355,7 @@ mitsumi_cdrom_out(uint16_t port, uint8_t val, void *priv)
|
||||
}
|
||||
break;
|
||||
case CMD_GET_Q:
|
||||
if (mitsumi_cdrom_is_ready(cdrom)) {
|
||||
if (mitsumi_cdrom_is_ready(dev)) {
|
||||
cdrom_get_q(cdrom, &(dev->cmdbuf[1]), &dev->cur_toc_track, dev->mode & MODE_GET_TOC);
|
||||
dev->cmdbuf_count = 11;
|
||||
dev->readcount = 0;
|
||||
@@ -378,7 +372,7 @@ mitsumi_cdrom_out(uint16_t port, uint8_t val, void *priv)
|
||||
break;
|
||||
case CMD_STOPCDDA:
|
||||
case CMD_STOP:
|
||||
cdrom_stop(cdrom);
|
||||
cdrom_stop(dev->cdrom_dev);
|
||||
dev->drvmode = DRV_MODE_STOP;
|
||||
dev->cur_toc_track = 0;
|
||||
break;
|
||||
@@ -387,7 +381,7 @@ mitsumi_cdrom_out(uint16_t port, uint8_t val, void *priv)
|
||||
break;
|
||||
case CMD_READ1X:
|
||||
case CMD_READ2X:
|
||||
if (mitsumi_cdrom_is_ready(cdrom)) {
|
||||
if (mitsumi_cdrom_is_ready(dev)) {
|
||||
dev->readcount = 0;
|
||||
dev->drvmode = (val == CMD_READ1X) ? DRV_MODE_CDDA : DRV_MODE_READ;
|
||||
dev->cmdrd_count = 6;
|
||||
@@ -403,7 +397,7 @@ mitsumi_cdrom_out(uint16_t port, uint8_t val, void *priv)
|
||||
dev->cmdbuf_count = 3;
|
||||
break;
|
||||
case CMD_EJECT:
|
||||
cdrom_stop(cdrom);
|
||||
cdrom_stop(dev->cdrom_dev);
|
||||
cdrom_eject(0);
|
||||
dev->readcount = 0;
|
||||
break;
|
||||
@@ -434,10 +428,23 @@ mitsumi_cdrom_init(UNUSED(const device_t *info))
|
||||
{
|
||||
mcd_t *dev = calloc(1, sizeof(mcd_t));
|
||||
|
||||
dev->irq = MCD_DEFAULT_IRQ;
|
||||
dev->dma = MCD_DEFAULT_DMA;
|
||||
for (uint8_t i = 0; i < CDROM_NUM; i++) {
|
||||
if (cdrom[i].bus_type == CDROM_BUS_MITSUMI) {
|
||||
dev->cdrom_dev = &cdrom[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
io_sethandler(MCD_DEFAULT_IOPORT, 3,
|
||||
if (!dev->cdrom_dev)
|
||||
return NULL;
|
||||
|
||||
dev->cdrom_dev->priv = &dev;
|
||||
|
||||
uint16_t base = device_get_config_hex16("base");
|
||||
dev->irq = device_get_config_int("irq");
|
||||
dev->dma = device_get_config_int("dma");
|
||||
|
||||
io_sethandler(base, 3,
|
||||
mitsumi_cdrom_in, NULL, NULL, mitsumi_cdrom_out, NULL, NULL, dev);
|
||||
|
||||
mitsumi_cdrom_reset(dev);
|
||||
@@ -456,6 +463,64 @@ mitsumi_cdrom_close(void *priv)
|
||||
}
|
||||
}
|
||||
|
||||
static const device_config_t mitsumi_config[] = {
|
||||
// clang-format off
|
||||
{
|
||||
.name = "base",
|
||||
.description = "Address",
|
||||
.type = CONFIG_HEX16,
|
||||
.default_string = NULL,
|
||||
.default_int = 0x310,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "300H", .value = 0x300 },
|
||||
{ .description = "310H", .value = 0x310 },
|
||||
{ .description = "320H", .value = 0x320 },
|
||||
{ .description = "340H", .value = 0x340 },
|
||||
{ .description = "350H", .value = 0x350 },
|
||||
{ NULL }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "irq",
|
||||
.description = "IRQ",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = NULL,
|
||||
.default_int = 5,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "IRQ 3", .value = 3 },
|
||||
{ .description = "IRQ 5", .value = 5 },
|
||||
{ .description = "IRQ 9", .value = 9 },
|
||||
{ .description = "IRQ 10", .value = 10 },
|
||||
{ .description = "IRQ 11", .value = 11 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "dma",
|
||||
.description = "DMA",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = NULL,
|
||||
.default_int = 5,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "DMA 5", .value = 5 },
|
||||
{ .description = "DMA 6", .value = 6 },
|
||||
{ .description = "DMA 7", .value = 7 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
// clang-format off
|
||||
};
|
||||
|
||||
const device_t mitsumi_cdrom_device = {
|
||||
.name = "Mitsumi CD-ROM interface",
|
||||
.internal_name = "mcd",
|
||||
@@ -467,5 +532,5 @@ const device_t mitsumi_cdrom_device = {
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
.config = mitsumi_config
|
||||
};
|
||||
|
||||
1078
src/cdrom/cdrom_mke.c
Normal file
1078
src/cdrom/cdrom_mke.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -840,7 +840,7 @@ recalc_sltptr(scamp_t *dev)
|
||||
recalc_ems(dev);
|
||||
}
|
||||
} else {
|
||||
for (uint8_t i = 0; i < (sltptr / EMS_PGSIZE); i++)
|
||||
for (uint32_t i = 0; i < (sltptr / EMS_PGSIZE); i++)
|
||||
scamp_mem_update_state(dev, i * EMS_PGSIZE, EMS_PGSIZE, 0x00, MEM_FMASK_SLOTBUS);
|
||||
|
||||
for (uint8_t i = (sltptr / EMS_PGSIZE); i < 40; i++)
|
||||
|
||||
@@ -841,7 +841,7 @@ wd76c10_pf_loc_recalc(wd76c10_t *dev)
|
||||
uint8_t ems_page;
|
||||
uint32_t base;
|
||||
|
||||
for (uint8_t i = (0x031 + pf_loc); i <= (0x037 + pf_loc); i++) {
|
||||
for (uint16_t i = (0x031 + pf_loc); i <= (0x037 + pf_loc); i++) {
|
||||
ems_page = (i - 0x10) & 0xf7;
|
||||
dev->mem_pages[i] = ems_page;
|
||||
base = ((uint32_t) i) << 14;
|
||||
|
||||
416
src/config.c
416
src/config.c
@@ -56,6 +56,7 @@
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/fdc_ext.h>
|
||||
#include <86box/gameport.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/serial_passthrough.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/mouse.h>
|
||||
@@ -65,7 +66,7 @@
|
||||
#include <86box/scsi_device.h>
|
||||
#include <86box/cdrom.h>
|
||||
#include <86box/cdrom_interface.h>
|
||||
#include <86box/zip.h>
|
||||
#include <86box/rdisk.h>
|
||||
#include <86box/mo.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/midi.h>
|
||||
@@ -453,9 +454,6 @@ load_video(void)
|
||||
if (((gfxcard[0] == VID_INTERNAL) && machine_has_flags(machine, MACHINE_VIDEO_8514A)) ||
|
||||
video_card_get_flags(gfxcard[0]) == VIDEO_FLAG_TYPE_8514)
|
||||
ini_section_delete_var(cat, "8514a");
|
||||
if (((gfxcard[0] == VID_INTERNAL) && machine_has_flags(machine, MACHINE_VIDEO_XGA)) ||
|
||||
video_card_get_flags(gfxcard[0]) == VIDEO_FLAG_TYPE_XGA)
|
||||
ini_section_delete_var(cat, "xga");
|
||||
|
||||
voodoo_enabled = !!ini_section_get_int(cat, "voodoo", 0);
|
||||
ibm8514_standalone_enabled = !!ini_section_get_int(cat, "8514a", 0);
|
||||
@@ -483,6 +481,23 @@ load_input_devices(void)
|
||||
char temp[512];
|
||||
char *p;
|
||||
|
||||
p = ini_section_get_string(cat, "keyboard_type", NULL);
|
||||
if (p != NULL)
|
||||
keyboard_type = keyboard_get_from_internal_name(p);
|
||||
else if (machine_has_bus(machine, MACHINE_BUS_PS2_PORTS)) {
|
||||
if (machine_has_flags(machine, MACHINE_KEYBOARD_JIS))
|
||||
keyboard_type = KEYBOARD_TYPE_PS55;
|
||||
else
|
||||
keyboard_type = KEYBOARD_TYPE_PS2;
|
||||
} else if (machine_has_bus(machine, MACHINE_BUS_ISA16) ||
|
||||
machine_has_bus(machine, MACHINE_BUS_PCI)) {
|
||||
if (machine_has_flags(machine, MACHINE_KEYBOARD_JIS))
|
||||
keyboard_type = KEYBOARD_TYPE_AX;
|
||||
else
|
||||
keyboard_type = KEYBOARD_TYPE_AT;
|
||||
} else
|
||||
keyboard_type = KEYBOARD_TYPE_PC_XT;
|
||||
|
||||
p = ini_section_get_string(cat, "mouse_type", NULL);
|
||||
if (p != NULL)
|
||||
mouse_type = mouse_get_from_internal_name(p);
|
||||
@@ -810,12 +825,16 @@ load_image_file(char *dest, char *p, uint8_t *ui_wp)
|
||||
prefix = "wp://";
|
||||
|
||||
if (path_abs(p)) {
|
||||
if (strlen(p) > (MAX_IMAGE_PATH_LEN - 1))
|
||||
if ((strlen(prefix) + strlen(p)) > (MAX_IMAGE_PATH_LEN - 1))
|
||||
ret = 1;
|
||||
else
|
||||
snprintf(dest, MAX_IMAGE_PATH_LEN, "%s%s", prefix, p);
|
||||
} else
|
||||
snprintf(dest, MAX_IMAGE_PATH_LEN, "%s%s%s%s", prefix, usr_path, path_get_slash(usr_path), p);
|
||||
} else {
|
||||
if ((strlen(prefix) + strlen(usr_path) + strlen(path_get_slash(usr_path)) + strlen(p)) > (MAX_IMAGE_PATH_LEN - 1))
|
||||
ret = 1;
|
||||
else
|
||||
snprintf(dest, MAX_IMAGE_PATH_LEN, "%s%s%s%s", prefix, usr_path, path_get_slash(usr_path), p);
|
||||
}
|
||||
|
||||
path_normalize(dest);
|
||||
|
||||
@@ -831,7 +850,6 @@ load_storage_controllers(void)
|
||||
char *p;
|
||||
char temp[512];
|
||||
int min = 0;
|
||||
int free_p = 0;
|
||||
|
||||
for (int c = min; c < SCSI_CARD_MAX; c++) {
|
||||
sprintf(temp, "scsicard_%d", c + 1);
|
||||
@@ -850,6 +868,8 @@ load_storage_controllers(void)
|
||||
else
|
||||
fdc_current[0] = FDC_INTERNAL;
|
||||
#else
|
||||
int free_p = 0;
|
||||
|
||||
if (p == NULL) {
|
||||
if (machine_has_flags(machine, MACHINE_FDC)) {
|
||||
p = (char *) malloc((strlen("internal") + 1) * sizeof(char));
|
||||
@@ -870,46 +890,54 @@ load_storage_controllers(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
p = ini_section_get_string(cat, "hdc", NULL);
|
||||
if (p == NULL) {
|
||||
if (machine_has_flags(machine, MACHINE_HDC)) {
|
||||
p = (char *) malloc((strlen("internal") + 1) * sizeof(char));
|
||||
strcpy(p, "internal");
|
||||
} else {
|
||||
p = (char *) malloc((strlen("none") + 1) * sizeof(char));
|
||||
strcpy(p, "none");
|
||||
}
|
||||
free_p = 1;
|
||||
}
|
||||
/* Migrate renamed and merged cards. */
|
||||
if (!strcmp(p, "xtide_plus")) {
|
||||
hdc_current[0] = hdc_get_from_internal_name("xtide");
|
||||
migration_cat = ini_find_or_create_section(config, "PC/XT XTIDE");
|
||||
ini_section_set_string(migration_cat, "bios", "xt_plus");
|
||||
} else if (!strcmp(p, "xtide_at_386")) {
|
||||
hdc_current[0] = hdc_get_from_internal_name("xtide_at");
|
||||
migration_cat = ini_find_or_create_section(config, "PC/AT XTIDE");
|
||||
ini_section_set_string(migration_cat, "bios", "at_386");
|
||||
} else
|
||||
hdc_current[0] = hdc_get_from_internal_name(p);
|
||||
for (int c = min; c < HDC_MAX; c++) {
|
||||
sprintf(temp, "hdc_%d", c + 1);
|
||||
|
||||
if (free_p) {
|
||||
free(p);
|
||||
p = NULL;
|
||||
p = ini_section_get_string(cat, temp, NULL);
|
||||
if (p != NULL)
|
||||
hdc_current[c] = hdc_get_from_internal_name(p);
|
||||
else
|
||||
hdc_current[c] = 0;
|
||||
}
|
||||
|
||||
/* Backwards compatibility for single HDC and standalone tertiary/quaternary IDE from v4.2 and older. */
|
||||
const char *legacy_cards[] = { NULL, "ide_ter", "ide_qua" };
|
||||
p = ini_section_get_string(cat, "hdc", NULL);
|
||||
for (int i = !(p || machine_has_flags(machine, MACHINE_HDC)), j = 0; i < (sizeof(legacy_cards) / sizeof(legacy_cards[0])); i++) {
|
||||
if (!legacy_cards[i] || (ini_section_get_int(cat, legacy_cards[i], 0) == 1)) {
|
||||
/* Migrate to the first available HDC slot. */
|
||||
for (; j < (sizeof(hdc_current) / sizeof(hdc_current[0])); j++) {
|
||||
if (!hdc_current[j]) {
|
||||
if (!legacy_cards[i]) {
|
||||
if (!p) {
|
||||
hdc_current[j] = hdc_get_from_internal_name("internal");
|
||||
} else if (!strcmp(p, "xtide_plus")) {
|
||||
hdc_current[j] = hdc_get_from_internal_name("xtide");
|
||||
sprintf(temp, "PC/XT XTIDE #%i", j + 1);
|
||||
migration_cat = ini_find_or_create_section(config, temp);
|
||||
ini_section_set_string(migration_cat, "bios", "xt_plus");
|
||||
} else if (!strcmp(p, "xtide_at_386")) {
|
||||
hdc_current[j] = hdc_get_from_internal_name("xtide_at");
|
||||
sprintf(temp, "PC/AT XTIDE #%i", j + 1);
|
||||
migration_cat = ini_find_or_create_section(config, temp);
|
||||
ini_section_set_string(migration_cat, "bios", "at_386");
|
||||
} else {
|
||||
hdc_current[j] = hdc_get_from_internal_name(p);
|
||||
}
|
||||
} else {
|
||||
hdc_current[j] = hdc_get_from_internal_name(legacy_cards[i]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
ini_section_delete_var(cat, "hdc");
|
||||
|
||||
p = ini_section_get_string(cat, "cdrom_interface", NULL);
|
||||
if (p != NULL)
|
||||
cdrom_interface_current = cdrom_interface_get_from_internal_name(p);
|
||||
|
||||
if (free_p) {
|
||||
free(p);
|
||||
p = NULL;
|
||||
}
|
||||
|
||||
ide_ter_enabled = !!ini_section_get_int(cat, "ide_ter", 0);
|
||||
ide_qua_enabled = !!ini_section_get_int(cat, "ide_qua", 0);
|
||||
|
||||
if (machine_has_bus(machine, MACHINE_BUS_CASSETTE))
|
||||
cassette_enable = !!ini_section_get_int(cat, "cassette_enabled", 0);
|
||||
else
|
||||
@@ -1335,11 +1363,23 @@ load_floppy_and_cdrom_drives(void)
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
/* Default values, needed for proper operation of the Settings dialog. */
|
||||
cdrom[c].ide_channel = cdrom[c].scsi_device_id = c + 2;
|
||||
cdrom[c].mke_channel = cdrom[c].ide_channel = cdrom[c].scsi_device_id = c & 3;
|
||||
|
||||
if (cdrom[c].bus_type == CDROM_BUS_ATAPI) {
|
||||
if (cdrom[c].bus_type == CDROM_BUS_MKE) {
|
||||
char *type = cdrom_get_internal_name(cdrom_get_type(c));
|
||||
|
||||
if (strstr(type, "cr56") == NULL)
|
||||
cdrom_set_type(c, cdrom_get_from_internal_name("cr563_075"));
|
||||
|
||||
sprintf(temp, "cdrom_%02i_mke_channel", c + 1);
|
||||
cdrom[c].mke_channel = ini_section_get_int(cat, temp, c & 3);
|
||||
|
||||
if (cdrom[c].mke_channel > 3)
|
||||
cdrom[c].mke_channel = 3;
|
||||
|
||||
} else if (cdrom[c].bus_type == CDROM_BUS_ATAPI) {
|
||||
sprintf(temp, "cdrom_%02i_ide_channel", c + 1);
|
||||
sprintf(tmp2, "%01u:%01u", (c + 2) >> 1, (c + 2) & 1);
|
||||
sprintf(tmp2, "%01u:%01u", (c & 3) >> 1, (c & 3) & 1);
|
||||
p = ini_section_get_string(cat, temp, tmp2);
|
||||
sscanf(p, "%01u:%01u", &board, &dev);
|
||||
board &= 3;
|
||||
@@ -1350,13 +1390,13 @@ load_floppy_and_cdrom_drives(void)
|
||||
cdrom[c].ide_channel = 7;
|
||||
} else if (cdrom[c].bus_type == CDROM_BUS_SCSI) {
|
||||
sprintf(temp, "cdrom_%02i_scsi_location", c + 1);
|
||||
sprintf(tmp2, "%01u:%02u", SCSI_BUS_MAX, c + 2);
|
||||
sprintf(tmp2, "%01u:%02u", SCSI_BUS_MAX, c & 3);
|
||||
p = ini_section_get_string(cat, temp, tmp2);
|
||||
sscanf(p, "%01u:%02u", &board, &dev);
|
||||
if (board >= SCSI_BUS_MAX) {
|
||||
/* Invalid bus - check legacy ID */
|
||||
sprintf(temp, "cdrom_%02i_scsi_id", c + 1);
|
||||
cdrom[c].scsi_device_id = ini_section_get_int(cat, temp, c + 2);
|
||||
cdrom[c].scsi_device_id = ini_section_get_int(cat, temp, c & 3);
|
||||
|
||||
if (cdrom[c].scsi_device_id > 15)
|
||||
cdrom[c].scsi_device_id = 15;
|
||||
@@ -1367,6 +1407,11 @@ load_floppy_and_cdrom_drives(void)
|
||||
}
|
||||
}
|
||||
|
||||
if (cdrom[c].bus_type != CDROM_BUS_MKE) {
|
||||
sprintf(temp, "cdrom_%02i_mke_channel", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
}
|
||||
|
||||
if (cdrom[c].bus_type != CDROM_BUS_ATAPI) {
|
||||
sprintf(temp, "cdrom_%02i_ide_channel", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
@@ -1458,32 +1503,35 @@ load_other_removable_devices(void)
|
||||
unsigned int board = 0;
|
||||
unsigned int dev = 0;
|
||||
int c;
|
||||
int legacy_zip_drives = 0;
|
||||
|
||||
memset(temp, 0x00, sizeof(temp));
|
||||
for (c = 0; c < ZIP_NUM; c++) {
|
||||
for (c = 0; c < RDISK_NUM; c++) {
|
||||
sprintf(temp, "zip_%02i_parameters", c + 1);
|
||||
p = ini_section_get_string(cat, temp, NULL);
|
||||
if (p != NULL)
|
||||
sscanf(p, "%01u, %s", &zip_drives[c].is_250, s);
|
||||
else
|
||||
sscanf("0, none", "%01u, %s", &zip_drives[c].is_250, s);
|
||||
zip_drives[c].bus_type = hdd_string_to_bus(s, 1);
|
||||
if (p != NULL) {
|
||||
sscanf(p, "%01u, %s", &rdisk_drives[c].type, s);
|
||||
legacy_zip_drives++;
|
||||
} else
|
||||
sscanf("0, none", "%01u, %s", &rdisk_drives[c].type, s);
|
||||
rdisk_drives[c].type++;
|
||||
rdisk_drives[c].bus_type = hdd_string_to_bus(s, 1);
|
||||
|
||||
/* Default values, needed for proper operation of the Settings dialog. */
|
||||
zip_drives[c].ide_channel = zip_drives[c].scsi_device_id = c + 2;
|
||||
rdisk_drives[c].ide_channel = rdisk_drives[c].scsi_device_id = c + 2;
|
||||
|
||||
if (zip_drives[c].bus_type == ZIP_BUS_ATAPI) {
|
||||
if (rdisk_drives[c].bus_type == RDISK_BUS_ATAPI) {
|
||||
sprintf(temp, "zip_%02i_ide_channel", c + 1);
|
||||
sprintf(tmp2, "%01u:%01u", (c + 2) >> 1, (c + 2) & 1);
|
||||
p = ini_section_get_string(cat, temp, tmp2);
|
||||
sscanf(p, "%01u:%01u", &board, &dev);
|
||||
board &= 3;
|
||||
dev &= 1;
|
||||
zip_drives[c].ide_channel = (board << 1) + dev;
|
||||
rdisk_drives[c].ide_channel = (board << 1) + dev;
|
||||
|
||||
if (zip_drives[c].ide_channel > 7)
|
||||
zip_drives[c].ide_channel = 7;
|
||||
} else if (zip_drives[c].bus_type == ZIP_BUS_SCSI) {
|
||||
if (rdisk_drives[c].ide_channel > 7)
|
||||
rdisk_drives[c].ide_channel = 7;
|
||||
} else if (rdisk_drives[c].bus_type == RDISK_BUS_SCSI) {
|
||||
sprintf(temp, "zip_%02i_scsi_location", c + 1);
|
||||
sprintf(tmp2, "%01u:%02u", SCSI_BUS_MAX, c + 2);
|
||||
p = ini_section_get_string(cat, temp, tmp2);
|
||||
@@ -1491,23 +1539,23 @@ load_other_removable_devices(void)
|
||||
if (board >= SCSI_BUS_MAX) {
|
||||
/* Invalid bus - check legacy ID */
|
||||
sprintf(temp, "zip_%02i_scsi_id", c + 1);
|
||||
zip_drives[c].scsi_device_id = ini_section_get_int(cat, temp, c + 2);
|
||||
rdisk_drives[c].scsi_device_id = ini_section_get_int(cat, temp, c + 2);
|
||||
|
||||
if (zip_drives[c].scsi_device_id > 15)
|
||||
zip_drives[c].scsi_device_id = 15;
|
||||
if (rdisk_drives[c].scsi_device_id > 15)
|
||||
rdisk_drives[c].scsi_device_id = 15;
|
||||
} else {
|
||||
board %= SCSI_BUS_MAX;
|
||||
dev &= 15;
|
||||
zip_drives[c].scsi_device_id = (board << 4) + dev;
|
||||
rdisk_drives[c].scsi_device_id = (board << 4) + dev;
|
||||
}
|
||||
}
|
||||
|
||||
if (zip_drives[c].bus_type != ZIP_BUS_ATAPI) {
|
||||
if (rdisk_drives[c].bus_type != RDISK_BUS_ATAPI) {
|
||||
sprintf(temp, "zip_%02i_ide_channel", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
}
|
||||
|
||||
if (zip_drives[c].bus_type != ZIP_BUS_SCSI) {
|
||||
if (rdisk_drives[c].bus_type != RDISK_BUS_SCSI) {
|
||||
sprintf(temp, "zip_%02i_scsi_location", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
}
|
||||
@@ -1519,49 +1567,154 @@ load_other_removable_devices(void)
|
||||
p = ini_section_get_string(cat, temp, "");
|
||||
|
||||
sprintf(temp, "zip_%02i_writeprot", c + 1);
|
||||
zip_drives[c].read_only = ini_section_get_int(cat, temp, 0);
|
||||
rdisk_drives[c].read_only = ini_section_get_int(cat, temp, 0);
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
if (!strcmp(p, usr_path))
|
||||
p[0] = 0x00;
|
||||
|
||||
if (p[0] != 0x00) {
|
||||
if (load_image_file(zip_drives[c].image_path, p, &(zip_drives[c].read_only)))
|
||||
if (load_image_file(rdisk_drives[c].image_path, p, &(rdisk_drives[c].read_only)))
|
||||
fatal("Configuration: Length of zip_%02i_image_path is more than 511\n", c + 1);
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_PREV_IMAGES; i++) {
|
||||
zip_drives[c].image_history[i] = (char *) calloc((MAX_IMAGE_PATH_LEN + 1) << 1, sizeof(char));
|
||||
rdisk_drives[c].image_history[i] = (char *) calloc((MAX_IMAGE_PATH_LEN + 1) << 1, sizeof(char));
|
||||
sprintf(temp, "zip_%02i_image_history_%02i", c + 1, i + 1);
|
||||
p = ini_section_get_string(cat, temp, NULL);
|
||||
if (p) {
|
||||
if (load_image_file(zip_drives[c].image_history[i], p, NULL))
|
||||
if (load_image_file(rdisk_drives[c].image_history[i], p, NULL))
|
||||
fatal("Configuration: Length of zip_%02i_image_history_%02i is more than %i\n",
|
||||
c + 1, i + 1, MAX_IMAGE_PATH_LEN - 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* If the ZIP drive is disabled, delete all its variables. */
|
||||
if (zip_drives[c].bus_type == ZIP_BUS_DISABLED) {
|
||||
sprintf(temp, "zip_%02i_parameters", c + 1);
|
||||
sprintf(temp, "zip_%02i_parameters", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
sprintf(temp, "zip_%02i_ide_channel", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
sprintf(temp, "zip_%02i_scsi_location", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
sprintf(temp, "zip_%02i_image_path", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
for (int i = 0; i < MAX_PREV_IMAGES; i++) {
|
||||
sprintf(temp, "zip_%02i_image_history_%02i", c + 1, i + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
}
|
||||
}
|
||||
|
||||
if (legacy_zip_drives > 0)
|
||||
goto go_to_mo;
|
||||
|
||||
memset(temp, 0x00, sizeof(temp));
|
||||
for (c = 0; c < RDISK_NUM; c++) {
|
||||
sprintf(temp, "rdisk_%02i_parameters", c + 1);
|
||||
p = ini_section_get_string(cat, temp, NULL);
|
||||
if (p != NULL) {
|
||||
sscanf(p, "%01u, %s", &rdisk_drives[c].type, s);
|
||||
legacy_zip_drives++;
|
||||
} else
|
||||
sscanf("0, none", "%01u, %s", &rdisk_drives[c].type, s);
|
||||
rdisk_drives[c].bus_type = hdd_string_to_bus(s, 1);
|
||||
|
||||
/* Default values, needed for proper operation of the Settings dialog. */
|
||||
rdisk_drives[c].ide_channel = rdisk_drives[c].scsi_device_id = c + 2;
|
||||
|
||||
if (rdisk_drives[c].bus_type == RDISK_BUS_ATAPI) {
|
||||
sprintf(temp, "rdisk_%02i_ide_channel", c + 1);
|
||||
sprintf(tmp2, "%01u:%01u", (c + 2) >> 1, (c + 2) & 1);
|
||||
p = ini_section_get_string(cat, temp, tmp2);
|
||||
sscanf(p, "%01u:%01u", &board, &dev);
|
||||
board &= 3;
|
||||
dev &= 1;
|
||||
rdisk_drives[c].ide_channel = (board << 1) + dev;
|
||||
|
||||
if (rdisk_drives[c].ide_channel > 7)
|
||||
rdisk_drives[c].ide_channel = 7;
|
||||
} else if (rdisk_drives[c].bus_type == RDISK_BUS_SCSI) {
|
||||
sprintf(temp, "rdisk_%02i_scsi_location", c + 1);
|
||||
sprintf(tmp2, "%01u:%02u", SCSI_BUS_MAX, c + 2);
|
||||
p = ini_section_get_string(cat, temp, tmp2);
|
||||
sscanf(p, "%01u:%02u", &board, &dev);
|
||||
if (board >= SCSI_BUS_MAX) {
|
||||
/* Invalid bus - check legacy ID */
|
||||
sprintf(temp, "rdisk_%02i_scsi_id", c + 1);
|
||||
rdisk_drives[c].scsi_device_id = ini_section_get_int(cat, temp, c + 2);
|
||||
|
||||
if (rdisk_drives[c].scsi_device_id > 15)
|
||||
rdisk_drives[c].scsi_device_id = 15;
|
||||
} else {
|
||||
board %= SCSI_BUS_MAX;
|
||||
dev &= 15;
|
||||
rdisk_drives[c].scsi_device_id = (board << 4) + dev;
|
||||
}
|
||||
}
|
||||
|
||||
if (rdisk_drives[c].bus_type != RDISK_BUS_ATAPI) {
|
||||
sprintf(temp, "rdisk_%02i_ide_channel", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
}
|
||||
|
||||
if (rdisk_drives[c].bus_type != RDISK_BUS_SCSI) {
|
||||
sprintf(temp, "rdisk_%02i_scsi_location", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
}
|
||||
|
||||
sprintf(temp, "rdisk_%02i_scsi_id", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
sprintf(temp, "rdisk_%02i_image_path", c + 1);
|
||||
p = ini_section_get_string(cat, temp, "");
|
||||
|
||||
sprintf(temp, "rdisk_%02i_writeprot", c + 1);
|
||||
rdisk_drives[c].read_only = ini_section_get_int(cat, temp, 0);
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
if (!strcmp(p, usr_path))
|
||||
p[0] = 0x00;
|
||||
|
||||
if (p[0] != 0x00) {
|
||||
if (load_image_file(rdisk_drives[c].image_path, p, &(rdisk_drives[c].read_only)))
|
||||
fatal("Configuration: Length of rdisk_%02i_image_path is more than 511\n", c + 1);
|
||||
}
|
||||
|
||||
for (int i = 0; i < MAX_PREV_IMAGES; i++) {
|
||||
rdisk_drives[c].image_history[i] = (char *) calloc((MAX_IMAGE_PATH_LEN + 1) << 1, sizeof(char));
|
||||
sprintf(temp, "rdisk_%02i_image_history_%02i", c + 1, i + 1);
|
||||
p = ini_section_get_string(cat, temp, NULL);
|
||||
if (p) {
|
||||
if (load_image_file(rdisk_drives[c].image_history[i], p, NULL))
|
||||
fatal("Configuration: Length of rdisk_%02i_image_history_%02i is more than %i\n",
|
||||
c + 1, i + 1, MAX_IMAGE_PATH_LEN - 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* If the removable disk drive is disabled, delete all its variables. */
|
||||
if (rdisk_drives[c].bus_type == RDISK_BUS_DISABLED) {
|
||||
sprintf(temp, "rdisk_%02i_parameters", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
sprintf(temp, "zip_%02i_ide_channel", c + 1);
|
||||
sprintf(temp, "rdisk_%02i_ide_channel", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
sprintf(temp, "zip_%02i_scsi_location", c + 1);
|
||||
sprintf(temp, "rdisk_%02i_scsi_location", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
sprintf(temp, "zip_%02i_image_path", c + 1);
|
||||
sprintf(temp, "rdisk_%02i_image_path", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
for (int i = 0; i < MAX_PREV_IMAGES; i++) {
|
||||
sprintf(temp, "zip_%02i_image_history_%02i", c + 1, i + 1);
|
||||
sprintf(temp, "rdisk_%02i_image_history_%02i", c + 1, i + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
go_to_mo:
|
||||
memset(temp, 0x00, sizeof(temp));
|
||||
for (c = 0; c < MO_NUM; c++) {
|
||||
sprintf(temp, "mo_%02i_parameters", c + 1);
|
||||
@@ -1820,7 +1973,7 @@ config_load(void)
|
||||
#ifdef USE_IOCTL
|
||||
memset(cdrom_ioctl, 0, sizeof(cdrom_ioctl_t) * CDROM_NUM);
|
||||
#endif
|
||||
memset(zip_drives, 0, sizeof(zip_drive_t));
|
||||
memset(rdisk_drives, 0, sizeof(rdisk_drive_t));
|
||||
|
||||
config = ini_read(cfg_path);
|
||||
|
||||
@@ -1847,7 +2000,11 @@ config_load(void)
|
||||
vid_resize = 0;
|
||||
video_fullscreen_scale = 1;
|
||||
time_sync = TIME_SYNC_ENABLED;
|
||||
hdc_current[0] = hdc_get_from_internal_name("none");
|
||||
|
||||
keyboard_type = KEYBOARD_TYPE_PC_XT;
|
||||
|
||||
for (int i = 0; i < HDC_MAX; i++)
|
||||
hdc_current[i] = hdc_get_from_internal_name("none");
|
||||
|
||||
com_ports[0].enabled = 1;
|
||||
com_ports[1].enabled = 1;
|
||||
@@ -2272,6 +2429,8 @@ save_input_devices(void)
|
||||
char temp[512];
|
||||
char tmp2[512];
|
||||
|
||||
ini_section_set_string(cat, "keyboard_type", keyboard_get_internal_name(keyboard_type));
|
||||
|
||||
ini_section_set_string(cat, "mouse_type", mouse_get_internal_name(mouse_type));
|
||||
|
||||
if (!joystick_type) {
|
||||
@@ -2603,16 +2762,39 @@ save_storage_controllers(void)
|
||||
ini_section_set_string(cat, "fdc",
|
||||
fdc_card_get_internal_name(fdc_current[0]));
|
||||
|
||||
if (machine_has_flags(machine, MACHINE_HDC))
|
||||
def_hdc = "internal";
|
||||
else
|
||||
def_hdc = "none";
|
||||
ini_section_delete_var(cat, "hdc");
|
||||
|
||||
if (!strcmp(hdc_get_internal_name(hdc_current[0]), def_hdc))
|
||||
ini_section_delete_var(cat, "hdc");
|
||||
else
|
||||
ini_section_set_string(cat, "hdc",
|
||||
hdc_get_internal_name(hdc_current[0]));
|
||||
for (c = 0; c < HDC_MAX; c++) {
|
||||
sprintf(temp, "hdc_%d", c + 1);
|
||||
|
||||
if ((c == 0) && machine_has_flags(machine, MACHINE_HDC))
|
||||
def_hdc = "internal";
|
||||
else
|
||||
def_hdc = "none";
|
||||
|
||||
if (!strcmp(hdc_get_internal_name(hdc_current[c]), def_hdc))
|
||||
ini_section_delete_var(cat, temp);
|
||||
else
|
||||
ini_section_set_string(cat, temp,
|
||||
hdc_get_internal_name(hdc_current[c]));
|
||||
}
|
||||
|
||||
/* Downgrade compatibility for standalone tertiary/quaternary IDE from v4.2 and older. */
|
||||
const char *legacy_cards[] = { "ide_ter", "ide_qua" };
|
||||
for (int i = 0; i < (sizeof(legacy_cards) / sizeof(legacy_cards[0])); i++) {
|
||||
int card_id = hdc_get_from_internal_name(legacy_cards[i]);
|
||||
for (int j = 0; j < (sizeof(sound_card_current) / sizeof(sound_card_current[0])); j++) {
|
||||
if (hdc_current[j] == card_id) {
|
||||
/* A special value of 2 still enables the cards on older versions,
|
||||
but lets newer versions know that they've already been migrated. */
|
||||
ini_section_set_int(cat, legacy_cards[i], 2);
|
||||
card_id = 0; /* mark as found */
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (card_id > 0) /* not found */
|
||||
ini_section_delete_var(cat, legacy_cards[i]);
|
||||
}
|
||||
|
||||
if (cdrom_interface_current == 0)
|
||||
ini_section_delete_var(cat, "cdrom_interface");
|
||||
@@ -2620,16 +2802,6 @@ save_storage_controllers(void)
|
||||
ini_section_set_string(cat, "cdrom_interface",
|
||||
cdrom_interface_get_internal_name(cdrom_interface_current));
|
||||
|
||||
if (ide_ter_enabled == 0)
|
||||
ini_section_delete_var(cat, "ide_ter");
|
||||
else
|
||||
ini_section_set_int(cat, "ide_ter", ide_ter_enabled);
|
||||
|
||||
if (ide_qua_enabled == 0)
|
||||
ini_section_delete_var(cat, "ide_qua");
|
||||
else
|
||||
ini_section_set_int(cat, "ide_qua", ide_qua_enabled);
|
||||
|
||||
if (cassette_enable == 0)
|
||||
ini_section_delete_var(cat, "cassette_enabled");
|
||||
else
|
||||
@@ -2967,8 +3139,7 @@ save_floppy_and_cdrom_drives(void)
|
||||
|
||||
sprintf(temp, "cdrom_%02i_type", c + 1);
|
||||
char *tn = cdrom_get_internal_name(cdrom_get_type(c));
|
||||
if ((cdrom[c].bus_type == 0) || (cdrom[c].bus_type == CDROM_BUS_MITSUMI) ||
|
||||
!strcmp(tn, "86cd"))
|
||||
if ((cdrom[c].bus_type == 0) || (cdrom[c].bus_type == CDROM_BUS_MITSUMI) || !strcmp(tn, "86cd"))
|
||||
ini_section_delete_var(cat, temp);
|
||||
else
|
||||
ini_section_set_string(cat, temp, tn);
|
||||
@@ -2987,6 +3158,13 @@ save_floppy_and_cdrom_drives(void)
|
||||
ini_section_set_string(cat, temp, tmp2);
|
||||
}
|
||||
|
||||
sprintf(temp, "cdrom_%02i_mke_channel", c + 1);
|
||||
if (cdrom[c].bus_type != CDROM_BUS_MKE)
|
||||
ini_section_delete_var(cat, temp);
|
||||
else {
|
||||
ini_section_set_int(cat, temp, cdrom[c].mke_channel);
|
||||
}
|
||||
|
||||
sprintf(temp, "cdrom_%02i_ide_channel", c + 1);
|
||||
if (cdrom[c].bus_type != CDROM_BUS_ATAPI)
|
||||
ini_section_delete_var(cat, temp);
|
||||
@@ -3045,52 +3223,52 @@ save_other_removable_devices(void)
|
||||
char tmp2[512];
|
||||
int c;
|
||||
|
||||
for (c = 0; c < ZIP_NUM; c++) {
|
||||
sprintf(temp, "zip_%02i_parameters", c + 1);
|
||||
if (zip_drives[c].bus_type == 0) {
|
||||
for (c = 0; c < RDISK_NUM; c++) {
|
||||
sprintf(temp, "rdisk_%02i_parameters", c + 1);
|
||||
if (rdisk_drives[c].bus_type == 0) {
|
||||
ini_section_delete_var(cat, temp);
|
||||
} else {
|
||||
sprintf(tmp2, "%u, %s", zip_drives[c].is_250,
|
||||
hdd_bus_to_string(zip_drives[c].bus_type, 1));
|
||||
sprintf(tmp2, "%u, %s", rdisk_drives[c].type,
|
||||
hdd_bus_to_string(rdisk_drives[c].bus_type, 1));
|
||||
ini_section_set_string(cat, temp, tmp2);
|
||||
}
|
||||
|
||||
sprintf(temp, "zip_%02i_ide_channel", c + 1);
|
||||
if (zip_drives[c].bus_type != ZIP_BUS_ATAPI)
|
||||
sprintf(temp, "rdisk_%02i_ide_channel", c + 1);
|
||||
if (rdisk_drives[c].bus_type != RDISK_BUS_ATAPI)
|
||||
ini_section_delete_var(cat, temp);
|
||||
else {
|
||||
sprintf(tmp2, "%01u:%01u", zip_drives[c].ide_channel >> 1,
|
||||
zip_drives[c].ide_channel & 1);
|
||||
sprintf(tmp2, "%01u:%01u", rdisk_drives[c].ide_channel >> 1,
|
||||
rdisk_drives[c].ide_channel & 1);
|
||||
ini_section_set_string(cat, temp, tmp2);
|
||||
}
|
||||
|
||||
sprintf(temp, "zip_%02i_scsi_id", c + 1);
|
||||
sprintf(temp, "rdisk_%02i_scsi_id", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
sprintf(temp, "zip_%02i_writeprot", c + 1);
|
||||
sprintf(temp, "rdisk_%02i_writeprot", c + 1);
|
||||
ini_section_delete_var(cat, temp);
|
||||
|
||||
sprintf(temp, "zip_%02i_scsi_location", c + 1);
|
||||
if (zip_drives[c].bus_type != ZIP_BUS_SCSI)
|
||||
sprintf(temp, "rdisk_%02i_scsi_location", c + 1);
|
||||
if (rdisk_drives[c].bus_type != RDISK_BUS_SCSI)
|
||||
ini_section_delete_var(cat, temp);
|
||||
else {
|
||||
sprintf(tmp2, "%01u:%02u", zip_drives[c].scsi_device_id >> 4,
|
||||
zip_drives[c].scsi_device_id & 15);
|
||||
sprintf(tmp2, "%01u:%02u", rdisk_drives[c].scsi_device_id >> 4,
|
||||
rdisk_drives[c].scsi_device_id & 15);
|
||||
ini_section_set_string(cat, temp, tmp2);
|
||||
}
|
||||
|
||||
sprintf(temp, "zip_%02i_image_path", c + 1);
|
||||
if ((zip_drives[c].bus_type == 0) || (strlen(zip_drives[c].image_path) == 0))
|
||||
sprintf(temp, "rdisk_%02i_image_path", c + 1);
|
||||
if ((rdisk_drives[c].bus_type == 0) || (strlen(rdisk_drives[c].image_path) == 0))
|
||||
ini_section_delete_var(cat, temp);
|
||||
else
|
||||
save_image_file(cat, temp, zip_drives[c].image_path);
|
||||
save_image_file(cat, temp, rdisk_drives[c].image_path);
|
||||
|
||||
for (int i = 0; i < MAX_PREV_IMAGES; i++) {
|
||||
sprintf(temp, "zip_%02i_image_history_%02i", c + 1, i + 1);
|
||||
if ((zip_drives[c].image_history[i] == 0) || strlen(zip_drives[c].image_history[i]) == 0)
|
||||
sprintf(temp, "rdisk_%02i_image_history_%02i", c + 1, i + 1);
|
||||
if ((rdisk_drives[c].image_history[i] == 0) || strlen(rdisk_drives[c].image_history[i]) == 0)
|
||||
ini_section_delete_var(cat, temp);
|
||||
else
|
||||
save_image_file(cat, temp, zip_drives[c].image_history[i]);
|
||||
save_image_file(cat, temp, rdisk_drives[c].image_history[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -539,10 +539,9 @@ pfq_write(void)
|
||||
static uint8_t
|
||||
pfq_read(void)
|
||||
{
|
||||
uint8_t temp, i;
|
||||
uint8_t temp = pfq[0];
|
||||
|
||||
temp = pfq[0];
|
||||
for (i = 0; i < (pfq_size - 1); i++)
|
||||
for (int i = 0; i < (pfq_size - 1); i++)
|
||||
pfq[i] = pfq[i + 1];
|
||||
pfq_pos--;
|
||||
cpu_state.pc = (cpu_state.pc + 1) & 0xffff;
|
||||
|
||||
@@ -469,7 +469,6 @@ device_get_bios_local(const device_t *dev, const char *internal_name)
|
||||
(bios->name != NULL) &&
|
||||
(bios->internal_name != NULL) &&
|
||||
(bios->files_no != 0)) {
|
||||
printf("Internal name was: %s", internal_name);
|
||||
if (!strcmp(internal_name, bios->internal_name))
|
||||
return bios->local;
|
||||
bios++;
|
||||
|
||||
@@ -38,6 +38,7 @@ add_library(dev OBJECT
|
||||
isapnp.c
|
||||
kbc_at.c
|
||||
kbc_at_dev.c
|
||||
kbc_xt.c
|
||||
keyboard.c
|
||||
keyboard_at.c
|
||||
keyboard_xt.c
|
||||
|
||||
@@ -1391,10 +1391,10 @@ static const device_config_t ems5150_config[] = {
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "Disabled", .value = 0x0000 },
|
||||
{ .description = "Board 1", .value = 0x0208 },
|
||||
{ .description = "Board 2", .value = 0x020a },
|
||||
{ .description = "Board 3", .value = 0x020c },
|
||||
{ .description = "Board 4", .value = 0x020e },
|
||||
{ .description = "208H", .value = 0x0208 },
|
||||
{ .description = "20AH", .value = 0x020a },
|
||||
{ .description = "20CH", .value = 0x020c },
|
||||
{ .description = "20EH", .value = 0x020e },
|
||||
{ .description = "" }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
|
||||
@@ -248,7 +248,7 @@ static const device_config_t isarom_config[] = {
|
||||
},
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0x00000,
|
||||
@@ -557,7 +557,7 @@ static const device_config_t isarom_quad_config[] = {
|
||||
static const device_config_t lba_enhancer_config[] = {
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xc8000,
|
||||
|
||||
@@ -823,7 +823,7 @@ static const device_config_t mm58167_config[] = {
|
||||
},
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xcc000,
|
||||
|
||||
@@ -2661,7 +2661,15 @@ kbc_at_init(const device_t *info)
|
||||
dev->ports[1] = kbc_at_ports[1];
|
||||
|
||||
/* The actual keyboard. */
|
||||
device_add(&keyboard_at_generic_device);
|
||||
if (keyboard_type == KEYBOARD_TYPE_INTERNAL) {
|
||||
if (machine_has_flags(machine, MACHINE_KEYBOARD_JIS))
|
||||
device_add(((dev->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1) ? &keyboard_ps55_device :
|
||||
&keyboard_ax_device);
|
||||
else
|
||||
device_add_params(&keyboard_at_generic_device, (void *) (uintptr_t)
|
||||
(((dev->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1) ? FLAG_PS2_KBD : 0x00));
|
||||
} else
|
||||
keyboard_add_device();
|
||||
|
||||
fast_reset = 0x00;
|
||||
|
||||
@@ -2670,9 +2678,9 @@ kbc_at_init(const device_t *info)
|
||||
return dev;
|
||||
}
|
||||
|
||||
const device_t keyboard_at_device = {
|
||||
.name = "PC/AT Keyboard",
|
||||
.internal_name = "keyboard_at",
|
||||
const device_t kbc_at_device = {
|
||||
.name = "PC/AT Keyboard Controller",
|
||||
.internal_name = "kbc_at",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_ISA | KBC_VEN_GENERIC,
|
||||
.init = kbc_at_init,
|
||||
@@ -2684,9 +2692,9 @@ const device_t keyboard_at_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_at_siemens_device = {
|
||||
.name = "PC/AT Keyboard",
|
||||
.internal_name = "keyboard_at",
|
||||
const device_t kbc_at_siemens_device = {
|
||||
.name = "PC/AT Keyboard Controller",
|
||||
.internal_name = "kbc_at",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_ISA | KBC_VEN_SIEMENS,
|
||||
.init = kbc_at_init,
|
||||
@@ -2698,9 +2706,9 @@ const device_t keyboard_at_siemens_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_at_ami_device = {
|
||||
.name = "PC/AT Keyboard (AMI)",
|
||||
.internal_name = "keyboard_at_ami",
|
||||
const device_t kbc_at_ami_device = {
|
||||
.name = "PC/AT Keyboard Controller (AMI)",
|
||||
.internal_name = "kbc_at_ami",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_ISA | KBC_VEN_AMI,
|
||||
.init = kbc_at_init,
|
||||
@@ -2712,9 +2720,9 @@ const device_t keyboard_at_ami_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_at_tg_ami_device = {
|
||||
.name = "PC/AT Keyboard (TriGem AMI)",
|
||||
.internal_name = "keyboard_at_tg_ami",
|
||||
const device_t kbc_at_tg_ami_device = {
|
||||
.name = "PC/AT Keyboard Controller (TriGem AMI)",
|
||||
.internal_name = "kbc_at_tg_ami",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_ISA | KBC_VEN_TRIGEM_AMI,
|
||||
.init = kbc_at_init,
|
||||
@@ -2726,9 +2734,9 @@ const device_t keyboard_at_tg_ami_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_at_toshiba_device = {
|
||||
.name = "PC/AT Keyboard (Toshiba)",
|
||||
.internal_name = "keyboard_at_toshiba",
|
||||
const device_t kbc_at_toshiba_device = {
|
||||
.name = "PC/AT Keyboard Controller (Toshiba)",
|
||||
.internal_name = "kbc_at_toshiba",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_ISA | KBC_VEN_TOSHIBA,
|
||||
.init = kbc_at_init,
|
||||
@@ -2740,9 +2748,9 @@ const device_t keyboard_at_toshiba_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_at_olivetti_device = {
|
||||
.name = "PC/AT Keyboard (Olivetti)",
|
||||
.internal_name = "keyboard_at_olivetti",
|
||||
const device_t kbc_at_olivetti_device = {
|
||||
.name = "PC/AT Keyboard Controller (Olivetti)",
|
||||
.internal_name = "kbc_at_olivetti",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_ISA | KBC_VEN_OLIVETTI,
|
||||
.init = kbc_at_init,
|
||||
@@ -2754,9 +2762,9 @@ const device_t keyboard_at_olivetti_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_at_ncr_device = {
|
||||
.name = "PC/AT Keyboard (NCR)",
|
||||
.internal_name = "keyboard_at_ncr",
|
||||
const device_t kbc_at_ncr_device = {
|
||||
.name = "PC/AT Keyboard Controller (NCR)",
|
||||
.internal_name = "kbc_at_ncr",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_ISA | KBC_VEN_NCR,
|
||||
.init = kbc_at_init,
|
||||
@@ -2768,9 +2776,9 @@ const device_t keyboard_at_ncr_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_at_compaq_device = {
|
||||
.name = "PC/AT Keyboard (Compaq)",
|
||||
.internal_name = "keyboard_at_compaq",
|
||||
const device_t kbc_at_compaq_device = {
|
||||
.name = "PC/AT Keyboard Controller (Compaq)",
|
||||
.internal_name = "kbc_at_compaq",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_ISA | KBC_VEN_COMPAQ,
|
||||
.init = kbc_at_init,
|
||||
@@ -2782,9 +2790,9 @@ const device_t keyboard_at_compaq_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_at_phoenix_device = {
|
||||
.name = "PC/AT Keyboard (Phoenix)",
|
||||
.internal_name = "keyboard_at_phoenix",
|
||||
const device_t kbc_at_phoenix_device = {
|
||||
.name = "PC/AT Keyboard Controller (Phoenix)",
|
||||
.internal_name = "kbc_at_phoenix",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_ISA | KBC_VEN_PHOENIX,
|
||||
.init = kbc_at_init,
|
||||
@@ -2796,9 +2804,9 @@ const device_t keyboard_at_phoenix_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_device = {
|
||||
.name = "PS/2 Keyboard",
|
||||
.internal_name = "keyboard_ps2",
|
||||
const device_t kbc_ps2_device = {
|
||||
.name = "PS/2 Keyboard Controller",
|
||||
.internal_name = "kbc_ps2",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_GENERIC,
|
||||
.init = kbc_at_init,
|
||||
@@ -2810,9 +2818,9 @@ const device_t keyboard_ps2_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_ps1_device = {
|
||||
.name = "PS/2 Keyboard (IBM PS/1)",
|
||||
.internal_name = "keyboard_ps2_ps1",
|
||||
const device_t kbc_ps2_ps1_device = {
|
||||
.name = "PS/2 Keyboard Controller (IBM PS/1)",
|
||||
.internal_name = "kbc_ps2_ps1",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_IBM_PS1,
|
||||
.init = kbc_at_init,
|
||||
@@ -2824,9 +2832,9 @@ const device_t keyboard_ps2_ps1_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_ps1_pci_device = {
|
||||
.name = "PS/2 Keyboard (IBM PS/1)",
|
||||
.internal_name = "keyboard_ps2_ps1_pci",
|
||||
const device_t kbc_ps2_ps1_pci_device = {
|
||||
.name = "PS/2 Keyboard Controller (IBM PS/1)",
|
||||
.internal_name = "kbc_ps2_ps1_pci",
|
||||
.flags = DEVICE_KBC | DEVICE_PCI,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_IBM_PS1,
|
||||
.init = kbc_at_init,
|
||||
@@ -2838,9 +2846,9 @@ const device_t keyboard_ps2_ps1_pci_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_xi8088_device = {
|
||||
.name = "PS/2 Keyboard (Xi8088)",
|
||||
.internal_name = "keyboard_ps2_xi8088",
|
||||
const device_t kbc_ps2_xi8088_device = {
|
||||
.name = "PS/2 Keyboard Controller (Xi8088)",
|
||||
.internal_name = "kbc_ps2_xi8088",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_GENERIC,
|
||||
.init = kbc_at_init,
|
||||
@@ -2852,9 +2860,9 @@ const device_t keyboard_ps2_xi8088_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_ami_device = {
|
||||
.name = "PS/2 Keyboard (AMI)",
|
||||
.internal_name = "keyboard_ps2_ami",
|
||||
const device_t kbc_ps2_ami_device = {
|
||||
.name = "PS/2 Keyboard Controller (AMI)",
|
||||
.internal_name = "kbc_ps2_ami",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_AMI,
|
||||
.init = kbc_at_init,
|
||||
@@ -2866,9 +2874,9 @@ const device_t keyboard_ps2_ami_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_compaq_device = {
|
||||
.name = "PS/2 Keyboard (Compaq)",
|
||||
.internal_name = "keyboard_at_compaq",
|
||||
const device_t kbc_ps2_compaq_device = {
|
||||
.name = "PS/2 Keyboard Controller (Compaq)",
|
||||
.internal_name = "kbc_at_compaq",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_COMPAQ,
|
||||
.init = kbc_at_init,
|
||||
@@ -2880,9 +2888,9 @@ const device_t keyboard_ps2_compaq_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_holtek_device = {
|
||||
.name = "PS/2 Keyboard (Holtek)",
|
||||
.internal_name = "keyboard_ps2_holtek",
|
||||
const device_t kbc_ps2_holtek_device = {
|
||||
.name = "PS/2 Keyboard Controller (Holtek)",
|
||||
.internal_name = "kbc_ps2_holtek",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_AMI | KBC_FLAG_IS_ASIC,
|
||||
.init = kbc_at_init,
|
||||
@@ -2894,9 +2902,9 @@ const device_t keyboard_ps2_holtek_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_phoenix_device = {
|
||||
.name = "PS/2 Keyboard (Phoenix)",
|
||||
.internal_name = "keyboard_ps2_phoenix",
|
||||
const device_t kbc_ps2_phoenix_device = {
|
||||
.name = "PS/2 Keyboard Controller (Phoenix)",
|
||||
.internal_name = "kbc_ps2_phoenix",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_PHOENIX,
|
||||
.init = kbc_at_init,
|
||||
@@ -2908,9 +2916,9 @@ const device_t keyboard_ps2_phoenix_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_tg_ami_device = {
|
||||
.name = "PS/2 Keyboard (TriGem AMI)",
|
||||
.internal_name = "keyboard_ps2_tg_ami",
|
||||
const device_t kbc_ps2_tg_ami_device = {
|
||||
.name = "PS/2 Keyboard Controller (TriGem AMI)",
|
||||
.internal_name = "kbc_ps2_tg_ami",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_TRIGEM_AMI,
|
||||
.init = kbc_at_init,
|
||||
@@ -2922,9 +2930,9 @@ const device_t keyboard_ps2_tg_ami_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_mca_1_device = {
|
||||
.name = "PS/2 Keyboard (IBM PS/2 MCA Type 1)",
|
||||
.internal_name = "keyboard_ps2_mca_1",
|
||||
const device_t kbc_ps2_mca_1_device = {
|
||||
.name = "PS/2 Keyboard Controller (IBM PS/2 MCA Type 1)",
|
||||
.internal_name = "kbc_ps2_mca_1",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_IBM,
|
||||
.init = kbc_at_init,
|
||||
@@ -2936,9 +2944,9 @@ const device_t keyboard_ps2_mca_1_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_mca_2_device = {
|
||||
.name = "PS/2 Keyboard (IBM PS/2 MCA Type 2)",
|
||||
.internal_name = "keyboard_ps2_mca_2",
|
||||
const device_t kbc_ps2_mca_2_device = {
|
||||
.name = "PS/2 Keyboard Controller (IBM PS/2 MCA Type 2)",
|
||||
.internal_name = "kbc_ps2_mca_2",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_PS2_2 | KBC_VEN_IBM,
|
||||
.init = kbc_at_init,
|
||||
@@ -2950,9 +2958,9 @@ const device_t keyboard_ps2_mca_2_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_quadtel_device = {
|
||||
.name = "PS/2 Keyboard (Quadtel/MegaPC)",
|
||||
.internal_name = "keyboard_ps2_quadtel",
|
||||
const device_t kbc_ps2_quadtel_device = {
|
||||
.name = "PS/2 Keyboard Controller (Quadtel/MegaPC)",
|
||||
.internal_name = "kbc_ps2_quadtel",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_QUADTEL,
|
||||
.init = kbc_at_init,
|
||||
@@ -2964,9 +2972,9 @@ const device_t keyboard_ps2_quadtel_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_pci_device = {
|
||||
.name = "PS/2 Keyboard",
|
||||
.internal_name = "keyboard_ps2_pci",
|
||||
const device_t kbc_ps2_pci_device = {
|
||||
.name = "PS/2 Keyboard Controller (PCI)",
|
||||
.internal_name = "kbc_ps2_pci",
|
||||
.flags = DEVICE_KBC | DEVICE_PCI,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_GENERIC,
|
||||
.init = kbc_at_init,
|
||||
@@ -2978,9 +2986,9 @@ const device_t keyboard_ps2_pci_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_ami_pci_device = {
|
||||
.name = "PS/2 Keyboard (AMI)",
|
||||
.internal_name = "keyboard_ps2_ami_pci",
|
||||
const device_t kbc_ps2_ami_pci_device = {
|
||||
.name = "PS/2 Keyboard Controller (PCI) (AMI)",
|
||||
.internal_name = "kbc_ps2_ami_pci",
|
||||
.flags = DEVICE_KBC | DEVICE_PCI,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_AMI,
|
||||
.init = kbc_at_init,
|
||||
@@ -2992,9 +3000,9 @@ const device_t keyboard_ps2_ami_pci_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_ali_pci_device = {
|
||||
.name = "PS/2 Keyboard (ALi M5123/M1543C)",
|
||||
.internal_name = "keyboard_ps2_ali_pci",
|
||||
const device_t kbc_ps2_ali_pci_device = {
|
||||
.name = "PS/2 Keyboard Controller (PCI) (ALi M5123/M1543C)",
|
||||
.internal_name = "kbc_ps2_ali_pci",
|
||||
.flags = DEVICE_KBC | DEVICE_PCI,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_ALI,
|
||||
.init = kbc_at_init,
|
||||
@@ -3006,9 +3014,9 @@ const device_t keyboard_ps2_ali_pci_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_intel_ami_pci_device = {
|
||||
.name = "PS/2 Keyboard (AMI)",
|
||||
.internal_name = "keyboard_ps2_intel_ami_pci",
|
||||
const device_t kbc_ps2_intel_ami_pci_device = {
|
||||
.name = "PS/2 Keyboard Controller (PCI) (AMI)",
|
||||
.internal_name = "kbc_ps2_intel_ami_pci",
|
||||
.flags = DEVICE_KBC | DEVICE_PCI,
|
||||
.local = KBC_TYPE_GREEN | KBC_VEN_AMI,
|
||||
.init = kbc_at_init,
|
||||
@@ -3020,9 +3028,9 @@ const device_t keyboard_ps2_intel_ami_pci_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_tg_ami_pci_device = {
|
||||
.name = "PS/2 Keyboard (TriGem AMI)",
|
||||
.internal_name = "keyboard_ps2_tg_ami_pci",
|
||||
const device_t kbc_ps2_tg_ami_pci_device = {
|
||||
.name = "PS/2 Keyboard Controller (PCI) (TriGem AMI)",
|
||||
.internal_name = "kbc_ps2_tg_ami_pci",
|
||||
.flags = DEVICE_KBC | DEVICE_PCI,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_TRIGEM_AMI,
|
||||
.init = kbc_at_init,
|
||||
@@ -3034,9 +3042,9 @@ const device_t keyboard_ps2_tg_ami_pci_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_acer_pci_device = {
|
||||
.name = "PS/2 Keyboard (Acer 90M002A)",
|
||||
.internal_name = "keyboard_ps2_acer_pci",
|
||||
const device_t kbc_ps2_acer_pci_device = {
|
||||
.name = "PS/2 Keyboard Controller (PCI) (Acer 90M002A)",
|
||||
.internal_name = "kbc_ps2_acer_pci",
|
||||
.flags = DEVICE_KBC | DEVICE_PCI,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_ACER,
|
||||
.init = kbc_at_init,
|
||||
@@ -3048,9 +3056,9 @@ const device_t keyboard_ps2_acer_pci_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_phoenix_pci_device = {
|
||||
.name = "PS/2 Keyboard (Phoenix)",
|
||||
.internal_name = "keyboard_ps2_phoenix_pci",
|
||||
const device_t kbc_ps2_phoenix_pci_device = {
|
||||
.name = "PS/2 Keyboard Controller (PCI) (Phoenix)",
|
||||
.internal_name = "kbc_ps2_phoenix_pci",
|
||||
.flags = DEVICE_KBC | DEVICE_PCI,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_PHOENIX,
|
||||
.init = kbc_at_init,
|
||||
|
||||
903
src/device/kbc_xt.c
Normal file
903
src/device/kbc_xt.c
Normal file
@@ -0,0 +1,903 @@
|
||||
/*
|
||||
* 86Box A hypervisor and IBM PC system emulator that specializes in
|
||||
* running old operating systems and software designed for IBM
|
||||
* PC systems and compatibles from 1981 through fairly recent
|
||||
* system designs based on the PCI bus.
|
||||
*
|
||||
* This file is part of the 86Box distribution.
|
||||
*
|
||||
* Implementation of the XT-style keyboard.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Fred N. van Kempen, <decwiz@yahoo.com>
|
||||
* EngiNerd, <webmaster.crrc@yahoo.it>
|
||||
*
|
||||
* Copyright 2008-2019 Sarah Walker.
|
||||
* Copyright 2016-2019 Miran Grca.
|
||||
* Copyright 2017-2019 Fred N. van kempen.
|
||||
* Copyright 2020 EngiNerd.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#define HAVE_STDARG_H
|
||||
#include <wchar.h>
|
||||
#include <86box/86box.h>
|
||||
#include <86box/device.h>
|
||||
#include "cpu.h"
|
||||
#include <86box/timer.h>
|
||||
#include <86box/fdd.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/m_xt_t1000.h>
|
||||
#include <86box/cassette.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/pic.h>
|
||||
#include <86box/pit.h>
|
||||
#include <86box/ppi.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/snd_speaker.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/keyboard.h>
|
||||
|
||||
#define STAT_PARITY 0x80
|
||||
#define STAT_RTIMEOUT 0x40
|
||||
#define STAT_TTIMEOUT 0x20
|
||||
#define STAT_LOCK 0x10
|
||||
#define STAT_CD 0x08
|
||||
#define STAT_SYSFLAG 0x04
|
||||
#define STAT_IFULL 0x02
|
||||
#define STAT_OFULL 0x01
|
||||
|
||||
/* Keyboard Types */
|
||||
enum {
|
||||
KBD_TYPE_PC81 = 0,
|
||||
KBD_TYPE_PC82,
|
||||
KBD_TYPE_XT82,
|
||||
KBD_TYPE_XT86,
|
||||
KBD_TYPE_COMPAQ,
|
||||
KBD_TYPE_TANDY,
|
||||
KBD_TYPE_TOSHIBA,
|
||||
KBD_TYPE_VTECH,
|
||||
KBD_TYPE_OLIVETTI,
|
||||
KBD_TYPE_ZENITH,
|
||||
KBD_TYPE_PRAVETZ,
|
||||
KBD_TYPE_HYUNDAI,
|
||||
KBD_TYPE_FE2010,
|
||||
KBD_TYPE_XTCLONE
|
||||
};
|
||||
|
||||
typedef struct xtkbd_t {
|
||||
int want_irq;
|
||||
int blocked;
|
||||
int tandy;
|
||||
|
||||
uint8_t pa;
|
||||
uint8_t pb;
|
||||
uint8_t pd;
|
||||
uint8_t cfg;
|
||||
uint8_t clock;
|
||||
uint8_t key_waiting;
|
||||
uint8_t type;
|
||||
uint8_t pravetz_flags;
|
||||
uint8_t cpu_speed;
|
||||
|
||||
pc_timer_t send_delay_timer;
|
||||
} xtkbd_t;
|
||||
|
||||
static uint8_t key_queue[16];
|
||||
static int key_queue_start = 0;
|
||||
static int key_queue_end = 0;
|
||||
static int is_tandy = 0;
|
||||
static int is_t1x00 = 0;
|
||||
static int is_amstrad = 0;
|
||||
|
||||
#ifdef ENABLE_KEYBOARD_XT_LOG
|
||||
int keyboard_xt_do_log = ENABLE_KEYBOARD_XT_LOG;
|
||||
|
||||
static void
|
||||
kbd_log(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (keyboard_xt_do_log) {
|
||||
va_start(ap, fmt);
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
#else
|
||||
# define kbd_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
static uint8_t
|
||||
get_fdd_switch_settings(void)
|
||||
{
|
||||
|
||||
uint8_t fdd_count = 0;
|
||||
|
||||
for (uint8_t i = 0; i < FDD_NUM; i++) {
|
||||
if (fdd_get_flags(i))
|
||||
fdd_count++;
|
||||
}
|
||||
|
||||
if (!fdd_count)
|
||||
return 0x00;
|
||||
else
|
||||
return ((fdd_count - 1) << 6) | 0x01;
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
get_videomode_switch_settings(void)
|
||||
{
|
||||
|
||||
if (video_is_mda())
|
||||
return 0x30;
|
||||
else if (video_is_cga())
|
||||
return 0x20; /* 0x10 would be 40x25 */
|
||||
else
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
static void
|
||||
kbd_poll(void *priv)
|
||||
{
|
||||
xtkbd_t *kbd = (xtkbd_t *) priv;
|
||||
|
||||
timer_advance_u64(&kbd->send_delay_timer, 1000 * TIMER_USEC);
|
||||
|
||||
if (!(kbd->pb & 0x40) && (kbd->type != KBD_TYPE_TANDY))
|
||||
return;
|
||||
|
||||
if (kbd->want_irq) {
|
||||
kbd->want_irq = 0;
|
||||
kbd->pa = kbd->key_waiting;
|
||||
kbd->blocked = 1;
|
||||
picint(2);
|
||||
#ifdef ENABLE_KEYBOARD_XT_LOG
|
||||
kbd_log("XTkbd: kbd_poll(): keyboard_xt : take IRQ\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((key_queue_start != key_queue_end) && !kbd->blocked) {
|
||||
kbd->key_waiting = key_queue[key_queue_start];
|
||||
kbd_log("XTkbd: reading %02X from the key queue at %i\n",
|
||||
kbd->key_waiting, key_queue_start);
|
||||
key_queue_start = (key_queue_start + 1) & 0x0f;
|
||||
kbd->want_irq = 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
kbd_adddata(uint16_t val)
|
||||
{
|
||||
/* Test for T1000 'Fn' key (Right Alt / Right Ctrl) */
|
||||
if (is_t1x00) {
|
||||
if (keyboard_recv(0x138) || keyboard_recv(0x11d)) { /* 'Fn' pressed */
|
||||
t1000_syskey(0x00, 0x04, 0x00); /* Set 'Fn' indicator */
|
||||
switch (val) {
|
||||
case 0x45: /* Num Lock => toggle numpad */
|
||||
t1000_syskey(0x00, 0x00, 0x10);
|
||||
break;
|
||||
case 0x47: /* Home => internal display */
|
||||
t1000_syskey(0x40, 0x00, 0x00);
|
||||
break;
|
||||
case 0x49: /* PgDn => turbo on */
|
||||
t1000_syskey(0x80, 0x00, 0x00);
|
||||
break;
|
||||
case 0x4D: /* Right => toggle LCD font */
|
||||
t1000_syskey(0x00, 0x00, 0x20);
|
||||
break;
|
||||
case 0x4F: /* End => external display */
|
||||
t1000_syskey(0x00, 0x40, 0x00);
|
||||
break;
|
||||
case 0x51: /* PgDn => turbo off */
|
||||
t1000_syskey(0x00, 0x80, 0x00);
|
||||
break;
|
||||
case 0x54: /* SysRQ => toggle window */
|
||||
t1000_syskey(0x00, 0x00, 0x08);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else
|
||||
t1000_syskey(0x04, 0x00, 0x00); /* Reset 'Fn' indicator */
|
||||
}
|
||||
|
||||
key_queue[key_queue_end] = val;
|
||||
kbd_log("XTkbd: %02X added to key queue at %i\n",
|
||||
val, key_queue_end);
|
||||
key_queue_end = (key_queue_end + 1) & 0x0f;
|
||||
}
|
||||
|
||||
void
|
||||
kbd_adddata_process(uint16_t val, void (*adddata)(uint16_t val))
|
||||
{
|
||||
uint8_t num_lock = 0;
|
||||
uint8_t shift_states = 0;
|
||||
|
||||
if (!adddata)
|
||||
return;
|
||||
|
||||
keyboard_get_states(NULL, &num_lock, NULL, NULL);
|
||||
shift_states = keyboard_get_shift() & STATE_LSHIFT;
|
||||
|
||||
if (is_amstrad)
|
||||
num_lock = !num_lock;
|
||||
|
||||
/* If NumLock is on, invert the left shift state so we can always check for
|
||||
the the same way flag being set (and with NumLock on that then means it
|
||||
is actually *NOT* set). */
|
||||
if (num_lock)
|
||||
shift_states ^= STATE_LSHIFT;
|
||||
|
||||
switch (val) {
|
||||
case FAKE_LSHIFT_ON:
|
||||
/* If NumLock is on, fake shifts are sent when shift is *NOT* presed,
|
||||
if NumLock is off, fake shifts are sent when shift is pressed. */
|
||||
if (shift_states) {
|
||||
/* Send fake shift. */
|
||||
adddata(num_lock ? 0x2a : 0xaa);
|
||||
}
|
||||
break;
|
||||
case FAKE_LSHIFT_OFF:
|
||||
if (shift_states) {
|
||||
/* Send fake shift. */
|
||||
adddata(num_lock ? 0xaa : 0x2a);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
adddata(val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
kbd_adddata_ex(uint16_t val)
|
||||
{
|
||||
kbd_adddata_process(val, kbd_adddata);
|
||||
}
|
||||
|
||||
static void
|
||||
kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
xtkbd_t *kbd = (xtkbd_t *) priv;
|
||||
uint8_t bit;
|
||||
uint8_t set;
|
||||
uint8_t new_clock;
|
||||
|
||||
switch (port) {
|
||||
case 0x61: /* Keyboard Control Register (aka Port B) */
|
||||
if (!(val & 0x80) || (kbd->type == KBD_TYPE_HYUNDAI)) {
|
||||
new_clock = !!(val & 0x40);
|
||||
if (!kbd->clock && new_clock) {
|
||||
key_queue_start = key_queue_end = 0;
|
||||
kbd->want_irq = 0;
|
||||
kbd->blocked = 0;
|
||||
kbd_adddata(0xaa);
|
||||
}
|
||||
}
|
||||
|
||||
kbd->pb = val;
|
||||
if (!(kbd->pb & 0x80) || (kbd->type == KBD_TYPE_HYUNDAI))
|
||||
kbd->clock = !!(kbd->pb & 0x40);
|
||||
ppi.pb = val;
|
||||
|
||||
timer_process();
|
||||
|
||||
if (((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) ||
|
||||
(kbd->type == KBD_TYPE_PRAVETZ)) && (cassette != NULL))
|
||||
pc_cas_set_motor(cassette, (kbd->pb & 0x08) == 0);
|
||||
|
||||
speaker_update();
|
||||
|
||||
speaker_gated = val & 1;
|
||||
speaker_enable = val & 2;
|
||||
|
||||
if (speaker_enable)
|
||||
was_speaker_enable = 1;
|
||||
pit_devs[0].set_gate(pit_devs[0].data, 2, val & 1);
|
||||
|
||||
if (val & 0x80) {
|
||||
kbd->pa = 0;
|
||||
kbd->blocked = 0;
|
||||
picintc(2);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_KEYBOARD_XT_LOG
|
||||
if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) || (kbd->type == KBD_TYPE_PRAVETZ))
|
||||
kbd_log("XTkbd: Cassette motor is %s\n", !(val & 0x08) ? "ON" : "OFF");
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 0x62: /* Switch Register (aka Port C) */
|
||||
#ifdef ENABLE_KEYBOARD_XT_LOG
|
||||
if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) || (kbd->type == KBD_TYPE_PRAVETZ))
|
||||
kbd_log("XTkbd: Cassette IN is %i\n", !!(val & 0x10));
|
||||
#endif
|
||||
if (kbd->type == KBD_TYPE_FE2010) {
|
||||
kbd_log("XTkbd: Switch register in is %02X\n", val);
|
||||
if (!(kbd->cfg & 0x08))
|
||||
kbd->pd = (kbd->pd & 0x30) | (val & 0xcf);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x63:
|
||||
if (kbd->type == KBD_TYPE_FE2010) {
|
||||
kbd_log("XTkbd: Configuration register in is %02X\n", val);
|
||||
if (!(kbd->cfg & 0x08))
|
||||
kbd->cfg = val;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xc0 ... 0xcf: /* Pravetz Flags */
|
||||
kbd_log("XTkbd: Port %02X out: %02X\n", port, val);
|
||||
if (kbd->type == KBD_TYPE_PRAVETZ) {
|
||||
bit = (port >> 1) & 0x07;
|
||||
set = (port & 0x01) << bit;
|
||||
kbd->pravetz_flags = (kbd->pravetz_flags & ~(1 << bit)) | set;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x1f0:
|
||||
kbd_log("XTkbd: Port %04X out: %02X\n", port, val);
|
||||
if (kbd->type == KBD_TYPE_VTECH) {
|
||||
kbd->cpu_speed = val;
|
||||
cpu_dynamic_switch(kbd->cpu_speed >> 7);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
kbd_read(uint16_t port, void *priv)
|
||||
{
|
||||
const xtkbd_t *kbd = (xtkbd_t *) priv;
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
switch (port) {
|
||||
case 0x60: /* Keyboard Data Register (aka Port A) */
|
||||
if ((kbd->pb & 0x80) && ((kbd->type == KBD_TYPE_PC81) ||
|
||||
(kbd->type == KBD_TYPE_PC82) || (kbd->type == KBD_TYPE_PRAVETZ) ||
|
||||
(kbd->type == KBD_TYPE_XT82) || (kbd->type == KBD_TYPE_XT86) ||
|
||||
(kbd->type == KBD_TYPE_XTCLONE) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
||||
(kbd->type == KBD_TYPE_ZENITH) || (kbd->type == KBD_TYPE_HYUNDAI) ||
|
||||
(kbd->type == KBD_TYPE_VTECH))) {
|
||||
if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) ||
|
||||
(kbd->type == KBD_TYPE_XTCLONE) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
||||
(kbd->type == KBD_TYPE_PRAVETZ) || (kbd->type == KBD_TYPE_HYUNDAI))
|
||||
ret = (kbd->pd & ~0x02) | (hasfpu ? 0x02 : 0x00);
|
||||
else if ((kbd->type == KBD_TYPE_XT82) || (kbd->type == KBD_TYPE_XT86) ||
|
||||
(kbd->type == KBD_TYPE_VTECH))
|
||||
/* According to Ruud on the PCem forum, this is supposed to
|
||||
return 0xFF on the XT. */
|
||||
ret = 0xff;
|
||||
else if (kbd->type == KBD_TYPE_ZENITH) {
|
||||
/* Zenith Data Systems Z-151
|
||||
* SW1 switch settings:
|
||||
* bits 6-7: floppy drive number
|
||||
* bits 4-5: video mode
|
||||
* bit 2-3: base memory size
|
||||
* bit 1: fpu enable
|
||||
* bit 0: fdc enable
|
||||
*/
|
||||
ret = get_fdd_switch_settings();
|
||||
|
||||
ret |= get_videomode_switch_settings();
|
||||
|
||||
/* Base memory size should always be 64k */
|
||||
ret |= 0x0c;
|
||||
|
||||
if (hasfpu)
|
||||
ret |= 0x02;
|
||||
}
|
||||
} else
|
||||
ret = kbd->pa;
|
||||
break;
|
||||
|
||||
case 0x61: /* Keyboard Control Register (aka Port B) */
|
||||
ret = kbd->pb;
|
||||
break;
|
||||
|
||||
case 0x62: /* Switch Register (aka Port C) */
|
||||
if (kbd->type == KBD_TYPE_FE2010) {
|
||||
if (kbd->pb & 0x04) /* PB2 */
|
||||
ret = (kbd->pd & 0x0d) | (hasfpu ? 0x02 : 0x00);
|
||||
else
|
||||
ret = kbd->pd >> 4;
|
||||
} else if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) ||
|
||||
(kbd->type == KBD_TYPE_PRAVETZ)) {
|
||||
if (kbd->pb & 0x04) /* PB2 */
|
||||
switch (mem_size + isa_mem_size) {
|
||||
case 64:
|
||||
case 48:
|
||||
case 32:
|
||||
case 16:
|
||||
ret = 0x00;
|
||||
break;
|
||||
default:
|
||||
ret = (((mem_size + isa_mem_size) - 64) / 32) & 0x0f;
|
||||
break;
|
||||
}
|
||||
else
|
||||
ret = (((mem_size + isa_mem_size) - 64) / 32) >> 4;
|
||||
} else if ((kbd->type == KBD_TYPE_OLIVETTI) ||
|
||||
(kbd->type == KBD_TYPE_ZENITH)) {
|
||||
/* Olivetti M19 or Zenith Data Systems Z-151 */
|
||||
if (kbd->pb & 0x04) /* PB2 */
|
||||
ret = kbd->pd & 0xbf;
|
||||
else
|
||||
ret = kbd->pd >> 4;
|
||||
} else {
|
||||
if (kbd->pb & 0x08) /* PB3 */
|
||||
ret = kbd->pd >> 4;
|
||||
else
|
||||
ret = (kbd->pd & 0x0d) | (hasfpu ? 0x02 : 0x00);
|
||||
}
|
||||
ret |= (ppispeakon ? 0x20 : 0);
|
||||
|
||||
/* This is needed to avoid error 131 (cassette error).
|
||||
This is serial read: bit 5 = clock, bit 4 = data, cassette header is 256 x 0xff. */
|
||||
if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) ||
|
||||
(kbd->type == KBD_TYPE_PRAVETZ)) {
|
||||
if (cassette == NULL)
|
||||
ret |= (ppispeakon ? 0x10 : 0);
|
||||
else
|
||||
ret |= (pc_cas_get_inp(cassette) ? 0x10 : 0);
|
||||
}
|
||||
|
||||
if (kbd->type == KBD_TYPE_TANDY)
|
||||
ret |= (tandy1k_eeprom_read() ? 0x10 : 0);
|
||||
break;
|
||||
|
||||
case 0x63: /* Keyboard Configuration Register (aka Port D) */
|
||||
if ((kbd->type == KBD_TYPE_XT82) || (kbd->type == KBD_TYPE_XT86) ||
|
||||
(kbd->type == KBD_TYPE_XTCLONE) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
||||
(kbd->type == KBD_TYPE_TOSHIBA) || (kbd->type == KBD_TYPE_HYUNDAI) ||
|
||||
(kbd->type == KBD_TYPE_VTECH))
|
||||
ret = kbd->pd;
|
||||
break;
|
||||
|
||||
case 0xc0: /* Pravetz Flags */
|
||||
if (kbd->type == KBD_TYPE_PRAVETZ)
|
||||
ret = kbd->pravetz_flags;
|
||||
kbd_log("XTkbd: Port %02X in : %02X\n", port, ret);
|
||||
break;
|
||||
|
||||
case 0x1f0:
|
||||
if (kbd->type == KBD_TYPE_VTECH)
|
||||
ret = kbd->cpu_speed;
|
||||
kbd_log("XTkbd: Port %04X in : %02X\n", port, ret);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
kbd_reset(void *priv)
|
||||
{
|
||||
xtkbd_t *kbd = (xtkbd_t *) priv;
|
||||
|
||||
kbd->want_irq = 0;
|
||||
kbd->blocked = 0;
|
||||
kbd->pa = 0x00;
|
||||
kbd->pb = 0x00;
|
||||
kbd->pravetz_flags = 0x00;
|
||||
|
||||
keyboard_scan = 1;
|
||||
|
||||
key_queue_start = 0;
|
||||
key_queue_end = 0;
|
||||
}
|
||||
|
||||
void
|
||||
keyboard_set_is_amstrad(int ams)
|
||||
{
|
||||
is_amstrad = ams;
|
||||
}
|
||||
|
||||
static void *
|
||||
kbd_init(const device_t *info)
|
||||
{
|
||||
xtkbd_t *kbd;
|
||||
|
||||
kbd = (xtkbd_t *) calloc(1, sizeof(xtkbd_t));
|
||||
|
||||
io_sethandler(0x0060, 4,
|
||||
kbd_read, NULL, NULL, kbd_write, NULL, NULL, kbd);
|
||||
keyboard_send = kbd_adddata_ex;
|
||||
kbd->type = info->local;
|
||||
if (kbd->type == KBD_TYPE_VTECH)
|
||||
kbd->cpu_speed = (!!cpu) << 2;
|
||||
kbd_reset(kbd);
|
||||
if (kbd->type == KBD_TYPE_PRAVETZ)
|
||||
io_sethandler(0x00c0, 16,
|
||||
kbd_read, NULL, NULL, kbd_write, NULL, NULL, kbd);
|
||||
if (kbd->type == KBD_TYPE_VTECH)
|
||||
io_sethandler(0x01f0, 1,
|
||||
kbd_read, NULL, NULL, kbd_write, NULL, NULL, kbd);
|
||||
|
||||
key_queue_start = key_queue_end = 0;
|
||||
|
||||
video_reset(gfxcard[0]);
|
||||
|
||||
if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) ||
|
||||
(kbd->type == KBD_TYPE_PRAVETZ) || (kbd->type == KBD_TYPE_XT82) ||
|
||||
(kbd->type <= KBD_TYPE_XT86) || (kbd->type == KBD_TYPE_XTCLONE) ||
|
||||
(kbd->type == KBD_TYPE_COMPAQ) || (kbd->type == KBD_TYPE_TOSHIBA) ||
|
||||
(kbd->type == KBD_TYPE_OLIVETTI) || (kbd->type == KBD_TYPE_HYUNDAI) ||
|
||||
(kbd->type == KBD_TYPE_VTECH) || (kbd->type == KBD_TYPE_FE2010)) {
|
||||
/* DIP switch readout: bit set = OFF, clear = ON. */
|
||||
if (kbd->type == KBD_TYPE_OLIVETTI)
|
||||
/* Olivetti M19
|
||||
* Jumpers J1, J2 - monitor type.
|
||||
* 01 - mono (high-res)
|
||||
* 10 - color (low-res, disables 640x400x2 mode)
|
||||
* 00 - autoswitching
|
||||
*/
|
||||
kbd->pd |= 0x00;
|
||||
else
|
||||
/* Switches 7, 8 - floppy drives. */
|
||||
kbd->pd = get_fdd_switch_settings();
|
||||
|
||||
/* Switches 5, 6 - video card type */
|
||||
kbd->pd |= get_videomode_switch_settings();
|
||||
|
||||
/* Switches 3, 4 - memory size. */
|
||||
if ((kbd->type == KBD_TYPE_XT86) || (kbd->type == KBD_TYPE_XTCLONE) ||
|
||||
(kbd->type == KBD_TYPE_HYUNDAI) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
||||
(kbd->type == KBD_TYPE_TOSHIBA) || (kbd->type == KBD_TYPE_FE2010)) {
|
||||
switch (mem_size) {
|
||||
case 256:
|
||||
kbd->pd |= 0x00;
|
||||
break;
|
||||
case 512:
|
||||
kbd->pd |= 0x04;
|
||||
break;
|
||||
case 576:
|
||||
kbd->pd |= 0x08;
|
||||
break;
|
||||
case 640:
|
||||
default:
|
||||
kbd->pd |= 0x0c;
|
||||
break;
|
||||
}
|
||||
} else if ((kbd->type == KBD_TYPE_XT82) || (kbd->type == KBD_TYPE_VTECH)) {
|
||||
switch (mem_size) {
|
||||
case 64: /* 1x64k */
|
||||
kbd->pd |= 0x00;
|
||||
break;
|
||||
case 128: /* 2x64k */
|
||||
kbd->pd |= 0x04;
|
||||
break;
|
||||
case 192: /* 3x64k */
|
||||
kbd->pd |= 0x08;
|
||||
break;
|
||||
case 256: /* 4x64k */
|
||||
default:
|
||||
kbd->pd |= 0x0c;
|
||||
break;
|
||||
}
|
||||
} else if (kbd->type == KBD_TYPE_PC82) {
|
||||
switch (mem_size) {
|
||||
#ifdef PC82_192K_3BANK
|
||||
case 192: /* 3x64k, not supported by stock BIOS due to bugs */
|
||||
kbd->pd |= 0x08;
|
||||
break;
|
||||
#else
|
||||
case 192: /* 2x64k + 2x32k */
|
||||
#endif
|
||||
case 64: /* 4x16k */
|
||||
case 96: /* 2x32k + 2x16k */
|
||||
case 128: /* 4x32k */
|
||||
case 160: /* 2x64k + 2x16k */
|
||||
case 224: /* 3x64k + 1x32k */
|
||||
case 256: /* 4x64k */
|
||||
default:
|
||||
kbd->pd |= 0x0c;
|
||||
break;
|
||||
}
|
||||
} else { /* really just the PC '81 */
|
||||
switch (mem_size) {
|
||||
case 16: /* 1x16k */
|
||||
kbd->pd |= 0x00;
|
||||
break;
|
||||
case 32: /* 2x16k */
|
||||
kbd->pd |= 0x04;
|
||||
break;
|
||||
case 48: /* 3x16k */
|
||||
kbd->pd |= 0x08;
|
||||
break;
|
||||
case 64: /* 4x16k */
|
||||
default:
|
||||
kbd->pd |= 0x0c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Switch 2 - 8087 FPU. */
|
||||
if (hasfpu)
|
||||
kbd->pd |= 0x02;
|
||||
} else if (kbd->type == KBD_TYPE_ZENITH) {
|
||||
/* Zenith Data Systems Z-151
|
||||
* SW2 switch settings:
|
||||
* bit 7: monitor frequency
|
||||
* bits 5-6: autoboot (00-11 resident monitor, 10 hdd, 01 fdd)
|
||||
* bits 0-4: installed memory
|
||||
*/
|
||||
kbd->pd = 0x20;
|
||||
switch (mem_size) {
|
||||
case 128:
|
||||
kbd->pd |= 0x02;
|
||||
break;
|
||||
case 192:
|
||||
kbd->pd |= 0x04;
|
||||
break;
|
||||
case 256:
|
||||
kbd->pd |= 0x06;
|
||||
break;
|
||||
case 320:
|
||||
kbd->pd |= 0x08;
|
||||
break;
|
||||
case 384:
|
||||
kbd->pd |= 0x0a;
|
||||
break;
|
||||
case 448:
|
||||
kbd->pd |= 0x0c;
|
||||
break;
|
||||
case 512:
|
||||
kbd->pd |= 0x0e;
|
||||
break;
|
||||
case 576:
|
||||
kbd->pd |= 0x10;
|
||||
break;
|
||||
case 640:
|
||||
default:
|
||||
kbd->pd |= 0x12;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
timer_add(&kbd->send_delay_timer, kbd_poll, kbd, 1);
|
||||
|
||||
is_tandy = (kbd->type == KBD_TYPE_TANDY);
|
||||
is_t1x00 = (kbd->type == KBD_TYPE_TOSHIBA);
|
||||
|
||||
if (keyboard_type == KEYBOARD_TYPE_INTERNAL)
|
||||
keyboard_set_table(scancode_xt);
|
||||
else
|
||||
keyboard_add_device();
|
||||
|
||||
is_amstrad = 0;
|
||||
|
||||
return kbd;
|
||||
}
|
||||
|
||||
static void
|
||||
kbd_close(void *priv)
|
||||
{
|
||||
xtkbd_t *kbd = (xtkbd_t *) priv;
|
||||
|
||||
/* Stop the timer. */
|
||||
timer_disable(&kbd->send_delay_timer);
|
||||
|
||||
/* Disable scanning. */
|
||||
keyboard_scan = 0;
|
||||
|
||||
keyboard_send = NULL;
|
||||
|
||||
io_removehandler(0x0060, 4,
|
||||
kbd_read, NULL, NULL, kbd_write, NULL, NULL, kbd);
|
||||
|
||||
free(kbd);
|
||||
}
|
||||
|
||||
const device_t kbc_pc_device = {
|
||||
.name = "IBM PC Keyboard Controller (1981)",
|
||||
.internal_name = "kbc_pc",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_PC81,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t kbc_pc82_device = {
|
||||
.name = "IBM PC Keyboard Controller (1982)",
|
||||
.internal_name = "kbc_pc82",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_PC82,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t kbc_pravetz_device = {
|
||||
.name = "Pravetz Keyboard Controller",
|
||||
.internal_name = "kbc_pravetz",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_PRAVETZ,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t kbc_xt_device = {
|
||||
.name = "XT (1982) Keyboard Controller",
|
||||
.internal_name = "kbc_xt",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_XT82,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t kbc_xt86_device = {
|
||||
.name = "XT (1986) Keyboard Controller",
|
||||
.internal_name = "kbc_xt86",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_XT86,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t kbc_xt_compaq_device = {
|
||||
.name = "Compaq Portable Keyboard Controller",
|
||||
.internal_name = "kbc_xt_compaq",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_COMPAQ,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t kbc_tandy_device = {
|
||||
.name = "Tandy 1000 Keyboard Controller",
|
||||
.internal_name = "kbc_tandy",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_TANDY,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t kbc_xt_t1x00_device = {
|
||||
.name = "Toshiba T1x00 Keyboard Controller",
|
||||
.internal_name = "kbc_xt_t1x00",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_TOSHIBA,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t kbc_xt_lxt3_device = {
|
||||
.name = "VTech Laser Turbo XT Keyboard Controller",
|
||||
.internal_name = "kbc_xt_lxt",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_VTECH,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t kbc_xt_olivetti_device = {
|
||||
.name = "Olivetti XT Keyboard Controller",
|
||||
.internal_name = "kbc_xt_olivetti",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_OLIVETTI,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t kbc_xt_zenith_device = {
|
||||
.name = "Zenith XT Keyboard Controller",
|
||||
.internal_name = "kbc_xt_zenith",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_ZENITH,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t kbc_xt_hyundai_device = {
|
||||
.name = "Hyundai XT Keyboard Controller",
|
||||
.internal_name = "kbc_xt_hyundai",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_HYUNDAI,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t kbc_xt_fe2010_device = {
|
||||
.name = "Faraday FE2010 XT Keyboard Controller",
|
||||
.internal_name = "kbc_xt_fe2010",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_FE2010,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t kbc_xtclone_device = {
|
||||
.name = "XT (Clone) Keyboard Controller",
|
||||
.internal_name = "kbc_xtclone",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_XTCLONE,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
@@ -27,6 +27,7 @@
|
||||
#define HAVE_STDARG_H
|
||||
#include <86box/86box.h>
|
||||
#include <86box/machine.h>
|
||||
#include <86box/device.h>
|
||||
#include <86box/keyboard.h>
|
||||
#include <86box/plat.h>
|
||||
|
||||
@@ -36,6 +37,38 @@ uint16_t scancode_map[768] = { 0 };
|
||||
|
||||
int keyboard_scan;
|
||||
|
||||
typedef struct keyboard_t {
|
||||
const device_t *device;
|
||||
} keyboard_t;
|
||||
|
||||
int keyboard_type = 0;
|
||||
|
||||
static const device_t keyboard_internal_device = {
|
||||
.name = "Internal",
|
||||
.internal_name = "internal",
|
||||
.flags = 0,
|
||||
.local = KEYBOARD_TYPE_INTERNAL,
|
||||
.init = NULL,
|
||||
.close = NULL,
|
||||
.reset = NULL,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
static keyboard_t keyboard_devices[] = {
|
||||
// clang-format off
|
||||
{ &keyboard_internal_device },
|
||||
{ &keyboard_pc_xt_device },
|
||||
{ &keyboard_at_device },
|
||||
{ &keyboard_ax_device },
|
||||
{ &keyboard_ps2_device },
|
||||
{ &keyboard_ps55_device },
|
||||
{ NULL }
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
#ifdef ENABLE_KBC_AT_LOG
|
||||
int kbc_at_do_log = ENABLE_KBC_AT_LOG;
|
||||
|
||||
@@ -516,3 +549,57 @@ convert_scan_code(uint16_t scan_code)
|
||||
|
||||
return scan_code;
|
||||
}
|
||||
|
||||
const char *
|
||||
keyboard_get_name(int keyboard)
|
||||
{
|
||||
return (keyboard_devices[keyboard].device->name);
|
||||
}
|
||||
|
||||
const char *
|
||||
keyboard_get_internal_name(int keyboard)
|
||||
{
|
||||
return device_get_internal_name(keyboard_devices[keyboard].device);
|
||||
}
|
||||
|
||||
int
|
||||
keyboard_get_from_internal_name(char *s)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
while (keyboard_devices[c].device != NULL) {
|
||||
if (!strcmp((char *) keyboard_devices[c].device->internal_name, s))
|
||||
return c;
|
||||
c++;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
keyboard_has_config(int keyboard)
|
||||
{
|
||||
if (keyboard_devices[keyboard].device == NULL)
|
||||
return 0;
|
||||
|
||||
return (keyboard_devices[keyboard].device->config ? 1 : 0);
|
||||
}
|
||||
|
||||
const device_t *
|
||||
keyboard_get_device(int keyboard)
|
||||
{
|
||||
return (keyboard_devices[keyboard].device);
|
||||
}
|
||||
|
||||
/* Return number of MOUSE types we know about. */
|
||||
int
|
||||
keyboard_get_ndev(void)
|
||||
{
|
||||
return ((sizeof(keyboard_devices) / sizeof(keyboard_t)) - 1);
|
||||
}
|
||||
|
||||
void
|
||||
keyboard_add_device(void)
|
||||
{
|
||||
device_add(keyboard_devices[keyboard_type].device);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -35,62 +35,8 @@
|
||||
#include <86box/machine.h>
|
||||
#include <86box/m_xt_t1000.h>
|
||||
#include <86box/cassette.h>
|
||||
#include <86box/io.h>
|
||||
#include <86box/pic.h>
|
||||
#include <86box/pit.h>
|
||||
#include <86box/ppi.h>
|
||||
#include <86box/mem.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/sound.h>
|
||||
#include <86box/snd_speaker.h>
|
||||
#include <86box/video.h>
|
||||
#include <86box/keyboard.h>
|
||||
|
||||
#define STAT_PARITY 0x80
|
||||
#define STAT_RTIMEOUT 0x40
|
||||
#define STAT_TTIMEOUT 0x20
|
||||
#define STAT_LOCK 0x10
|
||||
#define STAT_CD 0x08
|
||||
#define STAT_SYSFLAG 0x04
|
||||
#define STAT_IFULL 0x02
|
||||
#define STAT_OFULL 0x01
|
||||
|
||||
/* Keyboard Types */
|
||||
enum {
|
||||
KBD_TYPE_PC81 = 0,
|
||||
KBD_TYPE_PC82,
|
||||
KBD_TYPE_XT82,
|
||||
KBD_TYPE_XT86,
|
||||
KBD_TYPE_COMPAQ,
|
||||
KBD_TYPE_TANDY,
|
||||
KBD_TYPE_TOSHIBA,
|
||||
KBD_TYPE_VTECH,
|
||||
KBD_TYPE_OLIVETTI,
|
||||
KBD_TYPE_ZENITH,
|
||||
KBD_TYPE_PRAVETZ,
|
||||
KBD_TYPE_HYUNDAI,
|
||||
KBD_TYPE_FE2010,
|
||||
KBD_TYPE_XTCLONE
|
||||
};
|
||||
|
||||
typedef struct xtkbd_t {
|
||||
int want_irq;
|
||||
int blocked;
|
||||
int tandy;
|
||||
|
||||
uint8_t pa;
|
||||
uint8_t pb;
|
||||
uint8_t pd;
|
||||
uint8_t cfg;
|
||||
uint8_t clock;
|
||||
uint8_t key_waiting;
|
||||
uint8_t type;
|
||||
uint8_t pravetz_flags;
|
||||
uint8_t cpu_speed;
|
||||
|
||||
pc_timer_t send_delay_timer;
|
||||
} xtkbd_t;
|
||||
|
||||
/*XT keyboard has no escape scancodes, and no scancodes beyond 53*/
|
||||
const scancode scancode_xt[512] = {
|
||||
// clang-format off
|
||||
@@ -609,810 +555,66 @@ const scancode scancode_xt[512] = {
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
static uint8_t key_queue[16];
|
||||
static int key_queue_start = 0;
|
||||
static int key_queue_end = 0;
|
||||
static int is_tandy = 0;
|
||||
static int is_t1x00 = 0;
|
||||
static int is_amstrad = 0;
|
||||
|
||||
#ifdef ENABLE_KEYBOARD_XT_LOG
|
||||
int keyboard_xt_do_log = ENABLE_KEYBOARD_XT_LOG;
|
||||
|
||||
static void
|
||||
kbd_log(const char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (keyboard_xt_do_log) {
|
||||
va_start(ap, fmt);
|
||||
pclog_ex(fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
#else
|
||||
# define kbd_log(fmt, ...)
|
||||
#endif
|
||||
|
||||
static uint8_t
|
||||
get_fdd_switch_settings(void)
|
||||
{
|
||||
|
||||
uint8_t fdd_count = 0;
|
||||
|
||||
for (uint8_t i = 0; i < FDD_NUM; i++) {
|
||||
if (fdd_get_flags(i))
|
||||
fdd_count++;
|
||||
}
|
||||
|
||||
if (!fdd_count)
|
||||
return 0x00;
|
||||
else
|
||||
return ((fdd_count - 1) << 6) | 0x01;
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
get_videomode_switch_settings(void)
|
||||
{
|
||||
|
||||
if (video_is_mda())
|
||||
return 0x30;
|
||||
else if (video_is_cga())
|
||||
return 0x20; /* 0x10 would be 40x25 */
|
||||
else
|
||||
return 0x00;
|
||||
}
|
||||
|
||||
static void
|
||||
kbd_poll(void *priv)
|
||||
{
|
||||
xtkbd_t *kbd = (xtkbd_t *) priv;
|
||||
|
||||
timer_advance_u64(&kbd->send_delay_timer, 1000 * TIMER_USEC);
|
||||
|
||||
if (!(kbd->pb & 0x40) && (kbd->type != KBD_TYPE_TANDY))
|
||||
return;
|
||||
|
||||
if (kbd->want_irq) {
|
||||
kbd->want_irq = 0;
|
||||
kbd->pa = kbd->key_waiting;
|
||||
kbd->blocked = 1;
|
||||
picint(2);
|
||||
#ifdef ENABLE_KEYBOARD_XT_LOG
|
||||
kbd_log("XTkbd: kbd_poll(): keyboard_xt : take IRQ\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((key_queue_start != key_queue_end) && !kbd->blocked) {
|
||||
kbd->key_waiting = key_queue[key_queue_start];
|
||||
kbd_log("XTkbd: reading %02X from the key queue at %i\n",
|
||||
kbd->key_waiting, key_queue_start);
|
||||
key_queue_start = (key_queue_start + 1) & 0x0f;
|
||||
kbd->want_irq = 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
kbd_adddata(uint16_t val)
|
||||
{
|
||||
/* Test for T1000 'Fn' key (Right Alt / Right Ctrl) */
|
||||
if (is_t1x00) {
|
||||
if (keyboard_recv(0x138) || keyboard_recv(0x11d)) { /* 'Fn' pressed */
|
||||
t1000_syskey(0x00, 0x04, 0x00); /* Set 'Fn' indicator */
|
||||
switch (val) {
|
||||
case 0x45: /* Num Lock => toggle numpad */
|
||||
t1000_syskey(0x00, 0x00, 0x10);
|
||||
break;
|
||||
case 0x47: /* Home => internal display */
|
||||
t1000_syskey(0x40, 0x00, 0x00);
|
||||
break;
|
||||
case 0x49: /* PgDn => turbo on */
|
||||
t1000_syskey(0x80, 0x00, 0x00);
|
||||
break;
|
||||
case 0x4D: /* Right => toggle LCD font */
|
||||
t1000_syskey(0x00, 0x00, 0x20);
|
||||
break;
|
||||
case 0x4F: /* End => external display */
|
||||
t1000_syskey(0x00, 0x40, 0x00);
|
||||
break;
|
||||
case 0x51: /* PgDn => turbo off */
|
||||
t1000_syskey(0x00, 0x80, 0x00);
|
||||
break;
|
||||
case 0x54: /* SysRQ => toggle window */
|
||||
t1000_syskey(0x00, 0x00, 0x08);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else
|
||||
t1000_syskey(0x04, 0x00, 0x00); /* Reset 'Fn' indicator */
|
||||
}
|
||||
|
||||
key_queue[key_queue_end] = val;
|
||||
kbd_log("XTkbd: %02X added to key queue at %i\n",
|
||||
val, key_queue_end);
|
||||
key_queue_end = (key_queue_end + 1) & 0x0f;
|
||||
}
|
||||
|
||||
void
|
||||
kbd_adddata_process(uint16_t val, void (*adddata)(uint16_t val))
|
||||
{
|
||||
uint8_t num_lock = 0;
|
||||
uint8_t shift_states = 0;
|
||||
|
||||
if (!adddata)
|
||||
return;
|
||||
|
||||
keyboard_get_states(NULL, &num_lock, NULL, NULL);
|
||||
shift_states = keyboard_get_shift() & STATE_LSHIFT;
|
||||
|
||||
if (is_amstrad)
|
||||
num_lock = !num_lock;
|
||||
|
||||
/* If NumLock is on, invert the left shift state so we can always check for
|
||||
the the same way flag being set (and with NumLock on that then means it
|
||||
is actually *NOT* set). */
|
||||
if (num_lock)
|
||||
shift_states ^= STATE_LSHIFT;
|
||||
|
||||
switch (val) {
|
||||
case FAKE_LSHIFT_ON:
|
||||
/* If NumLock is on, fake shifts are sent when shift is *NOT* presed,
|
||||
if NumLock is off, fake shifts are sent when shift is pressed. */
|
||||
if (shift_states) {
|
||||
/* Send fake shift. */
|
||||
adddata(num_lock ? 0x2a : 0xaa);
|
||||
}
|
||||
break;
|
||||
case FAKE_LSHIFT_OFF:
|
||||
if (shift_states) {
|
||||
/* Send fake shift. */
|
||||
adddata(num_lock ? 0xaa : 0x2a);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
adddata(val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
kbd_adddata_ex(uint16_t val)
|
||||
{
|
||||
kbd_adddata_process(val, kbd_adddata);
|
||||
}
|
||||
|
||||
static void
|
||||
kbd_write(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
xtkbd_t *kbd = (xtkbd_t *) priv;
|
||||
uint8_t bit;
|
||||
uint8_t set;
|
||||
uint8_t new_clock;
|
||||
|
||||
switch (port) {
|
||||
case 0x61: /* Keyboard Control Register (aka Port B) */
|
||||
if (!(val & 0x80) || (kbd->type == KBD_TYPE_HYUNDAI)) {
|
||||
new_clock = !!(val & 0x40);
|
||||
if (!kbd->clock && new_clock) {
|
||||
key_queue_start = key_queue_end = 0;
|
||||
kbd->want_irq = 0;
|
||||
kbd->blocked = 0;
|
||||
kbd_adddata(0xaa);
|
||||
}
|
||||
}
|
||||
|
||||
kbd->pb = val;
|
||||
if (!(kbd->pb & 0x80) || (kbd->type == KBD_TYPE_HYUNDAI))
|
||||
kbd->clock = !!(kbd->pb & 0x40);
|
||||
ppi.pb = val;
|
||||
|
||||
timer_process();
|
||||
|
||||
if (((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) ||
|
||||
(kbd->type == KBD_TYPE_PRAVETZ)) && (cassette != NULL))
|
||||
pc_cas_set_motor(cassette, (kbd->pb & 0x08) == 0);
|
||||
|
||||
speaker_update();
|
||||
|
||||
speaker_gated = val & 1;
|
||||
speaker_enable = val & 2;
|
||||
|
||||
if (speaker_enable)
|
||||
was_speaker_enable = 1;
|
||||
pit_devs[0].set_gate(pit_devs[0].data, 2, val & 1);
|
||||
|
||||
if (val & 0x80) {
|
||||
kbd->pa = 0;
|
||||
kbd->blocked = 0;
|
||||
picintc(2);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_KEYBOARD_XT_LOG
|
||||
if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) || (kbd->type == KBD_TYPE_PRAVETZ))
|
||||
kbd_log("XTkbd: Cassette motor is %s\n", !(val & 0x08) ? "ON" : "OFF");
|
||||
#endif
|
||||
break;
|
||||
|
||||
case 0x62: /* Switch Register (aka Port C) */
|
||||
#ifdef ENABLE_KEYBOARD_XT_LOG
|
||||
if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) || (kbd->type == KBD_TYPE_PRAVETZ))
|
||||
kbd_log("XTkbd: Cassette IN is %i\n", !!(val & 0x10));
|
||||
#endif
|
||||
if (kbd->type == KBD_TYPE_FE2010) {
|
||||
kbd_log("XTkbd: Switch register in is %02X\n", val);
|
||||
if (!(kbd->cfg & 0x08))
|
||||
kbd->pd = (kbd->pd & 0x30) | (val & 0xcf);
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x63:
|
||||
if (kbd->type == KBD_TYPE_FE2010) {
|
||||
kbd_log("XTkbd: Configuration register in is %02X\n", val);
|
||||
if (!(kbd->cfg & 0x08))
|
||||
kbd->cfg = val;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0xc0 ... 0xcf: /* Pravetz Flags */
|
||||
kbd_log("XTkbd: Port %02X out: %02X\n", port, val);
|
||||
if (kbd->type == KBD_TYPE_PRAVETZ) {
|
||||
bit = (port >> 1) & 0x07;
|
||||
set = (port & 0x01) << bit;
|
||||
kbd->pravetz_flags = (kbd->pravetz_flags & ~(1 << bit)) | set;
|
||||
}
|
||||
break;
|
||||
|
||||
case 0x1f0:
|
||||
kbd_log("XTkbd: Port %04X out: %02X\n", port, val);
|
||||
if (kbd->type == KBD_TYPE_VTECH) {
|
||||
kbd->cpu_speed = val;
|
||||
cpu_dynamic_switch(kbd->cpu_speed >> 7);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
kbd_read(uint16_t port, void *priv)
|
||||
{
|
||||
const xtkbd_t *kbd = (xtkbd_t *) priv;
|
||||
uint8_t ret = 0xff;
|
||||
|
||||
switch (port) {
|
||||
case 0x60: /* Keyboard Data Register (aka Port A) */
|
||||
if ((kbd->pb & 0x80) && ((kbd->type == KBD_TYPE_PC81) ||
|
||||
(kbd->type == KBD_TYPE_PC82) || (kbd->type == KBD_TYPE_PRAVETZ) ||
|
||||
(kbd->type == KBD_TYPE_XT82) || (kbd->type == KBD_TYPE_XT86) ||
|
||||
(kbd->type == KBD_TYPE_XTCLONE) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
||||
(kbd->type == KBD_TYPE_ZENITH) || (kbd->type == KBD_TYPE_HYUNDAI) ||
|
||||
(kbd->type == KBD_TYPE_VTECH))) {
|
||||
if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) ||
|
||||
(kbd->type == KBD_TYPE_XTCLONE) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
||||
(kbd->type == KBD_TYPE_PRAVETZ) || (kbd->type == KBD_TYPE_HYUNDAI))
|
||||
ret = (kbd->pd & ~0x02) | (hasfpu ? 0x02 : 0x00);
|
||||
else if ((kbd->type == KBD_TYPE_XT82) || (kbd->type == KBD_TYPE_XT86) ||
|
||||
(kbd->type == KBD_TYPE_VTECH))
|
||||
/* According to Ruud on the PCem forum, this is supposed to
|
||||
return 0xFF on the XT. */
|
||||
ret = 0xff;
|
||||
else if (kbd->type == KBD_TYPE_ZENITH) {
|
||||
/* Zenith Data Systems Z-151
|
||||
* SW1 switch settings:
|
||||
* bits 6-7: floppy drive number
|
||||
* bits 4-5: video mode
|
||||
* bit 2-3: base memory size
|
||||
* bit 1: fpu enable
|
||||
* bit 0: fdc enable
|
||||
*/
|
||||
ret = get_fdd_switch_settings();
|
||||
|
||||
ret |= get_videomode_switch_settings();
|
||||
|
||||
/* Base memory size should always be 64k */
|
||||
ret |= 0x0c;
|
||||
|
||||
if (hasfpu)
|
||||
ret |= 0x02;
|
||||
}
|
||||
} else
|
||||
ret = kbd->pa;
|
||||
break;
|
||||
|
||||
case 0x61: /* Keyboard Control Register (aka Port B) */
|
||||
ret = kbd->pb;
|
||||
break;
|
||||
|
||||
case 0x62: /* Switch Register (aka Port C) */
|
||||
if (kbd->type == KBD_TYPE_FE2010) {
|
||||
if (kbd->pb & 0x04) /* PB2 */
|
||||
ret = (kbd->pd & 0x0d) | (hasfpu ? 0x02 : 0x00);
|
||||
else
|
||||
ret = kbd->pd >> 4;
|
||||
} else if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) ||
|
||||
(kbd->type == KBD_TYPE_PRAVETZ)) {
|
||||
if (kbd->pb & 0x04) /* PB2 */
|
||||
switch (mem_size + isa_mem_size) {
|
||||
case 64:
|
||||
case 48:
|
||||
case 32:
|
||||
case 16:
|
||||
ret = 0x00;
|
||||
break;
|
||||
default:
|
||||
ret = (((mem_size + isa_mem_size) - 64) / 32) & 0x0f;
|
||||
break;
|
||||
}
|
||||
else
|
||||
ret = (((mem_size + isa_mem_size) - 64) / 32) >> 4;
|
||||
} else if ((kbd->type == KBD_TYPE_OLIVETTI) ||
|
||||
(kbd->type == KBD_TYPE_ZENITH)) {
|
||||
/* Olivetti M19 or Zenith Data Systems Z-151 */
|
||||
if (kbd->pb & 0x04) /* PB2 */
|
||||
ret = kbd->pd & 0xbf;
|
||||
else
|
||||
ret = kbd->pd >> 4;
|
||||
} else {
|
||||
if (kbd->pb & 0x08) /* PB3 */
|
||||
ret = kbd->pd >> 4;
|
||||
else
|
||||
ret = (kbd->pd & 0x0d) | (hasfpu ? 0x02 : 0x00);
|
||||
}
|
||||
ret |= (ppispeakon ? 0x20 : 0);
|
||||
|
||||
/* This is needed to avoid error 131 (cassette error).
|
||||
This is serial read: bit 5 = clock, bit 4 = data, cassette header is 256 x 0xff. */
|
||||
if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) ||
|
||||
(kbd->type == KBD_TYPE_PRAVETZ)) {
|
||||
if (cassette == NULL)
|
||||
ret |= (ppispeakon ? 0x10 : 0);
|
||||
else
|
||||
ret |= (pc_cas_get_inp(cassette) ? 0x10 : 0);
|
||||
}
|
||||
|
||||
if (kbd->type == KBD_TYPE_TANDY)
|
||||
ret |= (tandy1k_eeprom_read() ? 0x10 : 0);
|
||||
break;
|
||||
|
||||
case 0x63: /* Keyboard Configuration Register (aka Port D) */
|
||||
if ((kbd->type == KBD_TYPE_XT82) || (kbd->type == KBD_TYPE_XT86) ||
|
||||
(kbd->type == KBD_TYPE_XTCLONE) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
||||
(kbd->type == KBD_TYPE_TOSHIBA) || (kbd->type == KBD_TYPE_HYUNDAI) ||
|
||||
(kbd->type == KBD_TYPE_VTECH))
|
||||
ret = kbd->pd;
|
||||
break;
|
||||
|
||||
case 0xc0: /* Pravetz Flags */
|
||||
if (kbd->type == KBD_TYPE_PRAVETZ)
|
||||
ret = kbd->pravetz_flags;
|
||||
kbd_log("XTkbd: Port %02X in : %02X\n", port, ret);
|
||||
break;
|
||||
|
||||
case 0x1f0:
|
||||
if (kbd->type == KBD_TYPE_VTECH)
|
||||
ret = kbd->cpu_speed;
|
||||
kbd_log("XTkbd: Port %04X in : %02X\n", port, ret);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
kbd_reset(void *priv)
|
||||
{
|
||||
xtkbd_t *kbd = (xtkbd_t *) priv;
|
||||
|
||||
kbd->want_irq = 0;
|
||||
kbd->blocked = 0;
|
||||
kbd->pa = 0x00;
|
||||
kbd->pb = 0x00;
|
||||
kbd->pravetz_flags = 0x00;
|
||||
|
||||
keyboard_scan = 1;
|
||||
|
||||
key_queue_start = 0;
|
||||
key_queue_end = 0;
|
||||
}
|
||||
|
||||
void
|
||||
keyboard_set_is_amstrad(int ams)
|
||||
{
|
||||
is_amstrad = ams;
|
||||
}
|
||||
typedef struct {
|
||||
int type;
|
||||
} kbd_t;
|
||||
|
||||
static void *
|
||||
kbd_init(const device_t *info)
|
||||
{
|
||||
xtkbd_t *kbd;
|
||||
kbd_t *dev = (kbd_t *) calloc(1, sizeof(kbd_t));
|
||||
|
||||
kbd = (xtkbd_t *) calloc(1, sizeof(xtkbd_t));
|
||||
dev->type = info->local;
|
||||
|
||||
io_sethandler(0x0060, 4,
|
||||
kbd_read, NULL, NULL, kbd_write, NULL, NULL, kbd);
|
||||
keyboard_send = kbd_adddata_ex;
|
||||
kbd->type = info->local;
|
||||
if (kbd->type == KBD_TYPE_VTECH)
|
||||
kbd->cpu_speed = (!!cpu) << 2;
|
||||
kbd_reset(kbd);
|
||||
if (kbd->type == KBD_TYPE_PRAVETZ)
|
||||
io_sethandler(0x00c0, 16,
|
||||
kbd_read, NULL, NULL, kbd_write, NULL, NULL, kbd);
|
||||
if (kbd->type == KBD_TYPE_VTECH)
|
||||
io_sethandler(0x01f0, 1,
|
||||
kbd_read, NULL, NULL, kbd_write, NULL, NULL, kbd);
|
||||
if (dev->type == KBD_83_KEY)
|
||||
keyboard_set_table(scancode_xt);
|
||||
else
|
||||
keyboard_set_table(scancode_set1);
|
||||
|
||||
key_queue_start = key_queue_end = 0;
|
||||
|
||||
video_reset(gfxcard[0]);
|
||||
|
||||
if ((kbd->type == KBD_TYPE_PC81) || (kbd->type == KBD_TYPE_PC82) ||
|
||||
(kbd->type == KBD_TYPE_PRAVETZ) || (kbd->type == KBD_TYPE_XT82) ||
|
||||
(kbd->type <= KBD_TYPE_XT86) || (kbd->type == KBD_TYPE_XTCLONE) ||
|
||||
(kbd->type == KBD_TYPE_COMPAQ) || (kbd->type == KBD_TYPE_TOSHIBA) ||
|
||||
(kbd->type == KBD_TYPE_OLIVETTI) || (kbd->type == KBD_TYPE_HYUNDAI) ||
|
||||
(kbd->type == KBD_TYPE_VTECH) || (kbd->type == KBD_TYPE_FE2010)) {
|
||||
/* DIP switch readout: bit set = OFF, clear = ON. */
|
||||
if (kbd->type == KBD_TYPE_OLIVETTI)
|
||||
/* Olivetti M19
|
||||
* Jumpers J1, J2 - monitor type.
|
||||
* 01 - mono (high-res)
|
||||
* 10 - color (low-res, disables 640x400x2 mode)
|
||||
* 00 - autoswitching
|
||||
*/
|
||||
kbd->pd |= 0x00;
|
||||
else
|
||||
/* Switches 7, 8 - floppy drives. */
|
||||
kbd->pd = get_fdd_switch_settings();
|
||||
|
||||
/* Switches 5, 6 - video card type */
|
||||
kbd->pd |= get_videomode_switch_settings();
|
||||
|
||||
/* Switches 3, 4 - memory size. */
|
||||
if ((kbd->type == KBD_TYPE_XT86) || (kbd->type == KBD_TYPE_XTCLONE) ||
|
||||
(kbd->type == KBD_TYPE_HYUNDAI) || (kbd->type == KBD_TYPE_COMPAQ) ||
|
||||
(kbd->type == KBD_TYPE_TOSHIBA) || (kbd->type == KBD_TYPE_FE2010)) {
|
||||
switch (mem_size) {
|
||||
case 256:
|
||||
kbd->pd |= 0x00;
|
||||
break;
|
||||
case 512:
|
||||
kbd->pd |= 0x04;
|
||||
break;
|
||||
case 576:
|
||||
kbd->pd |= 0x08;
|
||||
break;
|
||||
case 640:
|
||||
default:
|
||||
kbd->pd |= 0x0c;
|
||||
break;
|
||||
}
|
||||
} else if ((kbd->type == KBD_TYPE_XT82) || (kbd->type == KBD_TYPE_VTECH)) {
|
||||
switch (mem_size) {
|
||||
case 64: /* 1x64k */
|
||||
kbd->pd |= 0x00;
|
||||
break;
|
||||
case 128: /* 2x64k */
|
||||
kbd->pd |= 0x04;
|
||||
break;
|
||||
case 192: /* 3x64k */
|
||||
kbd->pd |= 0x08;
|
||||
break;
|
||||
case 256: /* 4x64k */
|
||||
default:
|
||||
kbd->pd |= 0x0c;
|
||||
break;
|
||||
}
|
||||
} else if (kbd->type == KBD_TYPE_PC82) {
|
||||
switch (mem_size) {
|
||||
#ifdef PC82_192K_3BANK
|
||||
case 192: /* 3x64k, not supported by stock BIOS due to bugs */
|
||||
kbd->pd |= 0x08;
|
||||
break;
|
||||
#else
|
||||
case 192: /* 2x64k + 2x32k */
|
||||
#endif
|
||||
case 64: /* 4x16k */
|
||||
case 96: /* 2x32k + 2x16k */
|
||||
case 128: /* 4x32k */
|
||||
case 160: /* 2x64k + 2x16k */
|
||||
case 224: /* 3x64k + 1x32k */
|
||||
case 256: /* 4x64k */
|
||||
default:
|
||||
kbd->pd |= 0x0c;
|
||||
break;
|
||||
}
|
||||
} else { /* really just the PC '81 */
|
||||
switch (mem_size) {
|
||||
case 16: /* 1x16k */
|
||||
kbd->pd |= 0x00;
|
||||
break;
|
||||
case 32: /* 2x16k */
|
||||
kbd->pd |= 0x04;
|
||||
break;
|
||||
case 48: /* 3x16k */
|
||||
kbd->pd |= 0x08;
|
||||
break;
|
||||
case 64: /* 4x16k */
|
||||
default:
|
||||
kbd->pd |= 0x0c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Switch 2 - 8087 FPU. */
|
||||
if (hasfpu)
|
||||
kbd->pd |= 0x02;
|
||||
} else if (kbd->type == KBD_TYPE_ZENITH) {
|
||||
/* Zenith Data Systems Z-151
|
||||
* SW2 switch settings:
|
||||
* bit 7: monitor frequency
|
||||
* bits 5-6: autoboot (00-11 resident monitor, 10 hdd, 01 fdd)
|
||||
* bits 0-4: installed memory
|
||||
*/
|
||||
kbd->pd = 0x20;
|
||||
switch (mem_size) {
|
||||
case 128:
|
||||
kbd->pd |= 0x02;
|
||||
break;
|
||||
case 192:
|
||||
kbd->pd |= 0x04;
|
||||
break;
|
||||
case 256:
|
||||
kbd->pd |= 0x06;
|
||||
break;
|
||||
case 320:
|
||||
kbd->pd |= 0x08;
|
||||
break;
|
||||
case 384:
|
||||
kbd->pd |= 0x0a;
|
||||
break;
|
||||
case 448:
|
||||
kbd->pd |= 0x0c;
|
||||
break;
|
||||
case 512:
|
||||
kbd->pd |= 0x0e;
|
||||
break;
|
||||
case 576:
|
||||
kbd->pd |= 0x10;
|
||||
break;
|
||||
case 640:
|
||||
default:
|
||||
kbd->pd |= 0x12;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
timer_add(&kbd->send_delay_timer, kbd_poll, kbd, 1);
|
||||
|
||||
keyboard_set_table(scancode_xt);
|
||||
|
||||
is_tandy = (kbd->type == KBD_TYPE_TANDY);
|
||||
is_t1x00 = (kbd->type == KBD_TYPE_TOSHIBA);
|
||||
|
||||
is_amstrad = 0;
|
||||
|
||||
return kbd;
|
||||
return dev;
|
||||
}
|
||||
|
||||
static void
|
||||
kbd_close(void *priv)
|
||||
{
|
||||
xtkbd_t *kbd = (xtkbd_t *) priv;
|
||||
|
||||
/* Stop the timer. */
|
||||
timer_disable(&kbd->send_delay_timer);
|
||||
|
||||
/* Disable scanning. */
|
||||
keyboard_scan = 0;
|
||||
|
||||
keyboard_send = NULL;
|
||||
|
||||
io_removehandler(0x0060, 4,
|
||||
kbd_read, NULL, NULL, kbd_write, NULL, NULL, kbd);
|
||||
kbd_t *kbd = (kbd_t *) priv;
|
||||
|
||||
free(kbd);
|
||||
}
|
||||
|
||||
const device_t keyboard_pc_device = {
|
||||
.name = "IBM PC Keyboard (1981)",
|
||||
.internal_name = "keyboard_pc",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_PC81,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
static const device_config_t keyboard_pc_xt_config[] = {
|
||||
// clang-format off
|
||||
{
|
||||
.name = "keys",
|
||||
.description = "Keys",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = NULL,
|
||||
.default_int = KBD_83_KEY,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "83", .value = KBD_83_KEY },
|
||||
{ .description = "101 (ANSI)", .value = KBD_101_KEY },
|
||||
{ .description = "102 (ISO)", .value = KBD_102_KEY }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "", .description = "", .type = CONFIG_END
|
||||
}
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
const device_t keyboard_pc82_device = {
|
||||
.name = "IBM PC Keyboard (1982)",
|
||||
.internal_name = "keyboard_pc82",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_PC82,
|
||||
const device_t keyboard_pc_xt_device = {
|
||||
.name = "PC/XT Keyboard",
|
||||
.internal_name = "keyboard_pc_xt",
|
||||
.flags = DEVICE_XT_KBC,
|
||||
.local = 0,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.reset = NULL,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_pravetz_device = {
|
||||
.name = "Pravetz Keyboard",
|
||||
.internal_name = "keyboard_pravetz",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_PRAVETZ,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_xt_device = {
|
||||
.name = "XT (1982) Keyboard",
|
||||
.internal_name = "keyboard_xt",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_XT82,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_xt86_device = {
|
||||
.name = "XT (1986) Keyboard",
|
||||
.internal_name = "keyboard_xt86",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_XT86,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_xt_compaq_device = {
|
||||
.name = "Compaq Portable Keyboard",
|
||||
.internal_name = "keyboard_xt_compaq",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_COMPAQ,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_tandy_device = {
|
||||
.name = "Tandy 1000 Keyboard",
|
||||
.internal_name = "keyboard_tandy",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_TANDY,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_xt_t1x00_device = {
|
||||
.name = "Toshiba T1x00 Keyboard",
|
||||
.internal_name = "keyboard_xt_t1x00",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_TOSHIBA,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_xt_lxt3_device = {
|
||||
.name = "VTech Laser Turbo XT Keyboard",
|
||||
.internal_name = "keyboard_xt_lxt",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_VTECH,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_xt_olivetti_device = {
|
||||
.name = "Olivetti XT Keyboard",
|
||||
.internal_name = "keyboard_xt_olivetti",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_OLIVETTI,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_xt_zenith_device = {
|
||||
.name = "Zenith XT Keyboard",
|
||||
.internal_name = "keyboard_xt_zenith",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_ZENITH,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_xt_hyundai_device = {
|
||||
.name = "Hyundai XT Keyboard",
|
||||
.internal_name = "keyboard_xt_hyundai",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_HYUNDAI,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_xt_fe2010_device = {
|
||||
.name = "Faraday FE2010 XT Keyboard",
|
||||
.internal_name = "keyboard_xt_fe2010",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_FE2010,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_xtclone_device = {
|
||||
.name = "XT (Clone) Keyboard",
|
||||
.internal_name = "keyboard_xtclone",
|
||||
.flags = 0,
|
||||
.local = KBD_TYPE_XTCLONE,
|
||||
.init = kbd_init,
|
||||
.close = kbd_close,
|
||||
.reset = kbd_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
.config = keyboard_pc_xt_config
|
||||
};
|
||||
|
||||
@@ -480,7 +480,7 @@ ltsermouse_update_report_period(mouse_t *dev)
|
||||
}
|
||||
|
||||
static void
|
||||
ltsermouse_switch_baud_rate(mouse_t *dev, int next_state)
|
||||
ltsermouse_switch_baud_rate(mouse_t *dev, int next_state, int prompt_off)
|
||||
{
|
||||
double word_lens[FORMATS_NUM] = {
|
||||
[FORMAT_BP1_ABS] = 7.0 + 1.0, /* 7 data bits + even parity */
|
||||
@@ -517,7 +517,7 @@ ltsermouse_switch_baud_rate(mouse_t *dev, int next_state)
|
||||
ltsermouse_set_report_period(dev, dev->rps);
|
||||
|
||||
if (!dev->continuous && (next_state != STATE_BAUD_RATE)) {
|
||||
if (dev->prompt)
|
||||
if (dev->prompt && prompt_off)
|
||||
ltsermouse_set_prompt_mode(dev, 0);
|
||||
|
||||
sermouse_transmit_report(dev, 0);
|
||||
@@ -569,7 +569,7 @@ ltsermouse_process_command(mouse_t *dev)
|
||||
dev->buf[0] = 0x06;
|
||||
sermouse_transmit(dev, 1, 0, 0);
|
||||
|
||||
ltsermouse_switch_baud_rate(dev, STATE_BAUD_RATE);
|
||||
ltsermouse_switch_baud_rate(dev, STATE_BAUD_RATE, 0);
|
||||
break;
|
||||
|
||||
case 0x4a: /* Report Rate Selection commands */
|
||||
@@ -614,7 +614,7 @@ ltsermouse_process_command(mouse_t *dev)
|
||||
case 0x58: /* Microsoft Compatible Format (3+1 byte 3-button, from the FreeBSD source code) */
|
||||
if ((dev->rev >= 0x02) && ((dev->command != 0x58) || (dev->rev > 0x04))) {
|
||||
dev->format = dev->command & 0x1f;
|
||||
ltsermouse_switch_baud_rate(dev, sermouse_next_state(dev));
|
||||
ltsermouse_switch_baud_rate(dev, sermouse_next_state(dev), 0);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -706,7 +706,7 @@ ltsermouse_process_data(mouse_t *dev)
|
||||
dev->bps = 9600;
|
||||
break;
|
||||
}
|
||||
ltsermouse_switch_baud_rate(dev, (dev->prompt || dev->continuous) ? STATE_IDLE : STATE_TRANSMIT_REPORT);
|
||||
ltsermouse_switch_baud_rate(dev, (dev->prompt || dev->continuous) ? STATE_IDLE : STATE_TRANSMIT_REPORT, 0);
|
||||
break;
|
||||
default:
|
||||
dev->state = STATE_IDLE;
|
||||
@@ -744,7 +744,7 @@ sermouse_reset(mouse_t *dev, int callback)
|
||||
break;
|
||||
}
|
||||
|
||||
ltsermouse_switch_baud_rate(dev, callback ? STATE_TRANSMIT : STATE_IDLE);
|
||||
ltsermouse_switch_baud_rate(dev, callback ? STATE_TRANSMIT : STATE_IDLE, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -37,7 +37,7 @@ add_library(hdd OBJECT
|
||||
hdc_ide_w83769f.c
|
||||
)
|
||||
|
||||
add_library(zip OBJECT zip.c)
|
||||
add_library(rdisk OBJECT rdisk.c)
|
||||
|
||||
add_library(mo OBJECT mo.c)
|
||||
|
||||
|
||||
@@ -79,6 +79,8 @@ static const struct {
|
||||
{ &xtide_at_2ch_device },
|
||||
{ &xtide_at_ps2_device },
|
||||
{ &xtide_at_ps2_2ch_device },
|
||||
{ &ide_ter_device },
|
||||
{ &ide_qua_device },
|
||||
{ &st506_at_wd1003_device },
|
||||
{ &esdi_at_wd1007vse1_device },
|
||||
/* MCA */
|
||||
@@ -89,6 +91,9 @@ static const struct {
|
||||
{ &ide_vlb_device },
|
||||
{ &ide_vlb_2ch_device },
|
||||
/* PCI */
|
||||
{ &ide_cmd646_ter_qua_device },
|
||||
{ &ide_cmd648_ter_qua_device },
|
||||
{ &ide_cmd649_ter_qua_device },
|
||||
{ &ide_pci_device },
|
||||
{ &ide_pci_2ch_device },
|
||||
{ NULL }
|
||||
@@ -109,18 +114,14 @@ hdc_init(void)
|
||||
void
|
||||
hdc_reset(void)
|
||||
{
|
||||
hdc_log("HDC: reset(current=%d, internal=%d)\n",
|
||||
hdc_current[0], (machines[machine].flags & MACHINE_HDC) ? 1 : 0);
|
||||
for (int i = 0; i < HDC_MAX; i++) {
|
||||
hdc_log("HDC %i: reset(current=%d, internal=%d)\n", i,
|
||||
hdc_current[i], hdc_current[i] == HDC_INTERNAL);
|
||||
|
||||
/* If we have a valid controller, add its device. */
|
||||
if (hdc_current[0] > HDC_INTERNAL)
|
||||
device_add(controllers[hdc_current[0]].device);
|
||||
|
||||
/* Now, add the tertiary and/or quaternary IDE controllers. */
|
||||
if (ide_ter_enabled)
|
||||
device_add(&ide_ter_device);
|
||||
if (ide_qua_enabled)
|
||||
device_add(&ide_qua_device);
|
||||
/* If we have a valid controller, add its device. */
|
||||
if (hdc_current[i] > HDC_INTERNAL)
|
||||
device_add_inst(controllers[hdc_current[i]].device, i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
@@ -130,7 +131,7 @@ hdc_get_internal_name(int hdc)
|
||||
}
|
||||
|
||||
int
|
||||
hdc_get_from_internal_name(char *s)
|
||||
hdc_get_from_internal_name(const char *s)
|
||||
{
|
||||
int c = 0;
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/hdd.h>
|
||||
#include <86box/zip.h>
|
||||
#include <86box/rdisk.h>
|
||||
#include <86box/version.h>
|
||||
|
||||
/* Bits of 'atastat' */
|
||||
@@ -234,9 +234,7 @@ static uint8_t ide_qua_pnp_rom[] = {
|
||||
0x79, 0x00
|
||||
};
|
||||
|
||||
ide_t *ide_drives[IDE_NUM];
|
||||
int ide_ter_enabled = 0;
|
||||
int ide_qua_enabled = 0;
|
||||
ide_t *ide_drives[IDE_NUM] = { 0 };
|
||||
|
||||
static void ide_atapi_callback(ide_t *ide);
|
||||
static void ide_callback(void *priv);
|
||||
@@ -2828,20 +2826,23 @@ ide_board_close(int board)
|
||||
|
||||
ide_log("ide_board_close(%i)\n", board);
|
||||
|
||||
if ((ide_boards[board] == NULL) || !ide_boards[board]->inited)
|
||||
if (ide_boards[board] == NULL)
|
||||
return;
|
||||
|
||||
ide_log("IDE: Closing board %i...\n", board);
|
||||
|
||||
timer_stop(&ide_boards[board]->timer);
|
||||
if (ide_boards[board]->inited) {
|
||||
timer_stop(&ide_boards[board]->timer);
|
||||
|
||||
ide_clear_bus_master(board);
|
||||
ide_clear_bus_master(board);
|
||||
}
|
||||
|
||||
/* Close hard disk image files (if previously open) */
|
||||
for (uint8_t d = 0; d < 2; d++) {
|
||||
c = (board << 1) + d;
|
||||
|
||||
ide_boards[board]->ide[d] = NULL;
|
||||
if (ide_boards[board]->inited)
|
||||
ide_boards[board]->ide[d] = NULL;
|
||||
|
||||
dev = ide_drives[c];
|
||||
|
||||
@@ -3265,6 +3266,16 @@ ide_close(UNUSED(void *priv))
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ide_hard_reset(void)
|
||||
{
|
||||
for (int i = 0; i < IDE_BUS_MAX; i++)
|
||||
ide_boards[i] = NULL;
|
||||
|
||||
for (int i = 0; i < IDE_NUM; i++)
|
||||
ide_drives[i] = NULL;
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
mcide_mca_read(const int port, void *priv)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/hdc_ide_sff8038i.h>
|
||||
#include <86box/zip.h>
|
||||
#include <86box/rdisk.h>
|
||||
#include <86box/mo.h>
|
||||
|
||||
typedef struct cmd640_t {
|
||||
@@ -417,10 +417,10 @@ cmd640_reset(void *priv)
|
||||
(cdrom[i].ide_channel <= max_channel) && cdrom[i].priv)
|
||||
scsi_cdrom_reset((scsi_common_t *) cdrom[i].priv);
|
||||
}
|
||||
for (i = 0; i < ZIP_NUM; i++) {
|
||||
if ((zip_drives[i].bus_type == ZIP_BUS_ATAPI) && (zip_drives[i].ide_channel >= min_channel) &&
|
||||
(zip_drives[i].ide_channel <= max_channel) && zip_drives[i].priv)
|
||||
zip_reset((scsi_common_t *) zip_drives[i].priv);
|
||||
for (i = 0; i < RDISK_NUM; i++) {
|
||||
if ((rdisk_drives[i].bus_type == RDISK_BUS_ATAPI) && (rdisk_drives[i].ide_channel >= min_channel) &&
|
||||
(rdisk_drives[i].ide_channel <= max_channel) && rdisk_drives[i].priv)
|
||||
rdisk_reset((scsi_common_t *) rdisk_drives[i].priv);
|
||||
}
|
||||
for (i = 0; i < MO_NUM; i++) {
|
||||
if ((mo_drives[i].bus_type == MO_BUS_ATAPI) && (mo_drives[i].ide_channel >= min_channel) &&
|
||||
@@ -667,7 +667,7 @@ const device_t ide_cmd640_pci_legacy_only_device = {
|
||||
};
|
||||
|
||||
const device_t ide_cmd640_pci_single_channel_device = {
|
||||
.name = "CMD PCI-0640B PCI",
|
||||
.name = "CMD PCI-0640B PCI (Single Channel)",
|
||||
.internal_name = "ide_cmd640_pci_single_channel",
|
||||
.flags = DEVICE_PCI,
|
||||
.local = 0x2000a,
|
||||
@@ -681,7 +681,7 @@ const device_t ide_cmd640_pci_single_channel_device = {
|
||||
};
|
||||
|
||||
const device_t ide_cmd640_pci_single_channel_sec_device = {
|
||||
.name = "CMD PCI-0640B PCI",
|
||||
.name = "CMD PCI-0640B PCI (Single Channel, Secondary)",
|
||||
.internal_name = "ide_cmd640_pci_single_channel_sec",
|
||||
.flags = DEVICE_PCI,
|
||||
.local = 0x4000a,
|
||||
|
||||
@@ -34,8 +34,26 @@
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/hdc_ide_sff8038i.h>
|
||||
#include <86box/zip.h>
|
||||
#include <86box/rdisk.h>
|
||||
#include <86box/rom.h>
|
||||
#include <86box/hdd.h>
|
||||
#include <86box/scsi_disk.h>
|
||||
#include <86box/mo.h>
|
||||
#include "cpu.h"
|
||||
#include "x86.h"
|
||||
|
||||
#define CMD_TYPE_646 0x0000000
|
||||
#define CMD_TYPE_648 0x0100000
|
||||
#define CMD_TYPE_649 0x0200000
|
||||
|
||||
#define CMD648_JP7 0x0400000 /* Reload subsystem ID on reset. */
|
||||
#define CMD648_RAID 0x0800000
|
||||
|
||||
#define CMD64X_ONBOARD 0x1000000
|
||||
|
||||
#define CMD648_BIOS_FILE "roms/hdd/ide/648_1910.bin"
|
||||
#define CMD649_REV_1914_BIOS_FILE "roms/hdd/ide/649_1914.bin"
|
||||
#define CMD649_REV_2301_BIOS_FILE "roms/hdd/ide/649_2301.bin"
|
||||
|
||||
typedef struct cmd646_t {
|
||||
uint8_t vlb_idx;
|
||||
@@ -46,11 +64,17 @@ typedef struct cmd646_t {
|
||||
uint8_t regs[256];
|
||||
|
||||
uint32_t local;
|
||||
uint32_t rom_addr;
|
||||
uint32_t rom_addr_size;
|
||||
uint32_t rom_addr_mask;
|
||||
|
||||
int irq_pin;
|
||||
int has_bios;
|
||||
|
||||
int irq_mode[2];
|
||||
|
||||
rom_t bios_rom;
|
||||
|
||||
sff8038i_t *bm[2];
|
||||
} cmd646_t;
|
||||
|
||||
@@ -80,7 +104,8 @@ cmd646_set_irq_0(uint8_t status, void *priv)
|
||||
if (!(dev->regs[0x50] & 0x04) || (status & 0x04))
|
||||
dev->regs[0x50] = (dev->regs[0x50] & ~0x04) | status;
|
||||
|
||||
sff_bus_master_set_irq(status, dev->bm[0]);
|
||||
if (!(dev->local & CMD_TYPE_648) || !(dev->regs[0x71] & 0x10))
|
||||
sff_bus_master_set_irq(status, dev->bm[0]);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -91,7 +116,8 @@ cmd646_set_irq_1(uint8_t status, void *priv)
|
||||
if (!(dev->regs[0x57] & 0x10) || (status & 0x04))
|
||||
dev->regs[0x57] = (dev->regs[0x57] & ~0x10) | (status << 2);
|
||||
|
||||
sff_bus_master_set_irq(status, dev->bm[1]);
|
||||
if (!(dev->local & CMD_TYPE_648) || !(dev->regs[0x71] & 0x20))
|
||||
sff_bus_master_set_irq(status, dev->bm[1]);
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -116,13 +142,24 @@ cmd646_ide_handlers(cmd646_t *dev)
|
||||
uint16_t main;
|
||||
uint16_t side;
|
||||
int irq_mode[2] = { IRQ_MODE_LEGACY, IRQ_MODE_LEGACY };
|
||||
int first = 0;
|
||||
int reg09 = dev->regs[0x09];
|
||||
int reg50 = dev->regs[0x50];
|
||||
|
||||
if ((dev->local & CMD_TYPE_648) && (dev->regs[0x0a] == 0x04) && (dev->regs[0x0b] == 0x01)) {
|
||||
reg09 = 0xff;
|
||||
reg50 |= 0x40;
|
||||
}
|
||||
|
||||
if (dev->local & 0x80000)
|
||||
first += 2;
|
||||
|
||||
sff_set_slot(dev->bm[0], dev->pci_slot);
|
||||
sff_set_slot(dev->bm[1], dev->pci_slot);
|
||||
|
||||
ide_pri_disable();
|
||||
ide_handlers(first, 0);
|
||||
|
||||
if ((dev->regs[0x09] & 0x01) && (dev->regs[0x50] & 0x40)) {
|
||||
if ((reg09 & 0x01) && (reg50 & 0x40)) {
|
||||
main = (dev->regs[0x11] << 8) | (dev->regs[0x10] & 0xf8);
|
||||
side = ((dev->regs[0x15] << 8) | (dev->regs[0x14] & 0xfc)) + 2;
|
||||
} else {
|
||||
@@ -130,23 +167,28 @@ cmd646_ide_handlers(cmd646_t *dev)
|
||||
side = 0x3f6;
|
||||
}
|
||||
|
||||
ide_set_base(0, main);
|
||||
ide_set_side(0, side);
|
||||
ide_set_base(first, main);
|
||||
ide_set_side(first, side);
|
||||
|
||||
if (dev->regs[0x09] & 0x01)
|
||||
if (reg09 & 0x01)
|
||||
irq_mode[0] = IRQ_MODE_PCI_IRQ_PIN;
|
||||
|
||||
sff_set_irq_mode(dev->bm[0], irq_mode[0]);
|
||||
cmd646_log("IDE %i: %04X, %04X, %i\n", first, main, side, irq_mode[0]);
|
||||
|
||||
if (dev->regs[0x04] & 0x01)
|
||||
ide_pri_enable();
|
||||
int pri_enabled = (dev->regs[0x04] & 0x01);
|
||||
if (dev->local & CMD_TYPE_648)
|
||||
pri_enabled = pri_enabled && (dev->regs[0x51] & 0x04);
|
||||
|
||||
if (pri_enabled)
|
||||
ide_handlers(first, 1);
|
||||
|
||||
if (dev->single_channel)
|
||||
return;
|
||||
|
||||
ide_sec_disable();
|
||||
ide_handlers(first + 1, 0);
|
||||
|
||||
if ((dev->regs[0x09] & 0x04) && (dev->regs[0x50] & 0x40)) {
|
||||
if ((reg09 & 0x04) && (reg50 & 0x40)) {
|
||||
main = (dev->regs[0x19] << 8) | (dev->regs[0x18] & 0xf8);
|
||||
side = ((dev->regs[0x1d] << 8) | (dev->regs[0x1c] & 0xfc)) + 2;
|
||||
} else {
|
||||
@@ -154,16 +196,17 @@ cmd646_ide_handlers(cmd646_t *dev)
|
||||
side = 0x376;
|
||||
}
|
||||
|
||||
ide_set_base(1, main);
|
||||
ide_set_side(1, side);
|
||||
ide_set_base(first + 1, main);
|
||||
ide_set_side(first + 1, side);
|
||||
|
||||
if (dev->regs[0x09] & 0x04)
|
||||
irq_mode[1] = 1;
|
||||
if (reg09 & 0x04)
|
||||
irq_mode[1] = IRQ_MODE_PCI_IRQ_PIN;
|
||||
|
||||
sff_set_irq_mode(dev->bm[1], irq_mode[1]);
|
||||
cmd646_log("IDE %i: %04X, %04X, %i\n", first + 1, main, side, irq_mode[1]);
|
||||
|
||||
if ((dev->regs[0x04] & 0x01) && (dev->regs[0x51] & 0x08))
|
||||
ide_sec_enable();
|
||||
ide_handlers(first + 1, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -175,74 +218,176 @@ cmd646_ide_bm_handlers(cmd646_t *dev)
|
||||
sff_bus_master_handler(dev->bm[1], (dev->regs[0x04] & 1), base + 8);
|
||||
}
|
||||
|
||||
uint8_t
|
||||
cmd646_bm_write(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
cmd646_t *dev = (cmd646_t *) priv;
|
||||
uint8_t ret = val;
|
||||
|
||||
switch (port & 0x000f) {
|
||||
case 0x0001:
|
||||
dev->regs[(port & 0x000f) | 0x70] = val & 0xf0;
|
||||
if (val & 0x04)
|
||||
dev->regs[0x50] &= ~0x04;
|
||||
if (val & 0x08)
|
||||
dev->regs[0x57] &= ~0x10;
|
||||
ret &= 0x03;
|
||||
break;
|
||||
case 0x0003:
|
||||
dev->regs[0x73] = val;
|
||||
break;
|
||||
case 0x0009:
|
||||
dev->regs[(port & 0x000f) | 0x70] = (dev->regs[(port & 0x000f) | 0x70] & 0x0f) | (val & 0xf0);
|
||||
ret &= 0x03;
|
||||
break;
|
||||
case 0x000b:
|
||||
dev->regs[0x7b] = val;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
cmd646_bm_read(uint16_t port, uint8_t val, void *priv)
|
||||
{
|
||||
cmd646_t *dev = (cmd646_t *) priv;
|
||||
uint8_t ret = val;
|
||||
|
||||
switch (port & 0x000f) {
|
||||
case 0x0001:
|
||||
ret = (dev->regs[(port & 0x000f) | 0x70] & 0xf3) | (dev->regs[0x50] & 0x04) | ((dev->regs[0x57] & 0x10) >> 1);
|
||||
break;
|
||||
case 0x0002: case 0x000a:
|
||||
ret |= 0x08;
|
||||
break;
|
||||
case 0x0003:
|
||||
ret = dev->regs[0x73];
|
||||
break;
|
||||
case 0x0009:
|
||||
ret = dev->regs[(port & 0x000f) | 0x70];
|
||||
break;
|
||||
case 0x000b:
|
||||
ret = dev->regs[0x7b];
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
cmd646_bios_handler(cmd646_t *dev)
|
||||
{
|
||||
if ((dev->local & CMD_TYPE_648) && dev->has_bios) {
|
||||
uint32_t *addr = (uint32_t *) &(dev->regs[0x30]);
|
||||
|
||||
*addr &= (~dev->rom_addr_mask) | 0x00000001;
|
||||
dev->rom_addr = *addr & 0xfffffff0;
|
||||
|
||||
cmd646_log("ROM address now: %08X\n", dev->rom_addr);
|
||||
|
||||
if ((dev->regs[0x04] & 0x02) && (*addr & 0x00000001))
|
||||
mem_mapping_set_addr(&dev->bios_rom.mapping, dev->rom_addr, dev->rom_addr_size);
|
||||
else
|
||||
mem_mapping_disable(&dev->bios_rom.mapping);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
cmd646_pci_write(int func, int addr, uint8_t val, void *priv)
|
||||
{
|
||||
cmd646_t *dev = (cmd646_t *) priv;
|
||||
cmd646_t *dev = (cmd646_t *) priv;
|
||||
int reg50 = dev->regs[0x50];
|
||||
|
||||
if ((dev->local & CMD_TYPE_648) && (dev->regs[0x0a] == 0x04) && (dev->regs[0x0b] == 0x01))
|
||||
reg50 |= 0x40;
|
||||
|
||||
cmd646_log("[%04X:%08X] (%08X) cmd646_pci_write(%i, %02X, %02X)\n", CS, cpu_state.pc, ESI, func, addr, val);
|
||||
|
||||
if (func == 0x00)
|
||||
switch (addr) {
|
||||
case 0x04:
|
||||
dev->regs[addr] = (val & 0x45);
|
||||
if (dev->has_bios)
|
||||
dev->regs[addr] = (val & 0x47);
|
||||
else
|
||||
dev->regs[addr] = (val & 0x45);
|
||||
|
||||
cmd646_ide_handlers(dev);
|
||||
cmd646_ide_bm_handlers(dev);
|
||||
|
||||
cmd646_bios_handler(dev);
|
||||
break;
|
||||
case 0x05:
|
||||
if (dev->local & CMD_TYPE_648)
|
||||
dev->regs[addr] = (dev->regs[addr] & 0x7e) | (val & 0x01);
|
||||
break;
|
||||
case 0x07:
|
||||
dev->regs[addr] &= ~(val & 0xb1);
|
||||
if (dev->local & CMD_TYPE_648)
|
||||
dev->regs[addr] = ((dev->regs[addr] & ~(val & 0xb9)) & 0xbf) | (val & 0x40);
|
||||
else
|
||||
dev->regs[addr] &= ~(val & 0xb1);
|
||||
break;
|
||||
case 0x09:
|
||||
if ((dev->regs[addr] & 0x0a) == 0x0a) {
|
||||
dev->regs[addr] = (dev->regs[addr] & 0x0a) | (val & 0x05);
|
||||
dev->irq_mode[0] = !!(val & 0x01);
|
||||
dev->irq_mode[1] = !!(val & 0x04);
|
||||
if (!(dev->local & CMD_TYPE_648) ||
|
||||
((dev->regs[0x0a] == 0x01) && (dev->regs[0x0b] == 0x01))) {
|
||||
if ((dev->regs[addr] & 0x0a) == 0x0a) {
|
||||
dev->regs[addr] = (dev->regs[addr] & 0x8a) | (val & 0x05);
|
||||
dev->irq_mode[0] = !!(val & 0x01);
|
||||
dev->irq_mode[1] = !!(val & 0x04);
|
||||
cmd646_ide_handlers(dev);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0x0a: case 0x0b:
|
||||
if ((dev->local & CMD_TYPE_648) && (dev->regs[0x4f] & 0x04)) {
|
||||
dev->regs[addr] = val;
|
||||
cmd646_ide_handlers(dev);
|
||||
}
|
||||
break;
|
||||
case 0x10:
|
||||
if (dev->regs[0x50] & 0x40) {
|
||||
if (reg50 & 0x40) {
|
||||
dev->regs[0x10] = (val & 0xf8) | 1;
|
||||
cmd646_ide_handlers(dev);
|
||||
}
|
||||
break;
|
||||
case 0x11:
|
||||
if (dev->regs[0x50] & 0x40) {
|
||||
if (reg50 & 0x40) {
|
||||
dev->regs[0x11] = val;
|
||||
cmd646_ide_handlers(dev);
|
||||
}
|
||||
break;
|
||||
case 0x14:
|
||||
if (dev->regs[0x50] & 0x40) {
|
||||
if (reg50 & 0x40) {
|
||||
dev->regs[0x14] = (val & 0xfc) | 1;
|
||||
cmd646_ide_handlers(dev);
|
||||
}
|
||||
break;
|
||||
case 0x15:
|
||||
if (dev->regs[0x50] & 0x40) {
|
||||
if (reg50 & 0x40) {
|
||||
dev->regs[0x15] = val;
|
||||
cmd646_ide_handlers(dev);
|
||||
}
|
||||
break;
|
||||
case 0x18:
|
||||
if (dev->regs[0x50] & 0x40) {
|
||||
if (reg50 & 0x40) {
|
||||
dev->regs[0x18] = (val & 0xf8) | 1;
|
||||
cmd646_ide_handlers(dev);
|
||||
}
|
||||
break;
|
||||
case 0x19:
|
||||
if (dev->regs[0x50] & 0x40) {
|
||||
if (reg50 & 0x40) {
|
||||
dev->regs[0x19] = val;
|
||||
cmd646_ide_handlers(dev);
|
||||
}
|
||||
break;
|
||||
case 0x1c:
|
||||
if (dev->regs[0x50] & 0x40) {
|
||||
if (reg50 & 0x40) {
|
||||
dev->regs[0x1c] = (val & 0xfc) | 1;
|
||||
cmd646_ide_handlers(dev);
|
||||
}
|
||||
break;
|
||||
case 0x1d:
|
||||
if (dev->regs[0x50] & 0x40) {
|
||||
if (reg50 & 0x40) {
|
||||
dev->regs[0x1d] = val;
|
||||
cmd646_ide_handlers(dev);
|
||||
}
|
||||
@@ -255,18 +400,42 @@ cmd646_pci_write(int func, int addr, uint8_t val, void *priv)
|
||||
dev->regs[0x21] = val;
|
||||
cmd646_ide_bm_handlers(dev);
|
||||
break;
|
||||
case 0x2c ... 0x2f:
|
||||
case 0x8c ... 0x8f:
|
||||
if (dev->local & CMD_TYPE_648)
|
||||
dev->regs[(addr & 0x0f) | 0x20] = val;
|
||||
break;
|
||||
case 0x30 ... 0x33:
|
||||
if ((dev->local & CMD_TYPE_648) && dev->has_bios) {
|
||||
dev->regs[addr] = val;
|
||||
cmd646_bios_handler(dev);
|
||||
}
|
||||
break;
|
||||
case 0x3c:
|
||||
dev->regs[0x3c] = val;
|
||||
break;
|
||||
case 0x4f:
|
||||
if (dev->local & CMD_TYPE_648)
|
||||
dev->regs[addr] = (dev->regs[addr] & 0xfa) | (val & 0x05);
|
||||
break;
|
||||
case 0x51:
|
||||
dev->regs[addr] = val & 0xc8;
|
||||
if (dev->local & CMD_TYPE_648)
|
||||
dev->regs[addr] = val & 0xcc;
|
||||
else
|
||||
dev->regs[addr] = val & 0xc8;
|
||||
cmd646_ide_handlers(dev);
|
||||
break;
|
||||
case 0x52:
|
||||
case 0x54:
|
||||
case 0x56:
|
||||
case 0x58:
|
||||
case 0x59:
|
||||
case 0x5b:
|
||||
dev->regs[addr] = val;
|
||||
break;
|
||||
case 0x59:
|
||||
if ((dev->local & CMD_TYPE_649) || !(dev->local & CMD_TYPE_648))
|
||||
dev->regs[addr] = val;
|
||||
break;
|
||||
case 0x53:
|
||||
case 0x55:
|
||||
dev->regs[addr] = val & 0xc0;
|
||||
@@ -274,10 +443,32 @@ cmd646_pci_write(int func, int addr, uint8_t val, void *priv)
|
||||
case 0x57:
|
||||
dev->regs[addr] = (dev->regs[addr] & 0x10) | (val & 0xcc);
|
||||
break;
|
||||
case 0x70 ... 0x77:
|
||||
case 0x64:
|
||||
if (dev->local & CMD_TYPE_648)
|
||||
dev->regs[addr] = (dev->regs[addr] & 0xfc) | (val & 0x03);
|
||||
break;
|
||||
case 0x65:
|
||||
if (dev->local & CMD_TYPE_648)
|
||||
dev->regs[addr] = (dev->regs[addr] & 0x7f) | (val & 0x80);
|
||||
break;
|
||||
case 0x71:
|
||||
if (dev->local & CMD_TYPE_648)
|
||||
sff_bus_master_write(addr & 0x0f, val, dev->bm[0]);
|
||||
else
|
||||
sff_bus_master_write(addr & 0x0f, val & 0x03, dev->bm[0]);
|
||||
break;
|
||||
case 0x70:
|
||||
case 0x72 ... 0x77:
|
||||
sff_bus_master_write(addr & 0x0f, val, dev->bm[0]);
|
||||
break;
|
||||
case 0x78 ... 0x7f:
|
||||
case 0x79:
|
||||
if (dev->local & CMD_TYPE_648)
|
||||
sff_bus_master_write(addr & 0x0f, val, dev->bm[1]);
|
||||
else
|
||||
sff_bus_master_write(addr & 0x0f, val & 0x03, dev->bm[1]);
|
||||
break;
|
||||
case 0x78:
|
||||
case 0x7a ... 0x7f:
|
||||
sff_bus_master_write(addr & 0x0f, val, dev->bm[1]);
|
||||
break;
|
||||
|
||||
@@ -295,7 +486,9 @@ cmd646_pci_read(int func, int addr, void *priv)
|
||||
if (func == 0x00) {
|
||||
ret = dev->regs[addr];
|
||||
|
||||
if (addr == 0x50)
|
||||
if ((addr == 0x09) && (dev->local & CMD_TYPE_648) && (dev->regs[0x0a] == 0x04))
|
||||
ret = 0x00;
|
||||
else if (addr == 0x50)
|
||||
dev->regs[0x50] &= ~0x04;
|
||||
else if (addr == 0x57)
|
||||
dev->regs[0x57] &= ~0x10;
|
||||
@@ -303,6 +496,8 @@ cmd646_pci_read(int func, int addr, void *priv)
|
||||
ret = sff_bus_master_read(addr & 0x0f, dev->bm[0]);
|
||||
else if ((addr >= 0x78) && (addr <= 0x7f))
|
||||
ret = sff_bus_master_read(addr & 0x0f, dev->bm[1]);
|
||||
else if ((dev->local & CMD_TYPE_648) && (addr >= 0x8c) && (addr <= 0x8f))
|
||||
ret = dev->regs[(addr & 0x0f) | 0x20];
|
||||
}
|
||||
|
||||
cmd646_log("[%04X:%08X] (%08X) cmd646_pci_read(%i, %02X, %02X)\n", CS, cpu_state.pc, ESI, func, addr, ret);
|
||||
@@ -310,22 +505,44 @@ cmd646_pci_read(int func, int addr, void *priv)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
check_ch(cmd646_t *dev, int channel)
|
||||
{
|
||||
int ret = 0;
|
||||
int min = 0;
|
||||
int max = dev->single_channel ? 1 : 3;
|
||||
|
||||
if (dev->local & 0x80000) {
|
||||
min += 4;
|
||||
max += 4;
|
||||
}
|
||||
|
||||
if ((channel >= min) && (channel <= max))
|
||||
ret = 1;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
cmd646_reset(void *priv)
|
||||
{
|
||||
cmd646_t *dev = (cmd646_t *) priv;
|
||||
int i = 0;
|
||||
|
||||
for (i = 0; i < HDD_NUM; i++) {
|
||||
if ((hdd[i].bus_type == HDD_BUS_ATAPI) && check_ch(dev, hdd[i].ide_channel) && hdd[i].priv)
|
||||
scsi_disk_reset((scsi_common_t *) hdd[i].priv);
|
||||
}
|
||||
for (i = 0; i < CDROM_NUM; i++) {
|
||||
if ((cdrom[i].bus_type == CDROM_BUS_ATAPI) && (cdrom[i].ide_channel < 4) && cdrom[i].priv)
|
||||
if ((cdrom[i].bus_type == CDROM_BUS_ATAPI) && check_ch(dev, cdrom[i].ide_channel) && cdrom[i].priv)
|
||||
scsi_cdrom_reset((scsi_common_t *) cdrom[i].priv);
|
||||
}
|
||||
for (i = 0; i < ZIP_NUM; i++) {
|
||||
if ((zip_drives[i].bus_type == ZIP_BUS_ATAPI) && (zip_drives[i].ide_channel < 4) && zip_drives[i].priv)
|
||||
zip_reset((scsi_common_t *) zip_drives[i].priv);
|
||||
for (i = 0; i < RDISK_NUM; i++) {
|
||||
if ((rdisk_drives[i].bus_type == RDISK_BUS_ATAPI) && check_ch(dev, rdisk_drives[i].ide_channel) && rdisk_drives[i].priv)
|
||||
rdisk_reset((scsi_common_t *) rdisk_drives[i].priv);
|
||||
}
|
||||
for (i = 0; i < MO_NUM; i++) {
|
||||
if ((mo_drives[i].bus_type == MO_BUS_ATAPI) && (mo_drives[i].ide_channel < 4) && mo_drives[i].priv)
|
||||
if ((mo_drives[i].bus_type == MO_BUS_ATAPI) && check_ch(dev, mo_drives[i].ide_channel) && mo_drives[i].priv)
|
||||
mo_reset((scsi_common_t *) mo_drives[i].priv);
|
||||
}
|
||||
|
||||
@@ -336,16 +553,41 @@ cmd646_reset(void *priv)
|
||||
|
||||
dev->regs[0x00] = 0x95; /* CMD */
|
||||
dev->regs[0x01] = 0x10;
|
||||
dev->regs[0x02] = 0x46; /* PCI-0646 */
|
||||
if (dev->local & CMD_TYPE_649)
|
||||
dev->regs[0x02] = 0x49; /* PCI-0649 */
|
||||
else if (dev->local & CMD_TYPE_648)
|
||||
dev->regs[0x02] = 0x48; /* PCI-0648 */
|
||||
else
|
||||
dev->regs[0x02] = 0x46; /* PCI-0646 */
|
||||
dev->regs[0x03] = 0x06;
|
||||
dev->regs[0x04] = 0x00;
|
||||
dev->regs[0x06] = 0x80;
|
||||
dev->regs[0x07] = 0x02; /* DEVSEL timing: 01 medium */
|
||||
dev->regs[0x09] = dev->local; /* Programming interface */
|
||||
dev->regs[0x0a] = 0x01; /* IDE controller */
|
||||
if ((dev->local & CMD_TYPE_648) && (dev->local & CMD648_RAID)) {
|
||||
dev->regs[0x06] = 0x90;
|
||||
dev->regs[0x08] = 0x02;
|
||||
dev->regs[0x09] = 0x00; /* Programming interface */
|
||||
dev->regs[0x0a] = 0x04; /* RAID controller */
|
||||
|
||||
dev->regs[0x50] = 0x40; /* Enable Base address register R/W;
|
||||
If 0, they return 0 and are read-only 8 */
|
||||
|
||||
/* Blank base addresses */
|
||||
dev->regs[0x10] = 0x01;
|
||||
dev->regs[0x14] = 0x01;
|
||||
dev->regs[0x18] = 0x01;
|
||||
dev->regs[0x1c] = 0x01;
|
||||
} else {
|
||||
dev->regs[0x06] = 0x80;
|
||||
dev->regs[0x09] = dev->local; /* Programming interface */
|
||||
dev->regs[0x0a] = 0x01; /* IDE controller */
|
||||
}
|
||||
dev->regs[0x0b] = 0x01; /* Mass storage controller */
|
||||
|
||||
if ((dev->local & 0xffff) == 0x8a) {
|
||||
if ((dev->local & CMD_TYPE_648) && (dev->local & CMD648_JP7))
|
||||
for (int i = 0; i < 4; i++)
|
||||
dev->regs[0x2c + i] = dev->regs[i];
|
||||
|
||||
if ((dev->regs[0x09] & 0x8a) == 0x8a) {
|
||||
dev->regs[0x50] = 0x40; /* Enable Base address register R/W;
|
||||
If 0, they return 0 and are read-only 8 */
|
||||
|
||||
@@ -371,13 +613,47 @@ cmd646_reset(void *priv)
|
||||
dev->regs[0x51] = 0x08;
|
||||
|
||||
dev->regs[0x57] = 0x0c;
|
||||
dev->regs[0x59] = 0x40;
|
||||
|
||||
dev->irq_mode[0] = dev->irq_mode[1] = 0;
|
||||
if (dev->local & CMD_TYPE_648) {
|
||||
dev->regs[0x34] = 0x60;
|
||||
|
||||
dev->regs[0x4f] = (dev->local & CMD648_JP7) ? 0x02 : 0x00;
|
||||
dev->regs[0x51] |= 0x04;
|
||||
|
||||
if (dev->local & CMD_TYPE_649) {
|
||||
dev->regs[0x57] |= 0x80;
|
||||
dev->regs[0x59] = 0x40;
|
||||
} else
|
||||
dev->regs[0x57] |= 0xc0;
|
||||
|
||||
dev->regs[0x60] = 0x01;
|
||||
dev->regs[0x62] = 0x21;
|
||||
dev->regs[0x63] = 0x06;
|
||||
dev->regs[0x65] = 0x60;
|
||||
dev->regs[0x67] = 0xf0;
|
||||
|
||||
/* 80-pin stuff. */
|
||||
dev->regs[0x72] = 0x08;
|
||||
dev->regs[0x7a] = 0x08;
|
||||
dev->regs[0x79] = 0x83;
|
||||
} else
|
||||
dev->regs[0x59] = 0x40;
|
||||
|
||||
dev->irq_pin = PCI_INTA;
|
||||
|
||||
if ((dev->local & CMD_TYPE_648) && (dev->local & CMD648_RAID))
|
||||
dev->irq_mode[0] = dev->irq_mode[1] = IRQ_MODE_PCI_IRQ_PIN;
|
||||
else {
|
||||
dev->irq_mode[0] = (dev->regs[0x09] & 0x01) ? IRQ_MODE_PCI_IRQ_PIN : IRQ_MODE_LEGACY;
|
||||
dev->irq_mode[1] = (dev->regs[0x09] & 0x04) ? IRQ_MODE_PCI_IRQ_PIN : IRQ_MODE_LEGACY;
|
||||
}
|
||||
|
||||
dev->irq_pin = PCI_INTA;
|
||||
|
||||
cmd646_ide_handlers(dev);
|
||||
cmd646_ide_bm_handlers(dev);
|
||||
|
||||
cmd646_bios_handler(dev);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -391,42 +667,147 @@ cmd646_close(void *priv)
|
||||
static void *
|
||||
cmd646_init(const device_t *info)
|
||||
{
|
||||
cmd646_t *dev = (cmd646_t *) calloc(1, sizeof(cmd646_t));
|
||||
cmd646_t *dev = (cmd646_t *) calloc(1, sizeof(cmd646_t));
|
||||
int first = 0;
|
||||
|
||||
dev->local = info->local;
|
||||
|
||||
device_add(&ide_pci_2ch_device);
|
||||
|
||||
if (info->local & 0x80000)
|
||||
pci_add_card(PCI_ADD_NORMAL, cmd646_pci_read, cmd646_pci_write, dev, &dev->pci_slot);
|
||||
else
|
||||
if (info->local & 0x80000) {
|
||||
first = 2;
|
||||
device_add(&ide_pci_ter_qua_2ch_device);
|
||||
} else
|
||||
device_add(&ide_pci_2ch_device);
|
||||
|
||||
if (info->local & CMD64X_ONBOARD)
|
||||
pci_add_card(PCI_ADD_IDE, cmd646_pci_read, cmd646_pci_write, dev, &dev->pci_slot);
|
||||
else
|
||||
pci_add_card(PCI_ADD_NORMAL, cmd646_pci_read, cmd646_pci_write, dev, &dev->pci_slot);
|
||||
|
||||
dev->single_channel = !!(info->local & 0x20000);
|
||||
|
||||
dev->bm[0] = device_add_inst(&sff8038i_device, 1);
|
||||
dev->bm[0] = device_add_inst(&sff8038i_device, first + 1);
|
||||
if (!dev->single_channel)
|
||||
dev->bm[1] = device_add_inst(&sff8038i_device, 2);
|
||||
dev->bm[1] = device_add_inst(&sff8038i_device, first + 2);
|
||||
|
||||
ide_set_bus_master(0, cmd646_bus_master_dma_0, cmd646_set_irq_0, dev);
|
||||
ide_set_bus_master(first, cmd646_bus_master_dma_0, cmd646_set_irq_0, dev);
|
||||
if (!dev->single_channel)
|
||||
ide_set_bus_master(1, cmd646_bus_master_dma_1, cmd646_set_irq_1, dev);
|
||||
ide_set_bus_master(first + 1, cmd646_bus_master_dma_1, cmd646_set_irq_1, dev);
|
||||
|
||||
sff_set_irq_mode(dev->bm[0], IRQ_MODE_LEGACY);
|
||||
|
||||
if (!dev->single_channel)
|
||||
sff_set_irq_mode(dev->bm[1], IRQ_MODE_LEGACY);
|
||||
|
||||
sff_set_slot(dev->bm[0], dev->pci_slot);
|
||||
sff_set_slot(dev->bm[1], dev->pci_slot);
|
||||
|
||||
if (dev->local & CMD_TYPE_648) {
|
||||
sff_set_ven_handlers(dev->bm[0], cmd646_bm_write, cmd646_bm_read, dev);
|
||||
sff_set_ven_handlers(dev->bm[1], cmd646_bm_write, cmd646_bm_read, dev);
|
||||
|
||||
dev->has_bios = device_get_config_int("bios");
|
||||
|
||||
if (dev->has_bios) {
|
||||
char *fn = NULL;
|
||||
|
||||
if (dev->local & CMD_TYPE_649) {
|
||||
const char *bios_rev = (char *) device_get_config_bios("bios_rev");
|
||||
fn = (char *) device_get_bios_file(info, bios_rev, 0);
|
||||
|
||||
dev->rom_addr_size = device_get_bios_file_size(info, bios_rev);
|
||||
} else {
|
||||
fn = CMD648_BIOS_FILE;
|
||||
|
||||
dev->rom_addr_size = 0x00004000;
|
||||
}
|
||||
|
||||
dev->rom_addr_mask = dev->rom_addr_size - 1;
|
||||
|
||||
rom_init(&dev->bios_rom, fn,
|
||||
0x000d0000, dev->rom_addr_size, dev->rom_addr_mask, 0, MEM_MAPPING_EXTERNAL);
|
||||
|
||||
mem_mapping_disable(&dev->bios_rom.mapping);
|
||||
}
|
||||
}
|
||||
|
||||
cmd646_reset(dev);
|
||||
|
||||
if (dev->local & CMD_TYPE_648)
|
||||
for (int i = 0; i < 4; i++)
|
||||
dev->regs[0x2c + i] = dev->regs[i];
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
static const device_config_t cmd648_config[] = {
|
||||
{
|
||||
.name = "bios",
|
||||
.description = "Enable BIOS",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
static const device_config_t cmd649_config[] = {
|
||||
{
|
||||
.name = "bios",
|
||||
.description = "Enable BIOS",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "bios_rev",
|
||||
.description = "BIOS Revision",
|
||||
.type = CONFIG_BIOS,
|
||||
.default_string = "rev_2301",
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.bios = {
|
||||
{
|
||||
.name = "Revision 1.9.14",
|
||||
.internal_name = "rev_1914",
|
||||
.bios_type = BIOS_NORMAL,
|
||||
.files_no = 1,
|
||||
.local = 0,
|
||||
.size = 16384,
|
||||
.files = { CMD649_REV_2301_BIOS_FILE, "" }
|
||||
},
|
||||
{
|
||||
.name = "Revision 2.3.01",
|
||||
.internal_name = "rev_2301",
|
||||
.bios_type = BIOS_NORMAL,
|
||||
.files_no = 1,
|
||||
.local = 0,
|
||||
.size = 65536,
|
||||
.files = { CMD649_REV_2301_BIOS_FILE, "" }
|
||||
},
|
||||
{ .files_no = 0 }
|
||||
},
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
const device_t ide_cmd646_device = {
|
||||
.name = "CMD PCI-0646",
|
||||
.internal_name = "ide_cmd646",
|
||||
.flags = DEVICE_PCI,
|
||||
.local = 0x8a,
|
||||
.local = 0x000008a | CMD64X_ONBOARD,
|
||||
.init = cmd646_init,
|
||||
.close = cmd646_close,
|
||||
.reset = cmd646_reset,
|
||||
@@ -440,7 +821,7 @@ const device_t ide_cmd646_legacy_only_device = {
|
||||
.name = "CMD PCI-0646 (Legacy Mode Only)",
|
||||
.internal_name = "ide_cmd646_legacy_only",
|
||||
.flags = DEVICE_PCI,
|
||||
.local = 0x80,
|
||||
.local = 0x0000080 | CMD64X_ONBOARD,
|
||||
.init = cmd646_init,
|
||||
.close = cmd646_close,
|
||||
.reset = cmd646_reset,
|
||||
@@ -451,10 +832,10 @@ const device_t ide_cmd646_legacy_only_device = {
|
||||
};
|
||||
|
||||
const device_t ide_cmd646_single_channel_device = {
|
||||
.name = "CMD PCI-0646",
|
||||
.name = "CMD PCI-0646 (Single Channel)",
|
||||
.internal_name = "ide_cmd646_single_channel",
|
||||
.flags = DEVICE_PCI,
|
||||
.local = 0x2008a,
|
||||
.local = 0x002008a | CMD64X_ONBOARD,
|
||||
.init = cmd646_init,
|
||||
.close = cmd646_close,
|
||||
.reset = cmd646_reset,
|
||||
@@ -463,3 +844,59 @@ const device_t ide_cmd646_single_channel_device = {
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t ide_cmd646_ter_qua_device = {
|
||||
.name = "CMD PCI-0646 (Tertiary and Quaternary)",
|
||||
.internal_name = "ide_cmd646_ter_qua",
|
||||
.flags = DEVICE_PCI,
|
||||
.local = 0x008008f,
|
||||
.init = cmd646_init,
|
||||
.close = cmd646_close,
|
||||
.reset = cmd646_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t ide_cmd648_ter_qua_device = {
|
||||
.name = "CMD PCI-0648 (Tertiary and Quaternary)",
|
||||
.internal_name = "ide_cmd648_ter_qua",
|
||||
.flags = DEVICE_PCI,
|
||||
.local = 0x0d8008f,
|
||||
.init = cmd646_init,
|
||||
.close = cmd646_close,
|
||||
.reset = cmd646_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = cmd648_config
|
||||
};
|
||||
|
||||
const device_t ide_cmd648_ter_qua_onboard_device = {
|
||||
.name = "CMD PCI-0648 (Tertiary and Quaternary) On-Board",
|
||||
.internal_name = "ide_cmd648_ter_qua_onboard",
|
||||
.flags = DEVICE_PCI,
|
||||
.local = 0x0d8008f | CMD64X_ONBOARD,
|
||||
.init = cmd646_init,
|
||||
.close = cmd646_close,
|
||||
.reset = cmd646_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t ide_cmd649_ter_qua_device = {
|
||||
.name = "CMD PCI-0649 (Tertiary and Quaternary)",
|
||||
.internal_name = "ide_cmd649_ter_qua",
|
||||
.flags = DEVICE_PCI,
|
||||
.local = 0x0f8008f,
|
||||
.init = cmd646_init,
|
||||
.close = cmd646_close,
|
||||
.reset = cmd646_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = cmd649_config
|
||||
};
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/hdc_ide_sff8038i.h>
|
||||
#include <86box/zip.h>
|
||||
#include <86box/rdisk.h>
|
||||
#include <86box/mo.h>
|
||||
|
||||
typedef struct rz1000_t {
|
||||
@@ -182,10 +182,10 @@ rz1000_reset(void *priv)
|
||||
(cdrom[i].ide_channel <= max_channel) && cdrom[i].priv)
|
||||
scsi_cdrom_reset((scsi_common_t *) cdrom[i].priv);
|
||||
}
|
||||
for (i = 0; i < ZIP_NUM; i++) {
|
||||
if ((zip_drives[i].bus_type == ZIP_BUS_ATAPI) && (zip_drives[i].ide_channel >= min_channel) &&
|
||||
(zip_drives[i].ide_channel <= max_channel) && zip_drives[i].priv)
|
||||
zip_reset((scsi_common_t *) zip_drives[i].priv);
|
||||
for (i = 0; i < RDISK_NUM; i++) {
|
||||
if ((rdisk_drives[i].bus_type == RDISK_BUS_ATAPI) && (rdisk_drives[i].ide_channel >= min_channel) &&
|
||||
(rdisk_drives[i].ide_channel <= max_channel) && rdisk_drives[i].priv)
|
||||
rdisk_reset((scsi_common_t *) rdisk_drives[i].priv);
|
||||
}
|
||||
for (i = 0; i < MO_NUM; i++) {
|
||||
if ((mo_drives[i].bus_type == MO_BUS_ATAPI) && (mo_drives[i].ide_channel >= min_channel) &&
|
||||
@@ -275,7 +275,7 @@ const device_t ide_rz1000_pci_device = {
|
||||
};
|
||||
|
||||
const device_t ide_rz1000_pci_single_channel_device = {
|
||||
.name = "PC Technology RZ-1000 PCI",
|
||||
.name = "PC Technology RZ-1000 PCI (Single Channel)",
|
||||
.internal_name = "ide_rz1000_pci_single_channel",
|
||||
.flags = DEVICE_PCI,
|
||||
.local = 0x20000,
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/hdc_ide_sff8038i.h>
|
||||
#include <86box/zip.h>
|
||||
#include <86box/rdisk.h>
|
||||
#include <86box/mo.h>
|
||||
#include <86box/plat_unused.h>
|
||||
|
||||
@@ -118,6 +118,9 @@ sff_bus_master_write(uint16_t port, uint8_t val, void *priv)
|
||||
|
||||
sff_log("SFF-8038i Bus master BYTE write: %04X %02X\n", port, val);
|
||||
|
||||
if (dev->ven_write != NULL)
|
||||
val = dev->ven_write(port, val, dev->priv);
|
||||
|
||||
switch (port & 7) {
|
||||
case 0:
|
||||
sff_log("sff Cmd : val = %02X, old = %02X\n", val, dev->command);
|
||||
@@ -255,6 +258,9 @@ sff_bus_master_read(uint16_t port, void *priv)
|
||||
break;
|
||||
}
|
||||
|
||||
if (dev->ven_read != NULL)
|
||||
ret= dev->ven_read(port, ret, dev->priv);
|
||||
|
||||
sff_log("SFF-8038i Bus master BYTE read : %04X %02X\n", port, ret);
|
||||
|
||||
return ret;
|
||||
@@ -489,10 +495,10 @@ sff_reset(void *priv)
|
||||
cdrom[i].priv)
|
||||
scsi_cdrom_reset((scsi_common_t *) cdrom[i].priv);
|
||||
}
|
||||
for (uint8_t i = 0; i < ZIP_NUM; i++) {
|
||||
if ((zip_drives[i].bus_type == ZIP_BUS_ATAPI) && (zip_drives[i].ide_channel < 4) &&
|
||||
zip_drives[i].priv)
|
||||
zip_reset((scsi_common_t *) zip_drives[i].priv);
|
||||
for (uint8_t i = 0; i < RDISK_NUM; i++) {
|
||||
if ((rdisk_drives[i].bus_type == RDISK_BUS_ATAPI) && (rdisk_drives[i].ide_channel < 4) &&
|
||||
rdisk_drives[i].priv)
|
||||
rdisk_reset((scsi_common_t *) rdisk_drives[i].priv);
|
||||
}
|
||||
for (uint8_t i = 0; i < MO_NUM; i++) {
|
||||
if ((mo_drives[i].bus_type == MO_BUS_ATAPI) && (mo_drives[i].ide_channel < 4) &&
|
||||
@@ -569,6 +575,16 @@ sff_set_mirq(sff8038i_t *dev, uint8_t mirq)
|
||||
dev->mirq = mirq;
|
||||
}
|
||||
|
||||
void
|
||||
sff_set_ven_handlers(sff8038i_t *dev, uint8_t (*ven_write)(uint16_t port, uint8_t val, void *priv),
|
||||
uint8_t (*ven_read)(uint16_t port, uint8_t val, void *priv), void *priv)
|
||||
{
|
||||
dev->ven_write = ven_write;
|
||||
dev->ven_read = ven_read;
|
||||
|
||||
dev->priv = priv;
|
||||
}
|
||||
|
||||
static void
|
||||
sff_close(void *priv)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <86box/hdc.h>
|
||||
#include <86box/hdc_ide.h>
|
||||
#include <86box/hdc_ide_sff8038i.h>
|
||||
#include <86box/zip.h>
|
||||
#include <86box/rdisk.h>
|
||||
#include <86box/mo.h>
|
||||
|
||||
typedef struct w83769f_t {
|
||||
@@ -297,10 +297,10 @@ w83769f_reset(void *priv)
|
||||
(cdrom[i].ide_channel <= max_channel) && cdrom[i].priv)
|
||||
scsi_cdrom_reset((scsi_common_t *) cdrom[i].priv);
|
||||
}
|
||||
for (i = 0; i < ZIP_NUM; i++) {
|
||||
if ((zip_drives[i].bus_type == ZIP_BUS_ATAPI) && (zip_drives[i].ide_channel >= min_channel) &&
|
||||
(zip_drives[i].ide_channel <= max_channel) && zip_drives[i].priv)
|
||||
zip_reset((scsi_common_t *) zip_drives[i].priv);
|
||||
for (i = 0; i < RDISK_NUM; i++) {
|
||||
if ((rdisk_drives[i].bus_type == RDISK_BUS_ATAPI) && (rdisk_drives[i].ide_channel >= min_channel) &&
|
||||
(rdisk_drives[i].ide_channel <= max_channel) && rdisk_drives[i].priv)
|
||||
rdisk_reset((scsi_common_t *) rdisk_drives[i].priv);
|
||||
}
|
||||
for (i = 0; i < MO_NUM; i++) {
|
||||
if ((mo_drives[i].bus_type == MO_BUS_ATAPI) && (mo_drives[i].ide_channel >= min_channel) &&
|
||||
|
||||
@@ -1915,7 +1915,7 @@ victor_v86p_available(void)
|
||||
static const device_config_t dtc_config[] = {
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xc8000,
|
||||
@@ -1969,7 +1969,7 @@ static const device_config_t st11_config[] = {
|
||||
},
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xc8000,
|
||||
@@ -2006,7 +2006,7 @@ static const device_config_t st11_config[] = {
|
||||
static const device_config_t wd_config[] = {
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xc8000,
|
||||
@@ -2089,7 +2089,7 @@ static const device_config_t wd_nobios_config[] = {
|
||||
static const device_config_t wd_rll_config[] = {
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xc8000,
|
||||
@@ -2153,7 +2153,7 @@ static const device_config_t wd_rll_config[] = {
|
||||
static const device_config_t wd1004a_config[] = {
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xc8000,
|
||||
@@ -2202,7 +2202,7 @@ static const device_config_t wd1004a_config[] = {
|
||||
static const device_config_t wd1004_rll_config[] = {
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xc8000,
|
||||
|
||||
@@ -1281,7 +1281,7 @@ static const device_config_t wdxt150_config[] = {
|
||||
},
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xc8000,
|
||||
|
||||
@@ -341,7 +341,7 @@ static const device_config_t xtide_config[] = {
|
||||
},
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xd0000,
|
||||
|
||||
@@ -78,6 +78,12 @@ no_cdrom:
|
||||
|
||||
if (!strcmp(str, "scsi"))
|
||||
return HDD_BUS_SCSI;
|
||||
|
||||
if (!strcmp(str, "mitsumi"))
|
||||
return CDROM_BUS_MITSUMI;
|
||||
|
||||
if (!strcmp(str, "mke"))
|
||||
return CDROM_BUS_MKE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -89,6 +95,17 @@ hdd_bus_to_string(int bus, UNUSED(int cdrom))
|
||||
|
||||
switch (bus) {
|
||||
default:
|
||||
if (cdrom) {
|
||||
switch (bus) {
|
||||
case CDROM_BUS_MITSUMI:
|
||||
s = "mitsumi";
|
||||
break;
|
||||
case CDROM_BUS_MKE:
|
||||
s = "mke";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HDD_BUS_DISABLED:
|
||||
break;
|
||||
|
||||
@@ -143,8 +160,12 @@ hdd_seek_get_time(hard_disk_t *hdd, uint32_t dst_addr, uint8_t operation, uint8_
|
||||
|
||||
const hdd_zone_t *zone = NULL;
|
||||
if (hdd->num_zones <= 0) {
|
||||
#ifdef DO_FATAL
|
||||
fatal("hdd_seek_get_time(): hdd->num_zones < 0)\n");
|
||||
return 0.0;
|
||||
#else
|
||||
return 1000.0;
|
||||
#endif
|
||||
}
|
||||
for (uint32_t i = 0; i < hdd->num_zones; i++) {
|
||||
zone = &hdd->zones[i];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -335,14 +335,17 @@ fdc_int(fdc_t *fdc, int set_fintr)
|
||||
{
|
||||
int ienable = 0;
|
||||
|
||||
if (!(fdc->flags & FDC_FLAG_PCJR))
|
||||
if (fdc->flags & FDC_FLAG_PS2_MCA)
|
||||
ienable = 1;
|
||||
else if (!(fdc->flags & FDC_FLAG_PCJR))
|
||||
ienable = !!(fdc->dor & 8);
|
||||
|
||||
if (ienable)
|
||||
if (ienable) {
|
||||
picint(1 << fdc->irq);
|
||||
|
||||
if (set_fintr)
|
||||
fdc->fintr = 1;
|
||||
if (set_fintr)
|
||||
fdc->fintr = 1;
|
||||
}
|
||||
fdc_log("fdc_int(%i): fdc->fintr = %i\n", set_fintr, fdc->fintr);
|
||||
}
|
||||
|
||||
@@ -762,9 +765,17 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
|
||||
fdc->st0 &= ~0x07;
|
||||
fdc->st0 |= (fdd_get_head(0) ? 4 : 0);
|
||||
} else {
|
||||
if (!(val & 8) && (fdc->dor & 8)) {
|
||||
fdc->tc = 1;
|
||||
fdc_int(fdc, 1);
|
||||
/*
|
||||
Writing this bit to logic "1" will enable the DRQ,
|
||||
nDACK, TC and FINTR outputs. This bit being a
|
||||
logic "0" will disable the nDACK and TC inputs, and
|
||||
hold the DRQ and FINTR outputs in a high
|
||||
impedance state.
|
||||
*/
|
||||
if (!(val & 8) && (fdc->dor & 8) && !(fdc->flags & FDC_FLAG_PS2_MCA)) {
|
||||
fdc->tc = 1;
|
||||
fdc->fintr = 0;
|
||||
picintc(1 << fdc->irq);
|
||||
}
|
||||
if (!(val & 4)) {
|
||||
fdd_stop(real_drive(fdc, val & 3));
|
||||
|
||||
@@ -110,7 +110,7 @@ static const device_config_t b215_config[] = {
|
||||
// clang-format off
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xca000,
|
||||
|
||||
@@ -162,7 +162,7 @@ static const device_config_t monster_fdc_config[] = {
|
||||
#endif
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xc8000,
|
||||
|
||||
@@ -123,7 +123,7 @@ static const device_config_t pii_config[] = {
|
||||
// clang-format off
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xce000,
|
||||
|
||||
@@ -539,7 +539,7 @@ fdd_hole(int drive)
|
||||
static __inline uint64_t
|
||||
fdd_byteperiod(int drive)
|
||||
{
|
||||
if (!fdd_get_turbo(drive) && drives[drive].byteperiod)
|
||||
if (drives[drive].byteperiod)
|
||||
return drives[drive].byteperiod(drive);
|
||||
else
|
||||
return 32ULL * TIMER_USEC;
|
||||
|
||||
@@ -758,36 +758,43 @@ d86f_get_encoding(int drive)
|
||||
uint64_t
|
||||
d86f_byteperiod(int drive)
|
||||
{
|
||||
double dusec = (double) TIMER_USEC;
|
||||
double p = 2.0;
|
||||
d86f_t *dev = d86f[drive];
|
||||
uint64_t ret = 32ULL * TIMER_USEC;
|
||||
|
||||
switch (d86f_track_flags(drive) & 0x0f) {
|
||||
case 0x02: /* 125 kbps, FM */
|
||||
p = 4.0;
|
||||
break;
|
||||
case 0x01: /* 150 kbps, FM */
|
||||
p = 20.0 / 6.0;
|
||||
break;
|
||||
case 0x0a: /* 250 kbps, MFM */
|
||||
case 0x00: /* 250 kbps, FM */
|
||||
default:
|
||||
p = 2.0;
|
||||
break;
|
||||
case 0x09: /* 300 kbps, MFM */
|
||||
p = 10.0 / 6.0;
|
||||
break;
|
||||
case 0x08: /* 500 kbps, MFM */
|
||||
p = 1.0;
|
||||
break;
|
||||
case 0x0b: /* 1000 kbps, MFM */
|
||||
p = 0.5;
|
||||
break;
|
||||
case 0x0d: /* 2000 kbps, MFM */
|
||||
p = 0.25;
|
||||
break;
|
||||
if (!fdd_get_turbo(drive) || (dev->version != 0x0063) || (dev->state == STATE_SECTOR_NOT_FOUND)) {
|
||||
double dusec = (double) TIMER_USEC;
|
||||
double p = 2.0;
|
||||
|
||||
switch (d86f_track_flags(drive) & 0x0f) {
|
||||
case 0x02: /* 125 kbps, FM */
|
||||
p = 4.0;
|
||||
break;
|
||||
case 0x01: /* 150 kbps, FM */
|
||||
p = 20.0 / 6.0;
|
||||
break;
|
||||
case 0x0a: /* 250 kbps, MFM */
|
||||
case 0x00: /* 250 kbps, FM */
|
||||
default:
|
||||
p = 2.0;
|
||||
break;
|
||||
case 0x09: /* 300 kbps, MFM */
|
||||
p = 10.0 / 6.0;
|
||||
break;
|
||||
case 0x08: /* 500 kbps, MFM */
|
||||
p = 1.0;
|
||||
break;
|
||||
case 0x0b: /* 1000 kbps, MFM */
|
||||
p = 0.5;
|
||||
break;
|
||||
case 0x0d: /* 2000 kbps, MFM */
|
||||
p = 0.25;
|
||||
break;
|
||||
}
|
||||
|
||||
ret = (uint64_t) (p * dusec);
|
||||
}
|
||||
|
||||
return (uint64_t) (p * dusec);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
@@ -2463,16 +2470,17 @@ d86f_poll(int drive)
|
||||
dev->state = STATE_SECTOR_NOT_FOUND;
|
||||
}
|
||||
|
||||
if (fdd_get_turbo(drive) && (dev->version == 0x0063)) {
|
||||
d86f_turbo_poll(drive, side);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((dev->state != STATE_IDLE) && (dev->state != STATE_SECTOR_NOT_FOUND) && ((dev->state & 0xF8) != 0xE8)) {
|
||||
if (!d86f_can_read_address(drive))
|
||||
dev->state = STATE_SECTOR_NOT_FOUND;
|
||||
}
|
||||
|
||||
/* Do normal poll if DENSEL is wrong, because Windows 95 is very strict about timings there. */
|
||||
if (fdd_get_turbo(drive) && (dev->version == 0x0063) && (dev->state != STATE_SECTOR_NOT_FOUND)) {
|
||||
d86f_turbo_poll(drive, side);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((dev->state != STATE_02_SPIN_TO_INDEX) && (dev->state != STATE_0D_SPIN_TO_INDEX))
|
||||
d86f_get_bit(drive, side ^ 1);
|
||||
|
||||
@@ -2577,12 +2585,6 @@ d86f_poll(int drive)
|
||||
|
||||
d86f_advance_bit(drive, side);
|
||||
|
||||
if (d86f_wrong_densel(drive) && (dev->state != STATE_IDLE)) {
|
||||
dev->state = STATE_IDLE;
|
||||
fdc_noidam(d86f_fdc);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((dev->index_count == 2) && (dev->state != STATE_IDLE)) {
|
||||
switch (dev->state) {
|
||||
case STATE_0A_FIND_ID:
|
||||
@@ -3277,7 +3279,12 @@ d86f_readsector(int drive, int sector, int track, int side, int rate, int sector
|
||||
if (!ret)
|
||||
return;
|
||||
|
||||
if (sector == SECTOR_FIRST)
|
||||
if (d86f_wrong_densel(drive)) {
|
||||
dev->state = STATE_SECTOR_NOT_FOUND;
|
||||
|
||||
if (fdd_get_turbo(drive))
|
||||
dev->track_pos = 0;
|
||||
} else if (sector == SECTOR_FIRST)
|
||||
dev->state = STATE_02_SPIN_TO_INDEX;
|
||||
else if (sector == SECTOR_NEXT)
|
||||
dev->state = STATE_02_FIND_ID;
|
||||
@@ -3302,7 +3309,13 @@ d86f_writesector(int drive, int sector, int track, int side, int rate, int secto
|
||||
if (!ret)
|
||||
return;
|
||||
|
||||
dev->state = fdc_is_deleted(d86f_fdc) ? STATE_09_FIND_ID : STATE_05_FIND_ID;
|
||||
if (d86f_wrong_densel(drive)) {
|
||||
dev->state = STATE_SECTOR_NOT_FOUND;
|
||||
|
||||
if (fdd_get_turbo(drive))
|
||||
dev->track_pos = 0;
|
||||
} else
|
||||
dev->state = fdc_is_deleted(d86f_fdc) ? STATE_09_FIND_ID : STATE_05_FIND_ID;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -3315,7 +3328,13 @@ d86f_comparesector(int drive, int sector, int track, int side, int rate, int sec
|
||||
if (!ret)
|
||||
return;
|
||||
|
||||
dev->state = STATE_11_FIND_ID;
|
||||
if (d86f_wrong_densel(drive)) {
|
||||
dev->state = STATE_SECTOR_NOT_FOUND;
|
||||
|
||||
if (fdd_get_turbo(drive))
|
||||
dev->track_pos = 0;
|
||||
} else
|
||||
dev->state = STATE_11_FIND_ID;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -3336,7 +3355,13 @@ d86f_readaddress(int drive, UNUSED(int side), UNUSED(int rate))
|
||||
dev->id_found = 0;
|
||||
dev->dma_over = 0;
|
||||
|
||||
dev->state = STATE_0A_FIND_ID;
|
||||
if (d86f_wrong_densel(drive)) {
|
||||
dev->state = STATE_SECTOR_NOT_FOUND;
|
||||
|
||||
if (fdd_get_turbo(drive))
|
||||
dev->track_pos = 0;
|
||||
} else
|
||||
dev->state = STATE_0A_FIND_ID;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -3438,7 +3463,13 @@ d86f_common_format(int drive, int side, UNUSED(int rate), uint8_t fill, int prox
|
||||
dev->index_count = dev->error_condition = dev->satisfying_bytes = dev->sector_count = 0;
|
||||
dev->dma_over = 0;
|
||||
|
||||
dev->state = STATE_0D_SPIN_TO_INDEX;
|
||||
if (d86f_wrong_densel(drive) && !proxy) {
|
||||
dev->state = STATE_SECTOR_NOT_FOUND;
|
||||
|
||||
if (fdd_get_turbo(drive))
|
||||
dev->track_pos = 0;
|
||||
} else
|
||||
dev->state = STATE_0D_SPIN_TO_INDEX;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -29,8 +29,9 @@
|
||||
#define CD_STATUS_STOPPED 6
|
||||
#define CD_STATUS_PLAYING_COMPLETED 7
|
||||
#define CD_STATUS_HOLD 8
|
||||
#define CD_STATUS_DVD_REJECTED 16
|
||||
#define CD_STATUS_HAS_AUDIO 0xc
|
||||
#define CD_STATUS_MASK 0xf
|
||||
#define CD_STATUS_MASK 0x1f
|
||||
|
||||
/* Medium changed flag. */
|
||||
#define CD_STATUS_TRANSITION 0x40
|
||||
@@ -93,13 +94,19 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
CDROM_BUS_DISABLED = 0,
|
||||
CDROM_BUS_ATAPI = 5,
|
||||
CDROM_BUS_SCSI = 6,
|
||||
CDROM_BUS_MITSUMI = 7,
|
||||
CDROM_BUS_USB = 8
|
||||
CDROM_BUS_DISABLED = 0,
|
||||
CDROM_BUS_PHILIPS = 1,
|
||||
CDROM_BUS_SONY = 2,
|
||||
CDROM_BUS_HITACHI = 3,
|
||||
CDROM_BUS_MKE = 4,
|
||||
CDROM_BUS_MITSUMI = 5,
|
||||
CDROM_BUS_LPT = 6,
|
||||
CDROM_BUS_ATAPI = 8,
|
||||
CDROM_BUS_SCSI = 9,
|
||||
CDROM_BUS_USB = 10
|
||||
};
|
||||
|
||||
#define BUS_TYPE_MKE CDROM_BUS_MKE
|
||||
#define BUS_TYPE_IDE CDROM_BUS_ATAPI
|
||||
#define BUS_TYPE_SCSI CDROM_BUS_SCSI
|
||||
#define BUS_TYPE_BOTH -2
|
||||
@@ -118,107 +125,112 @@ static const struct cdrom_drive_types_s {
|
||||
const int speed;
|
||||
const int inquiry_len;
|
||||
const int caddy;
|
||||
const int is_dvd;
|
||||
const int transfer_max[4];
|
||||
} cdrom_drive_types[] = {
|
||||
{ EMU_NAME, "86B_CD", CDV, "86cd", BUS_TYPE_BOTH, 2, -1, 36, 0, { 4, 2, 2, 5 } },
|
||||
{ EMU_NAME, "86B_CD", CDV, "86cd", BUS_TYPE_BOTH, 2, -1, 36, 0, 0, { 4, 2, 2, 5 } },
|
||||
/* SCSI-1 / early ATAPI generic - second on purpose so the later variant is the default. */
|
||||
{ EMU_NAME, "86B_CD", "1.00", "86cd100", BUS_TYPE_BOTH, 1, -1, 36, 1, { 0, -1, -1, -1 } },
|
||||
{ EMU_NAME, "86B_CD", "1.00", "86cd100", BUS_TYPE_BOTH, 1, -1, 36, 1, 0, { 0, -1, -1, -1 } },
|
||||
/* No difference from 86BOX CD-ROM, other than name - but enough people have requested such a name to warrant it. */
|
||||
{ EMU_NAME, "86B_DVD", "4.30", "86dvd", BUS_TYPE_BOTH, 2, -1, 36, 0, { 4, 2, 2, 5 } },
|
||||
{ "ASUS", "CD-S500/A", "1.41", "asus_500", BUS_TYPE_IDE, 0, 50, 36, 0, { 4, 2, 2, 2 } },
|
||||
{ "ASUS", "CD-S520/A4", "1.32", "asus_520", BUS_TYPE_IDE, 0, 52, 36, 0, { 4, 2, 2, 2 } },
|
||||
{ "AZT", "CDA46802I", "1.15", "azt_cda", BUS_TYPE_IDE, 0, 4, 36, 0, { 3, 0, 0, 0 } },
|
||||
{ "BTC", "CD-ROM BCD36XH", "U1.0", "btc_36xh", BUS_TYPE_IDE, 0, 36, 36, 0, { 4, 2, 2, -1 } },
|
||||
{ "GOLDSTAR", "CRD-8160B", "3.14", "goldstar", BUS_TYPE_IDE, 0, 16, 36, 0, { 4, 2, 2, -1 } },
|
||||
{ EMU_NAME, "86B_DVD", "5.00", "86dvd", BUS_TYPE_BOTH, 2, -1, 36, 0, 1, { 4, 2, 2, 5 } },
|
||||
{ "ASUS", "CD-S500/A", "1.41", "asus_500", BUS_TYPE_IDE, 0, 50, 36, 0, 0, { 4, 2, 2, 2 } },
|
||||
{ "ASUS", "CD-S520/A4", "1.32", "asus_520", BUS_TYPE_IDE, 0, 52, 36, 0, 0, { 4, 2, 2, 2 } },
|
||||
{ "AZT", "CDA46802I", "1.15", "azt_cda", BUS_TYPE_IDE, 0, 4, 36, 0, 0, { 3, 0, 0, 0 } },
|
||||
{ "BTC", "CD-ROM BCD36XH", "U1.0", "btc_36xh", BUS_TYPE_IDE, 0, 36, 36, 0, 0, { 4, 2, 2, -1 } },
|
||||
{ "GOLDSTAR", "CRD-8160B", "3.14", "goldstar", BUS_TYPE_IDE, 0, 16, 36, 0, 0, { 4, 2, 2, -1 } },
|
||||
/* TODO: Find an IDENTIFY and/or INQUIRY dump. */
|
||||
{ "GOLDSTAR", "GCD-R560B", "1.00", "goldstar", BUS_TYPE_IDE, 0, 6, 36, 0, { 4, 2, 2, -1 } },
|
||||
{ "HITACHI", "CDR-8130", "0020", "hitachi_r8130", BUS_TYPE_IDE, 0, 16, 36, 0, { 4, 2, 2, -1 } },
|
||||
{ "HITACHI", "GD-7500", "A1 ", "hitachi_7500", BUS_TYPE_IDE, 0, 40, 36, 0, { 4, 2, 2, 2 } }, /* DVD. */
|
||||
{ "HL-DT-ST", "CD-ROM GCR-8526B", "1.01", "hldtst_8526b", BUS_TYPE_IDE, 0, 52, 36, 0, { 4, 2, 2, 2 } },
|
||||
{ "HL-DT-ST", "DVDRAM GSA-4160", "A302", "hldtst_4160", BUS_TYPE_IDE, 0, 40, 36, 0, { 4, 2, 2, 2 } },
|
||||
{ "KENWOOD", "CD-ROM UCR-421", "208E", "kenwood_421", BUS_TYPE_IDE, 0, 72, 36, 0, { 4, 2, 2, 4 } },
|
||||
{ "GOLDSTAR", "GCD-R560B", "1.00", "goldstar", BUS_TYPE_IDE, 0, 6, 36, 0, 0, { 4, 2, 2, -1 } },
|
||||
{ "HITACHI", "CDR-8130", "0020", "hitachi_r8130", BUS_TYPE_IDE, 0, 16, 36, 0, 0, { 4, 2, 2, -1 } },
|
||||
{ "HITACHI", "GD-7500", "A1 ", "hitachi_7500", BUS_TYPE_IDE, 0, 40, 36, 0, 0, { 4, 2, 2, 2 } }, /* DVD. */
|
||||
{ "HL-DT-ST", "CD-ROM GCR-8526B", "1.01", "hldtst_8526b", BUS_TYPE_IDE, 0, 52, 36, 0, 0, { 4, 2, 2, 2 } },
|
||||
{ "HL-DT-ST", "DVDRAM GSA-4160", "A302", "hldtst_4160", BUS_TYPE_IDE, 0, 40, 36, 0, 0, { 4, 2, 2, 2 } },
|
||||
{ "KENWOOD", "CD-ROM UCR-421", "208E", "kenwood_421", BUS_TYPE_IDE, 0, 72, 36, 0, 0, { 4, 2, 2, 4 } },
|
||||
/*
|
||||
This is a laptop/notebook drive, as is also evident from the name:
|
||||
CRN = Notebook, CRD = Desktop.
|
||||
*/
|
||||
{ "LG", "CD-ROM CRN-8245B", "1.30", "lg_8245b", BUS_TYPE_IDE, 0, 24, 36, 0, { 4, 2, 2, -1 } },
|
||||
{ "LG", "CD-ROM CRD-8322B", "1.06", "lg_8322b", BUS_TYPE_IDE, 0, 32, 36, 0, { 4, 2, 2, -1 } },
|
||||
{ "LG", "CD-ROM CRN-8245B", "1.30", "lg_8245b", BUS_TYPE_IDE, 0, 24, 36, 0, 0, { 4, 2, 2, -1 } },
|
||||
{ "LG", "CD-ROM CRD-8322B", "1.06", "lg_8322b", BUS_TYPE_IDE, 0, 32, 36, 0, 0, { 4, 2, 2, -1 } },
|
||||
/* Nothing on Google, deduced 48x from the name. */
|
||||
{ "LITE-ON", "LTN48125S", "1S07", "liteon_48125s", BUS_TYPE_IDE, 0, 48, 36, 0, { 4, 2, 2, 2 } },
|
||||
{ "LITE-ON", "LTN48125S", "1S07", "liteon_48125s", BUS_TYPE_IDE, 0, 48, 36, 0, 0, { 4, 2, 2, 2 } },
|
||||
/* Confirmed to be 52x, was the basis for deducing the other one's speed. */
|
||||
{ "LITE-ON", "LTN526D", "YSR5", "liteon_526d", BUS_TYPE_IDE, 0, 52, 36, 0, { 4, 2, 2, 2 } },
|
||||
{ "MATSHITA", "CD-ROM CR-583", "1.07", "matshita_583", BUS_TYPE_IDE, 0, 8, 36, 0, { 4, 2, 2, -1 } },
|
||||
{ "MATSHITA", "CD-ROM CR-585", "Z18P", "matshita_585", BUS_TYPE_IDE, 0, 24, 36, 0, { 4, 2, 2, -1 } },
|
||||
{ "MATSHITA", "CD-ROM CR-587", "7S13", "matshita_587", BUS_TYPE_IDE, 0, 24, 36, 0, { 4, 2, 2, -1 } },
|
||||
{ "MATSHITA", "CD-ROM CR-588", "LS15", "matshita_588", BUS_TYPE_IDE, 0, 32, 36, 0, { 4, 2, 2, -1 } },
|
||||
{ "MATSHITA", "CR-571", "1.0e", "matshita_571", BUS_TYPE_IDE, 0, 2, 36, 0, { 0, -1, -1, -1 } },
|
||||
{ "MATSHITA", "CR-572", "1.0j", "matshita_572", BUS_TYPE_IDE, 0, 4, 36, 0, { 0, -1, -1, -1 } },
|
||||
{ "MITSUMI", "CRMC-FX4820T", "D02A", "mitsumi_4820t", BUS_TYPE_IDE, 0, 48, 36, 0, { 4, 2, 2, 2 } },
|
||||
{ "LITE-ON", "LTN526D", "YSR5", "liteon_526d", BUS_TYPE_IDE, 0, 52, 36, 0, 0, { 4, 2, 2, 2 } },
|
||||
{ "MATSHITA", "CD-ROM CR-583", "1.07", "matshita_583", BUS_TYPE_IDE, 0, 8, 36, 0, 0, { 4, 2, 2, -1 } },
|
||||
{ "MATSHITA", "CD-ROM CR-585", "Z18P", "matshita_585", BUS_TYPE_IDE, 0, 24, 36, 0, 0, { 4, 2, 2, -1 } },
|
||||
{ "MATSHITA", "CD-ROM CR-587", "7S13", "matshita_587", BUS_TYPE_IDE, 0, 24, 36, 0, 0, { 4, 2, 2, -1 } },
|
||||
{ "MATSHITA", "CD-ROM CR-588", "LS15", "matshita_588", BUS_TYPE_IDE, 0, 32, 36, 0, 0, { 4, 2, 2, -1 } },
|
||||
{ "MATSHITA", "CR-571", "1.0e", "matshita_571", BUS_TYPE_IDE, 0, 2, 36, 0, 0, { 0, -1, -1, -1 } },
|
||||
{ "MATSHITA", "CR-572", "1.0j", "matshita_572", BUS_TYPE_IDE, 0, 4, 36, 0, 0, { 0, -1, -1, -1 } },
|
||||
{ "MITSUMI", "CRMC-FX4820T", "D02A", "mitsumi_4820t", BUS_TYPE_IDE, 0, 48, 36, 0, 0, { 4, 2, 2, 2 } },
|
||||
/* TODO: Find an IDENTIFY and/or INQUIRY dump. */
|
||||
{ "MITSUMI", "CRMC-FX810T4", "????", "mitsumi_810t4", BUS_TYPE_IDE, 0, 8, 36, 0, { 4, 2, 2, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:260", "1.00", "nec_260_early", BUS_TYPE_IDE, 1, 2, 36, 1, { 0, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:260", "1.01", "nec_260", BUS_TYPE_IDE, 1, 4, 36, 1, { 0, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:273", "4.20", "nec_273", BUS_TYPE_IDE, 0, 4, 36, 0, { 0, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:280", "1.05", "nec_280_early", BUS_TYPE_IDE, 0, 6, 36, 1, { 4, 2, 2, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:280", "3.08", "nec_280", BUS_TYPE_IDE, 0, 8, 36, 1, { 4, 2, 2, -1 } },
|
||||
{ "NEC", "CDR-1300A", "1.05", "nec_1300a", BUS_TYPE_IDE, 0, 6, 36, 0, { 4, 2, 2, -1 } },
|
||||
{ "NEC", "CDR-1900A", "1.00", "nec_1900a", BUS_TYPE_IDE, 0, 32, 36, 0, { 4, 2, 2, -1 } },
|
||||
{ "PHILIPS", "CD-ROM PCA403CD", "U31P", "philips_403", BUS_TYPE_IDE, 0, 40, 36, 0, { 4, 2, 2, -1 } },
|
||||
{ "SONY", "CD-ROM CDU76", "1.0i", "sony_76", BUS_TYPE_IDE, 0, 4, 36, 0, { 2, -1, -1, -1 } },
|
||||
{ "SONY", "CD-ROM CDU311", "3.0h", "sony_311", BUS_TYPE_IDE, 0, 8, 36, 0, { 3, 2, 1, -1 } },
|
||||
{ "SONY", "CD-ROM CDU5225", "NYS4", "sony_5225", BUS_TYPE_IDE, 0, 52, 36, 0, { 4, 2, 2, 4 } },
|
||||
{ "TEAC", "CD-516E", "1.0G", "teac_516e", BUS_TYPE_IDE, 0, 16, 36, 0, { 3, 2, 2, -1 } },
|
||||
{ "TEAC", "CD-524EA", "3.0D", "teac_524ea", BUS_TYPE_IDE, 0, 24, 36, 0, { 3, 2, 2, -1 } },
|
||||
{ "TEAC", "CD-532E", "2.0A", "teac_532e", BUS_TYPE_IDE, 0, 32, 36, 0, { 3, 2, 2, -1 } },
|
||||
{ "TOSHIBA", "CD-ROM XM-5302TA", "0305", "toshiba_5302ta", BUS_TYPE_IDE, 0, 4, 96, 0, { 0, -1, -1, -1 } },
|
||||
{ "TOSHIBA", "CD-ROM XM-5702B", "TA70", "toshiba_5702b", BUS_TYPE_IDE, 0, 12, 96, 0, { 3, 2, 1, -1 } },
|
||||
{ "TOSHIBA", "CD-ROM XM-6202B", "1512", "toshiba_6202b", BUS_TYPE_IDE, 0, 32, 96, 0, { 4, 2, 2, -1 } },
|
||||
{ "TOSHIBA", "CD-ROM XM-6402B", "1008", "toshiba_6402b", BUS_TYPE_IDE, 0, 32, 96, 0, { 4, 2, 2, 2 } },
|
||||
{ "TOSHIBA", "CD-ROM XM-6702B", "1007", "toshiba_6720b", BUS_TYPE_IDE, 0, 48, 96, 0, { 4, 2, 2, 2 } },
|
||||
{ "TOSHIBA", "DVD-ROM SD-M1802", "1051", "toshiba_m1802", BUS_TYPE_IDE, 0, 48, 96, 0, { 4, 2, 2, 2 } },
|
||||
{ "CHINON", "CD-ROM CDS-431", "H42 ", "chinon_431", BUS_TYPE_SCSI, 1, 1, 36, 1, { -1, -1, -1, -1 } },
|
||||
{ "CHINON", "CD-ROM CDX-435", "M62 ", "chinon_435", BUS_TYPE_SCSI, 1, 2, 36, 1, { -1, -1, -1, -1 } },
|
||||
{ "DEC", "RRD45 (C) DEC", "0436", "dec_45", BUS_TYPE_SCSI, 1, 4, 36, 0, { -1, -1, -1, -1 } },
|
||||
{ "MATSHITA", "CD-ROM CR-501", "1.0b", "matshita_501", BUS_TYPE_SCSI, 1, 1, 36, 1, { -1, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:25", "1.0a", "nec_25", BUS_TYPE_SCSI, 1, 2, 36, 0, { -1, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:38", "1.00", "nec_38", BUS_TYPE_SCSI, 2, 1, 36, 0, { -1, -1, -1, -1 } },
|
||||
{ "MITSUMI", "CRMC-FX810T4", "????", "mitsumi_810t4", BUS_TYPE_IDE, 0, 8, 36, 0, 0, { 4, 2, 2, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:260", "1.00", "nec_260_early", BUS_TYPE_IDE, 1, 2, 36, 1, 0, { 0, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:260", "1.01", "nec_260", BUS_TYPE_IDE, 1, 4, 36, 1, 0, { 0, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:273", "4.20", "nec_273", BUS_TYPE_IDE, 0, 4, 36, 0, 0, { 0, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:280", "1.05", "nec_280_early", BUS_TYPE_IDE, 0, 6, 36, 1, 0, { 4, 2, 2, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:280", "3.08", "nec_280", BUS_TYPE_IDE, 0, 8, 36, 1, 0, { 4, 2, 2, -1 } },
|
||||
{ "NEC", "CDR-1300A", "1.05", "nec_1300a", BUS_TYPE_IDE, 0, 6, 36, 0, 0, { 4, 2, 2, -1 } },
|
||||
{ "NEC", "CDR-1900A", "1.00", "nec_1900a", BUS_TYPE_IDE, 0, 32, 36, 0, 0, { 4, 2, 2, -1 } },
|
||||
{ "PHILIPS", "CD-ROM PCA403CD", "U31P", "philips_403", BUS_TYPE_IDE, 0, 40, 36, 0, 0, { 4, 2, 2, -1 } },
|
||||
{ "SONY", "CD-ROM CDU76", "1.0i", "sony_76", BUS_TYPE_IDE, 0, 4, 36, 0, 0, { 2, -1, -1, -1 } },
|
||||
{ "SONY", "CD-ROM CDU311", "3.0h", "sony_311", BUS_TYPE_IDE, 0, 8, 36, 0, 0, { 3, 2, 1, -1 } },
|
||||
{ "SONY", "CD-ROM CDU5225", "NYS4", "sony_5225", BUS_TYPE_IDE, 0, 52, 36, 0, 0, { 4, 2, 2, 4 } },
|
||||
{ "TEAC", "CD-516E", "1.0G", "teac_516e", BUS_TYPE_IDE, 0, 16, 36, 0, 0, { 3, 2, 2, -1 } },
|
||||
{ "TEAC", "CD-524EA", "3.0D", "teac_524ea", BUS_TYPE_IDE, 0, 24, 36, 0, 0, { 3, 2, 2, -1 } },
|
||||
{ "TEAC", "CD-532E", "2.0A", "teac_532e", BUS_TYPE_IDE, 0, 32, 36, 0, 0, { 3, 2, 2, -1 } },
|
||||
{ "TOSHIBA", "CD-ROM XM-5302TA", "0305", "toshiba_5302ta", BUS_TYPE_IDE, 0, 4, 96, 0, 0, { 0, -1, -1, -1 } },
|
||||
{ "TOSHIBA", "CD-ROM XM-5702B", "TA70", "toshiba_5702b", BUS_TYPE_IDE, 0, 12, 96, 0, 0, { 3, 2, 1, -1 } },
|
||||
{ "TOSHIBA", "CD-ROM XM-6202B", "1512", "toshiba_6202b", BUS_TYPE_IDE, 0, 32, 96, 0, 0, { 4, 2, 2, -1 } },
|
||||
{ "TOSHIBA", "CD-ROM XM-6402B", "1008", "toshiba_6402b", BUS_TYPE_IDE, 0, 32, 96, 0, 0, { 4, 2, 2, 2 } },
|
||||
{ "TOSHIBA", "CD-ROM XM-6702B", "1007", "toshiba_6720b", BUS_TYPE_IDE, 0, 48, 96, 0, 0, { 4, 2, 2, 2 } },
|
||||
{ "TOSHIBA", "DVD-ROM SD-M1802", "1051", "toshiba_m1802", BUS_TYPE_IDE, 0, 48, 96, 0, 1, { 4, 2, 2, 2 } },
|
||||
{ "CHINON", "CD-ROM CDS-431", "H42 ", "chinon_431", BUS_TYPE_SCSI, 1, 1, 36, 1, 0, { -1, -1, -1, -1 } },
|
||||
{ "CHINON", "CD-ROM CDX-435", "M62 ", "chinon_435", BUS_TYPE_SCSI, 1, 2, 36, 1, 0, { -1, -1, -1, -1 } },
|
||||
{ "DEC", "RRD45 (C) DEC", "0436", "dec_45", BUS_TYPE_SCSI, 1, 4, 36, 0, 0, { -1, -1, -1, -1 } },
|
||||
{ "MATSHITA", "CD-ROM CR-501", "1.0b", "matshita_501", BUS_TYPE_SCSI, 1, 1, 36, 1, 0, { -1, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:25", "1.0a", "nec_25", BUS_TYPE_SCSI, 1, 2, 36, 0, 0, { -1, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:38", "1.00", "nec_38", BUS_TYPE_SCSI, 2, 1, 36, 0, 0, { -1, -1, -1, -1 } },
|
||||
/* The speed of the following two is guesswork based on the CDR-74. */
|
||||
{ "NEC", "CD-ROM DRIVE:75", "1.03", "nec_75", BUS_TYPE_SCSI, 1, 1, 36, 1, { -1, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:77", "1.06", "nec_77", BUS_TYPE_SCSI, 1, 1, 36, 1, { -1, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:211", "1.00", "nec_211", BUS_TYPE_SCSI, 2, 3, 36, 0, { -1, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:75", "1.03", "nec_75", BUS_TYPE_SCSI, 1, 1, 36, 1, 0, { -1, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:77", "1.06", "nec_77", BUS_TYPE_SCSI, 1, 1, 36, 1, 0, { -1, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:211", "1.00", "nec_211", BUS_TYPE_SCSI, 2, 3, 36, 0, 0, { -1, -1, -1, -1 } },
|
||||
/* The speed of the following two is guesswork based on the CDR-400. */
|
||||
{ "NEC", "CD-ROM DRIVE:464", "1.05", "nec_464", BUS_TYPE_SCSI, 2, 3, 36, 0, { -1, -1, -1, -1 } },
|
||||
{ "NEC", "CD-ROM DRIVE:464", "1.05", "nec_464", BUS_TYPE_SCSI, 2, 3, 36, 0, 0, { -1, -1, -1, -1 } },
|
||||
/* The speed of the following two is guesswork based on the name. */
|
||||
{ "ShinaKen", "CD-ROM DM-3x1S", "1.04", "shinaken_3x1s", BUS_TYPE_SCSI, 1, 3, 36, 0, { -1, -1, -1, -1 } },
|
||||
{ "SONY", "CD-ROM CDU-541", "1.0i", "sony_541", BUS_TYPE_SCSI, 1, 1, 36, 1, { -1, -1, -1, -1 } },
|
||||
{ "SONY", "CD-ROM CDU-561", "1.8k", "sony_561", BUS_TYPE_SCSI, 2, 2, 36, 1, { -1, -1, -1, -1 } },
|
||||
{ "SONY", "CD-ROM CDU-76S", "1.00", "sony_76s", BUS_TYPE_SCSI, 2, 4, 36, 0, { -1, -1, -1, -1 } },
|
||||
{ "PHILIPS", "CDD2600", "1.07", "philips_2600", BUS_TYPE_SCSI, 2, 6, 36, 0, { -1, -1, -1, -1 } },
|
||||
{ "ShinaKen", "CD-ROM DM-3x1S", "1.04", "shinaken_3x1s", BUS_TYPE_SCSI, 1, 3, 36, 0, 0, { -1, -1, -1, -1 } },
|
||||
{ "SONY", "CD-ROM CDU-541", "1.0i", "sony_541", BUS_TYPE_SCSI, 1, 1, 36, 1, 0, { -1, -1, -1, -1 } },
|
||||
{ "SONY", "CD-ROM CDU-561", "1.8k", "sony_561", BUS_TYPE_SCSI, 2, 2, 36, 1, 0, { -1, -1, -1, -1 } },
|
||||
{ "SONY", "CD-ROM CDU-76S", "1.00", "sony_76s", BUS_TYPE_SCSI, 2, 4, 36, 0, 0, { -1, -1, -1, -1 } },
|
||||
{ "PHILIPS", "CDD2600", "1.07", "philips_2600", BUS_TYPE_SCSI, 2, 6, 36, 0, 0, { -1, -1, -1, -1 } },
|
||||
/* NOTE: The real thing is a CD changer drive! */
|
||||
{ "PIONEER", "CD-ROM DRM-604X", "2403", "pioneer_604x", BUS_TYPE_SCSI, 2, 4, 47, 0, { -1, -1, -1, -1 } },
|
||||
{ "PLEXTOR", "CD-ROM PX-32TS", "1.03", "plextor_32ts", BUS_TYPE_SCSI, 2, 32, 36, 0, { -1, -1, -1, -1 } },
|
||||
{ "PIONEER", "CD-ROM DRM-604X", "2403", "pioneer_604x", BUS_TYPE_SCSI, 2, 4, 47, 0, 0, { -1, -1, -1, -1 } },
|
||||
{ "PLEXTOR", "CD-ROM PX-32TS", "1.03", "plextor_32ts", BUS_TYPE_SCSI, 2, 32, 36, 0, 0, { -1, -1, -1, -1 } },
|
||||
/* The speed of the following two is guesswork based on the R55S. */
|
||||
{ "TEAC", "CD 50", "1.00", "teac_50", BUS_TYPE_SCSI, 2, 4, 36, 1, { -1, -1, -1, -1 } },
|
||||
{ "TEAC", "CD-ROM R55S", "1.0R", "teac_55s", BUS_TYPE_SCSI, 2, 4, 36, 0, { -1, -1, -1, -1 } },
|
||||
{ "TEAC", "CD 50", "1.00", "teac_50", BUS_TYPE_SCSI, 2, 4, 36, 1, 0, { -1, -1, -1, -1 } },
|
||||
{ "TEAC", "CD-ROM R55S", "1.0R", "teac_55s", BUS_TYPE_SCSI, 2, 4, 36, 0, 0, { -1, -1, -1, -1 } },
|
||||
/* Texel is Plextor according to Plextor's own EU website. */
|
||||
{ "TEXEL", "CD-ROM DM-3024", "1.00", "texel_3024", BUS_TYPE_SCSI, 2, 2, 36, 1, { -1, -1, -1, -1 } },
|
||||
{ "TEXEL", "CD-ROM DM-3024", "1.00", "texel_3024", BUS_TYPE_SCSI, 2, 2, 36, 1, 0, { -1, -1, -1, -1 } },
|
||||
/*
|
||||
Unusual 2.23x according to Google, I'm rounding it upwards to 3x.
|
||||
Assumed caddy based on the DM-3024.
|
||||
*/
|
||||
{ "TEXEL", "CD-ROM DM-3028", "1.06", "texel_3028", BUS_TYPE_SCSI, 2, 3, 36, 1, { -1, -1, -1, -1 } }, /* Caddy. */
|
||||
{ "TEXEL", "CD-ROM DM-3028", "1.06", "texel_3028", BUS_TYPE_SCSI, 2, 3, 36, 1, 0, { -1, -1, -1, -1 } }, /* Caddy. */
|
||||
/*
|
||||
The characteristics are a complete guesswork because I can't find
|
||||
this one on Google.
|
||||
|
||||
Also, INQUIRY length is always 96 on these Toshiba drives.
|
||||
*/
|
||||
{ "TOSHIBA", "CD-ROM DRIVE:XM", "3433", "toshiba_xm", BUS_TYPE_SCSI, 2, 2, 96, 0, { -1, -1, -1, -1 } }, /* Tray. */
|
||||
{ "TOSHIBA", "CD-ROM XM-3201B", "3232", "toshiba_3201b", BUS_TYPE_SCSI, 1, 1, 96, 1, { -1, -1, -1, -1 } }, /* Caddy. */
|
||||
{ "TOSHIBA", "CD-ROM XM-3301TA", "0272", "toshiba_3301ta", BUS_TYPE_SCSI, 2, 2, 96, 0, { -1, -1, -1, -1 } }, /* Tray. */
|
||||
{ "TOSHIBA", "CD-ROM XM-5701TA", "3136", "toshiba_5701a", BUS_TYPE_SCSI, 2, 12, 96, 0, { -1, -1, -1, -1 } }, /* Tray. */
|
||||
{ "TOSHIBA", "DVD-ROM SD-M1401", "1008", "toshiba_m1401", BUS_TYPE_SCSI, 2, 40, 96, 0, { -1, -1, -1, -1 } }, /* Tray. */
|
||||
{ "", "", "", "", BUS_TYPE_NONE, 0, -1, 0, 0, { -1, -1, -1, -1 } }
|
||||
{ "TOSHIBA", "CD-ROM DRIVE:XM", "3433", "toshiba_xm", BUS_TYPE_SCSI, 2, 2, 96, 0, 0, { -1, -1, -1, -1 } }, /* Tray. */
|
||||
{ "TOSHIBA", "CD-ROM XM-3201B", "3232", "toshiba_3201b", BUS_TYPE_SCSI, 1, 1, 96, 1, 0, { -1, -1, -1, -1 } }, /* Caddy. */
|
||||
{ "TOSHIBA", "CD-ROM XM-3301TA", "0272", "toshiba_3301ta", BUS_TYPE_SCSI, 2, 2, 96, 0, 0, { -1, -1, -1, -1 } }, /* Tray. */
|
||||
{ "TOSHIBA", "CD-ROM XM-5701TA", "3136", "toshiba_5701a", BUS_TYPE_SCSI, 2, 12, 96, 0, 0, { -1, -1, -1, -1 } }, /* Tray. */
|
||||
{ "TOSHIBA", "DVD-ROM SD-M1401", "1008", "toshiba_m1401", BUS_TYPE_SCSI, 2, 40, 96, 0, 1, { -1, -1, -1, -1 } }, /* Tray. */
|
||||
{ "MATSHITA", "CR-562", "0.75", "cr562", BUS_TYPE_MKE , 0, 2, 0, 0, 0, { -1, -1, -1, -1 } },
|
||||
{ "MATSHITA", "CR-562", "0.80", "cr562_080", BUS_TYPE_MKE , 0, 2, 0, 0, 0, { -1, -1, -1, -1 } },
|
||||
{ "MATSHITA", "CR-563", "0.75", "cr563", BUS_TYPE_MKE , 0, 2, 0, 0, 0, { -1, -1, -1, -1 } },
|
||||
{ "MATSHITA", "CR-563", "0.80", "cr563_080", BUS_TYPE_MKE , 0, 2, 0, 0, 0, { -1, -1, -1, -1 } },
|
||||
{ "", "", "", "", BUS_TYPE_NONE, 0, -1, 0, 0, 0, { -1, -1, -1, -1 } }
|
||||
};
|
||||
|
||||
/* To shut up the GCC compilers. */
|
||||
@@ -285,7 +297,7 @@ typedef struct cdrom {
|
||||
union {
|
||||
uint8_t res;
|
||||
uint8_t res0; /* Reserved for other ID's. */
|
||||
uint8_t res1;
|
||||
uint8_t mke_channel;
|
||||
uint8_t ide_channel;
|
||||
uint8_t scsi_device_id;
|
||||
};
|
||||
@@ -383,6 +395,7 @@ extern void cdrom_get_model(const int type, char *name, const int id)
|
||||
extern char *cdrom_get_revision(const int type);
|
||||
extern int cdrom_get_scsi_std(const int type);
|
||||
extern int cdrom_is_early(const int type);
|
||||
extern int cdrom_is_dvd(const int type);
|
||||
extern int cdrom_is_generic(const int type);
|
||||
extern int cdrom_is_caddy(const int type);
|
||||
extern int cdrom_get_speed(const int type);
|
||||
@@ -390,6 +403,7 @@ extern int cdrom_get_inquiry_len(const int type);
|
||||
extern int cdrom_has_dma(const int type);
|
||||
extern int cdrom_get_transfer_max(const int type, const int mode);
|
||||
extern int cdrom_get_type_count(void);
|
||||
extern void cdrom_generate_name_mke(const int type, char *name);
|
||||
extern void cdrom_get_identify_model(const int type, char *name, const int id);
|
||||
extern void cdrom_get_name(const int type, char *name);
|
||||
extern char *cdrom_get_internal_name(const int type);
|
||||
@@ -459,7 +473,7 @@ extern void cdrom_reload(const uint8_t id);
|
||||
|
||||
extern void cdrom_compute_ecc_block(cdrom_t *dev, uint8_t *parity, const uint8_t *data,
|
||||
uint32_t major_count, uint32_t minor_count,
|
||||
uint32_t major_mult, uint32_t minor_inc);
|
||||
uint32_t major_mult, uint32_t minor_inc, int m2f1);
|
||||
extern unsigned long cdrom_crc32(unsigned long crc, const unsigned char *buf,
|
||||
size_t len);
|
||||
|
||||
|
||||
@@ -8,11 +8,11 @@
|
||||
*
|
||||
* Mitsumi CD-ROM emulation for the ISA bus.
|
||||
*
|
||||
*
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Jasmine Iwanek, <jriwanek@gmail.com>
|
||||
*
|
||||
* Copyright 2022 Miran Grca.
|
||||
* Copyright 2022 Miran Grca.
|
||||
* Copyright 2024-2025 Jasmine Iwanek.
|
||||
*/
|
||||
#ifndef CDROM_MITSUMI_H
|
||||
#define CDROM_MITSUMI_H
|
||||
|
||||
24
src/include/86box/cdrom_mke.h
Normal file
24
src/include/86box/cdrom_mke.h
Normal file
@@ -0,0 +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.
|
||||
*
|
||||
* Panasonic/MKE CD-ROM emulation for the ISA bus.
|
||||
*
|
||||
* Authors: Miran Grca, <mgrca8@gmail.com>
|
||||
* Cacodemon345
|
||||
*
|
||||
* Copyright 2022-2025 Miran Grca.
|
||||
* Copyright 2025 Cacodemon345.
|
||||
*/
|
||||
|
||||
#ifndef CDROM_MKE_H
|
||||
#define CDROM_MKE_H
|
||||
|
||||
extern const device_t mke_cdrom_device;
|
||||
extern const device_t mke_cdrom_noncreative_device;
|
||||
|
||||
#endif /*CDROM_MKE_H*/
|
||||
@@ -133,7 +133,7 @@ typedef struct config_t {
|
||||
|
||||
/* Other removable devices category */
|
||||
storage_cfg_t cdrom[CDROM_NUM]; /* CD-ROM drives */
|
||||
storage_cfg_t rdisk[ZIP_NUM]; /* Removable disk drives */
|
||||
storage_cfg_t rdisk[RDISK_NUM]; /* Removable disk drives */
|
||||
} config_t;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#define HDC_NONE 0
|
||||
#define HDC_INTERNAL 1
|
||||
|
||||
#define HDC_MAX 2
|
||||
#define HDC_MAX 4
|
||||
|
||||
extern int hdc_current[HDC_MAX];
|
||||
|
||||
@@ -79,6 +79,9 @@ extern const device_t ide_cmd646_device; /* CMD PCI-646 *
|
||||
extern const device_t ide_cmd646_legacy_only_device; /* CMD PCI-646 (Legacy Mode Only) */
|
||||
extern const device_t ide_cmd646_single_channel_device; /* CMD PCI-646 (Only primary channel) */
|
||||
extern const device_t ide_cmd646_ter_qua_device; /* CMD PCI-646 (Tertiary and quaternary channels) */
|
||||
extern const device_t ide_cmd648_ter_qua_device; /* CMD PCI-648 (Tertiary and quaternary channels) */
|
||||
extern const device_t ide_cmd648_ter_qua_onboard_device; /* CMD PCI-648 (Tertiary and quaternary channels, on-board) */
|
||||
extern const device_t ide_cmd649_ter_qua_device; /* CMD PCI-649 (Tertiary and quaternary channels) */
|
||||
|
||||
extern const device_t ide_opti611_vlb_device; /* OPTi 82c611/611A VLB */
|
||||
extern const device_t ide_opti611_vlb_sec_device; /* OPTi 82c611/611A VLB (Secondary channel) */
|
||||
@@ -118,7 +121,7 @@ extern void hdc_init(void);
|
||||
extern void hdc_reset(void);
|
||||
|
||||
extern const char *hdc_get_internal_name(int hdc);
|
||||
extern int hdc_get_from_internal_name(char *s);
|
||||
extern int hdc_get_from_internal_name(const char *s);
|
||||
extern int hdc_has_config(int hdc);
|
||||
extern const device_t *hdc_get_device(int hdc);
|
||||
extern int hdc_get_flags(int hdc);
|
||||
|
||||
@@ -178,9 +178,6 @@ enum {
|
||||
TIMINGS_PIO_FC = 2
|
||||
};
|
||||
|
||||
extern int ide_ter_enabled;
|
||||
extern int ide_qua_enabled;
|
||||
|
||||
#ifdef SCSI_DEVICE_H
|
||||
extern ide_t *ide_get_drive(int ch);
|
||||
extern void ide_irq(ide_t *ide, int set, int log);
|
||||
@@ -230,6 +227,8 @@ extern void ide_padstr8(uint8_t *buf, int buf_size, const char *src);
|
||||
extern uint8_t ide_read_ali_75(void);
|
||||
extern uint8_t ide_read_ali_76(void);
|
||||
|
||||
extern void ide_hard_reset(void);
|
||||
|
||||
/* Legacy #define's. */
|
||||
#define ide_irq_raise(ide) ide_irq(ide, 1, 1)
|
||||
#define ide_irq_lower(ide) ide_irq(ide, 0, 1)
|
||||
|
||||
@@ -56,6 +56,11 @@ typedef struct sff8038i_t
|
||||
int irq_level;
|
||||
int irq_pin;
|
||||
int pci_irq_line;
|
||||
|
||||
uint8_t (*ven_write)(uint16_t port, uint8_t val, void *priv);
|
||||
uint8_t (*ven_read)(uint16_t port, uint8_t val, void *priv);
|
||||
|
||||
void *priv;
|
||||
} sff8038i_t;
|
||||
|
||||
extern const device_t sff8038i_device;
|
||||
@@ -78,4 +83,7 @@ extern void sff_set_irq_pin(sff8038i_t *dev, int irq_pin);
|
||||
extern void sff_set_irq_level(sff8038i_t *dev, int irq_level);
|
||||
extern void sff_set_mirq(sff8038i_t *dev, uint8_t mirq);
|
||||
|
||||
extern void sff_set_ven_handlers(sff8038i_t *dev, uint8_t (*ven_write)(uint16_t port, uint8_t val, void *priv),
|
||||
uint8_t (*ven_read)(uint16_t port, uint8_t val, void *priv), void *priv);
|
||||
|
||||
#endif /*EMU_HDC_IDE_SFF8038I_H*/
|
||||
|
||||
@@ -67,14 +67,15 @@ enum {
|
||||
};
|
||||
#else
|
||||
enum {
|
||||
HDD_BUS_DISABLED = 0,
|
||||
HDD_BUS_MFM = 1,
|
||||
HDD_BUS_XTA = 2,
|
||||
HDD_BUS_ESDI = 3,
|
||||
HDD_BUS_IDE = 4,
|
||||
HDD_BUS_ATAPI = 5,
|
||||
HDD_BUS_SCSI = 6,
|
||||
HDD_BUS_USB = 7
|
||||
HDD_BUS_DISABLED = 0,
|
||||
HDD_BUS_MFM = 1,
|
||||
HDD_BUS_XTA = 2,
|
||||
HDD_BUS_ESDI = 3,
|
||||
HDD_BUS_LPT = 6,
|
||||
HDD_BUS_IDE = 7,
|
||||
HDD_BUS_ATAPI = 8,
|
||||
HDD_BUS_SCSI = 9,
|
||||
HDD_BUS_USB = 10
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -22,6 +22,21 @@
|
||||
#ifndef EMU_KEYBOARD_H
|
||||
#define EMU_KEYBOARD_H
|
||||
|
||||
#define FLAG_AT 0x00 /* dev is AT */
|
||||
#define FLAG_PS2_KBD 0x10 /* dev is AT or PS/2 */
|
||||
#define FLAG_AX 0x08 /* dev is AX */
|
||||
#define FLAG_TYPE_MASK 0x07 /* mask for type */
|
||||
|
||||
enum {
|
||||
KBD_83_KEY = 0,
|
||||
KBD_84_KEY,
|
||||
KBD_101_KEY,
|
||||
KBD_102_KEY,
|
||||
KBD_JIS,
|
||||
KBD_KSC,
|
||||
KBD_ABNT2
|
||||
};
|
||||
|
||||
enum {
|
||||
DEV_KBD = 0,
|
||||
DEV_AUX = 1
|
||||
@@ -38,6 +53,15 @@ enum {
|
||||
DEV_STATE_MAIN_WANT_EXECUTE_BAT = 7
|
||||
};
|
||||
|
||||
enum {
|
||||
KEYBOARD_TYPE_INTERNAL = 0,
|
||||
KEYBOARD_TYPE_PC_XT,
|
||||
KEYBOARD_TYPE_AT,
|
||||
KEYBOARD_TYPE_AX,
|
||||
KEYBOARD_TYPE_PS2,
|
||||
KEYBOARD_TYPE_PS55
|
||||
};
|
||||
|
||||
/* Used by the AT / PS/2 keyboard controller, common device, keyboard, and mouse. */
|
||||
typedef struct kbc_at_port_t {
|
||||
uint8_t wantcmd;
|
||||
@@ -194,6 +218,8 @@ typedef struct scancode {
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int keyboard_type;
|
||||
|
||||
extern uint8_t keyboard_mode;
|
||||
extern int keyboard_scan;
|
||||
|
||||
@@ -216,51 +242,56 @@ extern int mouse_scan;
|
||||
extern kbc_at_port_t *kbc_at_ports[2];
|
||||
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t keyboard_pc_device;
|
||||
extern const device_t keyboard_pc82_device;
|
||||
extern const device_t keyboard_pravetz_device;
|
||||
extern const device_t keyboard_xt_device;
|
||||
extern const device_t keyboard_xt86_device;
|
||||
extern const device_t keyboard_xt_compaq_device;
|
||||
extern const device_t keyboard_xt_t1x00_device;
|
||||
extern const device_t keyboard_tandy_device;
|
||||
extern const device_t keyboard_xt_lxt3_device;
|
||||
extern const device_t keyboard_xt_olivetti_device;
|
||||
extern const device_t keyboard_xt_zenith_device;
|
||||
extern const device_t keyboard_xt_hyundai_device;
|
||||
extern const device_t keyboard_xt_fe2010_device;
|
||||
extern const device_t keyboard_xtclone_device;
|
||||
extern const device_t keyboard_at_device;
|
||||
extern const device_t keyboard_at_ami_device;
|
||||
extern const device_t keyboard_at_compaq_device;
|
||||
extern const device_t keyboard_at_phoenix_device;
|
||||
extern const device_t keyboard_at_ncr_device;
|
||||
extern const device_t keyboard_at_olivetti_device;
|
||||
extern const device_t keyboard_at_siemens_device;
|
||||
extern const device_t keyboard_at_tg_ami_device;
|
||||
extern const device_t keyboard_at_toshiba_device;
|
||||
extern const device_t keyboard_ps2_device;
|
||||
extern const device_t keyboard_ps2_ps1_device;
|
||||
extern const device_t keyboard_ps2_ps1_pci_device;
|
||||
extern const device_t keyboard_ps2_xi8088_device;
|
||||
extern const device_t keyboard_ps2_ami_device;
|
||||
extern const device_t keyboard_ps2_compaq_device;
|
||||
extern const device_t keyboard_ps2_holtek_device;
|
||||
extern const device_t keyboard_ps2_mca_1_device;
|
||||
extern const device_t keyboard_ps2_mca_2_device;
|
||||
extern const device_t keyboard_ps2_olivetti_device;
|
||||
extern const device_t keyboard_ps2_phoenix_device;
|
||||
extern const device_t keyboard_ps2_quadtel_device;
|
||||
extern const device_t keyboard_ps2_tg_ami_device;
|
||||
extern const device_t keyboard_ps2_tg_ami_green_device;
|
||||
extern const device_t keyboard_ps2_pci_device;
|
||||
extern const device_t keyboard_ps2_ami_pci_device;
|
||||
extern const device_t keyboard_ps2_intel_ami_pci_device;
|
||||
extern const device_t keyboard_ps2_acer_pci_device;
|
||||
extern const device_t keyboard_ps2_ali_pci_device;
|
||||
extern const device_t keyboard_ps2_phoenix_pci_device;
|
||||
extern const device_t keyboard_ps2_tg_ami_pci_device;
|
||||
extern const device_t kbc_pc_device;
|
||||
extern const device_t kbc_pc82_device;
|
||||
extern const device_t kbc_pravetz_device;
|
||||
extern const device_t kbc_xt_device;
|
||||
extern const device_t kbc_xt86_device;
|
||||
extern const device_t kbc_xt_compaq_device;
|
||||
extern const device_t kbc_xt_t1x00_device;
|
||||
extern const device_t kbc_tandy_device;
|
||||
extern const device_t kbc_xt_lxt3_device;
|
||||
extern const device_t kbc_xt_olivetti_device;
|
||||
extern const device_t kbc_xt_zenith_device;
|
||||
extern const device_t kbc_xt_hyundai_device;
|
||||
extern const device_t kbc_xt_fe2010_device;
|
||||
extern const device_t kbc_xtclone_device;
|
||||
extern const device_t kbc_at_device;
|
||||
extern const device_t kbc_at_ami_device;
|
||||
extern const device_t kbc_at_compaq_device;
|
||||
extern const device_t kbc_at_phoenix_device;
|
||||
extern const device_t kbc_at_ncr_device;
|
||||
extern const device_t kbc_at_olivetti_device;
|
||||
extern const device_t kbc_at_siemens_device;
|
||||
extern const device_t kbc_at_tg_ami_device;
|
||||
extern const device_t kbc_at_toshiba_device;
|
||||
extern const device_t kbc_ps2_device;
|
||||
extern const device_t kbc_ps2_ps1_device;
|
||||
extern const device_t kbc_ps2_ps1_pci_device;
|
||||
extern const device_t kbc_ps2_xi8088_device;
|
||||
extern const device_t kbc_ps2_ami_device;
|
||||
extern const device_t kbc_ps2_compaq_device;
|
||||
extern const device_t kbc_ps2_holtek_device;
|
||||
extern const device_t kbc_ps2_mca_1_device;
|
||||
extern const device_t kbc_ps2_mca_2_device;
|
||||
extern const device_t kbc_ps2_olivetti_device;
|
||||
extern const device_t kbc_ps2_phoenix_device;
|
||||
extern const device_t kbc_ps2_quadtel_device;
|
||||
extern const device_t kbc_ps2_tg_ami_device;
|
||||
extern const device_t kbc_ps2_tg_ami_green_device;
|
||||
extern const device_t kbc_ps2_pci_device;
|
||||
extern const device_t kbc_ps2_ami_pci_device;
|
||||
extern const device_t kbc_ps2_intel_ami_pci_device;
|
||||
extern const device_t kbc_ps2_acer_pci_device;
|
||||
extern const device_t kbc_ps2_ali_pci_device;
|
||||
extern const device_t kbc_ps2_phoenix_pci_device;
|
||||
extern const device_t kbc_ps2_tg_ami_pci_device;
|
||||
|
||||
extern const device_t keyboard_pc_xt_device;
|
||||
extern const device_t keyboard_at_device;
|
||||
extern const device_t keyboard_ax_device;
|
||||
extern const device_t keyboard_ps2_device;
|
||||
extern const device_t keyboard_ps55_device;
|
||||
extern const device_t keyboard_at_generic_device;
|
||||
#endif /*EMU_DEVICE_H*/
|
||||
|
||||
@@ -303,6 +334,18 @@ extern atkbc_dev_t *kbc_at_dev_init(uint8_t inst);
|
||||
passed on incorrectly. */
|
||||
extern uint16_t convert_scan_code(uint16_t scan_code);
|
||||
|
||||
extern const char * keyboard_get_name(int mouse);
|
||||
extern const char * keyboard_get_internal_name(int mouse);
|
||||
extern int keyboard_get_from_internal_name(char *s);
|
||||
extern int keyboard_has_config(int mouse);
|
||||
#ifdef EMU_DEVICE_H
|
||||
extern const device_t *keyboard_get_device(int mouse);
|
||||
#endif
|
||||
extern int keyboard_get_ndev(void);
|
||||
extern void keyboard_add_device(void);
|
||||
|
||||
extern const scancode scancode_set1[512];
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -85,23 +85,24 @@
|
||||
#define MACHINE_SOFTFLOAT_ONLY 0x00000001 /* sys requires SoftFloat FPU */
|
||||
#define MACHINE_VIDEO 0x00000002 /* sys has int video */
|
||||
#define MACHINE_VIDEO_8514A 0x00000004 /* sys has int video */
|
||||
#define MACHINE_VIDEO_XGA 0x00000008 /* sys has int video */
|
||||
#define MACHINE_VIDEO_ONLY 0x00000010 /* sys has fixed video */
|
||||
#define MACHINE_MOUSE 0x00000020 /* sys has int mouse */
|
||||
#define MACHINE_FDC 0x00000040 /* sys has int FDC */
|
||||
#define MACHINE_LPT_PRI 0x00000080 /* sys has int pri LPT */
|
||||
#define MACHINE_LPT_SEC 0x00000100 /* sys has int sec LPT */
|
||||
#define MACHINE_LPT_TER 0x00000200 /* sys has int ter LPT */
|
||||
#define MACHINE_PS2_KBC 0x00000400 /* sys has a PS/2 keyboard controller */
|
||||
#define MACHINE_VIDEO_ONLY 0x00000008 /* sys has fixed video */
|
||||
#define MACHINE_KEYBOARD 0x00000010 /* sys has int keyboard */
|
||||
#define MACHINE_AX 0x00000020 /* sys adheres to Japanese AX standard */
|
||||
#define MACHINE_KEYBOARD_JIS 0x00000020 /* sys has int keyboard which is Japanese (AX or PS/55) */
|
||||
#define MACHINE_MOUSE 0x00000040 /* sys has int mouse */
|
||||
#define MACHINE_FDC 0x00000080 /* sys has int FDC */
|
||||
#define MACHINE_LPT_PRI 0x00000100 /* sys has int pri LPT */
|
||||
#define MACHINE_LPT_SEC 0x00000200 /* sys has int sec LPT */
|
||||
#define MACHINE_LPT_TER 0x00000400 /* sys has int ter LPT */
|
||||
#define MACHINE_PS2_KBC 0x00000800 /* sys has a PS/2 keyboard controller */
|
||||
/* this is separate from having PS/2 ports */
|
||||
#define MACHINE_UART_PRI 0x00000800 /* sys has int pri UART */
|
||||
#define MACHINE_UART_SEC 0x00001000 /* sys has int sec UART */
|
||||
#define MACHINE_UART_TER 0x00002000 /* sys has int ter UART */
|
||||
#define MACHINE_UART_QUA 0x00004000 /* sys has int qua UART */
|
||||
#define MACHINE_GAMEPORT 0x00008000 /* sys has int game port */
|
||||
#define MACHINE_SOUND 0x00010000 /* sys has int sound */
|
||||
#define MACHINE_NIC 0x00020000 /* sys has int NIC */
|
||||
#define MACHINE_AX 0x00040000 /* sys adheres to Japanese AX standard */
|
||||
#define MACHINE_UART_PRI 0x00010800 /* sys has int pri UART */
|
||||
#define MACHINE_UART_SEC 0x00002000 /* sys has int sec UART */
|
||||
#define MACHINE_UART_TER 0x00004000 /* sys has int ter UART */
|
||||
#define MACHINE_UART_QUA 0x00008000 /* sys has int qua UART */
|
||||
#define MACHINE_GAMEPORT 0x00010000 /* sys has int game port */
|
||||
#define MACHINE_SOUND 0x00020000 /* sys has int sound */
|
||||
#define MACHINE_NIC 0x00040000 /* sys has int NIC */
|
||||
/* Feature flags for advanced devices. */
|
||||
#define MACHINE_APM 0x00080000 /* sys has APM */
|
||||
#define MACHINE_ACPI 0x00100000 /* sys has ACPI */
|
||||
@@ -338,6 +339,7 @@ typedef struct _machine_ {
|
||||
uint32_t gpio_acpi;
|
||||
#ifdef EMU_DEVICE_H
|
||||
const device_t *device;
|
||||
const device_t *kbd_device;
|
||||
const device_t *fdc_device;
|
||||
const device_t *sio_device;
|
||||
const device_t *vid_device;
|
||||
@@ -345,6 +347,7 @@ typedef struct _machine_ {
|
||||
const device_t *net_device;
|
||||
#else
|
||||
void *device;
|
||||
void *kbd_device;
|
||||
void *fdc_device;
|
||||
void *sio_device;
|
||||
void *vid_device;
|
||||
@@ -789,6 +792,7 @@ extern int machine_at_ms5146_init(const machine_t *);
|
||||
extern int machine_at_cb52xsi_init(const machine_t *);
|
||||
|
||||
extern int machine_at_m560_init(const machine_t *);
|
||||
extern int machine_at_m5ata_init(const machine_t *);
|
||||
extern int machine_at_ms5164_init(const machine_t *);
|
||||
|
||||
extern int machine_at_sp97xv_init(const machine_t *);
|
||||
|
||||
@@ -20,7 +20,7 @@ typedef struct dev_status_empty_t {
|
||||
typedef struct machine_status_t {
|
||||
dev_status_empty_active_t fdd[FDD_NUM];
|
||||
dev_status_empty_active_t cdrom[CDROM_NUM];
|
||||
dev_status_empty_active_t zip[ZIP_NUM];
|
||||
dev_status_empty_active_t rdisk[RDISK_NUM];
|
||||
dev_status_empty_active_t mo[MO_NUM];
|
||||
dev_status_empty_active_t cassette;
|
||||
dev_status_active_t hdd[HDD_BUS_USB];
|
||||
|
||||
@@ -84,10 +84,11 @@ static const mo_drive_type_t mo_drive_types[KNOWN_MO_DRIVE_TYPES] = {
|
||||
};
|
||||
|
||||
enum {
|
||||
MO_BUS_DISABLED = 0,
|
||||
MO_BUS_ATAPI = 5,
|
||||
MO_BUS_SCSI = 6,
|
||||
MO_BUS_USB = 7
|
||||
MO_BUS_DISABLED = 0,
|
||||
MO_BUS_LPT = 6,
|
||||
MO_BUS_ATAPI = 8,
|
||||
MO_BUS_SCSI = 9,
|
||||
MO_BUS_USB = 10
|
||||
};
|
||||
|
||||
typedef struct mo_drive_t {
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
|
||||
#define MOUSE_TYPE_NONE 0 /* no mouse configured */
|
||||
#define MOUSE_TYPE_INTERNAL 1 /* achine has internal mouse */
|
||||
#define MOUSE_TYPE_INTERNAL 1 /* machine has internal mouse */
|
||||
#define MOUSE_TYPE_LOGIBUS 2 /* Logitech/ATI Bus Mouse */
|
||||
#define MOUSE_TYPE_INPORT 3 /* Microsoft InPort Mouse */
|
||||
#if 0
|
||||
|
||||
@@ -185,9 +185,9 @@ extern void floppy_mount(uint8_t id, char *fn, uint8_t wp);
|
||||
extern void floppy_eject(uint8_t id);
|
||||
extern void cdrom_mount(uint8_t id, char *fn);
|
||||
extern void plat_cdrom_ui_update(uint8_t id, uint8_t reload);
|
||||
extern void zip_eject(uint8_t id);
|
||||
extern void zip_mount(uint8_t id, char *fn, uint8_t wp);
|
||||
extern void zip_reload(uint8_t id);
|
||||
extern void rdisk_eject(uint8_t id);
|
||||
extern void rdisk_mount(uint8_t id, char *fn, uint8_t wp);
|
||||
extern void rdisk_reload(uint8_t id);
|
||||
extern void mo_eject(uint8_t id);
|
||||
extern void mo_mount(uint8_t id, char *fn, uint8_t wp);
|
||||
extern void mo_reload(uint8_t id);
|
||||
|
||||
@@ -16,29 +16,62 @@
|
||||
* Copyright 2018-2025 Miran Grca.
|
||||
*/
|
||||
|
||||
#ifndef EMU_ZIP_H
|
||||
#define EMU_ZIP_H
|
||||
#ifndef EMU_RDISK_H
|
||||
#define EMU_RDISK_H
|
||||
|
||||
#define ZIP_NUM 4
|
||||
#define RDISK_NUM 4
|
||||
|
||||
#define BUF_SIZE 32768
|
||||
#define BUF_SIZE 32768
|
||||
|
||||
#define ZIP_TIME 10.0
|
||||
#define RDISK_TIME 10.0
|
||||
|
||||
#define ZIP_SECTORS (96 * 2048)
|
||||
#define ZIP_SECTORS (96 * 2048)
|
||||
|
||||
#define ZIP_250_SECTORS (489532)
|
||||
#define ZIP_250_SECTORS (489532)
|
||||
|
||||
#define ZIP_IMAGE_HISTORY 10
|
||||
#define RDISK_IMAGE_HISTORY 10
|
||||
|
||||
enum {
|
||||
ZIP_BUS_DISABLED = 0,
|
||||
ZIP_BUS_ATAPI = 5,
|
||||
ZIP_BUS_SCSI = 6,
|
||||
ZIP_BUS_USB = 7
|
||||
RDISK_TYPE_GENERIC = 0,
|
||||
RDISK_TYPE_ZIP_100,
|
||||
RDISK_TYPE_ZIP_250
|
||||
};
|
||||
|
||||
typedef struct zip_drive_t {
|
||||
typedef struct rdisk_type_t {
|
||||
uint32_t sectors;
|
||||
uint16_t bytes_per_sector;
|
||||
} rdisk_type_t;
|
||||
|
||||
#define KNOWN_RDISK_TYPES 2
|
||||
static const rdisk_type_t rdisk_types[KNOWN_RDISK_TYPES] = {
|
||||
{ ZIP_SECTORS, 512 },
|
||||
{ ZIP_250_SECTORS, 512 },
|
||||
};
|
||||
|
||||
typedef struct rdisk_drive_type_t {
|
||||
const char *vendor;
|
||||
const char *model;
|
||||
const char *revision;
|
||||
int8_t supported_media[KNOWN_RDISK_TYPES];
|
||||
} rdisk_drive_type_t;
|
||||
|
||||
#define KNOWN_RDISK_DRIVE_TYPES 3
|
||||
static const rdisk_drive_type_t rdisk_drive_types[KNOWN_RDISK_DRIVE_TYPES] = {
|
||||
{ "86BOX", "REMOVABLE DISK", "5.00", { 1, 1 }},
|
||||
{ "IOMEGA", "ZIP 100", "E.08", { 1, 0 }},
|
||||
{ "IOMEGA", "ZIP 250", "42.S", { 1, 1 }}
|
||||
};
|
||||
|
||||
enum {
|
||||
RDISK_BUS_DISABLED = 0,
|
||||
RDISK_BUS_LPT = 6,
|
||||
RDISK_BUS_IDE = 7,
|
||||
RDISK_BUS_ATAPI = 8,
|
||||
RDISK_BUS_SCSI = 9,
|
||||
RDISK_BUS_USB = 10
|
||||
};
|
||||
|
||||
typedef struct rdisk_drive_t {
|
||||
uint8_t id;
|
||||
|
||||
union {
|
||||
@@ -64,17 +97,17 @@ typedef struct zip_drive_t {
|
||||
char image_path[1024];
|
||||
char prev_image_path[1024];
|
||||
|
||||
char *image_history[ZIP_IMAGE_HISTORY];
|
||||
char *image_history[RDISK_IMAGE_HISTORY];
|
||||
|
||||
uint32_t is_250;
|
||||
uint32_t type;
|
||||
uint32_t medium_size;
|
||||
uint32_t base;
|
||||
} zip_drive_t;
|
||||
} rdisk_drive_t;
|
||||
|
||||
typedef struct zip_t {
|
||||
typedef struct rdisk_t {
|
||||
mode_sense_pages_t ms_pages_saved;
|
||||
|
||||
zip_drive_t *drv;
|
||||
rdisk_drive_t *drv;
|
||||
#ifdef EMU_IDE_H
|
||||
ide_tf_t *tf;
|
||||
#else
|
||||
@@ -113,37 +146,37 @@ typedef struct zip_t {
|
||||
double callback;
|
||||
|
||||
uint8_t (*ven_cmd)(void *sc, uint8_t *cdb, int32_t *BufLen);
|
||||
} zip_t;
|
||||
} rdisk_t;
|
||||
|
||||
extern zip_t *zip[ZIP_NUM];
|
||||
extern zip_drive_t zip_drives[ZIP_NUM];
|
||||
extern uint8_t atapi_zip_drives[8];
|
||||
extern uint8_t scsi_zip_drives[16];
|
||||
extern rdisk_t *rdisk[RDISK_NUM];
|
||||
extern rdisk_drive_t rdisk_drives[RDISK_NUM];
|
||||
extern uint8_t atapi_rdisk_drives[8];
|
||||
extern uint8_t scsi_rdisk_drives[16];
|
||||
|
||||
#define zip_sense_error dev->sense[0]
|
||||
#define zip_sense_key dev->sense[2]
|
||||
#define zip_info *(uint32_t *) &(dev->sense[3])
|
||||
#define zip_asc dev->sense[12]
|
||||
#define zip_ascq dev->sense[13]
|
||||
#define rdisk_sense_error dev->sense[0]
|
||||
#define rdisk_sense_key dev->sense[2]
|
||||
#define rdisk_info *(uint32_t *) &(dev->sense[3])
|
||||
#define rdisk_asc dev->sense[12]
|
||||
#define rdisk_ascq dev->sense[13]
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void zip_disk_close(const zip_t *dev);
|
||||
extern void zip_disk_reload(const zip_t *dev);
|
||||
extern void zip_insert(zip_t *dev);
|
||||
extern void rdisk_disk_close(const rdisk_t *dev);
|
||||
extern void rdisk_disk_reload(const rdisk_t *dev);
|
||||
extern void rdisk_insert(rdisk_t *dev);
|
||||
|
||||
extern void zip_global_init(void);
|
||||
extern void zip_hard_reset(void);
|
||||
extern void rdisk_global_init(void);
|
||||
extern void rdisk_hard_reset(void);
|
||||
|
||||
extern void zip_reset(scsi_common_t *sc);
|
||||
extern int zip_is_empty(const uint8_t id);
|
||||
extern void zip_load(const zip_t *dev, const char *fn, const int skip_insert);
|
||||
extern void zip_close(void);
|
||||
extern void rdisk_reset(scsi_common_t *sc);
|
||||
extern int rdisk_is_empty(const uint8_t id);
|
||||
extern void rdisk_load(const rdisk_t *dev, const char *fn, const int skip_insert);
|
||||
extern void rdisk_close(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*EMU_ZIP_H*/
|
||||
#endif /*EMU_RDISK_H*/
|
||||
@@ -12,9 +12,11 @@
|
||||
*
|
||||
* Authors: Sarah Walker, <https://pcem-emulator.co.uk/>
|
||||
* Miran Grca, <mgrca8@gmail.com>
|
||||
* Jasmine Iwanek, <jriwanek@gmail.com>
|
||||
*
|
||||
* Copyright 2008-2018 Sarah Walker.
|
||||
* Copyright 2016-2018 Miran Grca.
|
||||
* Copyright 2016-2025 Miran Grca.
|
||||
* Copyright 2024-2025 Jasmine Iwanek.
|
||||
*/
|
||||
|
||||
#ifndef EMU_SOUND_H
|
||||
@@ -132,6 +134,12 @@ extern const device_t cmi8738_device;
|
||||
extern const device_t cmi8738_onboard_device;
|
||||
extern const device_t cmi8738_6ch_onboard_device;
|
||||
|
||||
/* Covox ISA */
|
||||
extern const device_t voicemasterkey_device;
|
||||
extern const device_t soundmasterplus_device;
|
||||
extern const device_t isadacr0_device;
|
||||
extern const device_t isadacr1_device;
|
||||
|
||||
/* Creative Labs Game Blaster */
|
||||
extern const device_t cms_device;
|
||||
|
||||
@@ -214,6 +222,9 @@ extern const device_t pasplus_device;
|
||||
extern const device_t pas16_device;
|
||||
extern const device_t pas16d_device;
|
||||
|
||||
/* Rainbow Arts PC-Soundman */
|
||||
extern const device_t soundman_device;
|
||||
|
||||
/* Tandy PSSJ */
|
||||
extern const device_t pssj_device;
|
||||
extern const device_t pssj_isa_device;
|
||||
|
||||
@@ -49,7 +49,7 @@ extern int ui_msgbox_header(int flags, void *header, void *message);
|
||||
#define SB_CARTRIDGE 0x10
|
||||
#define SB_FLOPPY 0x20
|
||||
#define SB_CDROM 0x30
|
||||
#define SB_ZIP 0x40
|
||||
#define SB_RDISK 0x40
|
||||
#define SB_MO 0x50
|
||||
#define SB_HDD 0x60
|
||||
#define SB_NETWORK 0x70
|
||||
|
||||
@@ -138,7 +138,6 @@ typedef struct svga_t {
|
||||
int ps_bit_bug;
|
||||
int ati_4color;
|
||||
int vblankend;
|
||||
int panning_blank;
|
||||
int render_line_offset;
|
||||
int start_retrace_latch;
|
||||
|
||||
|
||||
@@ -95,7 +95,7 @@ machine_at_init(const machine_t *model)
|
||||
{
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -103,7 +103,7 @@ machine_at_ibm_common_init(const machine_t *model)
|
||||
{
|
||||
machine_at_common_init_ex(model, 1);
|
||||
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
|
||||
mem_remap_top(384);
|
||||
|
||||
@@ -116,7 +116,7 @@ machine_at_ps2_init(const machine_t *model)
|
||||
{
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&keyboard_ps2_device);
|
||||
device_add(&kbc_ps2_device);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -398,7 +398,7 @@ machine_at_siemens_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init_ex(model, 1);
|
||||
|
||||
device_add(&keyboard_at_siemens_device);
|
||||
device_add(&kbc_at_siemens_device);
|
||||
|
||||
mem_remap_top(384);
|
||||
|
||||
@@ -408,19 +408,3 @@ machine_at_siemens_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_wellamerastar_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/wellamerastar/W_3.031_L.BIN",
|
||||
"roms/machines/wellamerastar/W_3.031_H.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_ibm_common_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ machine_at_mr286_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
machine_at_common_ide_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -69,7 +69,7 @@ machine_at_mr286_init(const machine_t *model)
|
||||
static void
|
||||
machine_at_headland_common_init(const machine_t *model, int type)
|
||||
{
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if ((type != 2) && (fdc_current[0] == FDC_INTERNAL))
|
||||
device_add(&fdc_at_device);
|
||||
@@ -136,7 +136,7 @@ machine_at_quadt286_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -159,7 +159,7 @@ machine_at_quadt386sx_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -226,7 +226,7 @@ machine_at_pbl300sx_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
device_add(&acc2036_device);
|
||||
|
||||
device_add(&keyboard_ps2_phoenix_device);
|
||||
device_add(&kbc_ps2_phoenix_device);
|
||||
device_add(&um82c862f_ide_device);
|
||||
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
@@ -274,7 +274,7 @@ machine_at_neat_ami_init(const machine_t *model)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -301,7 +301,7 @@ machine_at_ataripc4_init(const machine_t *model)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -318,7 +318,7 @@ machine_at_px286_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -338,7 +338,7 @@ machine_at_ctat_common_init(const machine_t *model)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_at_phoenix_device);
|
||||
device_add(&kbc_at_phoenix_device);
|
||||
}
|
||||
|
||||
int
|
||||
@@ -391,6 +391,23 @@ machine_at_tuliptc7_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_wellamerastar_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_interleaved("roms/machines/wellamerastar/W_3.031_L.BIN",
|
||||
"roms/machines/wellamerastar/W_3.031_H.BIN",
|
||||
0x000f0000, 65536, 0);
|
||||
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
machine_at_ctat_common_init(model);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
machine_at_scat_init(const machine_t *model, int is_v4, int is_ami)
|
||||
{
|
||||
@@ -398,14 +415,14 @@ machine_at_scat_init(const machine_t *model, int is_v4, int is_ami)
|
||||
|
||||
if (machines[machine].bus_flags & MACHINE_BUS_PS2) {
|
||||
if (is_ami)
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
else
|
||||
device_add(&keyboard_ps2_device);
|
||||
device_add(&kbc_ps2_device);
|
||||
} else {
|
||||
if (is_ami)
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
else
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
}
|
||||
|
||||
if (is_v4)
|
||||
@@ -419,7 +436,7 @@ machine_at_scatsx_init(const machine_t *model)
|
||||
{
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -543,12 +560,12 @@ machine_at_super286c_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&neat_device);
|
||||
device_add(&cs8220_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -585,8 +602,7 @@ machine_at_spc4200p_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 0, 1);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
device_add(&f82c710_device);
|
||||
|
||||
device_add(&ide_isa_device);
|
||||
|
||||
@@ -607,8 +623,7 @@ machine_at_spc4216p_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 1, 1);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
device_add(&f82c710_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -630,8 +645,7 @@ machine_at_spc4620p_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 1, 1);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
device_add(&f82c710_device);
|
||||
|
||||
device_add(&ide_isa_device);
|
||||
|
||||
@@ -667,8 +681,7 @@ machine_at_deskmaster286_init(const machine_t *model)
|
||||
|
||||
machine_at_scat_init(model, 0, 1);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
device_add(&f82c710_device);
|
||||
|
||||
device_add(&ide_isa_device);
|
||||
|
||||
@@ -690,7 +703,7 @@ machine_at_shuttle386sx_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&intel_82335_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -714,7 +727,7 @@ machine_at_adi386sx_init(const machine_t *model)
|
||||
device_add(&amstrad_megapc_nvr_device); /* NVR that is initialized to all 0x00's. */
|
||||
|
||||
device_add(&intel_82335_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -739,7 +752,7 @@ machine_at_wd76c10_init(const machine_t *model)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(¶dise_wd90c11_megapc_device);
|
||||
|
||||
device_add(&keyboard_ps2_quadtel_device);
|
||||
device_add(&kbc_ps2_quadtel_device);
|
||||
|
||||
device_add(&wd76c10_device);
|
||||
|
||||
@@ -760,7 +773,7 @@ machine_at_cmdsl386sx16_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&keyboard_ps2_device);
|
||||
device_add(&kbc_ps2_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -788,7 +801,7 @@ machine_at_if386sx_init(const machine_t *model)
|
||||
machine_at_common_init_ex(model, 2);
|
||||
device_add(&amstrad_megapc_nvr_device); /* NVR that is initialized to all 0x00's. */
|
||||
|
||||
device_add(&keyboard_at_phoenix_device);
|
||||
device_add(&kbc_at_phoenix_device);
|
||||
|
||||
device_add(&neat_sx_device);
|
||||
|
||||
@@ -812,9 +825,9 @@ machine_at_scamp_common_init(const machine_t *model, int is_ps2)
|
||||
machine_at_common_ide_init(model);
|
||||
|
||||
if (is_ps2)
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
else
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -1011,7 +1024,7 @@ machine_at_arb1374_init(const machine_t *model)
|
||||
|
||||
device_add(&ali1217_device);
|
||||
device_add(&w83787f_ide_en_device);
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1032,7 +1045,7 @@ machine_at_sbc350a_init(const machine_t *model)
|
||||
device_add(&ali1217_device);
|
||||
device_add(&ide_isa_device);
|
||||
device_add(&fdc37c665_ide_pri_device);
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1056,7 +1069,7 @@ machine_at_flytech386_init(const machine_t *model)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&tvga8900d_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1076,7 +1089,7 @@ machine_at_325ax_init(const machine_t *model)
|
||||
|
||||
device_add(&ali1217_device);
|
||||
device_add(&fdc_at_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1096,7 +1109,7 @@ machine_at_mr1217_init(const machine_t *model)
|
||||
|
||||
device_add(&ali1217_device);
|
||||
device_add(&fdc_at_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1116,7 +1129,7 @@ machine_at_pja511m_init(const machine_t *model)
|
||||
|
||||
device_add_inst(&fdc37c669_device, 1);
|
||||
device_add_inst(&fdc37c669_device, 2);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&ali6117d_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -1137,7 +1150,7 @@ machine_at_prox1332_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&fdc37c669_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&ali6117d_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -1161,7 +1174,7 @@ machine_at_pc8_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_ncr_device);
|
||||
device_add(&kbc_at_ncr_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -1194,7 +1207,7 @@ machine_at_3302_init(const machine_t *model)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(machine_get_vid_device(machine));
|
||||
|
||||
device_add(&keyboard_at_ncr_device);
|
||||
device_add(&kbc_at_ncr_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1217,7 +1230,7 @@ machine_at_pc916sx_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&keyboard_at_ncr_device);
|
||||
device_add(&kbc_at_ncr_device);
|
||||
mem_remap_top(384);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
@@ -1246,7 +1259,7 @@ machine_at_m290_init(const machine_t *model)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_at_olivetti_device);
|
||||
device_add(&kbc_at_olivetti_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ machine_at_acc386_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&acc2168_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -85,7 +85,7 @@ machine_at_asus3863364k_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&rabbit_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -106,7 +106,7 @@ machine_at_asus386_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&rabbit_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -126,7 +126,8 @@ machine_at_tandy4000_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&cs8230_device);
|
||||
device_add(&kbc_at_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -147,7 +148,7 @@ machine_at_dtk461_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&sl82c461_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -160,7 +161,7 @@ machine_at_sis401_common_init(const machine_t *model)
|
||||
{
|
||||
machine_at_common_init(model);
|
||||
device_add(&sis_85c401_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -211,7 +212,7 @@ machine_at_av4_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&sis_85c460_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -235,7 +236,7 @@ machine_at_valuepoint433_init(const machine_t *model) // hangs without the PS/2
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&et4000w32_onboard_device);
|
||||
|
||||
device_add(&keyboard_ps2_device);
|
||||
device_add(&kbc_ps2_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -261,7 +262,7 @@ machine_at_ecs386_init(const machine_t *model)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -284,7 +285,7 @@ machine_at_spc6000a_init(const machine_t *model)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -302,7 +303,7 @@ machine_at_ecs386v_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&ali1429_device);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&kbc_ps2_intel_ami_pci_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -324,7 +325,7 @@ machine_at_rycleopardlx_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&opti283_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -346,7 +347,7 @@ machine_at_486vchd_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&via_vt82c49x_device);
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -367,7 +368,7 @@ machine_at_cs4031_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&cs4031_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -388,7 +389,7 @@ machine_at_pb410a_init(const machine_t *model)
|
||||
|
||||
machine_at_ibm_common_ide_init(model);
|
||||
|
||||
device_add(&keyboard_ps2_device);
|
||||
device_add(&kbc_ps2_device);
|
||||
|
||||
device_add(&acc3221_device);
|
||||
device_add(&acc2168_device);
|
||||
@@ -533,7 +534,7 @@ machine_at_acera1g_init(const machine_t *model)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&gd5428_onboard_device);
|
||||
|
||||
device_add(&keyboard_ps2_acer_pci_device);
|
||||
device_add(&kbc_ps2_acer_pci_device);
|
||||
|
||||
device_add_params(&pc87310_device, (void *) (PC87310_ALI));
|
||||
device_add(&ide_ali5213_device);
|
||||
@@ -555,7 +556,7 @@ machine_at_acerv10_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&sis_85c461_device);
|
||||
device_add(&keyboard_ps2_acer_pci_device);
|
||||
device_add(&kbc_ps2_acer_pci_device);
|
||||
device_add(&ide_isa_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
@@ -582,7 +583,7 @@ machine_at_decpclpv_init(const machine_t *model)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(machine_get_vid_device(machine));
|
||||
|
||||
device_add(&keyboard_ps2_phoenix_pci_device);
|
||||
device_add(&kbc_ps2_phoenix_pci_device);
|
||||
|
||||
device_add(&ide_isa_2ch_device);
|
||||
device_add(&fdc37c663_ide_device);
|
||||
@@ -613,7 +614,7 @@ machine_at_dell466np_init(const machine_t *model)
|
||||
mem_mapping_set_addr(&bios_mapping, 0x0c0000, 0x40000);
|
||||
mem_mapping_set_exec(&bios_mapping, rom);
|
||||
|
||||
device_add(&keyboard_ps2_phoenix_pci_device);
|
||||
device_add(&kbc_ps2_phoenix_pci_device);
|
||||
|
||||
device_add(&ide_isa_device);
|
||||
device_add(&fdc37c661_ide_device);
|
||||
@@ -631,7 +632,7 @@ machine_at_ali1429_common_init(const machine_t *model, int is_green)
|
||||
else
|
||||
device_add(&ali1429_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -684,7 +685,7 @@ machine_at_opti495_init(const machine_t *model)
|
||||
|
||||
device_add(&opti495slc_device);
|
||||
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -699,7 +700,7 @@ machine_at_opti495_ami_common_init(const machine_t *model)
|
||||
|
||||
device_add(&opti495sx_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -757,7 +758,7 @@ machine_at_c747_init(const machine_t *model)
|
||||
No idea what KBC it actually has but this produces the
|
||||
desired behavior: command A9 does absolutely nothing.
|
||||
*/
|
||||
device_add(&keyboard_at_siemens_device);
|
||||
device_add(&kbc_at_siemens_device);
|
||||
device_add(&um82c862f_ide_device);
|
||||
|
||||
return ret;
|
||||
@@ -777,7 +778,7 @@ machine_at_exp4349_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&ali1429g_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -795,7 +796,7 @@ machine_at_403tg_common_init(const machine_t *model, int nvr_hack)
|
||||
|
||||
device_add(&opti895_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -919,7 +920,7 @@ machine_at_pb450_init(const machine_t *model)
|
||||
device_add(&opti895_device);
|
||||
device_add(&opti602_device);
|
||||
device_add(&opti822_device);
|
||||
device_add(&keyboard_ps2_phoenix_device);
|
||||
device_add(&kbc_ps2_phoenix_device);
|
||||
device_add(&fdc37c665_ide_device);
|
||||
device_add(&ide_opti611_vlb_sec_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
@@ -950,7 +951,7 @@ machine_at_pc330_6573_common_init(const machine_t *model)
|
||||
device_add(&opti602_device);
|
||||
device_add(&opti802g_device);
|
||||
device_add(&opti822_device);
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
device_add(&fdc37c665_ide_device);
|
||||
device_add(&ide_opti611_vlb_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
@@ -1003,7 +1004,7 @@ machine_at_mvi486_init(const machine_t *model)
|
||||
|
||||
device_add(&opti498_device);
|
||||
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
device_add(&pc87311_ide_device);
|
||||
|
||||
return ret;
|
||||
@@ -1032,7 +1033,7 @@ machine_at_ami471_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
machine_at_sis_85c471_common_init(model);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1054,7 +1055,7 @@ machine_at_advantage40xxd_init(const machine_t *model)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(machine_get_vid_device(machine));
|
||||
|
||||
device_add(&keyboard_ps2_phoenix_device);
|
||||
device_add(&kbc_ps2_phoenix_device);
|
||||
device_add(&um82c863f_ide_device);
|
||||
|
||||
device_add(&intel_flash_bxt_device);
|
||||
@@ -1074,7 +1075,7 @@ machine_at_vli486sv2g_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
machine_at_sis_85c471_common_init(model);
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1091,7 +1092,7 @@ machine_at_dtk486_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
machine_at_sis_85c471_common_init(model);
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1109,7 +1110,7 @@ machine_at_px471_init(const machine_t *model)
|
||||
|
||||
machine_at_sis_85c471_common_init(model);
|
||||
device_add(&ide_vlb_device);
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1126,7 +1127,7 @@ machine_at_win471_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
machine_at_sis_85c471_common_init(model);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1151,7 +1152,7 @@ machine_at_pci400ca_init(const machine_t *model)
|
||||
pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
device_add(&sio_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
@@ -1176,7 +1177,7 @@ machine_at_vi15g_init(const machine_t *model)
|
||||
return ret;
|
||||
|
||||
machine_at_sis_85c471_common_init(model);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1199,7 +1200,7 @@ machine_at_greenb_init(const machine_t *model)
|
||||
|
||||
device_add(&contaq_82c597_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1222,7 +1223,7 @@ machine_at_4gpv5_init(const machine_t *model)
|
||||
|
||||
device_add(&contaq_82c596a_device);
|
||||
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1262,7 +1263,7 @@ machine_at_r418_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1288,7 +1289,7 @@ machine_at_m4li_init(const machine_t *model)
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1314,7 +1315,7 @@ machine_at_ls486e_init(const machine_t *model)
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -1340,7 +1341,7 @@ machine_at_4dps_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
|
||||
device_add(&w83787f_device);
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -1367,7 +1368,7 @@ machine_at_ms4144_init(const machine_t *model)
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
|
||||
device_add(&w83787f_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -1396,7 +1397,7 @@ machine_at_acerp3_init(const machine_t *model)
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
|
||||
device_add(&fdc37c665_ide_device);
|
||||
device_add(&keyboard_ps2_acer_pci_device);
|
||||
device_add(&kbc_ps2_acer_pci_device);
|
||||
device_add(&ide_cmd640_pci_legacy_only_device);
|
||||
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
@@ -1427,7 +1428,7 @@ machine_at_486sp3c_init(const machine_t *model)
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -1455,7 +1456,7 @@ machine_at_4saw2_init(const machine_t *model)
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
|
||||
device_add(&w83787f_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -1485,7 +1486,7 @@ machine_at_alfredo_init(const machine_t *model)
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_phoenix_device);
|
||||
device_add(&kbc_ps2_phoenix_device);
|
||||
device_add(&sio_device);
|
||||
device_add(&fdc37c663_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
@@ -1514,7 +1515,7 @@ machine_at_ninja_init(const machine_t *model)
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 1, 2, 1, 2);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 1, 2, 1);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 1, 2, 1);
|
||||
device_add(&keyboard_ps2_phoenix_device);
|
||||
device_add(&kbc_ps2_phoenix_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
device_add(&i420ex_device);
|
||||
@@ -1544,7 +1545,7 @@ machine_at_bat4ip3e_init(const machine_t *model)
|
||||
pci_register_slot(0x0a, PCI_CARD_NORMAL, 1, 2, 1, 2);
|
||||
|
||||
device_add(&phoenix_486_jumper_pci_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&i420ex_device);
|
||||
device_add(&ide_cmd640_pci_device);
|
||||
device_add(&fdc37c665_device);
|
||||
@@ -1571,7 +1572,7 @@ machine_at_486pi_init(const machine_t *model)
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 1, 2, 1);
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 1, 2);
|
||||
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&i420ex_device);
|
||||
|
||||
@@ -1596,7 +1597,7 @@ machine_at_sb486p_init(const machine_t *model)
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 1, 2, 1, 2);
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 1, 2, 1);
|
||||
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&i82091aa_device);
|
||||
device_add(&i420ex_device);
|
||||
|
||||
@@ -1625,7 +1626,7 @@ machine_at_486sp3_init(const machine_t *model)
|
||||
pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 05 = Slot 3 */
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3); /* 06 = Slot 4 */
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_at_ami_device); /* Uses the AMIKEY KBC */
|
||||
device_add(&kbc_at_ami_device); /* Uses the AMIKEY KBC */
|
||||
device_add(&sio_device);
|
||||
device_add(&fdc37c663_ide_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
@@ -1654,7 +1655,7 @@ machine_at_amis76_init(const machine_t *model)
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&sio_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
@@ -1686,7 +1687,7 @@ machine_at_pci400cb_init(const machine_t *model)
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 0E = Slot 2 */
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 0D = Slot 3 */
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 0C = Slot 4 */
|
||||
device_add(&keyboard_ps2_ami_pci_device); /* Assume AMI Megakey 1993 standalone ('P')
|
||||
device_add(&kbc_ps2_ami_pci_device); /* Assume AMI Megakey 1993 standalone ('P')
|
||||
because of the Tekram machine below. */
|
||||
|
||||
device_add(&ims8848_device);
|
||||
@@ -1716,7 +1717,7 @@ machine_at_g486ip_init(const machine_t *model)
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 03 = Slot 1 */
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 04 = Slot 2 */
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 1, 2, 3, 4); /* 05 = Slot 3 */
|
||||
device_add(&keyboard_ps2_ami_pci_device); /* AMI Megakey 1993 stanalone ('P') */
|
||||
device_add(&kbc_ps2_ami_pci_device); /* AMI Megakey 1993 stanalone ('P') */
|
||||
|
||||
device_add(&ims8848_device);
|
||||
|
||||
@@ -1747,7 +1748,7 @@ machine_at_486sp3g_init(const machine_t *model)
|
||||
pci_register_slot(0x05, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 05 = Slot 2 */
|
||||
pci_register_slot(0x04, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 04 = Slot 3 */
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_ami_pci_device); /* Uses the AMIKEY KBC */
|
||||
device_add(&kbc_ps2_ami_pci_device); /* Uses the AMIKEY KBC */
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&pc87332_398_ide_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
@@ -1825,7 +1826,7 @@ machine_at_sb486pv_init(const machine_t *model)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(machine_get_vid_device(machine));
|
||||
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&ide_rz1000_pci_single_channel_device);
|
||||
device_add(&i82091aa_26e_device);
|
||||
@@ -1859,7 +1860,7 @@ machine_at_486ap4_init(const machine_t *model)
|
||||
pci_register_slot(0x0a, PCI_CARD_NORMAL, 2, 3, 4, 1); /* 0a = Slot 2 */
|
||||
pci_register_slot(0x0b, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 0b = Slot 3 */
|
||||
pci_register_slot(0x0c, PCI_CARD_NORMAL, 4, 1, 2, 3); /* 0c = Slot 4 */
|
||||
device_add(&keyboard_ps2_ami_pci_device); /* Uses the AMIKEY KBC */
|
||||
device_add(&kbc_ps2_ami_pci_device); /* Uses the AMIKEY KBC */
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -1892,7 +1893,7 @@ machine_at_g486vpa_init(const machine_t *model)
|
||||
device_add(&via_vt82c49x_pci_ide_device);
|
||||
device_add(&via_vt82c505_device);
|
||||
device_add(&pc87332_398_ide_sec_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
@@ -1921,7 +1922,7 @@ machine_at_486vipio2_init(const machine_t *model)
|
||||
device_add(&via_vt82c49x_pci_ide_device);
|
||||
device_add(&via_vt82c505_device);
|
||||
device_add(&w83787f_ide_sec_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
@@ -1948,7 +1949,7 @@ machine_at_abpb4_init(const machine_t *model)
|
||||
|
||||
device_add(&ali1489_device);
|
||||
device_add(&w83787f_device);
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
#if 0
|
||||
device_add(&intel_flash_bxt_device);
|
||||
#endif
|
||||
@@ -1978,7 +1979,7 @@ machine_at_win486pci_init(const machine_t *model)
|
||||
|
||||
device_add(&ali1489_device);
|
||||
device_add(&prime3b_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -2005,7 +2006,7 @@ machine_at_ms4145_init(const machine_t *model)
|
||||
|
||||
device_add(&ali1489_device);
|
||||
device_add(&w83787f_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
@@ -2037,7 +2038,7 @@ machine_at_sbc490_init(const machine_t *model)
|
||||
|
||||
device_add(&ali1489_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
@@ -2062,7 +2063,7 @@ machine_at_tf486_init(const machine_t *model)
|
||||
|
||||
device_add(&ali1489_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
@@ -2085,7 +2086,7 @@ machine_at_arb1476_init(const machine_t *model)
|
||||
|
||||
device_add(&ali1489_device);
|
||||
device_add(&fdc37c669_device);
|
||||
device_add(&keyboard_ps2_device);
|
||||
device_add(&kbc_ps2_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
return ret;
|
||||
@@ -2109,7 +2110,7 @@ machine_at_itoxstar_init(const machine_t *model)
|
||||
pci_register_slot(0x0C, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x1F, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
device_add(&w83977f_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&stpc_client_device);
|
||||
device_add(&sst_flash_29ee020_device);
|
||||
device_add(&w83781d_device); /* fans: Chassis, CPU, unused; temperatures: Chassis, CPU, unused */
|
||||
@@ -2140,7 +2141,7 @@ machine_at_arb1423c_init(const machine_t *model)
|
||||
pci_register_slot(0x1E, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x1D, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
device_add(&w83977f_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&stpc_consumer2_device);
|
||||
device_add(&winbond_flash_w29c020_device);
|
||||
|
||||
@@ -2167,7 +2168,7 @@ machine_at_arb1479_init(const machine_t *model)
|
||||
pci_register_slot(0x1E, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x1D, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
device_add(&w83977f_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&stpc_consumer2_device);
|
||||
device_add(&winbond_flash_w29c020_device);
|
||||
|
||||
@@ -2191,7 +2192,7 @@ machine_at_iach488_init(const machine_t *model)
|
||||
pci_register_slot(0x0B, PCI_CARD_NORTHBRIDGE, 0, 0, 0, 0);
|
||||
pci_register_slot(0x0C, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&w83977f_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&stpc_consumer2_device);
|
||||
device_add(&sst_flash_29ee020_device);
|
||||
|
||||
@@ -2219,7 +2220,7 @@ machine_at_pcm9340_init(const machine_t *model)
|
||||
pci_register_slot(0x1F, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
device_add_inst(&w83977f_device, 1);
|
||||
device_add_inst(&w83977f_device, 2);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&stpc_elite_device);
|
||||
device_add(&sst_flash_29ee020_device);
|
||||
|
||||
@@ -2247,7 +2248,7 @@ machine_at_pcm5330_init(const machine_t *model)
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
device_add(&stpc_serial_device);
|
||||
device_add(&w83977f_370_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&stpc_atlas_device);
|
||||
device_add(&sst_flash_29ee020_device);
|
||||
|
||||
@@ -2280,7 +2281,7 @@ machine_at_ecs486_init(const machine_t *model)
|
||||
device_add(&ide_cmd640_pci_legacy_only_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -2362,9 +2363,9 @@ machine_at_hot433a_init(const machine_t *model)
|
||||
device_add(&um8669f_device);
|
||||
device_add(&winbond_flash_w29c010_device);
|
||||
if (is_award)
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
else
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
pic_toggle_latch(is_award);
|
||||
|
||||
@@ -2395,7 +2396,7 @@ machine_at_84xxuuda_init(const machine_t *model)
|
||||
device_add(&umc_8886bf_device);
|
||||
device_add(&um8663bf_device);
|
||||
device_add(&winbond_flash_w29c010_device);
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -2426,7 +2427,7 @@ machine_at_pl4600c_init(const machine_t *model)
|
||||
device_add(&umc_8886af_device);
|
||||
device_add(&um8663af_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&gd5430_onboard_pci_device);
|
||||
@@ -2465,7 +2466,7 @@ machine_at_atc1415_init(const machine_t *model)
|
||||
device_add(&umc_hb4_device);
|
||||
device_add(&umc_8886bf_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -2497,7 +2498,7 @@ machine_at_actionpc2600_init(const machine_t *model)
|
||||
device_add(&umc_8886bf_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
device_add(&keyboard_ps2_tg_ami_device);
|
||||
device_add(&kbc_ps2_tg_ami_device);
|
||||
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(machine_get_vid_device(machine));
|
||||
@@ -2530,7 +2531,7 @@ machine_at_actiontower8400_init(const machine_t *model)
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&ide_cmd640_pci_device);
|
||||
device_add(&intel_flash_bxt_device); // The ActionPC 2600 has this so I'm gonna assume this does too.
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(machine_get_vid_device(machine));
|
||||
|
||||
@@ -2561,7 +2562,7 @@ machine_at_m919_init(const machine_t *model)
|
||||
device_add(&umc_8886af_device); /* AF is correct - the BIOS does IDE writes to ports 108h and 109h. */
|
||||
device_add(&um8663bf_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -2590,7 +2591,7 @@ machine_at_spc7700plw_init(const machine_t *model)
|
||||
device_add(&umc_8886af_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -2624,7 +2625,7 @@ machine_at_ms4134_init(const machine_t *model)
|
||||
device_add(&ali1435_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -2657,7 +2658,7 @@ machine_at_tg486gp_init(const machine_t *model)
|
||||
device_add(&ali1435_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
device_add(&keyboard_ps2_tg_ami_device);
|
||||
device_add(&kbc_ps2_tg_ami_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -2678,7 +2679,7 @@ machine_at_tg486g_init(const machine_t *model)
|
||||
device_add(&sis_85c471_device);
|
||||
device_add(&ide_isa_device);
|
||||
device_add(&fdc37c651_ide_device);
|
||||
device_add(&keyboard_ps2_tg_ami_pci_device);
|
||||
device_add(&kbc_ps2_tg_ami_pci_device);
|
||||
|
||||
if (gfxcard[0] != VID_INTERNAL) {
|
||||
for (uint16_t i = 0; i < 32768; i++)
|
||||
@@ -2705,7 +2706,7 @@ machine_at_dvent4xx_init(const machine_t *model)
|
||||
device_add(&sis_85c471_device);
|
||||
device_add(&ide_cmd640_vlb_pri_device);
|
||||
device_add(&fdc37c665_ide_device);
|
||||
device_add(&keyboard_ps2_phoenix_device);
|
||||
device_add(&kbc_ps2_phoenix_device);
|
||||
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(machine_get_vid_device(machine));
|
||||
@@ -2727,7 +2728,7 @@ machine_at_ecsal486_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&ali1429g_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -2750,7 +2751,7 @@ machine_at_ap4100aa_init(const machine_t *model)
|
||||
|
||||
device_add(&ami_1994_nvr_device);
|
||||
device_add(&ali1429g_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&ide_vlb_device);
|
||||
device_add(&um8663bf_device);
|
||||
|
||||
@@ -2770,7 +2771,7 @@ machine_at_atc1762_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&ali1429g_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -2792,7 +2793,7 @@ machine_at_dataexpert386wb_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&opti391_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -2816,7 +2817,7 @@ machine_at_isa486c_init(const machine_t *model)
|
||||
device_add(&isa486c_device);
|
||||
device_add(&port_92_key_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -2840,7 +2841,7 @@ machine_at_genoa486_init(const machine_t *model)
|
||||
device_add(&compaq_genoa_device);
|
||||
device_add(&port_92_key_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -2861,7 +2862,7 @@ machine_at_ga486l_init(const machine_t *model)
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&opti381_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -2887,7 +2888,7 @@ machine_at_cobalt_init(const machine_t *model)
|
||||
device_add(&ide_isa_sec_device);
|
||||
device_add(&fdc37c665_device);
|
||||
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(machine_get_vid_device(machine));
|
||||
@@ -2912,7 +2913,7 @@ machine_at_cougar_init(const machine_t *model)
|
||||
device_add(&opti499_device);
|
||||
device_add(&fdc37c665_ide_pri_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
@@ -133,7 +133,7 @@ machine_at_compaq_init(const machine_t *model, int type)
|
||||
switch (type) {
|
||||
case COMPAQ_PORTABLEII:
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_compaq_device);
|
||||
device_add(&kbc_at_compaq_device);
|
||||
break;
|
||||
|
||||
case COMPAQ_PORTABLEIII:
|
||||
@@ -143,7 +143,7 @@ machine_at_compaq_init(const machine_t *model, int type)
|
||||
device_add(&compaq_plasma_device);
|
||||
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_compaq_device);
|
||||
device_add(&kbc_at_compaq_device);
|
||||
break;
|
||||
|
||||
case COMPAQ_PORTABLEIII386:
|
||||
@@ -153,14 +153,14 @@ machine_at_compaq_init(const machine_t *model, int type)
|
||||
device_add(&compaq_plasma_device);
|
||||
device_add(&compaq_386_device);
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_compaq_device);
|
||||
device_add(&kbc_at_compaq_device);
|
||||
break;
|
||||
|
||||
case COMPAQ_DESKPRO386:
|
||||
case COMPAQ_DESKPRO386_05_1988:
|
||||
device_add(&compaq_386_device);
|
||||
machine_at_common_init(model);
|
||||
device_add(&keyboard_at_compaq_device);
|
||||
device_add(&kbc_at_compaq_device);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -342,7 +342,7 @@ int machine_at_grid1520_init(const machine_t *model) {
|
||||
machine_at_common_ide_init(model);
|
||||
mem_remap_top(384);
|
||||
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
// for now just select CGA with amber monitor
|
||||
//device_add(&cga_device);
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ machine_at_vpc2007_init(const machine_t *model)
|
||||
device_add(&i440bx_no_agp_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&w83977f_370_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 256); /* real VPC provides invalid SPD data */
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@ machine_at_kn97_init(const machine_t *model)
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&i440fx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&w83877f_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
device_add(&lm78_device); /* fans: Chassis, CPU, Power; temperature: MB */
|
||||
@@ -142,7 +142,7 @@ machine_at_lx6_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440lx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83977tf_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 256);
|
||||
@@ -244,7 +244,7 @@ machine_at_ma30d_init(const machine_t *model)
|
||||
device_add(&i440lx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&nec_mate_unk_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c67x_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
@@ -273,7 +273,7 @@ machine_at_p6i440e2_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440ex_device);
|
||||
device_add(&piix4_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83977tf_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x03, 256);
|
||||
@@ -309,7 +309,7 @@ machine_at_p2bls_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83977ef_device);
|
||||
#if 0
|
||||
device_add(ics9xxx_get(ICS9150_08)); /* setting proper speeds requires some interaction with the AS97127F ASIC */
|
||||
@@ -346,7 +346,7 @@ machine_at_lgibmx7g_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83977tf_device);
|
||||
device_add(&winbond_flash_w29c020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
@@ -379,7 +379,7 @@ machine_at_p3bf_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(ics9xxx_get(ICS9250_08));
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
@@ -416,7 +416,7 @@ machine_at_bf6_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
@@ -447,7 +447,7 @@ machine_at_bx6_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&w83977f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 256);
|
||||
@@ -479,7 +479,7 @@ machine_at_ax6bc_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83977tf_device);
|
||||
device_add(&sst_flash_29ee020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
@@ -511,7 +511,7 @@ machine_at_atc6310bxii_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&slc90e66_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
@@ -542,7 +542,7 @@ machine_at_686bx_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83977tf_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 256);
|
||||
@@ -582,7 +582,7 @@ machine_at_p6sba_init(const machine_t *model)
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&w83977tf_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
device_add(&w83781d_device); /* fans: CPU1, CPU2, Thermal Control; temperatures: unused, CPU1, CPU2? */
|
||||
@@ -655,7 +655,7 @@ machine_at_ficka6130_init(const machine_t *model)
|
||||
device_add(&via_apro_device);
|
||||
device_add(&via_vt82c596a_device);
|
||||
device_add(&w83877tf_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_29ee020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
|
||||
@@ -688,7 +688,7 @@ machine_at_p3v133_init(const machine_t *model)
|
||||
device_add(&via_apro133_device);
|
||||
device_add(&via_vt82c596b_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(ics9xxx_get(ICS9248_39));
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 512);
|
||||
@@ -725,7 +725,7 @@ machine_at_p3v4x_init(const machine_t *model)
|
||||
device_add(&via_apro133a_device);
|
||||
device_add(&via_vt82c596b_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(ics9xxx_get(ICS9250_18));
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 512);
|
||||
@@ -758,7 +758,7 @@ machine_at_gt694va_init(const machine_t *model)
|
||||
device_add(&via_apro133a_device);
|
||||
device_add(&via_vt82c596b_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 1024);
|
||||
device_add(&w83782d_device); /* fans: CPU, unused, unused; temperatures: System, CPU1, unused */
|
||||
@@ -796,10 +796,10 @@ machine_at_vei8_init(const machine_t *model)
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&i440zx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&fdc37m60x_370_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(ics9xxx_get(ICS9250_08));
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 512);
|
||||
@@ -828,7 +828,7 @@ machine_at_ms6168_common_init(const machine_t *model)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&voodoo_3_2000_agp_onboard_8m_device);
|
||||
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 256);
|
||||
|
||||
@@ -924,7 +924,7 @@ machine_at_p6f99_init(const machine_t *model)
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x02, PCI_CARD_AGPBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&sis_5600_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&it8661f_device);
|
||||
device_add(&winbond_flash_w29c020_device);
|
||||
|
||||
@@ -957,7 +957,7 @@ machine_at_m747_init(const machine_t *model)
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x02, PCI_CARD_AGPBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&sis_5600_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&it8661f_device);
|
||||
device_add(&winbond_flash_w29c020_device);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ machine_at_6gxu_init(const machine_t *model)
|
||||
|
||||
device_add(&i440gx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 512);
|
||||
@@ -102,7 +102,7 @@ machine_at_s2dge_init(const machine_t *model)
|
||||
|
||||
device_add(&i440gx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83977tf_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 512);
|
||||
|
||||
@@ -64,7 +64,7 @@ machine_at_s370slm_init(const machine_t *model)
|
||||
device_add(&i440lx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&w83977tf_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
device_add(&w83781d_device); /* fans: CPU, Fan 2, Chassis; temperatures: unused, CPU, unused */
|
||||
@@ -99,7 +99,7 @@ machine_at_prosignias31x_bx_init(const machine_t *model)
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&winbond_flash_w29c020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
device_add(&gl520sm_2d_device); /* fans: CPU, Chassis; temperature: System */
|
||||
@@ -139,7 +139,7 @@ machine_at_s1857_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
@@ -177,7 +177,7 @@ machine_at_p6bap_init(const machine_t *model)
|
||||
device_add(&via_apro133a_device); /* Rebranded as ET82C693A */
|
||||
device_add(&via_vt82c596b_device); /* Rebranded as ET82C696B */
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
|
||||
@@ -212,7 +212,7 @@ machine_at_p6bat_init(const machine_t *model)
|
||||
device_add(&via_apro133_device);
|
||||
device_add(&via_vt82c596b_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
|
||||
@@ -248,8 +248,9 @@ machine_at_cubx_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&ide_cmd648_ter_qua_onboard_device);
|
||||
device_add(ics9xxx_get(ICS9250_08));
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 256);
|
||||
@@ -282,7 +283,7 @@ machine_at_atc7020bxii_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&slc90e66_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 256);
|
||||
@@ -314,7 +315,7 @@ machine_at_m773_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i440bx_device);
|
||||
device_add(&slc90e66_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&it8671f_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 256);
|
||||
@@ -355,7 +356,7 @@ machine_at_ambx133_init(const machine_t *model)
|
||||
device_add(&i440bx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
device_add(&gl518sm_2d_device); /* fans: CPUFAN1, CPUFAN2; temperature: CPU */
|
||||
@@ -392,7 +393,7 @@ machine_at_awo671r_init(const machine_t *model)
|
||||
device_add(&piix4e_device);
|
||||
device_add_inst(&w83977ef_device, 1);
|
||||
device_add_inst(&w83977ef_device, 2);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(machine_get_vid_device(machine));
|
||||
@@ -426,7 +427,7 @@ machine_at_63a1_init(const machine_t *model)
|
||||
device_add(&i440zx_device);
|
||||
device_add(&piix4e_device);
|
||||
device_add(&w83977tf_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 256);
|
||||
|
||||
@@ -457,7 +458,7 @@ machine_at_apas3_init(const machine_t *model)
|
||||
device_add(&via_apro_device);
|
||||
device_add(&via_vt82c586b_device);
|
||||
device_add(&fdc37c669_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
|
||||
@@ -491,7 +492,7 @@ machine_at_cuv4xls_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&via_apro133a_device);
|
||||
device_add(&via_vt82c686b_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(ics9xxx_get(ICS9250_18));
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0xF, 1024);
|
||||
@@ -527,7 +528,7 @@ machine_at_6via90ap_init(const machine_t *model)
|
||||
pci_register_slot(0x01, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&via_apro133a_device);
|
||||
device_add(&via_vt82c686b_device); /* fans: CPU1, CPU2; temperatures: CPU, System, unused */
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(ics9xxx_get(ICS9250_18));
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 1024);
|
||||
@@ -562,7 +563,7 @@ machine_at_7sbb_init(const machine_t *model)
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x02, PCI_CARD_AGPBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&sis_5600_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&it8661f_device);
|
||||
device_add(&sst_flash_29ee020_device); /* assumed */
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ machine_at_v12p_init(const machine_t *model)
|
||||
pci_register_slot(0x04, PCI_CARD_NORMAL, 4, 0, 0, 0);
|
||||
pci_register_slot(0x05, PCI_CARD_NORMAL, 0, 0, 0, 0);
|
||||
device_add(&i430lx_device);
|
||||
device_add(&keyboard_ps2_acer_pci_device);
|
||||
device_add(&kbc_ps2_acer_pci_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add_params(&pc87310_device, (void *) (PC87310_ALI));
|
||||
device_add(&amd_am28f010_flash_device);
|
||||
@@ -127,7 +127,7 @@ machine_at_premiere_common_init(const machine_t *model, int pci_switch)
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_phoenix_device);
|
||||
device_add(&kbc_ps2_phoenix_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&ide_rz1000_pci_single_channel_device);
|
||||
device_add(&fdc37c665_ide_sec_device);
|
||||
@@ -152,7 +152,7 @@ machine_at_sp4_common_init(const machine_t *model)
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&sis_85c50x_device);
|
||||
device_add(&ide_cmd640_pci_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
}
|
||||
@@ -178,7 +178,7 @@ machine_at_excaliburpci_init(const machine_t *model)
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&ide_cmd640_pci_legacy_only_device);
|
||||
|
||||
device_add(&i430lx_device);
|
||||
@@ -208,7 +208,7 @@ machine_at_p5mp3_init(const machine_t *model)
|
||||
pci_register_slot(0x03, PCI_CARD_NORMAL, 3, 4, 1, 2); /* 03 = Slot 3 */
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&fdc_at_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&catalyst_flash_device);
|
||||
@@ -243,7 +243,7 @@ machine_at_dellxp60_init(const machine_t *model)
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 2, 1, 3, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430lx_device);
|
||||
device_add(&keyboard_ps2_phoenix_device);
|
||||
device_add(&kbc_ps2_phoenix_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
@@ -274,7 +274,7 @@ machine_at_opti560l_init(const machine_t *model)
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 2, 1, 3, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430lx_device);
|
||||
device_add(&keyboard_ps2_phoenix_device);
|
||||
device_add(&kbc_ps2_phoenix_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&i82091aa_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
@@ -306,7 +306,7 @@ machine_at_ambradp60_init(const machine_t *model)
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_phoenix_device);
|
||||
device_add(&kbc_ps2_phoenix_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&fdc37c665_ide_pri_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
@@ -339,7 +339,7 @@ machine_at_valuepointp60_init(const machine_t *model)
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_ps1_pci_device);
|
||||
device_add(&kbc_ps2_ps1_pci_device);
|
||||
device_add(&sio_device);
|
||||
device_add(&fdc37c665_ide_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
@@ -388,7 +388,7 @@ machine_at_award_common_init(const machine_t *model)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
}
|
||||
@@ -439,7 +439,7 @@ machine_at_pb520r_init(const machine_t *model)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(&gd5434_onboard_pci_device);
|
||||
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&i82091aa_ide_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
@@ -469,7 +469,7 @@ machine_at_m5pi_init(const machine_t *model)
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430lx_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&keyboard_ps2_phoenix_device);
|
||||
device_add(&kbc_ps2_phoenix_device);
|
||||
device_add(&ide_w83769f_pci_single_channel_device);
|
||||
device_add(&fdc37c665_ide_sec_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
@@ -500,7 +500,7 @@ machine_at_globalyst330_p5_init(const machine_t *model)
|
||||
device_add(&opti5x7_pci_device);
|
||||
device_add(&opti822_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -524,7 +524,7 @@ machine_at_excalibur_init(const machine_t *model)
|
||||
device_add(&opti5x7_device);
|
||||
device_add(&ide_opti611_vlb_device);
|
||||
device_add(&fdc37c661_device);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&kbc_ps2_intel_ami_pci_device);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -553,7 +553,7 @@ machine_at_p5vl_init(const machine_t *model)
|
||||
device_add(&opti5x7_pci_device);
|
||||
device_add(&opti822_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -584,7 +584,7 @@ machine_at_excaliburpci2_init(const machine_t *model)
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&ide_cmd640_pci_legacy_only_device);
|
||||
|
||||
device_add(&sis_85c50x_device);
|
||||
|
||||
@@ -106,7 +106,7 @@ machine_at_d842_init(const machine_t *model)
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4); /* Slot 01 */
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 2, 1, 3, 4); /* Slot 02 */
|
||||
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&i430nx_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&fdc37c665_device);
|
||||
@@ -201,7 +201,7 @@ machine_at_p54np4_init(const machine_t *model)
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430nx_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c665_ide_pri_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -246,7 +246,7 @@ machine_at_tek932_init(const machine_t *model)
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x0C, PCI_CARD_NORMAL, 1, 3, 2, 4);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&kbc_ps2_intel_ami_pci_device);
|
||||
device_add(&i430nx_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&ide_vlb_device);
|
||||
@@ -278,7 +278,7 @@ machine_at_acerv30_init(const machine_t *model)
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&keyboard_ps2_acer_pci_device);
|
||||
device_add(&kbc_ps2_acer_pci_device);
|
||||
device_add(&fdc37c665_device);
|
||||
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
@@ -307,7 +307,7 @@ machine_at_apollo_init(const machine_t *model)
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&pc87332_398_device);
|
||||
@@ -343,7 +343,7 @@ machine_at_optiplexgxl_init(const machine_t *model)
|
||||
if (sound_card_current[0] == SOUND_INTERNAL)
|
||||
machine_snd = device_add(machine_get_snd_device(machine));
|
||||
|
||||
device_add(&keyboard_ps2_phoenix_pci_device);
|
||||
device_add(&kbc_ps2_phoenix_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&pc87332_device);
|
||||
@@ -407,7 +407,7 @@ machine_at_zappa_init(const machine_t *model)
|
||||
pci_register_slot(0x0E, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&kbc_ps2_intel_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&pc87306_device);
|
||||
@@ -435,7 +435,7 @@ machine_at_powermatev_init(const machine_t *model)
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 0, 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);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&fdc37c665_device);
|
||||
@@ -464,7 +464,7 @@ machine_at_hawk_init(const machine_t *model)
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_tg_ami_pci_device);
|
||||
device_add(&kbc_ps2_tg_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&fdc37c665_device);
|
||||
@@ -495,7 +495,7 @@ machine_at_pt2000_init(const machine_t *model)
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
/* Should be VIA, but we do not emulate that yet. */
|
||||
device_add(&keyboard_ps2_holtek_device);
|
||||
device_add(&kbc_ps2_holtek_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&pc87332_398_device);
|
||||
@@ -518,7 +518,7 @@ machine_at_pat54pv_init(const machine_t *model)
|
||||
machine_at_common_init(model);
|
||||
|
||||
device_add(&opti5x7_device);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&kbc_ps2_intel_ami_pci_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -548,7 +548,7 @@ machine_at_hot543_init(const machine_t *model)
|
||||
device_add(&opti5x7_pci_device);
|
||||
device_add(&opti822_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&keyboard_at_device);
|
||||
device_add(&kbc_at_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -578,7 +578,7 @@ machine_at_ncselp90_init(const machine_t *model)
|
||||
device_add(&opti5x7_pci_device);
|
||||
device_add(&opti822_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&ide_opti611_vlb_device);
|
||||
device_add(&fdc37c665_ide_sec_device);
|
||||
device_add(&ide_vlb_2ch_device);
|
||||
@@ -626,7 +626,7 @@ machine_at_sq588_init(const machine_t *model)
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&sis_85c50x_device);
|
||||
device_add(&ide_cmd640_pci_single_channel_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c665_ide_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -655,7 +655,7 @@ machine_at_p54sps_init(const machine_t *model)
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&sis_85c50x_device);
|
||||
device_add(&ide_pci_2ch_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
device_add(&w83787f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -686,7 +686,7 @@ machine_at_ms5109_init(const machine_t *model)
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&sis_550x_85c503_device);
|
||||
device_add(&ide_w83769f_pci_device);
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
device_add(&w83787f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -720,7 +720,7 @@ machine_at_torino_init(const machine_t *model)
|
||||
|
||||
device_add(&sis_550x_85c503_device);
|
||||
device_add(&ide_um8673f_device);
|
||||
device_add(&keyboard_ps2_tg_ami_device);
|
||||
device_add(&kbc_ps2_tg_ami_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
@@ -752,7 +752,7 @@ machine_at_hot539_init(const machine_t *model)
|
||||
device_add(&umc_8890_device);
|
||||
device_add(&umc_8886af_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&um8663af_device);
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -111,7 +111,7 @@ machine_at_ap5vm_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430vx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&ncr53c810_onboard_pci_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
@@ -141,7 +141,7 @@ machine_at_p55t2p4_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430hx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&w83877f_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -244,7 +244,7 @@ machine_at_tc430hx_init(const machine_t *model)
|
||||
|
||||
device_add(&i430hx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&pc87306_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
@@ -283,7 +283,7 @@ machine_at_infinia7200_init(const machine_t *model)
|
||||
|
||||
device_add(&i430hx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&pc87306_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
@@ -342,7 +342,7 @@ machine_at_cu430hx_common_init(const machine_t *model)
|
||||
|
||||
device_add(&i430hx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&pc87306_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
}
|
||||
@@ -415,7 +415,7 @@ machine_at_pcv90_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430hx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&pc87306_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
@@ -461,7 +461,7 @@ machine_at_epc2102_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430hx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&kbc_ps2_intel_ami_pci_device);
|
||||
device_add(&i82091aa_device);
|
||||
device_add(&sst_flash_39sf010_device);
|
||||
|
||||
@@ -490,7 +490,7 @@ machine_at_p55tvp4_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430vx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device); // It uses the AMIKEY KBC
|
||||
device_add(&kbc_ps2_ami_pci_device); // It uses the AMIKEY KBC
|
||||
device_add(&w83877f_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -518,7 +518,7 @@ machine_at_5ivg_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430vx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&prime3c_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -547,7 +547,7 @@ machine_at_8500tvxa_init(const machine_t *model)
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 3, 2, 1);
|
||||
device_add(&i430vx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&um8669f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -734,7 +734,7 @@ machine_at_pb680_init(const machine_t *model)
|
||||
|
||||
device_add(&i430vx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&pc87306_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
@@ -794,7 +794,7 @@ machine_at_mb520n_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430vx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c669_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -823,7 +823,7 @@ machine_at_i430vx_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430vx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&um8669f_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -890,7 +890,7 @@ machine_at_ma23c_init(const machine_t *model)
|
||||
device_add(&i430tx_device);
|
||||
device_add(&piix4_device);
|
||||
device_add(&nec_mate_unk_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c67x_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
@@ -926,7 +926,7 @@ machine_at_nupro592_init(const machine_t *model)
|
||||
|
||||
device_add(&i430tx_device);
|
||||
device_add(&piix4_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83977ef_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 128);
|
||||
@@ -963,7 +963,7 @@ machine_at_tx97_init(const machine_t *model)
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
device_add(&i430tx_device);
|
||||
device_add(&piix4_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83877tf_acorp_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 128);
|
||||
@@ -1079,7 +1079,7 @@ machine_at_ym430tx_init(const machine_t *model)
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
device_add(&i430tx_device);
|
||||
device_add(&piix4_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&w83977tf_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 128);
|
||||
@@ -1109,7 +1109,7 @@ machine_at_mb540n_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4); /* PIIX4 */
|
||||
device_add(&i430tx_device);
|
||||
device_add(&piix4_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&um8669f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 128);
|
||||
@@ -1140,7 +1140,7 @@ machine_at_56a5_init(const machine_t *model)
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
device_add(&i430tx_device);
|
||||
device_add(&piix4_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&w83877f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 128);
|
||||
@@ -1170,7 +1170,7 @@ machine_at_p5mms98_init(const machine_t *model)
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&i430tx_device);
|
||||
device_add(&piix4_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83977tf_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 128);
|
||||
@@ -1202,7 +1202,7 @@ machine_at_richmond_init(const machine_t *model)
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&i430tx_device);
|
||||
device_add(&piix4_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&it8671f_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 128);
|
||||
@@ -1235,7 +1235,7 @@ machine_at_tomahawk_init(const machine_t *model)
|
||||
pci_register_slot(0x08, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
device_add(&i430tx_device);
|
||||
device_add(&piix4_device);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&kbc_ps2_intel_ami_pci_device);
|
||||
device_add(&fdc37c67x_device);
|
||||
device_add(&amd_flash_29f020a_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 128);
|
||||
@@ -1276,7 +1276,7 @@ machine_at_ficva502_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&via_vpx_device);
|
||||
device_add(&via_vt82c586b_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&fdc37c669_370_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 256);
|
||||
@@ -1308,7 +1308,7 @@ machine_at_ficpa2012_init(const machine_t *model)
|
||||
|
||||
device_add(&via_vp3_device);
|
||||
device_add(&via_vt82c586b_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&w83877f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 512);
|
||||
@@ -1340,7 +1340,7 @@ machine_at_via809ds_init(const machine_t *model)
|
||||
|
||||
device_add(&via_vp3_device);
|
||||
device_add(&via_vt82c586b_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c669_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 512);
|
||||
@@ -1370,7 +1370,7 @@ machine_at_r534f_init(const machine_t *model)
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
|
||||
device_add(&sis_5571_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83877f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -1399,7 +1399,7 @@ machine_at_ms5146_init(const machine_t *model)
|
||||
pci_register_slot(0x10, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
|
||||
device_add(&sis_5571_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83877f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -1428,7 +1428,7 @@ machine_at_cb52xsi_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
|
||||
device_add(&sis_5571_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c669_370_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -1457,7 +1457,7 @@ machine_at_sp97xv_init(const machine_t *model)
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x13, PCI_CARD_VIDEO, 1, 2, 3, 4); /* On-chip SiS graphics, absent here. */
|
||||
device_add(&sis_5581_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83877f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -1484,7 +1484,7 @@ machine_at_sq578_init(const machine_t *model)
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
device_add(&sis_5581_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83877tf_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -1512,7 +1512,7 @@ machine_at_ms5172_init(const machine_t *model)
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
device_add(&sis_5591_1997_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83877tf_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -1550,6 +1550,35 @@ machine_at_m560_init(const machine_t *model)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_m5ata_init(const machine_t *model)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = bios_load_linear("roms/machines/m5ata/ATA1223.BIN",
|
||||
0x000e0000, 131072, 0);
|
||||
|
||||
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, 1, 2, 3, 4);
|
||||
pci_register_slot(0x02, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x0B, PCI_CARD_SOUTHBRIDGE_IDE, 1, 2, 3, 4);
|
||||
pci_register_slot(0x03, PCI_CARD_NORMAL, 1, 2, 3, 4);
|
||||
pci_register_slot(0x04, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x05, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x06, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
|
||||
device_add(&ali1531_device);
|
||||
device_add(&ali1543_device); /* -5 */
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 64);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
machine_at_ms5164_init(const machine_t *model)
|
||||
{
|
||||
|
||||
@@ -106,7 +106,7 @@ machine_at_thor_common_init(const machine_t *model, int has_video)
|
||||
if (has_video && (gfxcard[0] == VID_INTERNAL))
|
||||
device_add(machine_get_vid_device(machine));
|
||||
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&kbc_ps2_intel_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&pc87306_device);
|
||||
@@ -125,7 +125,7 @@ machine_at_p54tp4xe_common_init(const machine_t *model)
|
||||
pci_register_slot(0x0A, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x09, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&fdc37c665_device);
|
||||
@@ -184,7 +184,7 @@ machine_at_exp8551_init(const machine_t *model)
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&w83787f_device);
|
||||
@@ -359,7 +359,7 @@ machine_at_endeavor_init(const machine_t *model)
|
||||
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(&kbc_ps2_intel_ami_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&pc87306_device);
|
||||
@@ -390,7 +390,7 @@ machine_at_ms5119_init(const machine_t *model)
|
||||
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83787f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -457,7 +457,7 @@ machine_at_pb640_init(const machine_t *model)
|
||||
if (gfxcard[0] == VID_INTERNAL)
|
||||
device_add(machine_get_vid_device(machine));
|
||||
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&kbc_ps2_intel_ami_pci_device);
|
||||
device_add(&pc87306_device);
|
||||
device_add(&intel_flash_bxt_ami_device);
|
||||
|
||||
@@ -484,7 +484,7 @@ machine_at_mb500n_init(const machine_t *model)
|
||||
pci_register_slot(0x12, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_no_mirq_device);
|
||||
device_add(&fdc37c665_device);
|
||||
@@ -516,7 +516,7 @@ machine_at_fmb_init(const machine_t *model)
|
||||
|
||||
device_add(&i430fx_device);
|
||||
device_add(&piix_no_mirq_device);
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
device_add(&w83787f_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -576,7 +576,7 @@ machine_at_ap53_init(const machine_t *model)
|
||||
pci_register_slot(0x06, PCI_CARD_VIDEO, 1, 2, 3, 4);
|
||||
device_add(&i430hx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c669_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -605,7 +605,7 @@ machine_at_8500tuc_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 1, 2, 3, 4);
|
||||
device_add(&i430hx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&um8669f_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -640,7 +640,7 @@ machine_at_d943_init(const machine_t *model)
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 1, 3, 2, 4);
|
||||
device_add(&i430hx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
spd_register(SPD_TYPE_EDO, 0x7, 256);
|
||||
@@ -718,7 +718,7 @@ machine_at_p55t2s_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&i430hx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&pc87306_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -747,7 +747,7 @@ machine_at_p5vxb_init(const machine_t *model)
|
||||
pci_register_slot(0x07, PCI_CARD_SOUTHBRIDGE, 0, 0, 0, 4);
|
||||
device_add(&i430vx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83877f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -854,7 +854,7 @@ machine_at_ap5s_init(const machine_t *model)
|
||||
pci_register_slot(0x13, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
|
||||
device_add(&sis_5511_device);
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -883,7 +883,7 @@ machine_at_ms5124_init(const machine_t *model)
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
|
||||
device_add(&sis_5511_device);
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
device_add(&w83787f_88h_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -912,7 +912,7 @@ machine_at_amis727_init(const machine_t *model)
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
|
||||
device_add(&sis_5511_device);
|
||||
device_add(&keyboard_ps2_intel_ami_pci_device);
|
||||
device_add(&kbc_ps2_intel_ami_pci_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -1016,7 +1016,7 @@ machine_at_5sbm2_init(const machine_t *model)
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 2, 3, 4, 1);
|
||||
pci_register_slot(0x11, PCI_CARD_NORMAL, 3, 4, 1, 2);
|
||||
|
||||
device_add(&keyboard_at_ami_device);
|
||||
device_add(&kbc_at_ami_device);
|
||||
device_add(&sis_550x_device);
|
||||
device_add(&um8663af_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
@@ -1048,7 +1048,7 @@ machine_at_pc140_6260_init(const machine_t *model)
|
||||
device_add(&gd5436_onboard_pci_device);
|
||||
|
||||
device_add(&sis_5511_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c669_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ machine_at_ap61_init(const machine_t *model)
|
||||
device_add(&i450kx_device);
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&ide_cmd646_device);
|
||||
device_add(&keyboard_ps2_acer_pci_device);
|
||||
device_add(&kbc_ps2_acer_pci_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
// device_add(&intel_flash_bxt_device);
|
||||
@@ -100,7 +100,7 @@ machine_at_p6rp4_init(const machine_t *model)
|
||||
device_add(&sio_zb_device);
|
||||
device_add(&ide_cmd646_device);
|
||||
/* Input port bit 2 must be 1 or CMOS Setup is disabled. */
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c665_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -129,7 +129,7 @@ machine_at_686nx_init(const machine_t *model)
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&i440fx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device); // Uses the AMIKEY keyboard controller
|
||||
device_add(&kbc_ps2_ami_pci_device); // Uses the AMIKEY keyboard controller
|
||||
device_add(&um8669f_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -158,7 +158,7 @@ machine_at_mb600n_init(const machine_t *model)
|
||||
pci_register_slot(0x14, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&i440fx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c669_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -217,7 +217,7 @@ machine_at_lgibmx61_init(const machine_t *model)
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&i440fx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_device);
|
||||
device_add(&kbc_ps2_ami_device);
|
||||
device_add(&w83877f_president_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
@@ -392,7 +392,7 @@ machine_at_8600ttc_init(const machine_t *model)
|
||||
pci_register_slot(0x0B, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(&i440fx_device);
|
||||
device_add(&piix3_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&fdc37c669_device);
|
||||
device_add(&intel_flash_bxt_device);
|
||||
|
||||
@@ -442,7 +442,7 @@ machine_at_p65up5_common_init(const machine_t *model, const device_t *northbridg
|
||||
pci_register_slot(0x0D, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
device_add(northbridge);
|
||||
device_add(&piix3_ioapic_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83877f_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
device_add(&ioapic_device);
|
||||
|
||||
@@ -231,7 +231,7 @@ machine_at_ax59pro_init(const machine_t *model)
|
||||
|
||||
device_add(&via_mvp3_device);
|
||||
device_add(&via_vt82c586b_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&w83877tf_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
@@ -262,7 +262,7 @@ machine_at_mvp3_init(const machine_t *model)
|
||||
|
||||
device_add(&via_mvp3_device);
|
||||
device_add(&via_vt82c586b_device);
|
||||
device_add(&keyboard_ps2_pci_device);
|
||||
device_add(&kbc_ps2_pci_device);
|
||||
device_add(&w83877tf_acorp_device);
|
||||
device_add(&sst_flash_39sf010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 256);
|
||||
@@ -294,7 +294,7 @@ machine_at_ficva503a_init(const machine_t *model)
|
||||
|
||||
device_add(&via_mvp3_device);
|
||||
device_add(&via_vt82c686a_device); /* fans: CPU1, Chassis; temperatures: CPU, System, unused */
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
hwm_values.temperatures[0] += 2; /* CPU offset */
|
||||
@@ -332,7 +332,7 @@ machine_at_5emapro_init(const machine_t *model)
|
||||
|
||||
device_add(&via_mvp3_device); /* Rebranded as EQ82C6638 */
|
||||
device_add(&via_vt82c686a_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&sst_flash_39sf010_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x7, 256);
|
||||
device_add(&via_vt82c686_hwm_device); /* fans: CPU1, Chassis; temperatures: CPU, System, unused */
|
||||
@@ -364,7 +364,7 @@ machine_at_delhi3_init(const machine_t *model)
|
||||
|
||||
device_add(&via_mvp3_device);
|
||||
device_add(&via_vt82c596a_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83877tf_device);
|
||||
device_add(&sst_flash_39sf020_device);
|
||||
spd_register(SPD_TYPE_SDRAM, 0x3, 256);
|
||||
@@ -397,7 +397,7 @@ machine_at_5sg100_init(const machine_t *model)
|
||||
pci_register_slot(0x0F, PCI_CARD_NORMAL, 4, 1, 2, 3);
|
||||
pci_register_slot(0x02, PCI_CARD_AGPBRIDGE, 0, 0, 0, 0);
|
||||
device_add(&sis_5591_1997_device);
|
||||
device_add(&keyboard_ps2_ami_pci_device);
|
||||
device_add(&kbc_ps2_ami_pci_device);
|
||||
device_add(&w83877tf_device);
|
||||
device_add(&sst_flash_29ee010_device);
|
||||
|
||||
|
||||
@@ -813,7 +813,7 @@ machine_at_t3100e_init(const machine_t *model)
|
||||
|
||||
machine_at_common_ide_init(model);
|
||||
|
||||
device_add(&keyboard_at_toshiba_device);
|
||||
device_add(&kbc_at_toshiba_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL) {
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
@@ -190,7 +190,7 @@ machine_elt_init(const machine_t *model)
|
||||
/* Keyboard goes after the video, because on XT compatibles it's dealt
|
||||
* with by the same PPI as the config switches and we need them to
|
||||
* indicate the correct display type */
|
||||
device_add(&keyboard_xt_device);
|
||||
device_add(&kbc_xt_device);
|
||||
|
||||
device_add(&elt_nvr_device);
|
||||
|
||||
|
||||
@@ -651,7 +651,7 @@ europc_boot(UNUSED(const device_t *info))
|
||||
jim_read, NULL, NULL, jim_write, NULL, NULL, sys);
|
||||
|
||||
/* Only after JIM has been initialized. */
|
||||
(void) device_add(&keyboard_xt_device);
|
||||
(void) device_add(&kbc_xt_device);
|
||||
|
||||
/* Enable and set up the FDC. */
|
||||
(void) device_add(&fdc_xt_device);
|
||||
|
||||
@@ -394,7 +394,7 @@ ps1_common_init(const machine_t *model)
|
||||
dma16_init();
|
||||
pic2_init();
|
||||
|
||||
device_add(&keyboard_ps2_ps1_device);
|
||||
device_add(&kbc_ps2_ps1_device);
|
||||
device_add(&port_6x_device);
|
||||
|
||||
/* Audio uses ports 200h and 202-207h, so only initialize gameport on 201h. */
|
||||
|
||||
@@ -197,7 +197,7 @@ ps2_isa_common_init(const machine_t *model)
|
||||
dma16_init();
|
||||
pic2_init();
|
||||
|
||||
device_add(&keyboard_ps2_device);
|
||||
device_add(&kbc_ps2_device);
|
||||
device_add(&port_6x_ps2_device);
|
||||
}
|
||||
|
||||
|
||||
@@ -1159,7 +1159,7 @@ ps2_mca_board_model_50_init(void)
|
||||
|
||||
mem_remap_top(384);
|
||||
mca_init(4);
|
||||
device_add(&keyboard_ps2_mca_2_device);
|
||||
device_add(&kbc_ps2_mca_2_device);
|
||||
|
||||
ps2.planar_read = model_50_read;
|
||||
ps2.planar_write = model_50_write;
|
||||
@@ -1180,7 +1180,7 @@ ps2_mca_board_model_60_init(void)
|
||||
|
||||
mem_remap_top(384);
|
||||
mca_init(8);
|
||||
device_add(&keyboard_ps2_mca_2_device);
|
||||
device_add(&kbc_ps2_mca_2_device);
|
||||
|
||||
ps2.planar_read = model_50_read;
|
||||
ps2.planar_write = model_50_write;
|
||||
@@ -1240,7 +1240,7 @@ ps2_mca_board_model_55sx_init(int has_sec_nvram, int slots)
|
||||
}
|
||||
|
||||
mca_init(slots);
|
||||
device_add(&keyboard_ps2_mca_1_device);
|
||||
device_add(&kbc_ps2_mca_1_device);
|
||||
|
||||
if (has_sec_nvram)
|
||||
device_add(&ps2_nvr_55ls_device);
|
||||
@@ -1419,7 +1419,7 @@ ps2_mca_board_model_70_type34_init(int is_type4, int slots)
|
||||
|
||||
ps2.split_addr = mem_size * 1024;
|
||||
mca_init(slots);
|
||||
device_add(&keyboard_ps2_mca_1_device);
|
||||
device_add(&kbc_ps2_mca_1_device);
|
||||
|
||||
ps2.planar_read = model_70_type3_read;
|
||||
ps2.planar_write = model_70_type3_write;
|
||||
@@ -1512,7 +1512,7 @@ ps2_mca_board_model_80_type2_init(void)
|
||||
|
||||
ps2.split_addr = mem_size * 1024;
|
||||
mca_init(8);
|
||||
device_add(&keyboard_ps2_mca_1_device);
|
||||
device_add(&kbc_ps2_mca_1_device);
|
||||
|
||||
ps2.planar_read = model_80_read;
|
||||
ps2.planar_write = model_80_write;
|
||||
@@ -1778,7 +1778,7 @@ ps55_mca_board_model_50t_init(void)
|
||||
ps2.split_addr = mem_size * 1024;
|
||||
/* The slot 5 is reserved for the Integrated Fixed Disk II (an internal ESDI hard drive). */
|
||||
mca_init(5);
|
||||
device_add(&keyboard_ps2_mca_1_device);
|
||||
device_add(&kbc_ps2_mca_1_device);
|
||||
|
||||
ps2.planar_read = ps55_model_50t_read;
|
||||
ps2.planar_write = ps55_model_50tv_write;
|
||||
@@ -1822,7 +1822,7 @@ ps55_mca_board_model_50v_init(void)
|
||||
ps2.split_addr = mem_size * 1024;
|
||||
/* The slot 5 is reserved for the Integrated Fixed Disk II (an internal ESDI hard drive). */
|
||||
mca_init(5);
|
||||
device_add(&keyboard_ps2_mca_1_device);
|
||||
device_add(&kbc_ps2_mca_1_device);
|
||||
|
||||
ps2.planar_read = ps55_model_50v_read;
|
||||
ps2.planar_write = ps55_model_50tv_write;
|
||||
|
||||
@@ -945,7 +945,7 @@ machine_tandy1k_init(const machine_t *model, int type)
|
||||
MEM_MAPPING_INTERNAL, dev);
|
||||
mem_mapping_set_addr(&ram_low_mapping, 0, dev->base);
|
||||
|
||||
device_add(&keyboard_tandy_device);
|
||||
device_add(&kbc_tandy_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_tandy_device);
|
||||
|
||||
@@ -86,7 +86,7 @@ machine_v86p_init(const machine_t *model)
|
||||
device_add(&ct_82c100_device);
|
||||
device_add(&f82c606_device);
|
||||
|
||||
device_add(&keyboard_xt_device);
|
||||
device_add(&kbc_xt_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
|
||||
@@ -160,7 +160,7 @@ machine_pc_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_pc_device);
|
||||
device_add(&kbc_pc_device);
|
||||
|
||||
machine_xt_common_init(model, 0);
|
||||
|
||||
@@ -270,7 +270,7 @@ machine_pc82_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_pc82_device);
|
||||
device_add(&kbc_pc82_device);
|
||||
|
||||
machine_xt_common_init(model, 0);
|
||||
|
||||
@@ -441,7 +441,7 @@ machine_xt_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_xt_device);
|
||||
device_add(&kbc_xt_device);
|
||||
|
||||
machine_xt_common_init(model, 0);
|
||||
|
||||
@@ -462,7 +462,7 @@ machine_genxt_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_xt_device);
|
||||
device_add(&kbc_xt_device);
|
||||
|
||||
machine_xt_common_init(model, 0);
|
||||
|
||||
@@ -619,7 +619,7 @@ machine_xt86_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_xt86_device);
|
||||
device_add(&kbc_xt86_device);
|
||||
|
||||
machine_xt_common_init(model, 0);
|
||||
|
||||
@@ -632,7 +632,7 @@ machine_xt86_init(const machine_t *model)
|
||||
static void
|
||||
machine_xt_clone_init(const machine_t *model, int fixed_floppy)
|
||||
{
|
||||
device_add(&keyboard_xtclone_device);
|
||||
device_add(&kbc_xtclone_device);
|
||||
|
||||
machine_xt_common_init(model, fixed_floppy);
|
||||
}
|
||||
@@ -680,7 +680,7 @@ machine_xt_tuliptc8_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_xt_fe2010_device);
|
||||
device_add(&kbc_xt_fe2010_device);
|
||||
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
@@ -863,7 +863,7 @@ machine_xt_pxxt_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_xt_device);
|
||||
device_add(&kbc_xt_device);
|
||||
|
||||
machine_xt_common_init(model, 0);
|
||||
|
||||
@@ -943,7 +943,7 @@ machine_xt_pravetz16_imko4_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_pravetz_device);
|
||||
device_add(&kbc_pravetz_device);
|
||||
|
||||
machine_xt_common_init(model, 0);
|
||||
|
||||
@@ -961,7 +961,7 @@ machine_xt_pravetz16s_cpu12p_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_xt_device);
|
||||
device_add(&kbc_xt_device);
|
||||
|
||||
machine_xt_common_init(model, 0);
|
||||
|
||||
@@ -979,7 +979,7 @@ machine_xt_micoms_xl7turbo_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_xt_device);
|
||||
device_add(&kbc_xt_device);
|
||||
|
||||
machine_xt_common_init(model, 0);
|
||||
|
||||
@@ -1013,7 +1013,7 @@ machine_xt_mpc1600_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_pc82_device);
|
||||
device_add(&kbc_pc82_device);
|
||||
|
||||
machine_xt_common_init(model, 0);
|
||||
|
||||
@@ -1036,7 +1036,7 @@ machine_xt_pcspirit_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_pc82_device);
|
||||
device_add(&kbc_pc82_device);
|
||||
|
||||
machine_xt_common_init(model, 0);
|
||||
|
||||
@@ -1054,7 +1054,7 @@ machine_xt_pc700_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_pc_device);
|
||||
device_add(&kbc_pc_device);
|
||||
|
||||
machine_xt_common_init(model, 0);
|
||||
|
||||
@@ -1072,7 +1072,7 @@ machine_xt_pc500_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_pc_device);
|
||||
device_add(&kbc_pc_device);
|
||||
|
||||
machine_xt_common_init(model, 0);
|
||||
|
||||
@@ -1146,7 +1146,7 @@ machine_xt_vendex_init(const machine_t *model)
|
||||
static void
|
||||
machine_xt_hyundai_common_init(const machine_t *model, int fixed_floppy)
|
||||
{
|
||||
device_add(&keyboard_xt_hyundai_device);
|
||||
device_add(&kbc_xt_hyundai_device);
|
||||
|
||||
machine_xt_common_init(model, fixed_floppy);
|
||||
}
|
||||
@@ -1294,7 +1294,7 @@ machine_xt_glabios_init(const machine_t *model)
|
||||
if (bios_only || !ret)
|
||||
return ret;
|
||||
|
||||
device_add(&keyboard_xt_device);
|
||||
device_add(&kbc_xt_device);
|
||||
|
||||
machine_xt_common_init(model, 0);
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ machine_xt_compaq_deskpro_init(const machine_t *model)
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
device_add(&keyboard_xt_compaq_device);
|
||||
device_add(&kbc_xt_compaq_device);
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
nmi_init();
|
||||
@@ -79,7 +79,7 @@ machine_xt_compaq_portable_init(const machine_t *model)
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
device_add(&keyboard_xt_compaq_device);
|
||||
device_add(&kbc_xt_compaq_device);
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_xt_device);
|
||||
nmi_init();
|
||||
|
||||
@@ -468,7 +468,7 @@ machine_xt_laserxt_common_init(const machine_t *model,int is_lxt3)
|
||||
|
||||
device_add(is_lxt3 ? &lxt3_device : &laserxt_device);
|
||||
|
||||
device_add(&keyboard_xt_lxt3_device);
|
||||
device_add(&kbc_xt_lxt3_device);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -2451,7 +2451,7 @@ machine_xt_m19_init(const machine_t *model)
|
||||
m19_vid_init(vid);
|
||||
device_add_ex(&m19_vid_device, vid);
|
||||
|
||||
device_add(&keyboard_xt_olivetti_device);
|
||||
device_add(&kbc_xt_olivetti_device);
|
||||
|
||||
pit_set_clock((uint32_t) 14318184.0);
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ machine_xt_philips_common_init(const machine_t *model)
|
||||
|
||||
standalone_gameport_type = &gameport_200_device;
|
||||
|
||||
device_add(&keyboard_pc_device);
|
||||
device_add(&kbc_pc_device);
|
||||
|
||||
device_add(&philips_device);
|
||||
|
||||
|
||||
@@ -899,7 +899,7 @@ machine_xt_t1000_init(const machine_t *model)
|
||||
machine_common_init(model);
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
device_add(&keyboard_xt_t1x00_device);
|
||||
device_add(&kbc_xt_t1x00_device);
|
||||
t1000.fdc = device_add(&fdc_xt_device);
|
||||
nmi_init();
|
||||
|
||||
@@ -957,7 +957,7 @@ machine_xt_t1200_init(const machine_t *model)
|
||||
NULL, MEM_MAPPING_EXTERNAL, &t1000);
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
device_add(&keyboard_xt_t1x00_device);
|
||||
device_add(&kbc_xt_t1x00_device);
|
||||
t1000.fdc = device_add(&fdc_xt_t1x00_device);
|
||||
nmi_init();
|
||||
|
||||
|
||||
@@ -110,11 +110,11 @@ static const device_config_t xi8088_config[] = {
|
||||
.type = CONFIG_SELECTION,
|
||||
.selection = {
|
||||
{
|
||||
.description = "64 kB starting from F0000",
|
||||
.description = "64 KB starting from F0000",
|
||||
.value = 0
|
||||
},
|
||||
{
|
||||
.description = "128 kB starting from E0000 (address MSB inverted, last 64KB first)",
|
||||
.description = "128 KB starting from E0000 (address MSB inverted, last 64 KB first)",
|
||||
.value = 1
|
||||
}
|
||||
},
|
||||
@@ -204,7 +204,7 @@ machine_xt_xi8088_init(const machine_t *model)
|
||||
if (fdc_current[0] == FDC_INTERNAL)
|
||||
device_add(&fdc_at_device);
|
||||
|
||||
device_add(&keyboard_ps2_xi8088_device);
|
||||
device_add(&kbc_ps2_xi8088_device);
|
||||
device_add(&port_6x_xi8088_device);
|
||||
nmi_init();
|
||||
device_add(&ibmat_nvr_device);
|
||||
|
||||
@@ -117,7 +117,7 @@ machine_zenith_init(const machine_t *model)
|
||||
|
||||
pit_devs[0].set_out_func(pit_devs[0].data, 1, pit_refresh_timer_xt);
|
||||
|
||||
device_add(&keyboard_xt_zenith_device);
|
||||
device_add(&kbc_xt_zenith_device);
|
||||
|
||||
nmi_init();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
#include <86box/cartridge.h>
|
||||
#include <86box/cassette.h>
|
||||
#include <86box/cdrom.h>
|
||||
#include <86box/zip.h>
|
||||
#include <86box/rdisk.h>
|
||||
#include <86box/mo.h>
|
||||
#include <86box/hdd.h>
|
||||
#include <86box/thread.h>
|
||||
@@ -36,9 +36,9 @@ machine_status_init(void)
|
||||
machine_status.cdrom[i].empty = (strlen(cdrom[i].image_path) == 0);
|
||||
machine_status.cdrom[i].active = false;
|
||||
}
|
||||
for (size_t i = 0; i < ZIP_NUM; i++) {
|
||||
machine_status.zip[i].empty = (strlen(zip_drives[i].image_path) == 0);
|
||||
machine_status.zip[i].active = false;
|
||||
for (size_t i = 0; i < RDISK_NUM; i++) {
|
||||
machine_status.rdisk[i].empty = (strlen(rdisk_drives[i].image_path) == 0);
|
||||
machine_status.rdisk[i].active = false;
|
||||
}
|
||||
for (size_t i = 0; i < MO_NUM; i++) {
|
||||
machine_status.mo[i].empty = (strlen(mo_drives[i].image_path) == 0);
|
||||
|
||||
@@ -721,7 +721,7 @@ static const device_config_t threec503_config[] = {
|
||||
},
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0xCC000,
|
||||
|
||||
@@ -1412,7 +1412,7 @@ static const device_config_t ne2000_config[] = {
|
||||
},
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
@@ -1510,7 +1510,7 @@ static const device_config_t ne2000_compat_config[] = {
|
||||
},
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
@@ -1602,7 +1602,7 @@ static const device_config_t ne2000_compat_8bit_config[] = {
|
||||
},
|
||||
{
|
||||
.name = "bios_addr",
|
||||
.description = "BIOS Address",
|
||||
.description = "BIOS address",
|
||||
.type = CONFIG_HEX20,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
|
||||
@@ -693,6 +693,13 @@ picint_common(uint16_t num, int level, int set, uint8_t *irq_state)
|
||||
uint16_t lines = level ? 0x0000 : num;
|
||||
pic_t *dev;
|
||||
|
||||
/*
|
||||
Do this because some emulated cards will, for whatever reason, attempt to
|
||||
raise an IRQ at init when the PIC has not yet been properly initialized.
|
||||
*/
|
||||
if (update_pending == NULL)
|
||||
return;
|
||||
|
||||
/* Make sure to ignore all slave IRQ's, and in case of AT+,
|
||||
translate IRQ 2 to IRQ 9. */
|
||||
for (uint8_t i = 0; i < 8; i++) {
|
||||
|
||||
@@ -2097,7 +2097,7 @@ escp_close(void *priv)
|
||||
}
|
||||
|
||||
const lpt_device_t lpt_prt_escp_device = {
|
||||
.name = "Generic ESC/P Dot-Matrix",
|
||||
.name = "Generic ESC/P Dot-Matrix Printer",
|
||||
.internal_name = "dot_matrix",
|
||||
.init = escp_init,
|
||||
.close = escp_close,
|
||||
|
||||
@@ -88,6 +88,8 @@ add_library(ui STATIC
|
||||
qt_openglrenderer.cpp
|
||||
qt_openglrenderer.hpp
|
||||
qt_glsl_parser.cpp
|
||||
qt_about.cpp
|
||||
qt_about.hpp
|
||||
|
||||
qt_settings.cpp
|
||||
qt_settings.hpp
|
||||
@@ -187,14 +189,6 @@ add_library(ui STATIC
|
||||
qt_mediahistorymanager.cpp
|
||||
qt_mediahistorymanager.hpp
|
||||
|
||||
qt_updatecheck.cpp
|
||||
qt_updatecheck.hpp
|
||||
qt_updatecheckdialog.cpp
|
||||
qt_updatecheckdialog.hpp
|
||||
qt_updatecheckdialog.ui
|
||||
qt_updatedetails.cpp
|
||||
qt_updatedetails.hpp
|
||||
qt_updatedetails.ui
|
||||
qt_downloader.cpp
|
||||
qt_downloader.hpp
|
||||
|
||||
@@ -245,6 +239,19 @@ add_library(ui STATIC
|
||||
qt_iconindicators.cpp
|
||||
)
|
||||
|
||||
if(EMU_BUILD_NUM)
|
||||
target_sources(ui PRIVATE
|
||||
qt_updatecheck.cpp
|
||||
qt_updatecheck.hpp
|
||||
qt_updatecheckdialog.cpp
|
||||
qt_updatecheckdialog.hpp
|
||||
qt_updatecheckdialog.ui
|
||||
qt_updatedetails.cpp
|
||||
qt_updatedetails.hpp
|
||||
qt_updatedetails.ui
|
||||
)
|
||||
endif()
|
||||
|
||||
if(RTMIDI)
|
||||
target_compile_definitions(ui PRIVATE USE_RTMIDI)
|
||||
endif()
|
||||
@@ -284,6 +291,15 @@ if(WIN32 AND NOT SDL_JOYSTICK)
|
||||
target_sources(plat PRIVATE win_joystick_rawinput.c)
|
||||
target_link_libraries(86Box hid)
|
||||
else()
|
||||
find_package(SDL2 REQUIRED)
|
||||
include_directories(${SDL2_INCLUDE_DIRS})
|
||||
if(STATIC_BUILD AND TARGET SDL2::SDL2-static)
|
||||
target_link_libraries(86Box SDL2::SDL2-static)
|
||||
elseif(TARGET SDL2::SDL2)
|
||||
target_link_libraries(86Box SDL2::SDL2)
|
||||
else()
|
||||
target_link_libraries(86Box ${SDL2_LIBRARIES})
|
||||
endif()
|
||||
target_sources(plat PRIVATE sdl_joystick.c)
|
||||
endif()
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 9.4 KiB After Width: | Height: | Size: 9.4 KiB |
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user