How to ... Track the JoyStick position and buttons from MBASIC?

31 views
Skip to first unread message

Walt Perko

unread,
Aug 15, 2025, 10:13:10 PMAug 15
to Altair-Duino
Hi, 

How to ... Track the JoyStick position and buttons from MBASIC?  

I've been writing lots of DZMBASIC (enhanced MBASIC) programs for the DAZZLER and they work great, but now I want to start using the JoySticks, Buttons and Sound.  

But I don't know what kind of MBASIC commands will track the JoyStick position, button action or to make sounds.  


.


Eric Smith

unread,
Aug 16, 2025, 2:48:50 AMAug 16
to Altair-Duino
On Fri, Aug 15, 2025 at 8:13 PM Walt Perko <r4r...@gmail.com> wrote:
But I don't know what kind of MBASIC commands will track the JoyStick position, button action or to make sounds.  

I haven't tested it myself, and I don't know anything about DZMBASIC, so maybe it has special commands to do that. Does any documentation on DZMBASIC exist? A web search didn't turn up any.

I think the Dazller simulation includes Cromemco D+7A for the joysticks, at the standard port addresses 0x18 through 0x1f. If so, for normal MBASIC the INP function is what you would use to read the joysticks.
INP(25) - first joystick X axis
INP(26) - first joystick Y axis
INP(27) - second joystick X axis
INP(28) - second joystick Y axis
The joystick buttons are all read with INP(24). The low four bits are the first joystick's buttons, and the high four bits are the second joystick's buttons.

Sound output from the D+7A is likely to be poor or unworkable from normal MBASIC, because the D+7A just provides an 8-bit DAC with sample-and-holds to drive the speaker(s). MBASIC isn't going to be fast enough to provide much sound control. To generate simple square-wave beeps, you'd need to write alternative values (e.g., 127 and 128) to the appropriate port at twice the desired frequency. Maybe DZMBASIC has some special commands for sound.





Patrick Linstruth

unread,
Aug 16, 2025, 7:23:41 AMAug 16
to Altair-Duino
--
You received this message because you are subscribed to the Google Groups "Altair-Duino" group.
To unsubscribe from this group and stop receiving emails from it, send an email to altair-duino...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/altair-duino/3efc81e5-e7c0-4095-bb1f-412e7924bfb1n%40googlegroups.com.

Walt Perko

unread,
Aug 16, 2025, 3:18:36 PMAug 16
to Altair-Duino
Hi, 

DAZZLER SUPPORT FOR MBASIC:

All DAZZLER commands are in the format:  DZOP “<action>” [, <argument>…]

ACTION
“I” – Initialize
ARGUMENTS
None
DESCRIPTION
Initializes the DAZZLER. This is optional. If omitted, the DAZZLER will be initialized automatically on the first call to any of the other actions.

ACTION
“P” – Position
ARGUMENTS
X, Y
DESCRIPTION
Sets the cursor to the specified coordinates.

ACTION
“D”—Dot
ARGUMENTS
None
DESCRIPTION
Displays a dot in the current color at the current cursor position.

ACTION
“C”—Color
ARGUMENTS
Color code
DESCRIPTION
This sets the color for the next sketch command.

ACTION
“L”—Line
ARGUMENTS
X, Y
DESCRIPTION
Draws a line in the current cole or from the current cursor position to the specified X, Y coordinate. This will include a dot at each end of the line. The cursor position is moved to X, Y.

ACTION
“R”—Rectangle
ARGUMENTS
X, Y
DESCRIPTION
Fills in a rectangle in the current color from the current cursor position to the location (X, Y), inclusive. The cursor position and (X,Y) are the two ends of either of the two diagonals of the rectangle, in any order.

ACTION
“S”—String
ARGUMENTS
String
DESCRIPTION
A string expression of characters to be sent via the CHAR entry point. Each character must have an ASCII code in the range 0 through 127. Each character can be a printable character, or a control code as described in the DAZZLER GRAPHICS LIBRARY documentation.

ACTION
“Z”—Zap
ARGUMENTS
None
DESCRIPTION
Clears the entire display

ACTION
“W”—Wait
ARGUMENTS
Time
DESCRIPTION
Waits 0.1 second times the value of “Time”.

ACTION
“A”--Animate“
ARGUMENTS
None
DESCRIPTION
 “Flips” to the other page of display memory. You can write to one page while the other is displayed.

ACTION
“Y’—cYcle
ARGUMENTS
None
DESCRIPTION
Cycles the display through the palette(??)



.
Reply all
Reply to author
Forward
0 new messages