The PokéCommunity Forums  

Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Sign Up Rules/FAQ Live Battle Blogs Mark Forums Read

Notices

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.


Advertise here

Closed Thread
Click here to go to the first staff post in this thread.  
Thread Tools
  #1    
Old October 8th, 2011, 07:24 PM
JPAN
pokemon rom researcher
 
Join Date: Dec 2008

Advertise here
After getting tired of working on my latest project, I decided it was time for something more relaxed and less time consuming. So, I decided to implement some new functionalities (and fix some old ones) on VBA-SDL-H.

Let me start by saying, I didn't make VBA. So, all credit to the original work goes to Forgotten and the rest of his team, and to all other contributers which can be found on the readme file (which I didn't alter), or in the VBA-SDL-H page.

So, what did I do to this new version? The changes aren't that big. Basically, changed the old breakpoint system to a new version that is capable of conditional breaking, and added support for string-viewing using a character table (with some modifications). But, to enumerating them:

Changed the way old Break worked
All breaks are now stored independantly in a new structure, and on memory, four flags are mantained that indicate the type of break that is present. They can be of ARM, Thumb, Read or Write.
The old method replaced the code at the location with the breakpoint symbol, and when it stopped there, it was replaced it with the actual code. That caused a somewhat annoying bug where the original code would be lost, leaving you with BE00 as the only knonw instruction code.
The old breakpoint symbol is still available for work, though, so normal, homebrew code should work as intended.

Created Conditional breaks
With the new system in place, you can now break anywhere equaly. But sometimes, you may wish to break only if a certain value was reached.(For example, when working on the item codes, sometimes I had to wait until the value written on memory was the item one. It took several passes.)
This new code allow for such situations. You can now only break when a certain value is reached, or when a set of conditions are met.

Created Register breaks
You can set a break on register change, that will break if a certain condition dependant on the register happened. This type of break is very heavy on the emulator, and can reduce maximum speed. My tests showed a difference from ~500% speed with it off to ~200% with it on. That is a big difference. When not in use, you can disable this behaviour by typing disable breg on the console.
Break on register may be useful for looping situations where you want to check certain values but not stop on that code every single time, or for loop-breaking interruptions that change a knonw register, but won't happen while only using next.

Table support
You can load a character table. It would work with the same one used with translhextion, and with some changes, would even print newlines and terminate strings correctly. With the tbl command, you can load such a table onto the emulator, and then with the ms command you can see the results. You can disable and re-enable the table behaviour using disable tbl, if you want to switch between ASCII and your string type. The other 'm' commands (such as mb), will always display ASCII, regardless of the table. That is because the Table entries can sometimes be quite big (5 characters long), and would create a new line, messing up the byte table.

Fill memory
Using the fillb, fillh and fillw commands, you can fill portions of memory with the byte to word of your choice.

Edit memory now accepts multiple entries
eb, eh and ew now allow for multiple consecutive entries. That means you can now enter any sequence of bytes you want, without repeating eb a number of times.

New quit commands
I got tired of trying to exit the debugger with quit when q was the right command. So, now adding to those two we also have exit and bye to get out. More can be added easily.

Command Alias
Same reason as above, but for some others. h, help and ? are interchangeable, continue for c, next for n. More can be added if needed.

Added to the Symbol evaluator
eval has been here for a while, and is used naturally on pretty much all commands that require number parsing. It did not support, however negate and negative operators. Negative is placing a - before the expression (-0x50), negate is placing a ~ before the number (~0x1). Could probably add more if needed, but the native VBA parser separates by using space, so expressions cannot contain spaces.

The contents of the ZIP file include the executable (windows only), Source code (so unix users aren't left out, the code is GCC compatible) if you want to check out how it was implemented (some stuff are wierd looking, but I guarantee, it's for performance reasons).
For instructions on how to use the controls, use help [commandName] for most instructions, or help breg for break register use, help break for generic break help, and help bm, bl, bd, bc for specific help with break make (bt, bw, br, and the like), break list (bl, btl, bxl, bil, and the like), break delete (btd, bwd, bad, and the like), and break clear (bc, bic, bac, and the like) respectively.

PS: A modified, emulator-ready table is also given.

EDIT:
Bug fixed. It now always show the correct break on ARM and THUMB breaks
Also, added new features:

Copy memory
Using the copyb, copyh and copyw, you can copy blocks of data from one location of memory to another, like from the ROM to RAM, or RAM to RAM.

Reload
Using the reload command, you can reload the currently open ROM, or open a new one by specifying the path afterwards.

Run commands from a text file
Creating a txt file with the commands you want to run (any of the defined debugger commands), then calling execute with the file. You can use it to run long breakpoint commands, or resume debugging a code location through several sessions.
__________________
Here are the links for my work


Currently working on:
Battle Script Documentation
Another large project

Last edited by JPAN; October 29th, 2011 at 03:32 PM. Reason: bugfix and new features
  #2    
Old October 9th, 2011, 11:12 AM
colcolstyles's Avatar
colcolstyles
Yours truly
 
Join Date: May 2008
Location: The Bay Area
Gender: Male
Nature: Lonely
This sounds awesome! Thanks, JPAN. I'm going to try it out right now. :)
__________________

Brother of Vrai
  #3    
Old October 9th, 2011, 12:25 PM
M.L's Avatar
M.L
Busy atm
 
Join Date: Oct 2010
Gender: Male
Haha another amazing tool by JPAN :D
__________________
Fluffy
  #4    
Old October 9th, 2011, 01:26 PM
Full Metal's Avatar
Full Metal
C(++) Developer.
Community Supporter
 
Join Date: Jan 2008
Location: In my mind.
Age: 19
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to Full Metal
Very nice! Did you fix the bug where the program occasionally will crash if the program is not shut down correctly?
[ I'm not sure how to describe it, excatly. ]
But that conditional breaking looks useful. :drool:
__________________

★ full metal.

I like to push it,
and push it,
until my luck is over.
  #5    
Old October 10th, 2011, 11:29 AM
JPAN
pokemon rom researcher
 
Join Date: Dec 2008
[QUOTE=Full Metal;6882098]Very nice! Did you fix the bug where the program occasionally will crash if the program is not shut down correctly?[/QUOTE]
Unfortunately, I couldn't really fix it. The bug lies with the SDL library, that crashes on exit (while trying to disable the sound device) if you previously clicked with your mouse on the window's exterior. The best solution is to always quit using either the Quit option on the debugger, or by pressing escape while in-game.
__________________
Here are the links for my work


Currently working on:
Battle Script Documentation
Another large project
  #6    
Old October 11th, 2011, 04:32 AM
Full Metal's Avatar
Full Metal
C(++) Developer.
Community Supporter
 
Join Date: Jan 2008
Location: In my mind.
Age: 19
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to Full Metal
I see, this is unfortunate.
Thank you for the info, though! (:
[ and the seriously needed updates to vba-sdl-h! ]
__________________

★ full metal.

I like to push it,
and push it,
until my luck is over.
  #7    
Old October 23rd, 2011, 06:34 AM
npo1229
Beginning Trainer
 
Join Date: Oct 2011
Looking Good. I'm Gonna Use it right now for my new hack im working on.
  #8    
Old October 23rd, 2011, 03:52 PM
Full Metal's Avatar
Full Metal
C(++) Developer.
Community Supporter
 
Join Date: Jan 2008
Location: In my mind.
Age: 19
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to Full Metal
> sh ./configure
wines about libsdl
> sudo apt-get install libsdl1.2-dev
installs a crap ton of packages
> sh ./configure
kay.
> make
HUGE amount of logs .... need to put @ prepending their commands... x)
A few errors
> make
debugger.cpp:33:34: fatal error: breakpointStructures.h: No such file or directory

-- I would manually do this, but I do not see a 'breakpointstructures.h' anywhere... :l
*edit*
I found it. Trying to figure out which directory it's in. #Ubuntu11.10
**edit**

tyler@tyler-desktop:~/Desktop/VisualBoyAdvance-1.7.2-H$ g++ -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE=\"VisualBoyAdvance\" -DVERSION=\"1.7.2-H\" -DHAVE_LIBZ=1 -DHAVE_LIBPNG=1 -DHAVE_LIBPTHREAD=1 -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_MALLOC_H=1 -DHAVE_STRINGS_H=1 -DHAVE_UNISTD_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_NETINET_IN_H=1 -I. -I../../src -DSDL -DSYSCONFDIR=\"/usr/local/etc\" -fno-exceptions -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -g -O2 -DPROFILING -DMMX -DDEV_VERSION -DBKPT_SUPPORT -MT debugger.o -MD -MP -MF .deps/debugger.Tpo -c -o debugger.o src/sdl/debugger.cpp -Isrc/sdl -I./.. -Isrc -Wno-write-strings -Wno-format -Wno-unused-result
src/sdl/debugger.cpp: In function ‘u8 getFlags(char*)’:
src/sdl/debugger.cpp:3027:7: error: expected unqualified-id before ‘not’ token
src/sdl/debugger.cpp:3041:18: error: expected primary-expression before ‘=’ token
src/sdl/debugger.cpp:3041:25: error: expected primary-expression before ‘)’ token
src/sdl/debugger.cpp:3045:8: error: expected primary-expression before ‘)’ token
src/sdl/debugger.cpp: In function ‘void executeBreakCommands(int, char**)’:
src/sdl/debugger.cpp:3433:1: error: jump to label ‘brkcmd_special_register’ [-fpermissive]
src/sdl/debugger.cpp:3383:19: error: from here [-fpermissive]
src/sdl/debugger.cpp:3395:7: error: crosses initialization of ‘bool hasAddress’


