MCPcopy Create free account
hub / github.com/TASEmulators/fceux / EncodeGG

Function EncodeGG

src/drivers/win/cheat.cpp:1243–1270  ·  view source on GitHub ↗

The code in this function is a modified version of Chris Covell's work - I'd just like to point that out

Source from the content-addressed store, hash-verified

1241//The code in this function is a modified version
1242//of Chris Covell's work - I'd just like to point that out
1243void EncodeGG(char *str, int a, int v, int c)
1244{
1245 uint8 num[8];
1246 int i;
1247
1248 a&=0x7fff;
1249
1250 num[0]=(v&7)+((v>>4)&8);
1251 num[1]=((v>>4)&7)+((a>>4)&8);
1252 num[2]=((a>>4)&7);
1253 num[3]=(a>>12)+(a&8);
1254 num[4]=(a&7)+((a>>8)&8);
1255 num[5]=((a>>8)&7);
1256
1257 if (c == -1){
1258 num[5]+=v&8;
1259 for(i = 0;i < 6;i++)str[i] = GameGenieLetters[num[i]];
1260 str[6] = 0;
1261 } else {
1262 num[2]+=8;
1263 num[5]+=c&8;
1264 num[6]=(c&7)+((c>>4)&8);
1265 num[7]=((c>>4)&7)+(v&8);
1266 for(i = 0;i < 8;i++)str[i] = GameGenieLetters[num[i]];
1267 str[8] = 0;
1268 }
1269 return;
1270}
1271
1272void ListGGAddresses(HWND hwndDlg)
1273{

Callers 4

CheatConsoleCallBFunction · 0.70
GGConvCallBFunction · 0.70
SetGGConvFocusFunction · 0.70
GetCheatStrFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected