void Ks202::SubSave(State::Saver& state) const
				{
					state.Begin( AsciiId<'K','0','2'>::V );
					state.Begin( AsciiId<'R','E','G'>::V ).Write8( ctrl ).End();

					const byte data[5] =
					{
						static_cast<byte>(irq.unit.ctrl),
						static_cast<byte>(irq.unit.count & 0xFF),
						static_cast<byte>(irq.unit.count >> 8),
						static_cast<byte>(irq.unit.latch & 0xFF),
						static_cast<byte>(irq.unit.latch >> 8)
					};
Esempio n. 2
0
				void Ks202::SubSave(State::Saver& state) const
				{
					state.Begin( AsciiId<'K','0','2'>::V );
					state.Begin( AsciiId<'R','E','G'>::V ).Write8( ctrl ).End();

					const byte data[5] =
					{
						irq.unit.ctrl,
						irq.unit.count & 0xFF,
						irq.unit.count >> 8,
						irq.unit.latch & 0xFF,
						irq.unit.latch >> 8
					};

					state.Begin( AsciiId<'I','R','Q'>::V ).Write( data ).End();
					state.End();
				}
Esempio n. 3
0
				void Standard::SubSave(State::Saver& state) const
				{
					const byte data[3] =
					{
						irq.unit.enabled ? 0x1 : 0x0,
						irq.unit.latch,
						irq.unit.count
					};

					state.Begin( AsciiId<'F','D','A'>::V ).Begin( AsciiId<'I','R','Q'>::V ).Write( data ).End().End();
				}
Esempio n. 4
0
		void Cartridge::SaveState(State::Saver& state,const dword baseChunk) const
		{
			state.Begin( baseChunk );

			board->SaveState( state, AsciiId<'M','P','R'>::V );

			if (vs)
				vs->SaveState( state, AsciiId<'V','S','S'>::V );

			state.End();
		}
Esempio n. 5
0
			void AdapterFour::SaveState(State::Saver& state,const dword chunk) const
			{
				if (type == Api::Input::ADAPTER_NES)
				{
					const byte data[3] =
					{
						increaser ^ 1, count[0], count[1]
					};

					state.Begin( chunk ).Write( data ).End();
				}
			}
				void Vrc4::Irq::SaveState(State::Saver& state,const dword chunk) const
				{
					const byte data[5] =
					{
						unit.ctrl | (Connected() ? BaseIrq::ENABLE_0 : 0),
						unit.latch,
						unit.count[0] & 0xFF,
						unit.count[0] >> 8,
						unit.count[1]
					};

					state.Begin( chunk ).Write( data ).End();
				}
void Datach::Reader::SaveState(State::Saver& state,const dword baseChunk) const
{
    if (Reader::IsTransferring())
    {
        NST_ASSERT( cycles != Cpu::CYCLE_MAX );

        state.Begin( baseChunk );

        state.Begin( AsciiId<'P','T','R'>::V ).Write8( stream - data ).End();
        state.Begin( AsciiId<'D','A','T'>::V ).Compress( data ).End();

        uint next;

        if (cycles > cpu.GetCycles())
            next = (cycles - cpu.GetCycles()) / cpu.GetClock();
        else
            next = 0;

        state.Begin( AsciiId<'C','Y','C'>::V ).Write16( next ).End();

        state.End();
    }
}
				void Tc0190fmcPal16r4::SubSave(State::Saver& state) const
				{
					state.Begin( AsciiId<'T','T','C'>::V );
					irq.unit.SaveState( state, AsciiId<'I','R','Q'>::V );
					state.End();
				}
			void KonamiHyperShot::SaveState(State::Saver& saver,const byte id) const
			{
				saver.Begin( AsciiId<'H','S'>::R(0,0,id) ).Write8( strobe ).End();
			}
				void ResetBased4in1::SubSave(State::Saver& state) const
				{
					state.Begin( AsciiId<'B','R','4'>::V ).Begin( AsciiId<'R','E','G'>::V ).Write8( resetSwitch ).End().End();
				}
			void DoremikkoKeyboard::SaveState(State::Saver& saver,const byte id) const
			{
				saver.Begin( AsciiId<'D','K'>::R(0,0,id) ).End();
			}
			void ExcitingBoxing::SaveState(State::Saver& saver,const byte id) const
			{
				saver.Begin( AsciiId<'E','B'>::R(0,0,id) ).End();
			}
Esempio n. 13
0
				void Standard::SubSave(State::Saver& state) const
				{
					state.Begin( AsciiId<'J','Y','C'>::V );

					{
						const byte data[35] =
						{
							regs.ctrl[0],
							regs.ctrl[1],
							regs.ctrl[2],
							regs.ctrl[3],
							regs.mul[0],
							regs.mul[1],
							regs.tmp,
							banks.prg[0],
							banks.prg[1],
							banks.prg[2],
							banks.prg[3],
							banks.chr[0] & 0xFF,
							banks.chr[0] >> 8,
							banks.chr[1] & 0xFF,
							banks.chr[1] >> 8,
							banks.chr[2] & 0xFF,
							banks.chr[2] >> 8,
							banks.chr[3] & 0xFF,
							banks.chr[3] >> 8,
							banks.chr[4] & 0xFF,
							banks.chr[4] >> 8,
							banks.chr[5] & 0xFF,
							banks.chr[5] >> 8,
							banks.chr[6] & 0xFF,
							banks.chr[6] >> 8,
							banks.chr[7] & 0xFF,
							banks.chr[7] >> 8,
							banks.nmt[0] & 0xFF,
							banks.nmt[0] >> 8,
							banks.nmt[1] & 0xFF,
							banks.nmt[1] >> 8,
							banks.nmt[2] & 0xFF,
							banks.nmt[2] >> 8,
							banks.nmt[3] & 0xFF,
							banks.nmt[3] >> 8
						};

						state.Begin( AsciiId<'R','E','G'>::V ).Write( data ).End();
					}

					if (cartSwitches.IsPpuLatched())
						state.Begin( AsciiId<'L','A','T'>::V ).Write8( banks.chrLatch[0] | banks.chrLatch[1] << 3 ).End();

					{
						const byte data[5] =
						{
							irq.enabled != 0,
							irq.mode,
							irq.prescaler & 0xFF,
							irq.count,
							irq.flip
						};

						state.Begin( AsciiId<'I','R','Q'>::V ).Write( data ).End();
					}

					state.End();
				}
Esempio n. 14
0
		void Fds::SaveState(State::Saver& state,const dword baseChunk) const
		{
			state.Begin( baseChunk );

			{
				const byte data[4] =
				{
					io.ctrl,
					io.port,
					0,
					0
				};

				state.Begin( AsciiId<'I','O'>::V ).Write( data ).End();
			}

			adapter.SaveState( state );

			state.Begin( AsciiId<'R','A','M'>::V ).Compress( ram.mem ).End();
			state.Begin( AsciiId<'C','H','R'>::V ).Compress( ppu.GetChrMem().Source().Mem(), SIZE_8K ).End();

			{
				const byte data[4] =
				{
					static_cast<byte>(disks.sides.count),
					static_cast<byte>((disks.current != Disks::EJECTED) | (disks.writeProtected ? 0x2U : 0x0U)),
					static_cast<byte>(disks.current != Disks::EJECTED ? disks.current : 0xFF),
					static_cast<byte>(disks.current != Disks::EJECTED ? disks.mounting : 0)
				};

				state.Begin( AsciiId<'D','S','K'>::V ).Write( data ).End();
			}

			bool saveData = true;

			if (state.Internal())
			{
				Checksum recentChecksum;

				for (uint i=0; i < disks.sides.count; ++i)
					recentChecksum.Compute( disks.sides[i], SIDE_SIZE );

				if (checksum == recentChecksum)
					saveData = false;
				else
					checksum = recentChecksum;
			}

			if (saveData)
			{
				struct Dst
				{
					byte* const NST_RESTRICT mem;

					Dst() : mem(new byte [SIDE_SIZE]) {}
					~Dst() { delete [] mem; }
				};

				Dst dst;

				for (uint i=0; i < disks.sides.count; ++i)
				{
					const byte* const NST_RESTRICT src = disks.sides[i];

					for (uint j=0; j < SIDE_SIZE; ++j)
						dst.mem[j] = src[j] ^ 0xFFU;

					state.Begin( AsciiId<'D','0','A'>::R( 0, i / 2, i % 2 ) ).Compress( dst.mem, SIDE_SIZE ).End();
				}
			}
Esempio n. 15
0
				void Ks7022::SubSave(State::Saver& state) const
				{
					state.Begin( AsciiId<'K','7','2'>::V ).Begin( AsciiId<'R','E','G'>::V ).Write8( reg ).End().End();
				}