shithub: pokered

ref: ecd2eb2447bf4dee4ec3be35f881c7e7102adb1b
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