Exemple #1
0
  public void loadROM(ROM rom) {

    // System.out.println("Loading ROM.");

    if (!rom.isValid()) {
      // System.out.println("MMC3: Invalid ROM! Unable to load.");
      return;
    }

    // Load hardwired PRG banks (0xC000 and 0xE000):
    load8kRomBank(((nes.getRom().getRomBankCount() - 1) * 2), 0xC000);
    load8kRomBank(((nes.getRom().getRomBankCount() - 1) * 2) + 1, 0xE000);

    // Load swappable PRG banks (0x8000 and 0xA000):
    load8kRomBank(0, 0x8000);
    load8kRomBank(1, 0xA000);

    // Load CHR-ROM:
    loadCHRROM();

    // Load Battery RAM (if present):
    loadBatteryRam();

    // Do Reset-Interrupt:
    // nes.getCpu().doResetInterrupt();
    nes.getCpu().requestIrq(CPU.IRQ_RESET);
  }