summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/nscsi_cd.h
blob: 1299d9bfd8b1b08392e52e5132fe5c0f2c25a6bd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// license:BSD-3-Clause
// copyright-holders:Olivier Galibert
#ifndef __NSCSI_CD_H__
#define __NSCSI_CD_H__

#include "machine/nscsi_bus.h"
#include "cdrom.h"

class nscsi_cdrom_device : public nscsi_full_device
{
public:
	nscsi_cdrom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
	virtual machine_config_constructor device_mconfig_additions() const override;

protected:
	virtual void device_start() override;
	virtual void device_reset() override;

	virtual void scsi_command() override;
	virtual uint8_t scsi_get_data(int id, int pos) override;

private:
	uint8_t block[2048];
	cdrom_file *cdrom;
	int bytes_per_sector;
	int lba, cur_lba, blocks;

	void return_no_cd();
};

extern const device_type NSCSI_CDROM;

#endif