| 1270 | } |
| 1271 | |
| 1272 | void ListGGAddresses(HWND hwndDlg) |
| 1273 | { |
| 1274 | uint32 i, j = 0; //mbg merge 7/18/06 changed from int |
| 1275 | char str[20], code[9]; |
| 1276 | SendDlgItemMessage(hwndDlg, IDC_LIST_GGADDRESSES, LB_RESETCONTENT,0,0); |
| 1277 | |
| 1278 | uint32 a = -1; uint8 v = -1; int c = -1; |
| 1279 | GetUIGGInfo(hwndDlg, &a, &v, &c); |
| 1280 | |
| 1281 | // also enable/disable the add GG button here |
| 1282 | GetDlgItemText(hwndDlg, IDC_GAME_GENIE_CODE, code, 9); |
| 1283 | EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_ADD_TO_CHEATS), a >= 0 && (strlen(code) == 6 || strlen(code) == 8)); |
| 1284 | |
| 1285 | if (a != -1 && v != -1) |
| 1286 | for(i = 0; i < PRGsize[0]; i += 0x2000) |
| 1287 | if(c == -1 || PRGptr[0][i + (a & 0x1FFF)] == c){ |
| 1288 | GGlist[j] = i + (a & 0x1FFF) + 0x10; |
| 1289 | if(++j > GGLISTSIZE) |
| 1290 | return; |
| 1291 | sprintf(str, "%06X", i + (a & 0x1FFF) + 0x10); |
| 1292 | SendDlgItemMessage(hwndDlg, IDC_LIST_GGADDRESSES, LB_ADDSTRING, 0, (LPARAM)str); |
| 1293 | } |
| 1294 | } |
| 1295 | |
| 1296 | //A different model for this could be to have everything |
| 1297 | //set in the INITDIALOG message based on the internal |
no test coverage detected