Please login or register.

Login with username, password and session length
Advanced search  

News:

Don't be hasty to start your own mod; all our FFT modding projects are greatly understaffed. Find out how you can help in the Recruitment section.

Pages: 1 2 3 [4]
xhai [Posts: 9]
  • View Profile
  • share
  • [January 11, 2013, 06:10:12 AM]
Re: (App) MassHexASM: Encode directly to little endian
« Reply #60 on: January 11, 2013, 06:10:12 AM »
sir is this same as madedit.. can you differentiate the difference.. I'm having trouble in string limitation.. i used madedit for psp translation
Glain [Posts: 456]
  • View Profile
  • share
  • [January 11, 2013, 04:20:36 PM]
Re: (App) MassHexASM: Encode directly to little endian
« Reply #61 on: January 11, 2013, 04:20:36 PM »
No, this program converts MIPS assembly language to machine code (encode) and vice versa (decode).  MadEdit is a hex editor (the one I use, actually, if I need to hex edit anything).
Glain [Posts: 456]
  • View Profile
  • share
  • [January 22, 2013, 12:18:03 AM]
Re: (App) MassHexASM: Encode directly to little endian (v11 Update: 1/21)
« Reply #62 on: January 22, 2013, 12:18:03 AM »
All right, I'm finally releasing v11.  This was a pretty big overhaul of the internals and should also provide support for a lot more commands (mostly PSP, but there were a few unsupported PSX ones as well like lwl/lwr/swl/swr and the GTE instructions).  Check the first post for the new version and changelog (I'm sure there are things I forgot in the changelog, but that should cover most of it).
pokeytax [Posts: 515]
  • View Profile
  • share
  • [February 04, 2013, 03:15:46 AM]
Re: (App) MassHexASM: Encode directly to little endian (v11 Update: 1/21)
« Reply #63 on: February 04, 2013, 03:15:46 AM »
Is jalr intended to be working yet, Glain?  I can't get it to compile correctly.

EDIT: Never mind, I didn't unzip it properly.  Working fine, looks great!

Just so you know, I did the Suikogaiden translation work completely with MHA, by choice.  ARMIPS is useful for certain purposes (I have used it on a GBA translation) but I love this tool, thanks for making it.
« Last Edit: February 04, 2013, 03:22:34 AM by pokeytax »
Glain [Posts: 456]
  • View Profile
  • share
  • [February 05, 2013, 03:37:07 PM]
Re: (App) MassHexASM: Encode directly to little endian (v11 Update: 1/21)
« Reply #64 on: February 05, 2013, 03:37:07 PM »
You're quite welcome!  It's really good to hear that you've put MHA to some good use in a project (even outside of FFT)!  Looks like it's come a long way from me looking at some assembly encodings and thinking "Hey, it could be fun to write a program that can do this..."
Choto [Posts: 818]
  • View Profile
  • share
  • [April 02, 2013, 02:33:44 PM]
Re: (App) MassHexASM: Encode directly to little endian (v11 Update: 1/21)
« Reply #65 on: April 02, 2013, 02:33:44 PM »
I have another request about comments. Could you make it so that as you resize the window, the text boxes stay anchored to the right and the ASM text box gets stretched? It would make it much easier to read the code with long comments as the commands and comments would be lined up nicely =)
Glain [Posts: 456]
  • View Profile
  • share
  • [May 29, 2013, 03:03:26 AM]
So I think I have that figured out... the window resize/anchoring thing, that is.  I also hit a situation where putting a label on its own line was giving me a warning that the encoder was ignoring the line. The encode still worked fine and the label worked properly, but the warning message was extraneous, so I've added a check for that and it should no longer display that in the next version.

I've currently got both MHA and LEDecoder in the actual FFTP project since I'm compiling the same ASM encoding library into FFTorgASM.  I'll probably update this at the same time as FFTP .483 since they're all compiled together, although I could update this early.  Really, for FFTP, most all the actual changes of .483 are in, it's just the testing and/or trying to reproduce bugs-with-no-test-cases-but-that-have-happened-before-no-really is something I keep putting off.

Edit: I'm also adding in "persistent labels" starting with @ that will stay around even if you don't define the label in the next chunk of ASM.  Basically what this is working towards is allowing me to specify huge swaths of ASM to FFTorgASM without having to specify concrete addresses for jal/branching/etc. (e.g. In one XML block:  @routine_name: [routine ASM], then in another block: "jal @routine_name" instead of "jal 0x16c034" or whatever).

Edit: Decoding no longer requires newlines; you should just be able to paste straight from a hex editor and it will decode every 4 bytes (8 hex digits) as a command.  I'm also supporting a ".label" directive to define label addresses without putting them inside the code.

