View Single Post
Old 21 July 2003, 17:56   #8
Posts: n/a
Originally posted by Toni Wilen
There is really no emulation. SCSI commands are directly forwarded to selected device. IDE ATAPI and SCSI are mostly identical except some advanced SCSI-only commands and some other small differences.

Volume problem is probably caused by IDE CDROM that only supports volume on/off. I can't check SCSI spec now but I think it is not mandatory to support multiple volume levels even on SCSI devices.
I see. Thanks for the clarification, Toni. Actually, this volume setting code worked on 99% of IDE CDROM's in the Amigas AFAIR (copied directly from the GroovyPlayer source):

		lea	SCSI_CMD6,a1
		move.b	#SCSI_CMD_MSL,(a1)
		move.b	#$10,1(a1)
		move.b	#20,4(a1)
		moveq	#6,d1
		lea	volumemodedata,a0
		moveq	#20,d0
		moveq	#0,d3
		jsr	SCSI_Command



;		input:	a0	data
;			d0	datasize
;			a1	command
;			d1	command size
;			d2	flags
;			d3	1 = asynchronous I/O (FUTURE)
SCSI_Command:		move.l	d1,d5
			move.l	a1,a5
			move.l	SCSI_IO,a2
			move.l	#scsi_SIZEOF,IO_LENGTH(a2)
			move.l	#scsi_cmd,IO_DATA(a2)
			move.w	#HD_SCSICMD,IO_COMMAND(a2)
			lea	scsi_cmd,a2
			move.l	a0,scsi_Data(a2)
			move.l	d0,scsi_Length(a2)
			move.w	#0,scsi_SenseActual(a2)
			move.l	#scsi_sense,scsi_SenseData(a2)
			move.w	#SENSE_LEN,scsi_SenseLength(a2)
			move.l	a1,scsi_Command(a2)
			move.w	d1,scsi_CmdLength(a2)
			move.b	d2,scsi_Flags(a2)
			move.l	4.w,a6
	sc_sync:	move.l	SCSI_IO,a1
			jsr	DoIO(a6)
	sc_clrcmd:	move.l	SCSI_IO,a1
			move.b	IO_ERROR(a1),d0
			subq.w	#1,d5	; clear command field
	sc_loop:	clr.b	(a5)+
			dbf	d5,sc_loop

SCSI_CMD6:		dc.b	0	; opcode
			dc.b	0,0,0,0	;_b1-b4
			dc.b	0	; control 

vm_head:		dcb.b	4,0
vm_page:		dc.b	0	; page code 0x0E
vm_plength:		dc.b	0	; page length
vm_b2:			dc.b	4	; bit 2: Immed, bit 1: SOTC
vm_b3:			dc.b	0	; reserved
vm_b4:			dc.b	0	; reserved
vm_b5:			dc.b	0 	; bit 7: APRVal, 
					; bit 3-0: format of LBAs/Sec.
vm_bps:			dc.w	0	; logical blocks/second audio playback
vm_out0:		dc.b	0	; lower 4 bits: output port 0
					;_channel selection
vm_vol0:		dc.b	0	; output port 0 volume
vm_out1:		dc.b	0	; lower 4 bits: output port 1
					;_channel selection
vm_vol1:		dc.b	0	; output port 1 volume
vm_out2:		dc.b	0	; lower 4 bits: output port 2
					;_channel selection
vm_vol2:		dc.b	0	; output port 2 volume
vm_out3:		dc.b	0	; lower 4 bits: output port 3
					;_channel selection
vm_vol3:		dc.b	0	; output port 3 volume
Anyway, you're the expert If you have any idea why it doesn't work, I'd be glad to hear.

PS: Sorry for the coding style, I was young, much-much younger...
Page generated in 0.03876 seconds with 10 queries