News:

As a consequence of the forum being updated and repaired, the chatbox has been lost.
However, you can still come say hi on our Discord server!

Main Menu

Post your GBA ASM Questions here.

Started by Daddy Poi's Oily Gorillas, 03, November, 2010, 06:10:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Misery

#20
Quote from: Teawater on 03, January, 2014, 11:15:11 AM
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.

QuoteWhen 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...

Daddy Poi's Oily Gorillas

#21
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.)
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...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Misery

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...


Daddy Poi's Oily Gorillas

#23
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.
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...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Misery

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.

Daddy Poi's Oily Gorillas

#25
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)
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...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Misery

#26
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...

pablitox

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.

Daddy Poi's Oily Gorillas

#28
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...
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...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

pablitox

#29
Quote from: Fox on 07, October, 2015, 12: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...

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:

Quote from: Aent on 01, August, 2014, 01:04:56 AM
Quote from: pablitox on 31, July, 2014, 04:06:59 PM
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.

Daddy Poi's Oily Gorillas

#30
Hmm... Interesting? So those images make it look like he has already made the font arrangement/swapped to 8-bit.... But I guessing he never released the tools on that end? (Only the extraction ones?) Or did I miss something?

[spoiler]That moment when you find out you can't keep multiple spoilers open at a time on romhacking.net.... almost makes gshc spoilers seem much better than I thought... after thinking they were tacky.[/spoiler]
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...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

pablitox

Quote from: Fox on 07, October, 2015, 09:56:00 PM
Hmm... Interesting? So those images make it look like he has already made the font arrangement/swapped to 8-bit.... But I guessing he never released the tools on that end? (Only the extraction ones?) Or did I miss something?

[spoiler]That moment when you find out you can't keep multiple spoilers open at a time on romhacking.net.... almost makes gshc spoilers seem much better than I thought... after thinking they were tacky.[/spoiler]

exactly, dissapeared without a trace, such a shame.
They are horrible indeed. You can try contacting blackdog61, the guy can give you sound advice. for sure.

pablitox

how to toggle debugging on/off on vba sdl h?????

Salanewt

How do you mean? The debugging window should always be active, but you can delete breakpoints and the like to stop it from breaking frequently.

bt [address] = breakpoint
bd
  • = breakpoint delete
    bpw = breakpoint write
    bpwc = breakpoint write clear
    bpr = breakpoint read
    bprc = breakpoint read clear
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?

Daddy Poi's Oily Gorillas

#34
I think the question might be more related to VBA-SDL-H bug(s)...?
Since well... in a certain game... even if you haven't set any breakpoints... you keep getting a breakpoint on read. (Making it nearly impossible to debug.)
I doubt that there are features for toggling overall debugging in vba-sdl-h, and if there are... then I wouldn't know.

Or does the question relate to something else?
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...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

I am very likely to start learning GBA ASM soon and making something with it.
I read much already, but am still left with some questions:
-What is a good development enviroment/kit?
-Where is a list of all opcodes/command? I mean, ARM has an online document, but it wasn't made for GBA.
-What is the size of the GBA's address bus? I could not find a clear anwser on the internet.

I might ask some more questions when I finally start, but I'll let you know.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

#36
@1 = Can't say, but there's a list here, at this old website. http://www.gbadev.org/tools.php?section=Build (devkitadv is pretty old, so if that was looked at, then you can also consider devkitpro... assuming you can get it to work.)

@2 - One of my favorite GBA resources is GBATEK. Never under-estimate what information it offers. (Not to mention, the same guy has documents for other hardware as well. - Like SNES/etc.)
http://problemkaputt.de/gbatek.htm

