• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Forum moderator applications are now open! Click here for details.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Tool: Visual Boy Advance SDL H2

Status
Not open for further replies.

JPAN

pokemon rom researcher
104
Posts
15
Years
  • Seen Jul 2, 2016
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.
 
Last edited:

Full Metal

C(++) Developer.
810
Posts
16
Years
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:
 

JPAN

pokemon rom researcher
104
Posts
15
Years
  • Seen Jul 2, 2016
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.
 

Full Metal

C(++) Developer.
810
Posts
16
Years
I see, this is unfortunate.
Thank you for the info, though! (:
[ and the seriously needed updates to vba-sdl-h! ]
 
1
Posts
12
Years
  • Seen Jun 14, 2015
Wow!

Looking Good. I'm Gonna Use it right now for my new hack im working on. :)
 

Full Metal

C(++) Developer.
810
Posts
16
Years
> 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.
 
Last edited:

JPAN

pokemon rom researcher
104
Posts
15
Years
  • Seen Jul 2, 2016
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.
 

FlameShocker

C++/ASM Programmer
64
Posts
15
Years
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,
JPAN said:
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.
 
Last edited:

ruby

[span="howdy;partner"][/span]
1,390
Posts
20
Years
  • Age 31
  • Seen yesterday
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.
 
91
Posts
14
Years
  • Seen Feb 22, 2023
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
 
1,762
Posts
14
Years
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.
 
Status
Not open for further replies.
Back
Top