GideonZ / 1541ultimate

Official GIT archive of 1541 ultimate II sources
GNU General Public License v3.0
181 stars 46 forks source link

Ultimate 64 DMA load menu causes FM-YAM cartridge to switch off #166

Open Odie-Cosine opened 4 years ago

Odie-Cosine commented 4 years ago

When you have an FM-YAM cartridge (also Commodore SFX Sound Expander) plugged into the Ultimate 64 and you use the DMA menu to load and run programs from the Ultimate 64 menu that make use of the cartridge for FM sound, the cartridge stops working.

If you power on the Ultimate 64 and mount a disk image and use either standard kernal load routines or one of the fastload cartridge images (allowing the mix of internal cartridges and external cartridges), then the FM-YAM cartridge and SFX Sound Expander cartridges work correctly.

It is purely the DMA loading which is disabling these external cartridges. Once this bug is triggered, you have to switch off/on the Ultimate 64 and use method 2 to make these cartridges work again.

GideonZ commented 4 years ago

Which firmware version are you using? 1.34?

Odie-Cosine commented 4 years ago

Hi Gideon, yes it is 1.34 firmware I am using (on a 1.2A revision board) but this bug has been around for a very long time. I am wondering after reading open case #161 about external Action Replay cartridge issue with DMA load if the two are linked and maybe all external cartridges are being disabled when the DMA menu is used?

I think my machine shipped with something like firmware 1.18 or 1.20 (I can't recall) and it took a while to realise that the DMA load would disable the external cartridge and a power off/on was needed to restart it.

GideonZ commented 4 years ago

Power on-off is not required. You can simply hit F5 and select "Reboot".

Of course the external cartridges are disabled for DMA load; that is, because an internal cartridge is used to perform the DMA load: $0001 needs to be switched in order to write under the $D000-$DFFF area. At least, that's how it has always been with the U2+.

On the U64 this may not be necessary, as I can force to write in the RAM under D000-DFFF without switching $0001. Maybe I should consider writing a DMA load for the U64 only. (And maybe this restriction can be lifted if the PRG in question does not NEED to write under D000-DFFF, e.g. for smaller files.)

However.. now that I think about this a bit more; it is not as easy as it sounds. What if an internal or external cartridge ends up in a menu, like Action Replay, Retro Replay, Final Cart III in desktop mode, SuperSnapsot, etc..? How is the program supposed to be run?

I'd love to brainstorm about this a bit more with clever users like you.

GideonZ commented 4 years ago

For the U64, 1.34, you may try to manually configure the bus sharing mode for I/O to "Both". I think this may solve your problem, but I haven't tested this.

Odie-Cosine commented 4 years ago

Hi Gideon,

My bus settings were already set to both so that doesn't work. I didn't know about the F5 reboot option which does allow the cartridge to restart as long as I don't go near the DMA menu when reloading a file from a D64 image.

As for the DMA and RAM locations $D000-$DFFF, I understand what you mean about the $0001 location (I guess there's some bank switching for the Ultimate 64's internal operations). The FM-YAM and SFX Sound Expander cartridges are accessed at $DF40, $DF50 and $DF60 so they fall within I/O addresses and not in RAM locations within the $D000-$DFFF range. We only write to those cartridge registers providing the VIC-II and I/O area are enabled at location $0001.