public static void writeToCurrentMapper(ushort address, byte value) { if (Core.rom != null) { int mapperSetting = Core.rom.getMapperSetting(); if (mapperSetting == 1) { MMC1.writeMMC1(address, value); } else if (mapperSetting == 2) { UNROM.writeUNROM(address, value); } else if (mapperSetting == 3) { CNROM.writeCNROM(address, value); } else if (mapperSetting == 4) { MMC3.writeMMC3(address, value); } } }