Re: IOP.SWDF - what does A1 point at please?
Posted: Sat Jul 16, 2022 6:47 pm
Thanks Marcel.
Right then, after a bit of experimentation, I've come to the conclusion that it's pretty impossible to use IOP.SWDF for anything useful This, coincidentally is what Gerge Gwilt wrote about it on my QDOSMSQ web site!
If I open a console and OUTLN it then call SWDF with A1 pointing a zero long word, followed by 8 words and a long to define the main subwindow sizes and attributes, then as long as the main window sizes match the OUTLN size, then the sprite will be used, but none of the attributes will be used, no paper or border, only the sprite. Like this:
If I change the code to have an actual list of subwindow definitions, with relative pointers, nothing works correctly. The main window shows the default arrosw sprite, and there's o sign of any of the subwindows. Noting uses any of the attributes Ive set. 
If I replace the relative pointers with absolute pointers, I get the correct main window pointer sprite back again, but nothing changes regarding attributes for the main or the sub window. Plus, the subwindow doesn't use the defined pointer sprite either.
I might have to admit defeat here which is a bit of a shame as I was hoping to be able to divide a main window into multiple subwindows, and use the returned pointer record, offset $04, from IOP.RPTR to determine the subwindow and act accordingly. I don't need the full WMAN stuff for this game, just the PE, but it's not looking hopeful.
All of this experimenting is on QPC 5.01, with high colour mode (32) selected, if this makes any difference?
Cheers,
Norm.
Right then, after a bit of experimentation, I've come to the conclusion that it's pretty impossible to use IOP.SWDF for anything useful This, coincidentally is what Gerge Gwilt wrote about it on my QDOSMSQ web site!
If I open a console and OUTLN it then call SWDF with A1 pointing a zero long word, followed by 8 words and a long to define the main subwindow sizes and attributes, then as long as the main window sizes match the OUTLN size, then the sprite will be used, but none of the attributes will be used, no paper or border, only the sprite. Like this:
Code: Select all
lea swdfPntr,a1
moveq #-1,d3
moveq #iop.swdf,d0
; A0 is the channel id
trap #3
...
swdfPntr
dc.l 0
dc.w x,y,xorg,yorg
dc.w spare,bordw,bordc,paprc
dc.l $0A ; Use SLEEP pointer sprite.

Code: Select all
lea swdfPntr,a1
moveq #-1,d3
moveq #iop.swdf,d0
; A0 is the channel id
trap #3
...
swdfPntr
dc.l swdfList-*
dc.w x,y,xorg,yorg
dc.w spare,bordw,bordc,paprc
dc.l 0 ; Use default arrow pointer sprite.
swdfList
dc.l swdf_1-*
dc.l 0
swdf_1
; These are different from the main window!
dc.w x,y,xorg,yorg
dc.w spare,bordw,bordc,paprc
dc.l 0 ; Use default arrow pointer sprite.
If I replace the relative pointers with absolute pointers, I get the correct main window pointer sprite back again, but nothing changes regarding attributes for the main or the sub window. Plus, the subwindow doesn't use the defined pointer sprite either.
Code: Select all
lea swdfPntr,a1
move.l a1,a5
lea swdfList,a4
move.l a4,(a1)
lea swdf_1,a1
move.l a1,(a4)
move.l a5,a1
moveq #-1,d3
moveq #iop.swdf,d0
; A0 is the channel id
trap #3
...
swdfPntr
dc.l 0
dc.w x,y,xorg,yorg
dc.w spare,bordw,bordc,paprc
dc.l 0 ; Use default arrow pointer sprite.
swdfList
dc.l 0
dc.l 0
swdf_1
; These are different from the main window!
dc.w x,y,xorg,yorg
dc.w spare,bordw,bordc,paprc
dc.l 0 ; Use default arrow pointer sprite.

All of this experimenting is on QPC 5.01, with high colour mode (32) selected, if this makes any difference?
Cheers,
Norm.