Need some coding help with Melee's start.dol
- ShockSlayer
- Posts: 97
- Joined: Sat Feb 05, 2011 7:21 pm
Need some coding help with Melee's start.dol
Hey GCForever peeps, looking for some insight and maybe a little help with some Melee hacking stuff. Dunno if this is the right forum, I didn't see a general gamecube hacking forum so I just went with this one.
For the last couple days I've been poking around in Melee's start.dol and poking at the memory with dolphin, trying out stuff, etc. Basically what I'm trying to do is find a way to integrate a certain AR code(the perfect widescreen code) into the start.dol. If you wanna read up on my exploits, my posting starts at the bottom of this page on smashboards. But anyways, putting codes into the start.dol is normally not an issue, but this code's different and I've encountered a lot of problems with the standard method, mainly:
1. The code edits a value at an address in the memory
2. Where the value comes from in the start.dol is shared by multiple things, so if I change it there, some other important things change and ruin the effect. Perfect widescreen / What I get when I edit the value in the start.dol.
The neat thing though, is that I know there's a way to do this right, because someone's already close. Standardtoaster on smashboards managed to write this neat "asm injection" thing(I quoted it here) and put it in the start.dol. It mostly works, too, but the problem is for some reason his code changes some other values that the normal AR code doesn't, and those values screw up the foreground shader which causes some noticeable graphical glitches that the standard AR code doesn't have. I demonstrated it in the thread I linked to earlier.
But anyways, basically what I've concluded that I need to do is write some asm code that just accomplishes what the standard code does, and inject it like standardtoaster did. So that just means some asm that says "replace 3F9BD194 at address 00BDC5E4 with 3FCFC217." And more or less my problem is I have no idea how to do that, because again I have no idea how to code anything. Which is where I could use some help from the gamecube masters. I'm also probably using some wrong terminology here, but I can get to where it's supposed to go in dolphin's debug mode, so if further elaboration is needed I could make a video showing that.
So here's the AR code I've been talking about, I also managed to convert it to all versions of melee so if someone can help me out, they don't have to try to get the same version I'm using:
1.0: 04BDA464 3FCFC217
1.1: 04BDB8C4 3FCFC217
1.2: 04BDC5E4 3FCFC217
PAL: 04C05144 3FCFC217
I hate to be that guy that just shows up and asks for code, but I'm at my wit's end and I wouldn't ask if I had anything else left to try. I packed as much info as I could think of into this post, if there's anything I need to elaborate on please just let me know. And if you just have any ideas or insight to share, that'd be great, I will take anything I can get and do whatever I can. Hell at this point I'd pay for professional help, spending hours staring at code and trying things to no avail gets painful pretty quick, haha.
SS
For the last couple days I've been poking around in Melee's start.dol and poking at the memory with dolphin, trying out stuff, etc. Basically what I'm trying to do is find a way to integrate a certain AR code(the perfect widescreen code) into the start.dol. If you wanna read up on my exploits, my posting starts at the bottom of this page on smashboards. But anyways, putting codes into the start.dol is normally not an issue, but this code's different and I've encountered a lot of problems with the standard method, mainly:
1. The code edits a value at an address in the memory
2. Where the value comes from in the start.dol is shared by multiple things, so if I change it there, some other important things change and ruin the effect. Perfect widescreen / What I get when I edit the value in the start.dol.
The neat thing though, is that I know there's a way to do this right, because someone's already close. Standardtoaster on smashboards managed to write this neat "asm injection" thing(I quoted it here) and put it in the start.dol. It mostly works, too, but the problem is for some reason his code changes some other values that the normal AR code doesn't, and those values screw up the foreground shader which causes some noticeable graphical glitches that the standard AR code doesn't have. I demonstrated it in the thread I linked to earlier.
But anyways, basically what I've concluded that I need to do is write some asm code that just accomplishes what the standard code does, and inject it like standardtoaster did. So that just means some asm that says "replace 3F9BD194 at address 00BDC5E4 with 3FCFC217." And more or less my problem is I have no idea how to do that, because again I have no idea how to code anything. Which is where I could use some help from the gamecube masters. I'm also probably using some wrong terminology here, but I can get to where it's supposed to go in dolphin's debug mode, so if further elaboration is needed I could make a video showing that.
So here's the AR code I've been talking about, I also managed to convert it to all versions of melee so if someone can help me out, they don't have to try to get the same version I'm using:
1.0: 04BDA464 3FCFC217
1.1: 04BDB8C4 3FCFC217
1.2: 04BDC5E4 3FCFC217
PAL: 04C05144 3FCFC217
I hate to be that guy that just shows up and asks for code, but I'm at my wit's end and I wouldn't ask if I had anything else left to try. I packed as much info as I could think of into this post, if there's anything I need to elaborate on please just let me know. And if you just have any ideas or insight to share, that'd be great, I will take anything I can get and do whatever I can. Hell at this point I'd pay for professional help, spending hours staring at code and trying things to no avail gets painful pretty quick, haha.
SS

