Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!jarthur!nntp-server.caltech.edu!toddpw From: toddpw@nntp-server.caltech.edu (Todd P. Whitesel) Newsgroups: comp.sys.apple2 Subject: Re: help optimizing asm routine (and help with GetCaretTime) Message-ID: <1991May24.111453.27330@nntp-server.caltech.edu> Date: 24 May 91 11:14:53 GMT References: <3638@kluge.fiu.edu> Organization: California Institute of Technology, Pasadena Lines: 49 acmfiu@serss0.fiu.edu (ACMFIU) writes: >below are three assembly routines. two i need help in optimizing and the >third i need help to get it to work. And how... First, I suggest you install a heartbeat task and use it to tell your event loop code when to blink. Read up in the Miscellaneous Tools chapter (I assume you know where that is...), hearbeat tasks are quite useful and convenient for this sort of thing. >the next routine, 'scroll_rect', is used to scroll my off-screen grafport >one line (line = length specified by ~line_height [height of line]). can >anyone optimize this? the code is self-explanatory. Well, if you want to make your source a lot easier to manage, make a macro that represents one or more loop iterations and edit the macro. Then you can experiment with faster unrolled code with far less stress than hand editing 80 copies of the same fragment. >the last routine, 'copy_grafport', is used to copy the data in an off-screen >grafport to an on-screen grafport, namely my window. i also need this >optimized. > _HideCursor Ugh. There's a ShieldCursor vector for this. It's in a technote, left an excercise for the reader. >:6 ldy ]x >:4 lda []off_image],y > sta []image],y > dey > dey > bpl :4 Jeezus. LHG at its slowest uses a loop like this. You can use MVP/MVN a lot of the time (yes, you really can use them -- get sneaky), and most of the time (except under Orca) you can map the stack into the shadowed graphics page and romp pixels to the screen. Sure it sounds sick but that's tough noogies. Think about it for a while and then mail me. Don't listen to Tim Meekins, or your code won't work with AppleTalk (in fact he's lucky it works at all -- do you EVER check to see where the standard GrafPort is, Tim?). Todd Whitesel toddpw @ tybalt.caltech.edu