Skip to content

Commit

Permalink
Build 0.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
danebouchie committed Nov 6, 2016
1 parent 6b63b16 commit b5ffa4d
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 38 deletions.
10 changes: 5 additions & 5 deletions Source/SM64 Diagnostic/Config/TrianglesData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@
<Data type="float" address="0x1C" triangleOffset="true">Normal X</Data>
<Data type="float" address="0x20" triangleOffset="true">Normal Y</Data>
<Data type="float" address="0x24" triangleOffset="true">Normal Z</Data>
<Data type="float" address="0x28" triangleOffset="true">Offset</Data>
<Data type="float" address="0x28" triangleOffset="true">Normal Offset</Data>
<Data type="uint" address="0x2C" triangleOffset="true" useHex="true">Associated Object</Data>
<Data special="true" specialType="ClosestVertex">Closest Vertex</Data>
<Data special="true" specialType="UpHillAngle">Uphill Angle</Data>
<Data special="true" specialType="DownHillAngle">Downhill Angle</Data>
<Data special="true" specialType="RightHillAngle">Right Hill Angle</Data>
<Data special="true" specialType="LeftHillAngle">Left Hill Angle</Data>
<Data special="true" specialType="Steepness" color="#ffcccc">Steepness</Data>
<Data special="true" specialType="Steepness">Steepness</Data>
<Data type="float" address="0x8033B1AC" color="#ffcccc">Mario X</Data>
<Data type="float" address="0x8033B1B0" color="#ffcccc">Mario Y</Data>
<Data type="float" address="0x8033B1B4" color="#ffcccc">Mario Z</Data>
<Data type="ushort" address="0x00C26C16" absoluteAddress="true" isAngle="true" color="#ffcccc">Yaw (Intended)</Data>
<Data type="ushort" address="0x00C26C1C" absoluteAddress="true" isAngle="true" color="#ffcccc">Yaw (Facing)</Data>
<Data special="true" specialType="ClosestVertex" color="#ffcccc">Closest Vertex</Data>
<Data type="ushort" address="0x00C26C16" absoluteAddress="true" isAngle="true" color="#ffcccc">M. Yaw (Intended)</Data>
<Data type="ushort" address="0x00C26C1C" absoluteAddress="true" isAngle="true" color="#ffcccc">M. Yaw (Facing)</Data>
<Data type="uint" address="0x00C26C58" absoluteAddress="true" useHex="true" color="#ffcccc">Floor Triangle</Data>
<Data type="uint" address="0x00C26C50" absoluteAddress="true" useHex="true" color="#ffcccc">Wall Triangle</Data>
<Data type="uint" address="0x00C26C54" absoluteAddress="true" useHex="true" color="#ffcccc">Ceiling Triangle</Data>
Expand Down
2 changes: 1 addition & 1 deletion Source/SM64 Diagnostic/StroopMainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace SM64_Diagnostic
{
public partial class StroopMainForm : Form
{
const string _version = "v0.2.5";
const string _version = "v0.2.6";
ProcessStream _sm64Stream = null;

ObjectSlotManagerGui _slotManagerGui = new ObjectSlotManagerGui();
Expand Down
25 changes: 3 additions & 22 deletions Source/SM64 Diagnostic/Utilities/MarioActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ namespace SM64_Diagnostic.Utilities
{
public static class MarioActions
{
public enum DistanceToObjType { Mario, Object, ObjectHome };

public static bool MoveMarioToObject(ProcessStream stream, uint objAddress)
{
// Move mario to object
Expand Down Expand Up @@ -200,23 +198,12 @@ public static bool RetrieveTriangle(ProcessStream stream, uint triangleAddress)
float normOffset = -(normX * marioX + normY * marioY + normZ * marioZ);
float normDiff = normOffset - oldNormOffset;

short xOffset, yOffset, zOffset;
xOffset = (short)(-normDiff * normX);
yOffset = (short)(-normDiff * normY);
zOffset = (short)(-normDiff * normZ);
short yOffset = (short)(-normDiff * normY);

short v1X, v1Y, v1Z;
short v2X, v2Y, v2Z;
short v3X, v3Y, v3Z;
v1X = (short)(BitConverter.ToInt16(stream.ReadRam(triangleAddress + Config.TriangleOffsets.X1, 2), 0) + xOffset);
short v1Y, v2Y, v3Y;
v1Y = (short)(BitConverter.ToInt16(stream.ReadRam(triangleAddress + Config.TriangleOffsets.Y1, 2), 0) + yOffset);
v1Z = (short)(BitConverter.ToInt16(stream.ReadRam(triangleAddress + Config.TriangleOffsets.Z1, 2), 0) + zOffset);
v2X = (short)(BitConverter.ToInt16(stream.ReadRam(triangleAddress + Config.TriangleOffsets.X2, 2), 0) + xOffset);
v2Y = (short)(BitConverter.ToInt16(stream.ReadRam(triangleAddress + Config.TriangleOffsets.Y2, 2), 0) + yOffset);
v2Z = (short)(BitConverter.ToInt16(stream.ReadRam(triangleAddress + Config.TriangleOffsets.Z2, 2), 0) + zOffset);
v3X = (short)(BitConverter.ToInt16(stream.ReadRam(triangleAddress + Config.TriangleOffsets.X3, 2), 0) + xOffset);
v3Y = (short)(BitConverter.ToInt16(stream.ReadRam(triangleAddress + Config.TriangleOffsets.Y3, 2), 0) + yOffset);
v3Z = (short)(BitConverter.ToInt16(stream.ReadRam(triangleAddress + Config.TriangleOffsets.Z3, 2), 0) + zOffset);

short yMin = Math.Min(Math.Min(v1Y, v2Y), v3Y);
short yMax = Math.Max(Math.Max(v1Y, v2Y), v3Y);
Expand All @@ -225,16 +212,10 @@ public static bool RetrieveTriangle(ProcessStream stream, uint triangleAddress)

// Update triangle
bool success = true;

success &= stream.WriteRam(BitConverter.GetBytes(v1X), triangleAddress + Config.TriangleOffsets.X1);

success &= stream.WriteRam(BitConverter.GetBytes(v1Y), triangleAddress + Config.TriangleOffsets.Y1);
success &= stream.WriteRam(BitConverter.GetBytes(v1Z), triangleAddress + Config.TriangleOffsets.Z1);
success &= stream.WriteRam(BitConverter.GetBytes(v2X), triangleAddress + Config.TriangleOffsets.X2);
success &= stream.WriteRam(BitConverter.GetBytes(v2Y), triangleAddress + Config.TriangleOffsets.Y2);
success &= stream.WriteRam(BitConverter.GetBytes(v2Z), triangleAddress + Config.TriangleOffsets.Z2);
success &= stream.WriteRam(BitConverter.GetBytes(v3X), triangleAddress + Config.TriangleOffsets.X3);
success &= stream.WriteRam(BitConverter.GetBytes(v3Y), triangleAddress + Config.TriangleOffsets.Y3);
success &= stream.WriteRam(BitConverter.GetBytes(v3Z), triangleAddress + Config.TriangleOffsets.Z3);
success &= stream.WriteRam(BitConverter.GetBytes(yMin), triangleAddress + Config.TriangleOffsets.YMin);
success &= stream.WriteRam(BitConverter.GetBytes(yMax), triangleAddress + Config.TriangleOffsets.YMax);
success &= stream.WriteRam(BitConverter.GetBytes(normOffset), triangleAddress + Config.TriangleOffsets.Offset);
Expand Down
13 changes: 13 additions & 0 deletions Windows Build/Config/Config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
<CoordinateOffsetX>0xA0</CoordinateOffsetX>
<CoordinateOffsetY>0xA4</CoordinateOffsetY>
<CoordinateOffsetZ>0xA8</CoordinateOffsetZ>
<HomeOffsetX>0x164</HomeOffsetX>
<HomeOffsetY>0x168</HomeOffsetY>
<HomeOffsetZ>0x16C</HomeOffsetZ>
<RotationOffset>0xC8</RotationOffset>
<MaxObjectSlots>240</MaxObjectSlots>
<MoveToMarioYOffset>300</MoveToMarioYOffset>
Expand Down Expand Up @@ -65,6 +68,16 @@
<SlidingSpeedZOffset>0x5C</SlidingSpeedZOffset>
<PeakHeightOffset>0xBC</PeakHeightOffset>
</Mario>
<Hud>
<HpAddress>0x8033b21e</HpAddress>
<LiveCountAddress>0x8033b21c</LiveCountAddress>
<CoinCountAddress>0x8033b218</CoinCountAddress>
<StarCountAddress>0x8033b21a</StarCountAddress>
<FullHp>2176</FullHp>
<StandardLives>4</StandardLives>
<StandardCoins>0</StandardCoins>
<StandardStars>120</StandardStars>
</Hud>
<Debug>
<ToggleAddress>0x8033d263</ToggleAddress>
<SettingAddress>0x80330e94</SettingAddress>
Expand Down
2 changes: 1 addition & 1 deletion Windows Build/Config/Hacks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<Config>
<HackDirectory>Resources\Hacks\</HackDirectory>
</Config>
<Hack name="Pu Visibility" path="PuVisible.hck" />
<Hack name="Pu Visibility (by Peter Fedak)" path="PuVisible.hck" />
<Hack name="Camera 45 Degrees" path="Camera45Hack.hck" />
</Hacks>
7 changes: 0 additions & 7 deletions Windows Build/Config/MarioData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@
<Data type="ushort" address="0x00c26c22" absoluteAddress="true" isAngle="true">Roll</Data>
<Data type="ushort" address="0x00c26c26" absoluteAddress="true" isAngle="true">Yaw Velocity</Data>
<Data type="ushort" address="0x00c26c20" absoluteAddress="true" isAngle="true">Flying Pull Back</Data>
<Data type="float" address="0x70" marioOffset="true">Floor Height</Data>
<Data type="float" address="0x6C" marioOffset="true">Ceiling Height</Data>
<Data special="true" specialType="DistanceBelowCeiling">Dist Below Ceiling</Data>
<Data special="true" specialType="DistanceAboveFloor">Dist Above Floor</Data>
<Data type="uint" address="0x00C26C58" absoluteAddress="true" useHex="true">Floor Triangle</Data>
<Data type="uint" address="0x00C26C50" absoluteAddress="true" useHex="true">Wall Triangle</Data>
<Data type="uint" address="0x00C26C54" absoluteAddress="true" useHex="true">Ceiling Triangle</Data>
<Data type="uint" address="0xc26c68" absoluteAddress="true" useHex="true">Interaction Object</Data>
<Data type="uint" address="0xc26c70" absoluteAddress="true" useHex="true">Using Object</Data>
<Data type="uint" address="0xc1c8b4" absoluteAddress="true" useHex="true">Stood On Object</Data>
Expand Down
3 changes: 3 additions & 0 deletions Windows Build/Config/ObjectAssociations.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
<Using>
<OverlayImage path="Using.png"/>
</Using>
<Closest>
<OverlayImage path="Closest.png"/>
</Closest>
</Overlays>
<Object behaviorScriptAddress="0x13000000" name="Star Door">
<Image path="Star Door.png"/>
Expand Down
8 changes: 6 additions & 2 deletions Windows Build/Config/ObjectData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<Data type="uint" address="0x114" objectOffset="true" isAngle="true">Pitch (Rot Speed)</Data>
<Data type="uint" address="0x11c" objectOffset="true" isAngle="true">Roll (Rot Speed)</Data>
<Data type="float" address="0x015C" objectOffset="true">Dist to Mario</Data>
<Data special="true" specialType="DistanceToMario">Act. Dist to Mario</Data>
<Data special="true" specialType="LateralDistanceToMario">Lat. Dist to Mario</Data>
<Data special="true" specialType="MarioDistanceToObject">Act. Dist to Mario</Data>
<Data special="true" specialType="MarioLateralDistanceToObject">Lat. Dist to Mario</Data>
<Data type="uint" address="0x0160" objectOffset="true" isAngle="true">Angle to Mario</Data>
<Data type="float" address="0x019C" objectOffset="true">Drawing Dist</Data>
<Data special="true" specialType="RngCallsPerFrame">RNG Calls/Frame</Data>
Expand All @@ -37,6 +37,10 @@
<Data type="float" address="0x164" objectOffset="true">Home X</Data>
<Data type="float" address="0x168" objectOffset="true">Home Y</Data>
<Data type="float" address="0x16C" objectOffset="true">Home Z</Data>
<Data special="true" specialType="MarioDistanceToObjectHome">Mario Dist to Home</Data>
<Data special="true" specialType="MarioLateralDistanceToObjectHome">Mario Lat. Dist to Home</Data>
<Data special="true" specialType="ObjectDistanceToHome">Dist to Home</Data>
<Data special="true" specialType="LateralObjectDistanceToHome">Lat. Dist to Home</Data>
<Data type="uint" address="0x1CC" objectOffset="true" useHex="true">Release Status</Data>
<Data type="ushort" address="0x136" objectOffset="true" useHex="true">Interaction Status</Data>
<Data type="int" address="0x144" objectOffset="true">Subtype</Data>
Expand Down
45 changes: 45 additions & 0 deletions Windows Build/Config/TrianglesData.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8" ?>
<TrianglesData>
<Data special="true" specialType="Classification">Classification</Data>
<Data type="ushort" address="0x00" triangleOffset="true">SurfaceType</Data>
<Data type="byte" address="0x02" triangleOffset="true" useHex="true">Flags</Data>
<Data type="byte" address="0x03" triangleOffset="true">Wind Direction</Data>
<Data type="short" address="0x04" triangleOffset="true">Wall Projection</Data>
<Data type="short" address="0x06" triangleOffset="true">Y Min</Data>
<Data type="short" address="0x08" triangleOffset="true">Y Max</Data>
<Data type="short" address="0x0A" triangleOffset="true">X1</Data>
<Data type="short" address="0x0C" triangleOffset="true">Y1</Data>
<Data type="short" address="0x0E" triangleOffset="true">Z1</Data>
<Data type="short" address="0x10" triangleOffset="true">X2</Data>
<Data type="short" address="0x12" triangleOffset="true">Y2</Data>
<Data type="short" address="0x14" triangleOffset="true">Z2</Data>
<Data type="short" address="0x16" triangleOffset="true">X3</Data>
<Data type="short" address="0x18" triangleOffset="true">Y3</Data>
<Data type="short" address="0x1A" triangleOffset="true">Z3</Data>
<Data type="float" address="0x1C" triangleOffset="true">Normal X</Data>
<Data type="float" address="0x20" triangleOffset="true">Normal Y</Data>
<Data type="float" address="0x24" triangleOffset="true">Normal Z</Data>
<Data type="float" address="0x28" triangleOffset="true">Normal Offset</Data>
<Data type="uint" address="0x2C" triangleOffset="true" useHex="true">Associated Object</Data>
<Data special="true" specialType="UpHillAngle">Uphill Angle</Data>
<Data special="true" specialType="DownHillAngle">Downhill Angle</Data>
<Data special="true" specialType="RightHillAngle">Right Hill Angle</Data>
<Data special="true" specialType="LeftHillAngle">Left Hill Angle</Data>
<Data special="true" specialType="Steepness">Steepness</Data>
<Data type="float" address="0x8033B1AC" color="#ffcccc">Mario X</Data>
<Data type="float" address="0x8033B1B0" color="#ffcccc">Mario Y</Data>
<Data type="float" address="0x8033B1B4" color="#ffcccc">Mario Z</Data>
<Data special="true" specialType="ClosestVertex" color="#ffcccc">Closest Vertex</Data>
<Data type="ushort" address="0x00C26C16" absoluteAddress="true" isAngle="true" color="#ffcccc">M. Yaw (Intended)</Data>
<Data type="ushort" address="0x00C26C1C" absoluteAddress="true" isAngle="true" color="#ffcccc">M. Yaw (Facing)</Data>
<Data type="uint" address="0x00C26C58" absoluteAddress="true" useHex="true" color="#ffcccc">Floor Triangle</Data>
<Data type="uint" address="0x00C26C50" absoluteAddress="true" useHex="true" color="#ffcccc">Wall Triangle</Data>
<Data type="uint" address="0x00C26C54" absoluteAddress="true" useHex="true" color="#ffcccc">Ceiling Triangle</Data>
<Data type="float" address="0x8033b1E0" color="#ffcccc">Floor Height</Data>
<Data special="true" specialType="HeightOnSlope" color="#ffcccc">Height On Slope</Data>
<Data type="float" address="0x8033b1DC" color="#ffcccc">Ceiling Height</Data>
<Data special="true" specialType="DistanceBelowCeiling" color="#ffcccc">Dist Below Ceiling</Data>
<Data special="true" specialType="DistanceAboveFloor" color="#ffcccc">Dist Above Floor</Data>
<Data special="true" specialType="NormalDistAway" color="#ffcccc">Normal Dist Away</Data>
<Data special="true" specialType="VerticalDistAway" color="#ffcccc">Vertical Dist Away</Data>
</TrianglesData>
Binary file modified Windows Build/Stroop.exe
Binary file not shown.

0 comments on commit b5ffa4d

Please sign in to comment.