From Bulbapedia, the community-driven Pokémon encyclopedia.
Tweaking, originally called "Holepunching" to commemorate its discoverer, is a glitch in Generation IV of Pokémon Diamond/Pearl/Platinum. Tweaking causes a failure to properly load the graphics of one or more sections.
The Generation IV of Pokémon RPG Games uses a map with section the size of 32 tiles in length and width. The result of a tweak will either freeze the game, create an invisible barrier, or will distort one or more of these sections. Tweaking may cause a black section, white section, or another section to load instead of the normal section.
How Tweaking Works
For tweaking to work, it must be preformed at the "load lines" of these 32x32 tile sections. The load lines are found vertically and horizontally between the 16th and 17th step of every section. Upon crossing a load line, the game will immediately load the next section your character is approaching. Tweaking is done at the intersection of a vertical and horizontal load line. The intersection of two load lines is the point at which four different sections load. Crossing the two lines back and forth fast enough causes an overload in the game's RAM because it's needing to load/unload all the surrounding sections in such a short period of time. Tweaking is, in essence, simply crossing over the load lines so quickly that the game overloads from the loading of multiple incoming sections. Using a bicycle in 4th gear makes it easier to cause an overload because your character is able to load more sections in a shorter period of time. However, 3rd gear and even running may also create tweaking results.
The distorted result of tweaking itself can be corrected by taking 17 or more steps away from the distorted section. At this point, the section will unload from the game's RAM and reload normally once it is approached again. Therefore, tweaking itself is almost completely harmless to the game.
Tweaking can be used to enter the Mystery Zone, also called the "Void". The Void is the surrounding black area which is seen at the edge of any section of the game. This area's data is very uncertain and unstable since it has not been programmed in a specific fashion. This makes it possible to come across countless abnormalities in the game which could both be beneficial or detrimental to the game. Most notably, a method for obtaining the event Pokémon Darkrai and Shaymin have been discovered by the Mystery Zone.