Out of curiousity, did have to you change the CH376S_WR_USB_DATA define to 0x2B, as mentioned in posts 228 and 235, or did you leave it as 0x2C?
If we can get to a common set of commands that will work on both devices for read/write/initialize/setup, that might make it possible to support both chips with a single firmware, which is the big dream for me-- work done for the ISA-card people will benefit the people using the CH376S-on-the-mainboard people and vice versa.
I've done another trivial change at
https://gitlab.com/hakfoo1/v40-bios/-/blob/CH375-Workarounds/disc.asm
In the past, this BIOS never set "number of hard discs" in the BIOS data area, address 0x475. Maybe that confuses the "official" XT BIOS that expects it to be set.
I noticed the XT-IDE Universal BIOS docs mention that their BIOS paid attention to that value, and indeed with it set, I was able to boot with both BIOSes working together-- the CH376S was the first drive, and the XT-IDE was identified as second. Usual disclaimer of who-knows-what-subtle-horrors-lurk, but that does seem to make a real-world difference. Maybe it's what the XT BIOS needs to actually try to boot.
(There's also some tweaks to the delays used during the bring-up process; there's been a never-ending game of trying to optimize them to be quick, but not accidentally outrun the device's ability to respond. I figure this is something that people might want to tune themselves for their specific needs)
My build uses the Anonymous BIOS with some hardware-specific tweaks (loading an alternative to ROM BASIC, initializing V40-specific peripherals and a weird keyboard controller). The vanilla version at
https://www.phatcode.net/downloads.php?id=101 might be worth experimenting with on a real 5160. Its boot logic is pretty damn naive: it tries drive A and C whether or not they exist.
If you're running benchmarks, one other thing you might want to play with-- the ALLOW_INTS option, if set to 1, should add a "STI" at the top of the INT13 handler. This should hopefully allow other interrupts (like serial devices and the timer) to work normally. This obviously increases the risk something will go wrong-- either a break at the wrong point in the loop, or some Rube Goldberg series of events that causes another disc operation to trigger while we're in the middle of one-- so I've left it off for now, but the intent was to prevent "time distortion" during benchmarks-- where it assumes everything was super-fast because the timer tick didn't fire while doing disc accesses. I'd realistically expect to see lower benchmark scores with it in place.
IMO, it's sort of a mediocre value proposition. It's like $25 inclusive of shipping typically, while the CH375/6 on little breakout boards are between $3 and 8 or so, and it's like three pieces of 74LS logic that probably add another two bucks. So you're paying $10+ for a tiny scrap of PCB, and not even a slot cover or EPROM.
I wonder what the costs would look like for doing a pre-assembled SMD version using something like JLCPCB's assembly service. I suspect if you did a group order of 20 boards, you could get them down below $15 per unit assembled. I'm not sure if they'll assemble everything (the USB connector might not be offered, I think they only do SMD assembly) though.