mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
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:
parent
734586a0ab
commit
7a2cdef912
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -8,6 +8,7 @@ files = [
|
||||
"XFMemory.cpp",
|
||||
"XFBConvert.cpp",
|
||||
"Fifo.cpp",
|
||||
"VideoState.cpp",
|
||||
]
|
||||
|
||||
env_common = env.Copy()
|
||||
|
31
Source/Core/VideoCommon/Src/VideoState.cpp
Normal file
31
Source/Core/VideoCommon/Src/VideoState.cpp
Normal 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
|
||||
}
|
26
Source/Core/VideoCommon/Src/VideoState.h
Normal file
26
Source/Core/VideoCommon/Src/VideoState.h
Normal 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
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user