• Please review our updated Terms and Rules here

Cromemco JS-1 Joystick Replica

I may be able to do stereo by combining the first two channels into one analogue output and the other two channels into a second. However, I would have to tweak the cosine table accordingly to get the full amplitude out of the DAC.

Of course, we could use one channel per DAC output for quadraphonic!

Another thought, if you are using the speaker in the JS-1 joystick, this only has a switching transistor driving the speaker - so it is essentially 'digital' sound (with the speaker either being 'on' or 'off'). The program (and DAC) produces an 8-bit sinusoidal output, so you should get a much better sound quality by feeding the DAC output into an amplifier, but with the appropriate resistors (potential divider) to match the DAC output voltage to the amplifier input sensitivity.

Of course, this won't fix my note errors!

Of course, the note errors may have been in the original magazine article all those years ago, so could be a faithful replication of the original electronic score...

Dave
 
Last edited:
Really impressive considering you don't have anything to test this on & thanks for posting a link to the origins of this code - really interesting read.
 
Most definitely! I made a small a change so it outputs the audio to both DACs (port 19h & 1Bh) so it plays on both joysticks at the same time now. haha very neat
 
Last edited:
Added D+7A audio support for the z80pack emulator... seems to work ... kind of... 👻


That's pretty cool! I still need to get z80pack set up correctly so I can do development on there. Right now my snake game is so huge (surely due to my awful code) it takes like almost 10 minutes to assemble @ 4mhz. It has Dazzler support too, right?
 
Yes is has. Also asm80.com is using z80pack, but I am not sure whether it utilizes the Dazzler code. I changed the z80pack Dazzler code a bit so you may achieve a slightly more accurate timing (includes interlaced display with two fields in a single frame, also looks more vintage...).

I am using a standar IDE for the development (Geany for Linux and Ultraedit for Windows, but there are many alternatives), zmac for the assembly, cpmtools for building the disk images, and z80pack with Linux or Cygwin for the runtime (z80pack requires X Windows for the Dazzler display). Most of the toolchain can be automated. I am not sure whether there is a cross compiler for C language, but I am coding assembly only anyway. Turnaround times are just seconds, which makes it more comfortable to apply & test even small changes.

I am still looking for improving the audio results of the audio emulation. There are still relatively strong artifacts probably resulting from the fact that Windows/Linux has no real time capabilities, and the emulator can't guarantee time synchronous CPU execution (typical emulator problem), which leads to dropouts and needs a more sophisticated buffering. Maybe higher prioritization of the emulator helps. Also there might be a need for a better fine tuning of the sampling rate and a low pass filter. Next should be joystick support for the analog inputs.
 
Hi,


I made a CP/M compatible disk of all the CDOS GRAPHICSZ80.dsk files I've gotten so far ... next step is for somebody to convert those DAZZLER subroutines to something MBASIC and ASM(DR).COM can work with.

http://www.brainless.org/Altair/Repository/DAZZLER-CPM-GRAPHICSZ80.dsk



This is the CDOS GRAPHICSZ80.dsk:

http://www.brainless.org/Altair/Repository/DAZZLER-CDOS-GRAPHICSZ80.dsk
In case anyone is wondering, these are CP/M formatted Altair 8800 disk images, which can be examined using the "Altair Tools" utility found here:
 
Last edited:
Hi,

This is fun … I just need to figure out the best and fastest way to blank the screen into one solid color starting with black.

In the video you can see my first program creating some crappy circles on the screen, the 2nd program was the first attempt at blanking out the screen with different colors by printing dots in each position … the long way to do it.

20240910 First DAZZLER II Programs
This is all done on my Altair 8800c computer = TDL Z80 ZPU board, ME 88-2SIOJP Serial I/O board, MD FDC+ Serial Drive Server board and a TW DAZZLER II board.


.
 
>>> I just need to figure out the best and fastest way to blank the screen into one solid color starting with black.

Load the first byte of the Dazzler buffer with the desired colour. Depending upon the chosen mode, this may contain 2 or 8 pixels.

Use the Z80 block transfer (LDIR) instruction.

This instruction requires that register pair HL points to the start address of the Dazzler buffer (the byte of colour you previously stored), DE points at the next byte of the Dazzler buffer, BC contains the number of bytes in the Dazzler buffer minus 1.

