georgel wrote on 2025-05-29, 22:02:
EDIT:Yes, it is checking ROM bytes. Now the firmare stub reports hardware version 0. The 2M EPROM installed successfully, dumps successfully via the dumper, and MIDI synthesizer now works well. I guess now I have Soundscape 2000 equivalent for MIDI. If someone wants me to check other soundscape ROM dumps, my configuration is convenient, just provide the dump you want to be tested. Thanks mkarcher.
Oops, I didn't see your edit, as it didn't show up as "new post", so I disassembled that ROM myself, too. To make the algorithm of the hardware detection ROM public: It works like this:
- Send FF to host, to confirm successful start of firmware code
- Write a byte to address 0x800 (2K) in firmware RAM space. That address will have address bit 11 set. When SSINIT uploaded the firmware, the ODIE chip was configured to "firmware RAM is DRAM", and bit 11 will always end up as row address bit. If the firmware RAM is SRAM instead, the row address is ignored by the SRAM (as it does not connect /RAS), so the write ends up in byte 0 instead.
- If byte 0 is affected by that write, the card uses SRAM as firmware RAM. SSINIT needs to reconfigure the memory controller before firmware images bigger than 256 bytes work (in case of 64KWord firmware RAM). In case of 4M firmware RAM, images up to 2K would work. That's why the stub firmware needs to be less than 256 bytes - that's the maximum size that works with any kind of mixed up memory configuration. If the firmware memory is found to be SRAM, set bit 4 in the output (0x10).
- Probe whether "memory bank 2" yields writeable memory. AFAIK no PC SoundScape cards have anything connected to "memory bank 2". "memory bank 0" is firmware RAM, "memory bank 1" is the sample ROM. If "memory bank 2" is writeable, set bit 5 in the output.
- Look at byte 0x24 in memory bank 1. As the sample ROM is mapped as 8 bit device, this is location 0x12 in the ROM image. All the odd bytes in sample ROM space are undefined. Here you get a lookup table: If that byte is oxFD, request firmware type 0; if that byte is 0x0F, request firmware type 1; if that byte is 0x19, request firmware type 2. If the sample ROM has not yet been identified, and that byte is nonzero, return unknown sample ROM by requesting firmware type 15.
- If byte 0x12 in the sample ROM (i.e. 0x24 as seen by the 68000 processor) is zero, this is a later card (probably one that no longer has the SDGI-type header). In that case, an advanced feature of the ODIE-like chip is tested: Some advanced chip (no idea whether OPUS or VIVO) has an extensino that responds to address beyong the the 0xA00000..0xA0001F range from the ODIE datasheet, and it allows a word write to 0xA00026 to be handled in a way that the more significant byte ends up in 0xA00006. If that feature is supported, request firmware type 4. If that mapping does not happen (no idea whether you get the low byte written to the "upper range"), request firmware type 3.
- Send FE to host, to confirm success of the hardware detection
- Send the output byte (requested firmware in bits 0..3, SRAM indicator in bit 4, extra sample RAM indicator in bit 5
- Start an endless loop.
The original stub code on georgels card would have reported "unknown firmware required, DRAM for firmware memory, no sample RAM", as the 1350901501 ROM has the unhandled value 3C in the location used to identify the sample ROM variant.
It seems the sample ROMs have some tables in the end that are not MIDI wave samples. If that data is sufficient to generate the instrument mapping in the firmware, a patched SNDSCAPE.CO0 for the old 1M sample ROM could be prepared.
EDIT notification: I rewrote the paragraph about the detecteion of the ODIE extended register.