The PokéCommunity Forums Fan Games ROM Hacking Tools, Tutorials & Resources
Tool Visual Boy Advance SDL H2

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.

Closed Thread
 
Thread Tools
  #1    
Old October 8th, 2011 (7:24 PM). Edited October 29th, 2011 by JPAN.
JPAN JPAN is offline
pokemon rom researcher
     
    Join Date: Dec 2008
    Posts: 104
    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

    Relevant Advertising!

      #2    
    Old October 9th, 2011 (11:12 AM).
    colcolstyles's Avatar
    colcolstyles colcolstyles is offline
    Yours truly
    • Crystal Tier
     
    Join Date: May 2008
    Location: The Bay Area
    Gender: Male
    Nature: Lonely
    Posts: 1,584
    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 M.L is offline
    Invisible
       
      Join Date: Oct 2010
      Gender: Male
      Nature: Quiet
      Posts: 765
      Haha another amazing tool by JPAN :D
      __________________
      Fluffy
        #4    
      Old October 9th, 2011 (1:26 PM).
      Full Metal's Avatar
      Full Metal Full Metal is offline
      C(++) Developer.
      • Silver Tier
       
      Join Date: Jan 2008
      Location: In my mind.
      Age: 21
      Gender: Male
      Nature: Timid
      Posts: 805
      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 JPAN is offline
      pokemon rom researcher
         
        Join Date: Dec 2008
        Posts: 104
        [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 (4:32 AM).
        Full Metal's Avatar
        Full Metal Full Metal is offline
        C(++) Developer.
        • Silver Tier
         
        Join Date: Jan 2008
        Location: In my mind.
        Age: 21
        Gender: Male
        Nature: Timid
        Posts: 805
        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 (6:34 AM).
        npo1229 npo1229 is offline
           
          Join Date: Oct 2011
          Posts: 1
          Looking Good. I'm Gonna Use it right now for my new hack im working on.
            #8    
          Old October 23rd, 2011 (3:52 PM). Edited October 23rd, 2011 by Full Metal.
          Full Metal's Avatar
          Full Metal Full Metal is offline
          C(++) Developer.
          • Silver Tier
           
          Join Date: Jan 2008
          Location: In my mind.
          Age: 21
          Gender: Male
          Nature: Timid
          Posts: 805
          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**

          [email protected]:~/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.
            #9    
          Old October 29th, 2011 (3:11 PM).
          JPAN JPAN is offline
          pokemon rom researcher
             
            Join Date: Dec 2008
            Posts: 104
            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 (9:41 PM). Edited June 24th, 2012 by FlameShocker.
            FlameShocker's Avatar
            FlameShocker FlameShocker is offline
            C++/ASM Programmer
               
              Join Date: Aug 2008
              Location: Location: United States
              Age: 23
              Gender: Male
              Nature: Hasty
              Posts: 64
              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, 11 views) (Save to Dropbox)
              __________________
              Occasionally I do things related to ROM hacking, especially assembly stuffs.
                #11    
              Old June 25th, 2012 (3:23 PM).
              Josephine's Avatar
              Josephine Josephine is offline
              • Crystal Tier
               
              Join Date: Mar 2004
              Gender: Female
              Posts: 1,520
              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.
                #12    
              Old December 21st, 2013 (9:11 AM).
              SBird SBird is offline
                 
                Join Date: Aug 2009
                Gender: Male
                Posts: 83
                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 (7:49 AM).
                giradialkia's Avatar
                giradialkia giradialkia is offline
                • Crystal Tier
                 
                Join Date: Apr 2009
                Location: Ireland
                Age: 23
                Gender: Male
                Nature: Timid
                Posts: 1,561
                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.
                __________________

                I'm working on an album of Pokémon-inspired music. Check out the Soundcloud link if you're interested!


                This is my Soundcloud | | This is my bandcamp
                Closed Thread
                Quick Reply

                Sponsored Links
                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

                Forum Jump


                All times are GMT -8. The time now is 9:05 PM.