A83: delay routines...HELP!


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

A83: delay routines...HELP!




I have been trying for a few weeks to get a good delay rountine to slow
down my program in places. I studied the code of many games that use
delays, and I can't figure out what the commands do. If I implement other
peoples delay code, my calc crashes.I haven't seen them in any tutorials or
at the TI site. Many of the routines are similar from different programs.
Here's the code from frogger...

DelayChk:
	push	af			<<<<what does push do?
	push	bc
	ld	a,(level)			<<<<I understand the speed settings
	cp	1
	jp	z,d2500
	cp	2
	jp	z,d2000
	cp	3
	jp	z,d1500
	cp	4
	jp	z,d1000
	jp	nz,500
d2500:
	ld	bc,$2500		<<<<what does the $(number) mean?
	jp	delayLoop

d2000:
	ld	bc,$2000
	jp	delayLoop

d1500:
	ld	bc,$1500
	jp	delayLoop

d1000:
	ld	bc,$1000
	jp	delayLoop

d500:
	ld	bc,$500
	jp	delayLoop
		
delayLoop:
	DEC BC			<<<What is DEC
	LD A, B			
	OR C				<<what is OR C
	JR NZ, delayLoop		
	POP BC			<<<what is POP
	POP AF			
	ret



Follow-Ups: