mirror of
https://github.com/digital-jellyfish/Virtu.git
synced 2024-11-27 00:49:39 +00:00
Modified AudioService to check endianness; fixes Xbox 360 audio.
This commit is contained in:
parent
c3b65587f3
commit
18fa25759d
@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.GamerServices;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Microsoft.Xna.Framework.Input;
|
||||
|
||||
@ -20,8 +21,9 @@ public GameBase(string name)
|
||||
Content.RootDirectory = "Content";
|
||||
GraphicsDeviceManager = new GraphicsDeviceManager(this);
|
||||
#if WINDOWS_PHONE
|
||||
GraphicsDeviceManager.IsFullScreen = true;
|
||||
TargetElapsedTime = TimeSpan.FromTicks(333333); // 30 fps
|
||||
#elif XBOX
|
||||
Components.Add(new GamerServicesComponent(this));
|
||||
#endif
|
||||
GraphicsDeviceService = (IGraphicsDeviceService)Services.GetService(typeof(IGraphicsDeviceService));
|
||||
|
||||
|
@ -14,8 +14,16 @@ protected AudioService(Machine machine) :
|
||||
|
||||
public void Output(int data) // machine thread
|
||||
{
|
||||
_buffer[_index + 0] = (byte)(data & 0xFF);
|
||||
_buffer[_index + 1] = (byte)(data >> 8);
|
||||
if (BitConverter.IsLittleEndian)
|
||||
{
|
||||
_buffer[_index + 0] = (byte)(data & 0xFF);
|
||||
_buffer[_index + 1] = (byte)(data >> 8);
|
||||
}
|
||||
else
|
||||
{
|
||||
_buffer[_index + 0] = (byte)(data >> 8);
|
||||
_buffer[_index + 1] = (byte)(data & 0xFF);
|
||||
}
|
||||
_index = (_index + 2) % SampleSize;
|
||||
if (_index == 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user