Advertiser Content

Tool THUMB Editor & Assembler

Started by karatekid552 December 9th, 2013 1:11 PM
  • 8314 views
  • 12 replies

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,766 posts
7.4 Years

THUMB Editor & Assembler



So, I have always wanted to have a front end for HackMew's compiler since writing it up in notepad, opening up the command prompt, compiling the binary, and then dumping the contents into a rom honestly was just a little annoying, especially since I screw my code up so much and have to recompile far too many times. haha Either way, I finally got around to it. What this program is, is it is a very basic IDE for THUMB code that supports direct compiling to the rom, as well as a few other features:

~Simple syntax highlighting
~Test Compile
~Output to Binary
~Customize all editor colors
~.org dependent rom compiling
~Quick comment insertion

Syntax highlighting:
So, with this part, I really just wanted to improve the readability of code with a little bit of color. So, I added three types of highlighting: comments, large numbers, and labels.

-Comments are anything between "/*" and "*/" and get highest prioity over the other highlighting, meaning if you comment out code, it won't get the other highlighting (like a normal text editor).

-Labels are the heading for each section of your code, so in this piece:

Main:    ldr r5, .new_bg_table
        push {r5}
        push {r1}
        bl varloader
Main (and varloader) are considered labels. I honestly don't know what the real term for them is, but that is what I call them, otherwise they would just be "things ending in colons". These have the lowest priority.

-Large Numbers are like labels, but they serve to define static numbers that are larger than one byte. Most of the time, they look like this:

.new_bg_table:    .word    0x08F10000
As you can see, they have the same format as labels. So, I made it simple: if you start it with a period, it will get large number highlighting, and if you don't, it will get label highlighting. Now, I know I could have run a search to see if the next charactors were .word/.hword but I did it this way, so don't yell at me.:P (If you want it changed, by all means do so, the source code is right there will the download, haha)


Test Compile:
This option will basically compile your ASM into a binary and either return the errors or an "Assembled Successfully" message. Good for a quick test to make sure your code compiles. All temp files *should* get deleted once it is done.


Output to Binary:
This option works just like HackMew's batch file, the only difference being a "save as" dialog vs command line.


Customize all editor colors:
I really hope this doesn't need an explanation.......


.org dependent rom compiling:
This was a fun feature to implement. If your ASM has a .org, use this option, as it will jump ahead in your output file to that offset and start working from there. Without this, if you were to compile to the rom, you would get at ton of 00's inserted instead of your code.:P Currently, it doesn't search for the .org, you provide it, but I would like to automate that in the future.


Quick Comment Insertion:
Typing "/* */" can be cumbersome if you are moving quickly, so I just added a new feature: hit "ctrl+q" to quickly add a new comment. PLEASE comment your code. It helps so much.



---
I have been working on this for a while, and I released it on PHO on Nov. 16, but it wasn't the program I wanted it to be then. It had a lot of issues like: no normal saving, compiling required a console window open, the "open file" window didn't save where you were, etc. However, all of the big usage issues have been fixed and it is much more user friendly. So, now I'm finally releasing here on PC.

This program is in no way a response to ~Andrea's compiler. We took separate routes on this one and I urge anyone to try both and see which one you like best. Here is a link to that thread: http://www.pokecommunity.com/showthread.php?t=314358

This program is written in Python and therefore doesn't need the .net framework which allows it to run very well under wine if you are on Linux. (Main reason I use Python, haha.) The only reason it requires wine is because it runs the as.exe and objcopy.exe that HackMew's batch file used (hence, it being a "front-end gui") which only run under a Windows environment.

The future:


What I need to do:
-On close, it will NOT prompt you to save. I really need to add that in, but I haven't gotten to it yet.
-There is only a "save as" function, no regular just "save". Not a necessity, but it would be nice.
-Automated .org finding.
-Force pop-ups to stay in the foreground.
-Undo/Redo suck. No other way to put it. The Tkinter undo module is awful and I need to find a better way to do it.

What I might do:
-Customizable syntax highlighting so you can define your own highlights.
-More options like word wrap, disable syntax highlighting (you could just change all of the colors to match the foreground, but yeah...), and font changes.

Bugs:


None yet.:D

Screenshots:


Spoiler:







Disclaimer:


Please, always back up your roms. This program has been tested, but not extensively and something could go wrong. I am not responsible for a destroyed hack.

Download:


*Please note that this is my first ever GUI program, so the code is very messy and a little inefficient.




~karatekid552

Paired with Simba
Advertiser Content

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,766 posts
7.4 Years
Nice one, Roger! BTW I think a hex-dec calculator, like there's in XSE would be great. If there is, I probably missed it :p
That is a good feature! I will add it.

Paired with Simba

FBI

Free supporter

Male
Unknown Island
Seen January 26th, 2020
Posted December 17th, 2019
1,910 posts
7.2 Years
Congratulations on the release of a great tool! Lazy people like myself really appreciate the hard working people like yourself :P

While realizing the only purpose of this tool is to compile ASM code, I do have some suggestions that may help ease the process for the user.
The first one is to include a formatter. I'm not sure if you've seen one before, but generally good program tools have a format option that formats your code to be readable (note this doesn't fix bugged code). The second is to highlight errors and give error messages(the messages are a nice bonus, but jsut highlighting is great in and of itself).

I could help you with the formatter, but the error messages you're gonna have to do yourself :P
...

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,766 posts
7.4 Years
Congratulations on the release of a great tool! Lazy people like myself really appreciate the hard working people like yourself :P

While realizing the only purpose of this tool is to compile ASM code, I do have some suggestions that may help ease the process for the user.
The first one is to include a formatter. I'm not sure if you've seen one before, but generally good program tools have a format option that formats your code to be readable (note this doesn't fix bugged code). The second is to highlight errors and give error messages(the messages are a nice bonus, but jsut highlighting is great in and of itself).

I could help you with the formatter, but the error messages you're gonna have to do yourself :P
Thanks man.:P

Personally, the formatter would HAVE to be customize able, since everyone has a different format to their ASM that they like. However, things like auto-indent and such would be easy options and a nice touch.

The program already returns error messages from a compile, but checking for them as you type would be cool. However, the way I have been doing the syntax highlighting (searching for patterns using the built in search function and regular expressions) won't work, as I am beginning to notice a lag if I add another search area.

Paired with Simba

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,766 posts
7.4 Years
Just updated! xGal, I added your base converter. (May eventually add a full programmers calculator if I feel like it.:P) I also fixed a couple of saving bugs. (Nothing that would corrupt your save or anything, just annoying things about saving prompts.)

Paired with Simba

MrDollSteak

Formerly known as 11bayerf1

Age 25
Male
Hong Kong
Seen 2 Weeks Ago
Posted 2 Weeks Ago
853 posts
11.3 Years
As I've said before, seriously love this tool, it's really good.
I figured a glowing testimony here wouldn't do any harm :p

Lance32497

LanceKoijer of Pokemon_Addicts

Male
Criscanto town-Ginoa Region xD
Seen August 13th, 2017
Posted January 1st, 2017
793 posts
5.7 Years
The download link is broken
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.

karatekid552

What happens if I push it?....

Male
Do you really want to know? Really?
Seen January 12th, 2015
Posted December 14th, 2014
1,766 posts
7.4 Years
Download should be working again. I must have forgotten to remove the ad links when I was purging them from my other stuff. Sorry for any inconvenience. They now link directly to GitHub. If this is an issue, someone please email [email protected] as I am not very active anymore due to a crazy life.

Remember, this was my first program I ever wrote so it can have issues. Back up your roms!:)

Paired with Simba

Lance32497

LanceKoijer of Pokemon_Addicts

Male
Criscanto town-Ginoa Region xD
Seen August 13th, 2017
Posted January 1st, 2017
793 posts
5.7 Years
Download should be working again. I must have forgotten to remove the ad links when I was purging them from my other stuff. Sorry for any inconvenience. They now link directly to GitHub. If this is an issue, someone please email [email protected] as I am not very active anymore due to a crazy life.

Remember, this was my first program I ever wrote so it can have issues. Back up your roms!:)
Yayks!
Thanks for this tool!
This signature has been disabled.
Scrollbar appears
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.

Percy

Male
Asia
Seen 11 Hours Ago
Posted 5 Days Ago
3,012 posts
5.6 Years
The tool looks great! Now I can use this instead of Notepad, and HackMew's compiler.
Advertiser Content