home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 113 / EnigmaAmiga113CD.iso / software / sviluppo / quake_src / vid_turboupdppc.s < prev    next >
Text File  |  2000-06-17  |  2KB  |  107 lines

  1. # Copyright (C) 1996-1997 Id Software, Inc. 
  2. # This program is free software; you can redistribute it and/or 
  3. # modify it under the terms of the GNU General Public License 
  4. # as published by the Free Software Foundation; either version 2 
  5. # of the License, or (at your option) any later version. 
  6. # This program is distributed in the hope that it will be useful, 
  7. # but WITHOUT ANY WARRANTY; without even the implied warranty of 
  8. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.   
  9. # See the GNU General Public License for more details. 
  10. # You should have received a copy of the GNU General Public License 
  11. # along with this program; if not, write to the Free Software 
  12. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
  13.  
  14. ##
  15. ## vid_turboupdPPC.s
  16. ##
  17. ## turbo video buffer update for Quake-WarpOS
  18. ##
  19. ## Define WOS for PowerOpen ABI, otherwise SVR4-ABI is used.
  20. ##
  21.  
  22.     .text
  23.  
  24. .ifdef    WOS
  25.     .globl    _ChunkyCopyPPC
  26.     .align    4
  27. _ChunkyCopyPPC:
  28. .else
  29.     .globl    ChunkyCopyPPC
  30.     .align    4
  31. ChunkyCopyPPC:
  32. .endif
  33. # r3 = Mode_Screen
  34. # r4 = gfxaddr
  35. # r5 = vid_buffer
  36.     mr    r0,r5
  37.     lwz    r5,8(r3)    # ms.bpr
  38.     li    r6,0    
  39.     li    r7,0
  40.     lwz    r8,544(r3)    # ms.SCREENWIDTH
  41.     lwz    r9,548(r3)    # ms.SCREENHEIGHT
  42.     mr    r3,r0
  43.     nop            # 16 byte alignment for TurboUpdatePPC
  44.  
  45. .ifdef    WOS
  46.     .globl    _TurboUpdatePPC
  47. _TurboUpdatePPC:
  48. .else
  49.     .globl    TurboUpdatePPC
  50. TurboUpdatePPC:
  51. .endif
  52. # r3 = vid_buffer
  53. # r4 = gfxaddr
  54. # r5 = bytesperrow
  55. # r6 = x
  56. # r7 = y
  57. # r8 = width
  58. # r9 = height
  59.  
  60.     mullw    r0,r7,r5
  61.     add     r4,r4,r0
  62.     add     r4,r4,r6
  63.     subf    r5,r8,r5
  64.     srawi   r8,r8,5
  65.     mr      r10,r8
  66.     subi    r3,r3,8
  67.     subi    r4,r4,8
  68. .loop:
  69.     mr      r8,r10
  70.     mtctr   r8
  71. .loop2:
  72.     lfdu    f0,8(r3)
  73.     lfdu    f1,8(r3)
  74.     lfdu    f2,8(r3)
  75.     lfdu    f3,8(r3)
  76.     stfdu   f0,8(r4)
  77.     stfdu   f1,8(r4)
  78.     stfdu   f2,8(r4)
  79.     stfdu   f3,8(r4)
  80.     bdnz    .loop2
  81.     add     r4,r4,r5
  82.     subic.  r9,r9,1
  83.     bne     .loop
  84.     blr
  85.  
  86. .ifdef    WOS
  87.     .type    _TurboUpdatePPC,@function
  88.     .size    _TurboUpdatePPC,$-_TurboUpdatePPC
  89. .else
  90.     .type    TurboUpdatePPC,@function
  91.     .size    TurboUpdatePPC,$-TurboUpdatePPC
  92. .endif
  93.  
  94. .ifdef    WOS
  95.     .type    _ChunkyCopyPPC,@function
  96.     .size    _ChunkyCopyPPC,$-_ChunkyCopyPPC
  97. .else
  98.     .type    ChunkyCopyPPC,@function
  99.     .size    ChunkyCopyPPC,$-ChunkyCopyPPC
  100. .endif
  101.