shithub: pokered

ref: 2ebbb0d95eead4f40ec0bb7e9edd19526c2b2f3a
dir: /engine/random.asm/

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