Atrius: I'm trying to fix the site, but it might take a while.

It seems the SQL database had grown larger than our hosting company allows.
I've cleaned out all of the unnecessary log data to get it down to an
acceptable size, but haven't received a response as to why normal
functionality hasn't been restored yet.


 Post your GBA ASM Questions here.
Golden Sun Hacking Community
July 19, 2018, 09:51:56 AM *
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] 3 4 ... 7   Go Down
  Print  
Author Topic: Post your GBA ASM Questions here.  (Read 32101 times)
0 Members and 1 Guest are viewing this topic.
Misery
Bad Luck

Great Member
***

Coins: 2
Offline Offline

Gender: Male
Clan Position: Mercury Hack Leader
Posts: 709

« Reply #15 on: January 02, 2014, 10:05:30 PM »

Still can't follow much.  While I can't ask that you guys make tutorials for noobs, I'd say you're not doing yourselves any favors in terms of recruitment.
The point of the GS editor is that people won't have to learn this stuff, but it's still at a stage where it's pretty limited without it. Still, I think this thread is more aimed at people who are already familiar with ASM but trying to learn it.

Side question:  From reading above, it seems that the main changes people are making are with parameters (attack, defense, etc).  Have you been able to add and take away djinn from the game?  Or give enemy attacks to players?  It might even be neat to come across a bunch of enemies who, at the time of battle, have the exact same stats and abilities as the players.  Are these things which are ultimately possible through hacking?
I recommend at least trying out the editor and see what it can do. Even if you're not looking to make your own GS hack, most of these questions would have already been answered if you had tried opening a GS ROM in it.

Some info if you need it...

There is a VBA-SDL-H2 version I found on pokecommunity once, but didn't see a way to do breakpoint read or write.

Anyway, for SDL-H, the main commands you need to know are these:

bpr = Breakpoint Read
bpw = Breakpoint Write
bt = Breakpoint Thumb (I think there is a bug for this one in SDL-H, so I often like to use rtt instead. Which I forget if it too includes the bug or not.)(ba/rta? for Arm)
n = Execute next instruction
c = Continue execution

There are some other useful commands as well, but I wanted to say that the No$gba NDS debugger works a bit different. For one, it's not a command prompt, and you use [address]! for writes (only works when the value is actually changed, I thin, unlike SDL-H), and you use [address]? for reads...


So what are you trying to do in SDL-H anyway?
Hehe, thanks. Well, as for what I'm trying to do... I had taken another look at the exit editing tutorial and decided to see if I could use it to skip the whole intro when starting a new game in TLA, as well as setting the starting location. It seems like the entrance number can be used to initiate events, for example, the summary of the previous game is entrance 8 in room 0 (title), while the opening scene with Jenna, Kraden and Alex is initiated by going into entrance 99 of room... was it 5? It's the interior of Venus Lighthouse...

Anyway, I guess I also need to do the thing where the game changes the party leader to Felix, as playing through the game with Jenna causes some problems (and also is not what I wanted). Do you happen to know when/how this occurs?
Logged
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

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

« Reply #16 on: January 03, 2014, 01:34:08 AM »

