VOGONS


Reply 20 of 33, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just curious, what driver are you using? In my case it's the VIDE-CDD.SYS driver combined with MS-DOS 6.22 MSCDEX.EXE. Or is a different driver better to test(e.g. OAKCDROM.SYS)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 21 of 33, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just tried OAKCDROM.SYS again. It now can't seem to find the CD-ROM drives anymore? I see it's apparently waiting for something, but no ATAPI command is executed at all anymore?

Current code is always at: https://bitbucket.org/superfury/unipcemu/src/ … /hardware/ide.c

Edit: I see an ATAPI reset command being executed(ATA command 0x08)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 22 of 33, by superfury

User metadata
Rank l33t++
Rank
l33t++

Hmmmm.... I do see it writing the drive head a bunch of times after the DEVICE RESET command? And then checking the status register, which only seems to indicate busy?

During the device reset, it's reporting a status register value of 0x80, so not ready(because it's resetting) and busy? It never seems to become ready to process a command, before executing a new drive select by writing the drive/head register? Or is it not supposed to become more busy(resetting the timer for the drive select timeout) when it doesn't toggle the drive select line?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 23 of 33, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just implemented an IRQ to trigger when an ATAPI device receives command 0x08(DEVICE RESET command for ATAPI devices). I now see it properly executing a 0xEC IDENTIFY DEVICE command(which aborts of course), then a 0xA1 IDENTIFY PACKET DEVICE command 😁

And after that, a PACKET command 😁

Edit: Huh? Then a read sub-channel command?

Edit: After that one errors out, though, OAKCDROM does seem to execute a REQUEST SENSE command?
Edit: Then it executes command 0x00 again, which of course gives a not present CD-ROM error sense(code 0x20 in the error register).
Edit: Then another REQUEST SENSE ( 😁 )...

Then another read sub-channel, which of course still fails...
Edit: Then mode sense. And it then continues 😁

Edit: OK. Now to change the inserted disk...
Edit: OK. The dir starts...
It uses command 0x00, then REQUEST SENSE for the new media?
Then Read TOC... It gives a MEDIUM NOT PRESENT(then a drive not ready immediately happens in the MS-DOS prompt)... That's a REQUEST SENSE...
Then a CD-INSERTED EVENT happens(from the disk change)!
Eventually(read TOC still waiting), it gives a 0x02,0x28,0x00 error(Medium is ready (has changed)).
Then a REQUEST SENSE.
And then another READ TOC, which succeeds 😁
Then a Read Sectors, with LBA 0x10(16) 😁

Edit: More sectors follow, and it fully sees the new disk having been inserted, with the new directory list 😁

But that only seems to happen with the OAKCDROM driver? The VIDE-CDD.SYS driver seems to utterly fail at that?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 24 of 33, by superfury

User metadata
Rank l33t++
Rank
l33t++

So the problem is with the VIDE-CDD.SYS driver itself, not with the hardware? What does VIDE-CDD.SYS do with your emulator when you switch a disk?

Also, I assume those odd read subchannel commands are somehow for verifying it's a data disk instead of a CD-ROM disk?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 25 of 33, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just tried Windows 3.11 with OAKCDROM and MSCDEX combination. Inserting various disks, both cue and iso seems to work like a charm.

So since there's no issues with OAKCDROM, perhaps there's error issues with VIDE-CDD itself? Are any such problems known with the driver?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 26 of 33, by Stenzek

User metadata
Rank Newbie
Rank
Newbie

VIDE-CDD seems to work fine for me after a disc swap. Two ATA channels, CD-ROM is on primary slave. FWIW it's the same on the secondary channel.

Trace:

