Skip to content

Commit

Permalink
Inital commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Lglaplante committed Dec 13, 2020
1 parent 216e15b commit 647b31e
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
25 changes: 25 additions & 0 deletions DSShinyEditor.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30320.27
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DSShinyEditor", "DSShinyEditor\DSShinyEditor.csproj", "{91039D23-CF3F-4A60-8C6B-CE00127111B0}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{91039D23-CF3F-4A60-8C6B-CE00127111B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{91039D23-CF3F-4A60-8C6B-CE00127111B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{91039D23-CF3F-4A60-8C6B-CE00127111B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{91039D23-CF3F-4A60-8C6B-CE00127111B0}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FE016F6C-08F6-41C6-B4C2-F2F27824200D}
EndGlobalSection
EndGlobal
8 changes: 8 additions & 0 deletions DSShinyEditor/DSShinyEditor.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

</Project>
57 changes: 57 additions & 0 deletions DSShinyEditor/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
using System;
using System.IO;



namespace DS_Shiny_Editor
{
class Program
{
static void Main(string[] args)
{


int ptShinyAddr = 0x79E50;


Console.WriteLine("This program allows you to change the shiny rate in DS Pokemon games. As of now, ONLY Platinum is supported. The new rate can only range between 00 to FF (basically 0 to 255, being 0/65535 to roughly 1/257). for example, a rate of 10 gives 1/4096");
Console.WriteLine("To calculate the percentage, the following can be used: (Rate/65535)*100. The default value is 08 (1/8192)");
Console.WriteLine("Press any key to continue");
Console.ReadKey();
Console.Clear();
Console.WriteLine("Input your shiny rate, in decimal (0 to 255)");
int inputShinyRate = Convert.ToInt16(Console.ReadLine());
string hexShinyRate = "0x" + inputShinyRate.ToString("X");
Console.WriteLine("The new shiny rate will be " + hexShinyRate);

//We check if the rom exists
string ptRom = Path.Combine(Directory.GetCurrentDirectory() + @"\platinum.nds");

Console.WriteLine("Checking for rom...");
if (File.Exists("platinum.nds"))
{
Console.WriteLine("Rom found! Changing the value..");

//Main code to write the new rate

BinaryWriter bw = new BinaryWriter(File.OpenWrite(ptRom));
bw.Seek(ptShinyAddr, SeekOrigin.Begin);
bw.Write((byte)inputShinyRate);
bw.Dispose();

Console.WriteLine("Done !");
}
else {
Console.WriteLine("Sorry, the File does not exists, or is not present in the working directory. Please make sure the rom is there, and try again.");
}
Console.WriteLine("Press any key to close");
Console.ReadKey();
Environment.Exit(1);





}
}
}

0 comments on commit 647b31e

Please sign in to comment.