WSPT
                                    ====

Write a sprite to screen. This is a simple wrapper for the QDOS/SMSQ
iop.wspt trap. Error checking is minimal, but the trap checks most of the
check-able things itself, so unless you are careless it is hard to crash.

I have only tested it on SMSQ/E under QPC2 but I dont know of any reason
why it should not work under QDOS/Minerva, provided you have the Pointer
Interface (ptr_gen) loaded. The Window Manager is not required.

The code comes in two different packages, one is in a single, self-contained
file, the other is packaged as part of my pick'n mix toolkit series. They
may be reassembled  with QUATA's QMAC assembler, as described elsewhere.
Some modification may be required for other flavours. The text here refers
to the self-contained version, and was written to accompany my Qmovie program.

I really hope you find the code easy to follow, as one reason for
blatantly shoving it in your face is to encourage more people to code in
assembler. MC68 assembler is a beautiful, logical, human-friendly
programming language compared to many (most?) other near-bare-metal
languages (viz i86 - yuck!). It is native QL - the language God wrote the
Univers in! Having said that, I do not claim great proficiency in
assembler or the inner workings of QDOS/SMSQ, merely a long acquaintance,
so gremlins could be hiding in the undergrowth. Beware!


Some programming notes:
-----------------------

To maintain some kind of order and sanity, it has become traditional to
keep SMSQ/E-style key files under the DEV device, specifically dev8_. DEV
is a pseudo- or virtual-device and can point to any real device. DEV is
native under SMSQ/E but can be found as an add-on extension for other
systems. The key files in question are part of the SMSQ/E sources
distribution, available for download from the Official SMSQ/E site.

There are two nomenclatures in the QL assembler world: The old QDOS style
and the new SMSQ/E style. Both are valid, but it would be a good idea,
IMHO, for new projects to use the new style for the sake of consistency;
and this, presumably, is where any new developments will first appear.

Here, for the sake of illustration and ease of use, I have commented out
the references to these files and inserted the relevant definitions as EQU
statements in the code. Once you have the key files (or the whole of the
SMSQ/E sources) correctly installed on your system, you could remove all
the equ lines and un-comment the INCLUDE lines.

The keywords, or mnemonics, could just as well be swapped out by their
corresponding numbers, but for clarity, consistency and ease of alteration
(in the unlikely event that the underlying numbers should change) it is
advisable to use them. After a while they become easy to remember. The files
they are in, can help to quickly identify what sort of code your are dealing
with when reading other people's code.

Writing S*BASIC keywords in assembler is one of the easiest ways to learn
about assembler and the OS, as anyone will fondly recall who followed the
popular and enlightening series of DYI toolkits by Simon Goodwin, back in
the 80's. These are now available as a download from Dilwyn's mega web
site - no need to type them in yourself! They are a mine of information
and a great learning aid for beginners in assembler or QDOS. The only
downside is that they use the old mnemonics. But it is a good idea to
acquaint oneself with both.

But this piece is not a detailed treatise on learning assembler or about
the OS, it is but an example in a similar vein to the DIY Toolkits, only
focusing on a topic that was unknown then. The idea is that the in-line
comments should help to give an idea of whats going on.


Merry coding!

pjw, December 10th 2016


Links
-----

www.dilwyn.me.uk        - QL Home page, your one-stop QL site
www.wlenerz.com/smsqe   - the official SMSQ/E site


Software status:
----------------

V0.03, pjw, June 5th 2019, reorganised files

Conditions and disclaimer as per Knoware.no