[Patch] CD-ROM model selection

Post new patches here!
Post Reply
EluanCM
Posts: 94
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

[Patch] CD-ROM model selection

Post by EluanCM » Tue 11 Feb, 2020 11:10 am

This patch allows CD-ROM model selection from a list of available models and also alters some of the UI behaviour. Beware that I can't do UIs :-)

-CD-ROM settings will now only be enabled when an IDE or SCSI controller is selected.
-Specific CD-ROM models may be restricted by interface type.
-Speed selection may also be fixed for a specific model.

I've included only one model with the patch: the AZT CDA 468-02I IDE drive which is the model that the SGIDECD.SYS driver from one of my hdd dumps wants. There is potential for a database here.
(Again this patch was inspired by my desire to run unmodified bios/hdd dumps from my old computers.)

The patch is bz2-zipped because the automatically generated wx-resources.cpp is too large.
Attachments
cd_model_selection.patch.bz2
(91.14 KiB) Downloaded 22 times

User avatar
omarsis81
Posts: 783
Joined: Thu 17 Dec, 2015 6:20 pm

Re: [Patch] CD-ROM model selection

Post by omarsis81 » Tue 11 Feb, 2020 12:37 pm

Could you please add some screenshots of how it would look like?
I feel it is a step closer to real emulation! I always wanted something like this and HDDs too

EluanCM
Posts: 94
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] CD-ROM model selection

Post by EluanCM » Tue 11 Feb, 2020 10:41 pm

Here you go

(Yeah, the "-02I" being detected as an "-01I" by the DOS driver happens on the real thing :))
Attachments
Screenshot from 2020-02-11 17-36-47.png
Screenshot from 2020-02-11 17-36-47.png (124.47 KiB) Viewed 877 times
Screenshot from 2020-02-11 17-35-55.png
Screenshot from 2020-02-11 17-35-55.png (47.91 KiB) Viewed 877 times
Screenshot from 2020-02-11 17-34-23.png
Screenshot from 2020-02-11 17-34-23.png (30.52 KiB) Viewed 877 times
Screenshot_2020-02-11_17-34-06.png
Screenshot_2020-02-11_17-34-06.png (27.22 KiB) Viewed 877 times
Screenshot_2020-02-11_17-33-35.png
Screenshot_2020-02-11_17-33-35.png (27 KiB) Viewed 877 times

User avatar
omarsis81
Posts: 783
Joined: Thu 17 Dec, 2015 6:20 pm

Re: [Patch] CD-ROM model selection

Post by omarsis81 » Thu 13 Feb, 2020 3:52 pm

Is it possible to make the same for hard disks?

EluanCM
Posts: 94
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] CD-ROM model selection

Post by EluanCM » Thu 13 Feb, 2020 11:19 pm

PCem only supports one CD-ROM drive, so implementing this for HDDs would be a little different.
-Have a list of models for each interface
-After selecting the HDD for the channel, give an option to define CHS just like it is today (for the PCemHD model) or select a real model, which would fix the CHS for PCem and for the image creation step.
-I would suggest not using the "Type xx" nomenclature, because the meaning varies by BIOS.
-As with the CD-ROMs, creating the database with the correct strings would need a real working one of each model (or at least one of each series). This is the real hard part.

User avatar
omarsis81
Posts: 783
Joined: Thu 17 Dec, 2015 6:20 pm

Re: [Patch] CD-ROM model selection

Post by omarsis81 » Fri 14 Feb, 2020 12:12 am

EluanCM wrote:
Thu 13 Feb, 2020 11:19 pm
-As with the CD-ROMs, creating the database with the correct strings would need a real working one of each model (or at least one of each series). This is the real hard part.
Why is needed a real unit? To extract the BIOS or firmware? I have tons of optical drives.
Or just copy the string by hand?

User avatar
leilei
Posts: 731
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [Patch] CD-ROM model selection

Post by leilei » Fri 14 Feb, 2020 2:00 am

I'm sure i've got a few of my past CD-ROM drives' strings from random old hardware detection log files...