Re: Need some coding help with Melee's start.dol
Can you clarify where it is you're getting the "Perfect Widescreen" hack from? If it's the one from Swiss, it expects the patched code function to be sitting at a certain spot in memory.

- ShockSlayer
- Posts: 97
- Joined: Sat Feb 05, 2011 7:21 pm
Re: Need some coding help with Melee's start.dol
http://ssbmo.com/89/
It's just an AR code that changes a FOV to be 4/3 the normal image, or something along those lines.
I say perfect, but in reality it's not exactly perfect...the foreground and background shaders(atleast I think that's what they are) just aren't set to be 16:9 as well, so they're stretched(but being solid colors this doesn't matter,) eliminating the black bars on the side, etc, while the stage and characters and stuff are all the right size. HUD's another issue but we can either redraw that, and it's probably possible to fix that with some code somewhere too, just have to look for it. I figured I'd try to get the important stuff taken care of first though.
It's perfect Melee, more or less, probably not applicable to other games though. I haven't actually tried using Swiss's widescreen hack, is it different than Dolphins?
SS
It's just an AR code that changes a FOV to be 4/3 the normal image, or something along those lines.
I say perfect, but in reality it's not exactly perfect...the foreground and background shaders(atleast I think that's what they are) just aren't set to be 16:9 as well, so they're stretched(but being solid colors this doesn't matter,) eliminating the black bars on the side, etc, while the stage and characters and stuff are all the right size. HUD's another issue but we can either redraw that, and it's probably possible to fix that with some code somewhere too, just have to look for it. I figured I'd try to get the important stuff taken care of first though.
It's perfect Melee, more or less, probably not applicable to other games though. I haven't actually tried using Swiss's widescreen hack, is it different than Dolphins?
SS

Re: Need some coding help with Melee's start.dol
You won't think the Melee one is so perfect after you see what Swiss can do with it 


- ShockSlayer
- Posts: 97
- Joined: Sat Feb 05, 2011 7:21 pm
Re: Need some coding help with Melee's start.dol
Okay, so I loaded up swiss from the qoob pro, loaded melee(changed the widescreen setting to on) and loaded it up. The result looks the same as dolphins(the foreground and background shaders are still weird.)
it's the same on the cube and Dolphin unless I did something wrong. Also the pause menu junk isn't part of the foreground shader, just the white box is(and it's annoying too because it shows up every time you hit someone hard.)
Honestly it's just those two parts, if we fix those(from what I gather basically tell it not to patch those two spots) and can implement the patches directly into the start.dol, then that's perfect as well. All the menu stuff and HUD stuff being fixed is an added plus tbh. I figured it's just be easier to implement the single code.
I'm curious to learn more about how the whole start.dol patching thing works as well.
SS
it's the same on the cube and Dolphin unless I did something wrong. Also the pause menu junk isn't part of the foreground shader, just the white box is(and it's annoying too because it shows up every time you hit someone hard.)
Honestly it's just those two parts, if we fix those(from what I gather basically tell it not to patch those two spots) and can implement the patches directly into the start.dol, then that's perfect as well. All the menu stuff and HUD stuff being fixed is an added plus tbh. I figured it's just be easier to implement the single code.
I'm curious to learn more about how the whole start.dol patching thing works as well.
SS

- megalomaniac
- Posts: 2480
- Joined: Sun Aug 21, 2011 5:33 am
- Location: Drunk in Texas
- Contact:
Re: Need some coding help with Melee's start.dol
did you test with r214?
>>> BadAssConsoles.com <<<emu_kidid wrote: beer is like WD40 for megalomaniac's brain, gets the gears moving



- ShockSlayer
- Posts: 97
- Joined: Sat Feb 05, 2011 7:21 pm
Re: Need some coding help with Melee's start.dol
Swiss-0.3-r174...thought that was the latest? That's what on the google code site, unless there's somewhere else you can direct me to(please you have no idea how much I want to be wrong right now)

- megalomaniac
- Posts: 2480
- Joined: Sun Aug 21, 2011 5:33 am
- Location: Drunk in Texas
- Contact:
Re: Need some coding help with Melee's start.dol
The latest official release is r174...
...but current revision is at r214 which would need to be compiled.
The swiss autoboot files I posted up are r214 so give that a try just to confirm if the latest revision results are any different.
...but current revision is at r214 which would need to be compiled.
The swiss autoboot files I posted up are r214 so give that a try just to confirm if the latest revision results are any different.
>>> BadAssConsoles.com <<<emu_kidid wrote: beer is like WD40 for megalomaniac's brain, gets the gears moving



- ShockSlayer
- Posts: 97
- Joined: Sat Feb 05, 2011 7:21 pm
Re: Need some coding help with Melee's start.dol
I see. I don't know much about compiling, but I guess I should give it a shot sometime later 'cause it'd be nice to have a .dol I can throw on this SD card so I can test this junk on my normal(ish) cube. Fortunately I've still got this commissioned unit with the Swisstastic WKF, so I'll test it on that.
Okay, so, it appears to be the same, I tried both "Yes" and "Persp" (I think that was the other option) and both still have the back/foreground shader problems. ;_;
SS
Okay, so, it appears to be the same, I tried both "Yes" and "Persp" (I think that was the other option) and both still have the back/foreground shader problems. ;_;
SS

- ShockSlayer
- Posts: 97
- Joined: Sat Feb 05, 2011 7:21 pm
Re: Need some coding help with Melee's start.dol
I just tested the PAL and 1.0 versions of Melee(initially I had only tried 1.2) and it's the same deal. Also some of the stages turn like, black and stuff. o_O
Anyways, any ideas as to where I should go from here?
SS
Anyways, any ideas as to where I should go from here?
SS

Re: Need some coding help with Melee's start.dol
SS, all I can think of is to write a micro sized DOL patcher/loader that will load & patch melee.dol seamlessly with the patches found in Swiss (you'd put it back into the .iso even).
If you're using Dolphin related patches they might not work the same on actual hardware.
If you're using Dolphin related patches they might not work the same on actual hardware.

- ShockSlayer
- Posts: 97
- Joined: Sat Feb 05, 2011 7:21 pm
Re: Need some coding help with Melee's start.dol
Yeah, I'm not using any dolphin code on actual hardware, I was just comparing the results that I got from Swiss regarding the foreground/background junk.
Your solution sounds pretty much ideal. Then I assume we could just tweak the patches from there so everything renders perfect. I kinda of want to find the patches in Swiss and try messing with them, basically I just need them not to patch certain addresses(which I can't seem to find) and they'd be perfect...I'm secretly hoping that if I just comment out a line or something that it fixes it.
How easy/hard would it be to write the patcher? I somewhat assume since it'd have to be micro that it wouldn't be too hard, but then again I could be wrong...again I have no idea what I'm doing but I'm willing to try anything.
SS
Your solution sounds pretty much ideal. Then I assume we could just tweak the patches from there so everything renders perfect. I kinda of want to find the patches in Swiss and try messing with them, basically I just need them not to patch certain addresses(which I can't seem to find) and they'd be perfect...I'm secretly hoping that if I just comment out a line or something that it fixes it.
How easy/hard would it be to write the patcher? I somewhat assume since it'd have to be micro that it wouldn't be too hard, but then again I could be wrong...again I have no idea what I'm doing but I'm willing to try anything.
SS

Re: Need some coding help with Melee's start.dol
I haven't worked at all on the video patches so I can't comment on the possibility of a "one liner fix", but I highly doubt it without a lot of trial and error.
I'd write the tiny DOL loader to expect a merged blob (the melee.dol) and then patch/load it.
I'd write the tiny DOL loader to expect a merged blob (the melee.dol) and then patch/load it.

- ShockSlayer
- Posts: 97
- Joined: Sat Feb 05, 2011 7:21 pm
Re: Need some coding help with Melee's start.dol
Ah, okay. Yeah, as I'm coming to find out nothing's ever that simple when it comes to this stuff. I tried looking over the forcewidescreen.s file and I couldn't make heads or tails of anything. ._.
So, this would be a replacement start.dol file that loads the normal one and patches it? Or am I misunderstanding that completely.
It makes me think though, if it is done that way...what about instead loading the Swiss cheat engine? There's plenty of extra room in the melee iso for a .qch cheats database, if it's possible to just force them all on and then we can just add just the codes we want. The smash community would flip their shit if we could do something like that(there's a ton of codes that people want to add into the game that currently can't be hacked into the start.dol the normal way.) That'd solve the widescreen thing too.
Thoughts? I got a little excited thinking about that.
SS
So, this would be a replacement start.dol file that loads the normal one and patches it? Or am I misunderstanding that completely.
It makes me think though, if it is done that way...what about instead loading the Swiss cheat engine? There's plenty of extra room in the melee iso for a .qch cheats database, if it's possible to just force them all on and then we can just add just the codes we want. The smash community would flip their shit if we could do something like that(there's a ton of codes that people want to add into the game that currently can't be hacked into the start.dol the normal way.) That'd solve the widescreen thing too.
Thoughts? I got a little excited thinking about that.
SS

Re: Need some coding help with Melee's start.dol
yeah something like that, but the more I think about it, how about just booting Swiss before the game like everyone else? 


Re: Need some coding help with Melee's start.dol
All current patches are hooks for SDK functions.
You're looking at old code.ShockSlayer wrote:I tried looking over the forcewidescreen.s file and I couldn't make heads or tails of anything. ._.
- ShockSlayer
- Posts: 97
- Joined: Sat Feb 05, 2011 7:21 pm
Re: Need some coding help with Melee's start.dol
I guess so...I doubt I'd be able to understand any of the newer code either, but I'm not sure. I mean, I was looking in the source folder on the google code page.
Anyways, as far as just loading up Swiss each time, Melee hacking's all about streamlining everything; one of the most popular codes is changing the starting settings from time to 4 stock, 8 minutes, friendly fire on, etc. Sure we could just change the settings each time we start up the game, but it's all about making the whole experience better. Plus it'd be nice to bring some uniformity to how the codes are handled, right now it's a mixmatch of wii stuff, hacking the start.dol, using an actual AR, etc, but everyone's still modifying the actual iso.
Don't get me wrong, I'm all about taking the practical method over the luxurious one, and I will admit that doing this would be a luxury, but I figure getting this done would be a one time thing, solve a lot of problems and remove some limitations.
Baby steps, though, I'll take whatever help I can get, and my prime goal for now is still widescreen. I swear one day I'll figure all this out and actually be able to give back.
SS
Anyways, as far as just loading up Swiss each time, Melee hacking's all about streamlining everything; one of the most popular codes is changing the starting settings from time to 4 stock, 8 minutes, friendly fire on, etc. Sure we could just change the settings each time we start up the game, but it's all about making the whole experience better. Plus it'd be nice to bring some uniformity to how the codes are handled, right now it's a mixmatch of wii stuff, hacking the start.dol, using an actual AR, etc, but everyone's still modifying the actual iso.
Don't get me wrong, I'm all about taking the practical method over the luxurious one, and I will admit that doing this would be a luxury, but I figure getting this done would be a one time thing, solve a lot of problems and remove some limitations.
Baby steps, though, I'll take whatever help I can get, and my prime goal for now is still widescreen. I swear one day I'll figure all this out and actually be able to give back.
SS

Re: Need some coding help with Melee's start.dol
Sounds like someone needs to make what's known as a "Trainer".

- ShockSlayer
- Posts: 97
- Joined: Sat Feb 05, 2011 7:21 pm
Re: Need some coding help with Melee's start.dol
Yes! I totally forgot about trainers, I remember messing around with them on the GBA a long time ago, can't believe I forgot, that's basically what I was wanting(sans the menu, just defaulting everything to "ON.")
So, naturally after you mentioned that, I searched the internet for gamecube trainers, and when I found nothing, I searched here, and found this:
viewtopic.php?f=4&t=30&p=73&hilit=trainer#p73
A melee trainer...pretty astounding, I had no idea something like this already existed. Granted it's disc based and for PAL, but that's probably just the disc ID it looks for and the codes themselves, I'd bet everything else will work fine with the other versions of melee if we just changed those.
But yeah, this gives me extreme amounts of hope that something can be accomplished, because now we have a pretty good starting point. At least I think so...is it possible to modify this .dol like that?
SS
So, naturally after you mentioned that, I searched the internet for gamecube trainers, and when I found nothing, I searched here, and found this:
viewtopic.php?f=4&t=30&p=73&hilit=trainer#p73
A melee trainer...pretty astounding, I had no idea something like this already existed. Granted it's disc based and for PAL, but that's probably just the disc ID it looks for and the codes themselves, I'd bet everything else will work fine with the other versions of melee if we just changed those.
But yeah, this gives me extreme amounts of hope that something can be accomplished, because now we have a pretty good starting point. At least I think so...is it possible to modify this .dol like that?
SS

- ShockSlayer
- Posts: 97
- Joined: Sat Feb 05, 2011 7:21 pm
Re: Need some coding help with Melee's start.dol
I tried asking crediar for the source of the trainer, he told me he still has it, but "it uses an unreleased custom LIB and it would be way easier to write one from scratch with todays LIBs." I'm not entirely sure what that means, and so far I haven't been able to make heads or tails of anything in the trainer, I've tried looking for the codes inside, so then maybe I could replace one of them with the widescreen one,but so far no luck with that either. Ugh, what I wouldn't give for some college classes right about now.
So, next plan of attack is to try messing with crazynation's trainers...it looks like he's posted the source on his site, so maybe it's possible to change everything on the waverace one to be for Melee instead and compile it...somehow.
Fun fact, before there was Wiikey Fusion, there was Electric_rain trying to recreate what crazynation did with his IDE loading so portablizers wouldn't have to try to deal with the disc drive...good times, good times.
SS
So, next plan of attack is to try messing with crazynation's trainers...it looks like he's posted the source on his site, so maybe it's possible to change everything on the waverace one to be for Melee instead and compile it...somehow.
Fun fact, before there was Wiikey Fusion, there was Electric_rain trying to recreate what crazynation did with his IDE loading so portablizers wouldn't have to try to deal with the disc drive...good times, good times.
SS

Re: Need some coding help with Melee's start.dol
If you thought the source for crediars thing was outdated, wait till you look at CrazyNation source.
I'd get someone who has time to write something, and ask them to write a trainer
(I'm too flat out busy at the moment, maybe if you can wait a few months).
I'd get someone who has time to write something, and ask them to write a trainer


- ShockSlayer
- Posts: 97
- Joined: Sat Feb 05, 2011 7:21 pm
Re: Need some coding help with Melee's start.dol
Well, he never gave me the source, just basically told me it was outdated I guess. And yeah, I can't figure out crazynation's either. ;_;
Any suggestions as to where to find someone to help me out? The trainer idea is mostly wishful thinking, I'm still mainly interested in a working widescreen solution.
Anyways, if I can't find someone/figure this out myself, I'd appreciate any help you can give me even if it's months down the road.
SS
Any suggestions as to where to find someone to help me out? The trainer idea is mostly wishful thinking, I'm still mainly interested in a working widescreen solution.
Anyways, if I can't find someone/figure this out myself, I'd appreciate any help you can give me even if it's months down the road.
SS

- ShockSlayer
- Posts: 97
- Joined: Sat Feb 05, 2011 7:21 pm