The true hit system removal patch

As is known to us all, there is a true hit system on GBAFE.

Accuracy - Actual Accuracy
0 % 0 %
10% 2 %
20% 8 %
30% 18%
40% 32%
50% 50%
60% 68%
70% 82%
80% 92%
90% 98%
100 100

Here is a patch to remove it. Select your favorite patch from the 3 types.

Type A: Only consume 1 random number.
Type B: Consume 2 random numbers but only use the former.
Type C: Consume 2 random numbers but only use the latter.

The purpose to consume 2 random numbers is to keep the original random number consuming rule for those who feel like predicting random numbers in an old way.

Patch here.

7 Likes

Holy Crap: this is impressive! Any plans for an FE6/8 version in the future?

If anyone needs, I will complete it immediately. After all, It is a only small hack.

How about a hack to remove True Hit for Hard Mode only?

You can add a check for that before the calculation.
We seldom make several modes for players to choose. Often an extremely hard mode only. :slight_smile:

The original routine:

08000E92 F7FFFFB7 bl #0x8000E04 ;get the 2nd RN
08000E96 6879 ldr r1,[r7,#0x4]
08000E98 1808 add r0,r1,r0 ;1st RN + 2nd RN
08000E9A 6078 str r0,[r7,#0x4]
08000E9C 6878 ldr r0,[r7,#0x4]
08000E9E 17C1 asr r1,r0,#0x1F
08000EA0 0FCA lsr r2,r1,#0x1F
08000EA2 1881 add r1,r0,r2
08000EA4 1048 asr r0,r1,#0x1
08000EA6 6078 str r0,[r7,#0x4]

You can add a branch here.@circleseverywhere

I think FE6/8 has the same routine. @Celerity910

1 Like

FE8 routine looks like this:

08000CB8 B530     push    r4,r5,r14
08000CBA 1C05     mov     r5,r0
08000CBC F7FFFFD2 bl      8000C64h             @RN #1
08000CC0 1C04     mov     r4,r0
08000CC2 F7FFFFCF bl      8000C64h             @RN #2
08000CC6 1824     add     r4,r4,r0
08000CC8 0FE0     lsr     r0,r4,1Fh
08000CCA 1824     add     r4,r4,r0
08000CCC 1064     asr     r4,r4,1h             @average the two
08000CCE 2000     mov     r0,0h
08000CD0 42A5     cmp     r5,r4                @check if it hit
08000CD2 DD00     ble     8000CD6h
08000CD4 2001     mov     r0,1h
08000CD6 BC30     pop     r4,r5
08000CD8 BC02     pop     r1

and my hard mode check:

.thumb
.org 0            @paste at 8000cc0

mov r4,r0
ldr r0, Jump_to
mov lr, r0
.short 0xF800
b End
.align
Jump_to:
.long 0x08e90330  @or whatever free space you want
End:
.thumb
.org 0            @paste at 8e90330

push {lr}
ldr r0, ModeByte
ldrb r0,[r0]
mov r1, #0x40
and r0,r0,r1
cmp r0,#0
bne End           @skip the 2nd RN if hard mode

TrueHit:
ldr r0, GetRN
mov lr, r0
.short 0xF800
add r4,r4,r0
lsr r0,r4,#0x1F
add r4,r4,r0
asr r4,r4,#1

End:
mov r0,#0
pop {r1}
bx r1

.align
GetRN:
.long 0x08000C64
ModeByte:
.long 0x0202bd04
1 Like

A related thing: Shinpichu’s 2 RN Patches for SNESFE here.

1 Like

Very late, I know, necropost, I also know, but is it possible that there could be a version of this where it’s “if the hit rate is or is below 50, use one RN, if it’s above, use two RN’s?”

that’s possible and easy.