Files
dolphin/Source/Core/VideoBackends/Software/CPMemLoader.cpp
T

61 lines
1.4 KiB
C++
Raw Normal View History

// Copyright 2009 Dolphin Emulator Project
2015-05-18 01:08:10 +02:00
// Licensed under GPLv2+
// Refer to the license.txt file included.
2010-06-09 01:37:08 +00:00
#include "Common/CommonFuncs.h"
2014-02-17 05:18:15 -05:00
#include "Core/HW/Memmap.h"
#include "VideoBackends/Software/CPMemLoader.h"
#include "VideoCommon/VideoCommon.h"
2010-06-09 01:37:08 +00:00
void SWLoadCPReg(u32 sub_cmd, u32 value)
2010-06-09 01:37:08 +00:00
{
switch (sub_cmd & 0xF0)
2010-06-09 01:37:08 +00:00
{
case 0x30:
g_main_cp_state.matrix_index_a.Hex = value;
2010-06-09 01:37:08 +00:00
break;
case 0x40:
g_main_cp_state.matrix_index_b.Hex = value;
2010-06-09 01:37:08 +00:00
break;
case 0x50:
g_main_cp_state.vtx_desc.Hex &= ~0x1FFFF; // keep the Upper bits
g_main_cp_state.vtx_desc.Hex |= value;
2015-05-30 03:58:27 +12:00
g_main_cp_state.bases_dirty = true;
2010-06-09 01:37:08 +00:00
break;
case 0x60:
g_main_cp_state.vtx_desc.Hex &= 0x1FFFF; // keep the lower 17Bits
g_main_cp_state.vtx_desc.Hex |= (u64)value << 17;
2015-05-30 03:58:27 +12:00
g_main_cp_state.bases_dirty = true;
2010-06-09 01:37:08 +00:00
break;
case 0x70:
_assert_((sub_cmd & 0x0F) < 8);
g_main_cp_state.vtx_attr[sub_cmd & 7].g0.Hex = value;
2010-06-09 01:37:08 +00:00
break;
case 0x80:
_assert_((sub_cmd & 0x0F) < 8);
g_main_cp_state.vtx_attr[sub_cmd & 7].g1.Hex = value;
2010-06-09 01:37:08 +00:00
break;
case 0x90:
_assert_((sub_cmd & 0x0F) < 8);
g_main_cp_state.vtx_attr[sub_cmd & 7].g2.Hex = value;
2010-06-09 01:37:08 +00:00
break;
// Pointers to vertex arrays in GC RAM
case 0xA0:
g_main_cp_state.array_bases[sub_cmd & 0xF] = value;
2015-05-30 03:58:27 +12:00
g_main_cp_state.bases_dirty = true;
2010-06-09 01:37:08 +00:00
break;
case 0xB0:
g_main_cp_state.array_strides[sub_cmd & 0xF] = value & 0xFF;
2010-06-09 01:37:08 +00:00
break;
}
}