My Z80 thing, again

Wheee!

I added a handful of counters, so now the Z80 thingy has a sense of time. So I put together a tone generator and coded up some tunes.

Here's what's on the breadboard:

formatting link

The MK48Z02 is only 2kB, so I can't put much on it... still, a good minute or two running time.

If I had the bytes, the LED display would be animated, too (since the tone generator runs "in the background"). This program is stripped down to maximize notespace, so it doesn't blink or anything. So that's why I didn't record a video, it's not worth it. The audio part is still worth listening to, however...

formatting link

(Unfortunately I couldn't quite fit the entire piece in, by just a few bytes, so it cuts off rather abruptly at the end...)

Incidentially, I recorded this by running the square wave through my sound system, fairly loud, and recording it using my computer mic, placed very near the speaker. It doesn't look like a squarewave anymore, of course. The room adds a bit of reverb. I'd call this my first attempt at recording something to at least moderate quality. Decide for yourself!

Tim

Reply to
Tim Williams
Loading thread data ...

cool, even polyphonic in places.

perhaps static huffman compression, or a way of coding repeating phrases?

Reply to
Jasen Betts

I can't hear polyphonic. The music is monophonic anyway, at least for the beginning:

formatting link

But from the middle some chords are in the music, which don't sound good in the Z80 implementation, because of the missing theme while playing the simplified chord.

formatting link

--
Frank Buss, fb@frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de
Reply to
Frank Buss

Two thumbs up! :-)

Ed

Reply to
ehsjr

He should have a look at the source code for the MAME emulator. It emulates the CPUs in the old, upright video games, with the Z80 being the primary one. The sound sample files the games used then were stereo.

The sound sample code for pinball machines is pretty elaborate synth stuff too.

Mame source code is a hell of a way to learn about nearly any old CPU API and also how to emulate it in Linux, DOS, or Windows 32 and 64 bit.

It is quite a development. Very useful learning tool.

formatting link

The SDL version for Linux compiles nicely too!

formatting link

Reply to
Mr.Eko

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.