Golden Sun Hacking Community
June 27, 2019, 01:19:59 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
  Home   Forum   DC Wiki Help Search Calendar Downloads Login Register  
Pages: 1 [2]   Go Down
  Print  
Author Topic: Compression Formats  (Read 8852 times)
0 Members and 1 Guest are viewing this topic.
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 0
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2446

« Reply #15 on: November 16, 2015, 02:49:45 AM »

Well, it didn't fully support Text Compression, as Atrius's editor never rewrote the Char tables... It also didn't decompress battle backgrounds... etc. But the point was that it did support decompressoin/compression for some things...

I think most images are in three/four sections.
1.) The sprites tble: (0x08300000 in GS2)
2.) The Master File Table.. (0x08320000 in GS1, 0x08680000 in GS2; Yep, I have both of them memorized.)
3.) One of the code files has compressed icons.
4.) Oh, and there might be some things compressed in another code file files. (Like the palette menu graphics, I think..) but other than that, I think most graphics in those files are uncompressed(?) - Not many uncompressed images, though... but the red crystal grpahic (for convos), and that pink/purple conical selection thing used to select an enemy maybe.. some |> arrows used in debug menus....  etc. That kind of thing.)
« Last Edit: November 16, 2015, 03:01:22 AM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Remember kids! Before you go on that interview, remember to wash your hands in teawater! *Coughs on hand* (Excuse me, I just coughed up a little teawater, so they're still clean!) You wouldn't want that hiring manager to be unimpressed.

May the force be with you!
Shoo! Why does it smell in here?
Maybe that's the wrong kind of force. *smirk*
View Profile
approxies
Guest
« Reply #16 on: November 16, 2015, 06:39:09 PM »

OK, thanks for getting me inputs, I will investigate further. I guess, pointer for the chunk of graphics, I'm going to translate (GO and 1st match glyphs in arena) is hardcoded.
Logged
approxies
Guest
« Reply #17 on: February 11, 2016, 05:06:33 PM »

An update for my set of compression tools of Golden Sun.
Now it supports decoding/encoding for text, and two LZSS schemes for graphics, described in OP post.
Logged

Novice Member
*

Coins: 0
Offline Offline

Posts: 13

« Reply #18 on: March 10, 2016, 12:51:56 PM »

Hi approxies, Fox and Lord Squirtle, I am currently looking for a way to encode my Polish translation of The Lost Age in a different way than using Atrius' Editor, as it makes the output file much bigger and is now incompatible with The Balance Age  Sweat Drop
Needles to say that this thread caught my interest. Approxies, would you mind making a little tutorial to your compression tools for a non-programmer? I've played around with the tools a little bit, but can't really get them to work.
The haskell one returns "Could not find module 'Data.Bitstream.Lazy' (I just installed the GHC compiler).
Recommended translation scheme from the earlier version with .bat files works fine until the encoding (-e) part, where it shows "trees: Patch size is larger than specified. Aborted." I guess it is because my translation is larger than the original file (duh), so do I need to specify a new treeSize, Offset? How do I calculate this? :)
Here is the script, if you want to take a look.
Logged
View Profile

I need saves to test encounters in GS Reloaded!

Excellent Member
****

Coins: 0
Offline Offline

Gender: Male
Posts: 834

« Reply #19 on: March 10, 2016, 01:16:28 PM »

I'm not sure about it, but i think you can tweak gstlatoolkit itself and make it store the script later into the rom . that way you'd also gain back the compatibility with my patch.
Logged
View Profile

Novice Member
*

Coins: 0
Offline Offline

Posts: 13

« Reply #20 on: March 10, 2016, 04:42:51 PM »

I don't really know how to do that. I mean, I know where to look, but I don't know the right values to use. The patching file in gstlatoolkit looks like this:

Spoiler for Hidden:
Quote
echo Expanding ROM
patch x tla_patched.gba $01800000

echo Assembling decompress.asm
goldroad asm\decompress.asm

echo Assembling setArgumentsTLA.asm
goldroad asm\setArgumentsTLA.asm

echo Inserting decompress.asm
patch i tla_patched.gba asm\decompress.gba $0003843C

echo Inserting setArgumentsTLA.asm
patch i tla_patched.gba asm\setArgumentsTLA.gba $00038580

echo Inserting string offset table
patch i tla_patched.gba bin\offsets.bin $00FA0000

echo Inserting strings
patch i tla_patched.gba bin\strings.bin $00FAC300
Logged
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 0
Offline Offline

I am: certainly not a Gallant!
Clan Position: Head Gallant
Posts: 2446

« Reply #21 on: March 10, 2016, 06:00:56 PM »

Whether you choose to compress or not is up to you... Frankly, I don't think it matters unless you need the space. (Probably don't.)

I did not look at how Approxies puts the data back into the ROM... But my compressor compresses it to 0x00FA0000.... and it looks the addresses in your spoiler (gstlatoolkit) places it there too... Soo...

Quote
echo Inserting string offset table
patch i tla_patched.gba bin\offsets.bin $00FA0000

echo Inserting strings
patch i tla_patched.gba bin\strings.bin $00FAC300

With the game open in VisualBoyAdvance, you can go to Tools>Memory Viewer... in the address field... The Rom section goes from 0x08000000-0x09FFFFFF, it should match what you see when you open the file in a hex editor. So you just put 0x08FA0000 in the address field, press Go... scroll down until you find what looks like 00 data... That is unused/free data... and is the address you want to put in. (And +0xC300 for the next address.) (Assuming you're editing a hack, I recommend overwriting the text data that has already been pointed in the area if it is there. It should be easy to notice in The Balance Age since the text should be uncompressed, but I didn't check that for myself, if anything unlikely should go wrong.)

