| 495 | }; |
| 496 | |
| 497 | int LoadUNIFChunks(FCEUFILE *fp) { |
| 498 | int x; |
| 499 | int t; |
| 500 | for (;; ) { |
| 501 | t = FCEU_fread(&uchead, 1, 4, fp); |
| 502 | if (t < 4) { |
| 503 | if (t > 0) |
| 504 | return 0; |
| 505 | return 1; |
| 506 | } |
| 507 | if (!(FCEU_read32le(&uchead.info, fp))) |
| 508 | return 0; |
| 509 | t = 0; |
| 510 | x = 0; |
| 511 | while (bfunc[x].name) { |
| 512 | if (!memcmp(&uchead, bfunc[x].name, strlen(bfunc[x].name))) { |
| 513 | if (!bfunc[x].init(fp)) |
| 514 | return 0; |
| 515 | t = 1; |
| 516 | break; |
| 517 | } |
| 518 | x++; |
| 519 | } |
| 520 | if (!t) |
| 521 | if (FCEU_fseek(fp, uchead.info, SEEK_CUR) < 0) |
| 522 | return(0); |
| 523 | } |
| 524 | } |
| 525 | |
| 526 | static int InitializeBoard(void) { |
| 527 | int x = 0; |
no test coverage detected