Poking around the Commander X16 EMU

Chat about anything CX16 related that doesn't fit elsewhere
Post Reply
Pantheris
Posts: 1
Joined: Wed Mar 08, 2023 5:09 pm

General - CX16 Poking around the Commander X16 EMU

Post by Pantheris »

So I was trying out the CX16 EMU and man is this system a little fun emulator. It runs decently well, and it's kinda fun to play with. Now I have been having some trouble with getting the sound capabilities working directly through BASIC, because I kind of wanted to possibly make a tracker and nothing I have tried, excepting games, have been able to get the VERA's sound generation to work. I was wondering why that was, because this beats the hell out of me. Also, I did improve the readability of that one line drawing demo I found on one of the videos that 8-bit guy did.
10 SCREEN 128
20 A = INT(RND(1)*320)
30 B = INT(RND(1)*240)
40 C = INT(RND(1)*320)
50 D = INT(RND(1)*240)
60 E = INT(RND(1)*16)
70 LINE A, B, C, D, E
80 GOTO 20
TomXP411
Posts: 1781
Joined: Tue May 19, 2020 8:49 pm

Re: Poking around the Commander X16 EMU

Post by TomXP411 »

Have you tried the new BASIC sound commands?

FMINIT sets everything up, then you can use FMNOTE to play a note.

Check out the latest emulator and manuals at https://github.com/X16Community/x16-emu ... es/tag/r42
DragWx
Posts: 342
Joined: Tue Mar 07, 2023 9:07 pm

Re: Poking around the Commander X16 EMU

Post by DragWx »

Hah, that's one of the first things I wanted to do too, when I downloaded the emulator for the first time just a few days ago. :D

The registers for controlling the VERA's PSG are actually in VRAM, so you needed to access them with VPOKE. In addition to setting a channel's frequency, you needed to also set the waveform, set the left/right output bits, and set the volume to something audible, so you needed four VPOKEs in total before you'd hear anything.

The new PSGxxx BASIC commands simplify this greatly, so that's the better way to go now.
User avatar
Jestin
Posts: 85
Joined: Sat Jun 27, 2020 10:14 pm
Contact:

Re: Poking around the Commander X16 EMU

Post by Jestin »

I know I'm late to this thread, but yes, you've discovered exactly the reason why we build out the new BASIC statements for audio. You can read through the rationale and development process here: viewtopic.php?t=4985
Post Reply