Esempio n. 1
0
File: Core.java Progetto: Osmose/sno
 public static void renderScreen() {
   CGRAM.readColors();
   CGRAM.testColors();
   Sprites.dumpOBJ();
 }
Esempio n. 2
0
  @Override
  public void actionPerformed(ActionEvent e) {
    System.out.println(e.getActionCommand());
    if (e.getActionCommand().equals("Open")) {
      FileDialog fd = new FileDialog(new Frame(), "Choose a rom file", FileDialog.LOAD);
      fd.setVisible(true);

      String file = fd.getFile();
      String dir = fd.getDirectory();

      if (file != null) {
        if (dir != null) {
          file = dir.concat(file);
        }

        InputStream is = null;
        boolean isZip = file.endsWith(".zip");
        try {
          is = new FileInputStream(file);
        } catch (FileNotFoundException e1) {

        }

        if (is != null) {
          runGame(is, isZip);
        } else {
          System.out.println("File '" + file + "' not found!");
        }
      }
    }

    if (e.getActionCommand().equals("About")) {
      JOptionPane.showMessageDialog(
          getContentPane(),
          "Created By: Keith Johnson, Mike Kelly, and Eric Wells\r\nhttps://cs.fit.edu/proxy/proj/sno/",
          "About us!",
          JOptionPane.INFORMATION_MESSAGE);
    }
    if (e.getActionCommand().equals("Options")) {
      Core.pause = true;
      layout.show(getContentPane(), "Options");
    } else if (e.getActionCommand().equals("Input")) {
      Core.pause = true;
      layout.show(getContentPane(), "Input");
    }

    if (e.getActionCommand().equals("Dump APU RAM")) {
      APUMemory.dump();
    } else if (e.getActionCommand().equals("Reset APU")) {
      APU.debugReset();
    } else if (e.getActionCommand().equals("Dump VRAM")) {
      PPU.dumpVRAM();
    } else if (e.getActionCommand().equals("Dump WRAM")) {
      Core.mem.dumpWRAM();
    } else if (e.getActionCommand().equals("Dump Sprites")) {
      Sprites.dumpSpriteData();
    } else if (e.getActionCommand().equals("Dump OBJs")) {
      Sprites.dumpOBJ();
    } else if (e.getActionCommand().equals("BG Status")) {
      System.out.println(PPU.bg[0].toString());
      System.out.println(PPU.bg[1].toString());
      System.out.println(PPU.bg[2].toString());
      System.out.println(PPU.bg[3].toString());
    } else if (e.getActionCommand().equals("Dump Palette")) {
      CGRAM.dumpCGRAM();
      CGRAM.testColors();
    } else if (e.getActionCommand().equals("Dump BGs")) {
      PPU.bg[0].dumpBGGraphics();
      PPU.bg[1].dumpBGGraphics();
      PPU.bg[2].dumpBGGraphics();
      PPU.bg[3].dumpBGGraphics();
    } else if (e.getActionCommand().equals("Output Hex Colors")) {
      CGRAM.outputHexColors();
    } else if (e.getActionCommand().equals("Toggle Logging")) {
      Log.setLogEnabled(!Log.enabled);
    } else if (e.getActionCommand().equals("Dump Tiles")) {
      OAM.dumpTiles();
    } else if (e.getActionCommand().equals("Toggle IRQ")) {
      CPU.userDisableIRQ = !CPU.userDisableIRQ;
    }
  }