Explanation of Hooktypes
#1
What are Hooktypes?

I get asked this question by noobs quite a bit. For starters, if you are new to playing with Cheat Codes (GCTs), let's go over some basics.

The Basics

Every Disc/ISO Loader application for the Homebrew Channel comes with a "Cheat" setting of some sorts. This "Cheat" setting is usually referred to as the Ocarina Setting. It has two options. ON or OFF. Simple to understand. ON would be to activate your GCT file aka your cheat codes, and off would be to not activate your GCT file.

Underneath the Ocarina Setting (or nearby; depends on which HBC app you are using), there is a setting called HookType.

These are the following Hooktype Options


- None (in some modern HBC apps, setting None is the same as VI/VBI)
- VI (can also be referred to as VBI)
- KPAD Read
- Joypad
- GXDraw
- GXFlush
- OSSleepThread
- AXNextFrame


Technical Details

In memory, there are groups of executable instructions known as 'functions'. A lot of the same functions are used across multiple Wii games, and some functions can even be found in every Wii game. These functions have names. The names of the Hooktypes are the name of these functions.

However these functions are not always located in the same spot of memory, it depends on what game is being played. Your Disc/ISO loader has a string of instructions that are used to find where all these functions/hooktypes are in the game's memory.

Let's say you choose GXDraw for your hooktype. During the early booting stages of your game, your Disc/ISO loader will have a string of instruction data that it uses to search for the GXDraw function. Once the GXDraw function has been found, your loader will 'inject' the Gecko codehandler at that spot into memory. Technically, you cannot 'inject' within memory itself, so a 'subroutine' is created at the GXDraw function that will execute the Gecko codehandler whenever the game executes the GXDraw function.

All of the hooktypes listed above are functions that occur every frame (60 times per second). Thus the Gecko codehandler gets executed every frame.

Due to the complexity of certain games and/or limitations of the Gecko code handler, some hooktypes may not work well on those games. GXDraw and OSSleepthread work on 99% of all Wii games. Regarding MKWii, VBI works fine.

More Important Notes

Some Disc/ISO loaders may still be using a very archaic version of the Gecko Code Handler. This can actually cause Hooktypes to be unreliable. For example, if you are using Riivolution, you must use the GXDraw hooktype for cheat codes to work reliably for MKWii.

If you are using codes for a game you have never played on before or a rare/unpopular Wii game, use GXDraw or OSSleepThread hooktype first before 'defaulting' to VBI/VI.

Thanks for reading!
Reply


Messages In This Thread
Explanation of Hooktypes - by Vega - 12-26-2018, 10:30 PM
RE: Explanation of Hooktypes - by lovops - 03-18-2021, 01:04 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)