home *** CD-ROM | disk | FTP | other *** search
- In Module
- Out NModule
- Type Module
- Max 32k
-
- ; NOTE : only read this if you have not got WM3.16 and the other patch
- ; which I made up off the top of my head (of course) doesn't work
- ;
- ; BTW, look at this in Assembler mode and it looks really nice (well,
- ; my comments are in lovelly green and I think it's nice)
- ;
- ; To patch the window manager you'll first need to save a copy of it.
- ; For simplicities sake I'm going to describe this using !Zap as it is
- ; the best editor for hacking with, has TaskWindow and ExtEdit protocol
- ; and can grab tasks and modules from where they sit.
- ; The version I use is 1.20 and so if you have an earlier version some of
- ; these features may not be available.
- ;
- ; Go to the iconbar menu, and Create.Get module.WindowManager (this may be
- ; different if you've changed the menu structure). Now change to text mode
- ; (Shift-Ctrl-F1) and save the file in the same directory as this file, as
- ; WMO, and close the file. The reason for this is that when I saved the
- ; module out once or twice in Code mode it corrupted it, but it didn't happen
- ; in text mode - odd init ?
- ; In all future descriptions I use search to buffer (F7) but you may prefer
- ; the search to cursor (F4), if you do make sure you check all the options.
- ; Do not use Search-as-you-type, because it doesn't function quite right in
- ; Code mode. It works on the first search, but then always says failed.
- ;
- ; Now reload the file into Zap and search for ,`#&F000 and pick out any
- ; AND r14 followed by TEQ r14 and compare them to the code. There should
- ; only be one which is the same. The address of the TEQ should be placed
- ; after the first @ sign, and the address of the next location should be
- ; placed at the branch in checkforWI.
- ;
- ; Secondly, you should find the location of the routine Wimp_SetCaretPostion
- ; This is internal SWI call 18. If you move to the top of the code to where
- ; it says SWI handler code and press right arrow it should take you to the
- ; code to process the SWI calls. What we need to know is the internal address
- ; of the routine, so if you move down about a page or two (if the window is
- ; half size mode 31, then it's about 3 page-down's) then you should find a
- ; load of Branch instruction. Place the cursor on the first branch and count
- ; 18 instruction downwards starting at 0.
- ; That is say 0 then press down, then 1 and down, and continue until you say
- ; 18. That's the way I do it anyway; what you are doing is counting the
- ; presses of the down key anyway. Because this table includes a dummy branch
- ; as the first instruction, to catch illegal SWI's, you now need to move down
- ; one more instruction. This is the address of the Wimp_SetCaretPostion code.
- ; On WM3.16 the code is B &9090, so the code is therefore at &9090.
- ;
- ; On the non-existant-sort-of-dream-like-vanish-when-you-wake-up VAPOURWARE
- ; (hi Joe!) versions of the WindowManager this might be the address that we
- ; need. I say probably, and I've knocked together a version of this patch
- ; for a version which I've just dreamt up, picking the patch address off
- ; the top of my head. I shouldn't try the patch on any WindowManager around
- ; because it won't work because you haven't got the right version, because
- ; it doesn't exist. If it does work, then welcome to my dream world - you
- ; can sit over there next to the filing cabinets with the penguins in :-)
- ;
- ; However, if you haven't overdone the medication are living in the clean
- ; living and legal 'real world', then a little more work is involved. On
- ; WM3.16, the address we require is the final address which this indirects
- ; us to (oooh, good word incorrectly used I think). To discover your magic
- ; address press the right key and there it should be. At least it might.
- ; On WM3.16 the instruction is BL &9098, so we use the address &9098, on
- ; other versions this could be the first address which the jump is on, or
- ; a later one. What you are in anycase looking for is a branch to a location
- ; containing STMDB r13!,{r6,r7,r14} followed by LDR r6,[r12,#640] or
- ; suchlike.
- ; In my aforementioned dream I dreamt that the first branch address was the
- ; correct one, because I like to make life easier for myself.
- ;
- ; So, once you've found this address (on WM3.16 it is &9098) we perform a
- ; search for 9098 (omit the & as this is not required). Again a list of BL
- ; instructions will appear and you need to find the one which looks most like
- ; the code in changesetcaret. On WM3.16 it is &AB44, and I should expect that
- ; on other versions it will still be near end of the list.
- ; The address prior to this (ie &AB44 on WM3.16) should be places after the
- ; second @ sign.
- ;
- ; And finally you can run the code. And if you don't have JFPatch you can
- ; watch a wonderful error box appear saying No run action specified for this
- ; filetype, but still you can do it here so why not alter the BASIC code ?
- ; it just as simple. Change the path names in the program, then PROCsetpc,
- ; I think is the equivilent of @ and most of the rest of the code is the
- ; same.
- ;
- ; When you've done all that you'll need to install the patched WM into the
- ; machine prior to the desktop starting. The only way to do this is to
- ; create a !Boot application and install it from there. At it's most basic
- ; this could just be and Obey file called !Run with :
- ; RMLoad <Obey$Dir>.WM
- ; Desktop
- ; although it is likely that you would put other things in it as well.
- ; Remember that WM takes up a load of space and therefore unless you really
- ; /need/ this patch, like desperately, I would recommend that you forget it
- ; and click in the icons when you need to.
- ;
- ; Some people, like me, have dream-like existances where we imagine our
- ; machines have all kinds of mythical features like longfile names, command
- ; line editting, full use of solid drags, personalised alt-key combinations,
- ; screen grabbing or even slabbed filer icons. For those people, who dream ;
- ; wonderful dreams but still make life difficult be forcing themselves to
- ; have to load their new wonderful things and taking about a minute to do it,
- ; you probably already have the oft-dreamt of fonts-in-the-desktop myth, and
- ; so have eaten away at all your memory already and so 32 extra bytes of
- ; space taken by a non-existant module will be nothing to you.
- ;
- ; For all those people with RO3 machines and WM2.00 installed in them (hi
- ; there you sad people, what fun that is !) the same procedures apply, and
- ; the address of the Wimp_SetCaretPosition code is &68D8 and therefore you
- ; need the second patch at address &7EC8, and the first at &7C80 (return to
- ; &7c84). However, until I can work out how to do TextCopy without using
- ; FilterManager this information is quite useless !
- ;
- ; So, there you have it. 6k of code just to explain how to patch the window
- ; manager to stop it putting the caret at the start of writable icons.
- ; Surprisingly, the same problem occurs if you use some patches to allow
- ; fonts in the desktop without dreaming (ie some PD ones), and can probably
- ; be fixed in the same way.
- ;
- ; Well, have fun with it. I know I will!
-
- @ &a854
- ; this replaces code :
- ; LDR r14,[r2],#32 - get data and increment
- ; AND r14,r14,#&F000 - leave just button
- ; TEQ r14,#&F000 <-- this line
- ; BNE &a840 - if not then try again
- B checkforWI
-
- @ &ab40
- ; this replaces code :
- ; MOV r0,r3 - set window handle
- ; MOV r1,r4 - set icon handle
- ; MVN r2,#&f0000000 - set x offset
- ; MVN r5,#0 <-- this line
- ; BL &a53c - is Wimp_SetCaretPosition
- BL changesetcaret
-
- @ endofcode
- .checkforWI
- TEQ r14,#&F000
- TEQNE r14,#&E000
- B &a858
-
- ; changes parameters passed to Wimp_SetCaretPosition internally when
- ; menu opens
- .changesetcaret
- MOV r2,#1024*16*16 ; 16k (should be enough)
- MOV r3,#0 ; no y-offset
- MVN r4,#0 ; flags (-1)
- MVN r5,#0 ; no index
- MOV pc,link
-