[  235.7322] T/i8259_PIC: PIC 1 mask 0x8F
[ 235.7324] T/HW::HDC: ATA write drive select 0xB0 (drive 1)
[ 235.7337] T/HW::HDC: ATA read status register 0/1 <- 0x50
[ 235.7339] T/HW::HDC: ATA write command block features 0/1 0x00
[ 235.7340] T/HW::HDC: ATA write command block 0/1 cylinder low 0x00
[ 235.7342] T/HW::HDC: ATA write command block 0/1 cylinder high 0x00
[ 235.7343] T/HW::HDC: ATA write drive select 0xB0 (drive 1)
[ 235.7345] T/HW::HDC: ATA write command register 0/1 <- 0xA0
[ 235.7346] T/HW::ATACDROM: ATA drive 0/1 command register <- 0xA0
[ 235.7348] T/HW::ATACDROM: Executing ATAPI command 0xA0 on drive 0/1
[ 235.7350] T/HW::HDC: ATA read status register 0/1 <- 0x58
[ 235.7351] T/HW::HDC: ATA read sector count 0/1 <- 0x01
[ 235.7353] T/HW::ATACDROM: ATAPI PACKET received from host of 12 bytes
[ 235.7354] T/HW::CDROM: CDROM executing command 0x00 length 12
[ 235.7356] D/HW::CDROM: CDROM test unit ready
[ 235.7357] B/HW::CDROM: Raising CDROM interrupt
[ 235.7359] T/HW::ATADevice: Raising ATA interrupt line 0/1
[ 235.7360] T/CPU_X86::CPU: IRQ line signaled
[ 235.7361] T/CPU_X86::CPU: IRQ line signaled
[ 235.7363] T/CPU_X86::CPU: Hardware interrupt 118
[ 235.7365] T/HW::HDC: ATA read status register 0/1 <- 0x41
[ 235.7366] T/i8259_PIC: EOI interrupt 6
[ 235.7368] T/i8259_PIC: EOI interrupt 2
[ 235.7369] T/HW::HDC: ATA read status register 0/1 <- 0x41
[ 235.7371] T/HW::HDC: ATA read sector count 0/1 <- 0x03
[ 235.7372] T/HW::HDC: ATA read alt status register 0/1 <- 0x41
[ 235.7374] T/HW::HDC: ATA read status register 0/1 <- 0x41
[ 235.7375] T/HW::HDC: ATA read error register 0/1 <- 0x60
[ 235.7379] T/i8259_PIC: PIC 1 mask 0x8F
[ 235.7380] T/HW::HDC: ATA write drive select 0xB0 (drive 1)
[ 235.7382] T/HW::HDC: ATA read status register 0/1 <- 0x41
[ 235.7383] T/HW::HDC: ATA write command block features 0/1 0x00
[ 235.7385] T/HW::HDC: ATA write command block 0/1 cylinder low 0x0C
[ 235.7387] T/HW::HDC: ATA write command block 0/1 cylinder high 0x00
[ 235.7388] T/HW::HDC: ATA write drive select 0xB0 (drive 1)
[ 235.7390] T/HW::HDC: ATA write command register 0/1 <- 0xA0
[ 235.7391] T/HW::ATACDROM: ATA drive 0/1 command register <- 0xA0
[ 235.7393] T/HW::ATACDROM: Executing ATAPI command 0xA0 on drive 0/1
[ 235.7394] T/HW::HDC: ATA read status register 0/1 <- 0x48
[ 235.7396] T/HW::HDC: ATA read sector count 0/1 <- 0x01
[ 235.7398] T/HW::ATACDROM: ATAPI PACKET received from host of 12 bytes
[ 235.7415] D/HostInterface: Key scancode 54 up
[ 235.7446] T/HW::CDROM: CDROM executing command 0x43 length 12
[ 235.7447] D/HW::CDROM: CDROM read TOC msf=0,start_track=0,format=1,max_length=12
[ 235.7449] B/HW::CDROM: Raising CDROM interrupt
[ 235.7450] T/HW::ATADevice: Raising ATA interrupt line 0/1
[ 235.7452] T/CPU_X86::CPU: IRQ line signaled
[ 235.7453] T/CPU_X86::CPU: IRQ line signaled
[ 235.7455] T/CPU_X86::CPU: Hardware interrupt 118
[ 235.7457] T/HW::HDC: ATA read status register 0/1 <- 0x48
[ 235.7458] T/i8259_PIC: EOI interrupt 6
[ 235.7460] T/i8259_PIC: EOI interrupt 2
[ 235.7461] T/HW::HDC: ATA read sector count 0/1 <- 0x02
[ 235.7463] T/HW::HDC: ATA read cylinder low 0/1 <- 0x0C
[ 235.7464] T/HW::HDC: ATA read cylinder high 0/1 <- 0x00
[ 235.7466] T/HW::ATADevice: Raising ATA interrupt line 0/1
[ 235.7468] T/CPU_X86::CPU: IRQ line signaled
[ 235.7469] T/CPU_X86::CPU: IRQ line signaled
[ 235.7471] T/CPU_X86::CPU: Hardware interrupt 118
[ 235.7472] T/HW::HDC: ATA read status register 0/1 <- 0x50
Show last 22 lines
[  235.7474] T/i8259_PIC: EOI interrupt 6
[ 235.7475] T/i8259_PIC: EOI interrupt 2
[ 235.7477] T/HW::HDC: ATA read sector count 0/1 <- 0x03
[ 235.7478] T/HW::HDC: ATA read alt status register 0/1 <- 0x50
[ 235.7480] T/HW::HDC: ATA read status register 0/1 <- 0x50
[ 235.7482] T/HW::HDC: ATA read error register 0/1 <- 0x00
[ 235.7483] T/i8259_PIC: PIC 1 mask 0x8F
[ 235.7485] T/HW::HDC: ATA write drive select 0xB0 (drive 1)
[ 235.7487] T/HW::HDC: ATA read status register 0/1 <- 0x50
[ 235.7488] T/HW::HDC: ATA write command block features 0/1 0x00
[ 235.7490] T/HW::HDC: ATA write command block 0/1 cylinder low 0x00
[ 235.7491] T/HW::HDC: ATA write command block 0/1 cylinder high 0x08
[ 235.7493] T/HW::HDC: ATA write drive select 0xB0 (drive 1)
[ 235.7495] T/HW::HDC: ATA write command register 0/1 <- 0xA0
[ 235.7496] T/HW::ATACDROM: ATA drive 0/1 command register <- 0xA0
[ 235.7498] T/HW::ATACDROM: Executing ATAPI command 0xA0 on drive 0/1
[ 235.7499] T/HW::HDC: ATA read status register 0/1 <- 0x58
[ 235.7501] T/HW::HDC: ATA read sector count 0/1 <- 0x01
[ 235.7502] T/HW::ATACDROM: ATAPI PACKET received from host of 12 bytes
[ 235.7504] T/HW::CDROM: CDROM executing command 0x28 length 10
[ 235.7506] D/HW::CDROM: CDROM read 1 sectors at LBA 16