Whatever byte you stored, is replicated into all of the other bytes of the Dazzler's memory buffer at the maximum speed that the Z80 is capable of (ignoring using DMA hardware).

Unless you are using the MBASIC extension? Judging by the speed (or lack of it) you are. This is one reason why high-speed assembler graphics libraries were developed...

Dave
 
Hi,

Okay, now I got a good start for creating some new fun DAZZLER programs!

Just a bunch of circles, but now you can see them!


.
 
If you are drawing a complete circle (as you are), you should be able to speed up your drawing by 'reflecting' the X and Y coordinates four times. This means you effectively plot a quarter of a circle (one quadrant) and reflect the X and Y coordinates for the other three quadrants as individual points.

Dave
 
If you are drawing a complete circle (as you are), you should be able to speed up your drawing by 'reflecting' the X and Y coordinates four times. This means you effectively plot a quarter of a circle (one quadrant) and reflect the X and Y coordinates for the other three quadrants as individual points.

Dave

Hi,

That's if I'm plotting dots from a list, but this is the result of a couple of math equations ... they calculate each dot placement to sketch on the display.

A quick tiny fun little DZMBASIC program.

This is fun ... and now I need to learn more screen control ... The program CIRCLES.BAS ... is on my website in the DAZZLER section;
http://www.brainless.org/Altair/Repository.html#section12


.
 
My solution used (probably) the same equations to calculate the points as yours, but you only do the calculations for one quarter of the circle (a point at a time) but plot 4 points instead of 1.

The way you are drawing your circle is the slowest way possible.

Dave
 
My solution used (probably) the same equations to calculate the points as yours, but you only do the calculations for one quarter of the circle (a point at a time) but plot 4 points instead of 1.

The way you are drawing your circle is the slowest way possible.

Dave

Hi,

I'm not going for speed on sketching the circles and here's a problem to solve ... IF doing the same thing for Triangles, how would you split that into one quarter and mirror?

Placing each dot is part of the art around this type of program.

This program does the four mirrors ...


.
 
>>> IF doing the same thing for Triangles, how would you split that into one quarter and mirror?

Er, you wouldn't...

A triangle is three vectors and is not symmetrical!

Circles (and ellipses) are symmetric and can (therefore) be divided into quadrants for speed.

If speed isn't a problem, carry on with what you are doing...

Dave
 
Another thought, if you are using the speaker in the JS-1 joystick, this only has a switching transistor driving the speaker - so it is essentially 'digital' sound (with the speaker either being 'on' or 'off'). The program (and DAC) produces an 8-bit sinusoidal output, so you should get a much better sound quality by feeding the DAC output into an amplifier, but with the appropriate resistors (potential divider) to match the DAC output voltage to the amplifier input sensitivity.

I wanted to try your suggestion and see if I could get a better sound using a cheap LM386 amplifier. It definitely sounds better and has a "fuller" sound than before (and can go MUCH louder).. but I think it really would benefit from a filter.. I must have missed what article you were referring to though, could you repost it the link?
 
The D+7A boards analog outputs originate from its DAC and can put out a sine wave, but I'm not sure if the musical note system involved in the software referred to here, is doing that, or just outputting a square wave. The transistor amplifier in the Joystick box is an analog amplifier not switching amplifier. The circuit has no gain and is an emitter follower and follows the analog output from the OP amp fed by the DAC. A mild LPF would/could help the sound. My altered version of it has no gain either, it just converts the impedance.

One thing about digital sound if just square waves, it can be a bit harsh because the switching edges have high frequency harmonics (many 3rd order harmonics) in the basic nature of a square wave. If you just have one frequency or a single note, you can integrate the wave and get it back to a sine wave easily, just with an RC low pass filter. There are also sine wave shaper circuits that can help. But then as the frequency increases the integration becomes too heavy for the higher notes and their amplitude drops away. One way to partially remedy this is to then pass the signal through an OP amp high pass filter circuit, to recover the relative gain of the higher frequencies and help level the signal amplitude. So with a few OP amps, it is possible to make a circuit that will convert the typical range of frequencies from digital sound to sine wave sound which is "reasonable".

With more elaborate systems you could correctly shape each note with digital controlled filters. But then again you might wan't some harmonics to make it sound like a specific instrument like a guitar or piano. I have never done it, but I think a square wave file can be converted to a MIDI file and if that is passed to a MIDI synthesizer you can have it sound like any instrument you want.
 
Last edited:
Back
Top