@Point of GS Editor: In my opinion, even if you do know all the game data, having an editor could still be very useful. (When considering many things, including what Atrius's editor does not have.... Clearly, we all know that uncompressing data, and compressing data is too time consuming to do manually. Other useful concepts could be finding all function calls to a function, being able to reallocate space in the middle of data while keeping everything in order. (May require a scan to all code to update pointers.) And whatever else.


The intro scene in Venus Lighthouse is done in the Initialization section of Map Code, I believe, so you could zero out the entire cutscene if you wanted to. That would also give you plenty of space to turn on the debug mode freely, and call the function that switches your party leadeer to Felix.

From my Hacking Documentation. (The one posted here back in August.)

080ADDF0 = Party initialization?
 080ADEF6 = Adds Felix
 080ADEFC = Adds Jenna
 080ADF02 = Innate Psynergies

080AE0DC = Set leader to Jenna.
 080AE0E4 = This sets Jenna as the leader while in Venus Lighthouse (during title screen, but is reset again shortly after this)

080AE0F0 = Set leader to Felix, add Felix to party, remove Jenna and Sheba.
 080AE0FA = This sets Felix as the leader while on Idejima (during title screen)
 080AE0FE = This adds Felix to your party while on Idejima
 080AE104 = This removes Jenna from your party
 080AE10A = This removes Sheba from your party
« Last Edit: January 03, 2014, 01:37:57 AM by Teawater » 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
Thunder-squall
Mercury Clan

Great Member
*

Coins: 0
Offline Offline

Posts: 538

« Reply #17 on: January 03, 2014, 02:51:35 AM »

yup, cloning's the idea.  Like fighting Dittos (the pokemon).
Logged
View Profile
Misery
Bad Luck

Great Member
***

Coins: 2
Offline Offline

Gender: Male
Clan Position: Mercury Hack Leader
Posts: 709

« Reply #18 on: January 03, 2014, 02:23:15 PM »

Damn, why didn't I check the documentation right away? I'll keep that in mind from now on.

So, I found the following:
080D2AC0: Store r0 to 02000420 (room) (r0 = 00 at time of execution)
080D2AC8: Store r1 to 02000422 (entrance) (r1 = 08 at time of execution)

This takes the player to the prologue. But how do I find where these values are set in their respective registers? I can't execute instructions backwards...

Also, looked in r14 for the return address like you suggested earlier.
020086A5.
Looked in the GS map editor.
Instructions end at 020086A4.
Grrr... clearly, I must be missing something.
Logged
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

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

« Reply #19 on: January 03, 2014, 04:15:11 PM »

That's warping to Room 0, Door 8, yes. And the function you are looking at is the Warp To function as listed in the Hacking Documentation. All it does is set three RAM values. (Including those two) There may be other similar functions as well, but anyway.. This function is, ofcourse, called in Map Code, as you have shown. The arguments should be at 0200869C (r0=0) and 0200869E (r1=8) ...

When in the middle of a function, don't always rely on r14 giving you your insisted return address all the time, since when functions call other functions, functions usually push their return address into the stack. (And there are some functions that can use r14 as a normal variable, but it's not very common.)
« Last Edit: January 03, 2014, 04:36:23 PM by Teawater » 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
Misery
Bad Luck

Great Member
***

Coins: 2
Offline Offline

Gender: Male
Clan Position: Mercury Hack Leader
Posts: 709

« Reply #20 on: January 03, 2014, 05:04:30 PM »

The arguments should be at 0200869C (r0=0) and 0200869E (r1=8) ...
This does not appear to be the case, at least not for map 0. Only zeroes at those addresses.

Quote
When in the middle of a function, don't always rely on r14 giving you your insisted return address all the time, since when functions call other functions, functions usually push their return address into the stack. (And there are some functions that can use r14 as a normal variable, but it's not very common.)
Right, you did mention that... so how can I see what's on top of the stack?

Also, big wow to the documentation. I don't think I had realized just how much info there is there. Although finding a specific function can take a while...
« Last Edit: January 03, 2014, 05:07:42 PM by Misery » Logged
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

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

« Reply #21 on: January 03, 2014, 11:46:08 PM »

How could I be wrong, when it is all here in the attachment? Hmm?

The stack? I would do mw sp (As long as the stack address wasn't temporarily modified.), but the function return is not always on the very top, so you have to look until you find one that looks like a function return. (It's usually noticeable.) You do not have to worry about that for this particular function, as I don't think the function return was ever pushed. (Sometimes it doesn't get pushed when you don't have calls in the function.)


* mapcodewarpto.png (32.29 KB, 619x706 - viewed 472 times.)
« Last Edit: January 04, 2014, 12:04:16 AM by Teawater » 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
Misery
Bad Luck

Great Member
***

Coins: 2
Offline Offline

Gender: Male
Clan Position: Mercury Hack Leader
Posts: 709

« Reply #22 on: January 04, 2014, 12:20:44 AM »

