Exemplo n.º 1
0
void AXUCode::ProcessPBList(u32 pb_addr)
{
  // Samples per millisecond. In theory DSP sampling rate can be changed from
  // 32KHz to 48KHz, but AX always process at 32KHz.
  const u32 spms = 32;

  AXPB pb;

  while (pb_addr)
  {
    AXBuffers buffers = {{m_samples_left, m_samples_right, m_samples_surround, m_samples_auxA_left,
                          m_samples_auxA_right, m_samples_auxA_surround, m_samples_auxB_left,
                          m_samples_auxB_right, m_samples_auxB_surround}};

    ReadPB(pb_addr, pb);

    u32 updates_addr = HILO_TO_32(pb.updates.data);
    u16* updates = (u16*)HLEMemory_Get_Pointer(updates_addr);

    for (int curr_ms = 0; curr_ms < 5; ++curr_ms)
    {
      ApplyUpdatesForMs(curr_ms, (u16*)&pb, pb.updates.num_updates, updates);

      ProcessVoice(pb, buffers, spms, ConvertMixerControl(pb.mixer_control),
                   m_coeffs_available ? m_coeffs : nullptr);

      // Forward the buffers
      for (size_t i = 0; i < ArraySize(buffers.ptrs); ++i)
        buffers.ptrs[i] += spms;
    }

    WritePB(pb_addr, pb);
    pb_addr = HILO_TO_32(pb.next_pb);
  }
}
Exemplo n.º 2
0
void AXWiiUCode::ProcessPBList(u32 pb_addr)
{
	AXPBWii pb;

	while (pb_addr)
	{
		AXBuffers buffers = {{
			m_samples_left,
			m_samples_right,
			m_samples_surround,
			m_samples_auxA_left,
			m_samples_auxA_right,
			m_samples_auxA_surround,
			m_samples_auxB_left,
			m_samples_auxB_right,
			m_samples_auxB_surround,
			m_samples_auxC_left,
			m_samples_auxC_right,
			m_samples_auxC_surround,
			m_samples_wm0,
			m_samples_aux0,
			m_samples_wm1,
			m_samples_aux1,
			m_samples_wm2,
			m_samples_aux2,
			m_samples_wm3,
			m_samples_aux3
		}};

		ReadPB(pb_addr, pb);

		u16 num_updates[3];
		u16 updates[1024];
		u32 updates_addr;
		if (ExtractUpdatesFields(pb, num_updates, updates, &updates_addr))
		{
			for (int curr_ms = 0; curr_ms < 3; ++curr_ms)
			{
				ApplyUpdatesForMs(curr_ms, (u16*)&pb, num_updates, updates);
				ProcessVoice(pb, buffers, 32,
				             ConvertMixerControl(HILO_TO_32(pb.mixer_control)),
				             m_coeffs_available ? m_coeffs : nullptr);

				// Forward the buffers
				for (size_t i = 0; i < ArraySize(buffers.ptrs); ++i)
					buffers.ptrs[i] += 32;
			}
			ReinjectUpdatesFields(pb, num_updates, updates_addr);
		}
		else
		{
			ProcessVoice(pb, buffers, 96,
			             ConvertMixerControl(HILO_TO_32(pb.mixer_control)),
			             m_coeffs_available ? m_coeffs : nullptr);
		}

		WritePB(pb_addr, pb);
		pb_addr = HILO_TO_32(pb.next_pb);
	}
}
Exemplo n.º 3
0
void CUCode_AX::ProcessPBList(u32 pb_addr)
{
	// Samples per millisecond. In theory DSP sampling rate can be changed from
	// 32KHz to 48KHz, but AX always process at 32KHz.
	const u32 spms = 32;

	AXPB pb;

	while (pb_addr)
	{
		AXBuffers buffers = {{
			m_samples_left,
			m_samples_right,
			m_samples_surround,
			m_samples_auxA_left,
			m_samples_auxA_right,
			m_samples_auxA_surround,
			m_samples_auxB_left,
			m_samples_auxB_right,
			m_samples_auxB_surround
		}};

		if (!ReadPB(pb_addr, pb))
			break;

		for (int curr_ms = 0; curr_ms < 5; ++curr_ms)
		{
			ApplyUpdatesForMs(pb, curr_ms);

			Process1ms(pb, buffers, ConvertMixerControl(pb.mixer_control));

			// Forward the buffers
			for (u32 i = 0; i < sizeof (buffers.ptrs) / sizeof (buffers.ptrs[0]); ++i)
				buffers.ptrs[i] += spms;
		}

		WritePB(pb_addr, pb);
		pb_addr = HILO_TO_32(pb.next_pb);
	}
}