[A83] 12*12


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

[A83] 12*12





hello, i recieved a left/right scrolling tilemap from Tijl Coosemans awhile 
ago. Now I basically fully understand it. But , it is an 8*8 tile scrolling 
tilemap. I was wondering if anyone could tell me how to edit it or show me 
to make it a 12*12 scrolling tilemap with some example code. And if possible 
how to go about making it scroll by pixels instead of tiles. Thankyou very 
much! Here is the 8*8 tilemap routine i would like to edit for learning 
purposes:
     xor	a
updateTileMap:
	push	af
	ld	hl,tilemap
	ld	de,tiles
	call	drawTileMap
	bcall(_grbufcpy)
keyloop:
	 halt
	 ld a,0ffh
         out (1),a
         ld a,0feh
         out (1),a
         in a,(1)
         cp 253
         jp z,left
         cp 251
         jp z,right
         ld a,0ffh
         out (1),a
         ld a,0fdh
         out (1),a
         in a,(1)
         cp 191
         jp z,quit
	 jr nz,keyloop
right:
	pop	af
	cp      12-12
	jr	z,updateTileMap
	inc	a
	jr	updateTileMap
left:
	pop	af
	or	a
	jr	z,updateTileMap
	dec	a
	jr	updateTileMap
quit:
	pop	af
        bcall( _clrLCDFull)
        bcall( _grbufclr)

	ret
drawTileMap:
	ld	b,0
	ld	c,a
	add	hl,bc
	push	hl
	pop	ix
	ld	hl,8E29h
	ld	bc,8*256+12
drawTileMapLoop:
	push	bc
	ld	b,c
drawLineLoop:
	push	bc
	push	hl
	ld	h,0
	ld	l,(ix)
	inc	ix
	add	hl,hl
	add	hl,hl
	add	hl,hl
	add	hl,de
	ex	de,hl
	ex	(sp),hl
	ld	b,8
drawTileLoop:
        ld	a,(de)
        ld	(hl),a
        inc	de
        ld	a,b
        ld	b,0
        add	hl,bc
        ld	b,a
        djnz	drawTileLoop
        ld	de,-(8*12)+1
        add	hl,de
        pop	de
        pop	bc
        djnz	drawLineLoop
        ld	c,7*12
        add	hl,bc
        ld	c,12-12
        add	ix,bc
        pop	bc
        djnz	drawTileMapLoop
        ret
tilemap:


tiles:
.end
END







_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp.