Language: asm
; figure out attack type
$09F4 jsr RNG_ROLL_0_995A
$09FA cmp.w (a2)+,d0
$09FC bcc.w $2D22 ; if D0 (left after RNG roll) > #$AB85, branch to $2D22
$0A00 addq.l #2,a2
$0A02 cmp.w (a2)+,d0
$0A04 bcs.s $0A00
; prepare jump to $0BD0
$0A06 adda.w (a2),a2
$0A08 movea.w (a2)+,a0
$0A0A jmp (a0) ; resume to $0BD0
Language: asm
; RNG ROLL
$998E move.w d0,-(sp)
$9990 bsr #$C8 [00:995A]
$995A move.l d1,-(sp)
$995C move.w (RNG_1_FFF5FC).w,d0
$9960 move.l (RNG_2_FFF5FE).w,d1
$9964 rol.l #1,d1
$9966 eor.w d0,d1
$9968 swap d1
$996A eor.w d1,d0
$996C rol.w #1,d0
$996E eor.w d0,d1
$9970 swap d1
$9972 eor.w d1,d0
$9974 move.l d1,(RNG_2_FFF5FE).w
$9978 move.w d0,(RNG_1_FFF5FC).w
$997C move.l (sp)+,d1
$997E ext.l d0
$9980 rts
Language: asm
; prepare jump to $0BD0
$2D22 adda.w (a2),a2
$2D24 movea.w (a2)+,a0
$2D26 jmp (a0) ; resume to $0BD0
As we can see, RNG address is $FFF5FC, and when roll occurs, it only accounts its own previous value, and previous value of $FFF5FE. Which makes result impossible to manipulate directly. The only difference is that while RNG roll occurs every frame, when you do B attack (not double A), it rolls once more. Doesn't happen when you just press B, only when attack activates.
Figuring out which value of D0 leads to what looks unnecessary to me, because you can't manipulate the result anyway. So the displayed value is not the last D0 that gets compared, but the one stored in RAM whenever gui gets registered.