floor1LARM.s 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. @ Tremolo library
  2. @-----------------------------------------------------------------------
  3. @ Copyright (C) 2002-2009, Xiph.org Foundation
  4. @ Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
  5. @ All rights reserved.
  6. @ Redistribution and use in source and binary forms, with or without
  7. @ modification, are permitted provided that the following conditions
  8. @ are met:
  9. @ * Redistributions of source code must retain the above copyright
  10. @ notice, this list of conditions and the following disclaimer.
  11. @ * Redistributions in binary form must reproduce the above
  12. @ copyright notice, this list of conditions and the following disclaimer
  13. @ in the documentation and/or other materials provided with the
  14. @ distribution.
  15. @ * Neither the names of the Xiph.org Foundation nor Pinknoise
  16. @ Productions Ltd nor the names of its contributors may be used to
  17. @ endorse or promote products derived from this software without
  18. @ specific prior written permission.
  19. @
  20. @ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21. @ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22. @ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23. @ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24. @ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25. @ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26. @ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27. @ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28. @ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29. @ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30. @ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. @ ----------------------------------------------------------------------
  32. .text
  33. .global render_lineARM
  34. render_lineARM:
  35. @ r0 = n
  36. @ r1 = d
  37. @ r2 = floor
  38. @ r3 = base
  39. @ <> = err
  40. @ <> = adx
  41. @ <> = ady
  42. MOV r12,r13
  43. STMFD r13!,{r4-r6,r11,r14}
  44. LDMFD r12,{r11,r12,r14} @ r11 = err
  45. @ r12 = adx
  46. @ r14 = ady
  47. rl_loop:
  48. LDR r4, [r1] @ r4 = *d
  49. LDR r5, [r2], r3,LSL #2 @ r5 = *floor r2 = floor+base
  50. SUBS r11,r11,r14 @ err -= ady
  51. MOV r4, r4, ASR #6
  52. MUL r5, r4, r5 @ r5 = MULT31_SHIFT15
  53. ADDLT r11,r11,r12 @ if (err < 0) err+=adx
  54. ADDLT r2, r2, #4 @ floor+=1
  55. SUBS r0, r0, #1
  56. STR r5, [r1], #4
  57. BGT rl_loop
  58. LDMFD r13!,{r4-r6,r11,PC}
  59. @ END