shithub: pokered

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