コード例 #1
0
ファイル: i8008.c プロジェクト: AltimorTASDK/shmupmametgm
INLINE UINT8 ARG(i8008_state *cpustate)
{
	UINT8 retVal = memory_raw_read_byte(cpustate->program, GET_PC.w.l);
	GET_PC.w.l = (GET_PC.w.l + 1) & 0x3fff;
	cpustate->PC = GET_PC;
	return retVal;
}
コード例 #2
0
ファイル: okim6295.c プロジェクト: DarrenBranford/MAME4iOS
void okim6295_device::data_write(UINT8 data)
{
	// if a command is pending, process the second half
	if (m_command != -1)
	{
		// the manual explicitly says that it's not possible to start multiple voices at the same time
		int voicemask = data >> 4;
		if (voicemask != 0 && voicemask != 1 && voicemask != 2 && voicemask != 4 && voicemask != 8)
			popmessage("OKI6295 start %x contact MAMEDEV", voicemask);

		// update the stream
		stream_update(m_stream);

		// determine which voice(s) (voice is set by a 1 bit in the upper 4 bits of the second byte)
		for (int voicenum = 0; voicenum < OKIM6295_VOICES; voicenum++, voicemask >>= 1)
			if (voicemask & 1)
			{
				okim_voice &voice = m_voice[voicenum];

				// determine the start/stop positions
				offs_t base = m_command * 8;

				offs_t start = memory_raw_read_byte(space(), base + 0) << 16;
				start |= memory_raw_read_byte(space(), base + 1) << 8;
				start |= memory_raw_read_byte(space(), base + 2) << 0;
				start &= 0x3ffff;

				offs_t stop = memory_raw_read_byte(space(), base + 3) << 16;
				stop |= memory_raw_read_byte(space(), base + 4) << 8;
				stop |= memory_raw_read_byte(space(), base + 5) << 0;
				stop &= 0x3ffff;

				// set up the voice to play this sample
				if (start < stop)
				{
					if (!voice.m_playing) // fixes Got-cha and Steel Force
					{
						voice.m_playing = true;
						voice.m_base_offset = start;
						voice.m_sample = 0;
						voice.m_count = 2 * (stop - start + 1);

						// also reset the ADPCM parameters
						voice.m_adpcm.reset();
						voice.m_volume = s_volume_table[data & 0x0f];
					}
					else
						logerror("OKIM6295:'%s' requested to play sample %02x on non-stopped voice\n",tag(),m_command);
				}

				// invalid samples go here
				else
				{
					logerror("OKIM6295:'%s' requested to play invalid sample %02x\n",tag(),m_command);
					voice.m_playing = false;
				}
			}

		// reset the command
		m_command = -1;
	}
コード例 #3
0
ファイル: m4510.c プロジェクト: nitrologic/emu
INLINE int m4510_cpu_readop_arg(m4510_Regs *cpustate)
{
	register UINT16 t=cpustate->pc.w.l++;
	return memory_raw_read_byte(cpustate->space, M4510_MEM(t));
}