also the CD-ROM model thing crossed my mind while pondering about figuring to create CD-ROM drive sound. I procrastinated too much on capturing my old whirry Mitsumi 4X. (by the way there's exactly one youtube video about this particular drive and it's playing a music cd so it's not whirring)

EDIT: That drive's string as pulled from an old detection log :P

Code: Select all

MITSUMI CD-ROM        !B
Last edited by leilei on Fri 14 Feb, 2020 8:36 am, edited 1 time in total.

ecksemmess
Posts: 165
Joined: Wed 18 Mar, 2015 5:27 am

Re: [Patch] CD-ROM model selection

Post by ecksemmess » Fri 14 Feb, 2020 7:27 am

Wow, fantastic work EluanCM! You're really on a roll lately with these patches. I'd love to see this approach adapted to HDDs as well.

User avatar
dns2kv2
Posts: 58
Joined: Sun 19 Feb, 2017 3:30 am

Re: [Patch] CD-ROM model selection

Post by dns2kv2 » Fri 14 Feb, 2020 11:15 am

Yea i agree with the idea too, also the idea if pcem can extract bios drive types table from supported machine bios and use it when creating harddisk image.

https://www.win.tue.nl/~aeb/linux/hdtypes/hdtypes.c
Attachments
hdtypes.c
(3 KiB) Downloaded 21 times

EluanCM
Posts: 94
Joined: Tue 27 Oct, 2015 2:07 pm
Location: Brazil
Contact:

Re: [Patch] CD-ROM model selection

Post by EluanCM » Sat 15 Feb, 2020 12:20 am

omarsis81 wrote:
Fri 14 Feb, 2020 12:12 am
Why is needed a real unit? To extract the BIOS or firmware? I have tons of optical drives.
Or just copy the string by hand?
ATAPI CD-ROM drives, for example, respond to the SCSI INQUIRY and the ATAPI IDENTIFY commands slightly differently. Getting all these strings would be needed. This is only part of the problem for emulation, though: the reply for these commands also contains supported transfer modes, etc. Luckily, emulating the CD "speed" (e.g. 16x) is enough to create a convincing behaviour and just setting the strings creates a good illusion.

HDDs do not have a "speed" rating, so they would have good names but everything else completely equal according to the machine/controller being used, AFAIK.
leilei wrote:
Fri 14 Feb, 2020 2:00 am
I'm sure i've got a few of my past CD-ROM drives' strings from random old hardware detection log files...


also the CD-ROM model thing crossed my mind while pondering about figuring to create CD-ROM drive sound. I procrastinated too much on capturing my old whirry Mitsumi 4X. (by the way there's exactly one youtube video about this particular drive and it's playing a music cd so it's not whirring)

EDIT: That drive's string as pulled from an old detection log :P

Code: Select all

MITSUMI CD-ROM        !B
Every time I power up one of my old PCs, the sound of the PSU turning on, HDD spinning up and calibrating, the 5 1/4 and then the 3 1/2 drives seeking, etc REALLY bring me back in a way emulation can't. I'm really fond of your effort to preserve the sounds!

BTW: your string doesn't sound very useful! :D
ecksemmess wrote:
Fri 14 Feb, 2020 7:27 am
Wow, fantastic work EluanCM! You're really on a roll lately with these patches. I'd love to see this approach adapted to HDDs as well.
Thanks!
dns2kv2 wrote:
Fri 14 Feb, 2020 11:15 am
Yea i agree with the idea too, also the idea if pcem can extract bios drive types table from supported machine bios and use it when creating harddisk image.

https://www.win.tue.nl/~aeb/linux/hdtypes/hdtypes.c
This is interesting, I didn't know it was well structured between vendors.

User avatar
leilei
Posts: 731
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [Patch] CD-ROM model selection

Post by leilei » Sat 15 Feb, 2020 1:26 am

EluanCM wrote:
Sat 15 Feb, 2020 12:20 am
Every time I power up one of my old PCs, the sound of the PSU turning on, HDD spinning up and calibrating, the 5 1/4 and then the 3 1/2 drives seeking, etc REALLY bring me back in a way emulation can't. I'm really fond of your effort to preserve the sounds!
Thanks!
Another thing stopping me is how there was no visualizations of an old CD-ROM drive working in action (unlike floppy and hard drives) for more detail study. Understandable, being laser devices... i'd also have to throw in artificial stalling times and such for the drive in question, and doing that for the floppy drives was already a big hack for getting the old bootup seek times.

CD drive noise is something very overlooked for some systems emulated IMO. NeoGeoCD, Dreamcast, etc.. all need their loud drives in software
EluanCM wrote:
Sat 15 Feb, 2020 12:20 am
BTW: your string doesn't sound very useful! :D
I believe the real model name's a CRMC-FX400 but i'd have to yank out the drive from a dead system to find out and I don't feel like doing that now. I did unearth the firmware revision from a system.dat (dragging it into a throwaway win98 install, booting in safe mode and viewing device manager) however. B05


Also maybe there can be a generic "ATAPI CD-ROM ##X" name alternative to "PCem PCemCD" too. I've seen one drive in the wild showing in device manager like that before. Probably a Windows 9x fallback name though like GENERIC IDE HARD DISK TYPE 47 etc

User avatar
leilei
Posts: 731
Joined: Fri 25 Apr, 2014 4:47 pm

Re: [Patch] CD-ROM model selection

Post by leilei » Sun 23 Feb, 2020 2:14 am

Here's some models I scraped from info (rather than the actual drives)

Code: Select all

        {
                "MATSHITA",
                "CR-571",
                "53R141", 
                "CR-571", // unknown
                "1.0e",

                "",
                "1.0e",
                "CR-571-B",
                "Matsushita CR-571 2X",
                "matsushita_cr-571_2x",
                CD_MODEL_INTERFACE_IDE,
                2,
        },
        {
                "MITSUMI",
                "CD-ROM        !B",
                "53R141", 
                "CD-ROM        !B", 
                "B05",

                "",
                "B05",
                "MITSUMI CD-ROM        !B",
                "MITSUMI CRMC-FX400 4X",
                "mitsumi_crmc-fx400",
                CD_MODEL_INTERFACE_IDE,
                4,
        },
Earlier Packard Bells use a Matsushita 2X so I tried to put that in, but isn't enough to initialize with the driver given.
Last edited by leilei on Tue 25 Feb, 2020 1:23 am, edited 1 time in total.

User avatar
omarsis81
Posts: 783
Joined: Thu 17 Dec, 2015 6:20 pm

Re: [Patch] CD-ROM model selection

Post by omarsis81 » Tue 25 Feb, 2020 12:59 am

Here there is another CD-ROM string. What else should I provide?
20200224215650.JPG
20200224215650.JPG (172.62 KiB) Viewed 79 times

Post Reply