2015-05-24 07:55:12 +03:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2015-05-18 02:08:10 +03:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 06:09:55 +03:00
|
|
|
// Refer to the license.txt file included.
|
2008-12-08 07:30:24 +02:00
|
|
|
|
2016-01-17 23:54:31 +02:00
|
|
|
#include <cstring>
|
|
|
|
|
2014-07-30 03:55:07 +03:00
|
|
|
#include "Common/ChunkFile.h"
|
2014-09-17 04:04:37 +03:00
|
|
|
#include "VideoCommon/BoundingBox.h"
|
2014-02-17 12:18:15 +02:00
|
|
|
#include "VideoCommon/BPMemory.h"
|
2014-02-19 03:27:20 +02:00
|
|
|
#include "VideoCommon/CommandProcessor.h"
|
2014-02-17 12:18:15 +02:00
|
|
|
#include "VideoCommon/CPMemory.h"
|
|
|
|
#include "VideoCommon/Fifo.h"
|
2014-12-14 22:23:13 +02:00
|
|
|
#include "VideoCommon/GeometryShaderManager.h"
|
2014-02-17 12:18:15 +02:00
|
|
|
#include "VideoCommon/PixelEngine.h"
|
|
|
|
#include "VideoCommon/PixelShaderManager.h"
|
|
|
|
#include "VideoCommon/TextureDecoder.h"
|
|
|
|
#include "VideoCommon/VertexManagerBase.h"
|
|
|
|
#include "VideoCommon/VertexShaderManager.h"
|
|
|
|
#include "VideoCommon/VideoState.h"
|
2014-02-19 03:27:20 +02:00
|
|
|
#include "VideoCommon/XFMemory.h"
|
2008-12-08 07:30:24 +02:00
|
|
|
|
2016-01-12 23:46:44 +02:00
|
|
|
void VideoCommon_DoState(PointerWrap &p)
|
2008-12-08 07:30:24 +02:00
|
|
|
{
|
2013-03-20 03:51:12 +02:00
|
|
|
// BP Memory
|
|
|
|
p.Do(bpmem);
|
2012-01-01 23:52:31 +02:00
|
|
|
p.DoMarker("BP Memory");
|
|
|
|
|
|
|
|
// CP Memory
|
2014-08-27 20:26:06 +03:00
|
|
|
DoCPState(p);
|
2008-12-08 07:30:24 +02:00
|
|
|
|
2013-03-20 03:51:12 +02:00
|
|
|
// XF Memory
|
2014-04-27 21:59:04 +03:00
|
|
|
p.Do(xfmem);
|
2012-01-01 23:52:31 +02:00
|
|
|
p.DoMarker("XF Memory");
|
|
|
|
|
|
|
|
// Texture decoder
|
2015-09-29 19:35:30 +03:00
|
|
|
p.DoArray(texMem);
|
2012-01-01 23:52:31 +02:00
|
|
|
p.DoMarker("texMem");
|
2013-10-29 07:23:17 +02:00
|
|
|
|
2013-03-20 03:51:12 +02:00
|
|
|
// FIFO
|
2016-01-12 23:44:58 +02:00
|
|
|
Fifo::DoState(p);
|
2012-01-01 23:52:31 +02:00
|
|
|
p.DoMarker("Fifo");
|
2009-10-11 00:19:39 +03:00
|
|
|
|
2013-03-20 03:51:12 +02:00
|
|
|
CommandProcessor::DoState(p);
|
2012-01-01 23:52:31 +02:00
|
|
|
p.DoMarker("CommandProcessor");
|
|
|
|
|
|
|
|
PixelEngine::DoState(p);
|
|
|
|
p.DoMarker("PixelEngine");
|
2012-01-01 22:46:02 +02:00
|
|
|
|
|
|
|
// the old way of replaying current bpmem as writes to push side effects to pixel shader manager doesn't really work.
|
|
|
|
PixelShaderManager::DoState(p);
|
2012-01-01 23:52:31 +02:00
|
|
|
p.DoMarker("PixelShaderManager");
|
|
|
|
|
2012-01-01 22:46:02 +02:00
|
|
|
VertexShaderManager::DoState(p);
|
2012-01-01 23:52:31 +02:00
|
|
|
p.DoMarker("VertexShaderManager");
|
2012-01-01 22:46:02 +02:00
|
|
|
|
2014-12-14 22:23:13 +02:00
|
|
|
GeometryShaderManager::DoState(p);
|
|
|
|
p.DoMarker("GeometryShaderManager");
|
|
|
|
|
2015-11-01 23:54:41 +02:00
|
|
|
VertexManagerBase::DoState(p);
|
2012-01-04 10:42:22 +02:00
|
|
|
p.DoMarker("VertexManager");
|
|
|
|
|
2014-09-14 19:52:51 +03:00
|
|
|
BoundingBox::DoState(p);
|
|
|
|
p.DoMarker("BoundingBox");
|
|
|
|
|
|
|
|
|
2012-01-01 22:46:02 +02:00
|
|
|
// TODO: search for more data that should be saved and add it here
|
2008-12-08 07:30:24 +02:00
|
|
|
}
|
|
|
|
|
2012-01-02 12:20:22 +02:00
|
|
|
void VideoCommon_Init()
|
|
|
|
{
|
2014-08-27 20:26:06 +03:00
|
|
|
memset(&g_main_cp_state, 0, sizeof(g_main_cp_state));
|
2014-08-27 20:38:00 +03:00
|
|
|
memset(&g_preprocess_cp_state, 0, sizeof(g_preprocess_cp_state));
|
2012-01-02 12:20:22 +02:00
|
|
|
memset(texMem, 0, TMEM_SIZE);
|
|
|
|
}
|