You might need to edit the same addresses in the asm files as well. (So that the game knows that the data moved.)


^^ Wrote this without checking.... but I did look into gstoolkit a long time ago, so....
« Last Edit: March 10, 2016, 06:17:31 PM by Fox » Logged

Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Remember kids! Before you go on that interview, remember to wash your hands in teawater! *Coughs on hand* (Excuse me, I just coughed up a little teawater, so they're still clean!) You wouldn't want that hiring manager to be unimpressed.

May the force be with you!
Shoo! Why does it smell in here?
Maybe that's the wrong kind of force. *smirk*
View Profile

I need saves to test encounters in GS Reloaded!

Excellent Member
****

Coins: 0
Offline Offline

Gender: Male
Posts: 834

« Reply #22 on: March 10, 2016, 06:24:58 PM »

Try this: open go_TLA.bat with a txt editor and change "$00FA0000" to "$01000000" and "$00FAC300" to "$0100C300" then go into the asm folder, open setArgumentsTLA.asm in the same txt editor, and change at lines 57 and 58:
"r2,=0x08FA0000" to "r2,=0x09000000" and
"r3,=0x08FAC300" to "r3,=0x0900C300"

Save both edited files and paste your translation on a clean ROM (clean as in "not already patched with gstlatoolkit).

This way you save the uncompressed text at 01000000, which is where the original ROM ends. Basically, this way the toolkit can't overlap with anything and it'd be compatible with literally every patch you can find on this forum.

EDIT: @Fox actually in my patches the text is still compressed, I made all the changes with the editor.
« Last Edit: March 11, 2016, 07:03:53 PM by Caledor » Logged
View Profile

Novice Member
*

Coins: 0
Offline Offline

Posts: 13

« Reply #23 on: March 11, 2016, 09:01:16 PM »

Thanks guys, looks like saving the text at 01000000 gets rid of all compatibility problems  Happy
Logged
View Profile
Pages: 1 [2]   Go Up
  Print  
 
Jump to:  

Cbox
June 25, 2019, 02:51:42 PM
ryancaesar12345: jupiter revive animation any?
June 24, 2019, 08:05:17 AM
Fox: Such a patch would mean you need to be careful with item drops, coins, exp, etc. Because those things would then no longer be an infinite supply.  Whether or not one uses it depends on what they want to do with it.
June 24, 2019, 07:55:01 AM
Fox: (High enough being based on the area you are in.)
June 24, 2019, 07:54:02 AM
Fox: I had a thought today. What if I look into making a simple patch just for lulz.  One that works the same way as using Avoid, but it lasts from start to finish, and can't be disabled.  Avoid only works if your levels are high enough, though... so thought is to keep that as is.
June 24, 2019, 01:55:17 AM
ryancaesar12345: hi guys i have new update in Golden Sun 2 Lost Age Revise Mod.ips try this. :)
June 24, 2019, 01:54:16 AM
ryancaesar12345: where's that link?
June 24, 2019, 01:53:56 AM
ryancaesar12345: i have no account in discord.*
June 23, 2019, 08:44:52 PM
Salanewt: Although in the case of Wish, you could probably just use Breeze instead.
June 23, 2019, 08:44:36 PM
Salanewt: Yeah, it's a messaging program sort of like Skype. I find that it's much easy to walk people through some of the basics of assembly, since that's what you'll need for most animation hacks.
June 23, 2019, 09:39:10 AM
ryancaesar12345: discord? im not good in asm or assembly.
June 22, 2019, 09:37:26 AM
MaxiPower: gpnna update my thread on progress of my character art if anyones interested. :P
June 21, 2019, 07:51:44 PM
Salanewt: Hey there! Animation editing can be tricky, but I can share some notes with you if you pop in on our Discord. Are you good with assembly?
June 21, 2019, 02:59:40 PM
ryancaesar12345: and how to change a death curse turn in hex editor?
June 21, 2019, 02:50:00 PM
ryancaesar12345: and how to make animation but changing palette only like wish blue i want to change violet. for AOE healing and earth element.
June 21, 2019, 02:47:44 PM
ryancaesar12345: im done already thanks man i change the icon in that tutorial and all i need is animation most of elemental like healing like wish but wind element. how to import animation in TLA editor in *game crashes* index
June 21, 2019, 12:01:35 PM
Fox: Oh that. You are talking about Caledor's tutorial?
June 21, 2019, 11:49:55 AM
Fox: So in little endian... 08FA0000 (32-bit) is the same as 00 00 FA 08 (8-bits) (Since GBA is little endian) ;;; but if this were big-endian, it would have been 08 FA 00 00 (8-bits)     
June 21, 2019, 11:42:17 AM
Fox: "in the ROM file" = I mean when using any other hex editor to look in the file... ROM section in VBA is 08000000-09FFFFFF, but ROM files are different sizes, so GS1 stops a quarter the way (08800000 / 8MB), and GS2 stops half way. (09000000 / 16MB)
June 21, 2019, 11:39:55 AM
Fox: I am not sure I understand what you are trying to do? ... But all little endian is is just reverse byte. (of the bytes in a data type).... So like... 8-bit is the same regardless of big or little endian. 16-bit is like 0102=big endian 0201=little endian .... 32-bit is like 01020304=big endian ; 04030201=little endian.  (I use 01-04 numbers to represent how the bytes are ordered by address.) ; 00FA0000 in the ROM file is 08FA0000 in VBA's memory viewer/and that's how it works when the game reads
June 21, 2019, 05:20:47 AM
ryancaesar12345: i sa that in icon compressor 00FA0000 -> in 00FA0008 hmm?

Affiliates
Temple of Kraden Golden Sunrise
Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.093 seconds with 23 queries.