Golden Sun Hacking Community
August 20, 2017, 09:12:46 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: Problem with the 5% stats patch  (Read 510 times)
0 Members and 1 Guest are viewing this topic.

Novice Member
*

Coins: 1
Offline Offline

Posts: 33

« on: June 01, 2017, 09:53:23 PM »

I mentioned this before in the cbox but I figured that a topic would be better for it.

I applied the 5% stat patch to a fresh Golden Sun TLA (U) rom, however as shown in the pictures below it did not work out like it was supposed to.


* 5% patches.jpg (264.77 KB, 1533x384 - viewed 24 times.)

* gs2hack_11.png (7.12 KB, 240x160 - viewed 24 times.)

* gs2hack_12.png (7.67 KB, 240x160 - viewed 25 times.)
Logged
View Profile
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4560

« Reply #1 on: June 01, 2017, 09:59:09 PM »

Out of curiosity, have you had any luck with other patches? I figure that would be a good, quick way to figure out whether the patch messed things up or if there is something off with your ROM.

Logged

Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?
View Profile WWW
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Online Online

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

« Reply #2 on: June 01, 2017, 11:05:00 PM »

Squire looks fine.... (Since the percents in Atrius's editor do not take the code modification into consideration when determining what to display.)
Knight and Gallant??? Look off...


Might have also been useful to post screenshots of VBA>Tools>Memory viewer ... at address locations of:
0x080000A0 (To verify file version.)
0x080C15F4 (To verify if class data was here - Atrius's editor is compatible with more ROM versions than the 5% Patcher, since I only did the 5% Patcher with one version in mind.)

And to possibly go to VBA>Tools>Disassemble... with a screenshot at address 0x080AD768 (To verify if the percentage code stuff is here properly in your ROM.)



I would test it again to make sure... but I'm getting an error at the moment/little lazy...
Quote
ImportError: No module named tkinter
« Last Edit: June 01, 2017, 11:52:52 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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
View Profile

Novice Member
*

Coins: 1
Offline Offline

Posts: 33

« Reply #3 on: June 02, 2017, 12:21:33 AM »

This is what it looks like at the offsets. Also, I've used a copy of this rom before to patch stuff like the Reloaded patch and the Intellect patch and they've worked just fine so I don't think anything's wrong with my rom.

Also, I did have to change the first line to Tkinter import * #GUI stuff and comment out this one f = open(filedialog.askopenfilename(), 'r+b') in order to get it to patch.


* Memory Viewer.jpg (287.51 KB, 1392x658 - viewed 21 times.)
Logged
View Profile
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4560

« Reply #4 on: June 02, 2017, 01:17:37 AM »

I haven't checked through the patch/code yet, but wouldn't it be easier to just divide by 20 rather than 10? It almost looks like there is either an error in that patch or some weird workaround.

Edit: If you replace all six "325B" intructions with "2114" then you might be able to fix it. Assuming nothing else has really been changed!
« Last Edit: June 02, 2017, 01:20:05 AM by Lord Squirtle » Logged

Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?
View Profile WWW
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Online Online

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

« Reply #5 on: June 02, 2017, 04:19:10 AM »

EDIT:(Putting this at the top since it could maybe be the answer/not sure, though... so proceed with caution.)

OH!!!
Quote
Tkinter has been renamed to tkinter in Python 3.
Maybe I look into seeing if Python 3 works... Since my last test was with Python 2.7... xP
There are a bunch of differences between both, that it is probably better to use the Python that the code was made for before adapting it to a different version of Python... probably.

If this is it(?), then the rest of the post can be ignored.

How is it putting in 0x325B everywhere? o.O
So all 0x0A's become 0x5B's? ... when they're supposed to become 0x14's...
... Hmmm.... And the next instruction afterwards for each is messed up? - Attached image compares yours against an unmodified ROM.
It's possible the numbers could be stored in some 32-bit format when I intended an 8-bit format.... / Maybe some type of float or fixed point, I dunno... ??

@Salanewt: Dividing by 20 is exactly what the patch is supposed to put in.  The code originally looks like this (So you can see it is pretty simple.):

Unmodified/uncorrected version....
Code:
from tkinter import * #GUI stuff.

#Window
root = Tk()
root.title("Class Stats 5% Patcher")
root.geometry("300x200")
app = Frame(root)
app.grid()
lbl1 = Label(app, text = "Waiting for file...")
lbl1.grid()

#Open file.
f = open(filedialog.askopenfilename(), 'r+b')
#f = open('C:/Users/name/Desktop/gs2.gba', 'r+b')
fileOk = 1
#f.seek(0xA0)
#if f.read(16) != b'GOLDEN_SUN_BAGFE': fileOk = 0

#Check if values have not been altered.
for i in range(6):
    f.seek(0xAD768 + (i * 0x10))
    if ord(f.read(1)) != 10:
        fileOk = 0
       
if fileOk == 1:

    #Update the denominators to *2.  0x14 (20)
    for i in range(6):
        f.seek(0xAD768 + (i * 0x10))
        f.write(bytes([20]))
       
    #Update all class stats to *2.
    for i in range(0xF4): #Number of classes.
        for j in range(6): #Number of stats per class.
            f.seek(0xC15F4 + (i * 0x54) + (8 + j))
            val = ord(f.read(1))
            f.seek(0xC15F4 + (i * 0x54) + (8 + j))
            f.write(bytes([val * 2]))
           
    message = "Changes have been successfully saved."
else:
    message = "No changes have been made."

f.close()
lbl1['text'] = message
root.mainloop()

f.write(bytes([20]))

^You would think that'd put the 0x14's in for the denominators.... There is no fancy equations here... so... erm....


* statdenominators.png (79.21 KB, 602x688 - viewed 16 times.)
« Last Edit: June 02, 2017, 05:32:52 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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
View Profile
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4560

« Reply #6 on: June 02, 2017, 06:49:12 AM »

Okay, yeah I figured that was the case!

What's going on with python stuff?
Logged

Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?
View Profile WWW

Novice Member
*

Coins: 1
Offline Offline

Posts: 33

« Reply #7 on: June 02, 2017, 12:21:42 PM »

Okay, so I ran it in python 3 and it works just fine. I don't really get the difference between the two since I don't know python but thanks alots.

Now if only there was a faster way to copy paste class data so I could input the various classes that I added.
Logged
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Online Online

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

« Reply #8 on: June 02, 2017, 04:07:03 PM »

That's easy with a small amount of hex editor experience.

All you need is VBA's Memory viewer...
Go to the address of the class data (0x080C15F4 in TLA (U)), select the first byte. Click the Save button at the bottom. The size should be in hexadecimal, I believe. You can do it in a calculator: 0x54 times the number of classes there are.
Once you have a dump saved, you can open up the ROM you want to put those into. This time, hit Load (while at the appropriate address), and load the dump you saved.


After that's done, make sure you don't forget to save the whole ROM section, otherwise you may lose the changes....: Go to 0x08000000, save a dump for 0x1000000 (For TLA), and change that to .gba.



Alternately, you could do it with Python... ; Even though there are some things I do like about Python...  I feel that it's a bit messed up, so I try to use something else most of the time. (Currently C#) Especially since C# can easily load a whole ROM into an array in minimum time. (<1 second....) compared to Python which takes some time. :(


Given my analysis of some programming languages. (Not a detailed one at that.) I have came to the conclusion that the best programming languages for me were of the C ones...  (Currently C#)  At least if it isn't an obscure language, more people would be more likely to read source code from it.... Etc.
« Last Edit: June 02, 2017, 05:46:07 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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
View Profile

Novice Member
*

Coins: 1
Offline Offline

Posts: 33

« Reply #9 on: June 04, 2017, 10:06:33 PM »

I'm a bit confused at the memory dump size part.

So let me get this straight, at the memory dump part, I'm supposed to go to 80C15F4 and select the byte in the attached picture? Then when I'm saving the dump, its supposed to be a size of BE50 (0x54 multiplied by the 244 classes (NPC + 243) in the game data?


* Memory Viewer Class Copy.jpg (89.64 KB, 768x330 - viewed 13 times.)
Logged
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Online Online

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

« Reply #10 on: June 04, 2017, 11:03:00 PM »

Yes.

Except the 244 is a decimal number, and treating it as a hex number will mess up the calculation.

0x5010 should be the correct size for GS2.

080C15F4 = Classes
080C6604 = Class Type chart
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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
View Profile

Novice Member
*

Coins: 1
Offline Offline

Posts: 33

« Reply #11 on: June 05, 2017, 12:40:40 AM »

Thanks, I managed to stumble on another problem or maybe a weird quirk would be a better way to put it, but for some reason the text at locations 3346 and 3347 in the editor are backwards. Most locations would list the stats in the order Attack/Defense/Agility/Luck but for some weird reason this
section lists it as Attack/Defense/Luck/Agility. Then if you correct the order it mucks up a couple text areas.


* gs2hack_14.png (8.42 KB, 240x160 - viewed 16 times.)

* gs2hack_15.png (7.25 KB, 240x160 - viewed 14 times.)

* gs2hack_16.png (8.38 KB, 240x160 - viewed 14 times.)

* gs2hack_17.png (7.27 KB, 240x160 - viewed 13 times.)
Logged
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Online Online

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

« Reply #12 on: June 05, 2017, 02:14:37 AM »

Interesting...

Looking at how specific this topic's name is, I am assuming this is a "Wrong topic?" As in, I think this is related to the Intellect patch?


It is going to be my guess that Salanewt forgot to fully update it for everything else, since there's likely an index needed for every time the text should appear.
« Last Edit: June 05, 2017, 02:21:54 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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
View Profile
Salanewt
His Sexiness
Mercury Clan

Oh yeah, baby!

Prodigy
*

Coins: 32
Offline Offline

I am: A part of the organization of Cool Cats, but more of a dog person in reality.
Emblems: Have a nice day.
Posts: 4560

« Reply #13 on: June 05, 2017, 04:01:53 AM »

Oops, yeah I guess I either wrote the words in the wrong slots or forgot to switch those two labels around.

Thanks for pointing that out! Is this something you can fix yourself in the text editor or do I need to make a quick fix for that? I ask because I'm planning to revisit this patch and touch up a couple things when the AI overhaul patch is done, since that will have a second version that includes the Intellect patch when I finish the main one.
Logged

Oh yeah baby, £ me harder.

Fusion is just a cheap tactic to make weak Adepts stronger.

Yoshi's Lighthouse is a hacking website in progress. Why not check it out if you like Yoshi or the Mario & Luigi games?
View Profile WWW
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Online Online

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

« Reply #14 on: June 05, 2017, 04:26:07 AM »

...
Huh. Oh yeah. I guess I must have read something wrong at first... but it was only a minor tidbit, anyway...

I think this line should be enough, though:  If you do want them to be in the right order (and don't want to wait for an update), it could help to search the text indexes (Probably 32-bit) in a hex editor and switch them. (Preferably check each one to make sure it changed properly, as you would likely be changing quite a few. - But quite a few doesn't mean a lot, so it shouldn't be that difficult.)
^ And yeah, for some things, it can be that easy.... I say to check (Field Menus and Battle menus individually.) to make sure of any false positives when switching them.
For other things, it can be a little more complicated (e.g. base index + offset index , or coded via mov/lsl/add... but I think TLA usually has text indexes as a 32-bit loaded by an ldr-relative.)


---
To find indexes of 3346, I can search 120D0000 in a hex editor... and only pay attention to the ones at addresses divisible by 4 (32-bit), as if it is not, it's likely a false positive. But if it is aligned as such, then it depends.
« Last Edit: June 05, 2017, 04:52:50 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...
*Cross my fingers and hope we have Big Brother All-Stars next year... with Paulie & Cody Califorie(sp?)... and Vanessa & Tiffany Rousso.... Would be fun? :P Especially if one of the boys got evicted early since there's usually some all-guy alliance in there, right?
View Profile
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Cbox
Today at 08:59:37 PM
Fox: Same... depending on whether they've used tricks instead or not.
Today at 08:02:49 PM
Salanewt: I could see it counting.
Today at 11:24:44 AM
Fox: Not sure if Zelda (LttP/Minish Cap) count or not...
Today at 11:23:00 AM
Fox: Appararently, I can't think of many GBA games that do the psuedo-3D thing. (That being 2D maps with 3D-like collision...) Golden Sun and Superstar Saga come to mind, though... but I'll need to think about others, since it is quite possible i've simply forgotten....
Yesterday at 03:45:19 PM
Fox: Hmm... Thought: What if Isaac and co. weren't on Jupiter Lighthouse when Felix and co. were... I wonder if the story could have had a huge expansion, in this case.
August 18, 2017, 12:18:56 PM
Fox: Welcome back!
August 18, 2017, 09:12:43 AM
Luna_blade: back from vacation
August 17, 2017, 02:29:26 AM
Fox: That moment when you realize that there is a lot of chatting going on on Discord, that there is no point in trying to keep up. :P  Hm....
August 16, 2017, 04:50:22 AM
Fox: (Then again, just because posting is disabled, doesn't necessarily mean the buttons would be removed as well.)
August 16, 2017, 04:48:55 AM
Fox: (I mean, buttons I would expect to be similar to that.... rather than those specifically since I recall posting there to be disabled.)
August 16, 2017, 04:33:02 AM
Fox: Yeah... I like to think of it as a page loaded with ads. And it's not just the forum home page either... check the sub-forums/topics themselves. == New Topic/Reply/etc. buttons were affected.
August 15, 2017, 07:04:30 PM
Salanewt: Lol, nice. :P
August 15, 2017, 06:33:02 PM
Foxhttp://z9.invisionfree.com/Golden_Sun_Hacking/index.php? == Hahaha! GSHC Classic looks funny now that Photobucket killed the images. :P Anyway, how is everyone doing today?
August 14, 2017, 07:12:02 PM
Salanewt: So yeah, I'm typing up a non-academic essay on why GS2 was rushed; expect that sometime soon!
August 07, 2017, 05:53:11 AM
Fox: But anyway, such a hack mod is simply an idea, and I do not have any current plans to work on it at this time, so.....
August 07, 2017, 05:51:46 AM
Fox: Okay, cool. I think my idea works best without an ability to swap PCs (OR to just simply make that use it the PC's turn.) Hmmm... And with that, I question if a turn list is even needed with my approach. (Outside of maybe 1 entry, if that shortens the modifications.)
August 07, 2017, 05:13:26 AM
Salanewt: To be honest I've been thinking of expanding the battle turn section and also adding code for PCs to have more than two turns in the AI overhaul, but I probably won't allow anyone to have more than four.
August 06, 2017, 12:22:17 AM
Fox: Oh, and if that approach was taken = Would like to also have it so you select the spell to use when it is actually your turn rather than at round start.
August 06, 2017, 12:12:37 AM
Fox: Would take a lot of balancing, but I can see an adept being very slow, and yet very powerful.
August 06, 2017, 12:06:11 AM
Fox: And bosses can have an Agility that is above half of the maximum possible Agility. Mwahaha.

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.114 seconds with 22 queries.