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