diff --git a/src/cdrom/cdrom.c b/src/cdrom/cdrom.c index 70082af35..0508e4bba 100644 --- a/src/cdrom/cdrom.c +++ b/src/cdrom/cdrom.c @@ -9,7 +9,7 @@ * Implementation of the CD-ROM drive with SCSI(-like) * commands, for both ATAPI and SCSI usage. * - * Version: @(#)cdrom.c 1.0.7 2017/09/29 + * Version: @(#)cdrom.c 1.0.8 2017/09/30 * * Author: Miran Grca, * Copyright 2016,2017 Miran Grca. @@ -22,11 +22,12 @@ #include #include "../86box.h" #include "../ibm.h" +#include "../timer.h" +#include "../device.h" #include "../piix.h" #include "../scsi/scsi.h" -#include "../timer.h" #include "../nvr.h" -#include "../hdd/hdd.h" +#include "../hdd/hdc.h" #include "../hdd/hdc_ide.h" #include "../win/plat_iodev.h" #include "cdrom.h" diff --git a/src/config.c b/src/config.c index 4c8b24720..6541f473e 100644 --- a/src/config.c +++ b/src/config.c @@ -8,7 +8,7 @@ * * Configuration file handler. * - * Version: @(#)config.c 1.0.7 2017/09/29 + * Version: @(#)config.c 1.0.8 2017/09/30 * * Authors: Sarah Walker, * Miran Grca, @@ -801,10 +801,14 @@ load_other_peripherals(void) if (p != NULL) config_delete_var(cat, "hdd_controller"); } - if (p != NULL) - strcpy(hdc_name, p); - else - strcpy(hdc_name, "none"); + if (p == NULL) { + if (machines[machine].flags & MACHINE_HAS_HDC) + strcpy(hdc_name, "internal"); + else + strcpy(hdc_name, "none"); + } else + strcpy(hdc_name, p); + config_set_string(cat, "hdc", hdc_name); memset(temp, '\0', sizeof(temp)); for (c = 2; c < 4; c++) @@ -1181,7 +1185,7 @@ load_hard_disks(void) * with the CFG path. Just strip * that off for now... */ - wcscpy((wchar_t *)hdc[c].fn, &wp[wcslen(cfg_path)]); + wcscpy((wchar_t *)hdd[c].fn, &wp[wcslen(cfg_path)]); } else #endif memcpy(hdd[c].fn, wp, (wcslen(wp) << 1) + 2); @@ -1998,14 +2002,7 @@ save_other_peripherals(void) config_set_string(cat, "scsicard", scsi_card_get_internal_name(scsi_card_current)); } - if (!strcmp(hdc_name, "none")) - { - config_delete_var(cat, "hdc"); - } - else - { - config_set_string(cat, "hdc", hdc_name); - } + config_set_string(cat, "hdc", hdc_name); memset(temps, '\0', sizeof(temps)); for (c = 2; c < 4; c++) @@ -2043,7 +2040,6 @@ save_hard_disks(void) char *cat = "Hard disks"; char temps[24]; char temps2[64]; - char s[512]; int c; char *p; @@ -2051,7 +2047,6 @@ save_hard_disks(void) for (c = 0; c < HDD_NUM; c++) { sprintf(temps, "hdd_%02i_parameters", c+1); - memset(s, 0, sizeof(s)); if (! hdd_is_valid(c)) { config_delete_var(cat, temps); @@ -2310,8 +2305,9 @@ config_dump(void) while (sec != NULL) { entry_t *ent; - - pclog("[%s]\n", sec->name); + + if (sec->name && sec->name[0]) + pclog("[%s]\n", sec->name); ent = (entry_t *)sec->entry_head.next; diff --git a/src/hdd/hdc.c b/src/hdd/hdc.c index 647f73187..51cc7b432 100644 --- a/src/hdd/hdc.c +++ b/src/hdd/hdc.c @@ -8,7 +8,7 @@ * * Common code to handle all sorts of disk controllers. * - * Version: @(#)hdc.c 1.0.1 2017/09/29 + * Version: @(#)hdc.c 1.0.2 2017/09/30 * * Authors: Miran Grca, * Fred N. van Kempen, @@ -50,6 +50,26 @@ static device_t null_device = { }; +static void * +inthdc_init(void) +{ + return(NULL); +} + + +static void +inthdc_close(void *priv) +{ +} + + +static device_t inthdc_device = { + "Internal Controller", 0, + inthdc_init, inthdc_close, + NULL, NULL, NULL, NULL, NULL +}; + + static struct { char name[50]; char internal_name[16]; @@ -60,23 +80,31 @@ static struct { &null_device, 0 }, { "Internal Controller", "internal", - &null_device, 0 }, + &inthdc_device, 0 }, - { "IBM PC Fixed Disk Adapter (MFM,Xebec)", "mfm_xebec", + { "[MFM] IBM PC Fixed Disk Adapter", "mfm_xebec", &mfm_xt_xebec_device, 1 }, - { "PC DTC-5150X Fixed Disk Adapter (MFM)", "dtc5150x", + { "[MFM] DTC-5150X Fixed Disk Adapter", "mfm_dtc5150x", &mfm_xt_dtc5150x_device, 1 }, - { "IBM PC/AT Fixed Disk Adapter (WD1003)", "mfm_at", + { "[MFM] IBM PC/AT Fixed Disk Adapter", "mfm_at", &mfm_at_wd1003_device, 1 }, - { "PC/AT ESDI Fixed Disk Adapter (WD1007V-SE1)", "wd1007vse1", + { "[ESDI] PC/AT ESDI Fixed Disk Adapter", "esdi_wd1007vse1", &esdi_at_wd1007vse1_device, 0 }, - { "IBM PS/2 ESDI Fixed Disk Adapter (ESDI)","esdi_mca", + { "[ESDI] IBM PS/2 ESDI Fixed Disk Adapter","esdi_mca", &esdi_ps2_device, 1 }, +#if 0 + { "[IDE] PC/AT IDE Adapter", "ide_isa", + &ide_isa_device, 0 }, + + { "[IDE] PCI IDE Adapter", "ide_pci", + &ide_pci_device, 0 }, +#endif + { "[IDE] PC/XT XTIDE", "xtide", &xtide_device , 0 }, @@ -129,17 +157,27 @@ hdc_current_is_mfm(void) void -hdc_init(char *name) +hdc_init(void) +{ + pclog("HDC: initializing..\n"); + + hdc_current = 0; +} + + +void +hdc_reset(char *name) { int c; - if (machines[machine].flags & MACHINE_HAS_IDE) return; + pclog("HDC: reset(name='%s', internal=%d)\n", name, + (machines[machine].flags & MACHINE_HAS_HDC)?1:0); for (c=0; controllers[c].device; c++) { if (! strcmp(name, controllers[c].internal_name)) { hdc_current = c; - if (strcmp(name, "none")) { + if (strcmp(name, "none") && strcmp(name, "internal")) { device_add(controllers[c].device); return; diff --git a/src/hdd/hdc.h b/src/hdd/hdc.h index d73c315d0..fac94df1e 100644 --- a/src/hdd/hdc.h +++ b/src/hdd/hdc.h @@ -8,7 +8,7 @@ * * Definitions for the common disk controller handler. * - * Version: @(#)hdc.h 1.0.1 2017/09/29 + * Version: @(#)hdc.h 1.0.3 2017/09/30 * * Authors: Miran Grca, * Fred N. van Kempen, @@ -19,6 +19,14 @@ # define EMU_HDC_H +#define MFM_NUM 2 /* 2 drives per controller supported */ +#define ESDI_NUM 2 /* 2 drives per controller supported */ +#define XTIDE_NUM 2 /* 2 drives per controller supported */ +#define IDE_NUM 8 +#define SCSI_NUM 16 /* theoretically the controller can have at + * least 7 devices, with each device being + * able to support 8 units, but hey... */ + extern char hdc_name[16]; extern int hdc_current; @@ -36,12 +44,14 @@ extern device_t xtide_ps2_device; /* xtide_ps2 */ extern device_t xtide_at_ps2_device; /* xtide_at_ps2 */ +extern void hdc_init(void); +extern void hdc_reset(char *name); + extern char *hdc_get_name(int hdc); extern char *hdc_get_internal_name(int hdc); extern int hdc_get_flags(int hdc); extern int hdc_available(int hdc); extern int hdc_current_is_mfm(void); -extern void hdc_init(char *internal_name); #endif /*EMU_HDC_H*/ diff --git a/src/hdd/hdc_esdi_at.c b/src/hdd/hdc_esdi_at.c index eec73f825..c50282c4b 100644 --- a/src/hdd/hdc_esdi_at.c +++ b/src/hdd/hdc_esdi_at.c @@ -8,10 +8,12 @@ * * Driver for the ESDI controller (WD1007-vse1) for PC/AT. * - * Version: @(#)hdc_esdi_at.c 1.0.1 2017/09/29 + * Version: @(#)hdc_esdi_at.c 1.0.2 2017/10/01 * - * Authors: Miran Grca, + * Authors: Sarah Walker, + * Miran Grca, * Fred N. van Kempen, + * Copyright 2008-2017 Sarah Walker. * Copyright 2016,2017 Miran Grca. * Copyright 2017 Fred N. van Kempen. */ diff --git a/src/hdd/hdc_esdi_mca.c b/src/hdd/hdc_esdi_mca.c index 1f512d384..2c2a8e397 100644 --- a/src/hdd/hdc_esdi_mca.c +++ b/src/hdd/hdc_esdi_mca.c @@ -55,7 +55,7 @@ * Version: @(#)hdc_esdi_mca.c 1.0.4 2017/09/29 * * Authors: Sarah Walker, - * Miran Grca, + * Fred N. van Kempen, * Copyright 2008-2017 Sarah Walker. * Copyright 2017 Fred N. van Kempen. */ diff --git a/src/hdd/hdc_ide.c b/src/hdd/hdc_ide.c index 7839743ee..6d843f21d 100644 --- a/src/hdd/hdc_ide.c +++ b/src/hdd/hdc_ide.c @@ -9,11 +9,10 @@ * Implementation of the IDE emulation for hard disks and ATAPI * CD-ROM devices. * - * Version: @(#)hdc_ide.c 1.0.8 2017/09/29 + * Version: @(#)hdc_ide.c 1.0.9 2017/09/30 * * Authors: Sarah Walker, * Miran Grca, - * TheCollector1995, * Copyright 2008-2017 Sarah Walker. * Copyright 2016,2017 Miran Grca. */ @@ -31,9 +30,9 @@ #include "../device.h" #include "../cdrom/cdrom.h" #include "../scsi/scsi.h" -#include "hdd.h" #include "hdc.h" #include "hdc_ide.h" +#include "hdd.h" /* Bits of 'atastat' */ @@ -88,20 +87,17 @@ enum IDE ide_drives[IDE_NUM + XTIDE_NUM]; - IDE *ext_ide; - int (*ide_bus_master_read)(int channel, uint8_t *data, int transfer_length); int (*ide_bus_master_write)(int channel, uint8_t *data, int transfer_length); void (*ide_bus_master_set_irq)(int channel); - int idecallback[5] = {0, 0, 0, 0, 0}; - int cur_ide[5]; + int ide_do_log = 0; -void ide_log(const char *format, ...) +static void ide_log(const char *format, ...) { #ifdef ENABLE_IDE_LOG if (ide_do_log) @@ -609,10 +605,11 @@ void ide_set_sector(IDE *ide, int64_t sector_num) void ide_ter_disable_cond(); void ide_qua_disable_cond(); -void resetide(void) + +void ide_reset(void) { int c, d; - + build_atapi_cdrom_map(); /* Close hard disk image files (if previously open) */ @@ -620,7 +617,8 @@ void resetide(void) { ide_drives[d].channel = d; ide_drives[d].type = IDE_NONE; - hdd_image_close(ide_drives[d].hdd_num); + if (ide_drives[d].hdd_num != -1) + hdd_image_close(ide_drives[d].hdd_num); if (ide_drive_is_cdrom(&ide_drives[d])) { cdrom[atapi_cdrom_drives[d]].status = READY_STAT | DSC_STAT; @@ -634,6 +632,7 @@ void resetide(void) idecallback[2]=idecallback[3]=0; idecallback[4]=0; + pclog("IDE: start loading disks...\n"); c = 0; for (d = 0; d < HDD_NUM; d++) { @@ -650,6 +649,7 @@ void resetide(void) if (++c >= (IDE_NUM+XTIDE_NUM)) break; } } + pclog("IDE: done loading, %d disks.\n", c); for (d = 0; d < IDE_NUM; d++) { @@ -2304,6 +2304,26 @@ void ide_qua_init(void) } +/*FIXME: this will go away after Kotori's rewrite. --FvK */ +void ide_init_first(void) +{ + int d; + + pclog("IDE: initializing...\n"); + + memset(ide_drives, 0x00, sizeof(ide_drives)); + for (d = 0; d < (IDE_NUM+XTIDE_NUM); d++) + { + ide_drives[d].channel = d; + ide_drives[d].type = IDE_NONE; + ide_drives[d].hdd_num = -1; + ide_drives[d].atastat = READY_STAT | DSC_STAT; + ide_drives[d].service = 0; + ide_drives[d].board = d >> 1; + } +} + + void ide_init(void) { ide_pri_enable(); diff --git a/src/hdd/hdc_ide.h b/src/hdd/hdc_ide.h index 1260fe54e..ffccd356f 100644 --- a/src/hdd/hdc_ide.h +++ b/src/hdd/hdc_ide.h @@ -9,11 +9,10 @@ * Implementation of the IDE emulation for hard disks and ATAPI * CD-ROM devices. * - * Version: @(#)hdd_ide.h 1.0.3 2017/09/29 + * Version: @(#)hdd_ide.h 1.0.4 2017/09/30 * * Authors: Sarah Walker, * Miran Grca, - * TheCollector1995, * Copyright 2008-2017 Sarah Walker. * Copyright 2016,2017 Miran Grca. */ @@ -64,40 +63,44 @@ extern IDE ide_drives[IDE_NUM + XTIDE_NUM]; extern int idecallback[5]; +extern void ide_irq_raise(IDE *ide); +extern void ide_irq_lower(IDE *ide); + extern void writeide(int ide_board, uint16_t addr, uint8_t val); extern void writeidew(int ide_board, uint16_t val); extern uint8_t readide(int ide_board, uint16_t addr); extern uint16_t readidew(int ide_board); extern void callbackide(int ide_board); -extern void resetide(void); -extern void ide_init(void); -extern void ide_xtide_init(void); -extern void ide_ter_init(void); -extern void ide_qua_init(void); -extern void ide_pri_enable(void); -extern void ide_sec_enable(void); -extern void ide_ter_enable(void); -extern void ide_qua_enable(void); -extern void ide_pri_disable(void); -extern void ide_sec_disable(void); -extern void ide_ter_disable(void); -extern void ide_qua_disable(void); + extern void ide_set_bus_master(int (*read)(int channel, uint8_t *data, int transfer_length), int (*write)(int channel, uint8_t *data, int transfer_length), void (*set_irq)(int channel)); -extern void ide_irq_raise(IDE *ide); -extern void ide_irq_lower(IDE *ide); - -extern void ide_padstr8(uint8_t *buf, int buf_size, const char *src); - extern void win_cdrom_eject(uint8_t id); extern void win_cdrom_reload(uint8_t id); -extern void ide_pri_disable(void); -extern void ide_pri_enable_ex(void); extern void ide_set_base(int controller, uint16_t port); extern void ide_set_side(int controller, uint16_t port); +extern void ide_init_first(void); +extern void ide_init(void); +extern void ide_reset(void); + +extern void ide_xtide_init(void); + +extern void ide_pri_enable(void); +extern void ide_pri_enable_ex(void); +extern void ide_pri_disable(void); +extern void ide_sec_enable(void); +extern void ide_sec_disable(void); +extern void ide_ter_enable(void); +extern void ide_ter_disable(void); +extern void ide_ter_init(void); +extern void ide_qua_enable(void); +extern void ide_qua_disable(void); +extern void ide_qua_init(void); + extern void secondary_ide_check(void); +extern void ide_padstr8(uint8_t *buf, int buf_size, const char *src); + #endif /*EMU_IDE_H*/ diff --git a/src/hdd/hdc_mfm_at.c b/src/hdd/hdc_mfm_at.c index 1883dbc4f..80ce711df 100644 --- a/src/hdd/hdc_mfm_at.c +++ b/src/hdd/hdc_mfm_at.c @@ -15,10 +15,8 @@ * Version: @(#)hdd_mfm_at.c 1.0.4 2017/09/29 * * Authors: Sarah Walker, - * Miran Grca, * Fred N. van Kempen, * Copyright 2008-2017 Sarah Walker. - * Copyright 2016,2017 Miran Grca. * Copyright 2017 Fred N. van Kempen. */ #include diff --git a/src/hdd/hdc_mfm_xt.c b/src/hdd/hdc_mfm_xt.c index 6259aaa60..56063d20f 100644 --- a/src/hdd/hdc_mfm_xt.c +++ b/src/hdd/hdc_mfm_xt.c @@ -6,22 +6,46 @@ * * This file is part of the 86Box distribution. * - * Driver for the IBM PC-XT MFM/RLL Fixed Disk controller. + * Driver for the IBM PC-XT Fixed Disk controller. * * The original controller shipped by IBM was made by Xebec, and - * several variations had been made. + * several variations had been made: * + * #1 Original, single drive (ST412), 10MB, 2 heads. + * #2 Update, single drive (ST412) but with option for a + * switch block that can be used to 'set' the actual + * drive type. Four switches are define, where switches + * 1 and 2 define drive0, and switches 3 and 4 drive1. * - * Since all controllers (including the ones made by DTC) we do - * keep them all in this module. + * 0 ON ON 306 2 0 + * 1 ON OFF 375 8 0 + * 2 OFF ON 306 6 256 + * 3 OFF OFF 306 4 0 * - * Version: @(#)hdd_mfm_xt.c 1.0.5 2017/09/29 + * The latter option is the default, in use on boards + * without the switch block option. + * + * #3 Another updated board, mostly to accomodate the new + * 20MB disk now being shipped. The controller can have + * up to 2 drives, the type of which is set using the + * switch block: + * + * SW1 SW2 CYLS HD SPT WPC + * 0 ON ON 306 4 17 0 + * 1 ON OFF 612 4 17 0 (type 16) + * 2 OFF ON 615 4 17 300 (Seagate ST-225, 2) + * 3 OFF OFF 306 8 17 128 (IBM WD25, 13) + * + * Examples of #3 are IBM/Xebec, WD10004A-WX1 and ST11R. + * + * Since all controllers (including the ones made by DTC) use + * (mostly) the same API, we keep them all in this module. + * + * Version: @(#)hdd_mfm_xt.c 1.0.6 2017/09/30 * * Authors: Sarah Walker, - * Miran Grca, * Fred N. van Kempen, * Copyright 2008-2017 Sarah Walker. - * Copyright 2016,2017 Miran Grca. * Copyright 2017 Fred N. van Kempen. */ #include diff --git a/src/hdd/hdc_xtide.c b/src/hdd/hdc_xtide.c index 349b39e7c..6cbefc17d 100644 --- a/src/hdd/hdc_xtide.c +++ b/src/hdd/hdc_xtide.c @@ -25,8 +25,10 @@ * * Authors: Sarah Walker, * Miran Grca, + * Fred N. van Kempen, * Copyright 2008-2017 Sarah Walker. * Copyright 2016,2017 Miran Grca. + * Copyright 2017 Fred N. van Kempen. */ #include #include @@ -38,7 +40,6 @@ #include "../mem.h" #include "../rom.h" #include "../device.h" -#include "hdd.h" #include "hdc.h" #include "hdc_ide.h" diff --git a/src/hdd/hdd.c b/src/hdd/hdd.c index 23c9ed38f..1041f66fd 100644 --- a/src/hdd/hdd.c +++ b/src/hdd/hdd.c @@ -8,7 +8,7 @@ * * Common code to handle all sorts of hard disk images. * - * Version: @(#)hdd.c 1.0.1 2017/09/29 + * Version: @(#)hdd.c 1.0.2 2017/09/30 * * Authors: Miran Grca, * Fred N. van Kempen, @@ -27,3 +27,13 @@ hard_disk_t hdd[HDD_NUM]; + + +int +hdd_init(void) +{ + /* Clear all global data. */ + memset(hdd, 0x00, sizeof(hdd)); + + return(0); +} diff --git a/src/hdd/hdd.h b/src/hdd/hdd.h index 758c3e72b..c60d4d0d1 100644 --- a/src/hdd/hdd.h +++ b/src/hdd/hdd.h @@ -8,7 +8,7 @@ * * Definitions for the hard disk image handler. * - * Version: @(#)hdd.h 1.0.1 2017/09/29 + * Version: @(#)hdd.h 1.0.2 2017/09/30 * * Authors: Miran Grca, * Fred N. van Kempen, @@ -20,13 +20,7 @@ #define HDD_NUM 30 /* total of 30 images supported */ -#define MFM_NUM 2 /* 2 drives per controller supported */ -#define ESDI_NUM 2 /* 2 drives per controller supported */ -#define XTIDE_NUM 2 /* 2 drives per controller supported */ -#define IDE_NUM 8 -#define SCSI_NUM 16 /* theoretically the controller can have at - * least 7 devices, with each device being - * able to support 8 units, but hey... */ + /* Hard Disk bus types. */ enum { @@ -76,6 +70,8 @@ extern hard_disk_t hdd[HDD_NUM]; extern uint64_t hdd_table[128][3]; +extern int hdd_init(void); + extern int hdd_image_load(int id); extern void hdd_image_seek(uint8_t id, uint32_t sector); extern void hdd_image_read(uint8_t id, uint32_t sector, uint32_t count, uint8_t *buffer); diff --git a/src/hdd/hdd_image.c b/src/hdd/hdd_image.c index 5fdd08892..564ec5ffa 100644 --- a/src/hdd/hdd_image.c +++ b/src/hdd/hdd_image.c @@ -1,3 +1,22 @@ +/* + * 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. + * + * Handling of hard disk image files. + * + * Version: @(#)hdd_image.c 1.0.2 2017/10/01 + * + * Authors: Sarah Walker, + * Miran Grca, + * Fred N. van Kempen, + * Copyright 2008-2017 Sarah Walker. + * Copyright 2016-2017 Miran Grca. + * Copyright 2017 Fred N. van Kempen. + */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _GNU_SOURCE @@ -10,7 +29,6 @@ #include #include "../ibm.h" #include "hdd.h" -//#include "hdc_ide.h" typedef struct @@ -351,7 +369,7 @@ prepare_new_hard_disk: hdd_images[id].last_sector = (uint32_t) (full_size >> 9) - 1; hdd_images[id].loaded = 1; -pclog("HDD: disk %d image '%S' file 0x%08lx\n", id, hdd[id].fn, hdd_images[id].file); + return 1; } @@ -368,7 +386,6 @@ void hdd_image_read(uint8_t id, uint32_t sector, uint32_t count, uint8_t *buffer { count <<= 9; -pclog("HDD: read_image(id=%d sector=%lu cnt=%d, bufp=%08lx) fp=%08lx\n",id,sector,count,buffer,hdd_images[id].file); hdd_image_seek(id, sector); memset(buffer, 0, count); fread(buffer, 1, count, hdd_images[id].file); @@ -512,16 +529,14 @@ void hdd_image_unload(uint8_t id, int fn_preserve) fclose(hdd_images[id].file); hdd_images[id].file = NULL; } + hdd_images[id].loaded = 0; } hdd_images[id].last_sector = -1; memset(hdd[id].prev_fn, 0, sizeof(hdd[id].prev_fn)); if (fn_preserve) - { wcscpy(hdd[id].prev_fn, hdd[id].fn); - } - memset(hdd[id].fn, 0, sizeof(hdd[id].fn)); } @@ -531,6 +546,6 @@ void hdd_image_close(uint8_t id) { fclose(hdd_images[id].file); hdd_images[id].file = NULL; - hdd_images[id].loaded = 0; } + hdd_images[id].loaded = 0; } diff --git a/src/hdd/hdd_table.c b/src/hdd/hdd_table.c index 8a5bf9cd5..bf61beef9 100644 --- a/src/hdd/hdd_table.c +++ b/src/hdd/hdd_table.c @@ -9,13 +9,12 @@ * Implementation of the IDE emulation for hard disks and ATAPI * CD-ROM devices. * - * Version: @(#)hdd_table.c 1.0.2 2017/09/29 + * Version: @(#)hdd_table.c 1.0.3 2017/09/30 * - * Authors: Sarah Walker, - * Miran Grca, - * TheCollector1995, - * Copyright 2008-2017 Sarah Walker. + * Authors: Miran Grca, + * Fred N. van Kempen, * Copyright 2016,2017 Miran Grca. + * Copyright 2017 Fred N. van Kempen. */ #include #include diff --git a/src/machine/machine.c b/src/machine/machine.c index 4f38fefcd..8373742aa 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -8,7 +8,7 @@ * * Handling of the emulated machines. * - * Version: @(#)machine.c 1.0.15 2017/09/24 + * Version: @(#)machine.c 1.0.16 2017/09/30 * * Authors: Sarah Walker, * Miran Grca, @@ -85,7 +85,7 @@ machine_t machines[] = {"[8088] Generic XT clone", ROM_GENXT, "genxt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 640, 64, 0, machine_xt_init, NULL }, {"[8088] Juko XT clone", ROM_JUKOPC, "jukopc", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 640, 64, 0, machine_xt_init, NULL }, {"[8088] Phoenix XT clone", ROM_PXXT, "pxxt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 640, 64, 0, machine_xt_init, NULL }, - {"[8088] Schneider EuroPC", ROM_EUROPC, "europc", {{"Siemens",cpus_europc}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 512, 640, 128, 0, machine_europc_init, NULL }, + {"[8088] Schneider EuroPC", ROM_EUROPC, "europc", {{"Siemens",cpus_europc}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_HAS_HDC, 512, 640, 128, 0, machine_europc_init, NULL }, {"[8088] Tandy 1000", ROM_TANDY, "tandy", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, 0, 128, 640, 128, 0, machine_tandy1k_init, tandy1000_get_device }, {"[8088] Tandy 1000 HX", ROM_TANDY1000HX, "tandy1000hx", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, 0, 256, 640, 128, 0, machine_tandy1k_init, tandy1000hx_get_device }, {"[8088] VTech Laser Turbo XT", ROM_LTXT, "ltxt", {{"", cpus_8088}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, 0, 64, 1152, 64, 0, machine_xt_laserxt_init, NULL }, @@ -110,57 +110,57 @@ machine_t machines[] = {"[286 MCA] IBM PS/2 model 50", ROM_IBMPS2_M50, "ibmps2_m50", {{"", cpus_ps2_m30_286}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 1, MACHINE_AT | MACHINE_PS2 | MACHINE_PS2_HDD | MACHINE_MCA, 1, 16, 1, 63, machine_ps2_model_50_init, NULL }, - {"[386SX ISA] AMI 386SX clone", ROM_AMI386SX, "ami386", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_IDE, 512,16384, 128, 127, machine_at_headland_init, NULL }, - {"[386SX ISA] Amstrad MegaPC", ROM_MEGAPC, "megapc", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 1, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE, 1, 16, 1, 127, machine_at_wd76c10_init, NULL }, - {"[386SX ISA] Award 386SX clone", ROM_AWARD386SX_OPTI495, "award386sx", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_IDE, 1, 64, 1, 127, machine_at_opti495_init, NULL }, - {"[386SX ISA] DTK 386SX clone", ROM_DTK386, "dtk386", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_IDE, 512,16384, 128, 127, machine_at_neat_init, NULL }, - {"[386SX ISA] IBM PS/1 model 2121", ROM_IBMPS1_2121, "ibmps1_2121", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 1, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE, 1, 16, 1, 127, machine_ps1_m2121_init, NULL }, - {"[386SX ISA] IBM PS/1 m.2121+ISA", ROM_IBMPS1_2121_ISA, "ibmps1_2121_isa", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE, 1, 16, 1, 127, machine_ps1_m2121_init, NULL }, + {"[386SX ISA] AMI 386SX clone", ROM_AMI386SX, "ami386", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_HDC, 512,16384, 128, 127, machine_at_headland_init, NULL }, + {"[386SX ISA] Amstrad MegaPC", ROM_MEGAPC, "megapc", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 1, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC, 1, 16, 1, 127, machine_at_wd76c10_init, NULL }, + {"[386SX ISA] Award 386SX clone", ROM_AWARD386SX_OPTI495, "award386sx", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_HDC, 1, 64, 1, 127, machine_at_opti495_init, NULL }, + {"[386SX ISA] DTK 386SX clone", ROM_DTK386, "dtk386", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_HDC, 512,16384, 128, 127, machine_at_neat_init, NULL }, + {"[386SX ISA] IBM PS/1 model 2121", ROM_IBMPS1_2121, "ibmps1_2121", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 1, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC, 1, 16, 1, 127, machine_ps1_m2121_init, NULL }, + {"[386SX ISA] IBM PS/1 m.2121+ISA", ROM_IBMPS1_2121_ISA, "ibmps1_2121_isa", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC, 1, 16, 1, 127, machine_ps1_m2121_init, NULL }, {"[386SX MCA] IBM PS/2 model 55SX", ROM_IBMPS2_M55SX, "ibmps2_m55sx", {{"Intel", cpus_i386SX}, {"AMD", cpus_Am386SX}, {"Cyrix", cpus_486SLC}, {"", NULL}, {"", NULL}}, 1, MACHINE_AT | MACHINE_PS2 | MACHINE_PS2_HDD | MACHINE_MCA, 1, 8, 1, 63, machine_ps2_model_55sx_init, NULL }, - {"[386DX ISA] AMI 386DX clone", ROM_AMI386DX_OPTI495, "ami386dx", {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_IDE, 1, 64, 1, 127, machine_at_opti495_init, NULL }, - {"[386DX ISA] Amstrad MegaPC 386DX", ROM_MEGAPCDX, "megapcdx", {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, 1, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE, 1, 16, 1, 127, machine_at_wd76c10_init, NULL }, - {"[386DX ISA] Award 386DX clone", ROM_AWARD386DX_OPTI495, "award386dx", {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_IDE, 1, 64, 1, 127, machine_at_opti495_init, NULL }, - {"[386DX ISA] MR 386DX clone", ROM_MR386DX_OPTI495, "mr386dx", {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_IDE, 1, 64, 1, 127, machine_at_opti495_init, NULL }, + {"[386DX ISA] AMI 386DX clone", ROM_AMI386DX_OPTI495, "ami386dx", {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_HDC, 1, 64, 1, 127, machine_at_opti495_init, NULL }, + {"[386DX ISA] Amstrad MegaPC 386DX", ROM_MEGAPCDX, "megapcdx", {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, 1, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC, 1, 16, 1, 127, machine_at_wd76c10_init, NULL }, + {"[386DX ISA] Award 386DX clone", ROM_AWARD386DX_OPTI495, "award386dx", {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_HDC, 1, 64, 1, 127, machine_at_opti495_init, NULL }, + {"[386DX ISA] MR 386DX clone", ROM_MR386DX_OPTI495, "mr386dx", {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_HDC, 1, 64, 1, 127, machine_at_opti495_init, NULL }, {"[386DX MCA] IBM PS/2 model 80", ROM_IBMPS2_M80, "ibmps2_m80", {{"Intel", cpus_i386DX}, {"AMD", cpus_Am386DX}, {"Cyrix", cpus_486DLC}, {"", NULL}, {"", NULL}}, 1, MACHINE_AT | MACHINE_PS2 | MACHINE_PS2_HDD | MACHINE_MCA, 1, 12, 1, 63, machine_ps2_model_80_init, NULL }, - {"[486 ISA] AMI 486 clone", ROM_AMI486, "ami486", {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_IDE, 1, 64, 1, 127, machine_at_ali1429_init, NULL }, - {"[486 ISA] AMI WinBIOS 486", ROM_WIN486, "win486", {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_IDE, 1, 64, 1, 127, machine_at_ali1429_init, NULL }, - {"[486 ISA] Award 486 clone", ROM_AWARD486_OPTI495, "award486", {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_IDE, 1, 64, 1, 127, machine_at_opti495_init, NULL }, - {"[486 ISA] DTK PKM-0038S E-2", ROM_DTK486, "dtk486", {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_IDE, 1, 128, 1, 127, machine_at_dtk486_init, NULL }, - {"[486 ISA] IBM PS/1 machine 2133", ROM_IBMPS1_2133, "ibmps1_2133", {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE, 1, 64, 1, 127, machine_ps1_m2133_init, NULL }, + {"[486 ISA] AMI 486 clone", ROM_AMI486, "ami486", {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_HDC, 1, 64, 1, 127, machine_at_ali1429_init, NULL }, + {"[486 ISA] AMI WinBIOS 486", ROM_WIN486, "win486", {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_HDC, 1, 64, 1, 127, machine_at_ali1429_init, NULL }, + {"[486 ISA] Award 486 clone", ROM_AWARD486_OPTI495, "award486", {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_HDC, 1, 64, 1, 127, machine_at_opti495_init, NULL }, + {"[486 ISA] DTK PKM-0038S E-2", ROM_DTK486, "dtk486", {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_HDC, 1, 128, 1, 127, machine_at_dtk486_init, NULL }, + {"[486 ISA] IBM PS/1 machine 2133", ROM_IBMPS1_2133, "ibmps1_2133", {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC, 1, 64, 1, 127, machine_ps1_m2133_init, NULL }, {"[486 MCA] IBM PS/2 model 80-486", ROM_IBMPS2_M80_486, "ibmps2_m80-486", {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, 1, MACHINE_AT | MACHINE_PS2 | MACHINE_PS2_HDD | MACHINE_MCA, 1, 32, 1, 63, machine_ps2_model_80_486_init, NULL }, - {"[486 PCI] Rise Computer R418", ROM_R418, "r418", {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_IDE | MACHINE_PCI, 1, 255, 1, 127, machine_at_r418_init, NULL }, + {"[486 PCI] Rise Computer R418", ROM_R418, "r418", {{"Intel", cpus_i486}, {"AMD", cpus_Am486}, {"Cyrix", cpus_Cx486}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_HDC | MACHINE_PCI, 1, 255, 1, 127, machine_at_r418_init, NULL }, - {"[Socket 4 LX] Intel Premiere/PCI", ROM_REVENGE, "revenge", {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 2, 128, 2, 127, machine_at_batman_init, NULL }, + {"[Socket 4 LX] Intel Premiere/PCI", ROM_REVENGE, "revenge", {{"Intel", cpus_Pentium5V}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 2, 128, 2, 127, machine_at_batman_init, NULL }, - {"[Socket 5 NX] Intel Premiere/PCI II", ROM_PLATO, "plato", {{ "Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 2, 128, 2, 127, machine_at_plato_init, NULL }, + {"[Socket 5 NX] Intel Premiere/PCI II", ROM_PLATO, "plato", {{ "Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 2, 128, 2, 127, machine_at_plato_init, NULL }, - {"[Socket 5 FX] ASUS P/I-P54TP4XE", ROM_P54TP4XE, "p54tp4xe", {{ "Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_IDE | MACHINE_PCI, 8, 128, 8, 127, machine_at_p54tp4xe_init, NULL }, - {"[Socket 5 FX] Intel Advanced/EV", ROM_ENDEAVOR, "endeavor", {{ "Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 8, 128, 8, 127, machine_at_endeavor_init, NULL }, - {"[Socket 5 FX] Intel Advanced/ZP", ROM_ZAPPA, "zappa", {{ "Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 8, 128, 8, 127, machine_at_zappa_init, NULL }, - {"[Socket 5 FX] PC Partner MB500N", ROM_MB500N, "mb500n", {{ "Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_IDE | MACHINE_PCI, 8, 128, 8, 127, machine_at_mb500n_init, NULL }, - {"[Socket 5 FX] President Award 430FX PCI",ROM_PRESIDENT, "president", {{ "Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_IDE | MACHINE_PCI, 8, 128, 8, 127, machine_at_president_init, NULL }, + {"[Socket 5 FX] ASUS P/I-P54TP4XE", ROM_P54TP4XE, "p54tp4xe", {{ "Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_HDC | MACHINE_PCI, 8, 128, 8, 127, machine_at_p54tp4xe_init, NULL }, + {"[Socket 5 FX] Intel Advanced/EV", ROM_ENDEAVOR, "endeavor", {{ "Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 8, 128, 8, 127, machine_at_endeavor_init, NULL }, + {"[Socket 5 FX] Intel Advanced/ZP", ROM_ZAPPA, "zappa", {{ "Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 8, 128, 8, 127, machine_at_zappa_init, NULL }, + {"[Socket 5 FX] PC Partner MB500N", ROM_MB500N, "mb500n", {{ "Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_HDC | MACHINE_PCI, 8, 128, 8, 127, machine_at_mb500n_init, NULL }, + {"[Socket 5 FX] President Award 430FX PCI",ROM_PRESIDENT, "president", {{ "Intel", cpus_PentiumS5}, {"IDT", cpus_WinChip}, {"AMD", cpus_K5}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_HAS_HDC | MACHINE_PCI, 8, 128, 8, 127, machine_at_president_init, NULL }, - {"[Socket 7 FX] Intel Advanced/ATX", ROM_THOR, "thor", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 8, 128, 8, 127, machine_at_thor_init, NULL }, - {"[Socket 7 FX] MR Intel Advanced/ATX", ROM_MRTHOR, "mrthor", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 8, 128, 8, 127, machine_at_thor_init, NULL }, + {"[Socket 7 FX] Intel Advanced/ATX", ROM_THOR, "thor", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 8, 128, 8, 127, machine_at_thor_init, NULL }, + {"[Socket 7 FX] MR Intel Advanced/ATX", ROM_MRTHOR, "mrthor", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 8, 128, 8, 127, machine_at_thor_init, NULL }, - {"[Socket 7 HX] Acer M3a", ROM_ACERM3A, "acerm3a", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 8, 192, 8, 127, machine_at_acerm3a_init, NULL }, - {"[Socket 7 HX] Acer V35n", ROM_ACERV35N, "acerv35n", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 8, 192, 8, 127, machine_at_acerv35n_init, NULL }, - {"[Socket 7 HX] AOpen AP53", ROM_AP53, "ap53", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 8, 512, 8, 127, machine_at_ap53_init, NULL }, - {"[Socket 7 HX] ASUS P/I-P55T2P4", ROM_P55T2P4, "p55t2p4", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 8, 512, 8, 127, machine_at_p55t2p4_init, NULL }, - {"[Socket 7 HX] SuperMicro Super P55T2S",ROM_P55T2S, "p55t2s", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 8, 768, 8, 127, machine_at_p55t2s_init, NULL }, + {"[Socket 7 HX] Acer M3a", ROM_ACERM3A, "acerm3a", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 8, 192, 8, 127, machine_at_acerm3a_init, NULL }, + {"[Socket 7 HX] Acer V35n", ROM_ACERV35N, "acerv35n", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 8, 192, 8, 127, machine_at_acerv35n_init, NULL }, + {"[Socket 7 HX] AOpen AP53", ROM_AP53, "ap53", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 8, 512, 8, 127, machine_at_ap53_init, NULL }, + {"[Socket 7 HX] ASUS P/I-P55T2P4", ROM_P55T2P4, "p55t2p4", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 8, 512, 8, 127, machine_at_p55t2p4_init, NULL }, + {"[Socket 7 HX] SuperMicro Super P55T2S",ROM_P55T2S, "p55t2s", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 8, 768, 8, 127, machine_at_p55t2s_init, NULL }, - {"[Socket 7 VX] ASUS P/I-P55TVP4", ROM_P55TVP4, "p55tvp4", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 8, 128, 8, 127, machine_at_p55tvp4_init, NULL }, - {"[Socket 7 VX] Award 430VX PCI", ROM_430VX, "430vx", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 8, 128, 8, 127, machine_at_i430vx_init, NULL }, - {"[Socket 7 VX] Epox P55-VA", ROM_P55VA, "p55va", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 8, 128, 8, 127, machine_at_p55va_init, NULL }, + {"[Socket 7 VX] ASUS P/I-P55TVP4", ROM_P55TVP4, "p55tvp4", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 8, 128, 8, 127, machine_at_p55tvp4_init, NULL }, + {"[Socket 7 VX] Award 430VX PCI", ROM_430VX, "430vx", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 8, 128, 8, 127, machine_at_i430vx_init, NULL }, + {"[Socket 7 VX] Epox P55-VA", ROM_P55VA, "p55va", {{"Intel", cpus_Pentium}, {"IDT", cpus_WinChip}, {"AMD", cpus_K56}, {"Cyrix", cpus_6x86},{"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 8, 128, 8, 127, machine_at_p55va_init, NULL }, - {"[Socket 8 FX] Tyan Titan-Pro AT", ROM_440FX, "440fx", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 8, 1024, 8, 127, machine_at_i440fx_init, NULL }, - {"[Socket 8 FX] Tyan Titan-Pro ATX", ROM_S1668, "tpatx", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_IDE | MACHINE_PCI, 8, 1024, 8, 127, machine_at_s1668_init, NULL }, + {"[Socket 8 FX] Tyan Titan-Pro AT", ROM_440FX, "440fx", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 8, 1024, 8, 127, machine_at_i440fx_init, NULL }, + {"[Socket 8 FX] Tyan Titan-Pro ATX", ROM_S1668, "tpatx", {{"Intel", cpus_PentiumPro}, {"", NULL}, {"", NULL}, {"", NULL}, {"", NULL}}, 0, MACHINE_AT | MACHINE_PS2 | MACHINE_HAS_HDC | MACHINE_PCI, 8, 1024, 8, 127, machine_at_s1668_init, NULL }, {"", -1, "", {{"", 0}, {"", 0}, {"", 0}}, 0,0,0,0, 0 } }; diff --git a/src/machine/machine.h b/src/machine/machine.h index 7b3cd4ead..2f3cc00c0 100644 --- a/src/machine/machine.h +++ b/src/machine/machine.h @@ -8,7 +8,7 @@ * * Handling of the emulated machines. * - * Version: @(#)machine.h 1.0.4 2017/09/18 + * Version: @(#)machine.h 1.0.5 2017/09/30 * * Authors: Sarah Walker, * Miran Grca, @@ -23,10 +23,10 @@ #define MACHINE_PS2 2 #define MACHINE_AMSTRAD 4 #define MACHINE_OLIM24 8 -#define MACHINE_HAS_IDE 16 +#define MACHINE_HAS_HDC 16 #define MACHINE_MCA 32 #define MACHINE_PCI 64 -#define MACHINE_PS2_HDD 128 +#define MACHINE_PS2_HDD 128 // can now remove? --FvK #define MACHINE_NEC 256 #define MACHINE_FUJITSU 512 #define MACHINE_RM 1024 diff --git a/src/machine/machine_at.c b/src/machine/machine_at.c index 611ed3802..63f3a9f7a 100644 --- a/src/machine/machine_at.c +++ b/src/machine/machine_at.c @@ -13,7 +13,7 @@ #include "../gameport.h" #include "../keyboard_at.h" #include "../lpt.h" -#include "../hdd/hdd.h" +#include "../hdd/hdc.h" #include "../hdd/hdc_ide.h" #include "machine_common.h" #include "machine_at.h" diff --git a/src/machine/machine_at_ali1429.c b/src/machine/machine_at_ali1429.c index 2892c17dd..83a71e47d 100644 --- a/src/machine/machine_at_ali1429.c +++ b/src/machine/machine_at_ali1429.c @@ -9,7 +9,8 @@ #include "../cpu/cpu.h" #include "../io.h" #include "../mem.h" -#include "../hdd/hdd.h" +#include "../device.h" +#include "../hdd/hdc.h" #include "../hdd/hdc_ide.h" #include "machine_at.h" #include "machine_at_ali1429.h" diff --git a/src/machine/machine_at_sis_85c471.c b/src/machine/machine_at_sis_85c471.c index 51efb03a1..91b2a2659 100644 --- a/src/machine/machine_at_sis_85c471.c +++ b/src/machine/machine_at_sis_85c471.c @@ -9,7 +9,7 @@ * SiS sis85c471 Super I/O Chip * Used by DTK PKM-0038S E-2 * - * Version: @(#)sis85c471.c 1.0.6 2017/09/29 + * Version: @(#)sis85c471.c 1.0.6 2017/09/30 * * Author: Miran Grca, * Copyright 2017 Miran Grca. @@ -21,12 +21,13 @@ #include "../ibm.h" #include "../io.h" #include "../memregs.h" +#include "../device.h" #include "../lpt.h" #include "../serial.h" #include "../floppy/floppy.h" #include "../floppy/fdc.h" #include "../floppy/fdd.h" -#include "../hdd/hdd.h" +#include "../hdd/hdc.h" #include "../hdd/hdc_ide.h" #include "machine_at.h" #include "machine_at_sis_85c471.h" diff --git a/src/machine/machine_ps1.c b/src/machine/machine_ps1.c index b63354c22..962c71adc 100644 --- a/src/machine/machine_ps1.c +++ b/src/machine/machine_ps1.c @@ -22,7 +22,7 @@ #include "../floppy/floppy.h" #include "../floppy/fdd.h" #include "../floppy/fdc.h" -#include "../hdd/hdd.h" +#include "../hdd/hdc.h" #include "../hdd/hdc_ide.h" #include "../sound/snd_ps1.h" #include "machine_common.h" diff --git a/src/pc.c b/src/pc.c index 8f949b000..8c4ecbfe3 100644 --- a/src/pc.c +++ b/src/pc.c @@ -8,7 +8,7 @@ * * Emulation core dispatcher. * - * Version: @(#)pc.c 1.0.13 2017/09/29 + * Version: @(#)pc.c 1.0.14 2017/09/30 * * Authors: Sarah Walker, * Miran Grca, @@ -407,6 +407,14 @@ usage: append_filename_w(config_file_default, cfg_path, CONFIG_FILE_W, 511); } + /* + * This is weird, but we need to clear that global + * data before we actually use it, and the config + * file reader will add data to those areas.. --FvK + */ + hdd_init(); + hdc_init(); + config_load(config_file); } @@ -415,22 +423,22 @@ void initmodules(void) int i; /* Initialize modules. */ + random_init(); mouse_init(); #ifdef WALTJE serial_init(); #endif - random_init(); - joystick_init(); + video_init(); + ide_init_first(); - cpuspeed2=(AT)?2:1; - atfullspeed=0; - - initvideo(); mem_init(); rom_load_bios(romset); mem_add_bios(); + cpuspeed2=(AT)?2:1; + atfullspeed=0; + codegen_init(); device_init(); @@ -475,9 +483,8 @@ void initmodules(void) loadnvr(); sound_init(); -#if 0 - resetide(); -#endif + ide_reset(); + scsi_card_init(); fullspeed(); @@ -566,31 +573,23 @@ void resetpchard_init(void) fdc_init(); floppy_reset(); - hdc_init(hdc_name); + hdc_reset(hdc_name); #ifndef WALTJE serial_init(); #endif machine_init(); - video_init(); + video_reset(); speaker_init(); lpt1_device_init(); ide_ter_disable(); ide_qua_disable(); - if (ide_enable[2]) - { ide_ter_init(); - } - if (ide_enable[3]) - { ide_qua_init(); - } + ide_reset(); -#if 0 - resetide(); -#endif scsi_card_init(); #ifdef USE_NETWORK network_reset(); @@ -773,7 +772,7 @@ void closepc(void) floppy_close(i); } dumpregs(0); - closevideo(); + video_close(); lpt1_device_close(); device_close_all(); midi_close(); diff --git a/src/pci.c b/src/pci.c index 6bbccd225..d945c7a63 100644 --- a/src/pci.c +++ b/src/pci.c @@ -7,11 +7,12 @@ #include "io.h" #include "pic.h" #include "mem.h" +#include "device.h" #include "pci.h" #include "keyboard_at.h" #include "floppy/floppy.h" #include "floppy/fdc.h" -#include "hdd/hdd.h" +#include "hdd/hdc.h" #include "hdd/hdc_ide.h" #include "cdrom/cdrom.h" @@ -655,7 +656,7 @@ static void trc_reset(uint8_t val) pci_reset_handler.super_io_reset(); } - resetide(); + ide_reset(); for (i = 0; i < CDROM_NUM; i++) { if (!cdrom_drives[i].bus_type) diff --git a/src/piix.c b/src/piix.c index c37d05a1b..2d233737b 100644 --- a/src/piix.c +++ b/src/piix.c @@ -12,7 +12,7 @@ * word 0 - base address * word 1 - bits 1 - 15 = byte count, bit 31 = end of transfer * - * Version: @(#)piix.c 1.0.4 2017/09/29 + * Version: @(#)piix.c 1.0.4 2017/09/30 * * Authors: Sarah Walker, * Miran Grca, @@ -26,10 +26,11 @@ #include "ibm.h" #include "dma.h" #include "io.h" +#include "device.h" #include "keyboard_at.h" #include "mem.h" #include "pci.h" -#include "hdd/hdd.h" +#include "hdd/hdc.h" #include "hdd/hdc_ide.h" #include "piix.h" diff --git a/src/scsi/scsi.c b/src/scsi/scsi.c index 0bde9090b..c5a62b3b7 100644 --- a/src/scsi/scsi.c +++ b/src/scsi/scsi.c @@ -8,7 +8,7 @@ * * Handling of the SCSI controllers. * - * Version: @(#)scsi.c 1.0.6 2017/09/29 + * Version: @(#)scsi.c 1.0.6 2017/09/30 * * Authors: TheCollector1995, * Miran Grca, @@ -26,7 +26,7 @@ #include "../timer.h" #include "../device.h" #include "../cdrom/cdrom.h" -#include "../hdd/hdd.h" +#include "../hdd/hdc.h" #include "scsi.h" #include "scsi_aha154x.h" #include "scsi_buslogic.h" diff --git a/src/scsi/scsi_disk.c b/src/scsi/scsi_disk.c index aa6add9f4..c4e65fee8 100644 --- a/src/scsi/scsi_disk.c +++ b/src/scsi/scsi_disk.c @@ -6,7 +6,7 @@ * * Emulation of SCSI fixed and removable disks. * - * Version: @(#)scsi_disk.c 1.0.9 2017/09/29 + * Version: @(#)scsi_disk.c 1.0.9 2017/09/30 * * Author: Miran Grca, * Copyright 2017 Miran Grca. @@ -20,9 +20,11 @@ #include "../86box.h" #include "../ibm.h" #include "../timer.h" +#include "../device.h" #include "../piix.h" #include "../cdrom/cdrom.h" #include "../hdd/hdd.h" +#include "../hdd/hdc.h" #include "../hdd/hdc_ide.h" #include "../win/plat_iodev.h" #include "scsi.h" diff --git a/src/sio_fdc37c665.c b/src/sio_fdc37c665.c index 7f441fc35..4b32d84ba 100644 --- a/src/sio_fdc37c665.c +++ b/src/sio_fdc37c665.c @@ -8,7 +8,7 @@ * * Implementation of the SMC FDC37C665 Super I/O Chip. * - * Version: @(#)sio_fdc37c665.c 1.0.6 2017/09/29 + * Version: @(#)sio_fdc37c665.c 1.0.6 2017/09/30 * * Authors: Sarah Walker, * Miran Grca, @@ -21,12 +21,13 @@ #include #include "ibm.h" #include "io.h" +#include "device.h" #include "lpt.h" #include "serial.h" #include "floppy/floppy.h" #include "floppy/fdc.h" #include "floppy/fdd.h" -#include "hdd/hdd.h" +#include "hdd/hdc.h" #include "hdd/hdc_ide.h" #include "sio.h" diff --git a/src/sio_fdc37c669.c b/src/sio_fdc37c669.c index fdcf085e2..f2dac8cbd 100644 --- a/src/sio_fdc37c669.c +++ b/src/sio_fdc37c669.c @@ -8,7 +8,7 @@ * * Implementation of the SMC FDC37C669 Super I/O Chip. * - * Version: @(#)sio_fdc37c669.c 1.0.4 2017/09/29 + * Version: @(#)sio_fdc37c669.c 1.0.4 2017/09/30 * * Author: Miran Grca, * Copyright 2016,2017 Miran Grca. @@ -19,12 +19,13 @@ #include #include "ibm.h" #include "io.h" +#include "device.h" #include "lpt.h" #include "serial.h" #include "floppy/floppy.h" #include "floppy/fdc.h" #include "floppy/fdd.h" -#include "hdd/hdd.h" +#include "hdd/hdc.h" #include "hdd/hdc_ide.h" #include "sio.h" diff --git a/src/sio_fdc37c932fr.c b/src/sio_fdc37c932fr.c index dfc1aead2..2ecc95b74 100644 --- a/src/sio_fdc37c932fr.c +++ b/src/sio_fdc37c932fr.c @@ -8,7 +8,7 @@ * * Implementation of the SMC FDC37C932FR Super I/O Chip. * - * Version: @(#)sio_fdc37c932fr.c 1.0.5 2017/09/29 + * Version: @(#)sio_fdc37c932fr.c 1.0.5 2017/09/30 * * Author: Miran Grca, * Copyright 2016,2017 Miran Grca. @@ -19,12 +19,13 @@ #include #include "ibm.h" #include "io.h" +#include "device.h" #include "lpt.h" #include "serial.h" #include "floppy/floppy.h" #include "floppy/fdc.h" #include "floppy/fdd.h" -#include "hdd/hdd.h" +#include "hdd/hdc.h" #include "hdd/hdc_ide.h" #include "sio.h" diff --git a/src/sio_pc87306.c b/src/sio_pc87306.c index 772d637aa..44fb5a914 100644 --- a/src/sio_pc87306.c +++ b/src/sio_pc87306.c @@ -8,7 +8,7 @@ * * Emulation of the NatSemi PC87306 Super I/O chip. * - * Version: @(#)sio_pc87306.c 1.0.5 2017/09/29 + * Version: @(#)sio_pc87306.c 1.0.5 2017/09/30 * * Author: Miran Grca, * Copyright 2016,2017 Miran Grca. @@ -19,12 +19,13 @@ #include #include "ibm.h" #include "io.h" +#include "device.h" #include "lpt.h" #include "serial.h" #include "floppy/floppy.h" #include "floppy/fdc.h" #include "floppy/fdd.h" -#include "hdd/hdd.h" +#include "hdd/hdc.h" #include "hdd/hdc_ide.h" #include "sio.h" diff --git a/src/video/video.c b/src/video/video.c index dcfff2ebd..c8eb8a404 100644 --- a/src/video/video.c +++ b/src/video/video.c @@ -269,7 +269,7 @@ int video_timing[6][4] = {VIDEO_BUS, 3, 3, 4} }; -void video_updatetiming() +void video_updatetiming(void) { if (video_timing[video_speed][0] == VIDEO_ISA) { @@ -294,9 +294,11 @@ int video_res_x, video_res_y, video_bpp; void (*video_blit_memtoscreen_func)(int x, int y, int y1, int y2, int w, int h); void (*video_blit_memtoscreen_8_func)(int x, int y, int w, int h); -void video_init() + +void +video_reset(void) { - pclog("Video_init %i %i\n",romset,gfxcard); + pclog("Video_reset(rom=%i, gfx=%i)\n", romset, gfxcard); #ifndef __unix cga_palette = 0; @@ -533,7 +535,8 @@ int calc_16to32(int c) return (b | g | r); } -void initvideo() +void +video_init(void) { int c, d, e; @@ -604,7 +607,8 @@ void initvideo() blit_data.blit_thread = thread_create(blit_thread, NULL); } -void closevideo() +void +video_close(void) { thread_kill(blit_data.blit_thread); thread_destroy_event(blit_data.buffer_not_in_use); @@ -636,19 +640,19 @@ static void blit_thread(void *param) } } -void video_blit_complete() +void video_blit_complete(void) { blit_data.buffer_in_use = 0; thread_set_event(blit_data.buffer_not_in_use); } -void video_wait_for_blit() +void video_wait_for_blit(void) { while (blit_data.busy) thread_wait_event(blit_data.blit_complete, -1); thread_reset_event(blit_data.blit_complete); } -void video_wait_for_buffer() +void video_wait_for_buffer(void) { while (blit_data.buffer_in_use) thread_wait_event(blit_data.buffer_not_in_use, -1); @@ -686,27 +690,6 @@ void video_blit_memtoscreen_8(int x, int y, int w, int h) thread_set_event(blit_data.wake_blit_thread); } -#ifdef __unix -void d3d_fs_take_screenshot(char *fn) -{ -} - -void d3d_take_screenshot(char *fn) -{ -} - -void ddraw_fs_take_screenshot(char *fn) -{ -} - -void ddraw_take_screenshot(char *fn) -{ -} - -void take_screenshot() -{ -} -#else time_t now; struct tm *info; wchar_t screenshot_fn_partial[2048]; @@ -763,4 +746,3 @@ void take_screenshot(void) } } } -#endif diff --git a/src/video/video.h b/src/video/video.h index 53cb98c5c..38b998ef4 100644 --- a/src/video/video.h +++ b/src/video/video.h @@ -1,11 +1,6 @@ /* Copyright holders: Sarah Walker, Tenshi see COPYING for more details */ -#ifdef __unix - -#include "allegro-main.h" - -#else typedef struct { @@ -28,7 +23,6 @@ typedef RGB PALETTE[256]; #define makecol(r, g, b) ((b) | ((g) << 8) | ((r) << 16)) #define makecol32(r, g, b) ((b) | ((g) << 8) | ((r) << 16)) -#endif extern BITMAP *buffer, *buffer32; @@ -92,15 +86,15 @@ extern int video_res_x, video_res_y, video_bpp; extern int vid_resize; -void video_wait_for_blit(); -void video_wait_for_buffer(); +void video_wait_for_blit(void); +void video_wait_for_buffer(void); extern int winsizex,winsizey; #ifdef __cplusplus extern "C" { #endif -void take_screenshot(); +void take_screenshot(void); void d3d_take_screenshot(wchar_t *fn); void d3d_fs_take_screenshot(wchar_t *fn); @@ -117,14 +111,14 @@ extern int video_grayscale; extern int video_graytype; void loadfont(wchar_t *s, int format); -void initvideo(); -void video_init(); -void closevideo(); -void video_updatetiming(); +void video_init(void); +void video_close(void); +void video_reset(void); +void video_updatetiming(void); void hline(BITMAP *b, int x1, int y, int x2, uint32_t col); void updatewindowsize(int x, int y); #ifdef ENABLE_VRAM_DUMP -void svga_dump_vram(); +void svga_dump_vram(void); #endif diff --git a/src/win/86Box.rc b/src/win/86Box.rc index bf95429d8..3cbfe7744 100644 --- a/src/win/86Box.rc +++ b/src/win/86Box.rc @@ -8,7 +8,7 @@ * * Windows resource script. * - * Version: @(#)86Box.rc 1.0.10 2017/09/23 + * Version: @(#)86Box.rc 1.0.11 2017/09/30 * * Authors: Miran Grca, * Fred N. van Kempen, @@ -833,7 +833,7 @@ BEGIN IDS_2151 "Disabled" IDS_2152 "None" IDS_2153 "AT Fixed Disk Adapter" - IDS_2154 "Internal IDE" + IDS_2154 "Internal Controller" IDS_2155 "IRQ %i" IDS_2156 "%" PRIu64 IDS_2157 "%" PRIu64 " MB (CHS: %" PRIu64 ", %" PRIu64 ", %" PRIu64 ")" diff --git a/src/win/win.c b/src/win/win.c index 9e97896c3..43e2846f0 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -8,7 +8,7 @@ * * The Emulator's Windows core. * - * Version: @(#)win.c 1.0.13 2017/09/29 + * Version: @(#)win.c 1.0.13 2017/09/30 * * Authors: Sarah Walker, * Miran Grca, @@ -1110,7 +1110,7 @@ int display_network_icon(void) void update_status_bar_panes(HWND hwnds) { - int i, id; + int i, id, hdint; int edge = 0; int c_mfm = 0; @@ -1119,20 +1119,19 @@ void update_status_bar_panes(HWND hwnds) int c_ide_pio = 0; int c_ide_dma = 0; int c_scsi = 0; - #ifdef USE_NETWORK int do_net = 0; #endif sb_ready = 0; + hdint = (machines[machine].flags & MACHINE_HAS_HDC) ? 1 : 0; c_mfm = hdd_count(HDD_BUS_MFM); c_esdi = hdd_count(HDD_BUS_ESDI); c_xtide = hdd_count(HDD_BUS_XTIDE); c_ide_pio = hdd_count(HDD_BUS_IDE_PIO_ONLY); c_ide_dma = hdd_count(HDD_BUS_IDE_PIO_AND_DMA); c_scsi = hdd_count(HDD_BUS_SCSI); - #ifdef USE_NETWORK do_net = display_network_icon(); #endif @@ -1182,11 +1181,15 @@ void update_status_bar_panes(HWND hwnds) } for (i = 0; i < CDROM_NUM; i++) { - if ((cdrom_drives[i].bus_type == CDROM_BUS_ATAPI_PIO_ONLY) && !(machines[machine].flags & MACHINE_HAS_IDE)) + /* Could be Internal or External IDE.. */ + if ((cdrom_drives[i].bus_type==CDROM_BUS_ATAPI_PIO_ONLY) && + !(hdint || !memcmp(hdc_name, "ide", 3))) { continue; } - if ((cdrom_drives[i].bus_type == CDROM_BUS_ATAPI_PIO_AND_DMA) && !(machines[machine].flags & MACHINE_HAS_IDE)) + /* Could be Internal or External IDE.. */ + if ((cdrom_drives[i].bus_type==CDROM_BUS_ATAPI_PIO_AND_DMA) && + !(hdint || !memcmp(hdc_name, "ide", 3))) { continue; } @@ -1206,24 +1209,28 @@ void update_status_bar_panes(HWND hwnds) sb_parts++; } } - if (c_mfm && !(machines[machine].flags & MACHINE_HAS_IDE) && !!memcmp(hdc_name, "none", 4) && !!memcmp(hdc_name, "xtide", 5) && !!memcmp(hdc_name, "esdi", 4)) + if (c_mfm && (hdint || !memcmp(hdc_name, "mfm", 3))) { + /* MFM drives, and MFM or Internal controller. */ sb_parts++; } - if (c_esdi && !memcmp(hdc_name, "esdi", 4)) + if (c_esdi && (hdint || !memcmp(hdc_name, "esdi", 4))) { + /* ESDI drives, and ESDI or Internal controller. */ sb_parts++; } if (c_xtide && !memcmp(hdc_name, "xtide", 5)) { sb_parts++; } - if (c_ide_pio && (machines[machine].flags & MACHINE_HAS_IDE)) + if (c_ide_pio && (hdint || !memcmp(hdc_name, "ide", 3))) { + /* IDE_PIO drives, and IDE or Internal controller. */ sb_parts++; } - if (c_ide_dma && (machines[machine].flags & MACHINE_HAS_IDE)) + if (c_ide_dma && (hdint || !memcmp(hdc_name, "ide", 3))) { + /* IDE_DMA drives, and IDE or Internal controller. */ sb_parts++; } if (c_scsi && (scsi_card_current != 0)) @@ -1267,11 +1274,15 @@ void update_status_bar_panes(HWND hwnds) } for (i = 0; i < CDROM_NUM; i++) { - if ((cdrom_drives[i].bus_type == CDROM_BUS_ATAPI_PIO_ONLY) && !(machines[machine].flags & MACHINE_HAS_IDE)) + /* Could be Internal or External IDE.. */ + if ((cdrom_drives[i].bus_type==CDROM_BUS_ATAPI_PIO_ONLY) && + !(hdint || !memcmp(hdc_name, "ide", 3))) { continue; } - if ((cdrom_drives[i].bus_type == CDROM_BUS_ATAPI_PIO_AND_DMA) && !(machines[machine].flags & MACHINE_HAS_IDE)) + /* Could be Internal or External IDE.. */ + if ((cdrom_drives[i].bus_type==CDROM_BUS_ATAPI_PIO_AND_DMA) && + !(hdint || !memcmp(hdc_name, "ide", 3))) { continue; } @@ -1297,14 +1308,14 @@ void update_status_bar_panes(HWND hwnds) sb_parts++; } } - if (c_mfm && !(machines[machine].flags & MACHINE_HAS_IDE) && !!memcmp(hdc_name, "none", 4) && !!memcmp(hdc_name, "xtide", 5) && !!memcmp(hdc_name, "esdi", 4)) + if (c_mfm && (hdint || !memcmp(hdc_name, "mfm", 3))) { edge += SB_ICON_WIDTH; iStatusWidths[sb_parts] = edge; sb_part_meanings[sb_parts] = SB_HDD | HDD_BUS_MFM; sb_parts++; } - if (c_esdi && !memcmp(hdc_name, "esdi", 4)) + if (c_esdi && (hdint || !memcmp(hdc_name, "esdi", 4))) { edge += SB_ICON_WIDTH; iStatusWidths[sb_parts] = edge; @@ -1318,14 +1329,14 @@ void update_status_bar_panes(HWND hwnds) sb_part_meanings[sb_parts] = SB_HDD | HDD_BUS_XTIDE; sb_parts++; } - if (c_ide_pio && (machines[machine].flags & MACHINE_HAS_IDE)) + if (c_ide_pio && (hdint || !memcmp(hdc_name, "ide", 3))) { edge += SB_ICON_WIDTH; iStatusWidths[sb_parts] = edge; sb_part_meanings[sb_parts] = SB_HDD | HDD_BUS_IDE_PIO_ONLY; sb_parts++; } - if (c_ide_dma && (machines[machine].flags & MACHINE_HAS_IDE)) + if (c_ide_dma && (hdint || !memcmp(hdc_name, "ide", 3))) { edge += SB_ICON_WIDTH; iStatusWidths[sb_parts] = edge; diff --git a/src/win/win_settings.c b/src/win/win_settings.c index a4f234c6a..88e49a413 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -8,7 +8,7 @@ * * Windows 86Box Settings dialog handler. * - * Version: @(#)win_settings.c 1.0.14 2017/09/29 + * Version: @(#)win_settings.c 1.0.14 2017/09/30 * * Author: Miran Grca, * Copyright 2016,2017 Miran Grca. @@ -82,8 +82,9 @@ static int temp_serial[2], temp_lpt; /* Peripherals category */ static int temp_scsi_card, hdc_ignore, temp_ide_ter, temp_ide_ter_irq, temp_ide_qua, temp_ide_qua_irq; -static int temp_bugger; static char temp_hdc_name[16]; +static char *hdc_names[16]; +static int temp_bugger; /* Hard disks category */ static hard_disk_t temp_hdd[HDD_NUM]; @@ -96,8 +97,6 @@ static cdrom_drive_t temp_cdrom_drives[CDROM_NUM]; static HWND hwndParentDialog, hwndChildDialog; -int hdd_controller_current; - static int displayed_category = 0; extern int is486; @@ -109,7 +108,6 @@ static int settings_scsi_to_list[20], settings_list_to_scsi[20]; #ifdef USE_NETWORK static int settings_network_to_list[20], settings_list_to_network[20]; #endif -static char *hdc_names[16]; /* This does the initial read of global variables into the temporary ones. */ @@ -1385,7 +1383,7 @@ static BOOL CALLBACK win_settings_ports_proc(HWND hdlg, UINT message, WPARAM wPa } -static void recalc_hdd_list(HWND hdlg, int machine, int use_selected_hdc) +static void recalc_hdc_list(HWND hdlg, int machine, int use_selected_hdc) { HWND h; @@ -1400,17 +1398,25 @@ static void recalc_hdd_list(HWND hdlg, int machine, int use_selected_hdc) h = GetDlgItem(hdlg, IDC_COMBO_HDC); - if (machines[temp_machine].flags & MACHINE_HAS_IDE) +#if 0 + /* + * We do not ignore this entry, nor do we zap the selection + * list, as we might want to override the internal controller + * with an external one. --FvK + */ + if (machines[temp_machine].flags & MACHINE_HAS_HDC) { hdc_ignore = 1; SendMessage(h, CB_RESETCONTENT, 0, 0); SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_2154)); + /* See above, don't disable it. */ EnableWindow(h, FALSE); - SendMessage(h, CB_SETCURSEL, 0, 0); + SendMessage(h, CB_SETCURSEL, 1, 0); } else { +#endif hdc_ignore = 0; valid = 0; @@ -1462,11 +1468,13 @@ static void recalc_hdd_list(HWND hdlg, int machine, int use_selected_hdc) c++; continue; } +#if 0 if (c < 2) { SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(2152 + c)); } else +#endif { mbstowcs(lptsTemp, s, strlen(s) + 1); SendMessage(h, CB_ADDSTRING, 0, (LPARAM) lptsTemp); @@ -1487,7 +1495,10 @@ static void recalc_hdd_list(HWND hdlg, int machine, int use_selected_hdc) } EnableWindow(h, TRUE); +#if 0 + if (machines[temp_machine].flags & MACHINE_HAS_HDC) } +#endif free(lptsTemp); } @@ -1573,7 +1584,7 @@ static BOOL CALLBACK win_settings_peripherals_proc(HWND hdlg, UINT message, WPAR EnableWindow(h, FALSE); } - recalc_hdd_list(hdlg, temp_machine, 0); + recalc_hdc_list(hdlg, temp_machine, 0); h=GetDlgItem(hdlg, IDC_COMBO_IDE_TER); SendMessage(h, CB_ADDSTRING, 0, (LPARAM) win_language_get_string_from_id(IDS_5376)); @@ -1925,7 +1936,7 @@ static void normalize_hd_list() int i, j; j = 0; - memset(ihdd, 0, HDD_NUM * sizeof(hard_disk_t)); + memset(ihdd, 0x00, HDD_NUM * sizeof(hard_disk_t)); for (i = 0; i < HDD_NUM; i++) {