| 166 | |
| 167 | |
| 168 | void Patch_PatchAll() |
| 169 | { |
| 170 | gNumOfOSFunctions = 0; |
| 171 | |
| 172 | if (!gPatchesApplied) |
| 173 | { |
| 174 | Patch_ApplyPatches(); |
| 175 | } |
| 176 | #ifdef DUMPOSFUNCTIONS |
| 177 | FILE *fp; |
| 178 | IO::Filename path; |
| 179 | Dump_GetDumpDirectory(path, ""); |
| 180 | IO::Path::Append(path, "n64.cfg"); |
| 181 | fp = fopen(path, "w"); |
| 182 | #endif |
| 183 | for (u32 i = 0; i < nPatchSymbols; i++) |
| 184 | { |
| 185 | if (g_PatchSymbols[i]->Found) |
| 186 | { |
| 187 | #ifdef DUMPOSFUNCTIONS |
| 188 | IO::Filename buf; |
| 189 | PatchSymbol * ps = g_PatchSymbols[i]; |
| 190 | Dump_GetDumpDirectory(buf, "oshle"); |
| 191 | IO::Path::Append(buf, ps->Name); |
| 192 | |
| 193 | Dump_Disassemble(PHYS_TO_K0(ps->Location), PHYS_TO_K0(ps->Location) + ps->Signatures->NumOps * sizeof(OpCode), |
| 194 | buf); |
| 195 | |
| 196 | fprintf(fp, "%s 0x%08x\n", ps->Name, PHYS_TO_K0(ps->Location)); |
| 197 | #endif |
| 198 | gNumOfOSFunctions++; |
| 199 | Patch_ApplyPatch(i); |
| 200 | } |
| 201 | } |
| 202 | #ifdef DUMPOSFUNCTIONS |
| 203 | fclose(fp); |
| 204 | #endif |
| 205 | } |
| 206 | |
| 207 | void Patch_ApplyPatch(u32 i) |
| 208 | { |
no test coverage detected