[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hires - to - Lores ... Yikes



On Fri, 23 Jul 2004 04:25:16 GMT, Bender MX <no@morespam.com> wrote:
> I was messing around with converting Lo-Res into Hires and for kicks,
> decided to try it the other way around ... What it will do is only
> scan from $2000 to $2400 (hires pg 1) and move it into $0400 - $0800
> (lores pg 1) memory locations
>
> Bload favorite Hires pic into page 1, bload this little utility, then
> back to (]) applesoft and type
>
> GR [return]
>
> followed by
>
> CALL 768 [return]

Repeatable version, "only" 8 octets longer. :)

$0300  ldx #$20
$0302  ldy #$04
$0304  stx $0310
$0307  sty $0313
$030a  ldx #$04
$030c  ldy #$00
$030e  lda $2000,y
$0311  sta $0400,y
$0314  iny
$0315  bne $030e
$0317  inc $0310
$031a  inc $0313
$031d  dex
$031e  bne $030c
$0320  rts

Hm.  We could unroll the outer loop, gain a tiny bit of speed, and
shorten it slightly too:

$0300  ldy #$00
$0302  lda $2000,y
$0305  sta $0400,y
$0308  lda $2100,y
$030b  sta $0500,y
$030e  lda $2200,y
$0311  sta $0600,y
$0314  lda $2300,y
$0317  sta $0700,y
$031a  iny
$031b  bne $0302
$031c  rts

Hey, that one's "only" 4 octets longer than your original routine.  Yay.
-- 
Matthew W. Miller <mwmiller@columbus.rr.com>      MPlayer does not suck.