home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 86 / af086sub.adf / UROUHACK / UROUHACK.lzx / UrouHack / source / patchfunc.a < prev    next >
Text File  |  2002-08-13  |  3KB  |  149 lines

  1. ;=============================================================================
  2. ;                    Assembler section for UrouHack 1.4+
  3. ;
  4. ; Patches for the following Functions:
  5. ;
  6. ;       OpenScreen()
  7. ;       OpenScreenTagList()
  8. ;       OpenWindow()
  9. ;       OpenWindowTagList()
  10. ;       CloseScreen()
  11. ;=============================================================================
  12.  
  13.                 include intuition/screens.i
  14.                 include intuition/intuition_lib.i
  15.                 include graphics/graphics_lib.i
  16.                 include graphics/rastport.i
  17.  
  18.                 XDEF    _newAGRoutine
  19.                 XREF    _oldAGRoutine
  20.                 XDEF    _newNMPRoutine
  21.                 XREF    _oldNMPRoutine
  22.                 XDEF    _newOSRoutine
  23.                 XREF    _oldOSRoutine
  24.                 XDEF    _newCSRoutine
  25.                 XREF    _oldCSRoutine
  26.                 XDEF    _newOTLRoutine
  27.                 XREF    _oldOTLRoutine
  28.                 XDEF    _newOWRoutine
  29.                 XREF    _oldOWRoutine
  30.                 XDEF    _newOWTLRoutine
  31.                 XREF    _oldOWTLRoutine
  32.  
  33.                 XREF    _b_left
  34.                 XREF    _b_right
  35.                 XREF    _b_top
  36.                 XREF    _b_bottom
  37.                 XREF    _b_height
  38.                 XREF    _b_width
  39.                 XREF    _w_bottom
  40.                 XREF    _psysi
  41.                 XREF    _UtilityBase
  42.                 XREF    _IntuitionBase
  43.                 XREF    @allocNewPens
  44.                 XREF    @changeSize
  45.                 XREF    @freeNewPens
  46.                 XREF    @AddGListExtra
  47.                 XREF    @AddGadgetExtra
  48.  
  49. _newAGRoutine   movem.l d0-d7/a0-a6,-(sp)
  50.                 jsr     @AddGadgetExtra
  51.                 movem.l (sp)+,d0-d7/a0-a6
  52.  
  53.                 move.l  a2,-(sp)
  54.                 move.l  _oldAGRoutine,a2
  55.                 jsr     0(a2)
  56.                 move.l  (sp)+,a2
  57.                 rts
  58.  
  59. _newNMPRoutine  rts
  60.  
  61. _newCSRoutine   jsr     @freeNewPens
  62.  
  63.                 move.l  a2,-(sp)
  64.                 move.l  _oldCSRoutine,a2
  65.                 jsr     0(a2)
  66.                 move.l  (sp)+,a2
  67.                 rts
  68.  
  69. _newOSRoutine   move.l  _oldOSRoutine,d0
  70.                 bra.s   shared
  71.  
  72. _newOTLRoutine  move.l  _oldOTLRoutine,d0
  73.  
  74. shared          move.l  a2,-(sp)
  75.  
  76.                 move.l  d0,a2
  77.                 jsr     0(a2)
  78.                 move.l  d0,a2
  79.  
  80.                 jsr     @allocNewPens
  81.  
  82.                 tst.w   _psysi
  83.                 beq.s   nosysi
  84.  
  85.                 move.b  _b_bottom,d0
  86.                 move.b  d0,sc_WBorBottom(a2)
  87.  
  88.                 move.b  _b_right,d0
  89.                 move.b  d0,sc_WBorRight(a2)
  90.  
  91.                 move.b  _b_top,d0
  92.                 move.b  d0,sc_WBorTop(a2)
  93.  
  94.                 move.b  _b_left,d0
  95.                 move.b  d0,sc_WBorLeft(a2)
  96.  
  97. nosysi          move.l  a2,d0
  98.                 move.l  (sp)+,a2
  99.                 rts
  100.  
  101. _newOWRoutine   move.l  _oldOWRoutine,d0
  102.                 bra.s   shared1
  103.  
  104. _newOWTLRoutine movem.l d1-d7/a0-a7,-(sp)
  105.                 jsr     @changeSize         
  106.                 movem.l (sp)+,d1-d7/a0-a7
  107.                 move.l  _oldOWTLRoutine,d0
  108.                 
  109. shared1         move.l  a2,-(sp)
  110.  
  111.                 move.l  d0,a2
  112.                 jsr     0(a2)
  113.                 move.l  d0,a2
  114.  
  115.                 move.l  wd_Flags(a2),d1
  116.  
  117.                 moveq   #1,d0
  118.                 and.l   d1,d0
  119.                 beq.s   noAdjust
  120.  
  121.                 moveq   #$20,d0
  122.                 and.l   d1,d0
  123.                 beq.s   checkRight
  124.  
  125.                 tst.b   wd_BorderBottom(a2)
  126.                 beq.s   checkRight
  127.                 move.b  _b_height,wd_BorderBottom(a2)
  128.  
  129. checkRight      moveq   #$10,d0
  130.                 and.l   d1,d0
  131.                 beq.s   checkRefresh
  132.  
  133.                 tst.b   wd_BorderRight(a2)
  134.                 beq.s   checkRefresh
  135.                 move.b  _b_width,wd_BorderRight(a2)
  136.  
  137. checkRefresh    moveq   #$30,d0
  138.                 and.l   d1,d0
  139.                 beq.s   noAdjust
  140.  
  141.                 move.l  a2,a0
  142.                 jsr     _LVORefreshWindowFrame(a6)
  143.  
  144. noAdjust        move.l  a2,d0
  145.                 move.l  (sp)+,a2
  146.                 rts
  147.  
  148.                 end
  149.