diff --git a/Virtu/Silverlight/Jellyfish.Virtu.Debug.html b/Virtu/Silverlight/Jellyfish.Virtu.Debug.html deleted file mode 100644 index ef60e49..0000000 --- a/Virtu/Silverlight/Jellyfish.Virtu.Debug.html +++ /dev/null @@ -1,77 +0,0 @@ - - - - - Jellyfish.Virtu - - - - - - - - -
- -
- - - - - - - - Get Microsoft Silverlight - - - -
- - diff --git a/Virtu/Silverlight/Jellyfish.Virtu.Silverlight.csproj b/Virtu/Silverlight/Jellyfish.Virtu.Silverlight.csproj index 7ac99a9..0717b64 100644 --- a/Virtu/Silverlight/Jellyfish.Virtu.Silverlight.csproj +++ b/Virtu/Silverlight/Jellyfish.Virtu.Silverlight.csproj @@ -26,6 +26,8 @@ false ..\..\Jellyfish.snk false + true + Properties\OutOfBrowserSettings.xml true @@ -195,12 +197,7 @@ - - PreserveNewest - - - - + - - Jellyfish.Virtu - - - - - - - - -
- -
- - - - - - - - Get Microsoft Silverlight - - - -
- - diff --git a/Virtu/Silverlight/Properties/AppManifest.xml b/Virtu/Silverlight/Properties/AppManifest.xml index b21943e..8bcc1ca 100644 --- a/Virtu/Silverlight/Properties/AppManifest.xml +++ b/Virtu/Silverlight/Properties/AppManifest.xml @@ -1,13 +1,5 @@  - - - - - + + diff --git a/Virtu/Silverlight/Properties/OutOfBrowserSettings.xml b/Virtu/Silverlight/Properties/OutOfBrowserSettings.xml new file mode 100644 index 0000000..118b758 --- /dev/null +++ b/Virtu/Silverlight/Properties/OutOfBrowserSettings.xml @@ -0,0 +1,7 @@ + + Apple IIe Emulator + + + + + diff --git a/Virtu/Silverlight/Services/SilverlightKeyboardService.cs b/Virtu/Silverlight/Services/SilverlightKeyboardService.cs index dbddc9c..f4496bb 100644 --- a/Virtu/Silverlight/Services/SilverlightKeyboardService.cs +++ b/Virtu/Silverlight/Services/SilverlightKeyboardService.cs @@ -233,12 +233,9 @@ private int GetAsciiKey(Key key, int platformKeyCode) return control ? 0x1A : capsLock ? 'Z' : 'z'; case Key.Unknown: - if (Application.Current.RunningOffline) - { - // SL cannot access HtmlPage.BrowserInformation.Platform when out of browser - } - else if (HtmlPage.BrowserInformation.Platform.Equals("Win32", StringComparison.OrdinalIgnoreCase)) + switch (Environment.OSVersion.Platform) { + case PlatformID.Win32NT: switch (platformKeyCode) { case 0xBA: // WinForms Keys.Oem1 @@ -274,9 +271,9 @@ private int GetAsciiKey(Key key, int platformKeyCode) case 0xBE: // WinForms Keys.OemPeriod return shift ? '>' : '.'; } - } - else if (HtmlPage.BrowserInformation.Platform.Equals("MacIntel", StringComparison.OrdinalIgnoreCase)) - { + break; + + case PlatformID.MacOSX: switch (platformKeyCode) { case 0x29: @@ -312,6 +309,10 @@ private int GetAsciiKey(Key key, int platformKeyCode) case 0x2F: return shift ? '>' : '.'; } + break; + + case PlatformID.Unix: // TODO + break; } break; diff --git a/Virtu/Silverlight/Services/SilverlightVideoService.cs b/Virtu/Silverlight/Services/SilverlightVideoService.cs index 1c74d48..fc138c0 100644 --- a/Virtu/Silverlight/Services/SilverlightVideoService.cs +++ b/Virtu/Silverlight/Services/SilverlightVideoService.cs @@ -15,8 +15,9 @@ public SilverlightVideoService(Image image) _image = image; SetImageSize(); - _bitmap = new WriteableBitmap(BitmapWidth, BitmapHeight, BitmapPixelFormat); - _pixels = new uint[BitmapWidth * BitmapHeight]; + _bitmap = new WriteableBitmap(BitmapWidth, BitmapHeight); + _pixels = new int[BitmapWidth * BitmapHeight]; + _image.Source = _bitmap; Application.Current.Host.Content.Resized += (sender, e) => SetImageSize(); } @@ -24,13 +25,13 @@ public SilverlightVideoService(Image image) [SuppressMessage("Microsoft.Usage", "CA2233:OperationsShouldNotOverflow", MessageId = "y*560")] public override void SetPixel(int x, int y, uint color) { - _pixels[y * BitmapWidth + x] = color; + _pixels[y * BitmapWidth + x] = (int)color; _pixelsDirty = true; } public override void Update() { - if (Application.Current.RunningOffline && /*_window.IsActive &&*/ (_isFullScreen != IsFullScreen)) + if (Application.Current.IsRunningOutOfBrowser && /*_window.IsActive &&*/ (_isFullScreen != IsFullScreen)) { if (IsFullScreen) // SL is missing out of browser window control { @@ -52,14 +53,11 @@ public override void Update() if (_pixelsDirty) { _pixelsDirty = false; - _bitmap.Lock(); for (int i = 0; i < BitmapWidth * BitmapHeight; i++) { - _bitmap[i] = (int)_pixels[i]; + _bitmap.Pixels[i] = _pixels[i]; } _bitmap.Invalidate(); - _bitmap.Unlock(); - _image.Source = _bitmap; // shouldn't have to set source each frame; SL bug? } } @@ -73,11 +71,10 @@ private void SetImageSize() private const int BitmapWidth = 560; private const int BitmapHeight = 384; - private static readonly PixelFormat BitmapPixelFormat = PixelFormats.Bgr32; private Image _image; private WriteableBitmap _bitmap; - private uint[] _pixels; + private int[] _pixels; private bool _pixelsDirty; private bool _isFullScreen; }