Page 2 of 2
Re: Arrakis Software
Posted: Fri Jan 16, 2015 11:41 pm
by Mr_Navigator
Derek_Stewart wrote:Hi Dave,
It is not dedication, just an interest.
I was trying to get the QL World Microdrive Exchange Software Library availble, but this this seems to be not possible due to the non-availblity of the software.
So, the only other solution would be to start re-reading the magazines and type the featured programmes.
Any luck with the typing in Derek?
Re: Arrakis Software
Posted: Sat Jan 17, 2015 9:24 am
by Derek_Stewart
Hi,
I have typed the programme in last year, no real problem. Except for a error in the listing. CV&G acknowledge the error and were going to print a correction, but I have read all issues of CV&G available and can not find the correction.
I will have another look.
Re: Arrakis Software
Posted: Mon Nov 23, 2015 8:34 pm
by tcat
Line 2100 does not make much sense, I have all of the magazines, so will see if there is an errata. Otherwise, I will have to work out the logic of the statement
Hi,
I believe the line 2100 may read
Code: Select all
PRINT#tab," "(1 TO (mov_num<10));mov_num;".";TO 4;"ABCD"(side+1);"12345678"(((gunpos && 7) ^^ ((gunpos && 16)/16*7))+1);" : ";
The bit " && 7) " is missing before ^^ operation, I should think.
Tom
Re: Arrakis Software
Posted: Tue Nov 24, 2015 8:54 am
by Derek_Stewart
Hi,
I will make the changes and see if it works and report back.
Re: Arrakis Software
Posted: Mon Nov 30, 2015 7:55 pm
by tcat
Hi,
I have typed the assembly as printed in the mag, unfortunately it does not seem to work for me. It makes use of $A command to IPC processor to play music. It contructs the parameter block
Code: Select all
; align
messsound nop
dc.b $0a,8 ; Command byte, no. of parameters
dc.l $0000aaaa ; Instructs trap to send information
; to IPC in bytes (see text)
dc.b 0,0 ; Pitch 1, pitch 2 set to 0
dc.b 0,0,255,255 ; Grad_x (0,0), Duration (65535)
dc.b 0,0 ; No Grad_x, wrap, fuzziness or Rnd
dc.b 1 ; No return parameters
As GST assembler does not have the ALIGN directive, I use NOP right after the label, as GST puts each label reference to be on even address, provided it is followed by an instruction. Is there a better way?
Parameter block address is then passed in A3, with D0 set to 17, and trap #1 instructs IPC to make sound.
Code: Select all
lea messsound,a3 ; Loads the pointer to messsound
moveq #17,d0 ; Make sound
trap #1
Only Pitch1 is set, and IPC called and paused in a loop.
Cannot make the program work so far.
Tom
Re: Arrakis Software
Posted: Mon Nov 30, 2015 8:15 pm
by RWAP
The nop command has added an extra byte to the IPC command block unfortunately - not sure how to align this automatically in GST compiler....
If GST puts each label reference onto an even keel - why not add a new label above messsound;
Re: Arrakis Software
Posted: Tue Dec 01, 2015 7:28 am
by tofro
tcat wrote:
Hi,
I have typed the assembly as printed in the mag, unfortunately it does not seem to work for me. It makes use of $A command to IPC processor to play music. It contructs the parameter block
As GST assembler does not have the ALIGN directive, I use NOP right after the label, as GST puts each label reference to be on even address, provided it is followed by an instruction. Is there a better way?
The correct translation of the above piece of code into GST lingo would be:
Code: Select all
ds.w 0
messsound
dc.b $0a,8 ; Command byte, no. of parameters
dc.l $0000aaaa ; Instructs trap to send information
; to IPC in bytes (see text)
dc.b 0,0 ; Pitch 1, pitch 2 set to 0
dc.b 0,0,255,255 ; Grad_x (0,0), Duration (65535)
dc.b 0,0 ; No Grad_x, wrap, fuzziness or Rnd
dc.b 1 ; No return parameters
(note the "ds.w 0"!)
If you ask the GST assembler to place zero words, it will align first and then place zero words

Long-word alignment works the same. And, obviously, the alignment command needs to be
before the label, otherwise the label will point to the padding byte as Rich has pointed out.
"align 2" translates into "ds.w 0"
"align 4" translates into "ds.l 0"
Regards,
Tobias
Re: Arrakis Software
Posted: Wed Dec 02, 2015 8:19 pm
by tcat
Tobias, Rich,
Thank you for padding suggestions, it now works, I use 100 as a delay in below line, as otherwise it playes really fast
moveq #100,d2 ; Play it very fast
I am getting binary and when loaded into reserved memory and then called from S*BASIC it works as expected and plays Bach's Prelude.
What I don't quite understand is, why the binary does NOT play sound when EXECuted. The job started does not even finish on it's own and needs to be removed. GST manual says, that the binary output can be run by EXEC or EXEC_W commands.
Tom
Re: Arrakis Software
Posted: Wed Dec 02, 2015 9:30 pm
by tofro
Tom,
in order to build an executable job, your code needs to look slightly different.
The first few lines should look like
Code: Select all
mt.frjob equ 5
start:
bra job_start
dc.w 0 ; Every job should have a proper header
dc.w $4afb
dc.w 7
dc.b 'Prelude'
job_start
lea prelude,a0
moveq #40,d2
bsr.s hi_fi
job_end:
move.l #mt.frjob.d0 ; instead of an rts, we need to do an MT.FRJOB trap to end the program
move.l #-1,d1
clr.l d3
trap #1
;
;
;
Details on that can be found in the "QL Technical Guide" page 17+. A job may not just end with rts, it needs to be terminated properly from QDOS. That's what the MT.FRJOB does. And it should have a header.
Regards,
Tobias
Re: Arrakis Software
Posted: Sat Dec 05, 2015 5:18 pm
by tcat
Tobias,
Thank you for explaining, I have also read pages 17+ from The Technical Guide, now with better understanding. I somehow realised, I also need to put an extra padding right at the assembly end.
To ensure the binary has even byte size, is all in words so to speak. Otherwise job gets loaded, but has problems executing. Cannot explain it, but seems to work with GST Assembler.
I can now call sound not only from SuperBASIC, but I can also run it as a job.
I may file a seperate topic on JOBS, as I have questions to ask.
Many thanks so far
Tom