News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_XeNoMoRPH

SNDh2AYc - iNViTRO for Benediction Coding Party

Started by XeNoMoRPH, 19:31, 13 August 25

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Targhan

Yes, the DMA allows you to buffer AY values, so that you the player can fill it, and then is done, and you have all the rest of the CPU to do your game/effect. This is also what allows Grim (in the Semilanceata demos: Sappy and Seminoisin), and also Power (Heat Beats demo), featuring samples and MOD playing, to mix effects with more elaborate sounds.

Doing that on a real CPC is from ultra-bothersome to impossible, depending on what you want to achieve.
Targhan/Arkos

Arkos Tracker 3.2.7 now released! - Follow the news on Twitter!
CPC Scene Radio! 24/7 CPC music only! Website Stream
Disark - A cross-platform Z80 disassembler/source converter
FDC Tool 1.2 - Read Amsdos files without the system

Imperial Mahjong
Orion Prime

andycadley

The DMA has 3 channels that each run a sort of mini program, without the CPU needing to be involved. Each can execute one  command per scanlines, so you can effectively write to 3 AY registers every 64us.

The advantage is twofold: 1) It can do this without the CPU being involved and the timing can be very precise. 2) Three arbitrary register writes is faster than the CPU can ever do, so you can feed the AY more data. 

HAL6128

Oh, thank you, if I understood it right it's similar to digitizing a sample with a higher bit rate and therefore it's more precise (maybe, not a good comparison because there's more behind)
How is the DMA being triggered?

andycadley

Partly. On a normal CPC, if you dedicate all the CPU time to it, you might be able to play back at sample at maybe 12KHz.. Using the DMA, the Plus can push three 15KHz samples with almost no CPU intervention. A higher sample rate means better quality playback.

But that's not the whole story. The DMA doesn't just play samples. You can also create DMA lists that just play back standard AY style music. The quality isn't necessarily better in that case (although some effects may be easier to achieve) but again you gain the benefit of offloading some of the audio work giving the CPU more time.

Another trick Plus coders seem to love is to take advantage of the timing capabilities of DMA lists to generate CPU interrupts at tightly controlled intervals - giving a much more flexible mechanism for pulling off raster bars etc (and proving coders will find all sorts of exciting ways of utilising hardware in unintended ways!)

As to how it is triggered each channel has a program pointer and a pause prescaler register in the ASIC where you can set where the DMA list starts in RAM for that channel (the pause prescaler allows for longer DMA PAUSE instructions that normal by effectively multiplying it by the scale value first). Then there is a single control register that can start or stop all the lists at once, to help keep everything in sync. 

BSC

** My website ** Some music

My hardware: ** Schneider CPC 464 with colour screen, 64k extension, 3" and 5,25 drives and more ** Amstrad CPC 6128 with M4 board, GreaseWeazle.

HAL6128

Oh yes, thanks all. That provide me a good overview of the possibilities. Very amazing and effective, that DMA. 
So, the Gate-Array in the PLUS is the DMA trigger/controller?

I've read that the Floppy-Disc-Controller (765) also owns DMA capabilities but not used in the CPC range? What a pitty.

andycadley

Pretty much all the hardware in the Plus (crtc, ppi, ga and all the new bits) live inside the ASIC. So it's inevitably responsible for most things.

As to the 765, I don't think it actually supports DMA itself though is designed to be easily integrated with a DMA controller. Might have been useful I guess, although it would likely have just ended up stalling the CPU in order to write back to memory, so the performance gains may have been negligible. 

arnoldemu

Quote from: HAL6128 on Yesterday at 20:44Oh yes, thanks all. That provide me a good overview of the possibilities. Very amazing and effective, that DMA.
So, the Gate-Array in the PLUS is the DMA trigger/controller?

I've read that the Floppy-Disc-Controller (765) also owns DMA capabilities but not used in the CPC range? What a pitty.
True it can work with a DMA controller. As andycadley says I am unsure of the benefit as it would have to pause the CPU for transfer. The FDC can also generate interrupts, and was used in the PCW, and it's a shame it wasn't used in the CPC either as that would have been more useful and the better approach here.

The Sound DMA in the Plus feels happens during hsync and horizontal blanking (when no pixels are output) so likely uses the same memory fetch mechanisms as for pixels so that is not going to affect the CPU done this way. A clever way to utilise that time.

I guess a Plus-Plus/Plus-Next Generation  ;D could utilise the time in the vertical blanking for fetching data in the same way..


Longshot

Quote from: arnoldemu on Today at 12:21The Sound DMA in the Plus feels happens during hsync and horizontal blanking (when no pixels are output) so likely uses the same memory fetch mechanisms as for pixels so that is not going to affect the CPU done this way. A clever way to utilise that time.
Indeed, that's exactly what it does.
Fetched DMA instructions are then "displayed" instead of VRAM.
Rhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!!

Powered by SMFPacks Menu Editor Mod