That's the VBA's memory viewer, right? I guess there's some magic (well, code) going on that puts those arguments into RAM at runtime, as it doesn't seem to be in the decompressed code for that map. Speaking of... it's kind of a pain that you can't access those functions from the SDL-H version (memory viewer, disassembler, a few other things...).

Well, ultimately, what I'm really looking to figure out is how to find out where a function is called from in the map code. It's clearly not as simple as looking for the address of a function getting loaded into memory, except for a select few cases. Even then, there has to be a better way than scrolling through all the code...

Logged
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

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

« Reply #23 on: January 04, 2014, 12:23:51 AM »

From your breakpoint in SDL-H, You could execute (n) code until you exit the function, and then type in dn. (Sometimes, I might even look for the end of the function in VBA, and go rtt (address of last instruction.), and then hit n to exit, and then dn. However, this function is short enough to not have to worry much about that part.)


Anyway, I think I might check that bit in Atrius's Editor soon, So I can inform you on whatever the problem may be.
« Last Edit: January 04, 2014, 12:28:45 AM by Teawater » 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
Misery
Bad Luck

Great Member
***

Coins: 2
Offline Offline

Gender: Male
Clan Position: Mercury Hack Leader
Posts: 709

« Reply #24 on: January 04, 2014, 12:54:21 AM »

Alright thanks, that seems to get me on the right track. I've been trying to find some other functions so it's not just the "warp to" function I'm looking at... right now, I'm trying to find where the "set party leader to Jenna" is called from. And it looks like I just found it.

So you think it might be an error with the editor? That... might make a bit more sense, admittedly.
Logged
View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

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

« Reply #25 on: January 04, 2014, 01:04:19 AM »

I think the problem is that you are looking at the wrong Map Code file.

You are suppose to be looking at Map 1 (UTIL)
« Last Edit: January 04, 2014, 01:07:38 AM by Teawater » 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
Misery
Bad Luck

Great Member
***

Coins: 2
Offline Offline

Gender: Male
Clan Position: Mercury Hack Leader
Posts: 709

« Reply #26 on: January 04, 2014, 01:09:59 AM »

Oh, right... I didn't realize it switched maps.
Well, I guess that settles that.

Edit: Woohoo, it worked! The game now starts at the point where you get control over Felix. Now I just need to make sure Jenna isn't in the party when the game starts, then I think I'll post a patch for this...
« Last Edit: January 04, 2014, 01:25:27 AM by Misery » Logged
View Profile

Regular Member
**

Coins: 0
Offline Offline

Posts: 64

« Reply #27 on: October 07, 2015, 04:17:19 AM »

Anyone interested in helping with some ASM stuff for hajimari no ishi? I'm looking for someone that can change the sjis to ascii  ( so that each char occupies 1 byte instead of 2). Also a VWF to help that change.
Logged

View Profile
Fox
Fox McCloud, the Hacking Doctor
Mercury Clan

Prodigy
*

Coins: 28
Offline Offline

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

« Reply #28 on: October 07, 2015, 04:52:19 AM »

Can't say... I'm probably the only one here at GSHC ("here" applies to those that pop in regularly) to consider it...(?)  I remember looking into the code a long time ago... and I believe at some point deciding not to really work on it... for some reason? Could have been due to how time consuming it might have been(?) (Not sure of its difficulty level...)

VWF = ???

I take it that http://forum.goldensunhacking.net/index.php?topic=2488.msg44352#msg44352 is still the latest update?

While one method /might/ be to have the 8-bit chars be indexes to a 16-bit char table... (In some way... while noting char pairs...) It's probably better to just go straight to 8-bit chars and update the font..? I um... Not know how difficult that is... sso may need to look it up. What tool was being used to import the text again? https://github.com/wangds/sncsm3 This one? (I think it was obsolete?)

And if I'm lucky... (Assuming I jump back in this? Haven't quite decided.) ...perhaps I will see about putting the GS Text Compression in the game.... But anyway.. It's probably unlikely that I'll do that... especially since compression might not be necessary... But you never know.


Edit again: Either way, I'm in no rush... and will hypothetically-speaking be months until I would show progress if I do.(?) ... so assume I've filled in no positions...
« Last Edit: October 07, 2015, 09:44:43 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

Regular Member
**

Coins: 0
Offline Offline

Posts: 64

« Reply #29 on: October 07, 2015, 10:55:31 PM »

Can't say... I'm probably the only one here at GSHC ("here" applies to those that pop in regularly) to consider it...(?)  I remember looking into the code a long time ago... and I believe at some point deciding not to really work on it... for some reason? Could have been due to how time consuming it might have been(?) (Not sure of its difficulty level...)

VWF = ???

I take it that http://forum.goldensunhacking.net/index.php?topic=2488.msg44352#msg44352 is still the latest update?

While one method /might/ be to have the 8-bit chars be indexes to a 16-bit char table... (In some way... while noting char pairs...) It's probably better to just go straight to 8-bit chars and update the font..? I um... Not know how difficult that is... sso may need to look it up. What tool was being used to import the text again? https://github.com/wangds/sncsm3 This one? (I think it was obsolete?)

And if I'm lucky... (Assuming I jump back in this? Haven't quite decided.) ...perhaps I will see about putting the GS Text Compression in the game.... But anyway.. It's probably unlikely that I'll do that... especially since compression might not be necessary... But you never know.


Edit again: Either way, I'm in no rush... and will hypothetically-speaking be months until I would show progress if I do.(?) ... so assume I've filled in no positions...

VWF = Variable Width Font

I use the gbatemp thread, but this one has information from Aent. He made exactly the same attempt, but dissapeared and never reported back (his mail's saviorkross@hotmail.com, but no idea if you will contact him, i couldn't at least) he made a tool to get the script:

as far as things goes i think that aent taking care of the hacking part as he must be decyphering the missing opcodes. that is an useful part. as you say now we need to find a way to make the script fit.

I've been working on it on and off in my spare time, but I am pretty new to all this. That tutorial you posted was quite helpful so my thanks to whomever wrote it and to you for posting it.

Ideally I want to break the limit of the current text blocks(PSI3 segments which is what is shown in my last post) so we can have a fuller translation. As it is now, each text block links to the others either by an index number to an array of pointers or a pointer of it's hex location. Still investigating that. If for instance, you take one segment, say the mine entrance right after the intro, and replace it with another. As soon as you leave after fighting VE it will warp you to the new location instead of the mine. In my case it was from there to the shop in the first town. If I walked out of the shop then, it took me outside into the town as it normally would. This tells me that the locations that they lead to aren't linked to the current text blocks location in the game file. If we were to pull out all the text blocks, put our full translation in and put them back in, they would run out of room. Sort of like putting 4 rectangles where 4 squares are supposed to fit. The way to fix this is put them in as normal and once we run out of room for the next one to fit, move it to free space and adjust the pointers as needed for all the text blocks. With luck it will be some sort of array, but I'm not sure honestly. I have located a value that if changed links to various locations and battles but more investigating is needed. As for the max rom space issue of 32mb, I'm not sure how close we'll come to that. I forget how much free space was said in the other thread. Something like 280kb? I'll have more on that situation soon I hope.

Download here.
I'm gonna include the program I use to dump the text blocks as well as a .bat file to use with DSDecmp. Just unzip to a folder with "sn3.gba" in it.(without the quotes). Doubleclick dumptexts.exe and it will dump the encrypted texts to the folder "output". Their names will be in the form of "decimal_hex". Then, with DSDecmp.exe in the original folder, doubleclick dsdecmp_folder.bat and it should make a folder called output_dec. Those will be the decompressed ones as shown in my last post. They include the original script, events, etc, albeit in a fairly unreadable form except for the actual script. For those of you who wish to see the code of dumptexts.exe, it's in src. You'll need GCC to compile most likely. I plan to include any programs/tools I create and their source as I don't want my progress for better or worse to be lost if something beyond my control should happen, lol. Beware I have some experience with C, but am certainly no expert and use google quite often.

If any questions/comments/tips/criticisms, etc I'll try and be more active here to see them. I can't promise I'm the answer to what you've been looking for, but I'm willing to try and help, lol. My apologies for the late response as well as the text-wall.


