Various small fixes.

This commit is contained in:
waltje
2018-09-21 23:35:10 -04:00
parent eb1de7d326
commit 98a9f34131
9 changed files with 54 additions and 28 deletions

View File

@@ -9,7 +9,7 @@
* Implementation of the CD-ROM drive with SCSI(-like) * Implementation of the CD-ROM drive with SCSI(-like)
* commands, for both ATAPI and SCSI usage. * commands, for both ATAPI and SCSI usage.
* *
* Version: @(#)cdrom.c 1.0.15 2018/05/08 * Version: @(#)cdrom.c 1.0.16 2018/09/21
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -145,7 +145,7 @@ const cdrom_speed_t cdrom_speeds[] = {
#pragma pack(push,1) #pragma pack(push,1)
static struct typedef struct
{ {
uint8_t opcode; uint8_t opcode;
uint8_t polled; uint8_t polled;
@@ -154,16 +154,16 @@ static struct
uint8_t reserved3[2]; uint8_t reserved3[2];
uint16_t len; uint16_t len;
uint8_t control; uint8_t control;
} *gesn_cdb; } gesn_cdb_t;
#pragma pack(pop) #pragma pack(pop)
#pragma pack(push,1) #pragma pack(push,1)
static struct typedef struct
{ {
uint16_t len; uint16_t len;
uint8_t notification_class; uint8_t notification_class;
uint8_t supported_events; uint8_t supported_events;
} *gesn_event_header; } gesn_event_header_t;
#pragma pack(pop) #pragma pack(pop)
@@ -401,6 +401,8 @@ static const mode_sense_pages_t cdrom_mode_sense_pages_changeable =
} }; } };
static mode_sense_pages_t cdrom_mode_sense_pages_saved[CDROM_NUM]; static mode_sense_pages_t cdrom_mode_sense_pages_saved[CDROM_NUM];
static gesn_cdb_t *gesn_cdb;
static gesn_event_header_t *gesn_event_header;
#ifdef ENABLE_CDROM_LOG #ifdef ENABLE_CDROM_LOG
@@ -2282,7 +2284,7 @@ cdrom_readtoc_fallback:
case GPCMD_GET_EVENT_STATUS_NOTIFICATION: case GPCMD_GET_EVENT_STATUS_NOTIFICATION:
cdrom_set_phase(id, SCSI_PHASE_DATA_IN); cdrom_set_phase(id, SCSI_PHASE_DATA_IN);
cdrom_buf_alloc(id, 8 + sizeof(gesn_event_header)); cdrom_buf_alloc(id, 8 + sizeof(gesn_event_header_t));
gesn_cdb = (void *) cdb; gesn_cdb = (void *) cdb;
gesn_event_header = (void *) cdbufferb; gesn_event_header = (void *) cdbufferb;

View File

