Skip to content

Commit

Permalink
Vita: - fix sound setting changes not being applied until reboot - fi…
Browse files Browse the repository at this point in the history
…x sound distortion for stereo separation 0% and 25%
  • Loading branch information
rsn8887 committed Jan 4, 2017
1 parent 2b22292 commit 7e3691a
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 35 deletions.
46 changes: 23 additions & 23 deletions src/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ typedef uae_s8 sample8_t;
} else { \
if ((unsigned)sndbufpt - (unsigned)render_sndbuff >= SNDBUFFER_LEN) { \
finish_sound_buffer (); } \
} \
} \
} \


Expand All @@ -84,30 +84,30 @@ typedef uae_s8 sample8_t;
d2 &= audio_channel_adk_mask[2]; \
d3 &= audio_channel_adk_mask[3]; \
if (mainMenu_soundStereo) { \
switch (mainMenu_soundStereoSep) \
{ \
case 3: \
PUT_SOUND_WORD (d0+d3) \
PUT_SOUND_WORD (d1+d2) \
break; \
case 2: \
PUT_SOUND_WORD (((d0+d3)*28+(d1+d2)*4)/32) \
PUT_SOUND_WORD (((d1+d2)*28+(d0+d3)*4)/32) \
break; \
case 1: \
PUT_SOUND_WORD (((d0+d3)*24+(d1+d2)*8)/32) \
PUT_SOUND_WORD (((d1+d2)*24+(d0+d3)*8)/32) \
break; \
case 0: \
switch (mainMenu_soundStereoSep) { \
case 3: \
PUT_SOUND_WORD (d0+d3) \
PUT_SOUND_WORD (d1+d2) \
break; \
case 2: \
PUT_SOUND_WORD (((d0+d3)*28+(d1+d2)*4)/32) \
PUT_SOUND_WORD (((d1+d2)*28+(d0+d3)*4)/32) \
break; \
case 1: \
PUT_SOUND_WORD (((d0+d3)*24+(d1+d2)*8)/32) \
PUT_SOUND_WORD (((d1+d2)*24+(d0+d3)*8)/32) \
break; \
case 0: \
PUT_SOUND_WORD (((d0+d3)*20+(d1+d2)*12)/32) \
PUT_SOUND_WORD (((d1+d2)*20+(d0+d3)*12)/32) \
default: \
PUT_SOUND_WORD (d0+d3) \
PUT_SOUND_WORD (d1+d2) \
} \
PUT_SOUND_WORD (((d1+d2)*20+(d0+d3)*12)/32) \
break; \
default: \
PUT_SOUND_WORD (d0+d3) \
PUT_SOUND_WORD (d1+d2) \
break; } \
} else { \
PUT_SOUND_WORD (d0+d1+d2+d3) } \
CHECK_SOUND_BUFFERS(); \
PUT_SOUND_WORD (d0+d1+d2+d3) } \
CHECK_SOUND_BUFFERS(); \
} \


Expand Down
4 changes: 3 additions & 1 deletion src/gp2x/menu/menu_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#include "cpuspeed/cpuctrl.h"
#include "custom.h"



/* PocketUAE config file. Used for parsing PocketUAE-like options. */
#include "savestate.h"

Expand Down Expand Up @@ -1028,7 +1030,7 @@ int run_mainMenu()

if (sound_rate != old_sound_rate || mainMenu_soundStereo != old_stereo)
init_sound();

update_display();
return mainMenu_case;
}
4 changes: 2 additions & 2 deletions src/gp2x/menu/menu_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ static void draw_miscMenu(int c)
write_text(tabstop1,menuLine,"Normal");

if (((mainMenu_chipset & 0xff00)==0x100)&&((menuMisc!=MENUMISC_BLITTER)||(bb)))
write_text_inv(tabstop5-1,menuLine,"Immediate");
write_text_inv(tabstop5-2,menuLine,"Immediate");
else
write_text(tabstop5-1,menuLine,"Immediate");
write_text(tabstop5-2,menuLine,"Immediate");

if (((mainMenu_chipset & 0xff00)==0x200)&&((menuMisc!=MENUMISC_BLITTER)||(bb)))
write_text_inv(tabstop9,menuLine,"Improved");
Expand Down
14 changes: 7 additions & 7 deletions src/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ static myRes quickSwitchModes[] = {
{240, 2},
{256, 2},
{270, 2},
{192, 16},
{200, 16},
{216, 16},
{224, 16},
{240, 16},
{256, 16},
{270, 16},
{192, 14},
{200, 14},
{216, 14},
{224, 14},
{240, 14},
{256, 14},
{270, 14},
};
extern int moveY;

Expand Down
9 changes: 7 additions & 2 deletions src/sound_sdl_new.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,17 @@ static int gp2x_start_sound(int rate, int bits, int stereo)

// if no settings change, we don't need to do anything
if (rate == s_oldrate && s_oldbits == bits && s_oldstereo == stereo)
return 0;
return 0;

if( audioOpened ) {
// __android_log_print(ANDROID_LOG_INFO, "UAE4ALL2", "UAE tries to open SDL sound device 2 times, ignoring that.");
// SDL_CloseAudio();
#ifdef __PSP2__
//this allows the user to change sound settings on the fly
//without having to save config and restart
SDL_CloseAudio();
#else
return 0;
#endif
}

SDL_AudioSpec as;
Expand Down

0 comments on commit 7e3691a

Please sign in to comment.