correct audio channel reversal, fix Gamecube version

This commit is contained in:
dborth 2008-10-20 07:30:59 +00:00
parent 45b38cbb7e
commit 8968dd802c
5 changed files with 17 additions and 56 deletions

View File

@ -26,7 +26,7 @@ INCLUDES := source/vba source/ngc
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
CFLAGS = -g -O3 -Wall $(MACHDEP) $(INCLUDE) \ CFLAGS = -g -O3 -Wall $(MACHDEP) $(INCLUDE) \
-DNGC -DWII_DVD -DWORDS_BIGENDIAN -DVIDEO_THREADING \ -DNGC -DWII_DVD -DWORDS_BIGENDIAN \
-DC_CORE -D__ppc__ -D__POWERPC__ -DFINAL_VERSION \ -DC_CORE -D__ppc__ -D__POWERPC__ -DFINAL_VERSION \
-DSDL -DNO_PNG -DHAVE_ZUTIL_H \ -DSDL -DNO_PNG -DHAVE_ZUTIL_H \
-D_SZ_ONE_DIRECTORY -D_LZMA_IN_CB -D_LZMA_OUT_READ -D_SZ_ONE_DIRECTORY -D_LZMA_IN_CB -D_LZMA_OUT_READ

View File

@ -1,13 +1,13 @@
¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤ ¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤
- Visual Boy Advance GX - - Visual Boy Advance GX -
Version 1.0.3 Version 1.0.4
http://code.google.com/p/vba-wii http://code.google.com/p/vba-wii
(Under GPL License) (Under GPL License)
¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤ ¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤°`°¤ø,¸,ø¤°`°¤ø,¸¸,ø¤
Visual Boy Advance GX is a modified port of VBA-M / VBA 1.7.2. Visual Boy Advance GX is a modified port of VBA-M.
With it you can play GBA/Game Boy Color/Game Boy games on your Wii/GameCube. With it you can play GBA/Game Boy Color/Game Boy games on your Wii/GameCube.
-=[ Features ]=- -=[ Features ]=-
@ -16,7 +16,7 @@ With it you can play GBA/Game Boy Color/Game Boy games on your Wii/GameCube.
* SRAM and State saving * SRAM and State saving
* Custom controller configurations * Custom controller configurations
* SD, USB, DVD, SMB, GC Memory Card, Zip, and 7z support * SD, USB, DVD, SMB, GC Memory Card, Zip, and 7z support
* GBA compatiblity based on VBA-M r750, GB compatibility based on VBA 1.7.2 * Compatiblity based on VBA-M r750
* 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, and unfiltered video options * Turbo speed, video zooming, and unfiltered video options
@ -25,6 +25,14 @@ 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|
`¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨' `¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨'
[What's New 1.0.4]
* Sound processing improved - L-R channel reversal corrected, skipping fixed
* Complete port of VBA-M - now uses blaarg's new audio core, latest GB core
* Frameskipping improvements
* Save file problems fixed, game compatibility improved
* IPS/UPS patching support
* GameCube support is back!
[What's New 1.0.3 - October 15, 2008] [What's New 1.0.3 - October 15, 2008]
* New timing / frameskip algorithm - should (hopefully) work 100% better! * New timing / frameskip algorithm - should (hopefully) work 100% better!
* Performance improvements - video threading, PPC core partly activated * Performance improvements - video threading, PPC core partly activated

View File

@ -20,6 +20,7 @@ static int tail = 0;
#define MIXBUFFSIZE 0x10000 #define MIXBUFFSIZE 0x10000
static u8 mixerdata[MIXBUFFSIZE]; static u8 mixerdata[MIXBUFFSIZE];
#define MIXERMASK ((MIXBUFFSIZE >> 2) - 1) #define MIXERMASK ((MIXBUFFSIZE >> 2) - 1)
#define SWAP(x) ((x>>16)|(x<<16)) // for reversing stereo channels
static u8 soundbuffer[2][3840] ATTRIBUTE_ALIGN(32); static u8 soundbuffer[2][3840] ATTRIBUTE_ALIGN(32);
extern int ConfigRequested; extern int ConfigRequested;
@ -91,8 +92,8 @@ void MIXER_AddSamples( u8 *sampledata, int len )
do do
{ {
// Do simple linear interpolate // Do simple linear interpolate, and swap channels from L-R to R-L
dst[head++] = src[fixofs >> 16]; dst[head++] = SWAP(src[fixofs >> 16]);
head &= MIXERMASK; head &= MIXERMASK;
fixofs += fixinc; fixofs += fixinc;
} }

View File

@ -81,7 +81,6 @@ static camera cam = { {0.0F, 0.0F, 0.0F},
{0.0F, 0.0F, -0.5F} {0.0F, 0.0F, -0.5F}
}; };
#ifdef VIDEO_THREADING
/**************************************************************************** /****************************************************************************
* VideoThreading * VideoThreading
***************************************************************************/ ***************************************************************************/
@ -126,8 +125,6 @@ InitVideoThread ()
LWP_CreateThread (&vbthread, vbgetback, NULL, vbstack, TSTACK, 80); LWP_CreateThread (&vbthread, vbgetback, NULL, vbstack, TSTACK, 80);
} }
#endif
/**************************************************************************** /****************************************************************************
* copy_to_xfb * copy_to_xfb
* *
@ -331,9 +328,7 @@ void InitialiseVideo ()
copynow = GX_FALSE; copynow = GX_FALSE;
GX_Start(); GX_Start();
#ifdef VIDEO_THREADING
InitVideoThread (); InitVideoThread ();
#endif
} }
/**************************************************************************** /****************************************************************************
@ -469,12 +464,8 @@ void GX_Render(int width, int height, u8 * buffer, int pitch)
vwidth = width; vwidth = width;
vheight = height; vheight = height;
#ifdef VIDEO_THREADING
// Ensure previous vb has complete // Ensure previous vb has complete
while ((LWP_ThreadIsSuspended (vbthread) == 0) || (copynow == GX_TRUE)) while ((LWP_ThreadIsSuspended (vbthread) == 0) || (copynow == GX_TRUE))
#else
while (copynow == GX_TRUE)
#endif
{ {
usleep (50); usleep (50);
} }
@ -532,10 +523,8 @@ void GX_Render(int width, int height, u8 * buffer, int pitch)
VIDEO_Flush(); VIDEO_Flush();
copynow = GX_TRUE; copynow = GX_TRUE;
#ifdef VIDEO_THREADING
// Return to caller, don't waste time waiting for vb // Return to caller, don't waste time waiting for vb
LWP_ResumeThread (vbthread); LWP_ResumeThread (vbthread);
#endif
} }
/**************************************************************************** /****************************************************************************

View File

@ -327,8 +327,6 @@ int VMCPULoadROM(int method)
return 0; return 0;
} }
// printf("ROM Size %d\n", romfile->fsize);
res = fread(rom, 1, (1 << VMSHIFTBITS), romfile); res = fread(rom, 1, (1 << VMSHIFTBITS), romfile);
if ( res != (1 << VMSHIFTBITS ) ) if ( res != (1 << VMSHIFTBITS ) )
{ {
@ -368,9 +366,9 @@ static void VMNewPage( int pageid )
mftb(&start); mftb(&start);
res = fseek( romfile, pageid << VMSHIFTBITS, SEEK_SET ); res = fseek( romfile, pageid << VMSHIFTBITS, SEEK_SET );
if ( ! res ) if (res) // fseek returns non-zero on a failure
{ {
sprintf(msg, "Seek error! - Offset %08x %d\n", pageid << VMSHIFTBITS, res); sprintf(msg, "Seek error! - Offset %d / %08x %d\n", pageid, pageid << VMSHIFTBITS, res);
WaitPrompt(msg); WaitPrompt(msg);
VMClose(); VMClose();
return; return;
@ -390,23 +388,6 @@ static void VMNewPage( int pageid )
mftb(&end); mftb(&end);
loadtimeradjust += tb_diff_msec(&end, &start); loadtimeradjust += tb_diff_msec(&end, &start);
#if 0
if ( pageid == 0x1FE )
{
vmpage[pageid].pageptr[0x209C] = 0xDF;
vmpage[pageid].pageptr[0x209D] = 0xFA;
vmpage[pageid].pageptr[0x209E] = 0x47;
vmpage[pageid].pageptr[0x209F] = 0x70;
}
printf("VMNP : %02x %04x %08x [%02x%02x%02x%02x] [%02x%02x%02x%02x]\n", vmpageno, pageid,
(u32)(vmpage[pageid].pageptr - rombase), vmpage[pageid].pageptr[0], vmpage[pageid].pageptr[1],
vmpage[pageid].pageptr[2], vmpage[pageid].pageptr[3],
vmpage[pageid].pageptr[0xfffc], vmpage[pageid].pageptr[0xfffd],
vmpage[pageid].pageptr[0xfffe], vmpage[pageid].pageptr[0xffff] );
#endif
} }
/**************************************************************************** /****************************************************************************
@ -419,7 +400,6 @@ u32 VMRead32( u32 address )
int pageid; int pageid;
u32 badaddress; u32 badaddress;
char msg[512]; char msg[512];
//printf("VM32 : Request %08x\n", address);
if ( address >= GBAROMSize ) if ( address >= GBAROMSize )
{ {
@ -443,10 +423,6 @@ u32 VMRead32( u32 address )
VMClose(); VMClose();
return 0; return 0;
} }
/* Can never get here ... but stops gcc bitchin' */
return 0;
} }
/**************************************************************************** /****************************************************************************
@ -458,8 +434,6 @@ u16 VMRead16( u32 address )
{ {
int pageid; int pageid;
//printf("VM16 : Request %08x\n", address);
if ( address >= GBAROMSize ) if ( address >= GBAROMSize )
{ {
return ( address >> 1 ) & 0xffff; return ( address >> 1 ) & 0xffff;
@ -480,10 +454,6 @@ u16 VMRead16( u32 address )
VMClose(); VMClose();
return 0; return 0;
} }
/* Can never get here ... but stops gcc bitchin' */
return 0;
} }
/**************************************************************************** /****************************************************************************
@ -495,8 +465,6 @@ u8 VMRead8( u32 address )
{ {
int pageid; int pageid;
//printf("VM8 : Request %08x\n", address);
if ( address >= GBAROMSize ) if ( address >= GBAROMSize )
{ {
return ( address >> 1 ) & 0xff; return ( address >> 1 ) & 0xff;
@ -517,11 +485,6 @@ u8 VMRead8( u32 address )
VMClose(); VMClose();
return 0; return 0;
} }
/* Can never get here ... but stops gcc bitchin' */
return 0;
} }
#endif #endif