(09-03-2022, 02:20 PM)TempodiBasic Wrote: Hi QB64 friends
...
I have found very interesting and reach of information the published work of Utah in VB6
moreover many links have talked about a unfoundable QMIDI.BAS written in Qbasic.
After different googled researches I got it...
Here it is and I post it in Codebox tool
Code: (Select All)...
'538 lines (511 sloc) 20.5 KB
...
DECLARE SUB GetIntVector (IntNum%, Segment%, Offset%)
'Loads and plays a file using SBSIM
...
Sub GetIntVector (IntNum%, Segment%, Offset%) Static
'If the code hasn't been loaded already, do it now.
If GetIntVCodeLoaded% = 0 Then
asm$ = asm$ + Chr$(&H55)
asm$ = asm$ + Chr$(&H89) + Chr$(&HE5)
asm$ = asm$ + Chr$(&H8B) + Chr$(&H5E) + Chr$(&HA)
asm$ = asm$ + Chr$(&H8A) + Chr$(&H7)
asm$ = asm$ + Chr$(&HB4) + Chr$(&H35)
asm$ = asm$ + Chr$(&HCD) + Chr$(&H21)
asm$ = asm$ + Chr$(&H8C) + Chr$(&HC1)
asm$ = asm$ + Chr$(&H89) + Chr$(&HDA)
asm$ = asm$ + Chr$(&H8B) + Chr$(&H5E) + Chr$(&H8)
asm$ = asm$ + Chr$(&H89) + Chr$(&HF)
asm$ = asm$ + Chr$(&H8B) + Chr$(&H5E) + Chr$(&H6)
asm$ = asm$ + Chr$(&H89) + Chr$(&H17)
asm$ = asm$ + Chr$(&H5D)
asm$ = asm$ + Chr$(&HCB)
asm$ = asm$ + Chr$(&H34) + Chr$(&H0)
asm$ = asm$ + Chr$(&H60)
asm$ = asm$ + Chr$(&H23) + Chr$(&H0)
GetIntVCodeLoaded% = 1
End If
'Execute the code
Def Seg = VarSeg(asm$)
Call Absolute(IntNum%, Segment%, Offset%, SAdd(asm$))
End Sub
...
you can got it from here or if you prefer from https://github.com/creationix/basic-game.../QMIDI.BAS
If you copy and paste the code into QB64 IDE you get this error tha I don't know how to solve to try to run the code.
Any suggestions?
Thanks for sharing that Tempodi!
I'm not sure yet what is causing the error, as I am not at my PC, however something I have been seeing that I am curious about is, what are those DECLARE FUNCTION and DECLARE SUB statements at the top, when the actual routine definitions are included in the code? What purpose does it serve including an additional DECLARE statement for them at the top? Is this some requirement of old QuickBasic that QB64 supports for backwards compatibility, but is optional in QB64, or does it serve some other purpose, like help optimize the compiler, or serve as a heads up to other programmers that these routines are included below?