示例#1
0
  public static void makeUMDSFO(
      String filename,
      String discID,
      String discVersion,
      String systemVersion,
      String title,
      int parentalLevel)
      throws IOException {

    ByteBuffer buffer = ByteBuffer.allocate(0x10000);
    PSF psf = new PSF();

    psf.put("BOOTABLE", 1);
    psf.put("CATEGORY", "UG");
    psf.put("DISC_ID", discID, 16);
    psf.put("DISC_NUMBER", 1);
    psf.put("DISC_TOTAL", 1);
    psf.put("DISC_VERSION", discVersion);
    psf.put("PARENTAL_LEVEL", parentalLevel);
    psf.put("PSP_SYSTEM_VER", systemVersion);
    psf.put("REGION", 32768);
    psf.put("TITLE", title, 128);

    psf.write(buffer);
    byte[] data = new byte[psf.size()];
    buffer.position(0);
    buffer.get(data);

    FileOutputStream fos = new FileOutputStream(filename);
    fos.write(data);
    fos.close();
  }