home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / utilities / utilsf / jfshared / Modules / TextCopy / WinMgr / Patch316 < prev    next >
Encoding:
Text File  |  1995-07-01  |  7.7 KB  |  155 lines

  1. In   Module
  2. Out  NModule
  3. Type Module
  4. Max  32k
  5.  
  6. ; NOTE : only read this if you have not got WM3.16 and the other patch
  7. ;        which I made up off the top of my head (of course) doesn't work
  8. ;
  9. ; BTW, look at this in Assembler mode and it looks really nice (well,
  10. ; my comments are in lovelly green and I think it's nice)
  11. ;
  12. ; To patch the window manager you'll first need to save a copy of it.
  13. ; For simplicities sake I'm going to describe this using !Zap as it is
  14. ; the best editor for hacking with, has TaskWindow and ExtEdit protocol
  15. ; and can grab tasks and modules from where they sit.
  16. ; The version I use is 1.20 and so if you have an earlier version some of
  17. ; these features may not be available.
  18. ;
  19. ; Go to the iconbar menu, and Create.Get module.WindowManager (this may be
  20. ; different if you've changed the menu structure). Now change to text mode
  21. ; (Shift-Ctrl-F1) and save the file in the same directory as this file, as
  22. ; WMO, and close the file. The reason for this is that when I saved the
  23. ; module out once or twice in Code mode it corrupted it, but it didn't happen
  24. ; in text mode - odd init ?
  25. ; In all future descriptions I use search to buffer (F7) but you may prefer
  26. ; the search to cursor (F4), if you do make sure you check all the options.
  27. ; Do not use Search-as-you-type, because it doesn't function quite right in
  28. ; Code mode. It works on the first search, but then always says failed.
  29. ;
  30. ; Now reload the file into Zap and search for ,`#&F000 and pick out any
  31. ; AND r14 followed by TEQ r14 and compare them to the code. There should
  32. ; only be one which is the same. The address of the TEQ should be placed
  33. ; after the first @ sign, and the address of the next location should be
  34. ; placed at the branch in checkforWI.
  35. ;
  36. ; Secondly, you should find the location of the routine Wimp_SetCaretPostion
  37. ; This is internal SWI call 18. If you move to the top of the code to where
  38. ; it says SWI handler code and press right arrow it should take you to the
  39. ; code to process the SWI calls. What we need to know is the internal address
  40. ; of the routine, so if you move down about a page or two (if the window is
  41. ; half size mode 31, then it's about 3 page-down's) then you should find a
  42. ; load of Branch instruction. Place the cursor on the first branch and count
  43. ; 18 instruction downwards starting at 0.
  44. ; That is say 0 then press down, then 1 and down, and continue until you say
  45. ; 18. That's the way I do it anyway; what you are doing is counting the
  46. ; presses of the down key anyway. Because this table includes a dummy branch
  47. ; as the first instruction, to catch illegal SWI's, you now need to move down
  48. ; one more instruction. This is the address of the Wimp_SetCaretPostion code.
  49. ; On WM3.16 the code is B &9090, so the code is therefore at &9090.
  50. ;
  51. ; On the non-existant-sort-of-dream-like-vanish-when-you-wake-up VAPOURWARE
  52. ; (hi Joe!) versions of the WindowManager this might be the address that we
  53. ; need. I say probably, and I've knocked together a version of this patch
  54. ; for a version which I've just dreamt up, picking the patch address off
  55. ; the top of my head. I shouldn't try the patch on any WindowManager around
  56. ; because it won't work because you haven't got the right version, because
  57. ; it doesn't exist. If it does work, then welcome to my dream world - you
  58. ; can sit over there next to the filing cabinets with the penguins in :-)
  59. ;
  60. ; However, if you haven't overdone the medication are living in the clean
  61. ; living and legal 'real world', then a little more work is involved. On
  62. ; WM3.16, the address we require is the final address which this indirects
  63. ; us to (oooh, good word incorrectly used I think). To discover your magic
  64. ; address press the right key and there it should be. At least it might.
  65. ; On WM3.16 the instruction is BL &9098, so we use the address &9098, on
  66. ; other versions this could be the first address which the jump is on, or
  67. ; a later one. What you are in anycase looking for is a branch to a location
  68. ; containing STMDB r13!,{r6,r7,r14} followed by LDR r6,[r12,#640] or
  69. ; suchlike.
  70. ; In my aforementioned dream I dreamt that the first branch address was the
  71. ; correct one, because I like to make life easier for myself.
  72. ;
  73. ; So, once you've found this address (on WM3.16 it is &9098) we perform a
  74. ; search for 9098 (omit the & as this is not required). Again a list of BL
  75. ; instructions will appear and you need to find the one which looks most like
  76. ; the code in changesetcaret. On WM3.16 it is &AB44, and I should expect that
  77. ; on other versions it will still be near end of the list.
  78. ; The address prior to this (ie &AB44 on WM3.16) should be places after the
  79. ; second @ sign.
  80. ;
  81. ; And finally you can run the code. And if you don't have JFPatch you can
  82. ; watch a wonderful error box appear saying No run action specified for this
  83. ; filetype, but still you can do it here so why not alter the BASIC code ?
  84. ; it just as simple. Change the path names in the program, then PROCsetpc,
  85. ; I think is the equivilent of @ and most of the rest of the code is the
  86. ; same.
  87. ;
  88. ; When you've done all that you'll need to install the patched WM into the
  89. ; machine prior to the desktop starting. The only way to do this is to
  90. ; create a !Boot application and install it from there. At it's most basic
  91. ; this could just be and Obey file called !Run with :
  92. ;   RMLoad <Obey$Dir>.WM
  93. ;   Desktop
  94. ; although it is likely that you would put other things in it as well.
  95. ; Remember that WM takes up a load of space and therefore unless you really
  96. ; /need/ this patch, like desperately, I would recommend that you forget it
  97. ; and click in the icons when you need to.
  98. ;
  99. ; Some people, like me, have dream-like existances where we imagine our
  100. ; machines have all kinds of mythical features like longfile names, command
  101. ; line editting, full use of solid drags, personalised alt-key combinations,
  102. ; screen grabbing or even slabbed filer icons. For those people, who dream ;
  103. ; wonderful dreams but still make life difficult be forcing themselves to
  104. ; have to load their new wonderful things and taking about a minute to do it,
  105. ; you probably already have the oft-dreamt of fonts-in-the-desktop myth, and
  106. ; so have eaten away at all your memory already and so 32 extra bytes of
  107. ; space taken by a non-existant module will be nothing to you.
  108. ;
  109. ; For all those people with RO3 machines and WM2.00 installed in them (hi
  110. ; there you sad people, what fun that is !) the same procedures apply, and
  111. ; the address of the Wimp_SetCaretPosition code is &68D8 and therefore you
  112. ; need the second patch at address &7EC8, and the first at &7C80 (return to
  113. ; &7c84). However, until I can work out how to do TextCopy without using
  114. ; FilterManager this information is quite useless !
  115. ;
  116. ; So, there you have it. 6k of code just to explain how to patch the window
  117. ; manager to stop it putting the caret at the start of writable icons.
  118. ; Surprisingly, the same problem occurs if you use some patches to allow
  119. ; fonts in the desktop without dreaming (ie some PD ones), and can probably
  120. ; be fixed in the same way.
  121. ;
  122. ; Well, have fun with it. I know I will!
  123.  
  124. @ &a854
  125. ; this replaces code :
  126. ; LDR r14,[r2],#32   - get data and increment
  127. ; AND r14,r14,#&F000 - leave just button
  128. ; TEQ r14,#&F000    <-- this line
  129. ; BNE &a840          - if not then try again
  130.    B       checkforWI
  131.  
  132. @ &ab40
  133. ; this replaces code :
  134. ; MOV r0,r3          - set window handle
  135. ; MOV r1,r4          - set icon handle
  136. ; MVN r2,#&f0000000  - set x offset
  137. ; MVN r5,#0         <-- this line
  138. ; BL  &a53c          - is Wimp_SetCaretPosition
  139.    BL      changesetcaret
  140.  
  141. @ endofcode
  142. .checkforWI
  143.    TEQ     r14,#&F000
  144.    TEQNE   r14,#&E000
  145.    B       &a858
  146.  
  147. ; changes parameters passed to Wimp_SetCaretPosition internally when
  148. ; menu opens
  149. .changesetcaret
  150.    MOV     r2,#1024*16*16 ; 16k (should be enough)
  151.    MOV     r3,#0     ; no y-offset
  152.    MVN     r4,#0     ; flags (-1)
  153.    MVN     r5,#0     ; no index
  154.    MOV     pc,link
  155.