p.s. Offsets.txt will be created as well. It's just a list of all the starting locations of the compressed segments in hex. Also, not all the txt files will be story dialogue. Some are just empty rooms or lead to battles and such. Also, some might be two different parts of one location. For instance, in the first game I had one for the intro dialogue and one for map items. ("...may..." cutscene for the dialogue and in a separate text for picking up the entrance ticket as well as the placement and teleport location of the stairs)

Yeah, updating the font will be best too since it's too big.

Thanks for the reply though, hope it's not hard as it seems to be.

Edit: Here's aent latest progress before disappearing:

http://oi58.tinypic.com/jsk5yu.jpg
http://oi61.tinypic.com/28jcdgi.jpg

For example, 0x8260 used to give us the character 'A'. Now, just 0x60 produces the same character so we save a fair amount of space for adding in the translation. Another thing to notice is the gaps between letters. This will have to be repaired with a variable width font when the time comes. That will most likely be one of the last things I do.
« Last Edit: October 08, 2015, 12:29:34 AM by pablitox » Logged

View Profile
Pages: 1 [2] 3 4 ... 7   Go Up
  Print  
 
Jump to:  

Cbox
Yesterday at 10:49:52 PM
roger: I can post but it goes to an error page when I submit.
Yesterday at 05:24:12 PM
zman9000: Site is back WOO!
May 09, 2018, 12:35:37 AM
KyleRunner: The "Start In" field is not editable... I'll try making new shortcuts
May 08, 2018, 09:51:08 PM
Fox: If all else fails, you canmake new Shortcuts to do the same thing.
May 08, 2018, 09:49:53 PM
Fox: Export Properties > Shortcut (Tab) > Target / Start In ; Target (for Export) should be: (filename) 0 , and for Import: (filename) 1
May 08, 2018, 08:52:00 PM
KyleRunner: I can't change the path in properties menu...
May 08, 2018, 01:27:19 AM
Fox: You may need to edit something in properties, though... so it uses the exe file in the same directory.
May 08, 2018, 01:24:59 AM
Fox: It is suppose to be a shortcut, yes.
May 03, 2018, 11:48:05 PM
KyleRunner: Fox, the "export" function in your text editor is just a shortcut... Could you please fix it?
May 02, 2018, 09:53:45 PM
KyleRunner: I come here everyday. I'm working on a Portuguese translation, and the people here help me a lot.
May 02, 2018, 08:56:07 AM
Drake baku: My feel as well, I posted a little as well since my return, but silence was all that followed... At least the forum is a great source for data when hacking GS/ GS2, currently looking for something I have read a long time ago cause my PP recovery psy is not working
May 01, 2018, 09:58:04 AM
Fox: I am thinking a lot of this might be because of Discord?
May 01, 2018, 09:56:08 AM
Fox: Yeah, this forum is more dead than ever before.  February and April have 0 new topics. (All other months prior have more.) And March has lowest number of new posts. (It'd be dumb to count the very first month this site was created.)
April 25, 2018, 09:02:13 PM
Fox: Yes. The best tool is a hex editor. Well.... VBA, VBA-SDL-H, no$gba Debugger, GBATEK, and my documentation.... to use these to learn how the code/data works. Best method because it maximizes your editing ability... and then there is my program gsmagic that I was working on. Still in its early stages, though. (Even after year(s).)
April 25, 2018, 04:21:58 PM
Xendrox D: *exept tla editor.
April 25, 2018, 04:21:29 PM
Xendrox D: is there any other tool for hacking gs?
April 23, 2018, 09:26:27 PM
Atrius: Rarely, but not never.
April 23, 2018, 08:01:48 AM
Drake baku: Can it be, the god who created the editor, atrius. I heard you never came back online here anymore
April 20, 2018, 02:46:36 PM
KyleRunner: Atrius!!
April 19, 2018, 11:29:46 PM
Atrius: @Fox, I tried, but for some reason Mario Golf won't boot, and Mario Tennis crashes when you patch out the text compression, and I'm not sure why...  The normal text loading functions in them are basically the same as the ones in the Golden Sun games.

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.11 seconds with 29 queries.