![]() |
Calling All ASM Experts!
I am currently working on a hack of Emerald. After showing some of my progress to my father (a professional software developer), he had an interest in developing a tool to simplify and make using ASM simpler for average hackers (like me *cough*). I made this thread to ask, not being well versed in ASM (just sent him every tutorial and resource I could find), what features hackers out there would like in such a tool. Also, any information on the topic is useful. He has specifically requested:
Thank you to FlyingWaffle for these links! devkitPro ARM Info Center GBATEK Manual CowBiteSpec Tonc - GBA Programming Manual ARM7TDMI Reference Manual However, in his words, "I want every piece of information on Emerald possible. If someone else knows it, I want it. I'll care if it's useful later, but I want to read it first." I'd like to hopefully make a large repository of all the information we can assimilate here. Links to other threads/posts are perfectly fine if you don't want to post redundant information. (I'll save copies of other threads and posts on my own.) I would just like to gather as much data on a wide range as possible. To make this easier and less messy, using a form like this would help: Topic: .... Information: .... Link(s): .... Anything else?: .... Thank you in advance to everyone who contributes! (PS. As of now, this is only for Emerald. Sorry to FireRed hackers.) |
Automated routine writing? There's a reason we have programming languages, you know. They're abstractions on a system that can't be satisfactorily automated. Creating something that can create anything you want is basically impossible.
A list of commands available in GBA ASM? The GBA uses an ARM7TDMI processor, which has two instruction sets: ARM and THUMB (It can also emulate the Z80 instruction set for GameBoy Color compatibility). Really, a simple Google search for "THUMB opcodes" will give you numerous resources on this. Additionally, there are numerous assemblers out there with their own manuals, namely GCC. However, if it's a GBA hardware manual you want, the extensive GBATek manual helps a lot (I can't post links as of yet, but you should have no problem searching for it) Most of these resources can be uncovered with a quick forum search. As far as I'm aware, most of the people who frequently work with ASM here use IDA pro for all their assembly needs. As this is proprietary, I highly doubt you'll have much luck with that second item. VBA is dead. It is no longer maintained. The VBA-M team has taken over development of this, but the codebase is horribly cluttered and virtually impossible to refactor successfully (it's riddled with globals and other things that make running multiple instances in one process a nightmare). However, there are all sorts of useful bits in there. I'm currently working on a C++ library that will allow a custom emulator to be built with relative ease. The source code for this library is not available as of yet, but I will be releasing it when I actually have made good progress. Otherwise, you can find VBA-M's source on their SVN (again, Google is your friend), or in a multitude of GitHub repositories. I'm reserving judgement on this though. Your father seems to be asking an awful lot that could have been resolved with a few seconds of searching (a lot less time than writing that list). Wikipedia would have told you to look for VBA-M, and the first thing a seasoned software developer would have done would be to perform an SVN checkout - it is under the GPL, so obviously someone must have the source. |
Simple and user-friendly asm hacking program would work kinda like XSE or other script editors do;
It could disassemble any routine you want by just telling it the address where the routine is, and you could use it write your own code at any rom address you like (and possibly also make it possible for the program to look for space for the routine and insert it there). If you wanted to "enhance" it by one way or another, I would suggest adding support for other systems (like GB/C CPU (~z80)) as well. |
Quote:
I am very aware that the VBA project is dead. I asked if anyone had the 1.8.0 source code because I did indeed read about VBA-M and heard that the code was quite a mess. If finding the 1.8.0 code is impossible, then it is. But I'd like to keep searching. And as I am still gathering information, it seemed a lot simpler to ask "does someone have the file?" because I cannot find it. Please do not assume that I did not do research, and that I have any intent other than to simply ask people for information in hopes of helping this come to fruition. I have already searched the PC forums and archives as well as other websites, but there is always information missed. An obscure topic that I didn't see. Something someone hasn't written into a document yet. Something where the link is dead. That is the kind of information I am hoping for. It's a shame that the IDA pro software is not open source, but it can't be helped. However, it's wonderful that you are working on that library, and I hope it progresses well. Quote:
|
I'm sorry I assumed that you had not done your research. I just thought that since you were asking for 1.8.0 that you didn't know about VBA-M. The latest stable release of the original VBA project is 1.7.2, and its source can be found on their SourceForge page (I can't link to it yet, but it's on Wikipedia).
I would suggest you stay away from it anyway, as it has the same problems as VBA-M. There is actually no advantage to using VBA over VBA-M. You'd just be using an outdated codebase. The VBA-M project just merged a variety of modifications to the original VBA - they didn't perform much refactoring. I plan to get around this mess by encapsulating my new code as best as possible, and then attempting to use multiprocessing to run each instance of the emulator in a separate process. The best possible (open source) alternative to IDA is radare. I suppose you could look into that, but IDA is pretty unique. Anyway, may I ask what language you're thinking of writing this in? As well as what languages your father is most experienced in? |
Quote:
He plans to write the program in C/C++, which is also the language he is most experienced in. He has experience with a large number of languages (he actually wrote a prominent language for the Atari 8bit computer series, but that's just a fun age check), but is fairly adamant that he wants to use C/C++. We do not have any non-Windows OS' between us, so it's almost certainly only going to have Windows support. |
Quote:
Additionally, many people would like to integrate this tool into their own. Maybe you could look into something like SWIG, to allow generation of wrapper libraries. This would allow the majority of the codebase to be written in C/C++, but the GUI to be implemented in Python, or another higher level language. Additionally, any of the low level functionality could be utilised in other tools. Otherwise, you could at least create a shared library containing the core functionality (written in cross-platform C) and implement your GUI front end separately (with all the Windows-only functions). This would ease porting to another language and integration, particularly if you open sourced it or provided the headers for this library. |
Quote:
Quote:
|
Quote:
Another option would be to use Cygwin to force POSIX compliance on Windows. |
My suggestion for such a tool would be to condense this down into the help document(s). Even with a pretty good understanding of the ideas of programming, I had only ever worked with higher-level languages before trying the GBA's ASM. I reread that document more times than I could count trying to remember what all the useful commands were and how they interacted.
It's really the subtle things: The differences between the lower and upper register numbers. The purposes of r14 and r15. How pushing a register saves the current value for later, and popping eliminates the current value in favor of a previously pushed one. The differences between using "r0" and "[r0]". When to use ldr or mov. The difference between "add r0, r1" and "add r0, r1, r2". When to use b, bl, bx, or blx. Something akin to XSE's "command help" feature would be invaluable for this sort of thing. A compiler, a decompiler, and a reference guide will go a long way toward helping new ASM hackers. |
Quote:
Quote:
|
Would it be possible to create this in the form of an IDA PRO plugin? Like having an extra option to directly modify anything you see., and then reload related pointers and stuff. Then it could work on FR too.
As for a list of commands: http://problemkaputt.de/gbatek.htm#thumbinstructionset |
Update: I spent last night teaching him how to play Pokemon. He just received the Pokedex. {XD} He's compiled the source code of VBA 1.7.2 and made his own changes to let him observe how Emerald works. He had to install Visual Studio 2003 to compile the code, though.
Quote:
However, thank you for the list of commands. That manual is a godsend. |
Quote:
|
Quote:
|
Quote:
damn, I wish my dad would play pokemon |
Quick list of things that no-one has mentioned yet that will be pretty necessary:
devkitpro_org - Free development environment for various consoles including GBA and NDS. infocenter_arm_com/help/index.jsp - Spec sheet for the processor used in the GBA and NDS (you'll have to search for the right one, it's listed on GBATEK.) problemkaputt_de/gbatek.htm - GBATEK specifications for GBA and NDS. cs_rit_edu/~tjh8300/CowBite/CowBiteSpec.htm - CowBiteSpec, similar to GBATEK. coranac_com/tonc/text/toc.htm - Tonc, complete tutorial and manual on GBA programming. Pretty much everything you'd need other than emulators/flashcarts is listed here. (Can't post links, replace underscores with periods.) |
Quote:
Those links are pretty useful, even if a few of them have been mentioned (GBATEK, for example). Queen Azura, maybe you should update the main post with all these links? |
Thanks for fixing the links!
Here are two reference manuals for the ARM7 processor used in the GBA: infocenter_arm_com/help/topic/com.arm.doc.ddi0029g/DDI0029.pdf infocenter_arm_com/help/topic/com.arm.doc.ddi0210c/DDI0210B.pdf I'm not quite sure which one is the right one since the revised copy was released right after the GBA itself was released. (Same deal with links, sorry.) |
Quote:
Quote:
Quote:
|
Quote:
And yeah, I can confirm it. Your dad is 100% surely a dad. |
Update: My father trained all 5 of his Pokemon up to level 10. Before he entered Petalburg. Dat grind...
Quote:
|
Quote:
Quote:
|
Quote:
|
Because Pokemon has a grid based movement system, diagonal movement would be impractical. Since the GBA only has 4 directions on the arrow pad any diagonal movement would rely on pushing first one direction then the next. Since Pokemon is grid based (1 button push = 1 grid block movement) this simply results in moving over one, then up one (or whatever directions you pushed). Games like Legend of Zelda: Minish Cap can have diagonal movement because they don't have grid based movement. Minish Cap simply moves you in the direction you're pushing for as long as you push the button and then adds to or cancels movement depending on what other buttons you push at the same time (push both up & down makes you stop; push up & left makes you travel diagonally up & left until a button is released). Since Pokemon's collision system (for trees, grass, water, etc.) is based on the same grid as the movement system & since you'd have to remove the grid system for diagonal movement, this is WAAAY more work than would be practical. (I guess you could steal the movement system straight from Minish Cap but other than that your only option is to rewrite a pretty large chunk of the Pokemon game engine.)
Note: I don't actually know about the inner workings of Pokemon's game engine, so it may be harder or easier than I'm making it out to be. |
| All times are GMT -8. The time now is 8:50 AM. |
![]()
© 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.
Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.