[stella] Supercharger RPG bare beginnings - request for help
bob.montgomery at thomson.com
bob.montgomery at thomson.com
Fri Sep 15 10:16:33 CDT 2006
Hi,
>Actually Andrew's code is doing something very clever and maybe this
would >work for your code too:
>When scrolling, he compares the new tile with the old one and then
skips
>updating the buffer if the tiles are identical.
That's a good idea.
>One question: How (or where) you do merge the data of the two tiles
>which belong to the same PF register?
They are pre-merged, if that makes sense. All the necessary
combinations are stored in ROM (well, SC RAM, but I don't modify them).
>I suppose you are only switching pointers inside the kernel, right?
I'm not sure what you mean.
>I saw this code:
> lda (PtrTemp),Y ;<--have both tiles
> sta Temp+1
> and #$F0 ;left tile * 16...
> sta Temp
> lda Temp+1 ;...plus right tile
> and #$0F
>...
>
>which can be optimized into:
> lda (PtrTemp),Y ;<--have both tiles
> and #$F0 ;left tile * 16...
I don't follow this. I have two lookup "addresses," each of which is 4
bits. I need the left one, times sixteen, added to twice the right one.
My comments aren't completely clear there, here's a bigger snippet for
folks who don't want to wade through the whole source:
; Y is zero already
lda (PtrTemp),Y ;<--have both tiles
sta Temp+1
and #$F0 ;left tile * 16...
sta Temp
lda Temp+1 ;...plus right tile
and #$0F
asl
;...times two. (carry is clear after ASL)
jmp HaveTileBitmapIndex
[elsewhere]
HaveTileBitmapIndex
adc Temp ;(carry is clear after LSR)
tay ;Is our index into the array of tile
bitmaps.
...
Thanks a bunch for looking at this. :)
-bob
More information about the Stella
mailing list