Skip to content

Commit

Permalink
Always store the GE in a 32-bit texture, 16-bit textures are causing …
Browse files Browse the repository at this point in the history
…color artifacts.
  • Loading branch information
gid15 committed Aug 11, 2014
1 parent d237620 commit bd71f28
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/jpcsp/HLE/modules150/sceDisplay.java
Expand Up @@ -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;
}
Expand Down
12 changes: 10 additions & 2 deletions src/jpcsp/graphics/textures/GETextureManager.java
Expand Up @@ -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);
}

Expand Down

0 comments on commit bd71f28

Please sign in to comment.