diff --git a/hbc/meta.xml b/hbc/meta.xml index 66ff2be..357e38a 100644 --- a/hbc/meta.xml +++ b/hbc/meta.xml @@ -2,8 +2,8 @@ Visual Boy Advance GX Tantric - 2.1.0 - 20091202 + 2.1.1 + 20091207 GBA/GBC/GB Emulator A port of Visual Boy Advance - M to the Wii. diff --git a/readme.txt b/readme.txt index 8d2c1f3..de309e3 100644 --- a/readme.txt +++ b/readme.txt @@ -1,7 +1,7 @@ ¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤ - Visual Boy Advance GX - - Version 2.1.0 + Version 2.1.1 http://code.google.com/p/vba-wii (Under GPL License) @@ -19,7 +19,7 @@ With it you can play GBA/Game Boy Color/Game Boy games on your Wii/GameCube. * IPS/UPS/PPF patch support * Custom controller configurations * SD, USB, DVD, SMB, Zip, and 7z support -* Compatiblity based on VBA-M r847 +* Compatiblity based on VBA-M r927 * MEM2 ROM Storage for fast access * Auto frame skip for those core heavy games * Turbo speed, video zooming, widescreen, and unfiltered video options @@ -28,6 +28,10 @@ With it you can play GBA/Game Boy Color/Game Boy games on your Wii/GameCube. |0O×øo· UPDATE HISTORY ·oø×O0| `¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨' +[2.1.1 - December 7, 2009] + +* Save state corruption issues fixed + [2.1.0 - December 2, 2009] * Fixed SMB (for real this time!) diff --git a/source/ngc/vba.h b/source/ngc/vba.h index a9a191b..df3d59d 100644 --- a/source/ngc/vba.h +++ b/source/ngc/vba.h @@ -16,7 +16,7 @@ #include "filelist.h" #define APPNAME "Visual Boy Advance GX" -#define APPVERSION "2.1.0" +#define APPVERSION "2.1.1" #define APPFOLDER "vbagx" #define PREF_FILE_NAME "settings.xml" #define PAL_FILE_NAME "palettes.xml" diff --git a/source/ngc/vbasupport.cpp b/source/ngc/vbasupport.cpp index 9fd7eb3..259eafc 100644 --- a/source/ngc/vbasupport.cpp +++ b/source/ngc/vbasupport.cpp @@ -259,7 +259,7 @@ int MemCPUWriteBatteryFile(char * membuffer) bool LoadBatteryOrState(char * filepath, int action, bool silent) { bool result = false; - size_t offset = 0; + int offset = 0; int device; if(!FindDevice(filepath, &device)) @@ -349,9 +349,9 @@ bool LoadBatteryOrStateAuto(int action, bool silent) bool SaveBatteryOrState(char * filepath, int action, bool silent) { bool result = false; - size_t offset = 0; - size_t datasize = 0; // we need the actual size of the data written - size_t imgSize = 0; // image screenshot bytes written + int offset = 0; + int datasize = 0; // we need the actual size of the data written + int imgSize = 0; // image screenshot bytes written int device; if(!FindDevice(filepath, &device)) @@ -394,7 +394,8 @@ bool SaveBatteryOrState(char * filepath, int action, bool silent) } else { - datasize = emulator.emuWriteMemState((char *)savebuffer, SAVEBUFFERSIZE); + if(emulator.emuWriteMemState((char *)savebuffer, SAVEBUFFERSIZE)) + datasize = *((int *)(savebuffer+4)) + 8; } // write savebuffer into file diff --git a/source/vba/System.h b/source/vba/System.h index 1490c80..733e3d0 100644 --- a/source/vba/System.h +++ b/source/vba/System.h @@ -25,7 +25,7 @@ struct EmulatedSystem { // load memory state (rewind) bool (*emuReadMemState)(char *, int); // write memory state (rewind) - int (*emuWriteMemState)(char *, int); + bool (*emuWriteMemState)(char *, int); // write PNG file bool (*emuWritePNG)(const char *); // write BMP file diff --git a/source/vba/apu/Blip_Buffer.cpp b/source/vba/apu/Blip_Buffer.cpp index c645252..bebb412 100644 --- a/source/vba/apu/Blip_Buffer.cpp +++ b/source/vba/apu/Blip_Buffer.cpp @@ -27,10 +27,17 @@ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ int const silent_buf_size = 1; // size used for Silent_Blip_Buffer -Blip_Buffer::Blip_Buffer(): - factor_(LONG_MAX), buffer_(0), buffer_size_(0), bass_shift_(0), - sample_rate_(0), clock_rate_(0), bass_freq_(16),length_(0) +Blip_Buffer::Blip_Buffer() { + factor_ = LONG_MAX; + buffer_ = 0; + buffer_size_ = 0; + sample_rate_ = 0; + bass_shift_ = 0; + clock_rate_ = 0; + bass_freq_ = 16; + length_ = 0; + // assumptions code makes about implementation-defined features #ifndef NDEBUG // right shift of negative value preserves sign @@ -196,13 +203,14 @@ void Blip_Synth_Fast_::volume_unit( double new_unit ) Blip_Synth_::Blip_Synth_( short* p, int w ) : impulses( p ), - width( w ), - volume_unit_(0.0), - kernel_unit(0), - buf(0), - last_amp(0), - delta_factor(0) -{} + width( w ) +{ + volume_unit_ = 0.0; + kernel_unit = 0; + buf = 0; + last_amp = 0; + delta_factor = 0; +} #undef PI #define PI 3.1415926535897932384626433832795029 diff --git a/source/vba/gb/GB.cpp b/source/vba/gb/GB.cpp index 75a9012..cc43c32 100644 --- a/source/vba/gb/GB.cpp +++ b/source/vba/gb/GB.cpp @@ -3550,23 +3550,24 @@ static bool gbWriteSaveState(gzFile gzFile) return true; } -int gbWriteMemSaveState(char *memory, int available) +bool gbWriteMemSaveState(char *memory, int available) { - int pos = 0; - gzFile gzFile = utilMemGzOpen(memory, available, "w"); + gzFile gzFile = utilMemGzOpen(memory, available, "w"); - if(gzFile == NULL) - return 0; + if(gzFile == NULL) { + return false; + } - if(gbWriteSaveState(gzFile)) - { - pos = utilGzMemTell(gzFile)+8; - - if(pos >= (available)) - pos = 0; - } - utilGzClose(gzFile); - return pos; + bool res = gbWriteSaveState(gzFile); + + long pos = utilGzMemTell(gzFile)+8; + + if(pos >= (available)) + res = false; + + utilGzClose(gzFile); + + return res; } bool gbWriteSaveState(const char *name) diff --git a/source/vba/gb/gb.h b/source/vba/gb/gb.h index c2f68ee..58712b3 100644 --- a/source/vba/gb/gb.h +++ b/source/vba/gb/gb.h @@ -30,7 +30,7 @@ bool gbWriteBatteryFile(const char *); bool gbWriteBatteryFile(const char *, bool); bool gbReadBatteryFile(const char *); bool gbWriteSaveState(const char *); -int gbWriteMemSaveState(char *, int); +bool gbWriteMemSaveState(char *, int); bool gbReadSaveState(const char *); bool gbReadMemSaveState(char *, int); void gbSgbRenderBorder(); diff --git a/source/vba/gba/Cheats.cpp b/source/vba/gba/Cheats.cpp index 90050a1..ffd7b85 100644 --- a/source/vba/gba/Cheats.cpp +++ b/source/vba/gba/Cheats.cpp @@ -1,4 +1,5 @@ #include +#include #include #include @@ -2677,6 +2678,8 @@ void cheatsReadGameSkip( gzFile file, int version ) utilGzSeek( file, sizeof( cheatsList ), SEEK_CUR ); } + bool firstCodeBreaker = true; + for( int i = 0; i < nCheats; i++ ) { if( version < 9 ) { utilGzSeek( file, ( 7 * sizeof(int) ) + ( 52 * sizeof(char) ), SEEK_CUR ); diff --git a/source/vba/gba/GBA.cpp b/source/vba/gba/GBA.cpp index 7624518..dd141db 100644 --- a/source/vba/gba/GBA.cpp +++ b/source/vba/gba/GBA.cpp @@ -634,23 +634,24 @@ bool CPUWriteState(const char *file) return res; } -int CPUWriteMemState(char *memory, int available) +bool CPUWriteMemState(char *memory, int available) { - int pos = 0; - gzFile gzFile = utilMemGzOpen(memory, available, "w"); + gzFile gzFile = utilMemGzOpen(memory, available, "w"); - if(gzFile == NULL) - return 0; + if(gzFile == NULL) { + return false; + } - if(CPUWriteState(gzFile)) - { - pos = utilGzMemTell(gzFile)+8; - - if(pos >= (available)) - pos = 0; - } - utilGzClose(gzFile); - return pos; + bool res = CPUWriteState(gzFile); + + long pos = utilGzMemTell(gzFile)+8; + + if(pos >= (available)) + res = false; + + utilGzClose(gzFile); + + return res; } static bool CPUReadState(gzFile gzFile) diff --git a/source/vba/gba/GBA.h b/source/vba/gba/GBA.h index c97cb60..33dee51 100644 --- a/source/vba/gba/GBA.h +++ b/source/vba/gba/GBA.h @@ -90,7 +90,7 @@ extern void CPUUpdateRender(); extern void CPUUpdateRenderBuffers(bool); extern bool CPUReadMemState(char *, int); extern bool CPUReadState(const char *); -extern int CPUWriteMemState(char *, int); +extern bool CPUWriteMemState(char *, int); extern bool CPUWriteState(const char *); extern int CPULoadRom(const char *); extern void doMirroring(bool); diff --git a/source/vba/gba/GBAGfx.cpp b/source/vba/gba/GBAGfx.cpp index b80676b..d73a93c 100644 --- a/source/vba/gba/GBAGfx.cpp +++ b/source/vba/gba/GBAGfx.cpp @@ -20,10 +20,6 @@ int gfxBG3Changed = 0; int gfxBG2X = 0; int gfxBG2Y = 0; -int gfxBG2LastX = 0; -int gfxBG2LastY = 0; int gfxBG3X = 0; int gfxBG3Y = 0; -int gfxBG3LastX = 0; -int gfxBG3LastY = 0; int gfxLastVCOUNT = 0; diff --git a/source/vba/gba/GBAGfx.h b/source/vba/gba/GBAGfx.h index 4eb44e9..4e55ff2 100644 --- a/source/vba/gba/GBAGfx.h +++ b/source/vba/gba/GBAGfx.h @@ -87,12 +87,8 @@ extern int gfxBG3Changed; extern int gfxBG2X; extern int gfxBG2Y; -extern int gfxBG2LastX; -extern int gfxBG2LastY; extern int gfxBG3X; extern int gfxBG3Y; -extern int gfxBG3LastX; -extern int gfxBG3LastY; extern int gfxLastVCOUNT; static inline void gfxClearArray(u32 *array) diff --git a/source/vba/gba/Globals.cpp b/source/vba/gba/Globals.cpp index 2ba581b..d579cd2 100644 --- a/source/vba/gba/Globals.cpp +++ b/source/vba/gba/Globals.cpp @@ -40,15 +40,15 @@ bool skipSaveGameCheats = false; // 0x0000 to 0x7FFF: set custom 15 bit color int customBackdropColor = -1; -u8 *bios = NULL; -u8 *rom = NULL; -u8 *internalRAM = NULL; -u8 *workRAM = NULL; -u8 *paletteRAM = NULL; -u8 *vram = NULL; -u8 *pix = NULL; -u8 *oam = NULL; -u8 *ioMem = NULL; +u8 *bios = 0; +u8 *rom = 0; +u8 *internalRAM = 0; +u8 *workRAM = 0; +u8 *paletteRAM = 0; +u8 *vram = 0; +u8 *pix = 0; +u8 *oam = 0; +u8 *ioMem = 0; u16 DISPCNT = 0x0080; u16 DISPSTAT = 0x0000; diff --git a/source/vba/gba/Sound.cpp b/source/vba/gba/Sound.cpp index 5f31364..025ec03 100644 --- a/source/vba/gba/Sound.cpp +++ b/source/vba/gba/Sound.cpp @@ -543,6 +543,13 @@ bool soundInit() return true; } +void soundSetThrottle(unsigned short throttle) +{ + if(!soundDriver) + return; + soundDriver->setThrottle(throttle); +} + long soundGetSampleRate() { return soundSampleRate; diff --git a/source/vba/gba/Sound.h b/source/vba/gba/Sound.h index 24e8e72..3a48c00 100644 --- a/source/vba/gba/Sound.h +++ b/source/vba/gba/Sound.h @@ -11,6 +11,9 @@ // current value in soundQuality global. bool soundInit(); +// sets the Sound throttle +void soundSetThrottle(unsigned short throttle); + // Manages sound volume, where 1.0 is normal void soundSetVolume( float ); float soundGetVolume(); diff --git a/source/vba/gba/bios.cpp b/source/vba/gba/bios.cpp index efdb46d..f62f37f 100644 --- a/source/vba/gba/bios.cpp +++ b/source/vba/gba/bios.cpp @@ -781,7 +781,7 @@ void BIOS_LZ77UnCompWram() int length = (data >> 12) + 3; int offset = (data & 0x0FFF); u32 windowOffset = dest - offset - 1; - for(int i = 0; i < length; i++) { + for(int i2 = 0; i2 < length; i2++) { CPUWriteByte(dest++, CPUReadByte(windowOffset++)); len--; if(len == 0) diff --git a/update.xml b/update.xml index 221da8b..bbfd2f6 100644 --- a/update.xml +++ b/update.xml @@ -1,4 +1,4 @@ - - + +