[Cosmetics]

- Update some headers that was incorrect
- Reformat the code in all files to match the same code style
- Removal of unwanted/unneeded files
This commit is contained in:
Godzil
2018-02-02 17:43:15 +00:00
parent ad195d6c20
commit cdda587579
77 changed files with 4001 additions and 4972 deletions

View File

@@ -2,7 +2,7 @@
* Code Breaker plugin - The peTI-NESulator Project
* gamegenie.c: Hack your games with unlimited lives of add new powers!
*
* Created by Manoel Trapier.
* Created by Manoël Trapier.
* Copyright (c) 2003-2018 986-Studio. All rights reserved.
*
*/
@@ -13,22 +13,15 @@
#include <os_dependent.h>
#define __TINES_PLUGINS__
#include <plugins/manager.h>
#undef __TINES_PLUGINS_
#include <memory/manager.h>
#include <types.h>
#if 0
/* Allegro includes */
#ifdef __APPLE__
#define USE_CONSOLE
#include <Allegro/allegro.h>
#else
#define USE_CONSOLE
#include <allegro.h>
#endif
typedef enum gg_States_
{
@@ -76,85 +69,95 @@ uint8_t gg_RdHookPatch##d(uint8_t addr) \
#define GG_MAX_PATCH 10
/* Defines the rdhook patches */
GG_RDHOOKPATCH(0)
GG_RDHOOKPATCH(1)
GG_RDHOOKPATCH(2)
GG_RDHOOKPATCH(3)
GG_RDHOOKPATCH(4)
GG_RDHOOKPATCH(5)
GG_RDHOOKPATCH(6)
GG_RDHOOKPATCH(7)
GG_RDHOOKPATCH(8)
GG_RDHOOKPATCH(9)
void gg_SetPatch(int id, uint8_t page, uint8_t addr, uint8_t value)
{
func_rdhook fptr;
if (id >= GG_MAX_PATCH)
{
return;
}
/* Set parameters for the patch */
if (gg_PatchUsed[id] == 0x00)
{
gg_rdhookPtr[id] = get_page_rdhook(page);
}
gg_rdhookPtr[id] = get_page_rdhook(page);
}
gg_PatchedPage[id] = page;
gg_PatchedAddr[id] = addr;
gg_PatchedValue[id] = value;
gg_PatchUsed[id] = 0xFF;
/* Set a ReadHook on the page */
switch(id)
switch (id)
{
default:
case 0:
fptr = gg_RdHookPatch0;
break;
case 1:
fptr = gg_RdHookPatch1;
break;
case 2:
fptr = gg_RdHookPatch2;
break;
case 3:
fptr = gg_RdHookPatch3;
break;
case 4:
fptr = gg_RdHookPatch4;
break;
case 5:
fptr = gg_RdHookPatch5;
break;
break;
case 6:
fptr = gg_RdHookPatch6;
break;
case 7:
fptr = gg_RdHookPatch7;
break;
case 8:
fptr = gg_RdHookPatch8;
break;
case 9:
fptr = gg_RdHookPatch9;
break;
break;
}
set_page_rd_hook(page, fptr);
}
/* Access to the bitmap Buffer */
extern BITMAP *Buffer;
BITMAP *gg_Buffer;
@@ -164,28 +167,28 @@ void MessageBox(char *title, char *msg)
int sc_w, sc_h;
int box_h, box_t, box_l, box_w;
sc_w = screen->w;
sc_h = screen->h;
gg_Buffer = create_bitmap(sc_w, sc_h);
blit(Buffer, gg_Buffer, 0, 0, 0, 0, 512 + 256, 480);
box_w = text_length(font, title) + 10;
box_w = (box_w>text_length(font, msg))?box_w:text_length(font, msg);
box_w = (box_w > text_length(font, msg)) ? box_w : text_length(font, msg);
box_w += 15 * 2; /*sc_w/2;*/
box_h = 15*2 + 10;
box_h = 15 * 2 + 10;
/* Set the box center */
box_t = (sc_h - box_h) / 2;
box_l = (sc_w - box_w) / 2;
rectfill(gg_Buffer, box_l, box_t, box_l + box_w, box_t + box_h, 60);
rect(gg_Buffer, box_l + 5, box_t + 5, box_l + box_w - 5, box_t + box_h - 5, 34);
/* Display the title */
textout_centre_ex(gg_Buffer, font, title, box_w / 2 + box_l, box_t + 2, 34, 60);
@@ -195,7 +198,7 @@ void MessageBox(char *title, char *msg)
blit(gg_Buffer, screen, 0, 0, 0, 0, 512 + 256, 480);
sleep(1);
release_bitmap(gg_Buffer);
}
@@ -205,43 +208,43 @@ uint16_t SelectNumber(char *title, char *msg, uint8_t size)
int sc_w, sc_h;
int box_h, box_t, box_l, box_w;
char valueText[10];
uint16_t value;
uint8_t digit = 0;
sc_w = screen->w;
sc_h = screen->h;
gg_Buffer = create_bitmap(sc_w, sc_h);
blit(Buffer, gg_Buffer, 0, 0, 0, 0, 512 + 256, 480);
box_w = text_length(font, title) + 10;
box_w = (box_w>text_length(font, msg))?box_w:text_length(font, msg);
box_w = (box_w > text_length(font, msg)) ? box_w : text_length(font, msg);
sprintf(valueText, "0000");
box_w = (box_w>text_length(font, valueText))?box_w:text_length(font, msg);
box_w = (box_w > text_length(font, valueText)) ? box_w : text_length(font, msg);
box_w += 15 * 2; /*sc_w/2;*/
box_h = 15*2 + 30;
box_h = 15 * 2 + 30;
/* Set the box center */
box_t = (sc_h - box_h) / 2;
box_l = (sc_w - box_w) / 2;
value = 0;
while(!key[KEY_ENTER])
while (!key[KEY_ENTER])
{
rectfill(gg_Buffer, box_l, box_t, box_l + box_w, box_t + box_h, 60);
rect(gg_Buffer, box_l + 5, box_t + 5, box_l + box_w - 5, box_t + box_h - 5, 34);
/* Display the title */
textout_centre_ex(gg_Buffer, font, title, box_w / 2 + box_l, box_t + 2, 34, 60);
@@ -249,163 +252,193 @@ uint16_t SelectNumber(char *title, char *msg, uint8_t size)
textout_centre_ex(gg_Buffer, font, msg, box_w / 2 + box_l, 15 + box_t + 2, 34, 60);
if (size == 2)
sprintf(valueText, " %02X", value&0xFF);
{
sprintf(valueText, " %02X", value & 0xFF);
}
else
{
sprintf(valueText, "%04X", value);
}
textout_centre_ex(gg_Buffer, font, valueText, box_w / 2 + box_l , 15 + box_t + 2 + 10, 34, 60);
switch(digit)
textout_centre_ex(gg_Buffer, font, valueText, box_w / 2 + box_l, 15 + box_t + 2 + 10, 34, 60);
switch (digit)
{
default:
case 0:
textout_centre_ex(gg_Buffer, font, " ^", box_w / 2 + box_l , 15 + box_t + 2 + 20, 34, 60);
textout_centre_ex(gg_Buffer, font, " ^", box_w / 2 + box_l, 15 + box_t + 2 + 20, 34, 60);
break;
case 1:
textout_centre_ex(gg_Buffer, font, " ^ ", box_w / 2 + box_l , 15 + box_t + 2 + 20, 34, 60);
textout_centre_ex(gg_Buffer, font, " ^ ", box_w / 2 + box_l, 15 + box_t + 2 + 20, 34, 60);
break;
case 2:
textout_centre_ex(gg_Buffer, font, " ^ ", box_w / 2 + box_l , 15 + box_t + 2 + 20, 34, 60);
textout_centre_ex(gg_Buffer, font, " ^ ", box_w / 2 + box_l, 15 + box_t + 2 + 20, 34, 60);
break;
case 3:
textout_centre_ex(gg_Buffer, font, "^ ", box_w / 2 + box_l , 15 + box_t + 2 + 20, 34, 60);
textout_centre_ex(gg_Buffer, font, "^ ", box_w / 2 + box_l, 15 + box_t + 2 + 20, 34, 60);
break;
}
blit(gg_Buffer, screen, 0, 0, 0, 0, 512 + 256, 480);
blit(gg_Buffer, screen, 0, 0, 0, 0, 512 + 256, 480);
if (key[KEY_UP])
{
usleep(100000);
value += ((digit==0)?0x0001:((digit==1)?0x0010:((digit==2)?0x0100:0x1000)));
value &= (size==2)?0xFF:0xFFFF;
value += ((digit == 0) ? 0x0001 : ((digit == 1) ? 0x0010 : ((digit == 2) ? 0x0100 : 0x1000)));
value &= (size == 2) ? 0xFF : 0xFFFF;
}
if (key[KEY_DOWN])
{
usleep(100000);
value -= ((digit==0)?0x0001:((digit==1)?0x0010:((digit==2)?0x0100:0x1000)));
value &= (size==2)?0xFF:0xFFFF;
value -= ((digit == 0) ? 0x0001 : ((digit == 1) ? 0x0010 : ((digit == 2) ? 0x0100 : 0x1000)));
value &= (size == 2) ? 0xFF : 0xFFFF;
}
if (key[KEY_RIGHT])
{
usleep(100000);
if (digit <= 0)
digit = size-1;
else
digit --;
{
digit = size - 1;
}
else
{
digit--;
}
}
if (key[KEY_LEFT])
{
usleep(100000);
if (digit >= size-1)
if (digit >= size - 1)
{
digit = 0;
}
else
digit ++;
{
digit++;
}
}
}
release_bitmap(gg_Buffer);
while(key[KEY_ENTER]);
while (key[KEY_ENTER])
{
}
return value;
}
int DispMenu(int itemc, char *itemv[], char *title)
{
//console_printf(Console_Default, "%s(%d, %p, \"%s\");\n", __func__, itemc, itemv, title);
int selection = 0;
int i;
int sc_w, sc_h;
int box_h, box_t, box_l, box_w;
sc_w = screen->w;
sc_h = screen->h;
gg_Buffer = create_bitmap(sc_w, sc_h);
blit(Buffer, gg_Buffer, 0, 0, 0, 0, 512 + 256, 480);
box_w = text_length(font, title) + 10;
for (i = 0; i < itemc; i ++)
box_w = (box_w>text_length(font, itemv[i]))?box_w:text_length(font, itemv[i]);
for (i = 0 ; i < itemc ; i++)
{
box_w = (box_w > text_length(font, itemv[i])) ? box_w : text_length(font, itemv[i]);
}
box_w += 15 * 2; /*sc_w/2;*/
box_h = 15*2 + itemc*10;
box_h = 15 * 2 + itemc * 10;
/* Set the box center */
box_t = (sc_h - box_h) / 2;
box_l = (sc_w - box_w) / 2;
while(!key[KEY_ENTER])
while (!key[KEY_ENTER])
{
/* Draw the box and highlight the selected item */
rectfill(gg_Buffer, box_l, box_t, box_l + box_w, box_t + box_h, 60);
rect(gg_Buffer, box_l + 5, box_t + 5, box_l + box_w - 5, box_t + box_h - 5, 34);
/* Display the title */
textout_centre_ex(gg_Buffer, font, title, box_w / 2 + box_l, box_t + 2, 34, 60);
/* Display the highlight item */
rectfill(gg_Buffer, box_l+15, 15 + box_t + (selection * 10) , box_l + box_w - 15, 15 + box_t + (selection * 10) + 10, 34);
textout_centre_ex(gg_Buffer, font, itemv[selection], box_w / 2 + box_l, 15 + box_t + (selection * 10) + 2, 60, 34);
rectfill(gg_Buffer, box_l + 15, 15 + box_t + (selection * 10), box_l + box_w - 15,
15 + box_t + (selection * 10) + 10, 34);
textout_centre_ex(gg_Buffer, font, itemv[selection], box_w / 2 + box_l, 15 + box_t + (selection * 10) + 2, 60,
34);
/* Display other items */
for (i = 0; i < itemc; i ++)
for (i = 0 ; i < itemc ; i++)
{
if (i != selection)
{
textout_centre_ex(gg_Buffer, font, itemv[i], box_w / 2 + box_l, 15 + box_t + (i * 10) + 2, 34, 60);
}
}
/* Blit the screen buffer */
blit(gg_Buffer, screen, 0, 0, 0, 0, 512 + 256, 480);
/* Now get the keyboard state */
if (key[KEY_UP])
{
usleep(100000);
if (selection <= 0)
{
selection = itemc - 1;
else
selection --;
}
else
{
selection--;
}
}
if (key[KEY_DOWN])
{
usleep(100000);
if (selection >= (itemc - 1))
{
selection = 0;
}
else
selection ++;
{
selection++;
}
}
}
release_bitmap(gg_Buffer);
while(key[KEY_ENTER]);
while (key[KEY_ENTER])
{
}
return selection;
}
uint8_t AskYesNo(char *title)
{
char *YesNo[] = { "No", "Yes" };
return DispMenu(2, YesNo, title);
}
uint8_t gg_CalcChk(uint16_t addr, uint8_t value)
{
int chk = 0x42;
chk += (addr & 0xFF00) >> 8;
chk -= (addr & 0x00FF);
chk += (value & 0x00FF);
chk += (addr & 0xFF00) >> 8;
chk -= (addr & 0x00FF);
chk += (value & 0x00FF);
return chk;
}
@@ -420,7 +453,7 @@ uint32_t gg_MakeCode(uint16_t addr, uint8_t value)
uint32_t code = addr << 16;
code |= (value << 8);
code |= (gg_CalcChk(addr, value) & 0x00FF);
return code ^ 0x246FF53A;
}
@@ -430,33 +463,41 @@ uint8_t gg_SelectPatch()
char *tmp;
int i;
uint8_t ret;
for (i = 0; i < GG_MAX_PATCH; i++)
for (i = 0 ; i < GG_MAX_PATCH ; i++)
{
tmp = (char*) malloc(0x100);
console_printf(Console_Default, "Items[%d]: %p\n", i, tmp);
tmp = (char *)malloc(0x100);
console_printf(Console_Default, "Items[%d]: %p\n", i, tmp);
if (gg_PatchUsed[i] == 0x00)
{
sprintf(tmp, "Patch %d: Not used", i);
}
else
{
sprintf(tmp, "Patch %d: Put 0x%02X on address 0x%02X%02X (Code: %08lX)",
i, gg_PatchedValue[i], gg_PatchedPage[i], gg_PatchedAddr[i],
gg_MakeCode((gg_PatchedPage[i]<<8) | gg_PatchedAddr[i], gg_PatchedValue[i]));
gg_MakeCode((gg_PatchedPage[i] << 8) | gg_PatchedAddr[i], gg_PatchedValue[i]));
}
Items[i] = tmp;
}
tmp = (char*) malloc(0x100);
tmp = (char *)malloc(0x100);
sprintf(tmp, "Return");
Items[GG_MAX_PATCH] = tmp;
ret = DispMenu(GG_MAX_PATCH + 1, Items, "Code Breaker - Select a patch");
for(i = 0; i < GG_MAX_PATCH; i++)
for (i = 0 ; i < GG_MAX_PATCH ; i++)
{
free(Items[i]);
}
if (ret == GG_MAX_PATCH)
{
return 0xFF;
}
return ret;
}
@@ -468,23 +509,23 @@ void gg_PatchManager()
void gg_InitSearch()
{
uint16_t addr;
for(addr = 0x000; addr < 0x800; addr ++)
for (addr = 0x000 ; addr < 0x800 ; addr++)
{
gg_MainRAM[addr] = ReadMemory((addr&0xFF00)>>8,addr&0x00FF);
gg_MainRAM[addr] = ReadMemory((addr & 0xFF00) >> 8, addr & 0x00FF);
gg_use_MainRAM[addr] = 0xFF;
}
gg_ResultNumber = 0x800;
}
typedef enum gg_SearchForMode_
typedef enum gg_SearchForMode_
{
GG_SEARCHFOR_LOWER = 0,
GG_SEARCHFOR_HIGHER,
GG_SEARCHFOR_IDENTIC,
GG_SEARCHFOR_DIFFERENT
} gg_SearchForMode;
void gg_SearchForValue(uint8_t value)
@@ -493,16 +534,16 @@ void gg_SearchForValue(uint8_t value)
//uint8_t oldValue;
uint8_t currentValue;
gg_ResultNumber = 0x00;
for(addr = 0x000; addr < 0x800; addr ++)
for (addr = 0x000 ; addr < 0x800 ; addr++)
{
if (gg_use_MainRAM[addr] == 0xFF)
{
/* "Backup" the old ram */
memcpy(gg_OldMainRAM, gg_MainRAM, 0x800);
//oldValue = gg_MainRAM[addr];
currentValue = ReadMemory((addr&0xFF00)>>8,addr&0x00FF);
currentValue = ReadMemory((addr & 0xFF00) >> 8, addr & 0x00FF);
if (currentValue != value)
{ /* This is not the good one ! */
gg_use_MainRAM[addr] = 0x00;
@@ -522,17 +563,17 @@ void gg_SearchFor(gg_SearchForMode mode)
uint8_t oldValue;
uint8_t currentValue;
gg_ResultNumber = 0x00;
for(addr = 0x000; addr < 0x800; addr ++)
for (addr = 0x000 ; addr < 0x800 ; addr++)
{
if (gg_use_MainRAM[addr] == 0xFF)
{
/* "Backup" the old ram */
memcpy(gg_OldMainRAM, gg_MainRAM, 0x800);
oldValue = gg_MainRAM[addr];
currentValue = ReadMemory((addr&0xFF00)>>8,addr&0x00FF);
switch(mode)
currentValue = ReadMemory((addr & 0xFF00) >> 8, addr & 0x00FF);
switch (mode)
{
case GG_SEARCHFOR_LOWER:
if (currentValue >= oldValue)
@@ -554,7 +595,7 @@ void gg_SearchFor(gg_SearchForMode mode)
else
{ /* This can be the good one ! */
gg_ResultNumber++;
gg_MainRAM[addr] = currentValue;
gg_MainRAM[addr] = currentValue;
}
break;
@@ -566,7 +607,7 @@ void gg_SearchFor(gg_SearchForMode mode)
else
{ /* This can be the good one ! */
gg_ResultNumber++;
gg_MainRAM[addr] = currentValue;
gg_MainRAM[addr] = currentValue;
}
break;
case GG_SEARCHFOR_DIFFERENT:
@@ -577,7 +618,7 @@ void gg_SearchFor(gg_SearchForMode mode)
else
{ /* This can be the good one ! */
gg_ResultNumber++;
gg_MainRAM[addr] = currentValue;
gg_MainRAM[addr] = currentValue;
}
break;
}
@@ -591,7 +632,7 @@ uint8_t gg_DisplayResults()
char *tmp;
int i, addr = 0x0000;
uint8_t ret = 0;
uint16_t AddrList[21];
if (gg_ResultNumber > 20)
{
@@ -599,42 +640,46 @@ uint8_t gg_DisplayResults()
}
else
{
for (i = 0; i < gg_ResultNumber; i++)
{
while(gg_use_MainRAM[addr] != 0xFF)
addr ++;
console_printf(Console_Default, "0x%04X [%d]\n", addr, i);
tmp = (char*) malloc(0x100);
sprintf(tmp,"Patch: %08XAddress 0x%04X - Was: 0x%02X - Actual: 0x%02X",
i,
addr,
gg_OldMainRAM[addr],
gg_MainRAM[addr]);
Items[i] = tmp;
AddrList[i] = addr;
addr++;
}
tmp = (char*) malloc(0x100);
sprintf(tmp, "Return");
Items[i] = tmp;
ret = DispMenu(gg_ResultNumber + 1, Items, "Code Breaker - Search");
if (ret < i)
{
if (AskYesNo("Code Breaker: Apply this patch?"))
{
/* Now patch it ! */
gg_SetPatch(gg_SelectPatch(), (AddrList[ret]&0xFF00)>>8, (AddrList[ret]&0x00FF),
SelectNumber("Code Breaker", "Value to apply:", 2) & 0x00FF);
ret = 1;
}
}
for(i=0 ; i<gg_ResultNumber+1; i++)
free(Items[i]);
for (i = 0 ; i < gg_ResultNumber ; i++)
{
while (gg_use_MainRAM[addr] != 0xFF)
{
addr++;
}
console_printf(Console_Default, "0x%04X [%d]\n", addr, i);
tmp = (char *)malloc(0x100);
sprintf(tmp, "Patch: %08XAddress 0x%04X - Was: 0x%02X - Actual: 0x%02X",
i,
addr,
gg_OldMainRAM[addr],
gg_MainRAM[addr]);
Items[i] = tmp;
AddrList[i] = addr;
addr++;
}
tmp = (char *)malloc(0x100);
sprintf(tmp, "Return");
Items[i] = tmp;
ret = DispMenu(gg_ResultNumber + 1, Items, "Code Breaker - Search");
if (ret < i)
{
if (AskYesNo("Code Breaker: Apply this patch?"))
{
/* Now patch it ! */
gg_SetPatch(gg_SelectPatch(), (AddrList[ret] & 0xFF00) >> 8, (AddrList[ret] & 0x00FF),
SelectNumber("Code Breaker", "Value to apply:", 2) & 0x00FF);
ret = 1;
}
}
for (i = 0 ; i < gg_ResultNumber + 1 ; i++)
{
free(Items[i]);
}
}
return ret;
}
@@ -642,23 +687,23 @@ void gg_Start()
{
char *S00_MenuList[] = { "Search a specific Value", "Search for an Unknown Value", "Enter code",
"Manage Patches", "Exit" };
char *S01_MenuList[] = { "Value is identical", "New Value...", "Value is different",
"Value is greater", "Value is lower", "Result", "Restart", "Exit" };
char *S02_MenuList[] = { "Value is identical", "Value is different", "Value is greater",
"Value is lower", "Result", "Restart", "Exit" };
"Value is lower", "Result", "Restart", "Exit" };
char Buffer[100];
int ret;
uint8_t value;
uint16_t addr;
switch(gg_state)
switch (gg_state)
{
default:
case GG_S00_MAIN_STATE:
ret = DispMenu(5, S00_MenuList, "Code Breaker - Main");
switch (ret)
{
case 0:
@@ -666,9 +711,9 @@ void gg_Start()
gg_InitSearch();
gg_state = GG_S01_SEARCH_VALUE;
value = SelectNumber("Code Breaker", "Select the value:", 2) & 0x00FF;
gg_SearchForValue(value);
MessageBox("Code Breaker", "Search initialized !");
break;
case 1:
@@ -679,29 +724,29 @@ void gg_Start()
case 2: /* Enter code */
addr = SelectNumber("Code Breaker", "Select the address", 4);
value = SelectNumber("Code Breaker", "Select the value:", 2) & 0x00FF;
if (AskYesNo("Code Breaker: Apply this patch?"))
{
if (AskYesNo("Code Breaker: Apply this patch?"))
{
/* Now patch it ! */
gg_SetPatch(gg_SelectPatch(),
(addr&0xFF00)>>8, (addr&0x00FF),
(addr & 0xFF00) >> 8, (addr & 0x00FF),
value);
}
}
break;
case 3: /* Patch manager */
gg_PatchManager();
break;
}
break;
case GG_S01_SEARCH_VALUE:
S01_MENU:
S01_MENU:
ret = DispMenu(8, S01_MenuList, "Code Breaker - Search");
switch(ret)
switch (ret)
{
case 0:
gg_SearchFor(GG_SEARCHFOR_IDENTIC);
@@ -709,10 +754,10 @@ S01_MENU:
break;
case 1:
value = SelectNumber("Code Breaker", "Select the value:", 2) & 0x00FF;
gg_SearchForValue(value);
break;
case 2:
gg_SearchFor(GG_SEARCHFOR_DIFFERENT);
//goto S02_MENU;
@@ -730,11 +775,15 @@ S01_MENU:
case 5: /* Results */
if (gg_DisplayResults() == 1)
{
gg_state = GG_S00_MAIN_STATE;
}
else
{
goto S01_MENU;
}
break;
case 6:
if (AskYesNo("Code Breaker: Restart?"))
{
@@ -742,19 +791,21 @@ S01_MENU:
gg_Start();
}
else
{
goto S01_MENU;
}
break;
}
sprintf(Buffer,"Results found: %d", gg_ResultNumber);
sprintf(Buffer, "Results found: %d", gg_ResultNumber);
MessageBox("Code Breaker", Buffer);
break;
case GG_S02_SEARCH_BAR:
S02_MENU:
S02_MENU:
ret = DispMenu(7, S02_MenuList, "Code Breaker - Search");
switch(ret)
switch (ret)
{
case 0:
gg_SearchFor(GG_SEARCHFOR_IDENTIC);
@@ -778,11 +829,15 @@ S02_MENU:
case 4: /* Results */
if (gg_DisplayResults() == 1)
{
gg_state = GG_S00_MAIN_STATE;
}
else
{
goto S02_MENU;
}
break;
case 5:
if (AskYesNo("Code Breaker: Restart?"))
{
@@ -790,28 +845,31 @@ S02_MENU:
gg_Start();
}
else
{
goto S02_MENU;
}
break;
}
sprintf(Buffer,"Results found: %d", gg_ResultNumber);
sprintf(Buffer, "Results found: %d", gg_ResultNumber);
MessageBox("Code Breaker", Buffer);
break;
}
}
int gg_Init()
{
int i;
console_printf(Console_Default, "Initializing GG plugin...\n");
plugin_install_keypressHandler('g', gg_Start);
for ( i = 0; i < GG_MAX_PATCH; i++)
for (i = 0 ; i < GG_MAX_PATCH ; i++)
{
gg_PatchUsed[i] = 0x00;
}
return 0;
}
@@ -820,4 +878,5 @@ int gg_Deinit()
{
return 0;
}
#endif