(You can just go to the Thumb/Arm sections. Thumb recommended for people who are pretty new.... as ARM basically has the same opcodes, but a bunch more.

#3: Address bus? (You mean how memory addresses are 32-bit.. ? Or what?) All R0-R15 are 32-bit... so it is easy enough to pop a 32-bit address in, and load data that is either 8-bit, 16-bit, or 32-bit. (Or 64-bit if using ARM... (e.g. LDRD , which sends the result to two registers.)) - The entire ROM section is available immediately on the memory map, so you don't have to worry with any I/O stuff like you would for the NDS/etc...
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...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Fox on 19, October, 2016, 11:03:14 AM
@1 = Can't say, but there's a list here, at this old website. http://www.gbadev.org/tools.php?section=Build (devkitadv is pretty old, so if that was looked at, then you can also consider devkitpro... assuming you can get it to work.)
Thanks!
Quote from: Fox
@2 - One of my favorite GBA resources is GBATEK. Never under-estimate what information it offers. (Not to mention, the same guy has documents for other hardware as well. - Like SNES/etc.)
http://problemkaputt.de/gbatek.htm (You can just go to the Thumb/Arm sections. Thumb recommended for people who are pretty new.... as ARM basically has the same opcodes, but a bunch more.
Okay I missed those sections...
But it is what I needed.
Quote from: Fox
#3: Address bus? (You mean how memory addresses are 32-bit.. ? Or what?) All R0-R15 are 32-bit... so it is easy enough to pop a 32-bit address in, and load data that is either 8-bit, 16-bit, or 32-bit. (Or 64-bit if using ARM... (e.g. LDRD , which sends the result to two registers.)) - The entire ROM section is available immediately on the memory map, so you don't have to worry with any I/O stuff like you would for the NDS/etc...
Well, now I think about it, I don't know how it is called on the GBA. I basically mean the amount of pins come out of the CPU and specify where the data bus should be linked to.

I know the ROM is in the memory map, it was more of a thing that has to do with R15.
From what I already understand, R15 contains the Instruction Pointer AND status flags.
Like you said, Registers are 32 bit, but if R15 contains both, the address bus (as I call it) must be less than 32 bits.
If the GBA has 32 pins for addresses, that means it can address 4Gb, which is clearly not the case...
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"

Daddy Poi's Oily Gorillas

#38
You are welcome..

Sounds good..

QuoteI basically mean the amount of pins come out of the CPU and specify where the data bus should be linked to.
Still a little bit confused... Will have to figure out what this "pins" stuff is about, but I have a hunch you might be referring to SNES, so I should probably look it up.

QuoteFrom what I already understand, R15 contains the Instruction Pointer AND status flags.
Hmm? R15=PC=Program Counter  = Address of code to execute. The only "status flag" it would have is whether it is Arm or Thumb mode. (Least significant bit on right.) - I think by status flags, you should probably take a look at CPSR. (And/or SPSR as well.) - Status flags being conditional flags that say whether a conditional branch should be executed or passed. (For the most part.) But then there are things like the Mode stuff.

@4 GB = Although, there is an excess of empty stuff/mirrors .. so you'll only ever really be use addresses within the first bit... Most likely... (Unless you modded your GBA/emulator to support additions.)

Unused Memory Area

  10000000-FFFFFFFF   Not used (upper 4bits of address bus unused)
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...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Luna_blade

Quote from: Fox on 19, October, 2016, 03:10:41 PM
Still a little bit confused... Will have to figure out what this "pins" stuff is about, but I have a hunch you might be referring to SNES, so I should probably look it up.
No no, it has nothing to do with the SNES.
With pins, I mean the wires coming out of the cpu.
A CPU needs some of them to let the data bus arrive at the right place.

Quote from: Fox
Hmm? R15=PC=Program Counter  = Address of code to execute. The only "status flag" it would have is whether it is Arm or Thumb mode. (Least significant bit on right.) - I think by status flags, you should probably take a look at CPSR. (And/or SPSR as well.) - Status flags being conditional flags that say whether a conditional branch should be executed or passed. (For the most part.) But then there are things like the Mode stuff.
Oh okay, that cleared another thing up. I really fought the flags were in some registers.
Quote from: Fox
@4 GB = Although, there is an excess of empty stuff/mirrors .. so you'll only ever really be use addresses within the first bit... Most likely... (Unless you modded your GBA/emulator to support additions.)
Unused Memory Area
  10000000-FFFFFFFF   Not used (upper 4bits of address bus unused)
Well, you literally anwsered it here. 28bits it is.
"Hear the sounds and melodies
Of rilets flowing down
They're the verlasting songs
Whispering all the time
As a warning that behind some rocks
There's a rigid grap even
Oreads fear the tread"