1
0
Fork 0
This repository has been archived on 2024-02-06. You can view files and clone it, but cannot push or open issues or pull requests.
Super-Mario-Sunshine-C-Kit/README.md

73 lines
2.9 KiB
Markdown
Raw Normal View History

2016-09-03 08:13:20 +09:00
# Super Mario Sunshine - C Kit
2016-07-08 08:53:33 +09:00
A WIP C library for everyone's favorite game: Super Mario Sunshine.
2016-07-12 23:37:22 +09:00
TODO: Add more examples.. (Please)
TODO: Actually fix the code listed in the main example.
2016-09-03 08:11:53 +09:00
#What can this do?
2016-07-08 08:53:33 +09:00
You can make Gecko code modifications in C for Super Mario Sunshine, and Super Mario Sunshine only, for now. (I'll probably make another kit for some other games in the future, though only me working on them; I don't want to involve Miluaces into the pain. ^ ^' )
2016-09-03 08:11:53 +09:00
#Neato!... Well, how do I set this up?
2016-07-08 08:53:33 +09:00
First, you need to install devkitPro in order for your code to compile, and don't forget to set up the environment for devkitPPC. (Ex., C:\devkitPro\devkitPPC\bin) You can install the lib anywhere on your computer, as long as a folder in the file path doesn't contain any spaces. To compile your code, simply drag your C code file into build.bat.
2016-09-03 08:11:53 +09:00
#Alright. Do you have any examples to show?
2016-07-08 08:53:33 +09:00
Yes, actually. Here's an item spawning example from Miluaces:
2016-09-03 08:11:53 +09:00
include "sms.h"
2016-07-08 08:53:33 +09:00
static int laststate __attribute__((section(".sdata"))); //Last state
int OnUpdate(MarDirector* director) {
int (*GameUpdate)(MarDirector* director) = (void*)*(void**)((int)*(int*)director + 0x64);
MarioActor* mario = GetMarioHitActor();
ItemActor* item = 0;
if (!laststate){
if (ControllerOne->buttons & PRESS_DU) //Dpad up spawns a coin
item = MakeObjAppear(*gpItemManager, OBJ_COIN);
else if (ControllerOne->buttons & PRESS_DL) //Dpad left spawns a 1-up
item = MakeObjAppear(*gpItemManager, OBJ_ONEUP);
else if (ControllerOne->buttons & PRESS_DR) //Dpad right spawns a rocket nozzle
item = MakeObjAppear(*gpItemManager, OBJ_ROCKETNOZZLE);
else if (ControllerOne->buttons & PRESS_DD) //Dpad down spawns a turbo nozzle
item = MakeObjAppear(*gpItemManager, OBJ_TURBONOZZLE);
}
// If no dpad buttons are pressed, reset laststate
if (!(ControllerOne-> buttons & (PRESS_DU | PRESS_DL | PRESS_DR | PRESS_DD)))
laststate = 0;
//If item was assigned, set it up
if (item != 0){
//Set laststate to 1 to prevent more than one item spawning from one button press
laststate = 1;
//Set item position
item->position.x = mario->position.x;
item->position.y = mario->position.y + 200.0f;
item->position.z = mario->position.z;
//Set item velocity
item->velocity.y = 20.0f;
//Make item moveable
item->flags = item->flags & ~ITEMFLAG_STATIC;
}
return GameUpdate(director);
}
2016-09-03 08:11:53 +09:00
#My code compiled! What do I do now?
2016-07-08 08:53:33 +09:00
That's good! The Gecko code should have automatically been copied to your clipboard. (Thanks Miluaces :D ) With that, you should now be able to paste that into your cheat code list in Dolphin and play your modification!
---
More examples and updates to the lib will surely come at the right moment. Stick around in the IRC channel #sunshinerealm in irc.nolimitzone.com/6667 to meet and converse with the Sunshine Realm crew and see updates on current SMS modifications, big or small.