Battle_CheckItemDrop:
bsr.w loc_44CA
bset #7, (Battle_Routine_2).l
bne.w loc_318E
clr.w ($FFFF4190).l ; Clears memory address FFFF4190
jsr (loc_27E178).l ; Run subroutine at location 27E178. Something to do with invertory, check if full?
jsr (UpdateRNGSeed2).l ; Draw a new random number (runs subroutine at UpdateRNGSeed2)
andi.b #$7F, d0 ; Bit-wise AND comparison. A mystery at the moment.
cmp.b (Item_Drop_Rate).l, d0 ; Compares Item_Drop_Rate to what's currently stored in d0, I GUESS
bge.s loc_318E ; Compares random number to item drop propability number, I GUESS
addq.w #1, ($FFFF4190).l
tst.b ($FFFFF437).w
beq.s loc_318E
addq.w #2, ($FFFF4190).l
loc_318E:
move.w ($FFFF4190).l, d0
lea (loc_319E).l, a0
trap #2
rts
Yeah. That would be 50%. So, yeah, it's not that.etony33 wrote:Well, it's not 127 out of 256, that's for sure.
UpdateRNGSeed2:
move.w $8(a5), d0 ; move 16-bits (word) from somewhere to d0
add.w (Main_Frame_Count).w, d0 ; add Main_Frame_Count to d0
sub.w (RNG_Seed).w, d0 ; substract some random number from d0
ror (RNG_Seed).w ; "rotate" random number (to maybe avoid successive similar numbers if used concurrently)
rts ; return/exit from subroutine
Zucca wrote:I've made only a little progess.
I've found one static number - 127. If I'm correct then the random number generated needs to be smaller than 127 to get the monster to drop the item.
That means (at least now) the drop rate for each item is the exact same.
Users browsing this forum: The PS Logo and 2 guests