pokeyellow/engine/random.asm
luckytyphlosion 94eee4e89e Cleanup with yellow-exclusive banks
Also introduce charmap for $ec (unfilled menu arrow cursor)
2015-12-31 15:24:54 -05:00

14 lines
207 B
NASM
Executable File

Random_:: ; f67dc (3d:67dc)
; 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