Skip to content

Commit

Permalink
v1.04 rev3987 (10 Aug 2020)
Browse files Browse the repository at this point in the history
- More robust XA audio detection
- Support for saving images as TIFF in Java 9+
- Ignore silent XA streams
- Improved Tim detection, including
  Github issue #29 "TIM image not found in file" by gmarty
Bug fixes:
- Replacing XA with pcm audio doesn't actually make any changes,
  broken since v0.99.8
  (Github issue #30 '"-replacexa" command does not work' by ViToTiV)
- Real-time audio player doesn't play tiny clips
- Error when Tim image ends at sector boundary
- Sector type detection issues
  • Loading branch information
m35 committed Aug 11, 2020
1 parent afbc4ea commit b1c3787
Show file tree
Hide file tree
Showing 409 changed files with 2,638 additions and 1,778 deletions.
6 changes: 1 addition & 5 deletions jpsxdec/TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,12 @@ Games to investigate
* Star Wars - Rebel Assault II
* Discworld 2
* BrainDead 13
* Syphon Filter 3
* Love Games - Wai Wai Tennis [Service Price] [SLPS-01647] INTRO.STR
* Fear Effect
* Kowloon's Gate
* Jackie Chan Stuntmaster
* Firemen 2
* Magic the Gathering
* Aconcagua ending video
* Sentient
* Panekit
* Panekit - Infinitive Crafting Toy Case

Replace
with a prompt before applying changes
Expand Down
2 changes: 1 addition & 1 deletion jpsxdec/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<!-- ====== global build properties ====== -->

<property name="jpsxdec.ver" value="v1-03_rev3953"/>
<property name="jpsxdec.ver" value="v1-04_rev3987"/>

<!-- sources -->
<property name="src.dir.rel" location="src" relative="true"/>
Expand Down
13 changes: 13 additions & 0 deletions jpsxdec/doc/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
v1.04 rev3987 (10 Aug 2020)
- More robust XA audio detection
- Support for saving images as TIFF in Java 9+
- Ignore silent XA streams
- Improved Tim detection, including
Github issue #29 "TIM image not found in file" by gmarty
Bug fixes:
- Replacing XA with pcm audio doesn't actually make any changes,
broken since v0.99.8
(Github issue #30 '"-replacexa" command does not work' by ViToTiV)
- Real-time audio player doesn't play tiny clips
- Error when Tim image ends at sector boundary
- Sector type detection issues
v1.03 rev3953 (15 Dec 2019)
Bug fixes:
- Some videos in EA games are still not detected
Expand Down
2 changes: 1 addition & 1 deletion jpsxdec/doc/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

jPSXdec: PlayStation 1 Media Decoder/Converter in Java
Copyright (C) 2007-2019 Michael Sabin
Copyright (C) 2007-2020 Michael Sabin
All rights reserved.

jPSXdec is licensed as a whole under this non-commercial license:
Expand Down
19 changes: 19 additions & 0 deletions jpsxdec/jPSXdec-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,25 @@ style that makes this easy. Hunting for a solution, I ran across this
`ParagraphLayout`, and it has been absolutely brilliant.


# Memory use

jPSXdec reference graph is fairly simple.

The root for a disc in memory is `CdFileSectorReader` and `DiscIndex`.
Once a disc is loaded, no memory is allocated or released.
And once the `CdFileSectorReader` is closed and discarded, everything
associated with a disc is freed
(assuming nothing else is holding onto some exposed internal reference).

The UI is also pretty simple. Most is allocated once and never freed.
The real-time audio/video player is created and freed on every view.

The only memory growth that could be noticed would come from the
`DiscItemSaverBuilder` used to save every `DiscItem`. Initially each `DiscItems`'s
`DiscItemSaverBuilder` start as `null` and are only allocated when the disc item
is selected in the GUI. But that should be minimal. And once the disc is closed,
those are all freed as well.

# Appendix 1: Adding support for a new game

Other than the frame-rate detection limitations, jPSXdec has all the features to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public String getName() {

public void setMnemonic(String mnemonic) {
if (mnemonic != null && mnemonic.length() > 0) {
putValue(Action.MNEMONIC_KEY, new Integer(mnemonic.charAt(0)));
putValue(Action.MNEMONIC_KEY, Integer.valueOf(mnemonic.charAt(0)));
}
}

Expand All @@ -256,7 +256,7 @@ public void setMnemonic(String mnemonic) {
* @see Action#putValue
*/
public void setMnemonic(int mnemonic) {
putValue(Action.MNEMONIC_KEY, new Integer(mnemonic));
putValue(Action.MNEMONIC_KEY, Integer.valueOf(mnemonic));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ private ButtonGroup getGroup(String groupid, JComponent container) {
if (container != null) {
intCode ^= container.hashCode();
}
Integer hashCode = new Integer(intCode);
Integer hashCode = Integer.valueOf(intCode);

ButtonGroup group = groupMap.get(hashCode);
if (group == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void setCallback(String callback) {

// May throw a security exception in an Applet
// context.
Object obj = clz.newInstance();
Object obj = clz.getDeclaredConstructor().newInstance();

registerCallback(obj, elems[1]);
} catch (Exception ex) {
Expand Down
4 changes: 2 additions & 2 deletions jpsxdec/src-lgpl/org/jdesktop/swingx/action/ServerAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public String getURL() {

@SuppressWarnings("unchecked")
private Map<String, String> getParams() {
return (Map)getValue(PARAMS);
return (Map<String, String>)getValue(PARAMS);
}

private void setParams(Map<String, String> params) {
Expand Down Expand Up @@ -145,7 +145,7 @@ public Set<String> getParamNames() {

@SuppressWarnings("unchecked")
private Map<String, String> getHeaders() {
return (Map)getValue(HEADERS);
return (Map<String, String>)getValue(HEADERS);
}

private void setHeaders(Map<String, String> headers) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
package org.jdesktop.swingx.plaf.basic.core;


import java.lang.reflect.*;
import javax.swing.*;
import javax.swing.plaf.*;

Expand All @@ -35,131 +34,9 @@
* @author Scott Violet
*/
public class LazyActionMap extends ActionMapUIResource {
/**
* Object to invoke <code>loadActionMap</code> on. This may be
* a Class object.
*/
private transient Object _loader;

/**
* Installs an ActionMap that will be populated by invoking the
* <code>loadActionMap</code> method on the specified Class
* when necessary.
* <p>
* This should be used if the ActionMap can be shared.
*
* @param c JComponent to install the ActionMap on.
* @param loaderClass Class object that gets loadActionMap invoked
* on.
* @param defaultsKey Key to use to defaults table to check for
* existing map and what resulting Map will be registered on.
*/
public static void installLazyActionMap(JComponent c, Class loaderClass,
String defaultsKey) {
ActionMap map = (ActionMap)UIManager.get(defaultsKey);
if (map == null) {
map = new LazyActionMap(loaderClass);
UIManager.getLookAndFeelDefaults().put(defaultsKey, map);
}
SwingUtilities.replaceUIActionMap(c, map);
}

/**
* Returns an ActionMap that will be populated by invoking the
* <code>loadActionMap</code> method on the specified Class
* when necessary.
* <p>
* This should be used if the ActionMap can be shared.
*
* @param c JComponent to install the ActionMap on.
* @param loaderClass Class object that gets loadActionMap invoked
* on.
* @param defaultsKey Key to use to defaults table to check for
* existing map and what resulting Map will be registered on.
*/
static ActionMap getActionMap(Class loaderClass,
String defaultsKey) {
ActionMap map = (ActionMap)UIManager.get(defaultsKey);
if (map == null) {
map = new LazyActionMap(loaderClass);
UIManager.getLookAndFeelDefaults().put(defaultsKey, map);
}
return map;
}


private LazyActionMap(Class loader) {
_loader = loader;
}

public void put(Action action) {
put(action.getValue(Action.NAME), action);
}

public void put(Object key, Action action) {
loadIfNecessary();
super.put(key, action);
}

public Action get(Object key) {
loadIfNecessary();
return super.get(key);
}

public void remove(Object key) {
loadIfNecessary();
super.remove(key);
}

public void clear() {
loadIfNecessary();
super.clear();
}

public Object[] keys() {
loadIfNecessary();
return super.keys();
}

public int size() {
loadIfNecessary();
return super.size();
}

public Object[] allKeys() {
loadIfNecessary();
return super.allKeys();
}

public void setParent(ActionMap map) {
loadIfNecessary();
super.setParent(map);
}

@SuppressWarnings("unchecked")
private void loadIfNecessary() {
if (_loader != null) {
Object loader = _loader;

_loader = null;
Class klass = (Class)loader;
try {
Method method = klass.getDeclaredMethod("loadActionMap",
new Class[] { LazyActionMap.class });
method.invoke(klass, new Object[] { this });
} catch (NoSuchMethodException nsme) {
assert false : "LazyActionMap unable to load actions " +
klass;
} catch (IllegalAccessException iae) {
assert false : "LazyActionMap unable to load actions " +
iae;
} catch (InvocationTargetException ite) {
assert false : "LazyActionMap unable to load actions " +
ite;
} catch (IllegalArgumentException iae) {
assert false : "LazyActionMap unable to load actions " +
iae;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public Painter<JRendererCheckBox> getPainter() {
* {@inheritDoc}
*/
public void setPainter(Painter<JRendererCheckBox> painter) {
Painter old = getPainter();
Painter<JRendererCheckBox> old = getPainter();
this.painter = painter;
if (painter != null) {
// ui maps to !opaque
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public boolean isOpaque() {
* {@inheritDoc}
*/
public void setPainter(Painter<JRendererLabel> painter) {
Painter old = getPainter();
Painter<JRendererLabel> old = getPainter();
this.painter = painter;
firePropertyChange("painter", old, getPainter());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void setValueClass(Class<?> valueClass) {
/**
*
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
@SuppressWarnings({ "rawtypes" })
private void updateMinMax() {
Comparable min = null;
Comparable max = null;
Expand Down Expand Up @@ -93,14 +93,14 @@ private void updateMinMax() {
}


@SuppressWarnings({ "unchecked", "rawtypes" })
@SuppressWarnings({ "rawtypes" })
@Override
public void setMaximum(Comparable max) {
super.setMaximum(max);
this.maxAsBig = max != null ? new BigDecimal(max.toString()) : null;
}

@SuppressWarnings({ "unchecked", "rawtypes" })
@SuppressWarnings({ "rawtypes" })
@Override
public void setMinimum(Comparable minimum) {
super.setMinimum(minimum);
Expand Down Expand Up @@ -140,22 +140,22 @@ public Object stringToValue(String text) throws ParseException {
private Object convertValueToValueClass(Object value, Class<?> valueClass) {
if (valueClass != null && (value instanceof Number)) {
if (valueClass == Integer.class) {
return new Integer(((Number)value).intValue());
return Integer.valueOf(((Number)value).intValue());
}
else if (valueClass == Long.class) {
return new Long(((Number)value).longValue());
return Long.valueOf(((Number)value).longValue());
}
else if (valueClass == Float.class) {
return new Float(((Number)value).floatValue());
return Float.valueOf(((Number)value).floatValue());
}
else if (valueClass == Double.class) {
return new Double(((Number)value).doubleValue());
return Double.valueOf(((Number)value).doubleValue());
}
else if (valueClass == Byte.class) {
return new Byte(((Number)value).byteValue());
return Byte.valueOf(((Number)value).byteValue());
}
else if (valueClass == Short.class) {
return new Short(((Number)value).shortValue());
return Short.valueOf(((Number)value).shortValue());
}
}
return value;
Expand Down
Loading

0 comments on commit b1c3787

Please sign in to comment.