Re: A86: Falldown...


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

Re: A86: Falldown...




FallDown Forever uses this routine to get a random number in a:

	ld a,r		;a=random-ish number <128
	srl a		;a<64
	ld h,a		;use that as the upper byte of an address
lrand:
	ld l,0		;use some value as the lower byte... (self-modifying)
	add a,(hl)	;get a number from there
	ld (lrand+1),a	;and use that as the next lower byte

If the number is less than ~50 it draws an open space, otherwise it
draws a tile.

GoodFeelings4Me@aol.com wrote:
> 
> How do you create random patterns in asm, such as in Falldown


References: