1k2b - 2 channel beeper routine for unexpanded ZX81

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
utz
Posts: 27
Joined: Fri Jul 15, 2011 11:06 pm

1k2b - 2 channel beeper routine for unexpanded ZX81

Post by utz »

Impossible!
- Sinclair Oozer

ZX81 will kill us all!
- Stephen HawKing

Jet Set F*cking Willy!
- Sir Clive Sinclair

1k2b is a 2,5 channel beeper routine for the ZX81. It was made with the unexpanded (1K) model in mind and is thus rather minimal in its features. It does however run on RAM-expanded machines as well. 1k2b features 2 channels of pulse interleaving (square wave) sound with 16-bit note dividers, and 2 interrupting click drums.

In order to hear it on real hardware, the "loud cassette" mod is recommended.
EightyOne emulator emulates it somewhat ok-ish, sz81 fails.

download (includes a Perl-based XM converter for making your own tunes)
source
sound example

Sound example is recorded from EightyOne, which gives rather unstable sound unfortunately. I'd be very happy if someone made a recording from hardware.

Special thanks to kokkiklhs for reinstating my belief that multichannel beeper on ZX81 is possible.
Attachments
1k2b.p
(948 Bytes) Downloaded 174 times
User avatar
yerzmyey
Posts: 1240
Joined: Thu May 15, 2008 10:11 am
Location: Rubber Planet
Contact:

Re: 1k2b - 2 channel beeper routine for unexpanded ZX81

Post by yerzmyey »

Like I mentioned elsewhere, it is simply BRILLIANT.

Now the question remains - who can record it from the real ZX81?
IN NIHILUM REVERTERIS - a big text-adventure game for ZX81: http://tiny.pl/g2m6m
"MONOCHROME" issue 5 - (Spring 2014) free paper/PDF magazine about ZX81: http://tiny.pl/q2m44
ZX81 COMPETITIONS 2007/2009: http://zx81.republika.pl/
User avatar
stefano
Posts: 568
Joined: Tue Dec 11, 2012 9:24 am
Contact:

Re: 1k2b - 2 channel beeper routine for unexpanded ZX81

Post by stefano »

Good ol' bit banging :)
Well, congratulations for the very good tuning ! Also the cute melody brings memories of those professional videogames for the Spectrum ..
Do you mind if I study the source and try to steal something for z88dk ?
olofsen
Posts: 189
Joined: Wed Jan 08, 2014 12:29 pm

Re: 1k2b - 2 channel beeper routine for unexpanded ZX81

Post by olofsen »

Port 0xfc is now interpreted by sz81: http://rullf2.xs4all.nl/sg/sz81-2.1.9.tar.gz (Linux only); on the second configuration page, VSYNC may be selected as sound device, and 1k2b now seems to work?
utz
Posts: 27
Joined: Fri Jul 15, 2011 11:06 pm

Re: 1k2b - 2 channel beeper routine for unexpanded ZX81

Post by utz »

Thanks you guys, glad you like it :) If there's interest, I'll make some more complex beeper engines for the Zeddy later. For now I'm busy with some other projects though.

Stefano, sure, you're more than welcome to use it for z88dk. Though unfortunately I somehow never manage to get the latest version to install, it always complains about some invalid paths with double slashes in in them... but that should better discussed in z88dk forum, perhaps.

olofsen, awesome, thanks a lot! Now I can use Linux again for my ZX81 development. I've updated the readme accordingly. Only one question, it seems the latest version of sz81 is trying to connect to the internet? What for? Btw not sure how you fixed port $fc, but perhaps a more complete fix of the port behaviour is needed? Don't know if I'll use $fc next time...
Output to Port FFh (or ANY other port)
Writing any data to any port terminates the Vertical Retrace period, and restarts the LINECNTR counter. The retrace signal is also output to the cassette (ie. the Cassette Output becomes High).

Input from Port FEh (or any other port with A0 zero)
Reading from this port initiates the Vertical Retrace period (and accordingly, Cassette Output becomes Low), and resets the LINECNTR register to zero, LINECNTR remains stopped/zero until user terminates retrace - In the ZX81, all of the above happens only if NMIs are disabled.
from http://problemkaputt.de/zxdocs.htm#zx80zx81ioports

Btw I added an "extra" version to the 1k2b package. It offers 102 bytes more space for music data (imo that's quite a lot on a 1K machine). This is made possible by jumping into the m'code via the D-FILE, rather than the usual RAND USR method. The downside of this method is that you can't easily integrate this version with other programs.
olofsen
Posts: 189
Joined: Wed Jan 08, 2014 12:29 pm

Re: 1k2b - 2 channel beeper routine for unexpanded ZX81

Post by olofsen »

Thank you, you're right, the port behaviour needs a more complete fix. And sz81 gathers information for ZeddyNet, so that Siggi's ZeddyFox and NFM may be used and programs may be loaded from a server - but then more than 1K RAM is needed ;)
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: 1k2b - 2 channel beeper routine for unexpanded ZX81

Post by Andy Rea »

Cool very cool, just got round to trying this on real hardware impressive for 1K although i tried it on an expanded machine :-)

Andy
what's that Smell.... smells like fresh flux and solder fumes...
utz
Posts: 27
Joined: Fri Jul 15, 2011 11:06 pm

Re: 1k2b - 2 channel beeper routine for unexpanded ZX81

Post by utz »

Thanks Andy! I'm very glad it works on your hw - because unfortunately now I have several reports of it not working. Could you post the specs of your hardware setup for reference?
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: 1k2b - 2 channel beeper routine for unexpanded ZX81

Post by Andy Rea »

standard ZX81 with ZXpand, casette player monitor plugged into mic socket, simple speaker monitor plugged into casette player.

Image

and video here

http://youtu.be/l-q-TogwCQM

Regards Andy
what's that Smell.... smells like fresh flux and solder fumes...
utz
Posts: 27
Joined: Fri Jul 15, 2011 11:06 pm

Re: 1k2b - 2 channel beeper routine for unexpanded ZX81

Post by utz »

Awesome, thanks for the video! So now I need to find out what ZXpand does differently compared to an unexpanded machine. Because it sure doesn't work on my Zeddy, neither unexpanded nor with standard Sinclair US 16K expansion. Does the ZXpand affect the Print buffer and/or BASIC calculator stack in any way? Also, I assume you used the "standard" version of 1k2b, correct?
Post Reply