^ This. l:
I don't feel comfortable messing with the code. DX
What the heck did you build this thing with?! o.O
***edit***
also -- watch your file names. They're case-sensitive on unix.
__________________

★ full metal.

I like to push it,
and push it,
until my luck is over.

Last edited by Full Metal; October 23rd, 2011 at 04:10 PM.
  #9    
Old October 29th, 2011, 03:11 PM
JPAN
pokemon rom researcher
 
Join Date: Dec 2008
Quote:
Originally Posted by Full Metal View Post
I don't feel comfortable messing with the code. DX
What the heck did you build this thing with?! o.O
***edit***
also -- watch your file names. They're case-sensitive on unix.
Sorry about that. I tried my best to make sure it didn't happen, but apparently didn't catch them all. Fixed on the new release.

Actually, I had built this with visual studio 2005, and not on linux. So, some stuff GCC didn't like swept by in the code. Fixed most of those as well. Also, me and a friend spent four hours looking and fixing the makefile (from the original one provided, which I hadn't seen), and we couldn't really make it link all the files in Ubuntu. Don't know why, because the places it complained about (on the expression parser) didn't really make sense (were well defined). But, apart from the verbose warning system, there are only two errors on the end, that seem to be system dependant.
__________________
Here are the links for my work


Currently working on:
Battle Script Documentation
Another large project
  #10    
Old June 23rd, 2012, 09:41 PM
FlameShocker's Avatar
FlameShocker
C++/ASM Programmer
 
Join Date: Aug 2008
Location: Location: United States
Age: 20
Gender: Male
Nature: Hasty
I somehow managed to get the SDL version of this to compile in Linux Mint by using #include modifications and other stuff. However, it runs at double speed without using throttle. Since using the throttle makes the sound choppy, I'm working on a different way to make it run at normal speed.

I'll post the results as soon as I've got it working at normal speed.

Edit: I've got it working at normal speed now (without the throttle), but the sound emulation is now somewhat inaccurate (although it sounds better than just using the throttle) due to the way I modified the timing. Because of that, I don't recommend using this unless you can't run the Windows version in WINE at an acceptable speed.

Also, the TestEmu thing still doesn't compile, but that thing isn't necessary to begin with.

To save other people's time, I put my already-compiled version in with this.

Also,
Quote:
Originally Posted by JPAN
Let me start by saying, I didn't make VBA. So, all credit to the original work goes to Forgotten and the rest of his team, and to all other contributers which can be found on the readme file (which I didn't alter), or in the VBA-SDL-H page.
goes for me as well. Also, JPAN made the debugger, not me. I don't take credit for anything except the very small modifications that I made.
Attached Files
File Type: gz VisualBoyAdvance-1.7.2-H.tar.gz‎ (1.95 MB, 8 views) (Save to Dropbox)
__________________
Occasionally I do things related to ROM hacking, especially assembly stuffs.

Last edited by FlameShocker; June 24th, 2012 at 04:15 PM. Reason: added downloadable file
  #11    
Old June 25th, 2012, 03:23 PM
Counterfeit's Avatar
Counterfeit
 
Community Supporter Tier 5
 
Join Date: Mar 2004
Age: 21
Send a message via Skype™ to Counterfeit
This is awesome, I use VBA-SDL H to run my hack and the extra commands are going to be infinitely helpful.

What version of did you start off with out of interest?

Again, thank you. This is really going to help me advance with my hack.
__________________
eram quod es, eris quod sum
  #12    
Old December 21st, 2013, 09:11 AM
SBird
 
Join Date: Aug 2009
Gender: Male
Sorry to bring this up once again, but is it possible(well, I actually tried, and failed) to run 32MB roms with this modified version of the mod? I is always a nausance to me being forced to debug my code on a unmodified version of the original game, as well as doing research on the non-hacked version of my project...
I'm also unable to compile the project with newer versions of visual studio, because... reasons :D
Maybe someone will still respond to this, thanks in advance anyways!

~SBird
  #13    
Old December 23rd, 2013, 07:49 AM
giradialkia's Avatar
giradialkia
Community Supporter
 
Join Date: Apr 2009
Location: Ireland
Age: 21
Gender: Male
Nature: Timid
Send a message via Windows Live Messenger to giradialkia
Quote:
Originally Posted by SBird View Post
Sorry to bring this up once again, but is it possible(well, I actually tried, and failed) to run 32MB roms with this modified version of the mod? I is always a nausance to me being forced to debug my code on a unmodified version of the original game, as well as doing research on the non-hacked version of my project...
I'm also unable to compile the project with newer versions of visual studio, because... reasons :D
Maybe someone will still respond to this, thanks in advance anyways! :)

~SBird
Hi SBird,

I'm afraid this thread hasn't been posted in since June, which mean there's a gap of about 6 months between your post and the last post made in this thread. The rules of the Toolbox forum state that if more than 2 months have passed since the last valid post was made, then revival isn't allowed.

Just keep an eye out for the dates of posts before posting yourself, in case it'd be reviving a dead thread. :)

JPAN, on the offchance you'd like this thread reopened, just contact myself, DrFuji or karatekid552.
In the meanwhile, this thread will be closed.
__________________

This one's called 'Red', and it's actually kinda Pokémon themed, so have a listen! Check out the links below for more stuff, if you like this!



This is the Doctor
This is my Soundcloud
This is my bandcamp

My Pokémon Y character is the same as my username. If you see me as a Passerby let me know! I tend to get a lot of Passerby requests and I often wonder if it's people from this site.
Closed Thread
Quick Reply

Sponsored Links


Advertise here
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 09:01 PM.


Style by Nymphadora, artwork by Sa-Dui.
Like our Facebook Page Follow us on Twitter © 2002 - 2014 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 - 2014 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.