A82: Rand Number Error


[Prev][Next][Index][Thread]

A82: Rand Number Error



Alright, I had a random point generator working under Ash 2.0. However,
when I converted to ash 3.0, I got a freeze. I isolated it to the 6th
line below, which will rerandomize the number if it is over 95 (the
screen boundary). Any help on fixing this, or somehow getting a random
number between 0 and 95?

NewTarget:
    ld a, r
    srl a
    and 127
    cp 95
;   jr c, NewTarget   ; <-- If this line is uncommented, it cause a
freeze (Or, is it an infinite loop?)
    jr z, NewTarget
    ld b, a


Follow-Ups: