Editing sprites and other images

Investigating, documenting, and reverse-engineering SaGa Frontier.

Editing sprites and other images

Postby Mir_Vimes » Sun Jan 29, 2012 9:43 am

The attachment sf_file_map.7z contains two plain text files. The plain text file saga_frontier_1_disk_map.txt contains Tile Molester settings for viewing many of the images - some of which are sprites - found in SaGa Frontier.

The attachment image_extraction_screencaps.7z has two folders in it. One folder has a bunch of PNG images which show you how to configure Tile Molester to view images in SaGa Frontier, and the other folder has a bunch of PNG images which show you how to point Tile Molester to the palettes in some of images in SaGa Frontier (note that the palettes aren't always in the same place in every file).
Attachments
image_extraction_screencaps.7z
a bunch of PNG images, in a 7z compressed archive
(1013.64 KiB) Downloaded 110 times
sf_file_map.7z
two plain text files, in a 7z compressed archive
(5.83 KiB) Downloaded 61 times
http://sf.data.project.tripod.com/

Biolab File Hosting

"Don't assume that you'll get endless chances. However much that person previously loved you, if that love stops because of your actions it's nearly impossible to get it back."
User avatar
Mir_Vimes
 
Posts: 429
Joined: Sat Jan 28, 2012 7:24 am
Location: Xibalba

Re: Editing sprites and other images

Postby Mir_Vimes » Thu Feb 02, 2012 11:34 am

Got some replies from the kind folks at romhacking.net.

From Vanished One:
Vanished One wrote:IMF###.TEX: 4-byte header, followed by 16x16 tile data, 8bpp. (Palettes are in the last section of the corresponding IMG files; I never fully worked out that section, since I ran out of free time, but it shouldn't be tricky.) Header generally begins 0x08, 0x40; then the other 2 bytes are (length of file after header in bytes/0x10). You were looking at the wrong Qhimm thread; it's not a relative of FF7PC TEX.

Tilemap layouts are also in an IMG file section.

I don't know offhand whether BESTAFF0.TEX is in the same format or just has the same extension.

I haven't had time to work on this for ages, so instead of replying to me you're best off talking to the http://www.gamefaqs.com/boards/198537-saga-frontier crowd; Eroneous [sic] Waylay has access to my notes (very loose/incomplete & not necessarily without errors).


Tauwasser PMed me in reply to the following topic:
http://www.romhacking.net/forum/index.php/topic,13915
But I don't completely understand his reply. I'll post his replies here, I guess, and we'll see how it goes.

Tauwasser said:
Tauwasser wrote:
Creeperton, AKA Mir_Vimes wrote:The link below is an archive which contains five files from SaGa Frontier. These files are monster sprites and data, for the first five monsters in the game. For the life of me, I can't figure out where the sprites and palettes end and the data (stats, equipment, abilities) begins, so I'm posting it here in case anyone wants to take a look.

Tile Molester settings, to the best of my knowledge:
4bpp Linear, Reverse Order
Canvas Size = Columns 32, Rows 16

I need someone to tell me exactly where sprite and palette data ends, and enemy data begins.

I think this info is all wrong... I couldn't make anything out using these settings. I think the settings should be 2dimensional linear 8bpp at 32x15 or maybe 15 or 16bpp at 16x16. This way, I could make out graphics in files 0 and 3 or the first archive file ("Rocky"?). What makes you think there are palettes in there? Nothing jumped me as being a typical palette layout... There is only one small enough file to arrant the suspicion of it being a palette: 0x30 bytes in each of the archives. However, the data starts off with increasing values, so it might be tilemaps or strings...

I used 010 editor to split the files up. See below.

Creeperton, AKA Mir_Vimes wrote:My other request: I need something which will go through every file in a directory, and remove everything but the last (n) bytes from all the files in that directory.

Again, it's for SaGa Frontier. When Square decided to create the enemy listings, they put the enemy sprites and data together, with the sprites before the data. The problem with this? Sprites can be any size. So, if I want to dump monster data without having to count backwards from the end of all 255 monster files (and deal with the inevitable mistakes made when manually typing out a data dump), I need something that will cut all but the last (insert arbitrary number here) bytes of every file in a directory.

I doubt anything like this exists, so consider this a programming request.


Many hex editors have a command-line interface or even better a scripting interface. Again, I assume 010 Editor here, but there are probably other tools out there that can do as much.

I packed an archive or three files for you: Two 010 editor scripts and a batch file example (using your requirements to cut n bytes off). You should be able to adapt the example to split all your archives into individual files that way.

Download here

Also, there are two pictures in there for your enjoyment.

cYa,

Tauwasser
http://sf.data.project.tripod.com/

Biolab File Hosting

"Don't assume that you'll get endless chances. However much that person previously loved you, if that love stops because of your actions it's nearly impossible to get it back."
User avatar
Mir_Vimes
 
Posts: 429
Joined: Sat Jan 28, 2012 7:24 am
Location: Xibalba

Re: Editing sprites and other images

Postby Mir_Vimes » Thu Feb 02, 2012 11:38 am

My reply to Tauwasser:
creeperton, aka Mir_Vimes wrote:
Tauwasser wrote:I think this info is all wrong... I couldn't make anything out using these settings. I think the settings should be 2dimensional linear 8bpp at 32x15 or maybe 15 or 16bpp at 16x16. This way, I could make out graphics in files 0 and 3 or the first archive file ("Rocky"?).

Thanks, first post updated. I'll tell everyone at the Biolab about it. And M000.ARC is a "Rocky", though I don't know why it's called that.

Tauwasser wrote:What makes you think there are palettes in there? Nothing jumped me as being a typical palette layout... There is only one small enough file to arrant the suspicion of it being a palette: 0x30 bytes in each of the archives. However, the data starts off with increasing values, so it might be tilemaps or strings...

I'm pretty sure there's a palette in there somewhere because that's how every other sprite in SaGa Frontier on whom we have palette info is organized.

You should be able to tell if there's palette info in these files by running them through PSicture (Linux user here, can't do it myself). If they come out not looking like rainbow colored barf, then they have an internal palette, and if you can find any info about the formats PSicture reads, then you can find out what the file really is (*.ARC is misdirection, or some internal organization scheme Square used to make the game, I think).

http://www.verve-fanworks.com/SMF/index.php?topic=479.0
^Topic about SaGa Frontier 2, which you may find useful.

http://www.verve-fanworks.com/SMF/index.php?topic=276.0
^A topic about other snippets of sprites in SaGa Frontier. Yes, Square did not think far enough ahead to make a single sprite sheet for every character. There are literally dozens of sprites for every character in the game, all over the place.

But all this finding the palette shit is extracurricular. I just need to know where the images and palettes end, and where the enemy data probably begins.
http://sf.data.project.tripod.com/

Biolab File Hosting

"Don't assume that you'll get endless chances. However much that person previously loved you, if that love stops because of your actions it's nearly impossible to get it back."
User avatar
Mir_Vimes
 
Posts: 429
Joined: Sat Jan 28, 2012 7:24 am
Location: Xibalba

Re: Editing sprites and other images

Postby Mir_Vimes » Thu Feb 02, 2012 11:49 am

Tauwasser's reply to me:
Tauwasser wrote:
creeperton, AKA Mir_Vimes wrote:I'm pretty sure there's a palette in there somewhere because that's how every other sprite in SaGa Frontier on whom we have palette info is organized.

Ok, I originally ruled out file 1 as a palette, because it starts off so linearly. However, they have color gradients for everything. So basically:


  • File0: Sprite Sheet
  • File1: Palette 15bpp BGR (555) LE //Maybe there is a transparency flag in there. Some entries have their highest bit set to 1 instead of zero.
  • File2: ?
  • File3: Big Sprite (shares palette file 1)
  • File4: ?
  • File5: ?
  • File6: ?
  • File7: ?
  • File8: ?
  • File9: ?

Here's what I pieced together in some minutes (I might have missed a belly piece):

Image

The only important thing for gfx is: 2d 8bpp canvas width 32 tiles at 8px width. I just mentioned the height because one of the images was smaller than 16 rows.

creeperton, AKA Mir_Vimes wrote:you can find out what the file really is (*.ARC is misdirection, or some internal organization scheme Square used to make the game, I think).


Well ARC stands for ARChive and that's really all there is to it. You shouldn't look at nor edit the ARC directly. Unpack it, edit files, repack them. You can write a similar script for 010 Editor to pack the files as I used to unpack them. Or for your favorite hex editor on Linux.

creeperton, AKA Mir_Vimes wrote:I just need to know where the images and palettes end, and where the enemy data probably begins.


Well, I already gave you a 010 Editor script that separates the files in the archive into individual files. Basically, you will have to figure out what files 2, 4 through 9 are on your own. They are in the ARC linearly, so file 5 comes before file 6 ... comes before file 9. So if you're sure the enemy data is at the very end, I suggest you check out files 8 and 9.

cYa,

Tauwasser
http://sf.data.project.tripod.com/

Biolab File Hosting

"Don't assume that you'll get endless chances. However much that person previously loved you, if that love stops because of your actions it's nearly impossible to get it back."
User avatar
Mir_Vimes
 
Posts: 429
Joined: Sat Jan 28, 2012 7:24 am
Location: Xibalba

Re: Editing sprites and other images

Postby DoomSwell » Thu Feb 02, 2012 11:55 am

"I need something that will cut all but the last (insert arbitrary number here) bytes of every file in a directory."

Don't hate me for saying this, but just from looking at one Perl tutorial last night, I almost know how to do this.

Open FILE (>>data.txt);
$lines S/[HowManyBytesYouWantToKeep]$/ = @copy
Close FILE
Open NEWFILE (>>newdata.txt);
Print $lines @copy"\n"
Close NEWFILE

Just a guess, don't use it.
User avatar
DoomSwell
 
Posts: 44
Joined: Sat Jan 28, 2012 12:02 pm
Location: Nybelheim
Title: Lone Defender

Re: Editing sprites and other images

Postby Mir_Vimes » Thu Feb 02, 2012 12:04 pm

http://www.sweetscape.com/010editor/
^The 010 editor, the hex editor Tauwasser coded the *.ARC file extractor for.

The archive attached to this post contains the following files:
*SagaFrontierArc.1sc
**A script for 010 editor, which extracts files from *.ARC archives.
*CutBytes.1sc
**A script for 010 editor, which cuts the last (n) bytes from a file.
*cutBytes.bat
**I don't know what this is, but I assume it goes with CutBytes.1sc.
*M000.ARC_file0.png
**A preview of an extracted file.
*M000.ARC_file3.png
**Another preview of an extracted file.

DoomSwell wrote:"I need something that will cut all but the last (insert arbitrary number here) bytes of every file in a directory."

Don't hate me for saying this, but just from looking at one Perl tutorial last night, I almost know how to do this.

Open FILE (>>data.txt);
$lines S/[HowManyBytesYouWantToKeep]$/ = @copy
Close FILE
Open NEWFILE (>>newdata.txt);
Print $lines @copy"\n"
Close NEWFILE

Just a guess, don't use it.

HHHHHHHHHHHAAAAAAAAAAAAATTTTTTTTTTTEEEEEEEEEEEE

And, seriously, if you can code a cross-platform image extractor for SaGa Frontier, I'll love you forever.
Attachments
arc_file_extraction_tools.zip
A zip archive
(15.16 KiB) Downloaded 30 times
http://sf.data.project.tripod.com/

Biolab File Hosting

"Don't assume that you'll get endless chances. However much that person previously loved you, if that love stops because of your actions it's nearly impossible to get it back."
User avatar
Mir_Vimes
 
Posts: 429
Joined: Sat Jan 28, 2012 7:24 am
Location: Xibalba

Re: Editing sprites and other images

Postby DoomSwell » Thu Feb 02, 2012 12:08 pm

cutBytes.bat is the "program" (think .exe) to run CutBytes.1sc

I think.
User avatar
DoomSwell
 
Posts: 44
Joined: Sat Jan 28, 2012 12:02 pm
Location: Nybelheim
Title: Lone Defender

Re: Editing sprites and other images

Postby Mir_Vimes » Thu Feb 02, 2012 12:44 pm

Probably.
*shrugs*
Want me to add that to my previous post?

Tomorrow, I'll see if I can turn the 010 deARC script into a BASH script for linux users, and into an xvi32 script for fans of that hex editor.
http://sf.data.project.tripod.com/

Biolab File Hosting

"Don't assume that you'll get endless chances. However much that person previously loved you, if that love stops because of your actions it's nearly impossible to get it back."
User avatar
Mir_Vimes
 
Posts: 429
Joined: Sat Jan 28, 2012 7:24 am
Location: Xibalba

Re: Editing sprites and other images

Postby Mir_Vimes » Fri Feb 03, 2012 11:42 am

My reply to Tauwasser:
creeperton, AKA Mir_Vimes wrote:Ah, I get it now. I had to reread all your message six or seven times while I formatted them for posting at the Biolab. Are you okay with that, and with me posting your scripts and whatnot, provided I link to the original download and credit you?

Could you provide a technical explanation for how *.ARC files were compressed, should we someday have someone to code a sprite extractor or editor? I don't have to understand it, it will be something to copy and paste for future reference.

I use the hex editor, XVI32. It works fine in Wine. I'm trying to annoy the author of XVI32 into Linux compatibility, and I'm making slow progress. I run Linux Mint 10, which is derived from one of the Ubuntus. I'm not sure that 010 editor will work with Wine, but I'm betting it will.

Thanks for taking the time to help us!
http://sf.data.project.tripod.com/

Biolab File Hosting

"Don't assume that you'll get endless chances. However much that person previously loved you, if that love stops because of your actions it's nearly impossible to get it back."
User avatar
Mir_Vimes
 
Posts: 429
Joined: Sat Jan 28, 2012 7:24 am
Location: Xibalba

Re: Editing sprites and other images

Postby Mir_Vimes » Fri Feb 03, 2012 11:43 am

Tauwasser's reply to me:
Tauwasser wrote:
creeperton, AKA Mir_Vimes wrote:Ah, I get it now. I had to reread all your message six or seven times while I formatted them for posting at the Biolab. Are you okay with that, and with me posting your scripts and whatnot, provided I link to the original download and credit you

Sure, go ahead.

creeperton, AKA Mir_Vimes wrote:Could you provide a technical explanation for how *.ARC files were compressed, should we someday have someone to code a sprite extractor or editor? I don't have to understand it, it will be something to copy and paste for future reference.

They're not compressed at all. The files are organized like this: [Number of Pointers] ((Number of Pointers) * [Pointer N]) [Data] ... [Data].
Each file starts where the pointer points to and ends where the next pointer points to. Therefore, there are (Number of Pointers -1) files in there. File 0 starts at [Pointer 0] and ends at [Pointer 1] and so on. The last pointer will usually point to just after the last byte of the file.

Files are zero-padded to 4 bytes. All data is Little Endian. All offsets are absolute within each ARC file. All files within the ARChives you presented to me were in chronological order, so (Pointer N) < (Pointer N + 1) for all N.

creeperton, AKA Mir_Vimes wrote:I use the hex editor, XVI32. It works fine in Wine. I'm trying to annoy the author of XVI32 into Linux compatibility, and I'm making slow progress. I run Linux Mint 10, which is derived from one of the Ubuntus. I'm not sure that 010 editor will work with Wine, but I'm betting it will.

Well good luck with that. Also, translating the 010 Editor script into a little C program is not hard in case you don't get it to work. Writing a script or tool to put files into an ARChive isn't hard either. You should be able to manage with just a few hours of introduction to C programming on the net if you have no experience with C at all.

creeperton, AKA Mir_Vimes wrote:Thanks for taking the time to help us!

Don't worry, I liked the challenge anyway ;)

cYa,

Tauwasser
http://sf.data.project.tripod.com/

Biolab File Hosting

"Don't assume that you'll get endless chances. However much that person previously loved you, if that love stops because of your actions it's nearly impossible to get it back."
User avatar
Mir_Vimes
 
Posts: 429
Joined: Sat Jan 28, 2012 7:24 am
Location: Xibalba

Re: Editing sprites and other images

Postby Mir_Vimes » Fri Feb 03, 2012 11:54 am

http://forums.linuxmint.com/viewtopic.php?f=188&t=93477
^My request for a deARC BASH script.

http://board.byuu.org/viewtopic.php?f=10&t=2421
^Request for a deARC script of some sort.

Thanks to funkyass of http://board.byuu.org, we now have a deARC python script! Now Linux users have a deARC script.

Here's the script:
from struct import unpack
import sys

#todo rewrite using the io module
datafile = open(sys.argv[1],"rb")
data = datafile.read()
start = 0
num_pointers = unpack("<I",data[start:start+4])
start +=4
pointer_fmt = "<%dI"%num_pointers[0]
pointers = unpack(pointer_fmt,data[start:start+num_pointers[0]*4])
start += num_pointers[0]*4

i = 0
while i < (num_pointers[0]-1):
splitname = "%s_file%u.bin"%(datafile.name,i)
splitfile = open(splitname,"wb")

splitfile.write(data[pointers[i]:pointers[i+1]])
splitfile.close()
i+=1

splitname = "%s_file%u.bin"%(datafile.name,i)
splitfile = open(splitname,"wb")
splitfile.write(data[pointers[i]:])
splitfile.close()


To use it, first make sure that you have some version of Python - I have 3.1. Next, create a plain text file named saga_split.py, and paste the code above into the file and save it. After that, put saga_split.py in the same folder as the *.ARC file you want to split, open the terminal, cd to that directory, and run the following command:
Code: Select all
python saga_split.py file.arc


Still, there is a problem with importing palettes. Tile Molester only allows you to import palettes from other files if they are a recognized format, and the only formats it recognizes are NES/SNES/Genesis-generation save states. It doesn't look like there's a way to fool TM into thinking that the palettes are actually something else, so we have to code a custom image viewer, extracter/inserter, or editor, specifically for SaGa Frontier.

As it stands, I can start working on the monster data dump, and that is good enough for me.
http://sf.data.project.tripod.com/

Biolab File Hosting

"Don't assume that you'll get endless chances. However much that person previously loved you, if that love stops because of your actions it's nearly impossible to get it back."
User avatar
Mir_Vimes
 
Posts: 429
Joined: Sat Jan 28, 2012 7:24 am
Location: Xibalba

Re: Editing sprites and other images

Postby Mir_Vimes » Tue Mar 06, 2012 8:32 am

http://board.byuu.org/viewtopic.php?f=1 ... 1&start=14
funkyass wrote:some cleaner code:
Code: Select all
from struct import unpack
from io import FileIO
import sys,os,glob


def split_file(fd):
    datafile = FileIO(fd,"r")
    num_pointers = unpack("<I",datafile.read(4))
    pointer_fmt = "<%dI"%num_pointers[0]
    pointers = unpack(pointer_fmt,datafile.read(num_pointers[0]*4))
    pointers+=(os.stat(datafile.name).st_size,)
    i = 0
    datafile.seek(pointers[0],0)
    while i < (num_pointers[0]):
   
        splitname = "%s_file%u.bin"%(datafile.name,i)
        with FileIO(splitname,"w") as splitfile:
            splitfile.write(datafile.read(pointers[i+1]-pointers[i]))
        i+=1

for arg in sys.argv[1:]:
    for files in glob.glob(arg):
        split_file(files)

you can give wildcard argument to this one.


Again, this is Python, and it requires the same installations - and it follows the same usage procedures - as the last Python script.
http://sf.data.project.tripod.com/

Biolab File Hosting

"Don't assume that you'll get endless chances. However much that person previously loved you, if that love stops because of your actions it's nearly impossible to get it back."
User avatar
Mir_Vimes
 
Posts: 429
Joined: Sat Jan 28, 2012 7:24 am
Location: Xibalba

Re: Editing sprites and other images

Postby Mir_Vimes » Fri Mar 09, 2012 10:58 am

Monster Palette Locations
Code: Select all
file      offset   length
M000.ARC   0x8030   512
M001.ARC   0x8030   512
M002.ARC   0x8030   512
M003.ARC   0x8030   512
M004.ARC   0x8030   512
M005.ARC   0x8030   512
M006.ARC   0x10030   512
M007.ARC   0x8030   512
M008.ARC   0x10030   512
M009.ARC   0x28030   512
M010.ARC   0x8030   512
M011.ARC   0x28030   512
M012.ARC   0x8030   512
M013.ARC   0x8030   512
M014.ARC   0x8030   512
M015.ARC   0x8030   512
M016.ARC   0x8030   512
M017.ARC   0x8030   512
M018.ARC   0x8030   512
M019.ARC   0x8030   512
M020.ARC   0x8030   512
M021.ARC   0x8030   512
M022.ARC   0x8030   512
M023.ARC   0x8030   512
M024.ARC   0x8030   512
M025.ARC   0x8030   512
M026.ARC   0x28030   512
M027.ARC   0x8030   512
M028.ARC   0x8030   512
M029.ARC   0x8030   512
M030.ARC   0x8030   512
M031.ARC   0x8030   512
M032.ARC   0x8030   512
M033.ARC   0x8030   512
M034.ARC   0x8030   512
M035.ARC   0x8030   512
M036.ARC   0x8030   512
M037.ARC   0x10030   512
M038.ARC   0x8030   512
M039.ARC   0x8030   512
M040.ARC   0x28030   512
M041.ARC   0x8030   512
M042.ARC   0x8030   512
M043.ARC   0x28030   512
M044.ARC   0x28030   512
M045.ARC   0x28030   512
M046.ARC   0x8030   512
M047.ARC   0x8030   512
M048.ARC   0x8030   512
M049.ARC   0x8030   512
M050.ARC   0x8030   512
M051.ARC   0x8030   512
M052.ARC   0x8030   512
M053.ARC   0x10030   512
M054.ARC   0x10030   512
M055.ARC   0x10030   512
M056.ARC   0x8030   512
M057.ARC   0x10030   512
M058.ARC   0x10030   512
M059.ARC   0x8030   512
M060.ARC   0x8030   512
M061.ARC   0x8030   512
M062.ARC   0x10030   512
M063.ARC   0x8030   512
M064.ARC   0x8030   512
M065.ARC   0x8030   512
M066.ARC   0x8030   512
M067.ARC   0x10030   512
M068.ARC   0x8030   512
M069.ARC   0x8030   512
M070.ARC   0x8030   512
M071.ARC   0x8030   512
M072.ARC   0x28030   512
M073.ARC   0x28030   512
M074.ARC   0x8030   512
M075.ARC   0x8030   512
M076.ARC   0x8030   512
M077.ARC   0x8030   512
M078.ARC   0x8030   512
M079.ARC   0x8030   512
M080.ARC   0x10030   512
M081.ARC   0x8030   512
M082.ARC   0x10030   512
M083.ARC   0x28030   512
M084.ARC   0x28030   512
M085.ARC   0x28030   512
M086.ARC   0x28030   512
M087.ARC   0x28030   512
M088.ARC   0x28030   512
M089.ARC   0x28030   512
M090.ARC   0x8030   512
M091.ARC   0x8030   512
M092.ARC   0x28030   512
M093.ARC   0x28030   512
M094.ARC   0x28030   512
M095.ARC   0x8030   512
M096.ARC   0x8030   512
M097.ARC   0x8030   512
M098.ARC   0x8030   512
M099.ARC   0x8030   512
M100.ARC   0x8030   512
M101.ARC   0x8030   512
M102.ARC   0x10030   512
M103.ARC   0x8030   512
M104.ARC   0x8030   512
M105.ARC   0x8030   512
M106.ARC   0x8030   512
M107.ARC   0x8030   512
M108.ARC   0x8030   512
M109.ARC   0x8030   512
M110.ARC   0x8030   512
M111.ARC   0x8030   512
M112.ARC   0x8030   512
M113.ARC   0x8030   512
M114.ARC   0x8030   512
M115.ARC   0x8030   512
M116.ARC   0x8030   512
M117.ARC   0x8030   512
M118.ARC   0x8030   512
M119.ARC   0x10030   512
M120.ARC   0x8030   512
M121.ARC   0x8030   512
M122.ARC   0x28030   512
M123.ARC   0x28030   512
M124.ARC   0x28030   512
M125.ARC   0x28030   512
M126.ARC   0x28030   512
M127.ARC   0x8030   512
M128.ARC   0x10030   512
M129.ARC   0x8030   512
M130.ARC   0x8030   512
M131.ARC   0x8030   512
M132.ARC   0x8030   512
M133.ARC   0x8030   512
M134.ARC   0x8030   512
M135.ARC   0x8030   512
M136.ARC   0x10030   512
M137.ARC   0x28030   512
M138.ARC   0x8030   512
M139.ARC   0x8030   512
M140.ARC   0x28030   512
M141.ARC   0x8030   512
M142.ARC   0x28030   512
M143.ARC   0x8030   512
M144.ARC   0x8030   512
M145.ARC   0x8030   512
M146.ARC   0x8030   512
M147.ARC   0x8030   512
M148.ARC   0x10030   512
M149.ARC   0x8030   512
M150.ARC   0x8030   512
M151.ARC   0x8030   512
M152.ARC   0x8030   512
M153.ARC   0x8030   512
M154.ARC   0x8030   512
M155.ARC   0x8030   512
M156.ARC   0x8030   512
M157.ARC   0x8030   512
M158.ARC   0x8030   512
M159.ARC   0x8030   512
M160.ARC   0x8030   512
M161.ARC   0x28030   512
M162.ARC   0x28030   512
M163.ARC   0x10030   512
M164.ARC   0x28030   512
M165.ARC   0x28030   512
M166.ARC   0x28030   512
M167.ARC   0x8030   512
M168.ARC   0x8030   512
M169.ARC   0x28030   512
M170.ARC   0x8030   512
M171.ARC   0x8030   512
M172.ARC   0x8030   512
M173.ARC   0x8030   512
M174.ARC   0x8030   512
M175.ARC   0x8030   512
M176.ARC   0x10030   512
M177.ARC   0x10030   512
M178.ARC   0x10030   512
M179.ARC   0x10030   512
M180.ARC   0x10030   512
M181.ARC   0x8030   512
M182.ARC   0x10030   512
M183.ARC   0x10030   512
M184.ARC   0x10030   512
M185.ARC   0x28030   512
M186.ARC   0x28030   512
M187.ARC   0x28030   512
M188.ARC   0x8030   512
M189.ARC   0x28030   512
M190.ARC   0x10030   512
M191.ARC   0x28030   512
M192.ARC   0x8030   512
M193.ARC   0x10030   512
M194.ARC   0x10030   512
M195.ARC   0x8030   512
M196.ARC   0x8030   512
M197.ARC   0x8030   512
M198.ARC   0x8030   512
M199.ARC   0x28030   512
M200.ARC   0x10030   512
M201.ARC   0x8030   512
M202.ARC   0x8030   512
M203.ARC   0x8030   512
M204.ARC   0x28030   512
M205.ARC   0x8030   512
M206.ARC   0x10030   512
M207.ARC   0x28030   512
M208.ARC   0x10030   512
M209.ARC   0x8030   512
M210.ARC   0x10030   512
M211.ARC   0x10030   512
M212.ARC   0x8030   512
M213.ARC   0x10030   512
M214.ARC   0x8030   512
M215.ARC   0x10030   512
M216.ARC   0x10030   512
M217.ARC   0x28030   512
M218.ARC   0x8030   512
M219.ARC   0x10030   512
M220.ARC   0x10030   512
M221.ARC   0x10030   512
M222.ARC   0x10030   512
M223.ARC   0x8030   512
M224.ARC   0x28030   512
M225.ARC   0x8030   512
M226.ARC   0x8030   512
M227.ARC   0x10030   512
M228.ARC   0x8030   512
M229.ARC   0x8030   512
M230.ARC   0x10030   512
M231.ARC   0x28030   512
M232.ARC   0x10030   512
M233.ARC   0x8030   512
M234.ARC   0x28030   512
M235.ARC   0x8030   512
M236.ARC   0x10030   512
M237.ARC   0x8030   512
M238.ARC   0x8030   512
M239.ARC   0x10030   512
M240.ARC   0x28030   512
M241.ARC   0x10030   512
M242.ARC   0x28030   512
M243.ARC   0x28030   512
M244.ARC   0x28030   512
M245.ARC   0x28030   512
M246.ARC   0x28030   512
M247.ARC   0x8030   512
M248.ARC   0x8030   512
M249.ARC   0x28030   512
M250.ARC   0x28030   512
M251.ARC   0x28030   512
M252.ARC   0x28030   512
M253.ARC   0x28030   512
M254.ARC   0x28030   512
M255.ARC   0x8030   512
http://sf.data.project.tripod.com/