Edit: I've also fixed some bugs with same-line labels.  The encode/decode textboxes are no longer limited to 32767 characters.
« Last Edit: June 15, 2013, 11:06:17 PM by Glain »
Choto [Posts: 818]
  • View Profile
  • share
  • [May 30, 2013, 12:03:50 AM]
Glain makes dreams come true! Thanks man.

Question for you, what are these programs edited in? I'm getting my feet wet developing a Visual Basic application that i'm keeping somewhat of a secret for now. I'm designing the layout first and then i'll dive into coding for it.. any tips or things I should know going in?
Glain [Posts: 456]
  • View Profile
  • share
  • [May 30, 2013, 03:19:25 PM]
Hmm, nice.  Mysterious coding projects are always fun!

FFTP/MHA/LED are all done in C# using the standard Windows forms for the layout. (I'm using an express version of Visual Studio 2012 as the IDE at the moment)

Visual Basic actually uses a similar framework for layout, though the code syntax is quite a bit different.

As for tips... well, for one thing, when you design the layout, don't forget to name your form elements (e.g. for a textbox that contains a title, you could give it a name like txt_Title). You might not see the difference when you're designing the layout, but when you get to the coding, it's far easier to work with form elements with names like txt_Title than ones with names like Textbox3 or what have you.
Glain [Posts: 456]
  • View Profile
  • share
  • [July 04, 2013, 11:00:14 PM]
Re: (App) MassHexASM: Encode directly to little endian (v12 Update: 7/4)
« Reply #69 on: July 04, 2013, 11:00:14 PM »
Updated with a new version containing the features discussed in the last few posts.  The first post is updated with the download and changelog for v12.
Bad code, beware! The NOPs are coming to eat you!
formerdeathcorps [Posts: 1322]
  • View Profile
  • share
  • [November 26, 2013, 03:39:27 PM]
Re: (App) MassHexASM: Encode directly to little endian (v12 Update: 7/4)
« Reply #70 on: November 26, 2013, 03:39:27 PM »
Two requests:
1) The ability to save my work (replete with comments and labels) in a readable (i.e. 1 ASM command + comments per line) format.  For writing long routines, this is an absolute must because if I only finish half my routine and want to come back to it later, I literally have to leave my computer and massHex open until my second sitting or post my half-finished work on FFH.  The latter isn't very efficient because I need Internet to access my code again (not a guarantee) and all the previous labels would be gone, so I would need to spend some time relabeling (and re-remembering) the logic of my previous code.  This also has the added benefit of making it easier for coders to check each others' work because we can transfer labels.  Although I'm fairly fluent in ASM, I know some of the newer coders find my code hard to read upon first inspection (and being able to transfer labels and comments would greatly help them understand).
2) The ability to use Ctrl + F to find certain registers or labels (very helpful for debugging long routines).  I'm sure pokeytax could use this to even better effect than me.

« Last Edit: November 26, 2013, 08:34:32 PM by Elric »
The destruction of the will is the rape of the mind.
The dogmas of every era are nothing but the fantasies of those in power; their dreams are our waking nightmares.
Glain [Posts: 456]
  • View Profile
  • share
  • [December 04, 2013, 06:11:39 AM]
Re: (App) MassHexASM: Encode directly to little endian (v12 Update: 7/4)
« Reply #71 on: December 04, 2013, 06:11:39 AM »
I could probably just save what's in the ASM textbox as a big string to a text file.  The search feature is a good point too; I hadn't really thought about it.

But, if you want text editor features, why not write your ASM in a text editor?  That's what I do when I write long ASM (I'm rather fond of Notepad++). That way you can save, find/replace, tab/shift+tab on blocks of text, use syntax highlighting, etc.  Then you can just copy (ctrl+A, ctrl+C) and paste (ctrl+V) into MassHex and encode (If that's even necessary...  FFTorgASM will encode for you if you specify mode="ASM" in the Location tags (ever since one of the later versions), though I'd still use MassHex as a check to make sure the ASM "compiles").

I spent a decent amount of time making MassHex play nice with various kinds of formatting (tabs, newlines, etc) so that it could work with nicely formatted text.  It should be able to deal with whatever kind of formatting a text editor throws at it!

Internet Cool
Dokurider [Posts: 2807]
  • View Profile
  • http://steamcommunity.com/profiles/76561198023738783/
  • share
  • [May 22, 2014, 07:49:45 PM]
Re: (App) MassHexASM: Encode directly to little endian (v12 Update: 7/4)
« Reply #72 on: May 22, 2014, 07:49:45 PM »
Whenever I translate multiple lines, branch labels get messed up. Yes, I'm using the latest version.
Glain [Posts: 456]
  • View Profile
  • share
  • [May 22, 2014, 11:46:11 PM]
Re: (App) MassHexASM: Encode directly to little endian (v12 Update: 7/4)
« Reply #73 on: May 22, 2014, 11:46:11 PM »
Could you post the ASM that isn't encoding correctly so I can investigate?
Internet Cool
Dokurider [Posts: 2807]
  • View Profile
  • http://steamcommunity.com/profiles/76561198023738783/
  • share
  • [May 29, 2014, 08:35:03 PM]
Re: (App) MassHexASM: Encode directly to little endian (v12 Update: 7/4)
« Reply #74 on: May 29, 2014, 08:35:03 PM »
Ah, sorry about the wait there, Glain.

beq r2, r0,0x004c
12004010

sltu r2,r5,r15   
beq r2, r0,0x004c
nop        
subu r5,r5,r3      
slt r2, r5, r7   
bne r2, r0 0x0010   
subu r2,r7,r11   
ori r5, r2, 0x0000
subu r3, r2, r15   
slt r2, r5, r0   
beq r2, r0,0x0010

2B10AF00
11004010
00000000
2328A300
2A10A700
FEFF4014
2310EB00
00004534
23184F00
2A10A000
F9FF4010
Glain [Posts: 456]
  • View Profile
  • share
  • [May 30, 2014, 02:16:25 PM]
Re: (App) MassHexASM: Encode directly to little endian (v12 Update: 7/4)
« Reply #75 on: May 30, 2014, 02:16:25 PM »
No worries. 

I get the same hex output, but it seems fine and decodes to the original ASM.

If you're worried about the encoding of "beq r2, r0,0x004c" changing from 12004010 to 11004010, it's because conditional branch statements like beq don't actually store the address they branch to in the encoding; they just store the number of lines to skip over.  In the first example, it needs to skip 18 (0x12) lines to get to 0x4c, since it's at address 0, and in the second example, it only needs to skip 17 (0x11) lines since it's at address 4.

(Conversely, j and jal do store the address they jump to, and their encodings wouldn't change in a scenario like this)
Internet Cool
Dokurider [Posts: 2807]
  • View Profile
  • http://steamcommunity.com/profiles/76561198023738783/
  • share
  • [May 30, 2014, 07:26:21 PM]
Glain [Posts: 456]
  • View Profile
  • share
  • [January 11, 2017, 11:19:05 PM]
Re: (App) MassHexASM: Encode directly to little endian (v13 Update: 1/11/2017)
« Reply #77 on: January 11, 2017, 11:19:05 PM »
I'm finally updating this with the latest version (v13), which features a bunch of incremental fixes to the ASM engine, a check mechanism for detecting ASM hazards on an Encode or Decode operation, and LEDecoder rolled into MassHexASM!
Internet Cool
Dokurider [Posts: 2807]
  • View Profile
  • http://steamcommunity.com/profiles/76561198023738783/
  • share
  • [February 21, 2017, 09:38:32 PM]
Re: (App) MassHexASM: Encode directly to little endian (v13 Update: 1/11/2017)
« Reply #78 on: February 21, 2017, 09:38:32 PM »
I think we have a problem here.
Glain [Posts: 456]
  • View Profile
  • share
  • [February 25, 2017, 05:43:44 PM]
Re: (App) MassHexASM: Encode directly to little endian (v13 Update: 1/11/2017)
« Reply #79 on: February 25, 2017, 05:43:44 PM »
The issue here is that 0xe618 isn't a valid value for the offset in your lbu statement.  The valid offset values go from -0x8000 to 0x7fff.

Since you specified a value outside that range, MassHex is trying to expand your lbu statement into a series of multiple statements to still get the proper result, assuming you want a positive 0xe618 as your offset. The method it's using here would normally work, except that you're using the assembler temporary register (r1) as the base register for your load, and MassHex needs that register to do the expansion, so the result is messed up.  Regardless, looking at what you're doing, this is unnecessarily complicated anyhow.

I suspect, based on the input you're giving MassHex, that you're looking to load a byte into r4 from RAM address (0x8016e618 + r2).  You could actually tell MassHex to do that with the following statement:

lbu r4, 0x8016e618(r2)

You'll notice that will expand into:

lui r1,0x8017
addu r1,r1,r2
lbu r4,-0x19e8(r1)

Which is probably the input you're looking for.

« Last Edit: February 25, 2017, 10:45:25 PM by Glain »
Pages: 1 2 3 [4]