From 8167bff3c457d97541eada7a8a4ed7fe4a0beab6 Mon Sep 17 00:00:00 2001 From: nitsuja Date: Sat, 22 Aug 2009 19:03:15 +0000 Subject: [PATCH] mic: oops, well, trying to make the savestate stubs work for cross-platform loads for now --- desmume/src/mic.cpp | 4 +++- desmume/src/mic_alsa.cpp | 3 +++ desmume/src/windows/mic.cpp | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/desmume/src/mic.cpp b/desmume/src/mic.cpp index 95f6b89f9..c9211a602 100644 --- a/desmume/src/mic.cpp +++ b/desmume/src/mic.cpp @@ -22,9 +22,9 @@ #include "types.h" #include "mic.h" +#include "readwrite.h" static BOOL silence = TRUE; -int MicButtonPressed; BOOL Mic_Init() { @@ -54,10 +54,12 @@ void Mic_DoNoise(BOOL noise) void mic_savestate(std::ostream* os) { + write32le(-1,os); } bool mic_loadstate(std::istream* is, int size) { + is->seekg(size, std::ios::cur); return TRUE; } diff --git a/desmume/src/mic_alsa.cpp b/desmume/src/mic_alsa.cpp index a36cbd8b8..bcf971ccd 100644 --- a/desmume/src/mic_alsa.cpp +++ b/desmume/src/mic_alsa.cpp @@ -22,6 +22,7 @@ #include "types.h" #include "mic.h" #include "debug.h" +#include "readwrite.h" #define MIC_BUFSIZE 4096 @@ -150,9 +151,11 @@ u8 Mic_ReadSample() /* FIXME: stub! */ void mic_savestate(std::ostream* os) { + write32le(-1,os); } bool mic_loadstate(std::istream* is, int size) { + is->seekg(size, std::ios::cur); return TRUE; } diff --git a/desmume/src/windows/mic.cpp b/desmume/src/windows/mic.cpp index 3aec52f16..2fbbef14e 100644 --- a/desmume/src/windows/mic.cpp +++ b/desmume/src/windows/mic.cpp @@ -254,7 +254,7 @@ void mic_savestate(std::ostream* os) } bool mic_loadstate(std::istream* is, int size) { - int version; + u32 version; if(read32le(&version,is) != 1) return false; if(version > 0) { is->seekg(size-4, std::ios::cur); return true; }