From acd7892436ac9504d5c534dbecc0daa123504ff8 Mon Sep 17 00:00:00 2001 From: Sean Fausett Date: Fri, 11 Dec 2009 09:12:31 +0000 Subject: [PATCH] Cosmetic changes. Fixed some code analysis warnings. Dropped Extended Strongly Typed Resource Generator dependency. --HG-- extra : convert_revision : svn%3Affd33b8c-2492-42e0-bdc5-587b920b7d6d/trunk%4035615 --- Library/GCHandleHelpers.cs | 5 + Library/GeneralSecurity.cs | 5 + Library/GlobalSuppressions.cs | 1 + Library/IEnumerableExtensions.cs | 9 + Library/SafeAllocHandle.cs | 10 + Library/SafeFileHandle.cs | 5 + Library/StreamExtensions.cs | 13 +- Virtu/Cpu.cs | 754 +++++++++--------- Virtu/GlobalSuppressions.cs | 3 + Virtu/Jellyfish.Virtu.FxCop | 182 +++-- Virtu/Memory.cs | 3 +- Virtu/Properties/SR.Designer.cs | 135 +--- Virtu/Services/AudioService.cs | 5 + Virtu/Services/MachineService.cs | 5 + Virtu/Services/MachineServices.cs | 13 +- .../Jellyfish.Virtu.Silverlight.csproj | 5 +- .../Services/SilverlightAudioService.cs | 12 +- .../Services/SilverlightKeyboardService.cs | 5 + .../Services/SilverlightStorageService.cs | 10 + .../Services/SilverlightVideoService.cs | 6 + Virtu/Wpf/Jellyfish.Virtu.Wpf.csproj | 5 +- Virtu/Wpf/MainWindow.xaml.cs | 2 +- Virtu/Wpf/Services/WpfAudioService.cs | 7 + Virtu/Wpf/Services/WpfKeyboardService.cs | 5 + Virtu/Wpf/Services/WpfStorageService.cs | 10 + Virtu/Wpf/Services/WpfVideoService.cs | 10 + Virtu/Xna/Jellyfish.Virtu.Xna.Xbox.csproj | 5 +- Virtu/Xna/Jellyfish.Virtu.Xna.csproj | 5 +- Virtu/Xna/Services/XnaAudioService.cs | 5 + Virtu/Xna/Services/XnaStorageService.cs | 15 + Virtu/Xna/Services/XnaVideoService.cs | 5 + 31 files changed, 683 insertions(+), 577 deletions(-) create mode 100644 Virtu/GlobalSuppressions.cs diff --git a/Library/GCHandleHelpers.cs b/Library/GCHandleHelpers.cs index 91d3993..52701e8 100644 --- a/Library/GCHandleHelpers.cs +++ b/Library/GCHandleHelpers.cs @@ -9,6 +9,11 @@ public static class GCHandleHelpers [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] public static void Pin(object value, Action action) { + if (action == null) + { + throw new ArgumentNullException("action"); + } + GCHandle gcHandle = new GCHandle(); try { diff --git a/Library/GeneralSecurity.cs b/Library/GeneralSecurity.cs index 603c189..798780d 100644 --- a/Library/GeneralSecurity.cs +++ b/Library/GeneralSecurity.cs @@ -127,6 +127,11 @@ public void GetSecurityAttributes(bool inheritable, Action a [SecurityPermission(SecurityAction.LinkDemand, UnmanagedCode = true)] public static void GetSecurityAttributes(ObjectSecurity security, bool inheritable, Action action) { + if (action == null) + { + throw new ArgumentNullException("action"); + } + if (security != null) { GCHandleHelpers.Pin(security.GetSecurityDescriptorBinaryForm(), securityDescriptor => diff --git a/Library/GlobalSuppressions.cs b/Library/GlobalSuppressions.cs index 9a9a557..7a792e7 100644 --- a/Library/GlobalSuppressions.cs +++ b/Library/GlobalSuppressions.cs @@ -1,3 +1,4 @@ using System.Diagnostics.CodeAnalysis; +[assembly: SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames")] [assembly: SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = "Jellyfish.Library.FrameRateCounter.#frameRateControl")] diff --git a/Library/IEnumerableExtensions.cs b/Library/IEnumerableExtensions.cs index ebe7919..2b1bb46 100644 --- a/Library/IEnumerableExtensions.cs +++ b/Library/IEnumerableExtensions.cs @@ -7,6 +7,15 @@ public static class IEnumerableExtensions { public static void ForEach(this IEnumerable source, Action action) { + if (source == null) + { + throw new ArgumentNullException("source"); + } + if (action == null) + { + throw new ArgumentNullException("action"); + } + foreach (T item in source) { action(item); diff --git a/Library/SafeAllocHandle.cs b/Library/SafeAllocHandle.cs index 542bea2..9851bdd 100644 --- a/Library/SafeAllocHandle.cs +++ b/Library/SafeAllocHandle.cs @@ -42,6 +42,11 @@ public static SafeGlobalAllocHandle Allocate(int size) public static SafeGlobalAllocHandle Allocate(byte[] value) { + if (value == null) + { + throw new ArgumentNullException("value"); + } + SafeGlobalAllocHandle alloc = Allocate(value.Length); Marshal.Copy(value, 0, alloc.DangerousGetHandle(), value.Length); @@ -100,6 +105,11 @@ public static SafeLocalAllocHandle Allocate(int size) public static SafeLocalAllocHandle Allocate(byte[] value) { + if (value == null) + { + throw new ArgumentNullException("value"); + } + SafeLocalAllocHandle alloc = Allocate(value.Length); Marshal.Copy(value, 0, alloc.DangerousGetHandle(), value.Length); diff --git a/Library/SafeFileHandle.cs b/Library/SafeFileHandle.cs index 0292913..3f19320 100644 --- a/Library/SafeFileHandle.cs +++ b/Library/SafeFileHandle.cs @@ -54,6 +54,11 @@ public GeneralSecurity GetAccessControl() public void SetAccessControl(GeneralSecurity fileSecurity) { + if (fileSecurity == null) + { + throw new ArgumentNullException("fileSecurity"); + } + fileSecurity.Persist(this); } diff --git a/Library/StreamExtensions.cs b/Library/StreamExtensions.cs index 5553753..15f2244 100644 --- a/Library/StreamExtensions.cs +++ b/Library/StreamExtensions.cs @@ -1,4 +1,5 @@ -using System.IO; +using System; +using System.IO; namespace Jellyfish.Library { @@ -6,6 +7,11 @@ public static class StreamExtensions { public static byte[] ReadAllBytes(this Stream stream) { + if (stream == null) + { + throw new ArgumentNullException("stream"); + } + int count = (int)stream.Length; byte[] buffer = new byte[count]; ReadBlock(stream, buffer, 0, count); @@ -15,6 +21,11 @@ public static byte[] ReadAllBytes(this Stream stream) public static int ReadBlock(this Stream stream, byte[] buffer, int offset, int count) { + if (stream == null) + { + throw new ArgumentNullException("stream"); + } + int total = 0; int read; do diff --git a/Virtu/Cpu.cs b/Virtu/Cpu.cs index e834c97..cc2e0d8 100644 --- a/Virtu/Cpu.cs +++ b/Virtu/Cpu.cs @@ -1158,706 +1158,706 @@ private void Execute65X02And31() // and (zpg), y { GetAddressZpgIndYCC(); ExecuteAnd(ReadZpgIndY(), 5); - } + } private void Execute65X02And35() // and zpg, x { GetAddressZpgX(); ExecuteAnd(ReadZpgX(), 4); - } + } private void Execute65X02And39() // and abs, y { GetAddressAbsYCC(); ExecuteAnd(ReadAbsY(), 4); - } + } private void Execute65X02And3D() // and abs, x { GetAddressAbsXCC(); ExecuteAnd(ReadAbsX(), 4); - } + } private void Execute65X02Asl06() // asl zpg { GetAddressZpg(); WriteZpg(ExecuteAsl(ReadZpg(), 5)); - } + } private void Execute65X02Asl0A() // asl imp { ExecuteAslImp(2); - } + } private void Execute65X02Asl0E() // asl abs { GetAddressAbs(); WriteAbs(ExecuteAsl(ReadAbs(), 6)); - } + } private void Execute65X02Asl16() // asl zpg, x { GetAddressZpgX(); WriteZpgX(ExecuteAsl(ReadZpgX(), 6)); - } + } private void Execute65X02Bcc90() // bcc rel { ExecuteBcc(2); - } + } private void Execute65X02BcsB0() // bcs rel { ExecuteBcs(2); - } + } private void Execute65X02BeqF0() // beq rel { ExecuteBeq(2); - } + } private void Execute65X02Bit24() // bit zpg { GetAddressZpg(); ExecuteBit(ReadZpg(), 3); - } + } private void Execute65X02Bit2C() // bit abs { GetAddressAbs(); ExecuteBit(ReadAbs(), 4); - } + } private void Execute65X02Bmi30() // bmi rel { ExecuteBmi(2); - } + } private void Execute65X02BneD0() // bne rel { ExecuteBne(2); - } + } private void Execute65X02Bpl10() // bpl rel { ExecuteBpl(2); - } + } private void Execute65X02Brk00() // brk imp { ExecuteBrk(7); - } + } private void Execute65X02Bvc50() // bvc rel { ExecuteBvc(2); - } + } private void Execute65X02Bvs70() // bvs rel { ExecuteBvs(2); - } + } private void Execute65X02Clc18() // clc imp { ExecuteClc(2); - } + } private void Execute65X02CldD8() // cld imp { ExecuteCld(2); - } + } private void Execute65X02Cli58() // cli imp { ExecuteCli(2); - } + } private void Execute65X02ClvB8() // clv imp { ExecuteClv(2); - } + } private void Execute65X02CmpC1() // cmp (zpg, x) { GetAddressZpgIndX(); ExecuteCmp(ReadZpgIndX(), 6); - } + } private void Execute65X02CmpC5() // cmp zpg { GetAddressZpg(); ExecuteCmp(ReadZpg(), 3); - } + } private void Execute65X02CmpC9() // cmp imm { ExecuteCmp(ReadImm(), 2); - } + } private void Execute65X02CmpCD() // cmp abs { GetAddressAbs(); ExecuteCmp(ReadAbs(), 4); - } + } private void Execute65X02CmpD1() // cmp (zpg), y { GetAddressZpgIndYCC(); ExecuteCmp(ReadZpgIndY(), 5); - } + } private void Execute65X02CmpD5() // cmp zpg, x { GetAddressZpgX(); ExecuteCmp(ReadZpgX(), 4); - } + } private void Execute65X02CmpD9() // cmp abs, y { GetAddressAbsYCC(); ExecuteCmp(ReadAbsY(), 4); - } + } private void Execute65X02CmpDD() // cmp abs, x { GetAddressAbsXCC(); ExecuteCmp(ReadAbsX(), 4); - } + } private void Execute65X02CpxE0() // cpx imm { ExecuteCpx(ReadImm(), 2); - } + } private void Execute65X02CpxE4() // cpx zpg { GetAddressZpg(); ExecuteCpx(ReadZpg(), 3); - } + } private void Execute65X02CpxEC() // cpx abs { GetAddressAbs(); ExecuteCpx(ReadAbs(), 4); - } + } private void Execute65X02CpyC0() // cpy imm { ExecuteCpy(ReadImm(), 2); - } + } private void Execute65X02CpyC4() // cpy zpg { GetAddressZpg(); ExecuteCpy(ReadZpg(), 3); - } + } private void Execute65X02CpyCC() // cpy abs { GetAddressAbs(); ExecuteCpy(ReadAbs(), 4); - } + } private void Execute65X02DecC6() // dec zpg { GetAddressZpg(); WriteZpg(ExecuteDec(ReadZpg(), 5)); - } + } private void Execute65X02DecCE() // dec abs { GetAddressAbs(); WriteAbs(ExecuteDec(ReadAbs(), 6)); - } + } private void Execute65X02DecD6() // dec zpg, x { GetAddressZpgX(); WriteZpgX(ExecuteDec(ReadZpgX(), 6)); - } + } private void Execute65X02DexCA() // dex imp { ExecuteDex(2); - } + } private void Execute65X02Dey88() // dey imp { ExecuteDey(2); - } + } private void Execute65X02Eor41() // eor (zpg, x) { GetAddressZpgIndX(); ExecuteEor(ReadZpgIndX(), 6); - } + } private void Execute65X02Eor45() // eor zpg { GetAddressZpg(); ExecuteEor(ReadZpg(), 3); - } + } private void Execute65X02Eor49() // eor imm { ExecuteEor(ReadImm(), 2); - } + } private void Execute65X02Eor4D() // eor abs { GetAddressAbs(); ExecuteEor(ReadAbs(), 4); - } + } private void Execute65X02Eor51() // eor (zpg), y { GetAddressZpgIndYCC(); ExecuteEor(ReadZpgIndY(), 5); - } + } private void Execute65X02Eor55() // eor zpg, x { GetAddressZpgX(); ExecuteEor(ReadZpgX(), 4); - } + } private void Execute65X02Eor59() // eor abs, y { GetAddressAbsYCC(); ExecuteEor(ReadAbsY(), 4); - } + } private void Execute65X02Eor5D() // eor abs, x { GetAddressAbsXCC(); ExecuteEor(ReadAbsX(), 4); - } + } private void Execute65X02IncE6() // inc zpg { GetAddressZpg(); WriteZpg(ExecuteInc(ReadZpg(), 5)); - } + } private void Execute65X02IncEE() // inc abs { GetAddressAbs(); WriteAbs(ExecuteInc(ReadAbs(), 6)); - } + } private void Execute65X02IncF6() // inc zpg, x { GetAddressZpgX(); WriteZpgX(ExecuteInc(ReadZpgX(), 6)); - } + } private void Execute65X02InxE8() // inx imp { ExecuteInx(2); - } + } private void Execute65X02InyC8() // iny imp { ExecuteIny(2); - } + } private void Execute65X02Jmp4C() // jmp abs { ExecuteJmpAbs(3); - } + } private void Execute65X02Jsr20() // jsr abs { ExecuteJsr(6); - } + } private void Execute65X02LdaA1() // lda (zpg, x) { GetAddressZpgIndX(); ExecuteLda(ReadZpgIndX(), 6); - } + } private void Execute65X02LdaA5() // lda zpg { GetAddressZpg(); ExecuteLda(ReadZpg(), 3); - } + } private void Execute65X02LdaA9() // lda imm { ExecuteLda(ReadImm(), 2); - } + } private void Execute65X02LdaAD() // lda abs { GetAddressAbs(); ExecuteLda(ReadAbs(), 4); - } + } private void Execute65X02LdaB1() // lda (zpg), y { GetAddressZpgIndYCC(); ExecuteLda(ReadZpgIndY(), 5); - } + } private void Execute65X02LdaB5() // lda zpg, x { GetAddressZpgX(); ExecuteLda(ReadZpgX(), 4); - } + } private void Execute65X02LdaB9() // lda abs, y { GetAddressAbsYCC(); ExecuteLda(ReadAbsY(), 4); - } + } private void Execute65X02LdaBD() // lda abs, x { GetAddressAbsXCC(); ExecuteLda(ReadAbsX(), 4); - } + } private void Execute65X02LdxA2() // ldx imm { ExecuteLdx(ReadImm(), 2); - } + } private void Execute65X02LdxA6() // ldx zpg { GetAddressZpg(); ExecuteLdx(ReadZpg(), 3); - } + } private void Execute65X02LdxAE() // ldx abs { GetAddressAbs(); ExecuteLdx(ReadAbs(), 4); - } + } private void Execute65X02LdxB6() // ldx zpg, y { GetAddressZpgY(); ExecuteLdx(ReadZpgY(), 4); - } + } private void Execute65X02LdxBE() // ldx abs, y { GetAddressAbsYCC(); ExecuteLdx(ReadAbsY(), 4); - } + } private void Execute65X02LdyA0() // ldy imm { ExecuteLdy(ReadImm(), 2); - } + } private void Execute65X02LdyA4() // ldy zpg { GetAddressZpg(); ExecuteLdy(ReadZpg(), 3); - } + } private void Execute65X02LdyAC() // ldy abs { GetAddressAbs(); ExecuteLdy(ReadAbs(), 4); - } + } private void Execute65X02LdyB4() // ldy zpg, x { GetAddressZpgX(); ExecuteLdy(ReadZpgX(), 4); - } + } private void Execute65X02LdyBC() // ldy abs, x { GetAddressAbsXCC(); ExecuteLdy(ReadAbsX(), 4); - } + } private void Execute65X02Lsr46() // lsr zpg { GetAddressZpg(); WriteZpg(ExecuteLsr(ReadZpg(), 5)); - } + } private void Execute65X02Lsr4A() // lsr imp { ExecuteLsrImp(2); - } + } private void Execute65X02Lsr4E() // lsr abs { GetAddressAbs(); WriteAbs(ExecuteLsr(ReadAbs(), 6)); - } + } private void Execute65X02Lsr56() // lsr zpg, x { GetAddressZpgX(); WriteZpgX(ExecuteLsr(ReadZpgX(), 6)); - } + } private void Execute65X02NopEA() // nop imp { ExecuteNop(2); - } + } private void Execute65X02Ora01() // ora (zpg, x) { GetAddressZpgIndX(); ExecuteOra(ReadZpgIndX(), 6); - } + } private void Execute65X02Ora05() // ora zpg { GetAddressZpg(); ExecuteOra(ReadZpg(), 3); - } + } private void Execute65X02Ora09() // ora imm { ExecuteOra(ReadImm(), 2); - } + } private void Execute65X02Ora0D() // ora abs { GetAddressAbs(); ExecuteOra(ReadAbs(), 4); - } + } private void Execute65X02Ora11() // ora (zpg), y { GetAddressZpgIndYCC(); ExecuteOra(ReadZpgIndY(), 5); - } + } private void Execute65X02Ora15() // ora zpg, x { GetAddressZpgX(); ExecuteOra(ReadZpgX(), 4); - } + } private void Execute65X02Ora19() // ora abs, y { GetAddressAbsYCC(); ExecuteOra(ReadAbsY(), 4); - } + } private void Execute65X02Ora1D() // ora abs, x { GetAddressAbsXCC(); ExecuteOra(ReadAbsX(), 4); - } + } private void Execute65X02Pha48() // pha imp { ExecutePha(3); - } + } private void Execute65X02Php08() // php imp { ExecutePhp(3); - } + } private void Execute65X02Pla68() // pla imp { ExecutePla(4); - } + } private void Execute65X02Plp28() // plp imp { ExecutePlp(4); - } + } private void Execute65X02Rol26() // rol zpg { GetAddressZpg(); WriteZpg(ExecuteRol(ReadZpg(), 5)); - } + } private void Execute65X02Rol2A() // rol imp { ExecuteRolImp(2); - } + } private void Execute65X02Rol2E() // rol abs { GetAddressAbs(); WriteAbs(ExecuteRol(ReadAbs(), 6)); - } + } private void Execute65X02Rol36() // rol zpg, x { GetAddressZpgX(); WriteZpgX(ExecuteRol(ReadZpgX(), 6)); - } + } private void Execute65X02Ror66() // ror zpg { GetAddressZpg(); WriteZpg(ExecuteRor(ReadZpg(), 5)); - } + } private void Execute65X02Ror6A() // ror imp { ExecuteRorImp(2); - } + } private void Execute65X02Ror6E() // ror abs { GetAddressAbs(); WriteAbs(ExecuteRor(ReadAbs(), 6)); - } + } private void Execute65X02Ror76() // ror zpg, x { GetAddressZpgX(); WriteZpgX(ExecuteRor(ReadZpgX(), 6)); - } + } private void Execute65X02Rti40() // rti imp { ExecuteRti(6); - } + } private void Execute65X02Rts60() // rts imp { ExecuteRts(6); - } + } private void Execute65X02Sec38() // sec imp { ExecuteSec(2); - } + } private void Execute65X02SedF8() // sed imp { ExecuteSed(2); - } + } private void Execute65X02Sei78() // sei imp { ExecuteSei(2); - } + } private void Execute65X02Sta81() // sta (zpg, x) { GetAddressZpgIndX(); WriteZpgIndX(RA); ExecuteSta(6); - } + } private void Execute65X02Sta85() // sta zpg { GetAddressZpg(); WriteZpg(RA); ExecuteSta(3); - } + } private void Execute65X02Sta8D() // sta abs { GetAddressAbs(); WriteAbs(RA); ExecuteSta(4); - } + } private void Execute65X02Sta91() // sta (zpg), y { GetAddressZpgIndY(); WriteZpgIndY(RA); ExecuteSta(6); - } + } private void Execute65X02Sta95() // sta zpg, x { GetAddressZpgX(); WriteZpgX(RA); ExecuteSta(4); - } + } private void Execute65X02Sta99() // sta abs, y { GetAddressAbsY(); WriteAbsY(RA); ExecuteSta(5); - } + } private void Execute65X02Sta9D() // sta abs, x { GetAddressAbsX(); WriteAbsX(RA); ExecuteSta(5); - } + } private void Execute65X02Stx86() // stx zpg { GetAddressZpg(); WriteZpg(RX); ExecuteStx(3); - } + } private void Execute65X02Stx8E() // stx abs { GetAddressAbs(); WriteAbs(RX); ExecuteStx(4); - } + } private void Execute65X02Stx96() // stx zpg, y { GetAddressZpgY(); WriteZpgY(RX); ExecuteStx(4); - } + } private void Execute65X02Sty84() // sty zpg { GetAddressZpg(); WriteZpg(RY); ExecuteSty(3); - } + } private void Execute65X02Sty8C() // sty abs { GetAddressAbs(); WriteAbs(RY); ExecuteSty(4); - } + } private void Execute65X02Sty94() // sty zpg, x { GetAddressZpgX(); WriteZpgX(RY); ExecuteSty(4); - } + } private void Execute65X02TaxAA() // tax imp { ExecuteTax(2); - } + } private void Execute65X02TayA8() // tay imp { ExecuteTay(2); - } + } private void Execute65X02TsxBA() // tsx imp { ExecuteTsx(2); - } + } private void Execute65X02Txa8A() // txa imp { ExecuteTxa(2); - } + } private void Execute65X02Txs9A() // txs imp { ExecuteTxs(2); - } + } private void Execute65X02Tya98() // tya imp { @@ -1870,655 +1870,655 @@ private void Execute65N02Adc61() // adc (zpg, x) { GetAddressZpgIndX(); ExecuteAdc65N02(ReadZpgIndX(), 6); - } + } private void Execute65N02Adc65() // adc zpg { GetAddressZpg(); ExecuteAdc65N02(ReadZpg(), 3); - } + } private void Execute65N02Adc69() // adc imm { ExecuteAdc65N02(ReadImm(), 2); - } + } private void Execute65N02Adc6D() // adc abs { GetAddressAbs(); ExecuteAdc65N02(ReadAbs(), 4); - } + } private void Execute65N02Adc71() // adc (zpg), y { GetAddressZpgIndYCC(); ExecuteAdc65N02(ReadZpgIndY(), 5); - } + } private void Execute65N02Adc75() // adc zpg, x { GetAddressZpgX(); ExecuteAdc65N02(ReadZpgX(), 4); - } + } private void Execute65N02Adc79() // adc abs, y { GetAddressAbsYCC(); ExecuteAdc65N02(ReadAbsY(), 4); - } + } private void Execute65N02Adc7D() // adc abs, x { GetAddressAbsXCC(); ExecuteAdc65N02(ReadAbsX(), 4); - } + } private void Execute65N02Asl1E() // asl abs, x { GetAddressAbsX(); WriteAbsX(ExecuteAsl(ReadAbsX(), 7)); - } + } private void Execute65N02DecDE() // dec abs, x { GetAddressAbsX(); WriteAbsX(ExecuteDec(ReadAbsX(), 7)); - } + } private void Execute65N02IncFE() // inc abs, x { GetAddressAbsX(); WriteAbsX(ExecuteInc(ReadAbsX(), 7)); - } + } private void Execute65N02Jmp6C() // jmp (abs) { ExecuteJmpAbsInd65N02(5); - } + } private void Execute65N02Lsr5E() // lsr abs, x { GetAddressAbsX(); WriteAbsX(ExecuteLsr(ReadAbsX(), 7)); - } + } private void Execute65N02Nop02() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02Nop03() // nop imp1 { ExecuteNop(1, 6); - } + } private void Execute65N02Nop04() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop07() // nop imp1 { ExecuteNop(1, 5); - } + } private void Execute65N02Nop0B() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop0C() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop0F() // nop imp2 { ExecuteNop(2, 6); - } + } private void Execute65N02Nop12() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02Nop13() // nop imp1 { ExecuteNop(1, 6); - } + } private void Execute65N02Nop14() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop17() // nop imp1 { ExecuteNop(1, 6); - } + } private void Execute65N02Nop1A() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02Nop1B() // nop imp2 { ExecuteNop(2, 6); - } + } private void Execute65N02Nop1C() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop1F() // nop imp2 { ExecuteNop(2, 6); - } + } private void Execute65N02Nop22() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02Nop23() // nop imp1 { ExecuteNop(1, 6); - } + } private void Execute65N02Nop27() // nop imp1 { ExecuteNop(1, 3); - } + } private void Execute65N02Nop2B() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop2F() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop32() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02Nop33() // nop imp1 { ExecuteNop(1, 5); - } + } private void Execute65N02Nop34() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop37() // nop imp1 { ExecuteNop(1, 4); - } + } private void Execute65N02Nop3A() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02Nop3B() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop3C() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop3F() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop42() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02Nop43() // nop imp1 { ExecuteNop(1, 6); - } + } private void Execute65N02Nop44() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop47() // nop imp1 { ExecuteNop(1, 3); - } + } private void Execute65N02Nop4B() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop4F() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop52() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02Nop53() // nop imp1 { ExecuteNop(1, 5); - } + } private void Execute65N02Nop54() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop57() // nop imp1 { ExecuteNop(1, 4); - } + } private void Execute65N02Nop5A() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02Nop5B() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop5C() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop5F() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop62() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02Nop63() // nop imp1 { ExecuteNop(1, 6); - } + } private void Execute65N02Nop64() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop67() // nop imp1 { ExecuteNop(1, 3); - } + } private void Execute65N02Nop6B() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop6F() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop72() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02Nop73() // nop imp1 { ExecuteNop(1, 5); - } + } private void Execute65N02Nop74() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop77() // nop imp1 { ExecuteNop(1, 4); - } + } private void Execute65N02Nop7A() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02Nop7B() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop7C() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop7F() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop80() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop82() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop83() // nop imp1 { ExecuteNop(1, 4); - } + } private void Execute65N02Nop87() // nop imp1 { ExecuteNop(1, 3); - } + } private void Execute65N02Nop89() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop8B() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02Nop8F() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02Nop92() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02Nop93() // nop imp1 { ExecuteNop(1, 6); - } + } private void Execute65N02Nop97() // nop imp1 { ExecuteNop(1, 4); - } + } private void Execute65N02Nop9B() // nop imp2 { ExecuteNop(2, 5); - } + } private void Execute65N02Nop9C() // nop imp2 { ExecuteNop(2, 5); - } + } private void Execute65N02Nop9E() // nop imp2 { ExecuteNop(2, 5); - } + } private void Execute65N02Nop9F() // nop imp2 { ExecuteNop(2, 5); - } + } private void Execute65N02NopA3() // nop imp1 { ExecuteNop(1, 6); - } + } private void Execute65N02NopA7() // nop imp1 { ExecuteNop(1, 3); - } + } private void Execute65N02NopAB() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02NopAF() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02NopB2() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02NopB3() // nop imp1 { ExecuteNop(1, 5); - } + } private void Execute65N02NopB7() // nop imp1 { ExecuteNop(1, 4); - } + } private void Execute65N02NopBB() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02NopBF() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02NopC2() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02NopC3() // nop imp1 { ExecuteNop(1, 6); - } + } private void Execute65N02NopC7() // nop imp1 { ExecuteNop(1, 5); - } + } private void Execute65N02NopCB() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02NopCF() // nop imp2 { ExecuteNop(2, 6); - } + } private void Execute65N02NopD2() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02NopD3() // nop imp1 { ExecuteNop(1, 6); - } + } private void Execute65N02NopD4() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02NopD7() // nop imp1 { ExecuteNop(1, 6); - } + } private void Execute65N02NopDA() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02NopDB() // nop imp2 { ExecuteNop(2, 6); - } + } private void Execute65N02NopDC() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02NopDF() // nop imp2 { ExecuteNop(2, 6); - } + } private void Execute65N02NopE2() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02NopE3() // nop imp1 { ExecuteNop(1, 6); - } + } private void Execute65N02NopE7() // nop imp1 { ExecuteNop(1, 5); - } + } private void Execute65N02NopEB() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02NopEF() // nop imp2 { ExecuteNop(2, 6); - } + } private void Execute65N02NopF2() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02NopF3() // nop imp1 { ExecuteNop(1, 6); - } + } private void Execute65N02NopF4() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65N02NopF7() // nop imp1 { ExecuteNop(1, 6); - } + } private void Execute65N02NopFA() // nop imp0 { ExecuteNop(0, 2); - } + } private void Execute65N02NopFB() // nop imp2 { ExecuteNop(2, 6); - } + } private void Execute65N02NopFC() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65N02NopFF() // nop imp2 { ExecuteNop(2, 6); - } + } private void Execute65N02Rol3E() // rol abs, x { GetAddressAbsX(); WriteAbsX(ExecuteRol(ReadAbsX(), 7)); - } + } private void Execute65N02Ror7E() // ror abs, x { GetAddressAbsX(); WriteAbsX(ExecuteRor(ReadAbsX(), 7)); - } + } private void Execute65N02SbcE1() // sbc (zpg, x) { GetAddressZpgIndX(); ExecuteSbc65N02(ReadZpgIndX(), 6); - } + } private void Execute65N02SbcE5() // sbc zpg { GetAddressZpg(); ExecuteSbc65N02(ReadZpg(), 3); - } + } private void Execute65N02SbcE9() // sbc imm { ExecuteSbc65N02(ReadImm(), 2); - } + } private void Execute65N02SbcED() // sbc abs { GetAddressAbs(); ExecuteSbc65N02(ReadAbs(), 4); - } + } private void Execute65N02SbcF1() // sbc (zpg), y { GetAddressZpgIndYCC(); ExecuteSbc65N02(ReadZpgIndY(), 5); - } + } private void Execute65N02SbcF5() // sbc zpg, x { GetAddressZpgX(); ExecuteSbc65N02(ReadZpgX(), 4); - } + } private void Execute65N02SbcF9() // sbc abs, y { GetAddressAbsYCC(); ExecuteSbc65N02(ReadAbsY(), 4); - } + } private void Execute65N02SbcFD() // sbc abs, x { @@ -2532,678 +2532,678 @@ private void Execute65C02Adc61() // adc (zpg, x) { GetAddressZpgIndX(); ExecuteAdc65C02(ReadZpgIndX(), 6); - } + } private void Execute65C02Adc65() // adc zpg { GetAddressZpg(); ExecuteAdc65C02(ReadZpg(), 3); - } + } private void Execute65C02Adc69() // adc imm { ExecuteAdc65C02(ReadImm(), 2); - } + } private void Execute65C02Adc6D() // adc abs { GetAddressAbs(); ExecuteAdc65C02(ReadAbs(), 4); - } + } private void Execute65C02Adc71() // adc (zpg), y { GetAddressZpgIndYCC(); ExecuteAdc65C02(ReadZpgIndY(), 5); - } + } private void Execute65C02Adc72() // adc (zpg) { GetAddressZpgInd(); ExecuteAdc65C02(ReadZpgInd(), 5); - } + } private void Execute65C02Adc75() // adc zpg, x { GetAddressZpgX(); ExecuteAdc65C02(ReadZpgX(), 4); - } + } private void Execute65C02Adc79() // adc abs, y { GetAddressAbsYCC(); ExecuteAdc65C02(ReadAbsY(), 4); - } + } private void Execute65C02Adc7D() // adc abs, x { GetAddressAbsXCC(); ExecuteAdc65C02(ReadAbsX(), 4); - } + } private void Execute65C02And32() // and (zpg) { GetAddressZpgInd(); ExecuteAnd(ReadZpgInd(), 5); - } + } private void Execute65C02Asl1E() // asl abs, x { GetAddressAbsXCC(); WriteAbsX(ExecuteAsl(ReadAbsX(), 6)); - } + } private void Execute65C02Bit34() // bit zpg, x { GetAddressZpgX(); ExecuteBit(ReadZpgX(), 4); - } + } private void Execute65C02Bit3C() // bit abs, x { GetAddressAbsXCC(); ExecuteBit(ReadAbsX(), 4); - } + } private void Execute65C02Bit89() // bit imm { ExecuteBitImm(ReadImm(), 2); - } + } private void Execute65C02Bra80() // bra rel { ExecuteBra(2); - } + } private void Execute65C02CmpD2() // cmp (zpg) { GetAddressZpgInd(); ExecuteCmp(ReadZpgInd(), 5); - } + } private void Execute65C02Dea3A() // dea imp { ExecuteDea(2); - } + } private void Execute65C02DecDE() // dec abs, x { GetAddressAbsXCC(); WriteAbsX(ExecuteDec(ReadAbsX(), 6)); - } + } private void Execute65C02Eor52() // eor (zpg) { GetAddressZpgInd(); ExecuteEor(ReadZpgInd(), 5); - } + } private void Execute65C02Ina1A() // ina imp { ExecuteIna(2); - } + } private void Execute65C02IncFE() // inc abs, x { GetAddressAbsXCC(); WriteAbsX(ExecuteInc(ReadAbsX(), 6)); - } + } private void Execute65C02Jmp6C() // jmp (abs) { ExecuteJmpAbsInd65C02(6); - } + } private void Execute65C02Jmp7C() // jmp (abs, x) { ExecuteJmpAbsIndX(6); - } + } private void Execute65C02LdaB2() // lda (zpg) { GetAddressZpgInd(); ExecuteLda(ReadZpgInd(), 5); - } + } private void Execute65C02Lsr5E() // lsr abs, x { GetAddressAbsXCC(); WriteAbsX(ExecuteLsr(ReadAbsX(), 6)); - } + } private void Execute65C02Nop02() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65C02Nop03() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop07() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop0B() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop0F() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop13() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop17() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop1B() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop1F() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop22() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65C02Nop23() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop27() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop2B() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop2F() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop33() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop37() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop3B() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop3F() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop42() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65C02Nop43() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop44() // nop imp1 { ExecuteNop(1, 3); - } + } private void Execute65C02Nop47() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop4B() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop4F() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop53() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop54() // nop imp1 { ExecuteNop(1, 4); - } + } private void Execute65C02Nop57() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop5B() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop5C() // nop imp2 { ExecuteNop(2, 8); - } + } private void Execute65C02Nop5F() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop62() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65C02Nop63() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop67() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop6B() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop6F() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop73() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop77() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop7B() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop7F() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop82() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65C02Nop83() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop87() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop8B() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop8F() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop93() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop97() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop9B() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Nop9F() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopA3() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopA7() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopAB() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopAF() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopB3() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopB7() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopBB() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopBF() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopC2() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65C02NopC3() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopC7() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopCB() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopCF() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopD3() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopD4() // nop imp1 { ExecuteNop(1, 4); - } + } private void Execute65C02NopD7() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopDB() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopDC() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65C02NopDF() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopE2() // nop imp1 { ExecuteNop(1, 2); - } + } private void Execute65C02NopE3() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopE7() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopEB() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopEF() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopF3() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopF4() // nop imp1 { ExecuteNop(1, 4); - } + } private void Execute65C02NopF7() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopFB() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02NopFC() // nop imp2 { ExecuteNop(2, 4); - } + } private void Execute65C02NopFF() // nop imp0 { ExecuteNop(0, 1); - } + } private void Execute65C02Ora12() // ora (zpg) { GetAddressZpgInd(); ExecuteOra(ReadZpgInd(), 5); - } + } private void Execute65C02PhxDA() // phx imp { ExecutePhx(3); - } + } private void Execute65C02Phy5A() // phy imp { ExecutePhy(3); - } + } private void Execute65C02PlxFA() // plx imp { ExecutePlx(4); - } + } private void Execute65C02Ply7A() // ply imp { ExecutePly(4); - } + } private void Execute65C02Rol3E() // rol abs, x { GetAddressAbsXCC(); WriteAbsX(ExecuteRol(ReadAbsX(), 6)); - } + } private void Execute65C02Ror7E() // ror abs, x { GetAddressAbsXCC(); WriteAbsX(ExecuteRor(ReadAbsX(), 6)); - } + } private void Execute65C02SbcE1() // sbc (zpg, x) { GetAddressZpgIndX(); ExecuteSbc65C02(ReadZpgIndX(), 6); - } + } private void Execute65C02SbcE5() // sbc zpg { GetAddressZpg(); ExecuteSbc65C02(ReadZpg(), 3); - } + } private void Execute65C02SbcE9() // sbc imm { ExecuteSbc65C02(ReadImm(), 2); - } + } private void Execute65C02SbcED() // sbc abs { GetAddressAbs(); ExecuteSbc65C02(ReadAbs(), 4); - } + } private void Execute65C02SbcF1() // sbc (zpg), y { GetAddressZpgIndYCC(); ExecuteSbc65C02(ReadZpgIndY(), 5); - } + } private void Execute65C02SbcF2() // sbc (zpg) { GetAddressZpgInd(); ExecuteSbc65C02(ReadZpgInd(), 5); - } + } private void Execute65C02SbcF5() // sbc zpg, x { GetAddressZpgX(); ExecuteSbc65C02(ReadZpgX(), 4); - } + } private void Execute65C02SbcF9() // sbc abs, y { GetAddressAbsYCC(); ExecuteSbc65C02(ReadAbsY(), 4); - } + } private void Execute65C02SbcFD() // sbc abs, x { GetAddressAbsXCC(); ExecuteSbc65C02(ReadAbsX(), 4); - } + } private void Execute65C02Sta92() // sta (zpg) { GetAddressZpgInd(); WriteZpgInd(RA); ExecuteSta(5); - } + } private void Execute65C02Stz64() // stz zpg { GetAddressZpg(); WriteZpg(0x00); ExecuteStz(3); - } + } private void Execute65C02Stz74() // stz zpg, x { GetAddressZpgX(); WriteZpgX(0x00); ExecuteStz(4); - } + } private void Execute65C02Stz9C() // stz abs { GetAddressAbs(); WriteAbs(0x00); ExecuteStz(4); - } + } private void Execute65C02Stz9E() // stz abs, x { GetAddressAbsX(); WriteAbsX(0x00); ExecuteStz(5); - } + } private void Execute65C02Trb14() // trb zpg { GetAddressZpg(); WriteZpg(ExecuteTrb(ReadZpg(), 5)); - } + } private void Execute65C02Trb1C() // trb abs { GetAddressAbs(); WriteAbs(ExecuteTrb(ReadAbs(), 6)); - } + } private void Execute65C02Tsb04() // tsb zpg { GetAddressZpg(); WriteZpg(ExecuteTsb(ReadZpg(), 5)); - } + } private void Execute65C02Tsb0C() // tsb abs { diff --git a/Virtu/GlobalSuppressions.cs b/Virtu/GlobalSuppressions.cs new file mode 100644 index 0000000..edd5113 --- /dev/null +++ b/Virtu/GlobalSuppressions.cs @@ -0,0 +1,3 @@ +using System.Diagnostics.CodeAnalysis; + +[assembly: SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames")] diff --git a/Virtu/Jellyfish.Virtu.FxCop b/Virtu/Jellyfish.Virtu.FxCop index 0e83827..bc91225 100644 --- a/Virtu/Jellyfish.Virtu.FxCop +++ b/Virtu/Jellyfish.Virtu.FxCop @@ -42,102 +42,111 @@ + + + + + + + + + + + + + 'DiskDsk.Read3Nibbles(byte, byte, byte, int)' + 'nibble' + 'byte' + + + + + + + + + 'DiskDsk.WriteTrack(int, int, byte[])' + 'Exception' + + + + + 'DiskDsk.WriteTrack(int, int, byte[])' + 'readVolume' + 'int' + + + + + + + + + + + + + 'target' + 'Button' + 'MainWindow.IComponentConnector.Connect(int, object)' + castclass + + + + + + + + + + + + + 'Video.ReadFloatingBus()' + + + + + + + + + + + + - - - - - 'Disk525' - - - + - + - + - 'fileData' - 'Disk525.Disk525(string, byte[])' - - - - - 'fileName' - 'Disk525.Disk525(string, byte[])' + 'DiskDsk.Read3Nibbles(byte, byte, byte, int)' + 'nibble' + 'byte' - - - - - + - - - 'DiskII._writeModeOn' + + + 'DiskDsk.WriteTrack(int, int, byte[])' + 'Exception' - - - - - + - 'DiskII.Write(int, int)' - - - - - 'address' - 'DiskII.Write(int, int)' - - - - - 'data' - 'DiskII.Write(int, int)' - - - - - - - - - - - - - 'Drive525.driveArmStepDelta' - - - - - - - - - 'Drive525.Reset()' - - - - - - - - - - - - - 'Speaker.ToggleOutput()' + 'DiskDsk.WriteTrack(int, int, byte[])' + 'readVolume' + 'int' @@ -165,20 +174,17 @@ - - Change the accessibility of all public constructors in {0} to protected. + + {0}, a parameter, is cast to type {1} multiple times in method {2}. Cache the result of the 'as' operator or direct cast in order to eliminate the redundant {3} instruction. - - It appears that field {0} is never used or is only ever assigned to. Use this field or remove it. + + {0} creates an exception of type {1}, an exception type that is not sufficiently specific and should never be raised by user code. If this exception instance might be thrown, use a different exception type. The 'this' parameter (or 'Me' in Visual Basic) of {0} is never used. Mark the member as static (or Shared in Visual Basic) or use 'this'/'Me' in the method body or at least one property accessor, if appropriate. - - {0} is a multidimensional array. Replace it with a jagged array if possible. - - - Parameter {0} of {1} is never used. Remove the parameter or use it in the method body. + + {0} declares a variable, {1}, of type {2}, which is never used or is only assigned to. Use this variable or remove it. diff --git a/Virtu/Memory.cs b/Virtu/Memory.cs index e403694..efe4978 100644 --- a/Virtu/Memory.cs +++ b/Virtu/Memory.cs @@ -1,5 +1,6 @@ using System; using System.Diagnostics.CodeAnalysis; +using System.Globalization; using System.IO; using System.Resources; using Jellyfish.Library; @@ -1376,7 +1377,7 @@ private Stream GetRomStream(string romName, int romSize) Stream romStream = (Stream)resourceManager.GetObject(romName); if (romStream.Length != romSize) { - throw new InvalidOperationException(SR.RomInvalidFormat(romName)); + throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, SR.RomInvalid, romName)); } return romStream; diff --git a/Virtu/Properties/SR.Designer.cs b/Virtu/Properties/SR.Designer.cs index 13a2298..6cfd7b4 100644 --- a/Virtu/Properties/SR.Designer.cs +++ b/Virtu/Properties/SR.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4016 +// Runtime Version:2.0.50727.4927 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -13,147 +13,78 @@ namespace Jellyfish.Virtu.Properties { /// - /// A strongly-typed resource class, for looking up localized strings, formatting them, etc. + /// A strongly-typed resource class, for looking up localized strings, etc. /// - // This class was auto-generated by the StronglyTypedResourceBuilderEx class via the ResXFileCodeGeneratorEx custom tool. - // To add or remove a member, edit your .ResX file then rerun the ResXFileCodeGeneratorEx custom tool or rebuild your VS.NET project. - // Copyright (c) Dmytro Kryvko 2006-2009 (http://dmytro.kryvko.googlepages.com/) - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("DMKSoftware.CodeGenerators.Tools.StronglyTypedResourceBuilderEx", "2.4.0.0")] + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Naming", "CA1724:TypeNamesShouldNotMatchNamespaces")] - public partial class SR { + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class SR { - private static global::System.Resources.ResourceManager _resourceManager; + private static global::System.Resources.ResourceManager resourceMan; - private static object _internalSyncObject; - - private static global::System.Globalization.CultureInfo _resourceCulture; + private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - public SR() { + internal SR() { } /// - /// Thread safe lock object used by this class. + /// Returns the cached ResourceManager instance used by this class. /// - public static object InternalSyncObject { + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { get { - if (object.ReferenceEquals(_internalSyncObject, null)) { - global::System.Threading.Interlocked.CompareExchange(ref _internalSyncObject, new object(), null); + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Jellyfish.Virtu.Properties.SR", typeof(SR).Assembly); + resourceMan = temp; } - return _internalSyncObject; + return resourceMan; } } /// - /// Returns the cached ResourceManager instance used by this class. + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Resources.ResourceManager ResourceManager { + internal static global::System.Globalization.CultureInfo Culture { get { - if (object.ReferenceEquals(_resourceManager, null)) { - global::System.Threading.Monitor.Enter(InternalSyncObject); - try { - if (object.ReferenceEquals(_resourceManager, null)) { - global::System.Threading.Interlocked.Exchange(ref _resourceManager, new global::System.Resources.ResourceManager("Jellyfish.Virtu.Properties.SR", typeof(SR).Assembly)); - } - } - finally { - global::System.Threading.Monitor.Exit(InternalSyncObject); - } - } - return _resourceManager; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - public static global::System.Globalization.CultureInfo Culture { - get { - return _resourceCulture; + return resourceCulture; } set { - _resourceCulture = value; + resourceCulture = value; } } /// - /// Looks up a localized string similar to 'Rom '{0}' invalid.'. + /// Looks up a localized string similar to Rom '{0}' invalid.. /// - public static string RomInvalid { + internal static string RomInvalid { get { - return ResourceManager.GetString(ResourceNames.RomInvalid, _resourceCulture); + return ResourceManager.GetString("RomInvalid", resourceCulture); } } /// - /// Looks up a localized string similar to 'Service type '{0}' already present.'. + /// Looks up a localized string similar to Service type '{0}' already present.. /// - public static string ServiceAlreadyPresent { + internal static string ServiceAlreadyPresent { get { - return ResourceManager.GetString(ResourceNames.ServiceAlreadyPresent, _resourceCulture); + return ResourceManager.GetString("ServiceAlreadyPresent", resourceCulture); } } /// - /// Looks up a localized string similar to 'Service type '{0}' must be assignable from service provider '{1}'.'. + /// Looks up a localized string similar to Service type '{0}' must be assignable from service provider '{1}'.. /// - public static string ServiceMustBeAssignable { + internal static string ServiceMustBeAssignable { get { - return ResourceManager.GetString(ResourceNames.ServiceMustBeAssignable, _resourceCulture); + return ResourceManager.GetString("ServiceMustBeAssignable", resourceCulture); } } - - /// - /// Formats a localized string similar to 'Rom '{0}' invalid.'. - /// - /// An object (0) to format. - /// A copy of format string in which the format items have been replaced by the String equivalent of the corresponding instances of Object in arguments. - public static string RomInvalidFormat(object arg0) { - return string.Format(_resourceCulture, RomInvalid, arg0); - } - - /// - /// Formats a localized string similar to 'Service type '{0}' already present.'. - /// - /// An object (0) to format. - /// A copy of format string in which the format items have been replaced by the String equivalent of the corresponding instances of Object in arguments. - public static string ServiceAlreadyPresentFormat(object arg0) { - return string.Format(_resourceCulture, ServiceAlreadyPresent, arg0); - } - - /// - /// Formats a localized string similar to 'Service type '{0}' must be assignable from service provider '{1}'.'. - /// - /// An object (0) to format. - /// An object (1) to format. - /// A copy of format string in which the format items have been replaced by the String equivalent of the corresponding instances of Object in arguments. - public static string ServiceMustBeAssignableFormat(object arg0, object arg1) { - return string.Format(_resourceCulture, ServiceMustBeAssignable, arg0, arg1); - } - - /// - /// Lists all the resource names as constant string fields. - /// - public class ResourceNames { - - /// - /// Stores the resource name 'RomInvalid'. - /// - public const string RomInvalid = "RomInvalid"; - - /// - /// Stores the resource name 'ServiceAlreadyPresent'. - /// - public const string ServiceAlreadyPresent = "ServiceAlreadyPresent"; - - /// - /// Stores the resource name 'ServiceMustBeAssignable'. - /// - public const string ServiceMustBeAssignable = "ServiceMustBeAssignable"; - } } } diff --git a/Virtu/Services/AudioService.cs b/Virtu/Services/AudioService.cs index 9fdca3e..345dcf6 100644 --- a/Virtu/Services/AudioService.cs +++ b/Virtu/Services/AudioService.cs @@ -25,6 +25,11 @@ public void ToggleOutput() // machine thread protected void Update(int bufferSize, Action updateBuffer) // audio thread { + if (updateBuffer == null) + { + throw new ArgumentNullException("updateBuffer"); + } + lock (_lock) { long cycles = Machine.Cpu.Cycles; diff --git a/Virtu/Services/MachineService.cs b/Virtu/Services/MachineService.cs index fe74e02..34ee5df 100644 --- a/Virtu/Services/MachineService.cs +++ b/Virtu/Services/MachineService.cs @@ -6,6 +6,11 @@ public abstract class MachineService : IDisposable { protected MachineService(Machine machine) { + if (machine == null) + { + throw new ArgumentNullException("machine"); + } + Machine = machine; } diff --git a/Virtu/Services/MachineServices.cs b/Virtu/Services/MachineServices.cs index ac8bd9c..38b8959 100644 --- a/Virtu/Services/MachineServices.cs +++ b/Virtu/Services/MachineServices.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; +using System.Globalization; using Jellyfish.Virtu.Properties; namespace Jellyfish.Virtu.Services @@ -9,13 +10,21 @@ public sealed class MachineServices : IServiceProvider { public void AddService(Type serviceType, MachineService serviceProvider) { + if (serviceType == null) + { + throw new ArgumentNullException("serviceType"); + } if (_serviceProviders.ContainsKey(serviceType)) { - throw new ArgumentException(SR.ServiceAlreadyPresentFormat(serviceType.FullName), "serviceType"); + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ServiceAlreadyPresent, serviceType.FullName), "serviceType"); + } + if (serviceProvider == null) + { + throw new ArgumentNullException("serviceProvider"); } if (!serviceType.IsAssignableFrom(serviceProvider.GetType())) { - throw new ArgumentException(SR.ServiceMustBeAssignableFormat(serviceType.FullName, serviceProvider.GetType().FullName)); + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, SR.ServiceMustBeAssignable, serviceType.FullName, serviceProvider.GetType().FullName)); } _serviceProviders.Add(serviceType, serviceProvider); diff --git a/Virtu/Silverlight/Jellyfish.Virtu.Silverlight.csproj b/Virtu/Silverlight/Jellyfish.Virtu.Silverlight.csproj index f3e2a6c..f112d0e 100644 --- a/Virtu/Silverlight/Jellyfish.Virtu.Silverlight.csproj +++ b/Virtu/Silverlight/Jellyfish.Virtu.Silverlight.csproj @@ -95,6 +95,9 @@ Core\GamePort.cs + + GlobalSuppressions.cs + Core\Keyboard.cs @@ -186,7 +189,7 @@ Properties\SR.resx - ResXFileCodeGeneratorEx + ResXFileCodeGenerator SR.Designer.cs diff --git a/Virtu/Silverlight/Services/SilverlightAudioService.cs b/Virtu/Silverlight/Services/SilverlightAudioService.cs index dabce77..aa01b90 100644 --- a/Virtu/Silverlight/Services/SilverlightAudioService.cs +++ b/Virtu/Silverlight/Services/SilverlightAudioService.cs @@ -1,4 +1,5 @@ -using System.Windows.Controls; +using System; +using System.Windows.Controls; namespace Jellyfish.Virtu.Services { @@ -7,6 +8,15 @@ public sealed class SilverlightAudioService : AudioService public SilverlightAudioService(Machine machine, UserControl page, MediaElement media) : base(machine) { + if (page == null) + { + throw new ArgumentNullException("page"); + } + if (media == null) + { + throw new ArgumentNullException("media"); + } + _page = page; _media = media; diff --git a/Virtu/Silverlight/Services/SilverlightKeyboardService.cs b/Virtu/Silverlight/Services/SilverlightKeyboardService.cs index 6a79a05..8e6f058 100644 --- a/Virtu/Silverlight/Services/SilverlightKeyboardService.cs +++ b/Virtu/Silverlight/Services/SilverlightKeyboardService.cs @@ -12,6 +12,11 @@ public sealed class SilverlightKeyboardService : KeyboardService public SilverlightKeyboardService(Machine machine, UserControl page) : base(machine) { + if (page == null) + { + throw new ArgumentNullException("page"); + } + _page = page; _page.KeyDown += Page_KeyDown; diff --git a/Virtu/Silverlight/Services/SilverlightStorageService.cs b/Virtu/Silverlight/Services/SilverlightStorageService.cs index fd572c8..a3097df 100644 --- a/Virtu/Silverlight/Services/SilverlightStorageService.cs +++ b/Virtu/Silverlight/Services/SilverlightStorageService.cs @@ -13,6 +13,11 @@ public SilverlightStorageService(Machine machine) : public override void Load(string path, Action reader) { + if (reader == null) + { + throw new ArgumentNullException("reader"); + } + try { using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication()) @@ -33,6 +38,11 @@ public override void Load(string path, Action reader) public override void Save(string path, Action writer) { + if (writer == null) + { + throw new ArgumentNullException("writer"); + } + try { using (IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication()) diff --git a/Virtu/Silverlight/Services/SilverlightVideoService.cs b/Virtu/Silverlight/Services/SilverlightVideoService.cs index b55b77f..26e3578 100644 --- a/Virtu/Silverlight/Services/SilverlightVideoService.cs +++ b/Virtu/Silverlight/Services/SilverlightVideoService.cs @@ -12,7 +12,13 @@ public sealed class SilverlightVideoService : VideoService public SilverlightVideoService(Machine machine, Image image) : base(machine) { + if (image == null) + { + throw new ArgumentNullException("image"); + } + _image = image; + _image.Source = _bitmap; SetImageSize(); diff --git a/Virtu/Wpf/Jellyfish.Virtu.Wpf.csproj b/Virtu/Wpf/Jellyfish.Virtu.Wpf.csproj index c78aed4..af9f1b6 100644 --- a/Virtu/Wpf/Jellyfish.Virtu.Wpf.csproj +++ b/Virtu/Wpf/Jellyfish.Virtu.Wpf.csproj @@ -111,6 +111,9 @@ Core\GamePort.cs + + GlobalSuppressions.cs + Services\AudioService.cs @@ -189,7 +192,7 @@ Properties\SR.resx - ResXFileCodeGeneratorEx + ResXFileCodeGenerator SR.Designer.cs diff --git a/Virtu/Wpf/MainWindow.xaml.cs b/Virtu/Wpf/MainWindow.xaml.cs index e19eefc..310711d 100644 --- a/Virtu/Wpf/MainWindow.xaml.cs +++ b/Virtu/Wpf/MainWindow.xaml.cs @@ -15,7 +15,7 @@ public MainWindow() _storageService = new WpfStorageService(_machine); _keyboardService = new WpfKeyboardService(_machine, this); - _gamePortService = new XnaGamePortService(_machine); + _gamePortService = new GamePortService(_machine); // not connected _audioService = new WpfAudioService(_machine, this); _videoService = new WpfVideoService(_machine, this, _image); diff --git a/Virtu/Wpf/Services/WpfAudioService.cs b/Virtu/Wpf/Services/WpfAudioService.cs index f9c7078..744f764 100644 --- a/Virtu/Wpf/Services/WpfAudioService.cs +++ b/Virtu/Wpf/Services/WpfAudioService.cs @@ -10,6 +10,11 @@ public sealed class WpfAudioService : AudioService public WpfAudioService(Machine machine, Window window) : base(machine) { + if (window == null) + { + throw new ArgumentNullException("window"); + } + _window = window; _window.SourceInitialized += (sender, e) => _directSound.Start(_window.GetHandle()); @@ -23,6 +28,8 @@ protected override void Dispose(bool disposing) { _directSound.Dispose(); } + + base.Dispose(disposing); } private void DirectSound_Update(object sender, DirectSoundUpdateEventArgs e) diff --git a/Virtu/Wpf/Services/WpfKeyboardService.cs b/Virtu/Wpf/Services/WpfKeyboardService.cs index dc8f6a1..127beb1 100644 --- a/Virtu/Wpf/Services/WpfKeyboardService.cs +++ b/Virtu/Wpf/Services/WpfKeyboardService.cs @@ -11,6 +11,11 @@ public sealed class WpfKeyboardService : KeyboardService public WpfKeyboardService(Machine machine, Window window) : base(machine) { + if (window == null) + { + throw new ArgumentNullException("window"); + } + _window = window; _window.KeyDown += Window_KeyDown; diff --git a/Virtu/Wpf/Services/WpfStorageService.cs b/Virtu/Wpf/Services/WpfStorageService.cs index 2aace8f..25848f3 100644 --- a/Virtu/Wpf/Services/WpfStorageService.cs +++ b/Virtu/Wpf/Services/WpfStorageService.cs @@ -14,6 +14,11 @@ public WpfStorageService(Machine machine) : public override void Load(string path, Action reader) { + if (reader == null) + { + throw new ArgumentNullException("reader"); + } + try { using (IsolatedStorageFile store = GetStore()) @@ -34,6 +39,11 @@ public override void Load(string path, Action reader) public override void Save(string path, Action writer) { + if (writer == null) + { + throw new ArgumentNullException("writer"); + } + try { using (IsolatedStorageFile store = GetStore()) diff --git a/Virtu/Wpf/Services/WpfVideoService.cs b/Virtu/Wpf/Services/WpfVideoService.cs index 37d4a2d..c7dc49a 100644 --- a/Virtu/Wpf/Services/WpfVideoService.cs +++ b/Virtu/Wpf/Services/WpfVideoService.cs @@ -15,8 +15,18 @@ public sealed class WpfVideoService : VideoService public WpfVideoService(Machine machine, Window window, Image image) : base(machine) { + if (window == null) + { + throw new ArgumentNullException("window"); + } + if (image == null) + { + throw new ArgumentNullException("image"); + } + _window = window; _image = image; + _image.Source = _bitmap; SetImageSize(); diff --git a/Virtu/Xna/Jellyfish.Virtu.Xna.Xbox.csproj b/Virtu/Xna/Jellyfish.Virtu.Xna.Xbox.csproj index d79869f..69bff5a 100644 --- a/Virtu/Xna/Jellyfish.Virtu.Xna.Xbox.csproj +++ b/Virtu/Xna/Jellyfish.Virtu.Xna.Xbox.csproj @@ -92,6 +92,9 @@ Core\GamePort.cs + + GlobalSuppressions.cs + Core\Keyboard.cs @@ -211,7 +214,7 @@ Properties\SR.resx - ResXFileCodeGeneratorEx + ResXFileCodeGenerator SR.Designer.cs diff --git a/Virtu/Xna/Jellyfish.Virtu.Xna.csproj b/Virtu/Xna/Jellyfish.Virtu.Xna.csproj index c7a50ea..f93acad 100644 --- a/Virtu/Xna/Jellyfish.Virtu.Xna.csproj +++ b/Virtu/Xna/Jellyfish.Virtu.Xna.csproj @@ -113,6 +113,9 @@ Core\GamePort.cs + + GlobalSuppressions.cs + Core\Keyboard.cs @@ -225,7 +228,7 @@ Properties\SR.resx - ResXFileCodeGeneratorEx + ResXFileCodeGenerator SR.Designer.cs diff --git a/Virtu/Xna/Services/XnaAudioService.cs b/Virtu/Xna/Services/XnaAudioService.cs index 9ccd5c6..885a261 100644 --- a/Virtu/Xna/Services/XnaAudioService.cs +++ b/Virtu/Xna/Services/XnaAudioService.cs @@ -10,6 +10,11 @@ public sealed class XnaAudioService : AudioService public XnaAudioService(Machine machine, GameBase game) : base(machine) { + if (game == null) + { + throw new ArgumentNullException("game"); + } + _game = game; _directSound.Start(_game.Window.Handle); diff --git a/Virtu/Xna/Services/XnaStorageService.cs b/Virtu/Xna/Services/XnaStorageService.cs index 3ee7717..1423356 100644 --- a/Virtu/Xna/Services/XnaStorageService.cs +++ b/Virtu/Xna/Services/XnaStorageService.cs @@ -11,11 +11,21 @@ public sealed class XnaStorageService : StorageService public XnaStorageService(Machine machine, GameBase game) : base(machine) { + if (game == null) + { + throw new ArgumentNullException("game"); + } + _game = game; } public override void Load(string path, Action reader) { + if (reader == null) + { + throw new ArgumentNullException("reader"); + } + try { using (StorageContainer storageContainer = _storageDevice.Value.OpenContainer(_game.Name)) @@ -33,6 +43,11 @@ public override void Load(string path, Action reader) public override void Save(string path, Action writer) { + if (writer == null) + { + throw new ArgumentNullException("writer"); + } + using (StorageContainer storageContainer = _storageDevice.Value.OpenContainer(_game.Name)) { using (FileStream stream = new FileStream(Path.Combine(storageContainer.Path, path), FileMode.Create, FileAccess.Write, FileShare.None)) diff --git a/Virtu/Xna/Services/XnaVideoService.cs b/Virtu/Xna/Services/XnaVideoService.cs index a78ca00..bf72658 100644 --- a/Virtu/Xna/Services/XnaVideoService.cs +++ b/Virtu/Xna/Services/XnaVideoService.cs @@ -11,6 +11,11 @@ public sealed class XnaVideoService : VideoService public XnaVideoService(Machine machine, GameBase game) : base(machine) { + if (game == null) + { + throw new ArgumentNullException("game"); + } + _game = game; _game.GraphicsDeviceManager.PreparingDeviceSettings += GraphicsDeviceManager_PreparingDeviceSettings;