🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.acorn.tech
Article #43

Re: DragAsprite

#43
From: Michael Hardy
Date: Tue, 03 Nov 1992 09:56
49 lines
2453 bytes
In article <1992Nov3.024724.26462@usage.csd.unsw.OZ.AU> 2105995@hydra.maths.unsw.EDU.AU writes:

>>shunger@waikato.ac.nz wrote:
>>: what was the *fx call or sys call to drag sprites around the desktop???.
>>: 
>>
>>Me too could someone post it???
>>
>>Alfred Tascon at ernie@tartarus.uwa.edu.au
>>
>*fx 162,28,3

Well, I've posted before explaining that this is not a good way to do it,
since you are also altering the state of seven other bits which control
other aspects of FileSwitch and the Wimp. A better way is to read the byte,
set bit 1, and then write it back. This is the program that I use:

   REM Toggle state of DragASprite bit in CMOS

   REM Read byte
   SYS "OS_Byte",161,&1C TO ,,byte%
   REM EOR byte with mask for bit 1
   byte% = byte% EOR 1<<1
   REM Write byte back again
   SYS "OS_Byte",162,&1C,byte%
   END

You *must* use the OS_Byte calls, otherwise the checksum byte will become
incorrect. This byte is calculated on a power-on reset, and then maintained
by the OS_Byte calls (in other words, they don't recalculate it, but merely
update it in a manner that is appropriate to the changes made).

The other thing to note is that you *must* do a power-on reset when
upgrading from either RISC OS 2 or RISC OS 3 (version 3.00) to RISC OS 3
(version 3.10), not just to initialise the checksum, but more importantly 
because the CMOS usage differs between the versions.

Hope this helps. I'd say this is one for the FAQ list too, otherwise there
will be loads of people blowing away the seven other bits of that
configuration byte with the incorrect (but commonly recommended) method...

- Michael J Hardy

  Technical Publications    Email:      mhardy@acorn.co.uk
  Acorn Computers Ltd       Telephone:  +44 223 254352
  Cambridge TechnoPark      Fax:        +44 223 254270
  645 Newmarket Road        Telex:      817875 ACORN G
  Cambridge CB5 8PB
  England                   Disclaimer: All opinions are my own, not Acorn's
Technical Details
Message-ID: <19957@acorn.co.uk>
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!emory!sol.ctr.columbia.edu!usc!elroy.jpl.nasa.gov!ames!agate!doc.ic.ac.uk!uknet!acorn!mhardy
References: <1992Nov3.024724.26462@usage.csd.unsw.OZ.AU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!emory!sol.ctr.columbia.edu!usc!elroy.jpl.nasa.gov!ames!agate!doc.ic.ac.uk!uknet!acorn!mhardy
From: mhardy@acorn.co.uk (Michael Hardy)
Newsgroups: comp.sys.acorn.tech
Subject: Re: DragAsprite
Message-ID: <19957@acorn.co.uk>
Date: 3 Nov 92 09:56:25 GMT
References: <1992Nov3.024724.26462@usage.csd.unsw.OZ.AU>
Sender: mhardy@acorn.co.uk
Organization: Acorn Computers Ltd, Cambridge, England
Lines: 49