4 |
|
using System.Text; |
5 |
|
using System.Drawing; |
6 |
|
using System.IO; |
7 |
< |
using EmuXPortal.Logging; |
7 |
> |
using Enterprise.Logging; |
8 |
|
|
9 |
|
namespace EmuXPortal.Api |
10 |
|
{ |
22 |
|
public static class RomLoader |
23 |
|
{ |
24 |
|
private const string EMU_CONFIG = "emu.config"; // if this file signifies the emulator configuration |
25 |
< |
public static IRomConfig Load(logger log, string rom_file, IEmuConfig EMUConfig) |
25 |
> |
public static IRomConfig Load(string rom_file, IEmuConfig EMUConfig) |
26 |
|
{ |
27 |
|
IRomConfig config = null; |
28 |
< |
config = new RomConfig(log, rom_file, EMUConfig); |
28 |
> |
config = new RomConfig(rom_file, EMUConfig); |
29 |
|
return config; |
30 |
|
} |
31 |
|
#region private class RomConfig : IRomConfig |
32 |
|
private class RomConfig : IRomConfig, IDisposable |
33 |
|
{ |
34 |
< |
public RomConfig(logger log, string rom_file, IEmuConfig EMUConfig) |
34 |
> |
public RomConfig(string rom_file, IEmuConfig EMUConfig) |
35 |
|
{ |
36 |
|
FileInfo fi = new FileInfo(rom_file); |
37 |
|
this.RomFile =fi.FullName; |
44 |
|
} |
45 |
|
catch (Exception ex) |
46 |
|
{ |
47 |
< |
log.WriteLine("Error Loading an Image file for: {1}{0}Error:{0}{2}",System.Environment.NewLine, fi.FullName, ex.ToString()); |
47 |
> |
gLog.Debug.WriteLine("Error Loading an Image file for: {1}{0}Error:{0}{2}", System.Environment.NewLine, fi.FullName, ex.ToString()); |
48 |
|
} |
49 |
|
try |
50 |
|
{ |
66 |
|
} |
67 |
|
catch (Exception ex) |
68 |
|
{ |
69 |
< |
log.WriteLine("Error loading rom image: {1}{0}Error:{0}{2}", System.Environment.NewLine, (rom_img == "") ? "DefaultGameImage" : rom_img, ex.ToString()); |
69 |
> |
gLog.Debug.WriteLine("Error loading rom image: {1}{0}Error:{0}{2}", System.Environment.NewLine, (rom_img == "") ? "DefaultGameImage" : rom_img, ex.ToString()); |
70 |
|
this.RomImage = null; |
71 |
|
} |
72 |
|
|