summaryrefslogtreecommitdiff
path: root/engine/math/random.asm
blob: c8760157be3f3f0dc445677d83ace4ee6fa92096 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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