fix save states, sync with VBA-M, finalize 2.1.1

This commit is contained in:
dborth 2009-12-07 08:24:05 +00:00
parent 178a26e23f
commit 0f6d0f7b1b
18 changed files with 91 additions and 71 deletions

View File

@ -2,8 +2,8 @@
<app version="1">
<name>Visual Boy Advance GX</name>
<coder>Tantric</coder>
<version>2.1.0</version>
<release_date>20091202</release_date>
<version>2.1.1</version>
<release_date>20091207</release_date>
<short_description>GBA/GBC/GB Emulator</short_description>
<long_description>A port of Visual Boy Advance - M to the Wii.</long_description>
</app>

View File

@ -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!)

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;
bool res = gbWriteSaveState(gzFile);
if(pos >= (available))
pos = 0;
}
utilGzClose(gzFile);
return pos;
long pos = utilGzMemTell(gzFile)+8;
if(pos >= (available))
res = false;
utilGzClose(gzFile);
return res;
}
bool gbWriteSaveState(const char *name)

View File

@ -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();

View File

@ -1,4 +1,5 @@
#include <string.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
@ -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 );

View File

@ -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;
bool res = CPUWriteState(gzFile);
if(pos >= (available))
pos = 0;
}
utilGzClose(gzFile);
return pos;
long pos = utilGzMemTell(gzFile)+8;
if(pos >= (available))
res = false;
utilGzClose(gzFile);
return res;
}
static bool CPUReadState(gzFile gzFile)

View File

@ -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);

View File

@ -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;

View File

@ -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)

View File

@ -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;

View File

@ -543,6 +543,13 @@ bool soundInit()
return true;
}
void soundSetThrottle(unsigned short throttle)
{
if(!soundDriver)
return;
soundDriver->setThrottle(throttle);
}
long soundGetSampleRate()
{
return soundSampleRate;

View File

@ -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();

View File

@ -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)

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<app version="2.1.0">
<file url="http://vba-wii.googlecode.com/files/Visual%20Boy%20Advance%20GX%202.1.0%20-%20Wii.zip"></file>
<app version="2.1.1">
<file url="http://vba-wii.googlecode.com/files/Visual%20Boy%20Advance%20GX%202.1.1%20-%20Wii.zip"></file>
</app>