Path: news1.icaen!news.uiowa.edu!news.physics.uiowa.edu!nntp.ksu.edu!news.cis.okstate.edu!news.ecn.uoknor.edu!feed1.news.erols.com!news From: Eric Jacobs Newsgroups: comp.sys.apple2.programmer Subject: Re: mvn Date: Mon, 21 Apr 1997 15:09:32 -0500 Organization: Erol's Internet Services Lines: 72 Message-ID: <335BC97C.27E5@no.no> References: <5j4g0e$10q$1@enyo.uwa.edu.au> <5jeoh5$gh5$1@enyo.uwa.edu.au> NNTP-Posting-Host: dam-as15s22.erols.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Received-On: 21 Apr 1997 15:54:15 GMT X-Mailer: Mozilla 2.02 (Macintosh; I; 68K) Joseph Turner wrote: > > ok, That method of using the shadowing plus 'touching' the graphics buffer > in Bank 1 sounds interesting. I rewrote my routines so that shadowing > wason and I used lda $2000,X then sta $2000,X then just went throug all > the buffer this way. > > It was suggested that tsb (Test Set Bit) be used. This would be really > cool since it has very minimal number of cycles. However there is no > indirect syntax of this code. Now one could write some code that changes > itself, which may require something like this... > > lda #0 > sta $017cff ;Alter the last two bytes so that tsb has Carry = > ; 1 at the end of the graphics screen > > lda #0 > repeat inc ch+1 > inc ch+1 > ch tsb $2000 > beq repeat > > But this code seems fairly silly, since the the two increment statements > take up 7 cycles, and so we are looking at a situation that isn't as > effeicent, or less efficient then the case I outilned above. > > Any ideas? > > Cheers > > Joe What I meant was a partially unrolled TSB loop, something like: lda #$30 tsb $C068 ; <- map to bank $01 lda #$2000 tcd loop lda #0 tsb $00 tsb $02 tsb $04 tsb $06 : tsb $FE tdc clc adc #$100 tcd bpl loop lda #$30 trb $C068 ; <- restore normal mapping This would do it $100 bytes at a time. Of course, you could use any increment you wanted, based on the speed you need and how much space you have. The state register ($C068) uses an old trick leftover from the IIe to change all accesses to bank $00 to bank $01. You can then use the direct page register to bulk transfer up to $100 bytes at a time. (Really fast.) You can also set up the stack pointer to the screen and do PEI and PLA/STA's to accomplish quick scrolling. But if you're just copying the screen, TSB's will do the trick very nicely. The interrupt manager by default does not deal with nonstandard memory mapping. So if you have interrupts, it is best to disable them during the loop (insert periodic CLI/SEI pairs if you have a long loop to service any pending interrupts.) -ej