Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.
Zero Tolerance for Disrespect

the Punisher 2005 xbox version XEG TGA

Featured Replies

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

Solved by h3x3r

  • Supporter

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

  • Supporter
  • Solution

image.thumb.png.c2d6af4d76112e95b45506a3668b0638.png

But can't produce right width/height. It's 250 x 391 px.

  • 3 months later...
  • Author

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

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.