shithub: pokered

ref: 083cb38e33891d58158762ac2580bd3b62fcdaec
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