robhagemans / pcbasic

PC-BASIC - A free, cross-platform emulator for the GW-BASIC family of interpreters
http://www.pc-basic.org
Other
393 stars 48 forks source link

Tandy SOUND 0,0,0 results in Syntax Error #167

Closed JDoucette closed 2 years ago

JDoucette commented 2 years ago

Bug report

Problem In Tandy mode, the following is legit:

SOUND 0,0,0

But it results in:

SOUND 0,0,0                                                                     
Syntax error                                                                    
Ok                                                                                               

Steps

  1. Run
    "pcbasic.exe" --preset=tandy --syntax=tandy --video=tandy --scaling=crisp --dimensions=1344,840
  2. type:
    SOUND 0,0,0

    This should shut off any existing playing sounds.

Program

SOUND 0,0,0

Crash log None.

Notes PC-BASIC version: 1.2.14 and 2.0.4 Operating system version: Windows 10

This has no effect, and is not required anyway:

PLAY "MB"
robhagemans commented 2 years ago

Hi, why do you say the statement is legit - does it work on a real Tandy? At least in DOSBox emulation in Tandy mode with Tandy GW-BASIC, this results in Syntax Error as well. tandy sound

JDoucette commented 2 years ago

Yes, you're right. I've confirmed the same with v3.2 and v2.0 of Tandy GW-BASIC on DOSBox. I didn't get a chance to test on the real Tandy. I saw in my old source code that I had SOUND 0,0,0, but I think now that this was mangled by loading & saving it from QBasic/QuickBasic... since I've never been able to get my old Tandy GW-BASIC programs running as-is even with DOSBox's Tandy settings. It seems to save SOUND statements as ][.

SOUND 0,0 works in DOSBox Tandy GW-BASIC as well as PC-BASIC.

JDoucette commented 2 years ago

Also, I was led to believe SOUND 0,0,0 would/should work after reading the documentation: http://robhagemans.github.io/pcbasic/doc/1.2/ But I guess it was never supposed to.

robhagemans commented 2 years ago

Could you let me know where in the documentation this is suggested so I can improve it if necessary?

It does say in the notes and potential errors for the SOUND statement:

JDoucette commented 2 years ago

Looks like your documentation does cover this. I was not reading the notes or errors. I was just reading the descriptions of the parameters. It looks like the combinations of parameter restrictions are not mentioned in the parameter descriptions, but in notes and errors section -- in fact, you list this twice, once in both location.

No worries; I'll read more next time. I believe I misunderstood seeing SOUND 0,0,0 as original Tandy GW-BASIC code in my code, when it was likely modified by QBasic at some point in the interim.