示例#1
0
 ModuleTraits(const Binary::Data& data, std::size_t footerOffset)
   : FooterOffset(footerOffset)
   , Foot(footerOffset != data.Size() ? safe_ptr_cast<const Footer*>(static_cast<const uint8_t*>(data.Start()) + footerOffset) : 0)
   , FirstSize(Foot ? fromLE(Foot->Size1) : 0)
   , SecondSize(Foot ? fromLE(Foot->Size2) : 0)
 {
 }
示例#2
0
 explicit SPC(const Binary::Data& data)
   : Data(static_cast<const uint8_t*>(data.Start()), static_cast<const uint8_t*>(data.Start()) + data.Size())
 {
   CheckError(Spc.init());
   // #0040 is C-1 (32Hz) - min
   // #0080 is C-2
   // #0100 is C-3
   // #0200 is C-4
   // #0400 is C-5
   // #0800 is C-6
   // #1000 is C-7 (2093Hz) - normal 32kHz
   // #2000 is C-8 (4186Hz)
   // #3fff is B-8 (7902Hz) - max
   const uint_t DIVIDER = ::SNES_SPC::sample_rate * SPC_DIVIDER / C_7_FREQ;
   Analysis.SetClockAndDivisor(::SNES_SPC::sample_rate, DIVIDER);
   Reset();
 }