Skip to content

Commit

Permalink
Merge r8247, r8265, r8267, r8268, r8269, r8270
Browse files Browse the repository at this point in the history
This represents version 1.9.1
  • Loading branch information
hegyak committed Nov 29, 2014
1 parent 961fc10 commit 49ffbce
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 40 deletions.
4 changes: 2 additions & 2 deletions BizHawk.Client.Common/BinarySaveStates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,9 @@ private static void WriteVersion(Stream s)

public BinaryStateSaver(string path, bool stateVersionTag = true) // stateVersionTag is a hack for reusing this for movie code
{
//_zip = new IonicZipWriter(path, Global.Config.SaveStateCompressionLevelNormal);
_zip = new IonicZipWriter(path, Global.Config.SaveStateCompressionLevelNormal);
//_zip = new SharpZipWriter(path, Global.Config.SaveStateCompressionLevelNormal);
_zip = new SevenZipWriter(path, Global.Config.SaveStateCompressionLevelNormal);
//_zip = new SevenZipWriter(path, Global.Config.SaveStateCompressionLevelNormal);

if (stateVersionTag)
{
Expand Down
4 changes: 2 additions & 2 deletions BizHawk.Client.Common/movie/PlatformFrameRates.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ public class PlatformFrameRates
{ "SG", (3579545 / 262.0 / 228.0) }, //59.9227434043
{ "SG_PAL", (3546893 / 313.0 / 228.0) }, //49.7014320946
{ "NGP", (6144000.0 / (515 * 198)) }, //60.2530155928
{ "VBOY", (20000000 / (259 * 384 * 4)) }, //50.2734877735
{ "Lynx", 59.8 },
{ "VBOY", (20000000.0 / (259 * 384 * 4)) }, //50.2734877735
{ "Lynx", 16000000.0 / ( 16 * 105 * 159 ) },
{ "WSWAN", (3072000.0 / (159 * 256)) }, //75.4716981132
{ "GB", 262144.0 / 4389.0 }, //59.7275005696
{ "GBC", 262144.0 / 4389.0 }, //59.7275005696
Expand Down
54 changes: 45 additions & 9 deletions BizHawk.Client.Common/tools/Watch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,23 +175,59 @@ public string AddressFormatStr

protected byte GetByte()
{
if (_domain.Size == 0)
return _domain.PeekByte(_address);
else return _domain.PeekByte(_address % _domain.Size);
if (Global.CheatList.IsActive(_domain, _address))
{
return Global.CheatList.GetByteValue(_domain, _address).Value;
}
else
{
if (_domain.Size == 0)
{
return _domain.PeekByte(_address);
}
else
{
return _domain.PeekByte(_address % _domain.Size);
}
}
}

protected ushort GetWord()
{
if (_domain.Size == 0)
return _domain.PeekWord(_address, _bigEndian);
else return _domain.PeekWord(_address % _domain.Size, _bigEndian); // TODO: % size stil lisn't correct since it could be the last byte of the domain
if (Global.CheatList.IsActive(_domain, _address))
{
return (ushort)Global.CheatList.GetCheatValue(_domain, _address, WatchSize.Word).Value;
}
else
{
if (_domain.Size == 0)
{
return _domain.PeekWord(_address, _bigEndian);
}
else
{
return _domain.PeekWord(_address % _domain.Size, _bigEndian); // TODO: % size stil lisn't correct since it could be the last byte of the domain
}
}
}

protected uint GetDWord()
{
if(_domain.Size == 0)
return _domain.PeekDWord(_address, _bigEndian); // TODO: % size stil lisn't correct since it could be the last byte of the domain
else return _domain.PeekDWord(_address % _domain.Size, _bigEndian); // TODO: % size stil lisn't correct since it could be the last byte of the domain
if (Global.CheatList.IsActive(_domain, _address))
{
return (uint)Global.CheatList.GetCheatValue(_domain, _address, WatchSize.DWord).Value;
}
else
{
if (_domain.Size == 0)
{
return _domain.PeekDWord(_address, _bigEndian); // TODO: % size stil lisn't correct since it could be the last byte of the domain
}
else
{
return _domain.PeekDWord(_address % _domain.Size, _bigEndian); // TODO: % size stil lisn't correct since it could be the last byte of the domain
}
}
}

protected void PokeByte(byte val)
Expand Down
5 changes: 4 additions & 1 deletion BizHawk.Client.Common/tools/WatchList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ public void RefreshDomans(IMemoryDomains core, MemoryDomain domain)

_watchList.ForEach(w =>
{
w.Domain = _core.MemoryDomains[w.Domain.Name];
if (w.Domain != null)
{
w.Domain = _core.MemoryDomains[w.Domain.Name];
}
});
}

Expand Down
54 changes: 30 additions & 24 deletions BizHawk.Client.EmuHawk/MainForm.Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2391,7 +2391,10 @@ private void FormDragDrop_internal(object sender, DragEventArgs e)
}
else if (MovieService.IsValidMovieExtension(ext))
{
StartNewMovie(MovieService.Get(filePaths[0]), false);
if (!Global.MovieSession.Movie.IsActive)
{
StartNewMovie(MovieService.Get(filePaths[0]), false);
}
}
else if (ext.ToUpper() == ".STATE")
{
Expand All @@ -2416,32 +2419,35 @@ private void FormDragDrop_internal(object sender, DragEventArgs e)

else if (MovieImport.IsValidMovieExtension(Path.GetExtension(filePaths[0])))
{
//tries to open a legacy movie format by importing it
if (CurrentlyOpenRom == null)
{
OpenRom();
}
else
if (!Global.MovieSession.Movie.IsActive)
{
LoadRom(CurrentlyOpenRom);
}
//tries to open a legacy movie format by importing it
if (CurrentlyOpenRom == null)
{
OpenRom();
}
else
{
LoadRom(CurrentlyOpenRom);
}

string errorMsg;
string warningMsg;
var movie = MovieImport.ImportFile(filePaths[0], out errorMsg, out warningMsg);
if (!string.IsNullOrEmpty(errorMsg))
{
MessageBox.Show(errorMsg, "Conversion error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
// fix movie extension to something palatable for these purposes.
// for instance, something which doesnt clobber movies you already may have had.
// i'm evenly torn between this, and a file in %TEMP%, but since we dont really have a way to clean up this tempfile, i choose this:
StartNewMovie(movie, false);
}
string errorMsg;
string warningMsg;
var movie = MovieImport.ImportFile(filePaths[0], out errorMsg, out warningMsg);
if (!string.IsNullOrEmpty(errorMsg))
{
MessageBox.Show(errorMsg, "Conversion error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
// fix movie extension to something palatable for these purposes.
// for instance, something which doesnt clobber movies you already may have had.
// i'm evenly torn between this, and a file in %TEMP%, but since we dont really have a way to clean up this tempfile, i choose this:
StartNewMovie(movie, false);
}

GlobalWin.OSD.AddMessage(warningMsg);
GlobalWin.OSD.AddMessage(warningMsg);
}
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1018,12 +1018,12 @@ private void LuaConsole_DragDrop(object sender, DragEventArgs e)
{
foreach (var path in filePaths)
{
if (Path.GetExtension(path) == ".lua" || Path.GetExtension(path) == ".txt")
if (Path.GetExtension(path).ToLower() == ".lua" || Path.GetExtension(path).ToLower() == ".txt")
{
LoadLuaFile(path);
UpdateDialog();
}
else if (Path.GetExtension(path) == ".luases")
else if (Path.GetExtension(path).ToLower() == ".luases")
{
_luaList.LoadLuaSession(path);
RunLuaScripts();
Expand Down

0 comments on commit 49ffbce

Please sign in to comment.