Fix TI83 screenshots. Fix screenshot naming code to use the filesystemsafe name, fix bug in screenshotas function

This commit is contained in:
andres.delikat 2011-07-10 01:55:37 +00:00
parent f89070f6ad
commit de1a3fdc50
4 changed files with 291 additions and 278 deletions

View File

@ -347,7 +347,8 @@ namespace BizHawk.Emulation.Consoles.Calculator
this.emu = emu;
}
public int[] GetVideoBuffer() {
public int[] GetVideoBuffer()
{
//unflatten bit buffer
int[] pixels = new int[96 * 64];
int i = 0;
@ -359,9 +360,10 @@ namespace BizHawk.Emulation.Consoles.Calculator
int bufbit = offset & 7;
int bit = ((emu.vram[bufbyte] >> (7 - bufbit)) & 1);
if (bit == 0)
pixels[i++] = 0xFFFFFF;
unchecked { pixels[i++] = (int)0xFFFFFFFF; }
else
pixels[i++] = 0;
}
return pixels;
}
@ -369,7 +371,8 @@ namespace BizHawk.Emulation.Consoles.Calculator
public int BufferHeight { get { return 64; } }
public int BackgroundColor { get { return 0; } }
}
public IVideoProvider VideoProvider { get { return new MyVideoProvider(this); } }
public IVideoProvider VideoProvider {
get { return new MyVideoProvider(this); } }
public ISoundProvider SoundProvider { get { return NullSound.SilenceProvider; } }

View File

@ -670,8 +670,6 @@ namespace BizHawk.MultiClient
if (result != DialogResult.OK)
return;
MakeScreenshot(sfd.FileName);
MakeScreenshot(path);
}
private void runInBackgroundToolStripMenuItem_Click(object sender, EventArgs e)

View File

@ -1352,7 +1352,18 @@ namespace BizHawk.MultiClient
var framebuf = video.GetVideoBuffer();
for (int y = 0; y < video.BufferHeight; y++)
for (int x = 0; x < video.BufferWidth; x++)
image.SetPixel(x, y, Color.FromArgb(framebuf[(y * video.BufferWidth) + x]));
{
int col = framebuf[(y * video.BufferWidth) + x];
if (Global.Emulator is TI83)
{
if (col == 0)
col = Color.Black.ToArgb();
else
col = Color.White.ToArgb();
}
image.SetPixel(x, y, Color.FromArgb(col));
}
var f = new FileInfo(path);
if (f.Directory.Exists == false)

View File

@ -103,7 +103,8 @@ namespace BizHawk.MultiClient
}
}
}
} catch (Exception) { } // No need for errors in patching to propagate.
}
catch (Exception) { } // No need for errors in patching to propagate.
}
public byte[] GetRomData() { return RomData; }
@ -183,15 +184,15 @@ namespace BizHawk.MultiClient
{
switch (System)
{
case "SMS": return PathManager.MakeAbsolutePath(Global.Config.PathSMSScreenshots, "SMS") + "/" + Name;
case "GG": return PathManager.MakeAbsolutePath(Global.Config.PathGGScreenshots, "GG") + "/" + Name;
case "SG": return PathManager.MakeAbsolutePath(Global.Config.PathSGScreenshots, "SG") + "/" + Name;
case "PCE": return PathManager.MakeAbsolutePath(Global.Config.PathPCEScreenshots, "PCE") + "/" + Name;
case "SGX": return PathManager.MakeAbsolutePath(Global.Config.PathPCEScreenshots, "PCE") + "/" + Name;
case "GB": return PathManager.MakeAbsolutePath(Global.Config.PathGBScreenshots, "GB") + "/" + Name;
case "GEN": return PathManager.MakeAbsolutePath(Global.Config.PathGenesisScreenshots, "GEN") + "/" + Name;
case "NES": return PathManager.MakeAbsolutePath(Global.Config.PathNESScreenshots, "NES") + "/" + Name;
case "TI83": return PathManager.MakeAbsolutePath(Global.Config.PathTI83Screenshots, "TI83") + "/" + Name;
case "SMS": return PathManager.MakeAbsolutePath(Global.Config.PathSMSScreenshots, "SMS") + "/" + filesystemSafeName;
case "GG": return PathManager.MakeAbsolutePath(Global.Config.PathGGScreenshots, "GG") + "/" + filesystemSafeName;
case "SG": return PathManager.MakeAbsolutePath(Global.Config.PathSGScreenshots, "SG") + "/" + filesystemSafeName;
case "PCE": return PathManager.MakeAbsolutePath(Global.Config.PathPCEScreenshots, "PCE") + "/" + filesystemSafeName;
case "SGX": return PathManager.MakeAbsolutePath(Global.Config.PathPCEScreenshots, "PCE") + "/" + filesystemSafeName;
case "GB": return PathManager.MakeAbsolutePath(Global.Config.PathGBScreenshots, "GB") + "/" + filesystemSafeName;
case "GEN": return PathManager.MakeAbsolutePath(Global.Config.PathGenesisScreenshots, "GEN") + "/" + filesystemSafeName;
case "NES": return PathManager.MakeAbsolutePath(Global.Config.PathNESScreenshots, "NES") + "/" + filesystemSafeName;
case "TI83": return PathManager.MakeAbsolutePath(Global.Config.PathTI83Screenshots, "TI83") + "/" + filesystemSafeName;
default: return "";
}
}