Reply 27 of 33, by superfury

User metadata
Rank l33t++
Rank
l33t++

Do I see that correctly that the A0 command (or any ATA command valid for ATAPI) clears the error bit in the status register? Doesn't sff8020i / ATA/ATAPI-4 say it's only cleared by a Request Sense command?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 29 of 33, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just thinking about something... What is the purpose of having index 02-99 inside a cue sheet? The software only sees the whole track, doesn't it(using the read TOC command)?

So what happens when you have index 01 and 02 inside a data track? Or an audio track? So far I've only seen tracks with index 00(pregap data in the backend file, HTOA) and 01(the actual track data). What's the purpose of indexes 02-99? What are they used for? Can software even address them individually? Read TOC only gives a whole track after all(thus all indexes)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 30 of 33, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just saw the Read TOC instruction be handled a bit odd. It was generating enough data(just now improved with full track packets instead of a fabricated track 1 only(for the whole cue image, while it's actually supposed to give multiple tracks for such a thing(depending on the amount of tracks in the disk image)), but the parameters it got in the command packets(of 12 bytes long) were read, but incorrectly shifted to their results before being OR-ed to form their native value(e.g. the length fields bytes being combined into a 32-bit integer were using shifts of 0,1,2,3 instead of 0,8,16,24 😖 ).

That was the case for mode select bytes 7&8, mode sense bytes 7&8, Read header bytes 7&8, Read sub-channel bytes 7&8, Read TOC bytes 7&8, Read sectors bytes 7&8(and extended form (command A8h) bytes 6,7,8,9) and Mechanism status bytes 8&9. Oops!

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 31 of 33, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just tried booting Minix 3.3.0 again with the improved and bugfixed CD-ROM emulation, but unfortunately. When booting it says it cannot find the netbsd partition(booting from bootable CD-ROM)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 32 of 33, by superfury

User metadata
Rank l33t++
Rank
l33t++

Just improved the Read TOC command a bit. It's now properly reporting the A0-A2 records for mode 2 and all tracks being listen instead of just track 1(what Bochs/Dosbox does). I also adjusted the mode 1 result to properly give the track 1 information and starting address. Mode 0 is unchanged, as it already reports according to the standards.

Also, just a confirmation, is mode 0 the only mode that gives MSF and LBA results(based on the bit in the command bytes) instead of always MSF results(like mode 2) or LBA results(like mode 1)?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 33 of 33, by superfury

User metadata
Rank l33t++
Rank
l33t++

I managed to improve the cue/bin disk image format quite a lot. It now supports all the different combinations of pregap, postgap, index(only index 1 and up, index 0 counted as invalid to read(as it's pregap)). The data read commands now properly support all different kinds of .cue disk image formats(CD-DA, 2048 byte tracks, 2352 byte tracks in both 2048 byte and 2353 byte read modes). I also added support to the cue sheet parsing and ATAPI emulation to properly skip the pregap/postgap regions for read commands(e.g. read(10/12), read TOC, read MSF etc.). The only basic CD-ROM thing that's not yet supported is the audio commands, but the basic data read commands should all be working fully with both ISO files(sectors converted from LBA like Dosbox, with the 2 second pregap) and standard CUE files(as long as the backend is of type binary) without any extensions.

So far tried various games with the new cue image file support(so far gotten only Earthworm Jim 1 running for those, as the others seem to have still unknown CPU problems(some even complain about no SVGA adapter, even though a ET4000 is pretty much fully emulated on the graphical modes(just not the enhanced text modes, WhatVGA keeps aborting them and returning to the main menus on those for some odd reason).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io