Example #1
0
static void ApplyUpdatesForMs(AXPB& pb, int curr_ms)
{
	u32 start_idx = 0;
	for (int i = 0; i < curr_ms; ++i)
		start_idx += pb.updates.num_updates[i];

	u32 update_addr = HILO_TO_32(pb.updates.data);
	for (u32 i = start_idx; i < start_idx + pb.updates.num_updates[curr_ms]; ++i)
	{
		u16 update_off = HLEMemory_Read_U16(update_addr + 4 * i);
		u16 update_val = HLEMemory_Read_U16(update_addr + 4 * i + 2);

		((u16*)&pb)[update_off] = update_val;
	}
}
Example #2
0
void AXUCode::SetupProcessing(u32 init_addr)
{
  u16 init_data[0x20];

  for (u32 i = 0; i < 0x20; ++i)
    init_data[i] = HLEMemory_Read_U16(init_addr + 2 * i);

  // List of all buffers we have to initialize
  int* 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};

  u32 init_idx = 0;
  for (auto& buffer : buffers)
  {
    s32 init_val = (s32)((init_data[init_idx] << 16) | init_data[init_idx + 1]);
    s16 delta = (s16)init_data[init_idx + 2];

    init_idx += 3;

    if (!init_val)
    {
      memset(buffer, 0, 5 * 32 * sizeof(int));
    }
    else
    {
      for (u32 j = 0; j < 32 * 5; ++j)
      {
        buffer[j] = init_val;
        init_val += delta;
      }
    }
  }
}
Example #3
0
void AXWiiUCode::SetupProcessing(u32 init_addr)
{
	// TODO: should be easily factorizable with AX
	s16 init_data[60];

	for (u32 i = 0; i < 60; ++i)
		init_data[i] = HLEMemory_Read_U16(init_addr + 2 * i);

	// List of all buffers we have to initialize
	struct
	{
		int* ptr;
		u32 samples;
	} buffers[] = {
		{ m_samples_left, 32 },
		{ m_samples_right, 32 },
		{ m_samples_surround, 32 },
		{ m_samples_auxA_left, 32 },
		{ m_samples_auxA_right, 32 },
		{ m_samples_auxA_surround, 32 },
		{ m_samples_auxB_left, 32 },
		{ m_samples_auxB_right, 32 },
		{ m_samples_auxB_surround, 32 },
		{ m_samples_auxC_left, 32 },
		{ m_samples_auxC_right, 32 },
		{ m_samples_auxC_surround, 32 },

		{ m_samples_wm0, 6 },
		{ m_samples_aux0, 6 },
		{ m_samples_wm1, 6 },
		{ m_samples_aux1, 6 },
		{ m_samples_wm2, 6 },
		{ m_samples_aux2, 6 },
		{ m_samples_wm3, 6 },
		{ m_samples_aux3, 6 }
	};

	u32 init_idx = 0;
	for (auto& buffer : buffers)
	{
		s32 init_val = (s32)((init_data[init_idx] << 16) | init_data[init_idx + 1]);
		s16 delta = (s16)init_data[init_idx + 2];

		init_idx += 3;

		if (!init_val)
		{
			memset(buffer.ptr, 0, 3 * buffer.samples * sizeof (int));
		}
		else
		{
			for (u32 j = 0; j < 3 * buffer.samples; ++j)
			{
				buffer.ptr[j] = init_val;
				init_val += delta;
			}
		}
	}
}
Example #4
0
void CUCode_AX::CopyCmdList(u32 addr, u16 size)
{
	if (size >= (sizeof (m_cmdlist) / sizeof (u16)))
	{
		ERROR_LOG(DSPHLE, "Command list at %08x is too large: size=%d", addr, size);
		return;
	}

	for (u32 i = 0; i < size; ++i, addr += 2)
		m_cmdlist[i] = HLEMemory_Read_U16(addr);
	m_cmdlist_size = size;
}