home *** CD-ROM | disk | FTP | other *** search
-
- Back in the 1993 Special issue, I mentioned a small problem with
- DragASprite v 0.03, & Acorn still have yet to release a sofloaded
- replacement, for RISC OS 3.1 machines, which fixes this bug.
-
- Recall, there is a single faulty instruction in the module which
- can screw up initial sprite alignment within its drag box. For top
- alignment, the original code uses sprite width in a calculation that
- should use height.
-
- The resulting error in initial sprite position may only be cosmetic,
- but it can be very noticeable when it does occur.
-
- I recently wanted to distribute an application which required this bug
- be fixed, & although, as described in the December '93 TechForum, I
- had patched a single copy of DragASprite, due to copyright
- restrictions I couldn't distribute this.
-
- The original BASIC routine which I wrote to patch the module could
- itself have been distributed, as it was with TechForum, however to
- non-programming users it was rather cumbersome, so instead I've
- written a short ARM code utility which has the similar effect of
- patching the module, but does so only temporarily - upto the next hard
- reset - each time it is run.
-
- Unlike the former routine which saved the patched module to disc for
- manual loading & relied on the user only using it if she did indeed
- have the bugged 0.03 version, this one can be executed from an
- application's !Run file to automatically patch & reinitialise the
- module, if appropriate, such that the end user need know nothing about
- what is going on.
-
- Most importantly, this code takes much more care to ensure that the
- version of DragASprite currently present is this bugged one, before it
- makes any modifications, so it should be safe to run on any machine.
-
- When run, if there is no version present or it is pre 0.03, no patch
- can occur. If it is 0.03 & it still contains the bug, it will be fixed
- if possible, whereas if the version is post 0.03, it shouldn't need
- fixing & will be left alone.
-
- The bugged version is identified by checking the module length, the
- specific instruction to be changed, & by performing an OS_CRC on the
- whole module.
-
- The utility is only 640 bytes long. I've included the source code for
- your perusal, in directory 's'.
-
- It's usually silent in operation, however if you add the argument
- 'verbose' to its command tail, you will get a report on the action
- taken, via Wimp_ReportError.
-
- Assuming you put DASpatch into your application directory, I suggest
- you call it from !Run using something like:
-
- SetEval App$DAS3 0
- RMEnsure DragASprite 0.04 SetEval App$DAS3 -1
- RMEnsure DragASprite 0.03 SetEval App$DAS3 0
- If App$DAS3 Then Run <App$Dir>.DASpatch
- UnSet App$DAS3
- | NB Use
- | If App$DAS3 Then Run <App$Dir>.DASpatch verbose
- | instead of the similar line above, to get a report on action taken
-