Kuribo64
Views: 30,526,154 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
11-09-25 10:19 AM
Guest:

Main - Posts by Phantom Wings

Pages: 1 2 3
Phantom Wings
Posted on 12-19-12 08:09 AM, in BCSV Editor (rev. 4 of 12-11-13 08:49 AM) Link | #1931
I know this thread is kind of old, but the AnarchGalaxy2 library had a pretty effective BCSV editor. I'm can't remember if I publicly released it or not, but I think it should come in handy.

Source Download

Also, just in case you're interested, MN1, The method I used to read Unicode strings was Encoding.GetEncoding("Shift-JIS").GetString which allowed you to read a string from either a byte buffer or a raw data pointer.

Phantom Wings
Posted on 12-25-12 08:08 PM, in BCSV Editor Link | #2125
I forgot that I had added an extension method to the Encoding class to simplify things.

Anyways, the extension method uses the string constructor using the Encoding as one of the parameters. You need to know the number of characters before hand and you need to use an sbyte pointer, but it should properly convert the characters.

Phantom Wings
Posted on 01-01-13 12:11 AM, in BCSV Editor Link | #2558
While heap memory and pointers may seem scary at first, you shouldn't knock them. Remember that these files have been specifically compiled for an environment that can use nothing but unsafe memory elements (RVL SDK is in C++). Marshalling data types from memory removes the need for excessive seeking and byte manipulation required when using streams. This also removes the need for dedicated read/write methods for each individual data type. Additionally, it allows you to use wrapper classes which removes the need for individually setting every field when reading in the more complex classes.

Anyways, MN1, if you're going to use unsafe memory in C#, you need the unsafe keyword either in the function declaration or the containing class declaration. You'll also need to go into the project properties and check "allow unsafe code" under build options.

Phantom Wings
Posted on 01-01-13 08:05 PM, in BCSV Editor Link | #2624
Well, I tested your code with a string from the ObjectNameTable.tbl and it checks out on my end, here's the test code:


OpenFileDialog ofd = new OpenFileDialog();
if (ofd.ShowDialog() != DialogResult.OK)
return;

FileStream bcsvFile = File.Open(ofd.FileName, FileMode.Open);
List bytes = new List();
String str;
int stringOffset = 0;
int strOffs = 0;
int strCount = 0;

while (bcsvFile.ReadByte() != 0)
{
bcsvFile.Seek(stringOffset + strOffs + strCount, SeekOrigin.Begin);
bytes.Add((SByte)bcsvFile.ReadByte());
strCount++;
}

unsafe
{
fixed (SByte* strData = bytes.ToArray())
{
str = new String(strData, 0, bytes.ToArray().Length, System.Text.Encoding.GetEncoding("Shift-JIS"));
}
}

MessageBox.Show(str);


The input was from this file and the output was 天文台図書館. I might suggest that your computer doesn't support the Shift-JIS encoding, but if you've been using Anarchy and it has been displaying properly, then that likely isn't the case.

Phantom Wings
Posted on 01-01-13 10:49 PM, in BCSV Editor Link | #2635
I'm using v3.5 SP1. I also retested the code segment up there just to make sure I didn't copy it wrong. It sounds like it's something in your system settings.

Phantom Wings
Posted on 01-19-13 01:30 AM, in Intro Cameras (rev. 3 of 01-19-13 02:10 AM) Link | #6913
It's a keyframe setup. The header is size 0x20 with constant values. Following that are keyframe indexers. Listed in order, they are:

0x20 x_pos
0x2C y_pos
0x38 z_pos
0x44 dir_x
0x50 dir_y
0x5C dir_z
0x68 unknown
0x74 unknown

Each keyframe indexer is size 0xC

keyframe_indexer:
0x00 element_count
0x04 table_start_index
0x08 blank

If element_count is 1, then the camera will use only 1 float value for that field throughout the intro. Otherwise, if element count is greater than 1, then the camera will use multiple keyframes which are 3 floats each:

keyframe:
0x00 time
0x04 value initial_value
0x08 transition_speed velocity


The value table is at 0x80. It starts with a uint value for its size and then lists the table values as floats. It seems to always end with the floating point values 0.1, 1E+9 and NAN.

Phantom Wings
Posted on 01-19-13 01:34 AM, in Intro Cameras Link | #6916
I think that's it for the .canm files. There's just the two unknown values which might be worth messing around with.

Phantom Wings
Posted on 01-19-13 01:48 AM, in Intro Cameras Link | #6933
The file still stores the coordinates, they just aren't stored as 3D Vectors. Instead they are broken up into single values that can be animated individually. Each coordinate is then interpolated according to the keyframe time, value and transition_speed fields. Imagine one individual graph for each of the x_pos, y_pos and z_pos values. Each graph is plotted with its value over time. The curves of the graph are controlled by the transition_speed.

Phantom Wings
Posted on 01-19-13 02:08 AM, in Intro Cameras (rev. 2 of 01-19-13 02:09 AM) Link | #6943
Yes, I'm looking at that now. Let me make a redefinition:

Keyframe:
0x00 time
0x04 initial_value
0x08 velocity

It seems there is no automatic transitioning between keyframes, instead, transitions are done through using the velocity value to move the value to where the next keyframe's initial_value is.

The top part of the file (0x20 to 0x80) just contains indexers. Use the indexers to find the keyframe values in the float table at 0x80.

Phantom Wings
Posted on 01-23-13 02:03 AM, in Adding SMG1 Objects (rev. 4 of 01-23-13 02:06 AM) Link | #8901
Regarding the opening post:

