Path: news1.icaen!news.uiowa.edu!uunet!in3.uu.net!206.229.87.25!news.sprintlink.net!news-peer.sprintlink.net!visi.com!news From: nathan@visi.com (Nathan Mates) Newsgroups: comp.sys.apple2.programmer Subject: Re: Scrolling the SHR screen (on the GS) Date: 12 Dec 1996 07:15:44 GMT Organization: Vector Internet Services, Inc. Lines: 64 Message-ID: <58obf0$mos@darla.visi.com> References: <58o7uv$c3g@engr.orst.edu> NNTP-Posting-Host: thumper.visi.com In article <58o7uv$c3g@engr.orst.edu>, Evan Day wrote: >I'm in search of some fast assembly code to scroll the GS SHR screen >up or down a variable number of scanlines. I can just use a >ScrollRect() call on my accelerated machine with fair results, but >on stock 2.8MHz machines, the thing tears and looks ugly. [Tip: 70 columns, not 80+ make it much easier to quote] In general, DP blasting is the fastest you can do under normal circumstances. It's not immediately the most flexible (you may want to have a few similar versions depending on which of the 5 pages a given 16-scanline block starts in, etc). It can also be interrupt unfriendly, unless you reenable interrupts every 5 pages (I do this in Fish/Toast, and background MODs aren't really affected). It does require bank 01 shadowing of the SHR screen. Here's some sample source for this kind of stuff. It's a straight slam-thru of one page, no up/down scrolling. php ; store this sei ; IMPORTANT! tsc sta EntryStack ;we mess with this tdc sta EntryDP shortm sta >$00C005 ;bank 1 stack & dp writing sta >$00c003 ;bank 1 stack & dp reading longm lda #$2000 ;top of screen tcd ;destination page clc adc #$FF ;pei starts at top of page tcs pei $FE pei $FC pei $FA * ... Fill in the pattern pei $02 pei $00 shortm ;and put the system back in a sane state sta >$00c004 ;bank 0 writing sta >$00c002 ;bank 0 reading longm lda EntryStack tcs lda EntryDP tcd ;restore initial values *before* plp ;we turn interrupts back on One of the GS tech notes (#70) recommends a NOP after every 13 peis as speeding things up. [Or so the hardware geeks with logic probes at Apple say; I've never bothered benchmarking various versions] That whole technote is rather informative; it's available at ftp://ftp.apple.com/dts/aii/tn/iigs/tn-iigs-070 Nathan Mates -- <*> Nathan Mates http://www.visi.com/~nathan/ <*> # What are the facts? Again and again and again-- what are the _facts_? # Shun wishful thinking, avoid opinion, care not what the neighbors # think-- what are the facts, and to how many decimal places? -R.A. Heinlein