Jump to content

the Punisher 2005 xbox version XEG TGA


Go to solution Solved by h3x3r,

Recommended Posts

Posted

Hello! I want to localize comic book covers in punisher game 2005 for the platform xbox original.  I need help with images that are stored in xeg format. I know there is specialized software to work with ceg for the PC version. I also know peg (ps2) scripts. But neither is compatible with this xeg format... I know that tga files are stored inside. Can someone tell you how to be with this format or there is universal software for such files??? 
Would appreciate

  • Moderators
Posted

For extracting raw data from archives you can use the same script you linked (punisher_ps2_peg.bms)
as archive file format is the same across all platforms https://rewiki.miraheze.org/wiki/The_Punisher_CEG_PEG_XEG

The difference is in the image encoding, PC version uses standard DXT5 or RGBA8888, while encoding seems to be different on PS2 and XBOX.
I was not able to find correct setting with ImageHeat.

Here's how it looks for PC sample:

punisher1.thumb.PNG.ff430a2f95ef24a2c210d620ff6c2d34.PNG

  • Like 1
  • 3 months later...
Posted (edited)

Texture param:
res: 512x256 
start offset: 1024
Pixel Format PAL8
Swizzling type Xbox\ps3 liner
Palette format BGRA8888

image.thumb.png.df083998ebc9fff83e9945c3d102107b.png

This script for insert to raw. 

Spoiler

from inc_noesis import *

def registerNoesisTypes():
    handle = noesis.register("The Punisher xbox font raw", ".raw")
    noesis.setHandlerTypeCheck(handle, noepyCheckType)
    noesis.setHandlerLoadRGBA(handle, noepyLoadRGBA)
    noesis.setHandlerWriteRGBA(handle, texWriteRGBA)
    return 1

def noepyCheckType(data):
    return 1
def noepyLoadRGBA(data, texList):
    bs = NoeBitStream(data)
    width = 256
    height = 512
    palette = bs.readBytes(1024)
    pixel = bs.readBytes(width*height)
    pixel = rapi.imageFromMortonOrder(pixel,width,height,1)
    textureData = rapi.imageDecodeRawPal(pixel,palette,width,height,8,"b8g8r8p8") #BGRX888X 24bit
    
    #Im not test in game, if is BGRA8888 32bit just Remove "#"
    #textureData = rapi.imageDecodeRawPal(pixel,palette,width,height,8,"b8g8r8a8") #BGRA8888 32bit
    
    texList.append(NoeTexture("font", width, height, textureData, noesis.NOESISTEX_RGBA32))
    
    return 1

def texWriteRGBA(data, width, height, bs):
    if width != 256 and height != 512:
        print("Can't export. width and height not equal 256")        
        return 0
    imgPal = rapi.imageGetPalette(data, width, height, 256, 0, 1)
    idxPix = rapi.imageApplyPalette(data, width, height, imgPal, 256)
    for i in range(0,256):
        bs.writeUByte(imgPal[i*4+2])
        bs.writeUByte(imgPal[i*4+1])
        bs.writeUByte(imgPal[i*4+0])
        bs.writeUByte(imgPal[i*4+3]) 
    idxPix = rapi.imageToMortonOrder(idxPix,width,height,1)
    bs.writeBytes(idxPix)
    print("Export done!")
    return 1

Thank you for help h3x3r ikskoks !

Edited by smith1395
  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...