A83: Re: MAPS


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

A83: Re: MAPS




Didn't I post the tutorial before?  Ok, here you go.  BTW:  They're not quite out yet :)

Introduction.
Well, after attempt after attempt at finding or writing a decent scrolling routine.  I'm talking to dear Movax, and he's like
"Hold on", 5 minutes later I'm running a perfect scrolling routine he'd just written (don't you hate people like that! =Ž). 
Thanks a lot to Hannes "Movax" Edfeldt.

New Commands.
_getk	- Like BASIC getkey.  Returns key to OP1.  Values in Ti-manual.


The Code.

  ld    hl,picture		;Load your pic.
  ld 	de,PLOTSSCREEN
  ld 	bc,768
  ldir
  call  _grbufcpy_v

loop:
  call _scrollright
  call _grbufcpy_v

  call    _getk   	; Key to OP2.
  call    _op2toop1
  call    _convop1
  cp	  45		; If clear…
  jp      nz,loop	;
  ret



_ScrollRight:
	ld	de,12
	ld	hl,8e29h-1
	ld	b,64		; 64*12=768 bytes to rotate
_loop1:
	push	hl		; Test if there's a bit to wrap around	
	add	hl,de
	ld	a,(hl)

and	00000001b
	sub	00000001b
	ccf
	pop	hl
	
	inc	hl		; We'll waste space here to gain some speed
	rr	(hl)
	inc	hl
	rr	(hl)
	inc	hl
	rr	(hl)
	inc	hl
	rr	(hl)
	inc	hl
	rr	(hl)
	inc	hl
	rr	(hl)
	inc	hl		; We'll waste space here to gain some speed
	rr	(hl)
	inc	hl
	rr	(hl)
	inc	hl
	rr	(hl)
	inc	hl
	rr	(hl)
	inc	hl
	rr	(hl)
	inc	hl
	rr	(hl)

	djnz	_loop1

  ret

picture:
;Put your picture here.

.end
END

Conclusion.

Thanks again to Movax for this routine!  This should help all of you game freaks out there!  If you come up with a better
routine that scrolls left/right, up/down, or all directions, please contact me!  Thanks.

 Related Topics.

I remember, I did post it...anyway. :)

HTH.

James Matthews (matthews@tkb.att.ne.jp)

ICQ: 7413754
http://home.att.ne.jp/gold/tomcat21/index.html
http://library.advanced.org/18242/

----------
> From: Chris Hiszpanski <mecad@scv.net>
> To: Assembly News 83 <assembly-83-digest@lists.ticalc.org>
> Subject: A83: MAPS
> Date: Sunday, October 04, 1998 8:44 AM
> 
> 
> I dont know if James released any tutorials about background scrolling or
> not ( tiled sprites that make a moving background ). The reason that I am
> asking is that I can't find them. I looked at ticalc but I can't find them.
> Could someone point me in the right direction (as in correct address
> something something : )
> 
> From: Chris
> mecad@scv.net