Path: utzoo!utgpu!watmath!clyde!att!pacbell!ames!amdcad!sun!pitstop!sundc!seismo!uunet!portal!cup.portal.com!chad From: chad@cup.portal.com (Chad The-Walrus Netzer) Newsgroups: comp.sys.amiga.tech Subject: Re: Unsupported Programming Practices Message-ID: <13389@cup.portal.com> Date: 11 Jan 89 01:59:49 GMT References: <8901060406.AA22607@postgres.Berkeley.EDU> <84277@sun.uucp> <43@sdcc10.ucsd.EDU> <5978@polya.Stanford.EDU> Organization: The Portal System (TM) Lines: 45 In a previous article,(Tomas Rokiki) sure plays a mean pinball... Oops, I mean, writes: )> Does OwnBlitter() actually call WaitBlit()? Or will it blow up if )> OwnBlitter is called without first calling WaitBlit()? )OwnBlitter() doesn't call WaitBlit(). Also, OwnBlitter(); WaitBlit(); )should be very marginally faster than WaitBlit(); OwnBlitter() since )in the previous step, the blitter can still run during the OwnBlitter() )call. This is the reason why you SHOULD use OwnBlitter() first. )As a matter of fact, WaitBlit(); OwnBlitter() isn't any good, since )someone might sneak in and start a blit after your WaitBlit() returns )and before you OwnBlitter() . . . you start mucking with the registers )then, and all hell breaks loose. This is the reason why you MUST use OwnBlitter() first! The order of the calls is always: 1) OwnBlitter(); 2) WaitBlit(); ...assuming you want to do your own mucking around with the blitter. Of course, in some instances you may want to call only WaitBlit() by itself, or only OwnBlitter() by itself, although the first case is probably rare, and the second case is even rarer. In general, when doing your own Blitter manipulations, you should do all your calculations for the Blitter registers, get control of the Blitter (via OwnBlitter(), then WaitBlit()), stuff the registers with you're values as quickly as possible, start the blit (by filling the size register last), and DisownBlitter() right away. If you need to read the BZERO flag in DMACONR, then do a WaitBlit() and copy the register value somewhere before the DisownBlitter() call. Doing all this will not only make the Blitter routine work correctly, it will also make it efficient. Remember, Be Kind to Your Blitter! BTW, Thanks for sending me the latest BlitLab, Tom. All us Blitter Hackers appreciate it! )(Please note that `loose' rhymes with noose and `lose' rhymes with )shoes. You seldom loose a game or cut lose. I've seen these two )words misused too much here and on BIX . . . No connection to the )above posting.) -tom And of course, these conventions are officially supported by Commodore. Any deviation from these conventions in user documentation will not be supported, and will probably break your users brain! Please do not use these Unsupported Grammer Conventions! No connection to the above poosting... errr, that should read posting. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Chad 'The_Walrus' Netzer -> AmigaManiac++ "I'm "first in" at the LIFO race of life..."