Main Menu

Databases

Major Glitches

Glitches by Generation/Game

Pokémon GameShark Codes

References

Interactive Tools

Unused Content and Prerelease Information

Affiliates

Search Wiki

Toolbox

Focus Energy glitch
 Page | Discussion | View source | History

From Glitch City Laboratories

(Redirected from Focus Energy oversight)
Jump to: navigation, search
Miscellaneous glitches of Pokémon Red and Blue and Pokémon Yellow

Cooltrainer move | Super Glitch | Surfing glitch | Statue behaviour glitch | ZZAZZ Glitch | Amazing Man | Stand on a Tree | Invisible PC | Evolving Raichu | Walking Pikachu happiness glitch (Yellow only) | Walking lag glitch | Transform into a Ditto | See a Ghost without a Silph Scope | Get stuck in a wall | Invisible Tree | Billʼs Secret Garden | Coastal Flooding | Evolve without an Evolution Stone | Walk on water | Super effective move AI flaw | Glitch battle systems | Item stack duplication glitch | Silph Co. PC Glitch | Trick Zone | Introduction Nidorino glitch | Mute the music in the Pokémon League | Walk around with only fainted Pokémon | Wild appeared! | Pokémon Tower Pokédex glitch | Partial trapping move link battle glitch | PP Reset Glitch | Substitute glitch | Focus Energy glitch | Recovery move glitch

(view, talk, edit)

The Focus Energy glitch is a glitch in Pokémon Red, Blue and Yellow.

Focus Energy is a move that, ever since Generation II, increased the user's critical hit rate.

In Generation I, due to a bug, Focus Energy will always effectively quarter the player's chances of getting a critical hit.

This glitch was fixed in Pokémon Stadium, where Focus Energy quadruples the critical hit rate instead.[citation needed]

Analysis

The relevant block of code for Focus Energy's effect is this, beginning at offset 3E055 in Pokémon Red and Blue (view 0F:6055 in a debugger). Thanks Wack0 for walking through this.

bit 2, a ; test for focus energy
jr nz, .focusEnergyUsed (6061)
sla b ; b=b*2
jr nc, .noFocusEnergyUsed ; if b was below 128, skip...
ld b, $ff ; a cap at 255/256
jr .noFocusEnergyUsed
.focusEnergyUsed
srl b ; whoops! b=b/2, and if you look, the jump to here is before the b=b*2, so b is effectively 1/4 of what it should be
.noFocusEnergyUsed ; no cap at 255/256 for focus energy. I wonder if, if done properly, this would have caused bugs related to integer wraparound..

... (check for high critical hit move here)

The relative jump to '.focusEnergyUsed' that happens when Focus Energy is used makes the game skip a 'sla b' (double b), and then a 'srl b' (half b) at '.focusEnergyUsed' halves the value in register 'b'.

If Focus Energy is not used, the value in 'b' is doubled and if it was used, the value in 'b' is halved. 2.0/0.5=4.0, meaning critical hits land four times less likely.