It is always discouraging to me when someone decides to criticise hackers because they feel they aren't trying hard enough. Please try to understand that the work we do is entirely of our own personal interest. Some of us lead busy lives which are very demanding of our time. When we hack, we are often taking up hours even working late into the night to try to get a code or hack running. This is time we could be using to get a good nights sleep or working on other tasks related to our lives. Instead, we choose to use our time hacking.

Let me tell you what happens when one of us "tries" like you say. I read your post last weekend and wanted to make a point. So, I lost 2 good nights sleep, was very nearly late in submitting a report and ended up having to give a speech with half an empty head.

The result? This.



[image]

[image]




Let me just mention that aside from Anarchy, I have never done any hacking for Super Mario Galaxy 2. Besides what MN1 has made available, I have absolutely no idea how SMG2 works.

I will be one of the first to say that just about anything can be achieved with the right application of hacking and time. But it's that last part which we just don't have enough of. Trust me, we want to try as hard as we can to make some of these hacks work. But in many cases, it's not a matter of "too hard, I give up" as it is "too time consuming, I don't have time for this."

Phantom Wings
Posted on 01-23-13 02:23 AM, in Adding SMG1 Objects Link | #8903
Thanks, but most of Ice Mario's code was still in SMG2. I just patched the areas that were needed for it to work.

Phantom Wings
Posted on 01-23-13 07:23 AM, in Adding SMG1 Objects Link | #8957
I've posted some additional information about power-up resources in the wiki just in case anyone's interested.

Phantom Wings
Posted on 01-24-13 12:23 AM, in Adding SMG1 Objects (rev. 2 of 01-24-13 12:24 AM) Link | #9136
The Ice Flower was made similar to how you made the Red Star appear. Because all power-up items are created more or less identical, it was just a matter of changing the power-up item ID of the Fire Flower to the Ice Flower. Currently I am unsure if the original Ice Flower exists as an actual object in memory, but what I do know is that there isn't a creation function bound to the MorphItemNeoIce or MorphItemNeoFoo strings. However, there are preload functions bound to the both of those strings meaning that if the object is successfully loaded, then the IceMario/FlyingMario resources will be loaded as well.

If you could find the v_table of either of those objects, then patching them into the game would be trivial. As it currently stands, you could probably get away with copying the v_table of one of the other power-ups, adjusting the 27th method of it and then binding a custom creation function to either of those strings. I'll try to put more details up on the Wiki.

Phantom Wings
Posted on 01-24-13 12:38 AM, in Adding SMG1 Objects Link | #9149
I listed the main parts of it in the Wiki, but there are a bunch of resources that need to be preloaded before Ice Mario will work. Before a stage is loaded, it scans the bcsv objects for it and calls any preload functions related to them. All the power-ups actually have the same preload function, but depending on the power-up that is being called, it will set a different flag in the flagset that determines which parts of Mario are loaded for that level. If the Ice Mario preload flag is not set, then Ice Mario cannot be used for that level. If you like, it is possible to manually change this flagset to always have Ice Mario loaded, but you need to make sure all of Ice Mario's files are available or the game will freeze.

Also, I think your patch is freezing because you used a normal unconditional branch instead of a link branch. Without using a link branch, the function can't return using blr.

Phantom Wings
Posted on 01-24-13 01:01 AM, in Adding SMG1 Objects Link | #9153
The only ones I needed to patch to have a minimally working Ice Mario were PowerUpIce.arc, IceMario.arc, IceMarioHandL.arc and IceMarioHandR.arc. I couldn't find a way to load up IceStep.arc in Dolphin, so I removed the creation routines for them from the setup_IceMario function.

Right now, it looks like your code isn't adding the the 18 bytes. Have you updated it since you posted it?

Phantom Wings
Posted on 01-24-13 01:26 AM, in Adding SMG1 Objects (rev. 4 of 01-24-13 01:48 AM) Link | #9158
Your hook point is being called prematurely. The start of the game seems to call it to load something up, but 8108249C hasn't been initialized yet. The write to the resulting null address is what's causing the game to crash.

Phantom Wings
Posted on 01-24-13 01:48 AM, in Adding SMG1 Objects Link | #9172
Try hooking your code to 802d20c0. That's the end of the power-up preload function. The only thing you need to remember is that you need at least one power-up in the level to load Ice Mario.

Phantom Wings
Posted on 01-24-13 02:13 AM, in Adding SMG1 Objects Link | #9175
Well, with the exception of your write offset being 0x15 when it should be 0x1B, your code checks out. But I don't have a Wii to test it on, so I only tested it using Dolphin.

Phantom Wings
Posted on 01-24-13 02:29 AM, in Adding SMG1 Objects (rev. 4 of 01-25-13 04:07 AM) Link | #9179
Sorry about that, I listed it in the Wiki as 18, but it's 0x18. 0x18 + 0x3 = 0x1B...

EDIT:

Hey MN1, if you haven't got it running already, can you try patching the game using these patch strings and seeing if it works?


<memory offset="0x802D20C0" value="484284A8"/>
<memory offset="0x803B6E80" value="38800003"/>
<memory offset="0x806FA568" value="3A80249C66948108829400003AA000019AB4001B4E800020"/>
<memory offset="0x803C84E8" value="3BFE15083BBE1518"/>
<memory offset="0x803C8568" value="4800005C"/>
<memory offset="0x803C9BA8" value="389F1624"/>
<memory offset="0x803C9BD8" value="389F163C"/>

Phantom Wings
Posted on 01-25-13 06:58 AM, in Adding SMG1 Objects Link | #9645
I should probably mention that I don't have a Wii anymore - it's part of the reason why I quit most forms of serious hacking. These days it's just manually looking at data files or using Dolphin.
Pages: 1 2 3

Main - Posts by Phantom Wings

Page rendered in 0.025 seconds. (2048KB of memory used)
MySQL - queries: 21, rows: 140/140, time: 0.011 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.