shithub: pokered

ref: b045ac4f16ca9b611a3e3baef0d9a0c33ac6351c
dir: /engine/math/random.asm/

View raw version
Random_::
; Generate a random 16-bit value.
	ldh a, [rDIV]
	ld b, a
	ldh a, [hRandomAdd]
	adc b
	ldh [hRandomAdd], a
	ldh a, [rDIV]
	ld b, a
	ldh a, [hRandomSub]
	sbc b
	ldh [hRandomSub], a
	ret