News:

The forum has been updated to SMF (2.1.3)!
Please be patient as we work to polish up the place and update features as we can.

Main Menu

Assemble the Sun idea

Started by Daddy Poi's Oily Gorillas, 17, June, 2013, 12:14:34 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Daddy Poi's Oily Gorillas

This editor idea is only in the alpha stages, and it might be a terrible pain to code because I feel that the chances that future versions of the editor could be incompatible with edited ROMs.

Before I start, it is IMPORTANT to note that I CANNOT promise that this will be done, but I can say that an idea is better than nothing, so here goes:


I would like to recode the editor in Java, because it is multi-platform compatible. Unfortunately, I am not well versed in this language yet.

The plan is to have assembly editing features (hopefully?).
Because of assembly editing, this may result in the editor files being stored to the ROM. Or as an external file... in which case one could store the filepath/name in the ROM to help with saving space... This would probably have some downsides, though... Like if you are transporting data via internet or thumb drive and you forget to get the second file for editor purposes or you get the wrong file, etc...
The editor files I were thinking about were:
-language.ini , all the text the editor has.
-A gigantic table for control properties and a pointer list for every data table. (And possibly for every function in the game.) , may be useful for adding/editing/deleting data tables.
- Editor graphics , Like the font , background , icons that aren't grabbed from the game. If you change the appearance of your game or whatever, you could probably make the editor match it for the particular ROM for example... And if you use icons directly from the game, maybe even link directly to the game's icon.

There will most likely still be another file containing enough information for graphics/etc. for when a ROM is not opened. Unless I require that a ROM be opened before the editor displays...


As I come up with more ideas to add to this, I will likely edit this topic. I have not actually started work on this project yet, so once again, I must say that I cannot promise that this idea will come to life. Though, I do wish it would... Hm...
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Robert Joe

#1
This sounds like a great idea, and I might even be able to assist you with it, as I know basic Java (I am still a bit of a novice with the language, though). However, I cannot help for some time, as I already have two other big Java projects on my plate (One of which I already have put on hold until the first is complete).  I may be able to help later on, though.

Java is a pretty easy language. You should be able to figure it out in no time, especially with your level of skill in coding. I am sure that you will become well-versed in it very quickly.

KyleRunner

Man... I wish I could help....
I can provide a Portuguese translation... that's all. :sad:

Daddy Poi's Oily Gorillas

Quote from: Robert Joe on 17, June, 2013, 05:18:19 AM
This sounds like a great idea, and I might even be able to assist you with it, as I know basic Java (I am still a bit of a novice with the language, though). However, I cannot help for some time, as I already have two other big Java projects on my plate (One of which I already have put on hold until the first is complete).  I may be able to help later on, though.

Java is a pretty easy language. You should be able to figure it out in no time, especially with your level of skill in coding. I am sure that you will become well-versed in it very quickly.
Thanks for the offer. ; Two big projects? Sounds interesting...

I should probably also note that the first time I learned how to read data from a ROM file with Visual Basic was when I looked at the source code of a Zelda Editor (It was known as Zeldit.) Who knows if reviewing Java source code could help as well...
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Misery

I may have mentioned this before, but anyway - Java is the programming language I'm the most familiar with, meaning this has the highest chance of me being able to help out at some point (assuming you make the source code available to others). I've written a program that loads the data from a GBA ROM and does some operations on it, for whatever that's worth.

Not a promise or anything though, so don't expect too much ._.

Daddy Poi's Oily Gorillas

#5
Quote(assuming you make the source code available to others)
Yeah, currently, that is my plan. Cheers. The best part is that no one will have to pay for the somewhat worthless GM PRO.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Atrius (He/Him)

One of the ideas I thought of eventually moving to was creating a project file for hacks that would contain any extra data needed for advanced editing of the game that didn't really belong in the ROM file.

Assembly editing is a pretty tall order though, one file might not be enough.  You might need to split it up into separate "source files" like you would see with java/c++ or other programming languages like that.
[sprite=220,4,0]I'm shaking my head in general disapproval of everything[/sprite]

Daddy Poi's Oily Gorillas

#7
Actually, I had in mind to do those files under a pointer list instead of actual individual files. When you resize one of these "files", you must use an io.read/io.write method instead of your normal file_bin_read_byte stuff for performance reasons... And then fix all the pointers.

Ofcourse, in this one file, it could be possible to have a byte/boolean specifically for how it is stored. (Separate files, or just one file.) This could be a flag list for each individual file, even.

And if things like compression is used, maybe even to the point that the editor would be the only way to navigate through these files in a user friendly way.



And yes, assembly editing is a tall order, and easily leads in the path of errors. (Which sort of scares me. At worst, I can imagine needing a pointer to every function, bl command(?), every pointer used in code, and every database. ; And this would also include map code files. Except those pointers could be 16-bit.)

Pointers read by ldr that are written out can sometimes be impossible to detect as actual pointers. (Like when they are either placed in RAM or used in the Function's Return.) ; Just because a pointer matches the address of a certain database doesn't always mean that it is a pointer, and it could be a coincidence.

@bl commands: I simply plan to replace them with index numbers and back again; but if I have a pointer table for all bl commands instead, then I could do it there. Which may be considered, because I can still imagine one possible false positive where you may be reading data in code as a bl command. This is only if you aren't actually checking the code operations...

And having a list for these becomes even more important when you consider the fact that more false positives could be unintentional hacked in.

However, having a ton of pointer tables to go through to try and position everything correctly could be hard on performance... so indexing and relative pointers could come in to play where see fit. (Possibly.) Like I could index the calls and pointers to the function with their relative location in the function.





Notes to self on the possible first version:

1.) Make the Function and Database List.

2.) Make reference list(s) for all bl instructions and pointers.

Quote from: Method A32-bit = Address of data to edit. (bl command or pointer.)
32-bit = Value to be placed at address.

Also add support for pointer lists?
32-bit = Address of data to edit. (pointer)
32-bit = Number of entries in list.

Quote from: Method B32-bit = Function Index in which instruction/pointer is listed under
32-bit = Relative address in function
32-bit = Function or Database the bl/pointer points to.
32-bit = Unused in case needed for anything & for spacing.


Also add support for pointer lists?
32-bit = Database index
16-bit = Entry length /4(?)
16-bit = Relative address in entry /4(?)
32-bit = Number of entries. (Not required if you can calculate from the size of the database via database list pointers.)
32-bit list = Function/Database indexes. (This one might just overwrite the pointer list.)
(The above two steps might be assisted with a program I make, and then some checking over.)


3.) Functions in editor should be viewed one at a time, so when you switch to viewing another item in the list, put the function back in, move the data over, and fix the function list.

---

For assembly/data patches

32-bit = Function index
32-bit = Relative position in function to patch
32-bit = Size of patch
??-bit = Code/data ; Should hold enough info to do an on/off properly, but may include numerics edit boxes, etc.

There should be a patches list in the editor, as well as a note about patches for the functions you edit which have them.
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Daddy Poi's Oily Gorillas

#8
- Valentine's Day Checkpoint -  (I know it's tomorrow, but still...)

GS Editor Alpha/Demo 0.0.1 = Featuring a partial assembly viewer. If you don't plan on looking at assembly, don't bother downloading. (You'll be wasting your time.)

As for everyone else... This is just a progress update. (And because of that, ignore the fact I forgot to update the About box.)

The application:
http://www.mediafire.com/download/pgpswp1b6tmsxle/GSJAR.7z

The source as it is in my workspace. (Which happens to be in my Google Drive folder. :) , but I have uploaded it to MediaFire as well.)
http://www.mediafire.com/download/in5814e2ie91iq2/GSEditor2.7z


When you first open the application, a box will pop up asking you to select a file.

-If you click Cancel, an error saying that a file couldn't be loaded and editor form should pop up. (With only the toolbar for an interface.) ; Opening via that toolbar doesn't work yet, I don't think.

-If you click a ROM, an alert box may pop up if the project file cannot be found... The path names that the editor looks for are listed in the alert, otherwise, the editor will pop up displaying an incomplete tree of data. It is currently used as an outline until it is filled out.

There are plenty of options in the tree that do nothing, the only ones that will do something are the ones that say Publics or Thumb. (Which ofcourse, will show you thumb code.)

I know that the coding that scans the thumb code isn't 100% perfect, but... yeah.

There are 3 labels I want to discuss. B, P, and C.

B = This lists the locations that branch instructions point to. (The location they point to is labelled with a B.)
P = Same as with B, except it's used when there's a pointer pointing somewhere, rather than a branch instruction.
C = Again, same with the above two, except, it's to label locations where function calls call.

(Edit: There is one other label... but,... I have to see if it is actually used anywhere... I think so, but...)

For all of the above, labelling is not determined by an outside source. (So a function call in another section calling to one of these functions will not be labeled "C"... (In other words, the labeling only counts for everything listed in the textbox at the time of labeling.)

There's also something else I would mention. If you have looked at VBA's assembly viewer, you will notice some things different. I have actually went and displayed pointers that are pointers properly (as well as data values), instead of them looking like code. I have also added additional calculations...


If you manage to look at the text file that makes up the tree, most of it is still in the works, so some of the text in it could still be place holders.


And now that I have gone over that, I want to add one final note that the thumb code has been placed in a text box, so you may freely copy it to a text document if you want to search for something. (Which reminds me, I still need to fix the width of the text box...)
Golden Sun Docs: Broken Seal - The Lost Age - Dark Dawn | Mario Sports Docs: Mario Golf & Mario Tennis | Misc. Docs
Refer to Yoshi's Lighthouse for any M&L hacking needs...

Sometimes I like to compare apples to oranges. (Figuratively) ... They are both fruits, but which one would you eat more? (If taken literally, I'd probably choose apples.)
Maybe it is over-analyzing, but it doesn't mean the information is useless.


The only GS Discord servers with significance are:
Golden Sun Hacking Community
GS Speedrunning
/r/Golden Sun
GS United Nations
Temple of Kraden

Can you believe how small the Golden Sun Community is?

2+2=5 Don't believe me? Those are rounded decimal numbers. Take that, flat earth theorists! :)

Thunder-squall

Oh, hey, kudos on the clever thread name.  I just noticed it.