Re: [stella] Revolutionary Horizontal positioning 2

Subject: Re: [stella] Revolutionary Horizontal positioning 2
From: Thomas Jentzsch <tjentzsch@xxxxxx>
Date: Tue, 26 Nov 2002 14:29:18 +0100
Manuel Polik wrote:
>       AND #$0F	     ; Manuels "forget about EOR/ASL
>       TAY            ; nonsense" magic :-)
>       LDA hmovetab,Y ;
>       STA HMP1       ; Fine Position sprite 1

>hmovetab
>    .byte $80,$70,$60,$50,$40,$30,$20,$10,$00
>    .byte $F0,$E0,$D0,$C0,$B0,$A0,$90

Good work Manuel! Did you find this trick in other games too?

Sometimes it might be useful not to use the index registers 
(X/Y). Then we'll need that "EOR/ASL nonsense" again. :-)

       EOR #$0F		
       SBC #$06		; -7 (carry is clear)
       ASL
       ASL
       ASL
       ASL              
       STA HMP1         ; Fine Position sprite 1

That costs 4 extra cycles, but keeps the Y-register (so you 
might save the 6 cycles for storing/loading) and also saves 14 
bytes of ROM.

The only problem with that code is, that the carry might be set 
after the last ASL. So it will not work for Manuel, but might 
be useful elsewhere.

Have fun!	
Thomas


----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread