Exemplo n.º 1
0
 public static bool IsVS2015RuntimeInstalled()
 {
     try
     {
         // Super ghetto way of detecting if the runtime is installed is simply by calling
         // any function that will cause a C++ DLL to be loaded.
         NesApu.GetAudioExpansions(0);
         return(true);
     }
     catch
     {
         return(false);
     }
 }
Exemplo n.º 2
0
        private void WriteN163Register(int reg, int data)
        {
            // HACK : There are conflicts between N163 registers and S5B register, a N163 addr write
            // can be interpreted as a S5B data write. To prevent this, we select a dummy register
            // for S5B so that the write is discarded.
            //
            // N163:
            //   f800-ffff (addr)
            //   4800-4fff (data)
            // S5B:
            //   c000-e000 (addr)
            //   f000-ffff (data)

            if ((NesApu.GetAudioExpansions(apuIdx) & NesApu.APU_EXPANSION_MASK_SUNSOFT) != 0)
            {
                WriteRegister(NesApu.S5B_ADDR, NesApu.S5B_REG_IO_A);
            }

            WriteRegister(NesApu.N163_ADDR, reg);
            WriteRegister(NesApu.N163_DATA, data);
        }