Biolab File Hosting

"Don't assume that you'll get endless chances. However much that person previously loved you, if that love stops because of your actions it's nearly impossible to get it back."
User avatar
Mir_Vimes
 
Posts: 429
Joined: Sat Jan 28, 2012 7:24 am
Location: Xibalba

Re: Editing sprites and other images

Postby Mir_Vimes » Tue Mar 13, 2012 10:26 am

Courtesy of funkyass, of byuu.org

saga_print.py
*This script prints starting addresses and total length of the specified sub-file, for all the M***.ARC files you choose.

*Usage directions - Windows users:
**Install python 3 on your computer. Google it, and then ask me if you need help with anything. Since I'm not a Windows user, I doubt I can be much help, but, eh, I'll see what I can do.
**Put the M***.ARC files you want in your C:\\ folder.
**Create a plain text file (notepad file) in your C:\\ folder, and name it saga_print.
**Copy and paste the code at the bottom of this page into saga_print
**Save saga_print as saga_print.py.
**Open the command terminal.
**I assume you type the following into the command terminal, though I could be wrong:
python saga_print.py *.ARC

**This should print off a bunch of stuff that's hard to read. Select all of it, copy all of it, and paste it to notepad for a closer look.

*Usage directions - Linux users:
**Copy your M***.ARC files into a new directory, unless you aren't worried about maybe corrupting them.
**Make a file named saga_print.py in the same directory.
**Copy the code at the bottom of the page into saga_print.py.
**Save saga_print.py.
**Open the terminal.
**cd to the directory where saga_print.py and the M***.ARC files are kept.
**Run the following command:
python saga_print.py *.ARC


*Fun Fact: You can change the sub-file specified by changing the following part of the code, from this:
print "%s\t0x%X\t%s"%(datafile.name,pointers[7],pointers[8]-pointers[7])

**To this:
print "%s\t0x%X\t%s"%(datafile.name,pointers[(enter subfile you want)],pointers[(enter subfile you want, plus 1)]-pointers[(enter subfile you want)])


*Here's the complete code:
Code: Select all
from struct import unpack
from io import FileIO
import sys,os,glob


def print_file(fd):
    datafile = FileIO(fd,"r")
    num_pointers = unpack("<I",datafile.read(4))
    pointer_fmt = "<%dI"%num_pointers[0]
    pointers = unpack(pointer_fmt,datafile.read(num_pointers[0]*4))
    pointers+=(os.stat(datafile.name).st_size,)
    print "%s\t0x%X\t%s"%(datafile.name,pointers[7],pointers[8]-pointers[7])
if len(sys.argv) <2:
    print "no files given"
    sys.exit(0)
for arg in sys.argv[1:]:
    print "file\t\toffset\tlength"
    for files in glob.glob(arg):
       
        print_file(files)
http://sf.data.project.tripod.com/

Biolab File Hosting

"Don't assume that you'll get endless chances. However much that person previously loved you, if that love stops because of your actions it's nearly impossible to get it back."
User avatar
Mir_Vimes
 
Posts: 429
Joined: Sat Jan 28, 2012 7:24 am
Location: Xibalba

Re: Editing sprites and other images

Postby Mir_Vimes » Wed Mar 21, 2012 6:01 am

Attached is a plain text file that has the 32 byte Player Character and NPC palettes. The plain text file is in a ZIP compressed achive.
Attachments
palettes_character.zip
A plain text file, in a ZIP compressed archive.
(2.9 KiB) Downloaded 19 times
http://sf.data.project.tripod.com/

Biolab File Hosting

"Don't assume that you'll get endless chances. However much that person previously loved you, if that love stops because of your actions it's nearly impossible to get it back."
User avatar
Mir_Vimes
 
Posts: 429
Joined: Sat Jan 28, 2012 7:24 am
Location: Xibalba


Return to General Hacking

Who is online

Users browsing this forum: No registered users and 1 guest

cron