Skip to content

Commit

Permalink
Master Ocarina
Browse files Browse the repository at this point in the history
  • Loading branch information
mzxrules committed Sep 10, 2018
1 parent aba1de9 commit 8fe9b2c
Show file tree
Hide file tree
Showing 243 changed files with 117,297 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,16 @@ ModelManifest.xml
.paket/paket.exe

# FAKE - F# Make
.fake/
.fake/

# ignore wip or dead projects
WadDisect/
VerboseWPF/
CutsceneEditor/
DungeonRush/
DungeonRushMQ/
PetriesChallenge/
Experimental/
RomBlock/
RomWorkshop/
PatchShared/
86 changes: 86 additions & 0 deletions Actor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DebugRomStats
{
public static class ActorFactory
{
public static ActorRecord NewActor(byte[] record)
{
ushort actor;

actor = (ushort)((record[0] << 8) + record[1]);
switch (actor)
{
case 0x000A:
return new ChestActor(record);
default:
return new ActorRecord(record);
}
}
}
#region ActorRecord
public class ActorRecord
{
public static int LENGTH = 0x10;
public ushort Actor;
public ushort Variable;
public Vector3<short> coords = new Vector3<short>();
public Vector3<ushort> rotation = new Vector3<ushort>();
public ActorRecord(byte[] record)
{
Actor = (ushort)((record[0] << 8) + record[1]);
coords.x = (short)((record[2] << 8) + record[3]);
coords.y = (short)((record[4] << 8) + record[5]);
coords.z = (short)((record[6] << 8) + record[7]);
rotation.x = (ushort)((record[8] << 8) + record[9]);
rotation.y = (ushort)((record[10] << 8) + record[11]);
rotation.z = (ushort)((record[12] << 8) + record[13]);
Variable = (ushort)((record[14] << 8) + record[15]);
}
public virtual string Print()
{
return String.Format("{0}, {3}, {1} {2} ",
Actor.ToString("X4"),
PrintCoord(),
PrintRotation(),
Variable.ToString("X4"));
}
public string PrintCoord()
{
return string.Format("({0}, {1}, {2})",
coords.x, coords.y, coords.z);
}
public string PrintRotation()
{
return string.Format("({0}, {1}, {2})",
Degrees(rotation.x).ToString("F0"),
Degrees(rotation.y).ToString("F0"),
Degrees(rotation.z).ToString("F0"));
}
public string PrintCoordAndRotation()
{
return PrintCoord() + " " + PrintRotation();
}
protected static float Degrees(ushort rx)
{
return ((float)rx / (float)ushort.MaxValue) * 360.0f;
}
}
#endregion

//Believe this is the Link actor.
public class PositionRecord : ActorRecord
{
public PositionRecord(byte[] record)
: base(record)
{
}
public override string Print()
{
return PrintCoordAndRotation();
}
}
}
6 changes: 6 additions & 0 deletions Atom/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/>
</startup>
</configuration>
104 changes: 104 additions & 0 deletions Atom/Atom.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{68453906-153D-4CD0-8AF4-B1B178D6CE28}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Atom</RootNamespace>
<AssemblyName>Atom</AssemblyName>
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Atom.Atom</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DisassemblyTask.cs" />
<Compile Include="JQuery.cs" />
<Compile Include="r4300\COP0.cs" />
<Compile Include="r4300\COP1.cs" />
<Compile Include="r4300\CPU.cs" />
<Compile Include="r4300\decode_help.cs" />
<Compile Include="r4300\label.cs" />
<Compile Include="r4300\Opcodes.cs" />
<Compile Include="r4300\parser.cs" />
<Compile Include="r4300\adis_c.cs" />
<Compile Include="program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="r4300i.cs" />
<Compile Include="RSP\decoder_c.cs" />
<Compile Include="RSP\decoder_h.cs" />
<Compile Include="MipsFields.cs" />
<Compile Include="RSP\opcodes.cs" />
<Compile Include="RSP\vector_opcodes.cs" />
<Compile Include="Section.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<Compile Include="RSP\opcodes_priv_h.cs" />
<None Include="data\mm-j0.json" />
<None Include="data\oot-n0.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\JOcaBase\JOcaBase.csproj">
<Project>{87a06c9e-f860-4f65-ad47-e4d97339382e}</Project>
<Name>JOcaBase</Name>
</ProjectReference>
<ProjectReference Include="..\OcaLib\Helper\Helper.csproj">
<Project>{44a9c95f-06bc-4686-b341-150a0e2755b6}</Project>
<Name>Helper</Name>
</ProjectReference>
<ProjectReference Include="..\OcaLib\source\OcaLib.csproj">
<Project>{ec69e9e2-4cfb-43f9-8e37-cb6a52935e4c}</Project>
<Name>OcaLib</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="Notes.txt" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Loading

0 comments on commit 8fe9b2c

Please sign in to comment.