mirror of
https://github.com/dborth/vbagx.git
synced 2024-11-22 10:39:18 +01:00
fix save states, sync with VBA-M, finalize 2.1.1
This commit is contained in:
parent
178a26e23f
commit
0f6d0f7b1b
@ -2,8 +2,8 @@
|
|||||||
<app version="1">
|
<app version="1">
|
||||||
<name>Visual Boy Advance GX</name>
|
<name>Visual Boy Advance GX</name>
|
||||||
<coder>Tantric</coder>
|
<coder>Tantric</coder>
|
||||||
<version>2.1.0</version>
|
<version>2.1.1</version>
|
||||||
<release_date>20091202</release_date>
|
<release_date>20091207</release_date>
|
||||||
<short_description>GBA/GBC/GB Emulator</short_description>
|
<short_description>GBA/GBC/GB Emulator</short_description>
|
||||||
<long_description>A port of Visual Boy Advance - M to the Wii.</long_description>
|
<long_description>A port of Visual Boy Advance - M to the Wii.</long_description>
|
||||||
</app>
|
</app>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤
|
¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤
|
||||||
|
|
||||||
- Visual Boy Advance GX -
|
- Visual Boy Advance GX -
|
||||||
Version 2.1.0
|
Version 2.1.1
|
||||||
http://code.google.com/p/vba-wii
|
http://code.google.com/p/vba-wii
|
||||||
(Under GPL License)
|
(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
|
* IPS/UPS/PPF patch support
|
||||||
* Custom controller configurations
|
* Custom controller configurations
|
||||||
* SD, USB, DVD, SMB, Zip, and 7z support
|
* 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
|
* MEM2 ROM Storage for fast access
|
||||||
* Auto frame skip for those core heavy games
|
* Auto frame skip for those core heavy games
|
||||||
* Turbo speed, video zooming, widescreen, and unfiltered video options
|
* 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|
|
|0O×øo· UPDATE HISTORY ·oø×O0|
|
||||||
`¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨'
|
`¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨'
|
||||||
|
|
||||||
|
[2.1.1 - December 7, 2009]
|
||||||
|
|
||||||
|
* Save state corruption issues fixed
|
||||||
|
|
||||||
[2.1.0 - December 2, 2009]
|
[2.1.0 - December 2, 2009]
|
||||||
|
|
||||||
* Fixed SMB (for real this time!)
|
* Fixed SMB (for real this time!)
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include "filelist.h"
|
#include "filelist.h"
|
||||||
|
|
||||||
#define APPNAME "Visual Boy Advance GX"
|
#define APPNAME "Visual Boy Advance GX"
|
||||||
#define APPVERSION "2.1.0"
|
#define APPVERSION "2.1.1"
|
||||||
#define APPFOLDER "vbagx"
|
#define APPFOLDER "vbagx"
|
||||||
#define PREF_FILE_NAME "settings.xml"
|
#define PREF_FILE_NAME "settings.xml"
|
||||||
#define PAL_FILE_NAME "palettes.xml"
|
#define PAL_FILE_NAME "palettes.xml"
|
||||||
|
@ -259,7 +259,7 @@ int MemCPUWriteBatteryFile(char * membuffer)
|
|||||||
bool LoadBatteryOrState(char * filepath, int action, bool silent)
|
bool LoadBatteryOrState(char * filepath, int action, bool silent)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
size_t offset = 0;
|
int offset = 0;
|
||||||
int device;
|
int device;
|
||||||
|
|
||||||
if(!FindDevice(filepath, &device))
|
if(!FindDevice(filepath, &device))
|
||||||
@ -349,9 +349,9 @@ bool LoadBatteryOrStateAuto(int action, bool silent)
|
|||||||
bool SaveBatteryOrState(char * filepath, int action, bool silent)
|
bool SaveBatteryOrState(char * filepath, int action, bool silent)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
size_t offset = 0;
|
int offset = 0;
|
||||||
size_t datasize = 0; // we need the actual size of the data written
|
int datasize = 0; // we need the actual size of the data written
|
||||||
size_t imgSize = 0; // image screenshot bytes written
|
int imgSize = 0; // image screenshot bytes written
|
||||||
int device;
|
int device;
|
||||||
|
|
||||||
if(!FindDevice(filepath, &device))
|
if(!FindDevice(filepath, &device))
|
||||||
@ -394,7 +394,8 @@ bool SaveBatteryOrState(char * filepath, int action, bool silent)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
datasize = emulator.emuWriteMemState((char *)savebuffer, SAVEBUFFERSIZE);
|
if(emulator.emuWriteMemState((char *)savebuffer, SAVEBUFFERSIZE))
|
||||||
|
datasize = *((int *)(savebuffer+4)) + 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
// write savebuffer into file
|
// write savebuffer into file
|
||||||
|
@ -25,7 +25,7 @@ struct EmulatedSystem {
|
|||||||
// load memory state (rewind)
|
// load memory state (rewind)
|
||||||
bool (*emuReadMemState)(char *, int);
|
bool (*emuReadMemState)(char *, int);
|
||||||
// write memory state (rewind)
|
// write memory state (rewind)
|
||||||
int (*emuWriteMemState)(char *, int);
|
bool (*emuWriteMemState)(char *, int);
|
||||||
// write PNG file
|
// write PNG file
|
||||||
bool (*emuWritePNG)(const char *);
|
bool (*emuWritePNG)(const char *);
|
||||||
// write BMP file
|
// write BMP 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
|
int const silent_buf_size = 1; // size used for Silent_Blip_Buffer
|
||||||
|
|
||||||
Blip_Buffer::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)
|
|
||||||
{
|
{
|
||||||
|
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
|
// assumptions code makes about implementation-defined features
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
// right shift of negative value preserves sign
|
// 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 ) :
|
Blip_Synth_::Blip_Synth_( short* p, int w ) :
|
||||||
impulses( p ),
|
impulses( p ),
|
||||||
width( w ),
|
width( w )
|
||||||
volume_unit_(0.0),
|
{
|
||||||
kernel_unit(0),
|
volume_unit_ = 0.0;
|
||||||
buf(0),
|
kernel_unit = 0;
|
||||||
last_amp(0),
|
buf = 0;
|
||||||
delta_factor(0)
|
last_amp = 0;
|
||||||
{}
|
delta_factor = 0;
|
||||||
|
}
|
||||||
|
|
||||||
#undef PI
|
#undef PI
|
||||||
#define PI 3.1415926535897932384626433832795029
|
#define PI 3.1415926535897932384626433832795029
|
||||||
|
@ -3550,23 +3550,24 @@ static bool gbWriteSaveState(gzFile gzFile)
|
|||||||
return true;
|
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)
|
if(gzFile == NULL) {
|
||||||
return 0;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(gbWriteSaveState(gzFile))
|
bool res = gbWriteSaveState(gzFile);
|
||||||
{
|
|
||||||
pos = utilGzMemTell(gzFile)+8;
|
long pos = utilGzMemTell(gzFile)+8;
|
||||||
|
|
||||||
if(pos >= (available))
|
if(pos >= (available))
|
||||||
pos = 0;
|
res = false;
|
||||||
}
|
|
||||||
utilGzClose(gzFile);
|
utilGzClose(gzFile);
|
||||||
return pos;
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool gbWriteSaveState(const char *name)
|
bool gbWriteSaveState(const char *name)
|
||||||
|
@ -30,7 +30,7 @@ bool gbWriteBatteryFile(const char *);
|
|||||||
bool gbWriteBatteryFile(const char *, bool);
|
bool gbWriteBatteryFile(const char *, bool);
|
||||||
bool gbReadBatteryFile(const char *);
|
bool gbReadBatteryFile(const char *);
|
||||||
bool gbWriteSaveState(const char *);
|
bool gbWriteSaveState(const char *);
|
||||||
int gbWriteMemSaveState(char *, int);
|
bool gbWriteMemSaveState(char *, int);
|
||||||
bool gbReadSaveState(const char *);
|
bool gbReadSaveState(const char *);
|
||||||
bool gbReadMemSaveState(char *, int);
|
bool gbReadMemSaveState(char *, int);
|
||||||
void gbSgbRenderBorder();
|
void gbSgbRenderBorder();
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
@ -2677,6 +2678,8 @@ void cheatsReadGameSkip( gzFile file, int version )
|
|||||||
utilGzSeek( file, sizeof( cheatsList ), SEEK_CUR );
|
utilGzSeek( file, sizeof( cheatsList ), SEEK_CUR );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool firstCodeBreaker = true;
|
||||||
|
|
||||||
for( int i = 0; i < nCheats; i++ ) {
|
for( int i = 0; i < nCheats; i++ ) {
|
||||||
if( version < 9 ) {
|
if( version < 9 ) {
|
||||||
utilGzSeek( file, ( 7 * sizeof(int) ) + ( 52 * sizeof(char) ), SEEK_CUR );
|
utilGzSeek( file, ( 7 * sizeof(int) ) + ( 52 * sizeof(char) ), SEEK_CUR );
|
||||||
|
@ -634,23 +634,24 @@ bool CPUWriteState(const char *file)
|
|||||||
return res;
|
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)
|
if(gzFile == NULL) {
|
||||||
return 0;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if(CPUWriteState(gzFile))
|
bool res = CPUWriteState(gzFile);
|
||||||
{
|
|
||||||
pos = utilGzMemTell(gzFile)+8;
|
long pos = utilGzMemTell(gzFile)+8;
|
||||||
|
|
||||||
if(pos >= (available))
|
if(pos >= (available))
|
||||||
pos = 0;
|
res = false;
|
||||||
}
|
|
||||||
utilGzClose(gzFile);
|
utilGzClose(gzFile);
|
||||||
return pos;
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool CPUReadState(gzFile gzFile)
|
static bool CPUReadState(gzFile gzFile)
|
||||||
|
@ -90,7 +90,7 @@ extern void CPUUpdateRender();
|
|||||||
extern void CPUUpdateRenderBuffers(bool);
|
extern void CPUUpdateRenderBuffers(bool);
|
||||||
extern bool CPUReadMemState(char *, int);
|
extern bool CPUReadMemState(char *, int);
|
||||||
extern bool CPUReadState(const char *);
|
extern bool CPUReadState(const char *);
|
||||||
extern int CPUWriteMemState(char *, int);
|
extern bool CPUWriteMemState(char *, int);
|
||||||
extern bool CPUWriteState(const char *);
|
extern bool CPUWriteState(const char *);
|
||||||
extern int CPULoadRom(const char *);
|
extern int CPULoadRom(const char *);
|
||||||
extern void doMirroring(bool);
|
extern void doMirroring(bool);
|
||||||
|
@ -20,10 +20,6 @@ int gfxBG3Changed = 0;
|
|||||||
|
|
||||||
int gfxBG2X = 0;
|
int gfxBG2X = 0;
|
||||||
int gfxBG2Y = 0;
|
int gfxBG2Y = 0;
|
||||||
int gfxBG2LastX = 0;
|
|
||||||
int gfxBG2LastY = 0;
|
|
||||||
int gfxBG3X = 0;
|
int gfxBG3X = 0;
|
||||||
int gfxBG3Y = 0;
|
int gfxBG3Y = 0;
|
||||||
int gfxBG3LastX = 0;
|
|
||||||
int gfxBG3LastY = 0;
|
|
||||||
int gfxLastVCOUNT = 0;
|
int gfxLastVCOUNT = 0;
|
||||||
|
@ -87,12 +87,8 @@ extern int gfxBG3Changed;
|
|||||||
|
|
||||||
extern int gfxBG2X;
|
extern int gfxBG2X;
|
||||||
extern int gfxBG2Y;
|
extern int gfxBG2Y;
|
||||||
extern int gfxBG2LastX;
|
|
||||||
extern int gfxBG2LastY;
|
|
||||||
extern int gfxBG3X;
|
extern int gfxBG3X;
|
||||||
extern int gfxBG3Y;
|
extern int gfxBG3Y;
|
||||||
extern int gfxBG3LastX;
|
|
||||||
extern int gfxBG3LastY;
|
|
||||||
extern int gfxLastVCOUNT;
|
extern int gfxLastVCOUNT;
|
||||||
|
|
||||||
static inline void gfxClearArray(u32 *array)
|
static inline void gfxClearArray(u32 *array)
|
||||||
|
@ -40,15 +40,15 @@ bool skipSaveGameCheats = false;
|
|||||||
// 0x0000 to 0x7FFF: set custom 15 bit color
|
// 0x0000 to 0x7FFF: set custom 15 bit color
|
||||||
int customBackdropColor = -1;
|
int customBackdropColor = -1;
|
||||||
|
|
||||||
u8 *bios = NULL;
|
u8 *bios = 0;
|
||||||
u8 *rom = NULL;
|
u8 *rom = 0;
|
||||||
u8 *internalRAM = NULL;
|
u8 *internalRAM = 0;
|
||||||
u8 *workRAM = NULL;
|
u8 *workRAM = 0;
|
||||||
u8 *paletteRAM = NULL;
|
u8 *paletteRAM = 0;
|
||||||
u8 *vram = NULL;
|
u8 *vram = 0;
|
||||||
u8 *pix = NULL;
|
u8 *pix = 0;
|
||||||
u8 *oam = NULL;
|
u8 *oam = 0;
|
||||||
u8 *ioMem = NULL;
|
u8 *ioMem = 0;
|
||||||
|
|
||||||
u16 DISPCNT = 0x0080;
|
u16 DISPCNT = 0x0080;
|
||||||
u16 DISPSTAT = 0x0000;
|
u16 DISPSTAT = 0x0000;
|
||||||
|
@ -543,6 +543,13 @@ bool soundInit()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void soundSetThrottle(unsigned short throttle)
|
||||||
|
{
|
||||||
|
if(!soundDriver)
|
||||||
|
return;
|
||||||
|
soundDriver->setThrottle(throttle);
|
||||||
|
}
|
||||||
|
|
||||||
long soundGetSampleRate()
|
long soundGetSampleRate()
|
||||||
{
|
{
|
||||||
return soundSampleRate;
|
return soundSampleRate;
|
||||||
|
@ -11,6 +11,9 @@
|
|||||||
// current value in soundQuality global.
|
// current value in soundQuality global.
|
||||||
bool soundInit();
|
bool soundInit();
|
||||||
|
|
||||||
|
// sets the Sound throttle
|
||||||
|
void soundSetThrottle(unsigned short throttle);
|
||||||
|
|
||||||
// Manages sound volume, where 1.0 is normal
|
// Manages sound volume, where 1.0 is normal
|
||||||
void soundSetVolume( float );
|
void soundSetVolume( float );
|
||||||
float soundGetVolume();
|
float soundGetVolume();
|
||||||
|
@ -781,7 +781,7 @@ void BIOS_LZ77UnCompWram()
|
|||||||
int length = (data >> 12) + 3;
|
int length = (data >> 12) + 3;
|
||||||
int offset = (data & 0x0FFF);
|
int offset = (data & 0x0FFF);
|
||||||
u32 windowOffset = dest - offset - 1;
|
u32 windowOffset = dest - offset - 1;
|
||||||
for(int i = 0; i < length; i++) {
|
for(int i2 = 0; i2 < length; i2++) {
|
||||||
CPUWriteByte(dest++, CPUReadByte(windowOffset++));
|
CPUWriteByte(dest++, CPUReadByte(windowOffset++));
|
||||||
len--;
|
len--;
|
||||||
if(len == 0)
|
if(len == 0)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<app version="2.1.0">
|
<app version="2.1.1">
|
||||||
<file url="http://vba-wii.googlecode.com/files/Visual%20Boy%20Advance%20GX%202.1.0%20-%20Wii.zip"></file>
|
<file url="http://vba-wii.googlecode.com/files/Visual%20Boy%20Advance%20GX%202.1.1%20-%20Wii.zip"></file>
|
||||||
</app>
|
</app>
|
||||||
|
Loading…
Reference in New Issue
Block a user