Skip to content

Commit

Permalink
Merge pull request #12 from SM64-STROOP/Development
Browse files Browse the repository at this point in the history
Build 0.2.7
  • Loading branch information
danebouchie authored Dec 3, 2016
2 parents 28bf804 + 4f8c832 commit 1887f56
Show file tree
Hide file tree
Showing 52 changed files with 3,183 additions and 1,424 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The latest release of Stroop can be downloaded from our [Releases Page](https://
* Windows 10 / Windows 8 / Windows 7 / Windows Vista 64-bit or 32-bit
* OpenGL 3.0 or greater (requirement for map tab only)
* .NET Framework 4.6 (See [.NET Framework System Requirements](https://msdn.microsoft.com/en-us/library/8z6watww(v=vs.110).aspx) for more information)
* Mupen 0.5 rerecording (0.5.1 will not work)
* [Mupen 0.5 rerecording](http://adelikat.tasvideos.org/emulatordownloads/mupen64-rr/Mupen64%20v8%20installer.zip) (0.5.1 will not work)
* 64 Marios (Must be super)
* Marios must be American (No PAL or JAP just yet)

Expand Down
5 changes: 4 additions & 1 deletion Source/SM64 Diagnostic/Config/Config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<HomeOffsetX>0x164</HomeOffsetX>
<HomeOffsetY>0x168</HomeOffsetY>
<HomeOffsetZ>0x16C</HomeOffsetZ>
<RotationOffset>0xC8</RotationOffset>
<RotationOffset>0xD4</RotationOffset>
<MaxObjectSlots>240</MaxObjectSlots>
<MoveToMarioYOffset>300</MoveToMarioYOffset>
</ObjectSlots>
Expand Down Expand Up @@ -73,6 +73,9 @@
<LiveCountAddress>0x8033b21c</LiveCountAddress>
<CoinCountAddress>0x8033b218</CoinCountAddress>
<StarCountAddress>0x8033b21a</StarCountAddress>
<DisplayLiveCountAddress>0x8033b260</DisplayLiveCountAddress>
<DisplayCoinCountAddress>0x8033b262</DisplayCoinCountAddress>
<DisplayStarCountAddress>0x8033b268</DisplayStarCountAddress>
<FullHp>2176</FullHp>
<StandardLives>4</StandardLives>
<StandardCoins>0</StandardCoins>
Expand Down
9 changes: 4 additions & 5 deletions Source/SM64 Diagnostic/Config/MarioData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@
<Data type="ushort" address="0x00C26C1C" absoluteAddress="true" isAngle="true">Yaw (Facing)</Data>
<Data type="ushort" address="0x00C26C2A" absoluteAddress="true" isAngle="true">Yaw (Moving)</Data>
<Data type="ushort" address="0x00C26C16" absoluteAddress="true" isAngle="true">Yaw (Intended)</Data>
<Data type="ushort" address="0x00C3BDB8" absoluteAddress="true" isAngle="true">Cannon Yaw</Data>
<Data type="ushort" address="0x00c26c1e" absoluteAddress="true" isAngle="true">Pitch</Data>
<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="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>
<Data type="uint" address="0xc26c6c" absoluteAddress="true" useHex="true">Held Object</Data>
<Data type="uint" address="0xc26c68" absoluteAddress="true" useHex="true" isObject="true">Interaction Object</Data>
<Data type="uint" address="0xc26c70" absoluteAddress="true" useHex="true" isObject="true">Using Object</Data>
<Data type="uint" address="0xc1c8b4" absoluteAddress="true" useHex="true" isObject="true">Stood On Object</Data>
<Data type="uint" address="0xc26c6c" absoluteAddress="true" useHex="true" isObject="true">Held Object</Data>
<Data type="float" address="0x8033B3C8">HOLP X</Data>
<Data type="float" address="0x8033B3CC">HOLP Y</Data>
<Data type="float" address="0x8033B3D0">HOLP Z</Data>
Expand Down
71 changes: 38 additions & 33 deletions Source/SM64 Diagnostic/Config/ObjectAssociations.xml

Large diffs are not rendered by default.

24 changes: 14 additions & 10 deletions Source/SM64 Diagnostic/Config/ObjectData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,26 @@
<Data type="float" address="0xB0" objectOffset="true">Y Speed</Data>
<Data type="float" address="0xB4" objectOffset="true">Z Speed</Data>
<Data type="float" address="0xB8" objectOffset="true">H Speed</Data>
<Data type="uint" address="0xD4" objectOffset="true" isAngle="true">Yaw (Facing)</Data>
<Data type="uint" address="0xD0" objectOffset="true" isAngle="true">Pitch (Facing)</Data>
<Data type="uint" address="0xD8" objectOffset="true" isAngle="true">Roll (Facing)</Data>
<Data type="uint" address="0xC8" objectOffset="true" isAngle="true">Yaw (Moving)</Data>
<Data type="uint" address="0xC4" objectOffset="true" isAngle="true">Pitch (Moving)</Data>
<Data type="uint" address="0xCC" objectOffset="true" isAngle="true">Roll (Moving)</Data>
<Data type="uint" address="0x118" objectOffset="true" isAngle="true">Yaw (Rot Speed)</Data>
<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="ushort" address="0xD6" objectOffset="true" isAngle="true">Yaw (Facing)</Data>
<Data type="short" address="0xD2" objectOffset="true" isAngle="true">Pitch (Facing)</Data>
<Data type="short" address="0xDA" objectOffset="true" isAngle="true">Roll (Facing)</Data>
<Data type="ushort" address="0xCA" objectOffset="true" isAngle="true">Yaw (Moving)</Data>
<Data type="short" address="0xC6" objectOffset="true" isAngle="true">Pitch (Moving)</Data>
<Data type="short" address="0xCE" objectOffset="true" isAngle="true">Roll (Moving)</Data>
<Data type="short" address="0x11A" objectOffset="true" isAngle="true">Yaw (Rot Speed)</Data>
<Data type="short" address="0x116" objectOffset="true" isAngle="true">Pitch (Rot Speed)</Data>
<Data type="short" address="0x11E" objectOffset="true" isAngle="true">Roll (Rot Speed)</Data>
<Data type="float" address="0x015C" objectOffset="true">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 special="true" specialType="AngleToMario">Act. Angle To Mario</Data>
<Data special="true" specialType="DeltaAngleToMario">Delta Angle To Mario</Data>
<Data special="true" specialType="MarioAngleToObject">Mario Angle To Object</Data>
<Data special="true" specialType="MarioDeltaAngleToObject">Delta Mario Angle To Object</Data>
<Data type="float" address="0x019C" objectOffset="true">Drawing Dist</Data>
<Data special="true" specialType="RngCallsPerFrame">RNG Calls/Frame</Data>
<Data type="uint" address="0x68" objectOffset="true" useHex="true">Parent Object</Data>
<Data type="uint" address="0x68" objectOffset="true" useHex="true" isObject="true">Parent Object</Data>
<Data type="uint" address="0x020C" objectOffset="true" useHex="true">Behavior Script</Data>
<Data type="uint" address="0x14" objectOffset="true" useHex="true">Graphic/Model</Data>
<Data type="byte" address="0x3" mask="0x10" objectOffset="true" isBool="true" invertBool="true">Visible</Data>
Expand Down
9 changes: 7 additions & 2 deletions Source/SM64 Diagnostic/Config/TrianglesData.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?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="ushort" address="0x00" triangleOffset="true">Surface Type</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="0x04" triangleOffset="true" useHex="true">Wall Projection</Data>
<Data type="byte" address="0x04" triangleOffset="true" isBool="true" mask="0x08">X Projection</Data>
<Data type="byte" address="0x04" triangleOffset="true" isBool="true" invertBool="true" mask="0x08">Z 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>
Expand All @@ -30,6 +32,9 @@
<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 special="true" specialType="ClosestVertexX" color="#ffcccc">Closest Vertex X</Data>
<Data special="true" specialType="ClosestVertexY" color="#ffcccc">Closest Vertex Y</Data>
<Data special="true" specialType="ClosestVertexZ" color="#ffcccc">Closest Vertex Z</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>
Expand Down
270 changes: 270 additions & 0 deletions Source/SM64 Diagnostic/Controls/AngleDataContainer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SM64_Diagnostic.Controls
{
public class AngleDataContainer : IDataContainer
{
Label _nameLabel;
TableLayoutPanel _tablePanel;
TextBox _textBoxValue;
string _specialName;

static AngleDataContainer _lastSelected;

public enum AngleViewModeType { Signed, Unsigned, Degrees, Radians };

AngleViewModeType _angleViewMode = AngleViewModeType.Unsigned;
bool _angleTruncated = false;

public AngleDataContainer(string name)
{
_specialName = name;

this._nameLabel = new Label();
this._nameLabel.Width = 210;
this._nameLabel.Text = name;
this._nameLabel.Margin = new Padding(3, 3, 3, 3);

this._textBoxValue = new TextBox();
this._textBoxValue.ReadOnly = true;
this._textBoxValue.BorderStyle = BorderStyle.None;
this._textBoxValue.TextAlign = HorizontalAlignment.Right;
this._textBoxValue.Width = 200;
this._textBoxValue.Margin = new Padding(6, 3, 6, 3);
this._textBoxValue.ContextMenuStrip = AngleMenu;
this._textBoxValue.MouseEnter += _textBoxValue_MouseEnter;

this._tablePanel = new TableLayoutPanel();
this._tablePanel.Size = new Size(230, _nameLabel.Height + 2);
this._tablePanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
this._tablePanel.RowCount = 1;
this._tablePanel.ColumnCount = 2;
this._tablePanel.RowStyles.Clear();
this._tablePanel.RowStyles.Add(new RowStyle(SizeType.Absolute, _nameLabel.Height + 3));
this._tablePanel.ColumnStyles.Clear();
this._tablePanel.Margin = new Padding(0);
this._tablePanel.Padding = new Padding(0);
this._tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 120));
this._tablePanel.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 110));
this._tablePanel.Controls.Add(_nameLabel, 0, 0);
this._tablePanel.Controls.Add(this._textBoxValue, 1, 0);

AngleMenu.ItemClicked += OnMenuStripClick;
AngleDropDownMenu[0].DropDownItemClicked += AngleDropDownMenu_DropDownItemClicked;
AngleDropDownMenu[1].Click += TruncateAngleMenu_ItemClicked;
}

private void TruncateAngleMenu_ItemClicked(object sender, EventArgs e)
{
if (this != _lastSelected)
return;

_angleTruncated = !_angleTruncated;

UpdateAngleValue();
}

private void AngleDropDownMenu_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
if (this != _lastSelected)
return;

switch (e.ClickedItem.Text)
{
case "Unsigned (short)":
_angleViewMode = AngleViewModeType.Unsigned;
break;
case "Signed (short)":
_angleViewMode = AngleViewModeType.Signed;
break;
case "Degrees":
_angleViewMode = AngleViewModeType.Degrees;
break;
case "Radians":
_angleViewMode = AngleViewModeType.Radians;
break;
}

UpdateAngleValue();
}

private void OnMenuStripClick(object sender, ToolStripItemClickedEventArgs e)
{
if (this != _lastSelected)
return;
}

private void _textBoxValue_MouseEnter(object sender, EventArgs e)
{
_lastSelected = this;
(AngleDropDownMenu[0].DropDownItems[0] as ToolStripMenuItem).Checked = (_angleViewMode == AngleViewModeType.Unsigned);
(AngleDropDownMenu[0].DropDownItems[1] as ToolStripMenuItem).Checked = (_angleViewMode == AngleViewModeType.Signed);
(AngleDropDownMenu[0].DropDownItems[2] as ToolStripMenuItem).Checked = (_angleViewMode == AngleViewModeType.Degrees);
(AngleDropDownMenu[0].DropDownItems[3] as ToolStripMenuItem).Checked = (_angleViewMode == AngleViewModeType.Radians);
(AngleDropDownMenu[1] as ToolStripMenuItem).Checked = _angleTruncated;
}

public Control Control
{
get
{
return _tablePanel;
}
}

private bool _valueExists = false;
public bool ValueExists
{
get
{
return _valueExists;
}
set
{
_valueExists = value;
UpdateAngleValue();
}
}

public string Name
{
get
{
return _nameLabel.Text;
}
set
{
_nameLabel.Text = value;
}
}

public string SpecialName
{
get
{
return _specialName;
}
set
{
_specialName = value;
}
}

private double _angleValue;
public double AngleValue
{
get
{
return _angleValue;
}
set
{
_angleValue = value % (Math.PI * 2);
if (_angleValue < 0)
_angleValue += Math.PI * 2;
UpdateAngleValue();
}
}

public Color Color
{
get
{
return Control.BackColor;
}
set
{
Control.BackColor = value;
_textBoxValue.BackColor = Color;
}
}

private static ContextMenuStrip _angleMenu;
public static ContextMenuStrip AngleMenu
{
get
{
if (_angleMenu == null)
{
_angleMenu = new ContextMenuStrip();
//_angleMenu.Items.Add("Edit");
//var newItem = new ToolStripMenuItem("View As Hexadecimal");
//newItem.Name = "HexView";
//_angleMenu.Items.Add(newItem);
//newItem = new ToolStripMenuItem("Lock Value");
//newItem.Name = "LockValue";
//_angleMenu.Items.Add(newItem);

_angleMenu.Items.Add(AngleDropDownMenu[0]);
_angleMenu.Items.Add(AngleDropDownMenu[1]);
}
return _angleMenu;
}
}

private static ToolStripMenuItem[] _angleMenuDropDown;
public static ToolStripMenuItem[] AngleDropDownMenu
{
get
{
if (_angleMenuDropDown == null)
{
_angleMenuDropDown = new ToolStripMenuItem[2];
_angleMenuDropDown[0] = new ToolStripMenuItem("View Angle As");
_angleMenuDropDown[0].DropDownItems.Add("Unsigned (short)");
_angleMenuDropDown[0].DropDownItems.Add("Signed (short)");
_angleMenuDropDown[0].DropDownItems.Add("Degrees");
_angleMenuDropDown[0].DropDownItems.Add("Radians");
_angleMenuDropDown[1] = new ToolStripMenuItem("Truncate Angle (by 16)");
}
return _angleMenuDropDown;
}
}

public void UpdateAngleValue()
{
if (!ValueExists)
{
_textBoxValue.Text = "(none)";
return;
}

var angleValue = _angleValue;

if (_angleTruncated)
{
double roundFactor = 65536 / (Math.PI * 2) / 16;
angleValue = Math.Floor(_angleValue * roundFactor) / roundFactor;
}

switch (_angleViewMode)
{
case AngleViewModeType.Degrees:
_textBoxValue.Text = (angleValue / (Math.PI * 2) * 360).ToString();
break;

case AngleViewModeType.Radians:
_textBoxValue.Text = angleValue.ToString();
break;

case AngleViewModeType.Signed:
_textBoxValue.Text = ((short)(angleValue / (Math.PI * 2) * 65536)).ToString();
break;

case AngleViewModeType.Unsigned:
_textBoxValue.Text = ((ushort)(angleValue / (Math.PI * 2) * 65536)).ToString();
break;
}
}

public void Update()
{
}
}
}
5 changes: 5 additions & 0 deletions Source/SM64 Diagnostic/Controls/IDataContainer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
Expand All @@ -24,6 +25,10 @@ Control Control
get;
}

Color Color
{
set;
}

void Update();
}
Expand Down
Loading

0 comments on commit 1887f56

Please sign in to comment.