-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more object distance variables
- Distance to home - Mario distance to home - Lateral distances of the above
- Loading branch information
danebouchie
committed
Nov 6, 2016
1 parent
766e060
commit a27c2e2
Showing
16 changed files
with
219 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
Source/SM64 Diagnostic/Extensions/ProcessStreamExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using SM64_Diagnostic.Utilities; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace SM64_Diagnostic.Extensions | ||
{ | ||
public static class ProcessStreamExtensions | ||
{ | ||
public static byte GetByte(this ProcessStream stream, uint address, bool absoluteAddress = false) | ||
{ | ||
return stream.ReadRam(address, 1, absoluteAddress)[0]; | ||
} | ||
|
||
public static sbyte GetSByte(this ProcessStream stream, uint address, bool absoluteAddress = false) | ||
{ | ||
return (sbyte)stream.ReadRam(address, 1, absoluteAddress)[0]; | ||
} | ||
|
||
public static short GetInt16(this ProcessStream stream, uint address, bool absoluteAddress = false) | ||
{ | ||
return BitConverter.ToInt16(stream.ReadRam(address, 2, absoluteAddress), 0); | ||
} | ||
|
||
public static ushort GetUInt16(this ProcessStream stream, uint address, bool absoluteAddress = false) | ||
{ | ||
return BitConverter.ToUInt16(stream.ReadRam(address, 2, absoluteAddress), 0); | ||
} | ||
|
||
public static int GetInt32(this ProcessStream stream, uint address, bool absoluteAddress = false) | ||
{ | ||
return BitConverter.ToInt32(stream.ReadRam(address, 4, absoluteAddress), 0); | ||
} | ||
|
||
public static uint GetUInt32(this ProcessStream stream, uint address, bool absoluteAddress = false) | ||
{ | ||
return BitConverter.ToUInt32(stream.ReadRam(address, 4, absoluteAddress), 0); | ||
} | ||
|
||
public static float GetSingle(this ProcessStream stream, uint address, bool absoluteAddress = false) | ||
{ | ||
return BitConverter.ToSingle(stream.ReadRam(address, 4, absoluteAddress), 0); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.