From 14c011d8de92f98904173697eba6a83301bbc93a Mon Sep 17 00:00:00 2001 From: zeromus Date: Mon, 21 Sep 2009 17:10:52 +0000 Subject: [PATCH] fix gcc compiling --- desmume/src/MMU.cpp | 9 +++++---- desmume/src/MMU.h | 8 ++++---- desmume/src/readwrite.h | 16 +++++++++------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index d3da537a6..9a2d3be4a 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -1904,10 +1904,11 @@ bool DmaController::loadstate(EMUFILE* f) read8le(&enable,f); read8le(&irq,f); read8le(&repeatMode,f); read8le(&_startmode,f); read8le(&userEnable,f); read32le(&wordcount,f); - readle(&startmode,f); - readle(&bitWidth,f); - readle(&sar,f); - readle(&dar,f); + u8 temp; + read8le(&temp,f); startmode = (EDMAMode)temp; + read8le(&temp,f); bitWidth = (EDMABitWidth)temp; + read8le(&temp,f); sar = (EDMASourceUpdate)temp; + read8le(&temp,f); dar = (EDMADestinationUpdate)temp; read32le(&saddr,f); read32le(&daddr,f); read32le(&check,f); read32le(&running,f); read32le(&paused,f); read32le(&triggered,f); read64le(&nextEvent,f); diff --git a/desmume/src/MMU.h b/desmume/src/MMU.h index c9e190767..c214b9401 100644 --- a/desmume/src/MMU.h +++ b/desmume/src/MMU.h @@ -38,7 +38,7 @@ typedef const u8 TWaitState; -enum EDMAMode : u8 +enum EDMAMode { EDMAMode_Immediate = 0, EDMAMode_VBlank = 1, @@ -52,13 +52,13 @@ enum EDMAMode : u8 EDMAMode7_GBASlot = 9, }; -enum EDMABitWidth : u8 +enum EDMABitWidth { EDMABitWidth_16 = 0, EDMABitWidth_32 = 1 }; -enum EDMASourceUpdate : u8 +enum EDMASourceUpdate { EDMASourceUpdate_Increment = 0, EDMASourceUpdate_Decrement = 1, @@ -66,7 +66,7 @@ enum EDMASourceUpdate : u8 EDMASourceUpdate_Invalid = 3, }; -enum EDMADestinationUpdate : u8 +enum EDMADestinationUpdate { EDMADestinationUpdate_Increment = 0, EDMADestinationUpdate_Decrement = 1, diff --git a/desmume/src/readwrite.h b/desmume/src/readwrite.h index c20e1baa4..b5b684bf8 100644 --- a/desmume/src/readwrite.h +++ b/desmume/src/readwrite.h @@ -32,6 +32,15 @@ int write16le(u16 b, EMUFILE* os); int write32le(u32 b, EMUFILE* os); int write64le(u64 b, EMUFILE* os); +int read8le(u8 *Bufo, EMUFILE*is); +int read16le(u16 *Bufo, EMUFILE*is); +inline int read16le(s16 *Bufo, EMUFILE*is) { return read16le((u16*)Bufo,is); } +int read32le(u32 *Bufo, EMUFILE*is); +inline int read32le(s32 *Bufo, EMUFILE*is) { return read32le((u32*)Bufo,is); } +int read64le(u64 *Bufo, EMUFILE*is); +int read16le(u16 *Bufo, std::istream *is); + + template int readle(T *Bufo, EMUFILE*is) { @@ -47,13 +56,6 @@ int readle(T *Bufo, EMUFILE*is) } -int read8le(u8 *Bufo, EMUFILE*is); -int read16le(u16 *Bufo, EMUFILE*is); -inline int read16le(s16 *Bufo, EMUFILE*is) { return read16le((u16*)Bufo,is); } -int read32le(u32 *Bufo, EMUFILE*is); -inline int read32le(s32 *Bufo, EMUFILE*is) { return read32le((u32*)Bufo,is); } -int read64le(u64 *Bufo, EMUFILE*is); -int read16le(u16 *Bufo, std::istream *is); int readbool(bool *b, EMUFILE* is); void writebool(bool b, EMUFILE* os);