You are right, it is not QB compatible (since it internally uses a lot of OOP features). I haven't tested it, but I think you can make an include file to call only the PLAY command (its syntax is simple, and it should be compatible with QB mode). For the SOUND command, instead, the header cannot be ported to QB mode since it uses OOP features (although a wrapper could be made, especially if you only want to emulate the original SOUND command)
Instead of including all the sfx.bi (that provides support for ALL features, you might only put the DECLAREs for what you actually need:
Code: Select all
declare sub SoundMidiSet
declare sub play overload (Midi as MidiSequence ptr, playstr as string, playstr1 as string="", playstr2 as string="", playstr3 as string="", _
playstr4 as string="", playstr5 as string="", playstr6 as string="", playstr7 as string="", _
playstr8 as string="", playstr9 as string="", playstr10 as string="", playstr11 as string="", _
playstr12 as string="", playstr13 as string="", playstr14 as string="", playstr15 as string="")
declare sub play overload (playstr as string, playstr1 as string="", playstr2 as string="", playstr3 as string="", _
playstr4 as string="", playstr5 as string="", playstr6 as string="", playstr7 as string="", _
playstr8 as string="", playstr9 as string="", playstr10 as string="", playstr11 as string="", _
playstr12 as string="", playstr13 as string="", playstr14 as string="", playstr15 as string="")
(not sure how to deal with "overload", I don't know if it's supported in QB mode)
Oh, another thing: the "x" command is not supported, because it is completely useless. Instead of
just use
Actually, the "x" command for DRAW and PLAY was useless in the original QBASIC, as well, since the second syntax was perfectly valid in QBASIC as well. The reason many users used it was that the guide was not clear about it, and by reading it, it seemed that the only way to use a variable with DRAW or PLAY was to use the "x" command. That was not true. The real purpose of the X command was to specify the name of a variable inside the string itself, like this:
It worked in an interpreter like GWBASIC, but not in a compiled language, since the symbol A$ was ditched during compiling, so to allow compilation it has been modified to accept the pointer converted to a string, instead of the name. A lame solution, that has almost no practical usage.