DMA - Direct Memory Access on the ZX Spectrum Next
This is the third video in a short series looking at some of the more advanced parts of the Spectrum Next. If you've not seen the others, go watch them after this one. In this video we're looking at how to program the DMA controller in the Spectrum Next. This'll be technical, it'll include code on how to do this using Z88DK and C for the Spectrum Next. It's a pretty advanced technique, but it's quite understandable and can add some nice speed boosts to code if used appropriately. DMA or Direct Memory Access is a way to allow devices access to system RAM without the CPU being involved. The DMA controller in the Next is a programmable device and has a few registers that need writing to. This is well documented on the Spectrum Next wiki https://wiki.specnext.dev/DMA. There are seven registers called WR0 to WR6. Writing to them is like when we configured the sprite system in my other video. Each register is accessed through the same IO port and the pattern of the first three bits tells the DMA controller which register you're writing to. The only thing to know is this is purely a DMA, it can copy continuous runs of bytes. It's not a blitter so it is unable to copy a rectanglular block of RAM. Also for small copies, the setup and configuration may actually be slower than doing it by hand with memcpy. It's definitely something to use with large amounts of data though. A music playing routine running in a vblank interrupt would use this to feed the audio hardware with sound data. Chapters: 00:00 Start! 00:45 What is DMA? 01:41 ZX Next DMA 02:01 The DMA Registers 02:32 Register WR0 03:10 Code example DMA Screen Copy 04:23 Register WR1 05:03 Registers WR2 and WR3 05:20 Register WR4 05:44 Register WR6 06:13 A note on writing to registers 06:45 Repeating DMA transfers 08:00 Closing Notes Credits: Casio Calculators - J. C. Barros from Portugal, CC BY 2.0, via Wikimedia Commons Random images - Midjourney Music - Epidemic Sounds

Parallel Port to Speaker - MS-DOS Audio Trick

I've used Linux for 12 years, but I never knew these 17 facts

Compute Vlog pt 1: Making speedy code with SIMD

The Z80's secret feature discovered after 40 years!

The PC Speaker shouldn't sound this good!

Top 50 ZX Spectrum games of 1988 - in under 10 minutes

Your RAM Has a 60 Year Old Design Flaw. I Bypassed It.

German Pilot Tested A Captured Spitfire... His Words Shocked The Luftwaffe

Rebuilding IBM's Most Obnoxious PC - PS/2 Model 70 Type 1

How I Built a Joystick Interface (And Made Every Mistake)

How Retro Games Built Their Worlds (Tile Maps in C from Scratch)

How does Computer Memory Work? 💻🛠

I Hacked This Temu Router. What I Found Should Be Illegal.

Who Dares Ripoff Commando? | ZX Spectrum | Commodore 64 | Amstrad CPC | 8-Bit Battle!

🚗 BYD : The biggest SCAM of the car industry ?

1985: Introducing the AMIGA | Micro Live | Retro Tech | BBC Archive

Possibly the fastest booting IBM PC (Running at 4.77MHz)

State Machines - How to engineer better software

Programming in Assembly without an Operating System

