GBA Assembly

Spikeman

New member
I searched the site for awhile but I can't find any docs or info on assembly for the GBA. The only thing I could find is the name of the language which is ARM7TDMI. I am not a newcomer to assembly (I know z80) so I just need docs with technical info on the GBA and specifications for the language.
 
> I searched the site for awhile but I can't find any docs or
> info on assembly for the GBA. The only thing I could find is
> the name of the language which is ARM7TDMI. I am not a
> newcomer to assembly (I know z80) so I just need docs with
> technical info on the GBA and specifications for the
> language.

I'm not sure about any info here, but I'd try http://www.gbadev.orgGBAdev</a> if you haven't already. They have a HUGE GBA community and a steadily growing DS community as well.
 
> I'm not sure about any info here, but I'd try GBAdev if you
> haven't already. They have a HUGE GBA community and a
> steadily growing DS community as well.

Ugly Joe pointed me to that site and I looked over it and it seems to be for homebrew games not just a simple hack, but I probably will be able to find some useful info there.
 
> > I'm not sure about any info here, but I'd try GBAdev if
> you
> > haven't already. They have a HUGE GBA community and a
> > steadily growing DS community as well.
Sorry for the double post but it's better then starting a new topic I guess. I was just wondering if anyone knows where I can find specific information on actual GBA <u>hacking</u>. GBADev helped but I think info on actually hacking (not easy stuff like text or graphics but assembly) would be more helpful than just info on assembly.
 
> I was just wondering if anyone knows
> where I can find specific information on actual GBA hacking.

I'm nearly positive that documents specifically on GBA hacking don't exist. The best you'll probably find is archived threads on forums or irc logs.
 
> I'm nearly positive that documents specifically on GBA
> hacking don't exist. The best you'll probably find is
> archived threads on forums or irc logs.

What's up with that? Does nobody hack for gba? And where should I look for archived threads and irc logs?
 
> What's up with that? Does nobody hack for gba?

No, it's not that.

See, I guess nobody's bothered to tell you this before, so I suppose the burden falls on me to inform you of this: Not everything in life is going to be handed to you on a silver platter. I don't know if your parents did your homework for you, or if you cheated on tests, but sometimes you need to work towards a goal rather than having it complete itself magically in front of you. GBA hacking is relatively new, so if you're looking for someone to hand-hold you and do all of the hard work for you, then you should try hacking a different system. However, since I'm such a nice guy, I'll clue you into the fact that "ARM7TDMI" is not a "language". It is the type of processor used in the GBA. What you're looking for is a guide regarding ARM instructions and opcodes. You can find the ARM Architecture Reference Manual, which lists all ARM instructions http://dsl.ee.unsw.edu.au/dsl-cdrom/reference/arm-architecture-reference.pdfhere</a>. If you can't understand assembly language, though, then ROM hacking is not for you.
 
> Not
> everything in life is going to be handed to you on a silver
> platter.

I know that I just thought someone might be able to point me to some tutorials but I guess nobody has written any. Maybe if I get good I will.

> GBA hacking is relatively new,

I didn't know that. I figured that people would have hacked it because it has been out for what 5 years?

> clue you into the fact that "ARM7TDMI" is not a "language".
> It is the type of processor used in the GBA.

The place I read that ARM7TDMI was in Inverse's guide. Maybe I read it wrong though. I'll try not to make that mistake again. I don't want to be flamed and treated like a complete n00b.

> What you're
> looking for is a guide regarding ARM instructions and
> opcodes.

I already found one on gbadev.

> If you can't
> understand assembly language, though, then ROM hacking is
> not for you.

I already know some assembly (z80 for the TI83+) so I understand how to program it but I'm having trouble hacking a game because I can't find the spot where a certain bit of code is. If I knew where the spot was (or how to find it) I'm sure I could hack it fine. Any tips on finding where a certain bit of code is?
 
> If I knew where the spot was (or how to find it)
> I'm sure I could hack it fine. Any tips on finding where a
> certain bit of code is?

That depends on what kind of code you're looking for. The best way is to use an emulator that has some sort of integrated debugger/disassembler that supports breakpoints. Typically you just find a memory location (using a cheat search) that's modified by the routine you want to find, then you put a Breakpoint on Write on that address. Then you just need to work backwards to find the start of the function.
 
> Typically you just find a memory location (using a cheat
> search) that's modified by the routine you want to find,
> then you put a Breakpoint on Write on that address. Then
> you just need to work backwards to find the start of the
> function.

I'm trying to find the routine that prints text so I can do a DTE hack and I found the bit of memory that points to the next letter (actually it holds the address to the next letter). I'm using VBA which has a disassembler but I'm not sure about breakpoints. Know any GBA emulators with breakpoints?

EDIT: I found the spot I was looking for by fooling around with the emulator and eventually I was able to make it slow down enough so I could step through the code and I found the place I was looking for. I tried changing it to make sure it was the right spot. My goal was to make it always print one character. But that didn't work because there are control codes at the beginning of each thing of text so I'm going to try and make it replace a certain character with another one and then add in the DTE code that I already figured out.<P ID="edit"><FONT class="small">Edited by Spikeman on 08/09/05 05:17 PM.</FONT></P>
 
I'm having a problem. I finally figured out how to get the opcode for BL (the instruction that jumps to a subroutine) to work and I made it jump to the place where I put the exact code it replaced and then return but the game freezes up. I think the problem may be with the instruction I used to return which was: mov pc, lr. Can anyone familiar with gba assembly tell me why it might not be working?
 
> I'm having a problem. I finally figured out how to get the
> opcode for BL (the instruction that jumps to a subroutine)
> to work and I made it jump to the place where I put the
> exact code it replaced and then return but the game freezes
> up.

Well, why not step through the code in the debugger to see if it is, in fact, returning to the link register? Perhaps the link register is getting destroyed between the calling of the subroutine and returning from the subroutine?
 
> Well, why not step through the code in the debugger to see
> if it is, in fact, returning to the link register?

I had no way to stop it at the right point so I would have to step through a ton of code. But I did figure it out. The problem was that I just figured out the opcode from this reference sheet I got and put it in with a hex editor and I had the opcode wrong but the disassembler said it was right so I was confused. I fixed it by looking through the technical reference on the processor. So know I have the DTE hack all working and its pretty awesome that I got this to work. The only thing is now I don't know what to do because I am still learning Japanese so I can't translate much yet.
 
Back
Top Bottom