shithub: pokered

ref: 610ec0fd2271defcc6ebda89b379455155fdb3ca
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