[A83] Re: Tilemap
[Prev][Next][Index][Thread]
[A83] Re: Tilemap
Okay, sligh mistake from my part, try this:
> left:
> ;all the shift routines use the same style, so it's only commented once:
> ;since we have a 13x9 tilemap, we can only shift right,left,up,down once,
> ;so check if we aren't already. If we are already u,l,d,r, return to the
> loop..
> ld a,(x_origin)
cp 0
jr z,wait
>
> ;else, decrement the x origin for left, increment it for right..
> ;decrement the y origin for up, increment it for down...
> ;origin is already in a since we needed to check it...
> dec a
> ld (x_origin),a
> ;call the tilemap routine...
> call writemap
> ;and write the buffer to the screen:
> bcall(_grbufcpy)
> jr wait
>
> right:
> ld a,(x_origin)
cp 2
jr z,wait
> inc a
> ld (x_origin),a
> call writemap
> bcall(_grbufcpy)
> jp wait
>
> up:
> ld a,(y_origin)
cp 0
jr z,wait
> dec a
> ld (y_origin),a
> call writemap
> bcall(_grbufcpy)
> jp wait
>
> down:
> ld a,(y_origin)
cp 2
jr z,wait
> inc a
> ld (y_origin),a
> call writemap
> bcall(_grbufcpy)
> jp wait
>
> ; then there was the
> map_width:
> .dw 14 ; width of map as a word!
--Peter-Martijn
> I suppose you're modifying my example program,
> > then I suppose too that you're forgetting to modify the left/right/up/down
> > routines...
> > the Down and right routines compare to 13 (original width) - 12 (=1)
> > and 9 (original height) - 8 (=1)
> >
> > you need to change the value in the down routine to [your height] - 8
> > and in the right routine to [your width] - 12
> >
> > hope this helps...
> > --Peter-Martijn
> >
>
>
>
>
>
References: