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 20:44, 23 August 25Oh 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 12:21, 24 August 25The 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!!

GUNHED

Quote from: BSC on 15:49, 21 August 25
Quote from: GUNHED on 19:08, 20 August 25Comparing 6128plus and CPC regarding sound...  :-\ :picard: :picard2:
You seem confused, but I can help.
Look, you wrote:
Quote from: GUNHED on 13:35, 16 August 25That's the first time I do hear such kind of sound on CPC and it really IS sound (both!). Previous attempts going into that direction failed cathastrophically as we all know.

Here, you obviously confused the Plus range (464 and 6128 Plus), for which this intro was coded, with the CPC range, which some people used to call "CPC old" to distinguish them from the 464 and 6128 Plus. Those "old" ones were the CPC 464, 664 and 6128, as you might have heard. Those have different hardware than the Plus range, which has this ASIC (quoting names so you can do some research on you own). Specifically, the CPC range does not have DMA to address the sound-chip. Something which was used in a great way in this intro here to play so-called SID voices. Not for the first time even, but let's leave that aside. On the CPC, however, similar sounding SID sounds are literally impossible for the lack of DMA support. Overflow was one of the first to demonstrate how this can be done on the CPC and I think it was very impressive, albeit (and obviously) not of the same sound quality as SNDh2AYc demonstrated. So, when you write ".. kind of sound on CPC ..", you sound really confused. But I hope you got it now.
If it's clear to you now where your mistake was, just reply "Thanks BSC, I needed this". If you are still confused and need help, reply as you like.
"Thanks BSC, I needed this"

Especially after your previous comment:

"PS: SNDh2AYc runs on a Plus, which is not a CPC, learn your stuff."

Hope you learn your stuff in some of your future lifes ;-)
http://futureos.de --> Get the revolutionary FutureOS (Update: 2024.10.27)
http://futureos.cpc-live.com/files/LambdaSpeak_RSX_by_TFM.zip --> Get the RSX-ROM for LambdaSpeak :-) (Updated: 2021.12.26)

Powered by SMFPacks Menu Editor Mod