| 317 | } |
| 318 | |
| 319 | static void read_counts (void) |
| 320 | { |
| 321 | FILE *file; |
| 322 | unsigned int opcode, count, total; |
| 323 | char name[20]; |
| 324 | int nr = 0; |
| 325 | memset (counts, 0, 65536 * sizeof *counts); |
| 326 | |
| 327 | count = 0; |
| 328 | file = fopen ("frequent.68k", "r"); |
| 329 | if (file) { |
| 330 | if (fscanf (file, "Total: %u\n", &total) == 0) { |
| 331 | abort(); |
| 332 | } |
| 333 | while (fscanf (file, "%x: %u %s\n", &opcode, &count, name) == 3) { |
| 334 | opcode_next_clev[nr] = 5; |
| 335 | opcode_last_postfix[nr] = -1; |
| 336 | opcode_map[nr++] = opcode; |
| 337 | counts[opcode] = count; |
| 338 | } |
| 339 | fclose (file); |
| 340 | } |
| 341 | if (nr == nr_cpuop_funcs) |
| 342 | return; |
| 343 | for (opcode = 0; opcode < 0x10000; opcode++) { |
| 344 | if (table68k[opcode].handler == -1 && table68k[opcode].mnemo != i_ILLG |
| 345 | && counts[opcode] == 0) |
| 346 | { |
| 347 | opcode_next_clev[nr] = 5; |
| 348 | opcode_last_postfix[nr] = -1; |
| 349 | opcode_map[nr++] = opcode; |
| 350 | counts[opcode] = count; |
| 351 | } |
| 352 | } |
| 353 | if (nr != nr_cpuop_funcs) |
| 354 | term(); |
| 355 | } |
| 356 | |
| 357 | static int genamode_cnt, genamode8r_offset[2]; |
| 358 | static int set_fpulimit; |
no test coverage detected