Extensively cleaned up and changed the CD-ROM code; Removed CD-ROM IOCTTL (it was causing performance and stability issues); Turned a lot of things into device_t's; Added the PS/1 Model 2011 XTA and standalone XTA hard disk controllers, ported from Varcem; Numerous FDC fixes for the PS/1 Model 2121; NVR changes ported from Varcem; The PCap code no longer requires libpcap to be compiled; Numerous fixes to various SCSI controllers; Updated NukedOPL to 1.8; Fixes to OpenAL initialization and closing, should give less Audio issues now; Revorked parts of the common (S)VGA code (also based on code from QEMU); Removed the Removable SCSI hard disks (they were a never finished experiment so there was no need to keep them there); Cleaned up the SCSI hard disk and Iomega ZIP code (but more cleanups of that are coming in the future); In some occasions (IDE hard disks in multiple sector mode and SCSI hard disks) the status bar icon is no longer updated, should improve performance a bit; Redid the way the tertiary and quaternary IDE controllers are configured (and they are now device_t's); Extensively reworked the IDE code and fixed quite a few bugs; Fixes to XT MFM, AT MFM, and AT ESDI code; Some changes to XTIDE and MCA ESDI code; Some fixes to the CD-ROM image handler.
162 lines
2.5 KiB
C
162 lines
2.5 KiB
C
/*
|
|
* 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 CD-ROM null interface for unmounted
|
|
* guest CD-ROM drives.
|
|
*
|
|
* Version: @(#)cdrom_null.c 1.0.7 2018/03/26
|
|
*
|
|
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
|
|
* Miran Grca, <mgrca8@gmail.com>
|
|
*
|
|
* Copyright 2008-2016 Sarah Walker.
|
|
* Copyright 2016-2018 Miran Grca.
|
|
*/
|
|
#include <stdio.h>
|
|
#include <stdint.h>
|
|
#include <string.h>
|
|
#include <wchar.h>
|
|
#include "../86box.h"
|
|
#include "../scsi/scsi.h"
|
|
#include "cdrom.h"
|
|
|
|
|
|
static CDROM null_cdrom;
|
|
|
|
|
|
static int
|
|
null_ready(uint8_t id)
|
|
{
|
|
return(0);
|
|
}
|
|
|
|
|
|
/* Always return 0, the contents of a null CD-ROM drive never change. */
|
|
static int
|
|
null_medium_changed(uint8_t id)
|
|
{
|
|
return(0);
|
|
}
|
|
|
|
|
|
static uint8_t
|
|
null_getcurrentsubchannel(uint8_t id, uint8_t *b, int msf)
|
|
{
|
|
return(0x13);
|
|
}
|
|
|
|
|
|
static int
|
|
null_readsector_raw(uint8_t id, uint8_t *buffer, int sector, int ismsf, int cdrom_sector_type, int cdrom_sector_flags, int *len)
|
|
{
|
|
*len = 0;
|
|
|
|
return(0);
|
|
}
|
|
|
|
|
|
static int
|
|
null_readtoc(uint8_t id, uint8_t *b, uint8_t starttrack, int msf, int maxlen, int single)
|
|
{
|
|
return(0);
|
|
}
|
|
|
|
|
|
static int
|
|
null_readtoc_session(uint8_t id, uint8_t *b, int msf, int maxlen)
|
|
{
|
|
return(0);
|
|
}
|
|
|
|
|
|
static int
|
|
null_readtoc_raw(uint8_t id, uint8_t *b, int maxlen)
|
|
{
|
|
return(0);
|
|
}
|
|
|
|
|
|
static uint32_t
|
|
null_size(uint8_t id)
|
|
{
|
|
return(0);
|
|
}
|
|
|
|
|
|
static int
|
|
null_status(uint8_t id)
|
|
{
|
|
return(CD_STATUS_EMPTY);
|
|
}
|
|
|
|
|
|
void
|
|
cdrom_null_reset(uint8_t id)
|
|
{
|
|
}
|
|
|
|
|
|
void cdrom_set_null_handler(uint8_t id);
|
|
|
|
int
|
|
cdrom_null_open(uint8_t id)
|
|
{
|
|
cdrom_set_null_handler(id);
|
|
|
|
return(0);
|
|
}
|
|
|
|
|
|
void
|
|
null_close(uint8_t id)
|
|
{
|
|
}
|
|
|
|
|
|
static
|
|
void null_exit(uint8_t id)
|
|
{
|
|
}
|
|
|
|
|
|
static int
|
|
null_media_type_id(uint8_t id)
|
|
{
|
|
return(0x70);
|
|
}
|
|
|
|
|
|
void
|
|
cdrom_set_null_handler(uint8_t id)
|
|
{
|
|
cdrom[id]->handler = &null_cdrom;
|
|
cdrom_drives[id].host_drive = 0;
|
|
memset(cdrom_image[id].image_path, 0, sizeof(cdrom_image[id].image_path));
|
|
}
|
|
|
|
|
|
static CDROM null_cdrom = {
|
|
null_ready,
|
|
null_medium_changed,
|
|
null_media_type_id,
|
|
NULL,
|
|
NULL,
|
|
null_readtoc,
|
|
null_readtoc_session,
|
|
null_readtoc_raw,
|
|
null_getcurrentsubchannel,
|
|
null_readsector_raw,
|
|
NULL,
|
|
NULL,
|
|
NULL,
|
|
null_size,
|
|
null_status,
|
|
NULL,
|
|
null_exit
|
|
};
|