SM64O M:X r14 – Development Part 2
Tarek701 | May 30, 2013No, this isn’t really a new release. This is more an explaintation, how future code is compiled.
Before, in SM64O C:X, we’ve used a very crappy way to do this. Now, we have a better way.
As you know, our main coding language will be C. Nothing else. Of course, you want now to release your code, but mainly as a patch. This works good at all, but people are able to recreate the patch in C and steal your code and/or claim it as theirs. So, we’ve decided to make a better compilation and this time, the machine binary code will be compiled too. For this, we’ve created an own algorithm, which does that for you:
For example, we write following C code:
#include
#include "explode.h"
void _start(void)
{
asm volatile("la $gp, _gp");
PrintXY(50,50, "Hello World");
}
A very simple C code. This one gets compiled usually to GameShark code. With PJ64 2.1 ME, the code gets compiled to machine binary into a .bin file. This .bin file can be then patched inside the ROM. However, as I said, you’re able to recreate that code from scratch.
So, we’ve decided a better method. When your code gets compiled, it will be compiled into a special compression/hash format. As you know, it’s not revertable, so better have a backup of your original code.
Then you can easily patch the patch file through PJ64 Patcher. This patcher allows to patch those special compression/hash formats. This should finally prevent stealing code.
Next:
Gamemodes!
Well, I’ve decided to write a new interactive feature, which allows you gamemodes. A gamemode is a setup, which allows you to manipulate all world settings and code some special features into it, a gamemode in this case. For example “Team Deathmatch”. The world settings are not directly changed, but a code is inserted, which allows to fight between mario and mario. In this case, you can also kill an another mario. (Also a compiled function; We’re using a special function, which says; If Mario A hits Mario B, send this to server, check if Punch was true, then send damage to Mario B. Mario B = damaged)
But the cool thing is, you can use gamemodes to change world settings, light, shading, etc. to configurate the gamemode and make it comfortable.
Also, the world settings, doesn’t even have to be written in C, just as simple $ commands. Example:
//environment
$EnvGuiServer::SimpleMode 0
$EnvGuiServer::SkyFile Add-Ons/Sky_Sunset/Sunset.dml
$EnvGuiServer::WaterFile Add-Ons/Water_Default/default.water
$EnvGuiServer::GroundFile Add-Ons/Ground_Plate/plate.ground
$EnvGuiServer::SunFlareTopTexture base/lighting/corona.png
$EnvGuiServer::SunFlareBottomTexture base/lighting/corona.png
$EnvGuiServer::DayOffset 0
$EnvGuiServer::DayLength 300
$EnvGuiServer::DayCycleEnabled 0
$EnvGuiServer::DayCycle Add-Ons/DayCycle_Default/default.daycycle
$EnvGuiServer::SunAzimuth 315
$EnvGuiServer::SunElevation 28
$EnvGuiServer::DirectLightColor 0.968628 0.835294 0.796079 1.000000
$EnvGuiServer::AmbientLightColor 0.600000 0.500000 0.400000 1.000000
$EnvGuiServer::ShadowColor 0.525490 0.560784 0.682353 1.000000
$EnvGuiServer::SunFlareColor 0.100000 0.100000 0.100000 1.000000
$EnvGuiServer::SunFlareSize 3
$EnvGuiServer::VisibleDistance 900
$EnvGuiServer::FogDistance 500
$EnvGuiServer::FogHeight
$EnvGuiServer::FogColor 0.580000 0.680000 0.940000 1.000000
$EnvGuiServer::WaterColor 255 255 255 128
$EnvGuiServer::WaterHeight 0
$EnvGuiServer::UnderWaterColor 51 153 153 77
$EnvGuiServer::SkyColor 1.0 1.0 1.0 1.0
$EnvGuiServer::WaterScrollX 0
$EnvGuiServer::WaterScrollY 0
$EnvGuiServer::GroundColor 0 128 64 255
$EnvGuiServer::GroundScrollX 0
$EnvGuiServer::GroundScrollY 0
$EnvGuiServer::VignetteMultiply 0
$EnvGuiServer::VignetteColor 0.000000 0.000000 0.000000 0.392157
This is the environment control. With this, you can set things, when the gamemode is started.
If you want to run code, just put it inside the folder later. You should call the file server.c and player specific stuff player.c
Through this, we were able to code a little checkmate deathmatch. You can also write it in ASM; but then you will have to use “labels”.






Recent Comments