mirror of
https://github.com/dborth/vbagx.git
synced 2024-11-29 05:54:17 +01:00
fix a couple stupid bugs, audio static gone, now synced to VBA-M r847
This commit is contained in:
parent
bb6d002d37
commit
b47b3fa80c
@ -52,27 +52,20 @@ static tb_t start, now;
|
|||||||
|
|
||||||
u32 loadtimeradjust;
|
u32 loadtimeradjust;
|
||||||
|
|
||||||
int vAspect = 0;
|
static int cartridgeType = 0;
|
||||||
int hAspect = 0;
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* VBA Globals
|
* VBA Globals
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
int RGB_LOW_BITS_MASK=0x821;
|
|
||||||
int systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
|
int systemSaveUpdateCounter = SYSTEM_SAVE_NOT_UPDATED;
|
||||||
|
|
||||||
int systemDebug = 0;
|
int systemDebug = 0;
|
||||||
int emulating = 0;
|
int emulating = 0;
|
||||||
|
|
||||||
int sensorX = 2047;
|
|
||||||
int sensorY = 2047;
|
|
||||||
|
|
||||||
int systemFrameSkip = 0;
|
int systemFrameSkip = 0;
|
||||||
int systemVerbose = 0;
|
int systemVerbose = 0;
|
||||||
int cartridgeType = 0;
|
|
||||||
int srcWidth = 0;
|
|
||||||
int srcHeight = 0;
|
|
||||||
int srcPitch = 0;
|
|
||||||
int systemRedShift = 0;
|
int systemRedShift = 0;
|
||||||
int systemBlueShift = 0;
|
int systemBlueShift = 0;
|
||||||
int systemGreenShift = 0;
|
int systemGreenShift = 0;
|
||||||
@ -484,6 +477,9 @@ u32 systemReadJoypad(int which)
|
|||||||
* - Wario Ware Twisted!
|
* - Wario Ware Twisted!
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
static int sensorX = 2047;
|
||||||
|
static int sensorY = 2047;
|
||||||
|
|
||||||
int systemGetSensorX()
|
int systemGetSensorX()
|
||||||
{
|
{
|
||||||
return sensorX;
|
return sensorX;
|
||||||
@ -583,6 +579,10 @@ if(sdlMotionButtons[KEY_LEFT]) {
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* systemDrawScreen
|
* systemDrawScreen
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
static int srcWidth = 0;
|
||||||
|
static int srcHeight = 0;
|
||||||
|
static int srcPitch = 0;
|
||||||
|
|
||||||
void systemDrawScreen()
|
void systemDrawScreen()
|
||||||
{
|
{
|
||||||
GX_Render( srcWidth, srcHeight, pix, srcPitch );
|
GX_Render( srcWidth, srcHeight, pix, srcPitch );
|
||||||
@ -717,14 +717,14 @@ bool LoadGBROM(int method)
|
|||||||
|
|
||||||
bool LoadVBAROM(int method)
|
bool LoadVBAROM(int method)
|
||||||
{
|
{
|
||||||
int type = 0;
|
cartridgeType = 0;
|
||||||
bool loaded = false;
|
bool loaded = false;
|
||||||
|
|
||||||
// image type (checks file extension)
|
// image type (checks file extension)
|
||||||
if(utilIsGBAImage(browserList[browser.selIndex].filename))
|
if(utilIsGBAImage(browserList[browser.selIndex].filename))
|
||||||
type = 2;
|
cartridgeType = 2;
|
||||||
else if(utilIsGBImage(browserList[browser.selIndex].filename))
|
else if(utilIsGBImage(browserList[browser.selIndex].filename))
|
||||||
type = 1;
|
cartridgeType = 1;
|
||||||
else if(utilIsZipFile(browserList[browser.selIndex].filename))
|
else if(utilIsZipFile(browserList[browser.selIndex].filename))
|
||||||
{
|
{
|
||||||
// we need to check the file extension of the first file in the archive
|
// we need to check the file extension of the first file in the archive
|
||||||
@ -733,9 +733,9 @@ bool LoadVBAROM(int method)
|
|||||||
if(zippedFilename != NULL)
|
if(zippedFilename != NULL)
|
||||||
{
|
{
|
||||||
if(utilIsGBAImage(zippedFilename))
|
if(utilIsGBAImage(zippedFilename))
|
||||||
type = 2;
|
cartridgeType = 2;
|
||||||
else if(utilIsGBImage(zippedFilename))
|
else if(utilIsGBImage(zippedFilename))
|
||||||
type = 1;
|
cartridgeType = 1;
|
||||||
}
|
}
|
||||||
else // loading the file failed
|
else // loading the file failed
|
||||||
{
|
{
|
||||||
@ -744,7 +744,7 @@ bool LoadVBAROM(int method)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// leave before we do anything
|
// leave before we do anything
|
||||||
if(type != 1 && type != 2)
|
if(cartridgeType != 1 && cartridgeType != 2)
|
||||||
{
|
{
|
||||||
WaitPrompt("Unknown game image!");
|
WaitPrompt("Unknown game image!");
|
||||||
return false;
|
return false;
|
||||||
@ -757,16 +757,13 @@ bool LoadVBAROM(int method)
|
|||||||
VMClose(); // cleanup GBA memory
|
VMClose(); // cleanup GBA memory
|
||||||
gbCleanUp(); // cleanup GB memory
|
gbCleanUp(); // cleanup GB memory
|
||||||
|
|
||||||
switch( type )
|
switch(cartridgeType)
|
||||||
{
|
{
|
||||||
case 2:
|
case 2:
|
||||||
emulator = GBASystem;
|
emulator = GBASystem;
|
||||||
srcWidth = 240;
|
srcWidth = 240;
|
||||||
srcHeight = 160;
|
srcHeight = 160;
|
||||||
loaded = VMCPULoadROM(method);
|
loaded = VMCPULoadROM(method);
|
||||||
// Actual Visual Aspect is 1.57
|
|
||||||
hAspect = 70;
|
|
||||||
vAspect = 46;
|
|
||||||
srcPitch = 484;
|
srcPitch = 484;
|
||||||
soundSetSampleRate(44100 / 2);
|
soundSetSampleRate(44100 / 2);
|
||||||
cpuSaveType = 0;
|
cpuSaveType = 0;
|
||||||
@ -795,9 +792,6 @@ bool LoadVBAROM(int method)
|
|||||||
}
|
}
|
||||||
|
|
||||||
loaded = LoadGBROM(method);
|
loaded = LoadGBROM(method);
|
||||||
// Actual physical aspect is 1.0
|
|
||||||
hAspect = 60;
|
|
||||||
vAspect = 46;
|
|
||||||
srcPitch = 324;
|
srcPitch = 324;
|
||||||
soundSetSampleRate(44100);
|
soundSetSampleRate(44100);
|
||||||
break;
|
break;
|
||||||
@ -811,9 +805,9 @@ bool LoadVBAROM(int method)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Setup GX
|
// Setup GX
|
||||||
GX_Render_Init( srcWidth, srcHeight, hAspect, vAspect );
|
GX_Render_Init(srcWidth, srcHeight);
|
||||||
|
|
||||||
if (type == 1)
|
if (cartridgeType == 1)
|
||||||
{
|
{
|
||||||
gbGetHardwareType();
|
gbGetHardwareType();
|
||||||
|
|
||||||
@ -841,12 +835,12 @@ bool LoadVBAROM(int method)
|
|||||||
doMirroring(mirroringEnable);
|
doMirroring(mirroringEnable);
|
||||||
|
|
||||||
soundReset();
|
soundReset();
|
||||||
CPUInit("BIOS.GBA", 1);
|
CPUInit(NULL, false);
|
||||||
LoadPatch(method);
|
LoadPatch(method);
|
||||||
CPUReset();
|
CPUReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
SetAudioRate(type);
|
SetAudioRate(cartridgeType);
|
||||||
soundInit();
|
soundInit();
|
||||||
|
|
||||||
emulating = 1;
|
emulating = 1;
|
||||||
|
@ -43,7 +43,6 @@ static int texturesize;
|
|||||||
static GXTexObj texobj;
|
static GXTexObj texobj;
|
||||||
static Mtx view;
|
static Mtx view;
|
||||||
static int vwidth, vheight;
|
static int vwidth, vheight;
|
||||||
static int video_vaspect, video_haspect;
|
|
||||||
static int updateScaling;
|
static int updateScaling;
|
||||||
bool progressive = false;
|
bool progressive = false;
|
||||||
|
|
||||||
@ -474,7 +473,7 @@ ResetVideo_Menu ()
|
|||||||
GX_LoadProjectionMtx (p, GX_ORTHOGRAPHIC);
|
GX_LoadProjectionMtx (p, GX_ORTHOGRAPHIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GX_Render_Init(int width, int height, int haspect, int vaspect)
|
void GX_Render_Init(int width, int height)
|
||||||
{
|
{
|
||||||
if (texturemem)
|
if (texturemem)
|
||||||
free(texturemem);
|
free(texturemem);
|
||||||
@ -489,9 +488,6 @@ void GX_Render_Init(int width, int height, int haspect, int vaspect)
|
|||||||
/*** Setup for first call to scaler ***/
|
/*** Setup for first call to scaler ***/
|
||||||
vwidth = width;
|
vwidth = width;
|
||||||
vheight = height;
|
vheight = height;
|
||||||
|
|
||||||
video_vaspect = vaspect;
|
|
||||||
video_haspect = haspect;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
void InitialiseVideo ();
|
void InitialiseVideo ();
|
||||||
void GX_Start();
|
void GX_Start();
|
||||||
void GX_Render_Init(int width, int height, int haspect, int vaspect);
|
void GX_Render_Init(int width, int height);
|
||||||
void GX_Render(int width, int height, u8 * buffer, int pitch);
|
void GX_Render(int width, int height, u8 * buffer, int pitch);
|
||||||
void clearscreen ();
|
void clearscreen ();
|
||||||
void showscreen ();
|
void showscreen ();
|
||||||
|
Loading…
Reference in New Issue
Block a user