@@ -9,7 +9,7 @@
* Implementation of the NEC uPD-765 and compatible floppy disk * Implementation of the NEC uPD-765 and compatible floppy disk
* controller. * controller.
* *
* Version: @(#)fdc.c 1.0.14 2018/06/25 * Version: @(#)fdc.c 1.0.15 2018/09/21
* *
* Authors: Miran Grca, <mgrca8@gmail.com> * Authors: Miran Grca, <mgrca8@gmail.com>
* Sarah Walker, <tommowalker@tommowalker.co.uk> * Sarah Walker, <tommowalker@tommowalker.co.uk>
@@ -1233,8 +1233,8 @@ fdc_write(uint16_t addr, uint8_t val, void *priv)
return; return;
case 7: case 7:
if (! (fdc->flags & FDC_FLAG_AT)) if (!(fdc->flags & FDC_FLAG_AT) &&
return; !(fdc->flags & FDC_FLAG_TOSHIBA)) return;
fdc->rate = val & 3; fdc->rate = val & 3;
return; return;
} }
@@ -1341,13 +1341,22 @@ fdc_read(uint16_t addr, void *priv)
case 7: /*Disk change*/ case 7: /*Disk change*/
drive = real_drive(fdc, fdc->dor & 3); drive = real_drive(fdc, fdc->dor & 3);
ret = 0x00;
if (fdc->flags & FDC_FLAG_TOSHIBA) {
/*
* T1200 only has the DSCH bit set for the
* internal 3.5" drive, otherwise it is 0.
*/
if ((drive == 0) && (fdc->dor & (0x10 << drive)))
ret = (fdd_changed[drive] || drive_empty[drive]) ? 0x80 : 0x00;
} else {
if (fdc->dor & (0x10 << drive)) if (fdc->dor & (0x10 << drive))
ret = (fdd_changed[drive] || drive_empty[drive])?0x80:0; ret = (fdd_changed[drive] || drive_empty[drive])?0x80:0;
else
ret = 0;
if (fdc->flags & FDC_FLAG_DISKCHG_ACTLOW) if (fdc->flags & FDC_FLAG_DISKCHG_ACTLOW)
ret ^= 0x80; ret ^= 0x80;
ret |= 0x01; ret |= 0x01;
}
break; break;
default: default:
@@ -2076,6 +2085,8 @@ fdc_set_base(fdc_t *fdc, int base)
io_sethandler(base+2, 1, NULL,NULL,NULL, fdc_write,NULL,NULL, fdc); io_sethandler(base+2, 1, NULL,NULL,NULL, fdc_write,NULL,NULL, fdc);
io_sethandler(base+4, 1, fdc_read,NULL,NULL, NULL,NULL,NULL, fdc); io_sethandler(base+4, 1, fdc_read,NULL,NULL, NULL,NULL,NULL, fdc);
io_sethandler(base+5, 1, fdc_read,NULL,NULL, fdc_write,NULL,NULL, fdc); io_sethandler(base+5, 1, fdc_read,NULL,NULL, fdc_write,NULL,NULL, fdc);
if (fdc->flags & FDC_FLAG_TOSHIBA)
io_sethandler(base+7, 1, fdc_read,NULL,NULL, fdc_write,NULL,NULL, fdc);
} }
fdc->base_address = base; fdc->base_address = base;
@@ -2101,6 +2112,8 @@ fdc_remove(fdc_t *fdc)
fdc_read,NULL,NULL, NULL,NULL,NULL, fdc); fdc_read,NULL,NULL, NULL,NULL,NULL, fdc);
io_removehandler(fdc->base_address+5, 1, io_removehandler(fdc->base_address+5, 1,
fdc_read,NULL,NULL, fdc_write,NULL,NULL, fdc); fdc_read,NULL,NULL, fdc_write,NULL,NULL, fdc);
if (fdc->flags & FDC_FLAG_TOSHIBA)
io_removehandler(fdc->base_address+7, 1, fdc_read,NULL,NULL, fdc_write,NULL,NULL, fdc);
} }
fdc_log("FDC: removed (%04X)\n", fdc->base_address); fdc_log("FDC: removed (%04X)\n", fdc->base_address);
@@ -2229,6 +2242,15 @@ const device_t fdc_xt_device = {
NULL NULL
}; };
const device_t fdc_xt_toshiba_device = {
"Toshiba TC8565 Floppy Drive Controller",
0,
FDC_FLAG_TOSHIBA,
fdc_init, fdc_close, fdc_reset,
NULL, NULL, NULL, NULL,
NULL
};
const device_t fdc_pcjr_device = { const device_t fdc_pcjr_device = {
"PCjr Floppy Drive Controller", "PCjr Floppy Drive Controller",
0, 0,

View File

@@ -9,7 +9,7 @@
* Implementation of the NEC uPD-765 and compatible floppy disk * Implementation of the NEC uPD-765 and compatible floppy disk
* controller. * controller.
* *
* Version: @(#)fdc.h 1.0.3 2018/03/17 * Version: @(#)fdc.h 1.0.4 2018/09/21
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -49,6 +49,7 @@
#define FDC_FLAG_START_RWC_1 0x20 /* W83877F, W83977F */ #define FDC_FLAG_START_RWC_1 0x20 /* W83877F, W83977F */
#define FDC_FLAG_MORE_TRACKS 0x40 /* W83877F, W83977F, PC87306, PC87309 */ #define FDC_FLAG_MORE_TRACKS 0x40 /* W83877F, W83977F, PC87306, PC87309 */
#define FDC_FLAG_NSC 0x80 /* PC87306, PC87309 */ #define FDC_FLAG_NSC 0x80 /* PC87306, PC87309 */
#define FDC_FLAG_TOSHIBA 0x100 /* Toshiba TC8565 */
typedef struct { typedef struct {
@@ -181,6 +182,7 @@ extern uint8_t fdc_ps1_525(void);
#ifdef EMU_DEVICE_H #ifdef EMU_DEVICE_H
extern const device_t fdc_xt_device; extern const device_t fdc_xt_device;
extern const device_t fdc_xt_toshiba_device;
extern const device_t fdc_pcjr_device; extern const device_t fdc_pcjr_device;
extern const device_t fdc_at_device; extern const device_t fdc_at_device;
extern const device_t fdc_at_actlow_device; extern const device_t fdc_at_actlow_device;

View File

@@ -11,7 +11,7 @@
* NOTES: For now ported from PCem with some modifications * NOTES: For now ported from PCem with some modifications
* but at least it's a start. * but at least it's a start.
* *
* Version: @(#)scsi_bus.c 1.0.2 2018/05/06 * Version: @(#)scsi_bus.c 1.0.3 2018/09/21
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -85,7 +85,7 @@ scsi_bus_log(const char *fmt, ...)
/* get the length of a SCSI command based on its command byte type */ /* get the length of a SCSI command based on its command byte type */
static int get_cmd_len(int cbyte) static int get_cmd_len(int cbyte)
{ {
int len; int len = -1;
int group; int group;
group = (cbyte>>5) & 7; group = (cbyte>>5) & 7;

View File

@@ -10,7 +10,7 @@
* *
* Misidentifies as AT&T 21C504. * Misidentifies as AT&T 21C504.
* *
* Version: @(#)vid_sdac_ramdac.c 1.0.4 2018/05/06 * Version: @(#)vid_sdac_ramdac.c 1.0.5 2018/09/21
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -138,7 +138,7 @@ void sdac_ramdac_out(uint16_t addr, uint8_t val, sdac_ramdac_t *ramdac, svga_t *
uint8_t sdac_ramdac_in(uint16_t addr, sdac_ramdac_t *ramdac, svga_t *svga) uint8_t sdac_ramdac_in(uint16_t addr, sdac_ramdac_t *ramdac, svga_t *svga)
{ {
uint8_t temp; uint8_t temp = 0xff;
switch (addr) switch (addr)
{ {
case 2: case 2:

View File

@@ -50,7 +50,7 @@
* *
* FIXME: The ROM drive should be re-done using the "option file". * FIXME: The ROM drive should be re-done using the "option file".
* *
* Version: @(#)m_xt_t1000.c 1.0.13 2018/05/06 * Version: @(#)m_xt_t1000.c 1.0.14 2018/09/21
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -1032,7 +1032,7 @@ machine_xt_t1200_init(const machine_t *model, void *arg)
pit_set_out_func(&pit, 1, pit_refresh_timer_xt); pit_set_out_func(&pit, 1, pit_refresh_timer_xt);
device_add(&keyboard_xt_device); device_add(&keyboard_xt_device);
t1000.fdc = device_add(&fdc_xt_device); t1000.fdc = device_add(&fdc_xt_toshiba_device);
nmi_init(); nmi_init();
tc8521_init(&t1000.nvr, model->nvrsz); tc8521_init(&t1000.nvr, model->nvrsz);

View File

@@ -12,7 +12,7 @@
* the DYNAMIC_TABLES=1 enables this. Will eventually go * the DYNAMIC_TABLES=1 enables this. Will eventually go
* away, either way... * away, either way...
* *
* Version: @(#)mem.c 1.0.20 2018/09/03 * Version: @(#)mem.c 1.0.21 2018/09/19
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>

View File

@@ -79,9 +79,9 @@
#define STR_2303 "The configured machine:\n\n %ls\n\nis not available.\n\nWould you like to enter the Settings dialog?" #define STR_2303 "The configured machine:\n\n %ls\n\nis not available.\n\nWould you like to enter the Settings dialog?"
#define STR_2304 "Configured video card:\n\n %ls\n\nis not available.\n\nWould you like to enter the Settings dialog?" #define STR_2304 "Configured video card:\n\n %ls\n\nis not available.\n\nWould you like to enter the Settings dialog?"
#define STR_2305 "Selected renderer '%S' not available. Reset to default?" #define STR_2305 "Selected renderer '%S' not available. Reset to default?"
#define STR_2306 "ST506 or ESDI CD-ROM drives never existed" #define STR_2306 "ST506/ESDI CDROM drives never existed!"
#define STR_2307 "USB is not yet supported" #define STR_2307 "USB is not yet supported"
#define STR_2308 "You must save your new settings first!" #define STR_2308 "You must save your settings first!"
/* Application messages (2400.) */ /* Application messages (2400.) */

View File

@@ -12,7 +12,7 @@
* they are not referenced outside of the platform UI. This * they are not referenced outside of the platform UI. This
* may change at some point. * may change at some point.
* *
* Version: @(#)ui_resource.h 1.0.15 2018/09/03 * Version: @(#)ui_resource.h 1.0.16 2018/09/21
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -221,7 +221,7 @@
#define IDS_ERR_NOMACH 2303 // "Configured machine not avai.." #define IDS_ERR_NOMACH 2303 // "Configured machine not avai.."
#define IDS_ERR_NOVIDEO 2304 // "Configured video card not.." #define IDS_ERR_NOVIDEO 2304 // "Configured video card not.."
#define IDS_ERR_NORENDR 2305 // "Selected renderer not avai.." #define IDS_ERR_NORENDR 2305 // "Selected renderer not avai.."
#define IDS_ERR_NOCDROM 2306 // "ST506 or ESDI CD-ROM driv.." #define IDS_ERR_NOCDROM 2306 // "ST506/ESDI CDROM drives.."
#define IDS_ERR_NO_USB 2307 // "USB is not yet supported" #define IDS_ERR_NO_USB 2307 // "USB is not yet supported"
#define IDS_ERR_SAVEIT 2308 // "Must save new config first.." #define IDS_ERR_SAVEIT 2308 // "Must save new config first.."