minor GB cleanup

This commit is contained in:
goyuken 2012-11-19 17:59:57 +00:00
parent 8d6e55e2a9
commit 5fc4b3f6c6
2 changed files with 8 additions and 16 deletions

View File

@ -148,7 +148,7 @@ namespace BizHawk.Emulation.Consoles.GB
LibGambatte.gambatte_runfor(GambatteState, VideoBuffer, 160, soundbuff, ref nsamp);
Console.WriteLine("===");
//Console.WriteLine("===");
// upload any modified data to the memory domains
@ -330,7 +330,7 @@ namespace BizHawk.Emulation.Consoles.GB
foreach (var r in MemoryRefreshers)
r.RefreshRead();
}
public void SaveStateText(System.IO.TextWriter writer)
{
var temp = SaveStateBinary();
@ -407,7 +407,7 @@ namespace BizHawk.Emulation.Consoles.GB
LibGambatte.gambatte_setreadcallback(GambatteState, readcb);
LibGambatte.gambatte_setwritecallback(GambatteState, writecb);
}
#endregion
@ -451,7 +451,6 @@ namespace BizHawk.Emulation.Consoles.GB
s[10] & 0xff,
s[11] != 0 ? "skip" : "",
s[12] & 0xff,
//CPUs.Z80GB.Disassembler.DAsm((ushort)s[1], (addr) => LibGambatte.gambatte_cpuread(GambatteState, addr), out unused).PadRight(30)
CPUs.Z80GB.NewDisassembler.Disassemble((ushort)s[1], (addr) => LibGambatte.gambatte_cpuread(GambatteState, addr), out unused).PadRight(30)
));
}
@ -475,7 +474,7 @@ namespace BizHawk.Emulation.Consoles.GB
// needs to be true in case a read is attempted before the first frame advance
readneeded = true;
}
bool readneeded;
bool writeneeded;
@ -576,7 +575,7 @@ namespace BizHawk.Emulation.Consoles.GB
public MemoryDomain MainMemory { get; private set; }
List <MemoryRefresher> MemoryRefreshers;
List<MemoryRefresher> MemoryRefreshers;
#endregion
@ -710,21 +709,14 @@ namespace BizHawk.Emulation.Consoles.GB
public void SetCGBColors(GBColors.ColorType type)
{
int[] lut = GBColors.GetLut(type);
unsafe
{
fixed (int* p = &lut[0])
LibGambatte.gambatte_setcgbpalette(GambatteState, (IntPtr)p);
}
LibGambatte.gambatte_setcgbpalette(GambatteState, lut);
}
#endregion
#region ISoundProvider
public ISoundProvider SoundProvider
{
get { return null; }
}
public ISoundProvider SoundProvider { get { return null; } }
public ISyncSoundProvider SyncSoundProvider { get { return dcfilter; } }
public bool StartAsyncSound() { return false; }
public void EndAsyncSound() { }

View File

@ -104,7 +104,7 @@ namespace BizHawk.Emulation.Consoles.GB
/// <param name="core">opaque state pointer</param>
/// <param name="lut">uint32[32768], input color (r,g,b) is at lut[r | g << 5 | b << 10]</param>
[DllImport("libgambatte.dll", CallingConvention = CallingConvention.Cdecl)]
public static extern void gambatte_setcgbpalette(IntPtr core, IntPtr lut);
public static extern void gambatte_setcgbpalette(IntPtr core, int[] lut);
/// <summary>
/// combination of button flags used by the input callback