Sound (again?)

Author(s): Guido Vieira
Publication: ZX-Appeal
Date: November 1985
Pages: 8

Since my last article I had the good fortune of purchasing a Spectrum ROM from England.As soon as it arrived mr v and I got to work on a Rom Switch of our own.It’s still being worked on.Anyway while this was being done I decided to switch ROMs.With the new Spectrum ROM I discovered several things:

1)When I first got the ROM I had no software for it,so I decided to try some 2068 programs.To my surprise(surprise! surprise!) it loaded perfectly!(WOW!)It also ran perfectly!I’m talking about the sound and joystick too. This was only true with the machine code programs such as Penetrator or Time Gate(2068 version).

2) Upon this discovery I decided to find out why this happened and discovered first how to operate the sound chip from the Spectrum ROM and then later how to use the joy stick.

Before I go into the actual program I shall tell you how this is done:

First you have to realize that the 2068 has a sound chip and that this sound chip also has a single bit I/O “Port”.It is through this port that the joystick port is connected.The only way to instruct the chip from the Spectrum ROM is by the OUT command.The OUT address for the chip is 245 for the register and 246 for the value.Now I’m not going to explain what the 2068 Manual says about the chip and how to program it,but I will tell you how to use those numbers up above.

Note:read the 2068 Manual on sound if you don’t know how to use the sound command

The instruction OUT 245 will program the sound chip with the register you want.Ex OUT 245,7 will give the chip the instructon to activate register #7.OUT 246 will load the register with the desie[illegible]d value. Ex OUT 246,56.

The above OUT’s(OUT 245,7:OUT 246,56) are the equivalent of the command SOUND 7,56. The following program might clarify things better if you experiment a bit:

10 INPUT "REGISTER";r:INPUT "VALUE";v
20 OUT 245,r:OUT 246,v:GO TO 10

Or try this:

10 OUT 245,7: OUT 246,58
20 OUT 245,8:OUT 246,15
30 OUT 245,9:OUT 246,15
40 OUT 245,10:OUT 246,15
50 FOR a=1 TO 255: OUT 245,0: OUT 246,a:OUT 245,2:OUT 246,a-10:OUT 245,4: OUT 246,a-15:NEXT a

Next time we’ll talk about the joystick port.

The 5131s integrated sound chip.
The 5131s integrated sound chip.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.