Package org.javatari.atari.cartridge

Examples of org.javatari.atari.cartridge.Cartridge


  }
 
  public void morphToStandaloneMode() {
    if (isStandaloneMode()) return;
    powerOff();
    Cartridge lastCartridge = isClientMode() ? cartridgeProvided : currentConsole.cartridgeSocket().inserted();
    if (standaloneConsole == null) buildAndPlugStandaloneConsole();
    else plugConsole(standaloneConsole);
    adjustPeripheralsToStandaloneOrServerOperation();
    currentConsole.cartridgeSocket().insert(lastCartridge, false);
    powerOn();
View Full Code Here


  }

  public void morphToServerMode() {
    if (isServerMode()) return;
    powerOff();
    Cartridge lastCartridge = isClientMode() ? cartridgeProvided : currentConsole.cartridgeSocket().inserted();
    if (serverConsole == null) buildAndPlugServerConsole();
    else plugConsole(serverConsole);
    adjustPeripheralsToStandaloneOrServerOperation();
    currentConsole.cartridgeSocket().insert(lastCartridge, false);
    powerOn();
View Full Code Here

    }
    @Override
    public boolean importData(TransferSupport support) {
      if (!canImport(support)) return false;
      monitor.showOSD("LOADING CARTRIDGE...", true);
      Cartridge cart = ROMTransferHandlerUtil.importCartridgeData(support.getTransferable());
      monitor.showOSD(null, true);
      if (cart == null) return false;
      // LINK Action means load Cartridge without auto power! :-)
      boolean autoPower = !support.isDrop() || support.getDropAction() != LINK;
      monitor.cartridgeInsert(cart, autoPower);
View Full Code Here

  }

  private void loadCartridgeFromFile(boolean autoPower) {
    if (cartridgeChangeDisabledWarning()) return;
    display.displayLeaveFullscreen();
    Cartridge cart = null;
    try {
      File file = FileROMChooser.chooseFileToLoad();
      if (file != null) cart = ROMLoader.load(file);
    } catch (AccessControlException e) {
      // Automatically tries FileServiceChooser if access is denied
View Full Code Here

  }

  private void loadCartridgeFromURL(boolean autoPower) {
    if (cartridgeChangeDisabledWarning()) return;
    display.displayLeaveFullscreen();
    Cartridge cart = null;
    String url = URLROMChooser.chooseURLToLoad();
    if (url != null) cart = ROMLoader.load(url, false);
    if (cart != null) cartridgeInsert(cart, autoPower);
    else display.displayRequestFocus();
  }
View Full Code Here

    if (cartridgeChangeDisabledWarning()) return;
    try {
      Clipboard clip = Toolkit.getDefaultToolkit().getSystemClipboard();
      Transferable transf = clip.getContents("Ignored");
      if (transf == null) return;
      Cartridge cart = ROMTransferHandlerUtil.importCartridgeData(transf);
      if (cart != null) cartridgeInsert(cart, true);
    } catch (Exception ex) {
      // Simply give up
    }
  }
View Full Code Here

    }
    @Override
    public boolean importData(TransferSupport support) {
      if (!canImport(support)) return false;
      monitorPanel.monitor().showOSD("LOADING CARTRIDGE...", true);
      Cartridge cart = ROMTransferHandlerUtil.importCartridgeData(support.getTransferable());
      monitorPanel.monitor().showOSD(null, true);
      if (cart == null) return false;
      // LINK Action means load Cartridge without auto power! :-)
      boolean autoPower = !support.isDrop() || support.getDropAction() != LINK;
      monitorPanel.monitor().cartridgeInsert(cart, autoPower);
View Full Code Here

    for (CartridgeFormatOption option : options)
      if (option.format.equals(cartridge().format())) currOption = option;
    int pos = options.indexOf(currOption) + 1;    // cycle through options
    if (pos >= options.size()) pos = 0;
    CartridgeFormatOption newOption = options.get(pos);
    Cartridge newCart = newOption.format.createCartridge(cartridge().rom());
    cartridgeSocket().insert(newCart, true);
    showOSD(newOption.format.toString(), true);
  }
View Full Code Here

      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;
View Full Code Here

  private void romFormatLbAction() {
    Object sel = romFormatLb.getSelectedValue();
    if (sel == null || !(sel instanceof CartridgeFormat)) return;
    CartridgeFormat format = (CartridgeFormat) sel;
    Console console = room.currentConsole();
    Cartridge cart = console.cartridgeSocket().inserted();
    if (cart == null || cart.format().equals(format)) return;
    Cartridge newCart = format.createCartridge(cart.rom());
    console.cartridgeSocket().insert(newCart, true);
  }
View Full Code Here

TOP

Related Classes of org.javatari.atari.cartridge.Cartridge

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.