romNameTf.setText("<NO CARTRIDGE INSERTED>");
romFormatLb.setListData(new Object[0]);
romFormatLb.setEnabled(false);
defaultsB.setVisible(false);
} else {
Cartridge cart = room.currentConsole().cartridgeSocket().inserted();
romNameTf.setText(cart.rom().info.name);
romNameTf.setCaretPosition(0);
ArrayList<CartridgeFormat> formats = new ArrayList<CartridgeFormat>();
try {
ArrayList<CartridgeFormatOption> formatOptions;
formatOptions = CartridgeDatabase.getFormatOptions(cart.rom());
for (CartridgeFormatOption option : formatOptions)
formats.add(option.format);
} catch (ROMFormatUnsupportedException e) {
// Leave formats empty
}
if (!formats.contains(cart.format())) formats.add(0, cart.format());
romFormatLb.setListData(formats.toArray());
romFormatLb.setSelectedValue(cart.format(), true);
romFormatLb.setEnabled(!formats.isEmpty() && !room.isClientMode());
defaultsB.setText("Auto Detect");
defaultsB.setVisible(!room.isClientMode());
}
refreshInProgress = false;