home *** CD-ROM | disk | FTP | other *** search
/ The AGA Experience 2 / agavol2.iso / software / utilities / wb_tools / urouhack / source / patchfunc.asm next >
Assembly Source File  |  1996-02-18  |  2KB  |  111 lines

  1.  
  2. ; OpenScreen(TagList) and OpenWindow(TagList) patches for Urouhack 0.5+
  3.  
  4.         incdir  GNU:os-include/
  5.         include intuition/screens.i
  6.         include intuition/intuition_lib.i
  7.         include graphics/graphics_lib.i
  8.         include graphics/rastport.i
  9.  
  10.         XDEF    _newOSRoutine
  11.         XREF    _oldOSRoutine
  12.         XDEF    _newOTLRoutine
  13.         XREF    _oldOTLRoutine
  14.         XDEF    _newOWRoutine
  15.         XREF    _oldOWRoutine
  16.         XDEF    _newOWTLRoutine
  17.         XREF    _oldOWTLRoutine
  18.  
  19.         XREF    _b_left
  20.         XREF    _b_right
  21.         XREF    _b_top
  22.         XREF    _b_bottom
  23.         XREF    _b_height
  24.         XREF    _b_width
  25.         XREF    _w_bottom
  26.         XREF    _psysi
  27.         XREF    @allocNewPens
  28.         XREF    @changeSize
  29.  
  30. _newOSRoutine   move.l  _oldOSRoutine,d0
  31.         bra.s   shared
  32.  
  33. _newOTLRoutine  move.l  _oldOTLRoutine,d0
  34.  
  35. shared          move.l  a2,-(sp)
  36.  
  37.         move.l  d0,a2
  38.         jsr     0(a2)
  39.         move.l  d0,a2
  40.  
  41.         move.l  d0,-(sp)
  42.         jsr     @allocNewPens
  43.         addq.w  #4,sp
  44.  
  45.         tst.w   _psysi
  46.         beq.s   nosysi
  47.  
  48.         move.b  _b_bottom,d0
  49.         move.b  d0,sc_WBorBottom(a2)
  50.  
  51.         move.b  _b_right,d0
  52.         move.b  d0,sc_WBorRight(a2)
  53.  
  54.         move.b  _b_top,d0
  55.         move.b  d0,sc_WBorTop(a2)
  56.  
  57.         move.b  _b_left,d0
  58.         move.b  d0,sc_WBorLeft(a2)
  59.  
  60. nosysi          move.l  a2,d0
  61.         move.l  (sp)+,a2
  62.         rts
  63.  
  64. _newOWRoutine   move.l  _oldOWRoutine,d0
  65.         bra.s   shared1
  66.  
  67. _newOWTLRoutine movem.l d0-d7/a0-a7,-(sp)
  68.         jsr     @changeSize
  69.         movem.l (sp)+,d0-d7/a0-a7
  70.         move.l  _oldOWTLRoutine,d0
  71. shared1         move.l  a2,-(sp)
  72.  
  73.         move.l  d0,a2
  74.         jsr     0(a2)
  75.         move.l  d0,a2
  76.  
  77.         move.l  wd_Flags(a2),d1
  78.  
  79.         moveq   #1,d0
  80.         and.l   d1,d0
  81.         beq.s   noAdjust
  82.  
  83.         moveq   #$20,d0
  84.         and.l   d1,d0
  85.         beq.s   checkRight
  86.  
  87.         tst.b   wd_BorderBottom(a2)
  88.         beq.s   checkRight
  89.         move.b  _b_height,wd_BorderBottom(a2)
  90.  
  91. checkRight      moveq   #$10,d0
  92.         and.l   d1,d0
  93.         beq.s   checkRefresh
  94.  
  95.         tst.b   wd_BorderRight(a2)
  96.         beq.s   checkRefresh
  97.         move.b  _b_width,wd_BorderRight(a2)
  98.  
  99. checkRefresh    moveq   #$30,d0
  100.         and.l   d1,d0
  101.         beq.s   noAdjust
  102.  
  103.         move.l  a2,a0
  104.         jsr     _LVORefreshWindowFrame(a6)
  105.  
  106. noAdjust        move.l  a2,d0
  107.         move.l  (sp)+,a2
  108.         rts
  109.  
  110.         end
  111.