CPCWiki forum

General Category => GFX + Tunes => Topic started by: ComSoft6128 on 15:18, 07 January 23

Title: Music query
Post by: ComSoft6128 on 15:18, 07 January 23
When recording a 2022 slideshow for YT this morning the music slowed or stopped when accessing the disc to load  the next image. This is common in most (all?) CPC slideshows going back thirty years or so. 

Is this a DOS or a processor (or both) problem?

I'm curious why this happens but I'm feeling around in the dark here......
Title: Re: Music query
Post by: pelrun on 16:19, 07 January 23
AMSDOS disables interrupts a *lot*. And makes no guarantees about re-enabling them in a timely fashion. So any player will have a bad time.

Demos manage to do disc loading without audio hiccups by either preloading everything, or bypassing/reimplementing some or all of the disc handling themselves. Simple slideshows aren't going to bother.
Title: Re: Music query
Post by: ComSoft6128 on 16:36, 07 January 23
Thanks for the info :)
Title: Re: Music query
Post by: Prodatron on 14:08, 09 January 23
The CPC doesn't have a DMA chip.
When the FDC (Floppy Disc Controller) receives data from the sector of a disc, the Z80 cpu has to wait for every single byte and put it into the memory. If it would miss one sigle byte during reading one sector, the whole sector data will be corrupt. Because of this you have to lock the interrupts during the reading of one sector.
Later computers had DMA chips (yes, the Plus as well, but that's another thing), which made it possible to load the disc data directly to memory without using the CPU.
IIRC some old Demos with music loaders used smaller sector sizes (128 or 256bytes), which made it easier to load one sector within a frame and play the music still with 50Hz.
With todays optimizations I guess it's even possible to load 512b sectors and play 50Hz music. At least 25Hz music wasn't an issue with 512 byte sectors.
Title: Re: Music query
Post by: Anthony Flack on 01:04, 23 February 23
Another reason to appreciate just how much work went into Orion Prime.
Powered by SMFPacks Menu Editor Mod