Merge remote-tracking branch 'origin/master' into version/4.1
This commit is contained in:
@@ -531,7 +531,7 @@ cdrom_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len, int ismsf)
|
||||
f = pos & 0xff;
|
||||
|
||||
/* NEC CDR-260 speaks BCD. */
|
||||
if (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01") || (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00"))) /*NEC*/
|
||||
if ((dev->type == CDROM_TYPE_NEC_260_100) || (dev->type == CDROM_TYPE_NEC_260_101)) /*NEC*/
|
||||
msf_from_bcd(&m, &s, &f);
|
||||
|
||||
if (pos == 0xffffff) {
|
||||
@@ -545,7 +545,7 @@ cdrom_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len, int ismsf)
|
||||
f = len & 0xff;
|
||||
|
||||
/* NEC CDR-260 speaks BCD. */
|
||||
if (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01") || (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00"))) /*NEC*/
|
||||
if ((dev->type == CDROM_TYPE_NEC_260_100) || (dev->type == CDROM_TYPE_NEC_260_101)) /*NEC*/
|
||||
msf_from_bcd(&m, &s, &f);
|
||||
|
||||
len = MSFtoLBA(m, s, f) - 150;
|
||||
@@ -571,7 +571,6 @@ cdrom_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len, int ismsf)
|
||||
dev->cd_end = len;
|
||||
dev->cd_status = CD_STATUS_PLAYING;
|
||||
dev->cd_buflen = 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -624,6 +623,52 @@ cdrom_audio_track_search(cdrom_t *dev, uint32_t pos, int type, uint8_t playbit)
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
cdrom_audio_track_search_pioneer(cdrom_t *dev, uint32_t pos, uint8_t playbit)
|
||||
{
|
||||
int m = 0;
|
||||
int s = 0;
|
||||
int f = 0;
|
||||
|
||||
if (dev->cd_status == CD_STATUS_DATA_ONLY)
|
||||
return 0;
|
||||
|
||||
f = bcd2bin((pos >> 24) & 0xff);
|
||||
s = bcd2bin((pos >> 16) & 0xff);
|
||||
m = bcd2bin((pos >> 8) & 0xff);
|
||||
if (pos == 0xffffffff) {
|
||||
pos = dev->seek_pos;
|
||||
} else
|
||||
pos = MSFtoLBA(m, s, f) - 150;
|
||||
|
||||
dev->seek_pos = pos;
|
||||
|
||||
dev->cd_buflen = 0;
|
||||
dev->cd_status = playbit ? CD_STATUS_PLAYING : CD_STATUS_PAUSED;
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
cdrom_audio_play_pioneer(cdrom_t *dev, uint32_t pos)
|
||||
{
|
||||
int m = 0;
|
||||
int s = 0;
|
||||
int f = 0;
|
||||
|
||||
if (dev->cd_status == CD_STATUS_DATA_ONLY)
|
||||
return 0;
|
||||
|
||||
f = bcd2bin((pos >> 24) & 0xff);
|
||||
s = bcd2bin((pos >> 16) & 0xff);
|
||||
m = bcd2bin((pos >> 8) & 0xff);
|
||||
pos = MSFtoLBA(m, s, f) - 150;
|
||||
dev->cd_end = pos;
|
||||
|
||||
dev->cd_buflen = 0;
|
||||
dev->cd_status = CD_STATUS_PLAYING;
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
cdrom_audio_play_toshiba(cdrom_t *dev, uint32_t pos, int type)
|
||||
{
|
||||
@@ -664,7 +709,6 @@ cdrom_audio_play_toshiba(cdrom_t *dev, uint32_t pos, int type)
|
||||
|
||||
/* Unlike standard commands, if there's a data track on an Audio CD (mixed mode)
|
||||
the playback continues with the audio muted (Toshiba CD-ROM SCSI-2 manual reference). */
|
||||
|
||||
dev->cd_buflen = 0;
|
||||
dev->cd_status = CD_STATUS_PLAYING;
|
||||
return 1;
|
||||
@@ -751,7 +795,7 @@ cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, int msf)
|
||||
ret = 0x13;
|
||||
}
|
||||
|
||||
cdrom_log("CD-ROM %i: Returned subchannel at %02i:%02i.%02i, ret = %02x, seek pos = %08x, cd_end = %08x.\n", dev->id, subc.abs_m, subc.abs_s, subc.abs_f, ret, dev->seek_pos, dev->cd_end);
|
||||
cdrom_log("CD-ROM %i: Returned subchannel absolute at %02i:%02i.%02i, relative at %02i:%02i.%02i, ret = %02x, seek pos = %08x, cd_end = %08x.\n", dev->id, subc.abs_m, subc.abs_s, subc.abs_f, subc.rel_m, subc.rel_s, subc.rel_f, ret, dev->seek_pos, dev->cd_end);
|
||||
|
||||
if (b[pos] > 1) {
|
||||
cdrom_log("B[%i] = %02x, ret = %02x.\n", pos, b[pos], ret);
|
||||
@@ -766,7 +810,7 @@ cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, int msf)
|
||||
b[pos] = 0;
|
||||
|
||||
/* NEC CDR-260 speaks BCD. */
|
||||
if (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01") || (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00"))) /*NEC*/ {
|
||||
if ((dev->type == CDROM_TYPE_NEC_260_100) || (dev->type == CDROM_TYPE_NEC_260_101)) { /*NEC*/
|
||||
m = subc.abs_m;
|
||||
s = subc.abs_s;
|
||||
f = subc.abs_f;
|
||||
@@ -785,7 +829,7 @@ cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, int msf)
|
||||
b[pos] = 0;
|
||||
|
||||
/* NEC CDR-260 speaks BCD. */
|
||||
if (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01") || (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00"))) /*NEC*/ {
|
||||
if ((dev->type == CDROM_TYPE_NEC_260_100) || (dev->type == CDROM_TYPE_NEC_260_101)) { /*NEC*/
|
||||
m = subc.rel_m;
|
||||
s = subc.rel_s;
|
||||
f = subc.rel_f;
|
||||
@@ -820,36 +864,62 @@ void
|
||||
cdrom_get_current_subchannel_sony(cdrom_t *dev, uint8_t *b, int msf)
|
||||
{
|
||||
subchannel_t subc;
|
||||
int pos = 0;
|
||||
uint32_t dat;
|
||||
|
||||
dev->ops->get_subchannel(dev, dev->seek_pos, &subc);
|
||||
|
||||
cdrom_log("CD-ROM %i: Returned subchannel at %02i:%02i.%02i, seek pos = %08x, cd_end = %08x.\n", dev->id, subc.abs_m, subc.abs_s, subc.abs_f, dev->seek_pos, dev->cd_end);
|
||||
cdrom_log("CD-ROM %i: Returned subchannel at %02i:%02i.%02i, seek pos = %08x, cd_end = %08x, msf = %x.\n", dev->id, subc.abs_m, subc.abs_s, subc.abs_f, dev->seek_pos, dev->cd_end, msf);
|
||||
|
||||
b[pos++] = subc.attr;
|
||||
b[pos++] = subc.track;
|
||||
b[pos++] = subc.index;
|
||||
b[0] = subc.attr;
|
||||
b[1] = subc.track;
|
||||
b[2] = subc.index;
|
||||
|
||||
if (msf) {
|
||||
b[pos++] = subc.rel_m;
|
||||
b[pos++] = subc.rel_s;
|
||||
b[pos++] = subc.rel_f;
|
||||
b[pos++] = subc.abs_m;
|
||||
b[pos++] = subc.abs_s;
|
||||
b[pos++] = subc.abs_f;
|
||||
b[3] = subc.rel_m;
|
||||
b[4] = subc.rel_s;
|
||||
b[5] = subc.rel_f;
|
||||
b[6] = subc.abs_m;
|
||||
b[7] = subc.abs_s;
|
||||
b[8] = subc.abs_f;
|
||||
} else {
|
||||
dat = MSFtoLBA(subc.rel_m, subc.rel_s, subc.rel_f);
|
||||
b[pos++] = (dat >> 16) & 0xff;
|
||||
b[pos++] = (dat >> 8) & 0xff;
|
||||
b[pos++] = dat & 0xff;
|
||||
b[3] = (dat >> 16) & 0xff;
|
||||
b[4] = (dat >> 8) & 0xff;
|
||||
b[5] = dat & 0xff;
|
||||
dat = MSFtoLBA(subc.abs_m, subc.abs_s, subc.abs_f) - 150;
|
||||
b[pos++] = (dat >> 16) & 0xff;
|
||||
b[pos++] = (dat >> 8) & 0xff;
|
||||
b[pos++] = dat & 0xff;
|
||||
b[6] = (dat >> 16) & 0xff;
|
||||
b[7] = (dat >> 8) & 0xff;
|
||||
b[8] = dat & 0xff;
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t
|
||||
cdrom_get_audio_status_pioneer(cdrom_t *dev, uint8_t *b)
|
||||
{
|
||||
uint8_t ret;
|
||||
subchannel_t subc;
|
||||
uint32_t dat;
|
||||
|
||||
dev->ops->get_subchannel(dev, dev->seek_pos, &subc);
|
||||
|
||||
if (dev->cd_status == CD_STATUS_DATA_ONLY)
|
||||
ret = 0x05;
|
||||
else {
|
||||
if (dev->cd_status == CD_STATUS_PLAYING)
|
||||
ret = dev->sound_on ? 0x00 : 0x02;
|
||||
else if (dev->cd_status == CD_STATUS_PAUSED)
|
||||
ret = 0x01;
|
||||
else
|
||||
ret = 0x03;
|
||||
}
|
||||
|
||||
b[0] = 0;
|
||||
b[1] = bin2bcd(subc.abs_m);
|
||||
b[2] = bin2bcd(subc.abs_s);
|
||||
b[3] = bin2bcd(subc.abs_f);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
cdrom_get_audio_status_sony(cdrom_t *dev, uint8_t *b, int msf)
|
||||
@@ -887,17 +957,36 @@ cdrom_get_audio_status_sony(cdrom_t *dev, uint8_t *b, int msf)
|
||||
return ret;
|
||||
}
|
||||
|
||||
uint8_t
|
||||
cdrom_get_current_subcodeq_playstatus(cdrom_t *dev, uint8_t *b)
|
||||
void
|
||||
cdrom_get_current_subcodeq(cdrom_t *dev, uint8_t *b)
|
||||
{
|
||||
uint8_t ret;
|
||||
uint8_t ret;
|
||||
subchannel_t subc;
|
||||
|
||||
dev->ops->get_subchannel(dev, dev->seek_pos, &subc);
|
||||
|
||||
cdrom_log("Get Current Subcode-q Play Status = %02x, op = %02x.\n", dev->cd_status, dev->audio_op);
|
||||
b[0] = subc.attr;
|
||||
b[1] = bin2bcd(subc.track);
|
||||
b[2] = bin2bcd(subc.index);
|
||||
b[3] = bin2bcd(subc.rel_m);
|
||||
b[4] = bin2bcd(subc.rel_s);
|
||||
b[5] = bin2bcd(subc.rel_f);
|
||||
b[6] = bin2bcd(subc.abs_m);
|
||||
b[7] = bin2bcd(subc.abs_s);
|
||||
b[8] = bin2bcd(subc.abs_f);
|
||||
}
|
||||
|
||||
if ((dev->cd_status == CD_STATUS_DATA_ONLY) || (dev->cd_status == CD_STATUS_PLAYING_COMPLETED))
|
||||
uint8_t
|
||||
cdrom_get_current_subcodeq_playstatus(cdrom_t *dev, uint8_t *b)
|
||||
{
|
||||
uint8_t ret;
|
||||
subchannel_t subc;
|
||||
|
||||
dev->ops->get_subchannel(dev, dev->seek_pos, &subc);
|
||||
|
||||
if ((dev->cd_status == CD_STATUS_DATA_ONLY) ||
|
||||
(dev->cd_status == CD_STATUS_PLAYING_COMPLETED) ||
|
||||
(dev->cd_status == CD_STATUS_STOPPED))
|
||||
ret = 0x03;
|
||||
else
|
||||
ret = (dev->cd_status == CD_STATUS_PLAYING) ? 0x00 : dev->audio_op;
|
||||
@@ -957,9 +1046,7 @@ read_toc_normal(cdrom_t *dev, unsigned char *b, unsigned char start_track, int m
|
||||
|
||||
/* No suitable starting track, return with error. */
|
||||
if (first_track == -1) {
|
||||
#ifdef ENABLE_CDROM_LOG
|
||||
cdrom_log(" [ERROR] No suitable track found\n");
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -976,7 +1063,7 @@ read_toc_normal(cdrom_t *dev, unsigned char *b, unsigned char start_track, int m
|
||||
b[len++] = 0;
|
||||
|
||||
/* NEC CDR-260 speaks BCD. */
|
||||
if (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.01") || (!strcmp(cdrom_drive_types[dev->type].internal_name, "NEC_CD-ROM_DRIVE260_1.00"))) { /*NEC*/
|
||||
if ((dev->type == CDROM_TYPE_NEC_260_100) || (dev->type == CDROM_TYPE_NEC_260_101)) { /*NEC*/
|
||||
m = ti.m;
|
||||
s = ti.s;
|
||||
f = ti.f;
|
||||
@@ -1128,9 +1215,7 @@ read_toc_sony(cdrom_t *dev, unsigned char *b, unsigned char start_track, int msf
|
||||
|
||||
/* No suitable starting track, return with error. */
|
||||
if (first_track == -1) {
|
||||
#ifdef ENABLE_CDROM_LOG
|
||||
cdrom_log(" [ERROR] No suitable track found\n");
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -1138,8 +1223,8 @@ read_toc_sony(cdrom_t *dev, unsigned char *b, unsigned char start_track, int msf
|
||||
cdrom_log(" tracks(%i) = %02X, %02X, %i:%02i.%02i\n", i, ti.attr, ti.number, ti.m, ti.s, ti.f);
|
||||
dev->ops->get_track_info(dev, i + 1, 0, &ti);
|
||||
|
||||
b[len++] = ti.attr;
|
||||
b[len++] = ti.number; /* track number */
|
||||
b[len++] = ti.attr;
|
||||
|
||||
if (msf) {
|
||||
b[len++] = 0;
|
||||
@@ -1154,7 +1239,6 @@ read_toc_sony(cdrom_t *dev, unsigned char *b, unsigned char start_track, int msf
|
||||
b[len++] = temp;
|
||||
}
|
||||
}
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
@@ -60,7 +60,53 @@ enum {
|
||||
CDROM_BUS_USB = 8
|
||||
};
|
||||
|
||||
#define KNOWN_CDROM_DRIVE_TYPES 35
|
||||
enum
|
||||
{
|
||||
CDROM_TYPE_86BOX_100,
|
||||
CDROM_TYPE_AZT_CDA46802I_115,
|
||||
CDROM_TYPE_BTC_BCD36XH_U10,
|
||||
CDROM_TYPE_GOLDSTAR_CRD_8160B_314,
|
||||
CDROM_TYPE_HITACHI_CDR_8130_0020,
|
||||
CDROM_TYPE_KENWOOD_UCR_421_208E,
|
||||
CDROM_TYPE_MATSHITA_587_7S13,
|
||||
CDROM_TYPE_MATSHITA_588_LS15,
|
||||
CDROM_TYPE_MATSHITA_571_10e,
|
||||
CDROM_TYPE_MATSHITA_572_10j,
|
||||
CDROM_TYPE_MITSUMI_FX4820T_D02A,
|
||||
CDROM_TYPE_NEC_260_100,
|
||||
CDROM_TYPE_NEC_260_101,
|
||||
CDROM_TYPE_NEC_273_420,
|
||||
CDROM_TYPE_NEC_280_105,
|
||||
CDROM_TYPE_NEC_280_308,
|
||||
CDROM_TYPE_PHILIPS_PCA403CD_U31P,
|
||||
CDROM_TYPE_SONY_CDU76_10i,
|
||||
CDROM_TYPE_SONY_CDU311_30h,
|
||||
CDROM_TYPE_TOSHIBA_5302TA_0305,
|
||||
CDROM_TYPE_TOSHIBA_5702B_TA70,
|
||||
CDROM_TYPE_CHINON_CDS431_H42,
|
||||
CDROM_TYPE_DEC_RRD45_0436,
|
||||
CDROM_TYPE_MATSHITA_501_10b,
|
||||
CDROM_TYPE_NEC_38_103,
|
||||
CDROM_TYPE_NEC_211_100,
|
||||
CDROM_TYPE_NEC_464_105,
|
||||
CDROM_TYPE_SONY_CDU541_10i,
|
||||
CDROM_TYPE_SONY_CDU561_18k,
|
||||
CDROM_TYPE_SONY_CDU76S_100,
|
||||
CDROM_TYPE_PHILIPS_CDD2600_107,
|
||||
CDROM_TYPE_PIONEER_DRM604X_2403,
|
||||
CDROM_TYPE_PLEXTOR_PX32TS_103,
|
||||
CDROM_TYPE_TEAC_CD50_100,
|
||||
CDROM_TYPE_TEAC_R55S_10R,
|
||||
CDROM_TYPE_TEXEL_DMXX24_100,
|
||||
CDROM_TYPE_TOSHIBA_XM_3433,
|
||||
CDROM_TYPE_TOSHIBA_XM3201B_3232,
|
||||
CDROM_TYPE_TOSHIBA_XM3301TA_0272,
|
||||
CDROM_TYPE_TOSHIBA_XM5701TA_3136,
|
||||
CDROM_TYPE_TOSHIBA_SDM1401_1008,
|
||||
CDROM_TYPES_NUM
|
||||
};
|
||||
|
||||
#define KNOWN_CDROM_DRIVE_TYPES CDROM_TYPES_NUM
|
||||
#define BUS_TYPE_IDE CDROM_BUS_ATAPI
|
||||
#define BUS_TYPE_SCSI CDROM_BUS_SCSI
|
||||
#define BUS_TYPE_BOTH -2
|
||||
@@ -99,17 +145,23 @@ static const struct
|
||||
{ "CHINON", "CD-ROM CDS-431", "H42 ", "(SCSI) CHINON CD-ROM CDS-431 H42", "CHINON_CD-ROM_CDS-431_H42", BUS_TYPE_SCSI }, /*22*/
|
||||
{ "DEC", "RRD45 (C) DEC", "0436", "(SCSI) DEC RRD45 0436", "DEC_RRD45_0436", BUS_TYPE_SCSI }, /*23*/
|
||||
{ "MATSHITA", "CD-ROM CR-501", "1.0b", "(SCSI) MATSHITA CD-ROM CR-501 1.0b", "MATSHITA_CD-ROM_CR-501_1.0b", BUS_TYPE_SCSI }, /*24*/
|
||||
{ "NEC", "CD-ROM DRIVE:75", "1.00", "(SCSI) NEC CD-ROM DRIVE:75 1.00", "NEC_CD-ROM_DRIVE75_1.00", BUS_TYPE_SCSI }, /*25*/
|
||||
{ "NEC", "CD-ROM DRIVE:464", "1.05", "(SCSI) NEC CD-ROM DRIVE:464 1.05", "NEC_CD-ROM_DRIVE464_1.05", BUS_TYPE_SCSI }, /*26*/
|
||||
{ "SONY", "CD-ROM CDU-541", "1.0i", "(SCSI) SONY CD-ROM CDU-541 1.0i", "SONY_CD-ROM_CDU-541_1.0i", BUS_TYPE_SCSI }, /*27*/
|
||||
{ "SONY", "CD-ROM CDU-76S", "1.00", "(SCSI) SONY CD-ROM CDU-76S 1.00", "SONY_CD-ROM_CDU-76S_1.00", BUS_TYPE_SCSI }, /*28*/
|
||||
{ "PHILIPS", "CDD2600", "1.07", "(SCSI) PHILIPS CDD2600 1.07", "PHILIPS_CDD2600_1.07", BUS_TYPE_SCSI }, /*29*/
|
||||
{ "PIONEER", "CD-ROM DRM-604X", "2403", "(SCSI) PIONEER CD-ROM DRM-604X 2403", "PIONEER_CD-ROM_DRM-604X_2403", BUS_TYPE_SCSI }, /*30*/
|
||||
{ "PLEXTOR", "CD-ROM PX-32TS", "1.03", "(SCSI) PLEXTOR CD-ROM PX-32TS 1.03", "PLEXTOR_CD-ROM_PX-32TS_1.03", BUS_TYPE_SCSI }, /*31*/
|
||||
{ "TEAC", "CD-R55S", "1.0R", "(SCSI) TEAC CD-R55S 1.0R", "TEAC_CD-R55S_1.0R", BUS_TYPE_SCSI }, /*32*/
|
||||
{ "TOSHIBA", "CD-ROM DRIVE:XM", "3433", "(SCSI) TOSHIBA CD-ROM DRIVE:XM 3433", "TOSHIBA_CD-ROM_DRIVEXM_3433", BUS_TYPE_SCSI }, /*33*/
|
||||
{ "TOSHIBA", "CD-ROM XM-3301TA", "0272", "(SCSI) TOSHIBA CD-ROM XM-3301TA 0272", "TOSHIBA_CD-ROM_XM-3301TA_0272", BUS_TYPE_SCSI }, /*34*/
|
||||
{ "TOSHIBA", "CD-ROM XM-5701TA", "3136", "(SCSI) TOSHIBA CD-ROM XM-5701TA 3136", "TOSHIBA_CD-ROM_XM-5701TA_3136", BUS_TYPE_SCSI }, /*35*/
|
||||
{ "NEC", "CD-ROM DRIVE:38", "1.03", "(SCSI) NEC CD-ROM DRIVE:38 1.03", "NEC_CD-ROM_DRIVE38_1.03", BUS_TYPE_SCSI }, /*25*/
|
||||
{ "NEC", "CD-ROM DRIVE:211", "1.00", "(SCSI) NEC CD-ROM DRIVE:211 1.00", "NEC_CD-ROM_DRIVE211_1.00", BUS_TYPE_SCSI }, /*26*/
|
||||
{ "NEC", "CD-ROM DRIVE:464", "1.05", "(SCSI) NEC CD-ROM DRIVE:464 1.05", "NEC_CD-ROM_DRIVE464_1.05", BUS_TYPE_SCSI }, /*27*/
|
||||
{ "SONY", "CD-ROM CDU-541", "1.0i", "(SCSI) SONY CD-ROM CDU-541 1.0i", "SONY_CD-ROM_CDU-541_1.0i", BUS_TYPE_SCSI }, /*28*/
|
||||
{ "SONY", "CD-ROM CDU-561", "1.8k", "(SCSI) SONY CD-ROM CDU-561 1.8k", "SONY_CD-ROM_CDU-561_1.8k", BUS_TYPE_SCSI }, /*29*/
|
||||
{ "SONY", "CD-ROM CDU-76S", "1.00", "(SCSI) SONY CD-ROM CDU-76S 1.00", "SONY_CD-ROM_CDU-76S_1.00", BUS_TYPE_SCSI }, /*30*/
|
||||
{ "PHILIPS", "CDD2600", "1.07", "(SCSI) PHILIPS CDD2600 1.07", "PHILIPS_CDD2600_1.07", BUS_TYPE_SCSI }, /*31*/
|
||||
{ "PIONEER", "CD-ROM DRM-604X", "2403", "(SCSI) PIONEER CD-ROM DRM-604X 2403", "PIONEER_CD-ROM_DRM-604X_2403", BUS_TYPE_SCSI }, /*32*/
|
||||
{ "PLEXTOR", "CD-ROM PX-32TS", "1.03", "(SCSI) PLEXTOR CD-ROM PX-32TS 1.03", "PLEXTOR_CD-ROM_PX-32TS_1.03", BUS_TYPE_SCSI }, /*33*/
|
||||
{ "TEAC", "CD 50", "1.00", "(SCSI) TEAC CD 50 1.00", "TEAC_CD_50_1.00", BUS_TYPE_SCSI }, /*34*/
|
||||
{ "TEAC", "CD-ROM R55S", "1.0R", "(SCSI) TEAC CD-ROM R55S 1.0R", "TEAC_CD-ROM_R55S_1.0R", BUS_TYPE_SCSI }, /*35*/
|
||||
{ "TEXEL", "CD-ROM DM-XX24", "1.00", "(SCSI) TEXEL CD-ROM DM-XX24 1.00", "TEXEL_CD-ROM_DM-XX24_1.00", BUS_TYPE_SCSI }, /*36*/
|
||||
{ "TOSHIBA", "CD-ROM DRIVE:XM", "3433", "(SCSI) TOSHIBA CD-ROM DRIVE:XM 3433", "TOSHIBA_CD-ROM_DRIVEXM_3433", BUS_TYPE_SCSI }, /*37*/
|
||||
{ "TOSHIBA", "CD-ROM XM-3201B", "3232", "(SCSI) TOSHIBA CD-ROM XM-3201B 3232", "TOSHIBA_CD-ROM_XM-3201B_3232", BUS_TYPE_SCSI }, /*38*/
|
||||
{ "TOSHIBA", "CD-ROM XM-3301TA", "0272", "(SCSI) TOSHIBA CD-ROM XM-3301TA 0272", "TOSHIBA_CD-ROM_XM-3301TA_0272", BUS_TYPE_SCSI }, /*39*/
|
||||
{ "TOSHIBA", "CD-ROM XM-5701TA", "3136", "(SCSI) TOSHIBA CD-ROM XM-5701TA 3136", "TOSHIBA_CD-ROM_XM-5701TA_3136", BUS_TYPE_SCSI }, /*40*/
|
||||
{ "TOSHIBA", "DVD-ROM SD-M1401", "1008", "(SCSI) TOSHIBA DVD-ROM SD-M1401 1008", "TOSHIBA_DVD-ROM_SD-M1401_1008", BUS_TYPE_SCSI }, /*41*/
|
||||
{ "", "", "", "", "", BUS_TYPE_NONE },
|
||||
};
|
||||
|
||||
@@ -186,6 +238,7 @@ typedef struct cdrom {
|
||||
int prev_host_drive;
|
||||
int cd_buflen;
|
||||
int audio_op;
|
||||
int sony_msf;
|
||||
|
||||
const cdrom_ops_t *ops;
|
||||
|
||||
@@ -193,8 +246,8 @@ typedef struct cdrom {
|
||||
|
||||
void (*insert)(void *priv);
|
||||
void (*close)(void *priv);
|
||||
uint32_t (*get_volume)(void *priv, int channel);
|
||||
uint32_t (*get_channel)(void *priv, int channel);
|
||||
uint32_t (*get_volume)(void *p, int channel);
|
||||
uint32_t (*get_channel)(void *p, int channel);
|
||||
|
||||
int16_t cd_buffer[BUF_SIZE];
|
||||
} cdrom_t;
|
||||
@@ -215,12 +268,16 @@ extern int cdrom_is_pre(cdrom_t *dev, uint32_t lba);
|
||||
extern int cdrom_audio_callback(cdrom_t *dev, int16_t *output, int len);
|
||||
extern uint8_t cdrom_audio_play(cdrom_t *dev, uint32_t pos, uint32_t len, int ismsf);
|
||||
extern uint8_t cdrom_audio_track_search(cdrom_t *dev, uint32_t pos, int type, uint8_t playbit);
|
||||
extern uint8_t cdrom_audio_track_search_pioneer(cdrom_t *dev, uint32_t pos, uint8_t playbit);
|
||||
extern uint8_t cdrom_audio_play_pioneer(cdrom_t *dev, uint32_t pos);
|
||||
extern uint8_t cdrom_audio_play_toshiba(cdrom_t *dev, uint32_t pos, int type);
|
||||
extern void cdrom_audio_pause_resume(cdrom_t *dev, uint8_t resume);
|
||||
extern uint8_t cdrom_audio_scan(cdrom_t *dev, uint32_t pos, int type);
|
||||
extern uint8_t cdrom_get_audio_status_pioneer(cdrom_t *dev, uint8_t *b);
|
||||
extern uint8_t cdrom_get_audio_status_sony(cdrom_t *dev, uint8_t *b, int msf);
|
||||
extern uint8_t cdrom_get_current_subchannel(cdrom_t *dev, uint8_t *b, int msf);
|
||||
extern void cdrom_get_current_subchannel_sony(cdrom_t *dev, uint8_t *b, int msf);
|
||||
extern void cdrom_get_current_subcodeq(cdrom_t *dev, uint8_t *b);
|
||||
extern uint8_t cdrom_get_current_subcodeq_playstatus(cdrom_t *dev, uint8_t *b);
|
||||
extern int cdrom_read_toc(cdrom_t *dev, unsigned char *b, int type,
|
||||
unsigned char start_track, int msf, int max_len);
|
||||
@@ -243,6 +300,10 @@ extern int cdrom_image_open(cdrom_t *dev, const char *fn);
|
||||
extern void cdrom_image_close(cdrom_t *dev);
|
||||
extern void cdrom_image_reset(cdrom_t *dev);
|
||||
|
||||
extern void cdrom_ioctl_eject(void);
|
||||
extern void cdrom_ioctl_load(void);
|
||||
extern int cdrom_ioctl_open(cdrom_t *dev, const char d);
|
||||
|
||||
extern void cdrom_update_cdb(uint8_t *cdb, int lba_pos,
|
||||
int number_of_blocks);
|
||||
|
||||
|
@@ -22,5 +22,6 @@
|
||||
#define SCSI_SPOCK_H
|
||||
|
||||
extern const device_t spock_device;
|
||||
extern const device_t tribble_device;
|
||||
|
||||
#endif /*SCSI_SPOCK_H*/
|
||||
|
@@ -86,6 +86,7 @@ static SCSI_CARD scsi_cards[] = {
|
||||
{ &buslogic_640a_device, },
|
||||
{ &ncr53c90_mca_device, },
|
||||
{ &spock_device, },
|
||||
{ &tribble_device, },
|
||||
{ &buslogic_958d_pci_device, },
|
||||
{ &ncr53c810_pci_device, },
|
||||
{ &ncr53c815_pci_device, },
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -135,7 +135,7 @@ typedef struct {
|
||||
int cir_status;
|
||||
|
||||
uint8_t pacing;
|
||||
|
||||
uint8_t irq_state;
|
||||
uint8_t buf[0x600];
|
||||
|
||||
struct {
|
||||
@@ -159,6 +159,7 @@ typedef struct {
|
||||
int scb_state;
|
||||
int in_reset;
|
||||
int in_invalid;
|
||||
int spock_16bit;
|
||||
|
||||
uint64_t temp_period;
|
||||
double media_period;
|
||||
@@ -674,9 +675,9 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb)
|
||||
spock_log("Get POS Info\n");
|
||||
get_pos_info_t *get_pos_info = &scsi->get_pos_info;
|
||||
|
||||
get_pos_info->pos = 0x8eff;
|
||||
get_pos_info->pos = scsi->spock_16bit ? 0x8efe : 0x8eff;
|
||||
get_pos_info->pos1 = scsi->pos_regs[3] | (scsi->pos_regs[2] << 8);
|
||||
get_pos_info->pos2 = 0x0e | (scsi->pos_regs[4] << 8);
|
||||
get_pos_info->pos2 = scsi->irq | (scsi->pos_regs[4] << 8);
|
||||
get_pos_info->pos3 = 1 << 12;
|
||||
get_pos_info->pos4 = (7 << 8) | 8;
|
||||
get_pos_info->pos5 = (16 << 8) | scsi->pacing;
|
||||
@@ -716,7 +717,7 @@ spock_execute_cmd(spock_t *scsi, scb_t *scb)
|
||||
case CMD_SEND_OTHER_SCSI:
|
||||
scsi->cdb_id = scsi->assign ? scsi->dev_id[scsi->scb_id].phys_id : scsi->present[scsi->scb_id];
|
||||
dma_bm_read(scsi->scb_addr + 0x18, scsi->cdb, 12, 2);
|
||||
spock_log("Send Other SCSI, SCB ID=%d, PHYS ID=%d\n", scsi->scb_id, scsi->dev_id[scsi->scb_id].phys_id);
|
||||
spock_log("Send Other SCSI, SCB ID=%d, PHYS ID=%d, CDB[0]=%02x, CDB_ID=%d\n", scsi->scb_id, scsi->dev_id[scsi->scb_id].phys_id, scsi->cdb[0], scsi->cdb_id);
|
||||
scsi->cdb[1] = (scsi->cdb[1] & 0x1f) | (scsi->dev_id[scsi->scb_id].lun_id << 5); /*Patch correct LUN into command*/
|
||||
scsi->cdb_len = (scb->lba_addr & 0xff) ? (scb->lba_addr & 0xff) : 6;
|
||||
scsi->scsi_state = SCSI_STATE_SELECT;
|
||||
@@ -916,7 +917,7 @@ spock_process_scsi(spock_t *scsi, scb_t *scb)
|
||||
scsi_device_command_phase0(sd, scsi->temp_cdb);
|
||||
spock_log("SCSI ID %i: Current CDB[0] = %02x, LUN = %i, data len = %i, max len = %i, phase val = %02x\n", scsi->cdb_id, scsi->temp_cdb[0], scsi->temp_cdb[1] >> 5, sd->buffer_length, spock_get_len(scsi, scb), sd->phase);
|
||||
|
||||
if (sd->phase != SCSI_PHASE_STATUS && sd->buffer_length > 0) {
|
||||
if ((sd->phase != SCSI_PHASE_STATUS) && (sd->buffer_length > 0)) {
|
||||
p = scsi_device_get_callback(sd);
|
||||
if (p <= 0.0)
|
||||
spock_add_to_period(scsi, sd->buffer_length);
|
||||
@@ -969,9 +970,9 @@ spock_process_scsi(spock_t *scsi, scb_t *scb)
|
||||
scsi->scsi_state = SCSI_STATE_IDLE;
|
||||
|
||||
spock_log("State to idle, cmd timer %d\n", scsi->cmd_timer);
|
||||
if (!scsi->cmd_timer) {
|
||||
if (!scsi->cmd_timer)
|
||||
scsi->cmd_timer = 1;
|
||||
}
|
||||
|
||||
spock_add_to_period(scsi, 1);
|
||||
break;
|
||||
}
|
||||
@@ -1056,7 +1057,7 @@ spock_callback(void *priv)
|
||||
|
||||
period = 0.2 * ((double) scsi->temp_period);
|
||||
timer_on_auto(&scsi->callback_timer, (scsi->media_period + period + 10.0));
|
||||
spock_log("Temporary period: %lf us (%" PRIi64 " periods)\n", scsi->callback_timer.period, scsi->temp_period);
|
||||
spock_log("Temporary period: %lf us (%" PRIi64 " periods), media period = %lf\n", scsi->callback_timer.period, scsi->temp_period, scsi->media_period);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1081,6 +1082,7 @@ spock_mca_write(int port, uint8_t val, void *priv)
|
||||
mem_mapping_enable(&scsi->bios_rom.mapping);
|
||||
}
|
||||
}
|
||||
spock_log("[%04X:%08X]: POS Write Port = %x, val = %02x, rom addr = %05x\n", CS, cpu_state.pc, port & 7, val, ((scsi->pos_regs[2] >> 4) * 0x2000) + 0xc0000);
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
@@ -1088,6 +1090,8 @@ spock_mca_read(int port, void *priv)
|
||||
{
|
||||
const spock_t *scsi = (spock_t *) priv;
|
||||
|
||||
spock_log("[%04X:%08X]: POS Read Port = %x, val = %02x\n", CS, cpu_state.pc,
|
||||
port & 7, scsi->pos_regs[port & 7]);
|
||||
return scsi->pos_regs[port & 7];
|
||||
}
|
||||
|
||||
@@ -1118,10 +1122,14 @@ spock_mca_reset(void *priv)
|
||||
scsi_device_reset(&scsi_devices[scsi->bus][i]);
|
||||
scsi->present[i] = 0;
|
||||
}
|
||||
|
||||
spock_log("Reset.\n");
|
||||
mem_mapping_disable(&scsi->bios_rom.mapping);
|
||||
spock_mca_write(0x102, 0, scsi);
|
||||
}
|
||||
|
||||
static void *
|
||||
spock_init(UNUSED(const device_t *info))
|
||||
spock_init(const device_t *info)
|
||||
{
|
||||
spock_t *scsi = malloc(sizeof(spock_t));
|
||||
memset(scsi, 0x00, sizeof(spock_t));
|
||||
@@ -1131,23 +1139,24 @@ spock_init(UNUSED(const device_t *info))
|
||||
scsi->irq = 14;
|
||||
|
||||
scsi->bios_ver = device_get_config_int("bios_ver");
|
||||
scsi->spock_16bit = info->local & 0xff;
|
||||
|
||||
switch (scsi->bios_ver) {
|
||||
case 1:
|
||||
rom_init_interleaved(&scsi->bios_rom, SPOCK_U68_1991_ROM, SPOCK_U69_1991_ROM,
|
||||
0xc8000, 0x8000, 0x7fff, 0x4000, MEM_MAPPING_EXTERNAL);
|
||||
break;
|
||||
case 0:
|
||||
rom_init_interleaved(&scsi->bios_rom, SPOCK_U68_1990_ROM, SPOCK_U69_1990_ROM,
|
||||
0xc8000, 0x8000, 0x7fff, 0x4000, MEM_MAPPING_EXTERNAL);
|
||||
break;
|
||||
case 1:
|
||||
rom_init_interleaved(&scsi->bios_rom, SPOCK_U68_1991_ROM, SPOCK_U69_1991_ROM,
|
||||
0xc8000, 0x8000, 0x7fff, 0x4000, MEM_MAPPING_EXTERNAL);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
mem_mapping_disable(&scsi->bios_rom.mapping);
|
||||
|
||||
scsi->pos_regs[0] = 0xff;
|
||||
scsi->pos_regs[0] = scsi->spock_16bit ? 0xfe : 0xff;
|
||||
scsi->pos_regs[1] = 0x8e;
|
||||
mca_add(spock_mca_read, spock_mca_write, spock_mca_feedb, spock_mca_reset, scsi);
|
||||
|
||||
@@ -1218,3 +1227,17 @@ const device_t spock_device = {
|
||||
.force_redraw = NULL,
|
||||
.config = spock_rom_config
|
||||
};
|
||||
|
||||
const device_t tribble_device = {
|
||||
.name = "IBM PS/2 SCSI Adapter (Tribble)",
|
||||
.internal_name = "tribble",
|
||||
.flags = DEVICE_MCA,
|
||||
.local = 1,
|
||||
.init = spock_init,
|
||||
.close = spock_close,
|
||||
.reset = NULL,
|
||||
{ .available = spock_available },
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = spock_rom_config
|
||||
};
|
||||
|
Reference in New Issue
Block a user