Permalink
Browse files

Always store the GE in a 32-bit texture, 16-bit textures are causing …

…color artifacts.
  • Loading branch information...
gid15 committed Aug 11, 2014
1 parent d237620 commit bd71f284cb93323a4a971bb54481a9983c3fc398
Showing with 13 additions and 2 deletions.
  1. +3 −0 src/jpcsp/HLE/modules150/sceDisplay.java
  2. +10 −2 src/jpcsp/graphics/textures/GETextureManager.java
@@ -2174,6 +2174,9 @@ public int sceDisplayGetBrightness(int leveladdr, int unkaddr) {
@HLEFunction(nid = 0x9C6EAAD7, version = 150)
public int sceDisplayGetVcount() {
if (log.isDebugEnabled()) {
log.debug(String.format("sceDisplayGetVcount returning %d", vcount));
}
// 60 units per second
return vcount;
}
@@ -63,30 +63,38 @@ private GETexture checkGETexturePSM8888(int address, int bufferWidth, int width,
return geTexture;
}
private int getGePixelFormat(int pixelFormat) {
// Always use a 32-bit texture to store the GE.
// 16-bit textures are causing color artifacts.
return GeCommands.TPSM_PIXEL_STORAGE_MODE_32BIT_ABGR8888;
}
public GETexture getGETexture(IRenderingEngine re, int address, int bufferWidth, int width, int height, int pixelFormat, boolean useViewportResize) {
int gePixelFormat = getGePixelFormat(pixelFormat);
GETexture geTexture = checkGETexturePSM8888(address, bufferWidth, width, height, pixelFormat);
if (geTexture == null) {
geTexture = checkGETexture(address, bufferWidth, width, height, pixelFormat);
}
if (geTexture == null) {
Long key = getKey(address, bufferWidth, width, height, pixelFormat);
geTexture = new GETexture(address, bufferWidth, width, height, pixelFormat, useViewportResize);
geTexture = new GETexture(address, bufferWidth, width, height, gePixelFormat, useViewportResize);
geTextures.put(key, geTexture);
}
return geTexture;
}
public GETexture getGEResizedTexture(IRenderingEngine re, GETexture baseGETexture, int address, int bufferWidth, int width, int height, int pixelFormat) {
int gePixelFormat = getGePixelFormat(pixelFormat);
GETexture geTexture = checkGETexturePSM8888(address, bufferWidth, width, height, pixelFormat);
if (geTexture == null) {
geTexture = checkGETexture(address, bufferWidth, width, height, pixelFormat);
}
if (geTexture == null) {
Long key = getKey(address, bufferWidth, width, height, pixelFormat);
geTexture = new GEResizedTexture(baseGETexture, address, bufferWidth, width, height, pixelFormat);
geTexture = new GEResizedTexture(baseGETexture, address, bufferWidth, width, height, gePixelFormat);
geTextures.put(key, geTexture);
}

0 comments on commit bd71f28

Please sign in to comment.