Preliminary video save state support. More work is necessary, this is just some infrastructure for inter-project communication.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@332 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY 2008-08-26 23:40:18 +00:00
parent 734586a0ab
commit 7a2cdef912
10 changed files with 138 additions and 1 deletions

View File

@ -410,6 +410,14 @@ EState GetState()
return CORE_UNINITIALIZED;
}
void SaveState() {
PluginVideo::Video_SaveState();
}
void LoadState() {
PluginVideo::Video_LoadState();
}
const SCoreStartupParameter& GetStartupParameter()
{
return g_CoreStartupParameter;

View File

@ -42,6 +42,10 @@ namespace Core
// Get state
EState GetState();
// Save/Load state
void SaveState();
void LoadState();
// get core parameters
extern SCoreStartupParameter g_CoreStartupParameter; //uck
const SCoreStartupParameter& GetStartupParameter();

View File

@ -35,6 +35,8 @@ typedef void (__cdecl* TVideo_EnterLoop)();
typedef void (__cdecl* TVideo_AddMessage)(const char* pstr, unsigned int milliseconds);
typedef void (__cdecl* TVideo_SaveState)();
typedef void (__cdecl* TVideo_LoadState)();
//! Function Pointer
TGetDllInfo g_GetDllInfo = 0;
@ -48,6 +50,8 @@ TVideo_UpdateXFB g_Video_UpdateXFB = 0;
TVideo_Screenshot g_Video_Screenshot = 0;
TVideo_EnterLoop g_Video_EnterLoop = 0;
TVideo_AddMessage g_Video_AddMessage = 0;
TVideo_SaveState g_Video_SaveState = 0;
TVideo_LoadState g_Video_LoadState = 0;
//! Library Instance
DynamicLibrary plugin;
@ -69,6 +73,8 @@ void UnloadPlugin()
g_Video_SendFifoData = 0;
g_Video_UpdateXFB = 0;
g_Video_AddMessage = 0;
g_Video_SaveState = 0;
g_Video_LoadState = 0;
plugin.Unload();
}
@ -88,6 +94,8 @@ bool LoadPlugin(const char *_Filename)
g_Video_Screenshot = reinterpret_cast<TVideo_Screenshot> (plugin.Get("Video_Screenshot"));
g_Video_EnterLoop = reinterpret_cast<TVideo_EnterLoop> (plugin.Get("Video_EnterLoop"));
g_Video_AddMessage = reinterpret_cast<TVideo_AddMessage> (plugin.Get("Video_AddMessage"));
g_Video_SaveState = reinterpret_cast<TVideo_SaveState> (plugin.Get("Video_SaveState"));
g_Video_LoadState = reinterpret_cast<TVideo_LoadState> (plugin.Get("Video_LoadState"));
if ((g_GetDllInfo != 0) &&
(g_DllAbout != 0) &&
@ -99,7 +107,9 @@ bool LoadPlugin(const char *_Filename)
(g_Video_UpdateXFB != 0) &&
(g_Video_EnterLoop != 0) &&
(g_Video_Screenshot != 0) &&
(g_Video_AddMessage != 0))
(g_Video_AddMessage != 0) &&
(g_Video_SaveState != 0) &&
(g_Video_LoadState != 0))
{
return true;
}
@ -171,4 +181,12 @@ void Video_AddMessage(const char* pstr, unsigned int milliseconds)
g_Video_AddMessage(pstr,milliseconds);
}
void Video_SaveState() {
g_Video_SaveState();
}
void Video_LoadState() {
g_Video_SaveState();
}
} // end of namespace PluginVideo

View File

@ -42,6 +42,9 @@ void Video_UpdateXFB(BYTE* _pXFB, DWORD _dwHeight, DWORD _dwWidth);
bool Video_Screenshot(TCHAR* _szFilename);
void Video_AddMessage(const char* pstr, unsigned int milliseconds);
void Video_SaveState();
void Video_LoadState();
} // end of namespace PluginVideo
#endif

View File

@ -8,6 +8,7 @@ files = [
"XFMemory.cpp",
"XFBConvert.cpp",
"Fifo.cpp",
"VideoState.cpp",
]
env_common = env.Copy()

View File

@ -0,0 +1,31 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "VideoState.h"
#include "TextureDecoder.h"
void VideoCommon_SaveState() {
#ifdef WIN32
MessageBoxA(NULL, "SAVING STATE", "From Common Video Library", NULL);
#endif
}
void VideoCommon_LoadState() {
#ifdef WIN32
MessageBoxA(NULL, "LOADING STATE", "From Common Video Library", NULL);
#endif
}

View File

@ -0,0 +1,26 @@
// Copyright (C) 2003-2008 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, version 2.0.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License 2.0 for more details.
// A copy of the GPL 2.0 should have been included with the program.
// If not, see http://www.gnu.org/licenses/
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#ifndef __VIDEOSTATE_H
#define __VIDEOSTATE_H
#include "Common.h"
void VideoCommon_SaveState();
void VideoCommon_LoadState();
#endif

View File

@ -177,6 +177,22 @@ EXPORT void CALL Video_EnterLoop(void);
//
EXPORT void CALL Video_AddMessage(const char* pstr, unsigned int milliseconds);
// __________________________________________________________________________________________________
// Function: Video_SaveState
// Purpose: Saves the current video data state
// input: The chunkfile to write to? FIXME
// output: none
//
EXPORT void CALL Video_SaveState();
// __________________________________________________________________________________________________
// Function: Video_LoadState
// Purpose: Loads the current video data state
// input: The chunkfile to read from? FIXME
// output: none
//
EXPORT void CALL Video_LoadState();
#undef CALL
#if defined(__cplusplus)

View File

@ -20,6 +20,7 @@
#include "D3DUtil.h"
#include "W32Util/Misc.h"
#include "EmuWindow.h"
#include "VideoState.h"
#include "Utils.h"
@ -165,6 +166,20 @@ void Video_Initialize(SVideoInitialize* _pVideoInitialize)
}
void Video_SaveState() {
VideoCommon_SaveState();
#ifdef WIN32
MessageBoxA(NULL, "SAVING STATE", "From DirectX", NULL);
#endif
}
void Video_LoadState() {
VideoCommon_LoadState();
#ifdef WIN32
MessageBoxA(NULL, "LOADING STATE", "From DirectX", NULL);
#endif
}
void Video_EnterLoop()
{
Fifo_EnterLoop(g_VideoInitialize);

View File

@ -37,6 +37,8 @@
#include "PixelShaderManager.h"
#include "VertexShaderManager.h"
#include "VideoState.h"
SVideoInitialize g_VideoInitialize;
#define VERSION_STRING "0.1"
@ -177,6 +179,19 @@ void Video_Initialize(SVideoInitialize* _pVideoInitialize)
}
void Video_SaveState() {
VideoCommon_SaveState();
#ifdef WIN32
MessageBoxA(NULL, "SAVING STATE", "From OpenGL", NULL);
#endif
}
void Video_LoadState() {
VideoCommon_LoadState();
#ifdef WIN32
MessageBoxA(NULL, "LOADING STATE", "From OpenGL", NULL);
#endif
}
void Video_Prepare(void)
{