diff --git a/src/computer.c b/src/computer.c index 91848bc..bda1cce 100644 --- a/src/computer.c +++ b/src/computer.c @@ -135,6 +135,7 @@ void computer_init () { //Called only on start-up for (bucle = 0; bucle < 16; bucle++) ordenador.ay_registers[bucle] = 0; ordenador.ay_emul = 0; + ordenador.gui_sound = 1; ordenador.aych_a = 0; ordenador.aych_b = 0; ordenador.aych_c = 0; @@ -176,7 +177,6 @@ void computer_init () { //Called only on start-up ordenador.npixels=4; ordenador.progressive=0; ordenador.audio_mode=2; //ACB - ordenador.low_filter=480; } void computer_set_palete() { diff --git a/src/computer.h b/src/computer.h index c91d5f3..a83420a 100644 --- a/src/computer.h +++ b/src/computer.h @@ -132,7 +132,6 @@ struct computer { unsigned char sound_bit; unsigned char sound_bit_mic; unsigned int tstados_counter_sound; - unsigned int low_filter; unsigned int *current_buffer; unsigned char num_buff; unsigned int sound_cuantity; // counter for the buffer @@ -141,6 +140,7 @@ struct computer { unsigned char ayval_a,ayval_b,ayval_c,ayval_n; unsigned char ay_emul; // 0: no AY emulation; 1: AY emulation unsigned char audio_mode; //mono, ABC, ACB, BAC + unsigned char gui_sound; unsigned int vol_a,vol_b,vol_c; unsigned int tst_ay; unsigned int ay_latch; diff --git a/src/emulator.c b/src/emulator.c index 277a75c..6a48d77 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -731,6 +731,7 @@ int save_config(struct computer *object, char *filename) { fprintf(fconfig,"joystick2=%c%c",48+object->joystick[1],10); fprintf(fconfig,"ay_sound=%c%c",48+object->ay_emul,10); fprintf(fconfig,"audio_mode=%c%c",48+object->audio_mode,10); + fprintf(fconfig,"gui_sound=%c%c",48+object->gui_sound,10); fprintf(fconfig,"interface1=%c%c",48+object->mdr_active,10); fprintf(fconfig,"doublescan=%c%c",48+object->dblscan,10); fprintf(fconfig,"framerate=%c%c",48+jump_frames,10); @@ -920,7 +921,7 @@ int load_config(struct computer *object, char *filename) { unsigned char volume=255,mode128k=255,issue=255,ntsc=255, joystick1=255,joystick2=255,ay_emul=255,mdr_active=255, dblscan=255,framerate =255, screen =255, text=255, precision=255, bw=255, tap_fast=255, audio_mode=255, joypad1=255, joypad2=255, rumble1=255, rumble2=255, joy_n=255, key_n=255, port=255, autoconf=255, turbo=225, vk_auto=255, vk_rumble=255, - rewind_on_reset=255, pause_instant_load =255, ignore_z80_joy_conf=255; + rewind_on_reset=255, pause_instant_load =255, ignore_z80_joy_conf=255, gui_sound=255; if (filename) strcpy(config_path,filename); else return -2; @@ -982,6 +983,10 @@ int load_config(struct computer *object, char *filename) { audio_mode=line[11]-'0'; continue; } + if (!strncmp(line,"gui_sound=",10)) { + gui_sound=line[10]-'0'; + continue; + } if (!strncmp(line,"interface1=",11)) { mdr_active=line[11]-'0'; continue; @@ -1095,6 +1100,9 @@ int load_config(struct computer *object, char *filename) { if (audio_mode<4) { object->audio_mode=audio_mode; } + if (gui_sound<2) { + object->gui_sound=gui_sound; + } if (mdr_active<2) { object->mdr_active=mdr_active; } diff --git a/src/gui_sdl.c b/src/gui_sdl.c index 73ac1ca..4759c00 100644 --- a/src/gui_sdl.c +++ b/src/gui_sdl.c @@ -119,9 +119,9 @@ static const char *audio_messages[] = { /*05*/ " ", /*06*/ "Audio mode", /*07*/ "^|mono|ABC|ACB|BAC", - /*08 " ", */ - /*09 "Beeper low pass filter",*/ - /*10 "^|0|1|2|3|4|5|6|7|max",*/ + /*08*/ " ", + /*09*/ "Gui sound", + /*10*/ "^|on|off", NULL }; @@ -695,40 +695,6 @@ static void tape_settings(void) } -unsigned int get_value_filter (unsigned int value) -{ - switch (value) - { - case 480: - return(0); - case 240: - return(1); - case 160: - return(2); - case 120: - return(3); - case 80: - return(4); - case 60: - return(5); - case 40: - return(6); - case 24: - return(7); - case 10: - return(8); - default: - return(0); - } -} - -unsigned int set_value_filter (unsigned int value) -{ - unsigned int set[9] = {480,240,160,120,80,60,40,24,10}; - beeper=0; - return set[value]; -} - static void audio_settings(void) { unsigned int submenus[4]; @@ -741,8 +707,7 @@ static void audio_settings(void) submenus[0] = ordenador.volume/2; submenus[1] = !ordenador.ay_emul; submenus[2] = ordenador.audio_mode; - submenus[3] = get_value_filter(ordenador.low_filter); - + submenus[3] = !ordenador.gui_sound; opt = menu_select_title("Audio settings", audio_messages, submenus); @@ -753,8 +718,7 @@ static void audio_settings(void) ordenador.volume = submenus[0]*2; ordenador.ay_emul = !submenus[1]; ordenador.audio_mode = submenus[2]; - ordenador.low_filter= set_value_filter(submenus[3]); - + ordenador.gui_sound = !submenus[3]; } diff --git a/src/menu_sdl.c b/src/menu_sdl.c index d30898b..c06e86d 100644 --- a/src/menu_sdl.c +++ b/src/menu_sdl.c @@ -1617,17 +1617,18 @@ int menu_is_inited(void) return is_inited; } -//Sound must be reseted before calling this function +//Sound must be reseted before calling this function (except for ASND) void play_click(sound) { - + if (!ordenador.gui_sound) return; +#ifdef GEKKO if (sound_type == SOUND_ASND) { ASND_SetVoice(2,VOICE_STEREO_16BIT_BE,ordenador.freq,0, click_buffer_pointer[sound],len_click_buffer[sound], 255, 255, NULL); return; } - +#endif int inc; int len_click_buffer_norm = len_click_buffer[sound]/ordenador.increment;