home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / programm / 15216 < prev    next >
Encoding:
Text File  |  1992-09-09  |  1.7 KB  |  51 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!mcsun!sunic!kth.se!musta.nada.kth.se!d88-jwa
  3. From: d88-jwa@musta.nada.kth.se (Jon W{tte)
  4. Subject: Re: Game Techniques (was: NON-QUICKDRAW GAMES)
  5. In-Reply-To: jholt@adobe.com's message of Tue, 8 Sep 1992 19:13:42 GMT
  6. Message-ID: <D88-JWA.92Sep9134048@musta.nada.kth.se>
  7. Originator: d88-jwa@musta.nada.kth.se
  8. Sender: usenet@kth.se (Usenet)
  9. Nntp-Posting-Host: musta.nada.kth.se
  10. Organization: Royal Institute of Technology, Stockholm, Sweden
  11. References: <1992Sep8.004821.11323@adobe.com> <Bu8oyn.LD6@acsu.buffalo.edu>
  12.     <1992Sep8.191342.15509@adobe.com>
  13. Date: Wed, 9 Sep 1992 12:40:48 GMT
  14. Lines: 35
  15.  
  16. In article <1992Sep8.191342.15509@adobe.com> jholt@adobe.com (joe holt) writes:
  17.  
  18. [ Lots deleted ]
  19.  
  20.      1. find the fastest instruction that moves the most bytes,
  21.      2. keep everything in registers, and 
  22.      3. unroll the loops.
  23.  
  24.    Oops. There is a #4.
  25.  
  26.  
  27.    #4. Only write to what you need to write to. This goes back to the
  28.  
  29. That's not only faster, it avoids crashes on some cards.
  30. You are supposed to NOT write anywhere the screen doesn't
  31. show your pixels.
  32.  
  33. However, your timings are off. If your mac has color, it's
  34. a 030 mac, where the instructions take much fewer cycles,
  35. and the relation is different. Not to mention the 68040,
  36. which uses one or two cycles for manu instructions ! You
  37. could special-case your code, so if it's on a 040 and the
  38. moves are cache line aligned, you do a MOVE16 to move four
  39. longs at a time.
  40.  
  41. Note, this is another important thing: alignment. Always
  42. make sure that reads/writes of size N is integer divisible
  43. by N (i.e. address modulo N equals 0)
  44.  
  45.  
  46.  
  47. -- 
  48. Jon W{tte, h+@nada.kth.se, Sweden, Phone +46-8-107069
  49.  
  50. Help eradicate FIDO-Net <-> Usenet gateways in our time!
  51.