mirror of
https://github.com/Oibaf66/fbzx-wii.git
synced 2024-11-28 11:04:15 +01:00
No computer reset between issue 2 and 3, fixed bug in sound and increased sound volume
This commit is contained in:
parent
b81feb3573
commit
fb061f73d4
@ -1344,7 +1344,7 @@ void Z80free_Out (register word Port, register byte Value) {
|
|||||||
|
|
||||||
if (((Port|maskport) == 0xBFFD)&&(ordenador.ay_emul)) {
|
if (((Port|maskport) == 0xBFFD)&&(ordenador.ay_emul)) {
|
||||||
ordenador.ay_registers[ordenador.ay_latch] = (unsigned char) Value;
|
ordenador.ay_registers[ordenador.ay_latch] = (unsigned char) Value;
|
||||||
if (ordenador.ay_latch == 13)
|
if (ordenador.ay_latch == 13) //Envelope shape
|
||||||
ordenador.ay_envel_way = 2; // start cycle
|
ordenador.ay_envel_way = 2; // start cycle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -369,6 +369,7 @@ static void emulation_settings(void)
|
|||||||
{
|
{
|
||||||
unsigned int submenus[7],submenus_old[7];
|
unsigned int submenus[7],submenus_old[7];
|
||||||
int opt, i;
|
int opt, i;
|
||||||
|
unsigned char old_mode;
|
||||||
|
|
||||||
memset(submenus, 0, sizeof(submenus));
|
memset(submenus, 0, sizeof(submenus));
|
||||||
|
|
||||||
@ -381,6 +382,7 @@ static void emulation_settings(void)
|
|||||||
submenus[6] = !ordenador.ay_emul;
|
submenus[6] = !ordenador.ay_emul;
|
||||||
|
|
||||||
for (i=0; i<7; i++) submenus_old[i] = submenus[i];
|
for (i=0; i<7; i++) submenus_old[i] = submenus[i];
|
||||||
|
old_mode=ordenador.mode128k;
|
||||||
|
|
||||||
opt = menu_select_title("Emulation settings menu",
|
opt = menu_select_title("Emulation settings menu",
|
||||||
emulation_messages, submenus);
|
emulation_messages, submenus);
|
||||||
@ -388,7 +390,7 @@ static void emulation_settings(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
set_machine_model(submenus[0]);
|
set_machine_model(submenus[0]);
|
||||||
if (submenus[0] != submenus_old[0]) ResetComputer(); else
|
if (old_mode!=ordenador.mode128k) ResetComputer(); else
|
||||||
ordenador.ay_emul = !submenus[6];
|
ordenador.ay_emul = !submenus[6];
|
||||||
|
|
||||||
ordenador.volume = submenus[1]*2; //I should use set_volume() ?
|
ordenador.volume = submenus[1]*2; //I should use set_volume() ?
|
||||||
@ -982,7 +984,7 @@ static void save_load_general_configurations(int which)
|
|||||||
{
|
{
|
||||||
|
|
||||||
int retorno;
|
int retorno;
|
||||||
unsigned char old_bw,old_model;
|
unsigned char old_bw,old_mode;
|
||||||
char config_path[1024];
|
char config_path[1024];
|
||||||
int length;
|
int length;
|
||||||
FILE *fconfig;
|
FILE *fconfig;
|
||||||
@ -1009,10 +1011,10 @@ static void save_load_general_configurations(int which)
|
|||||||
if (which == 0) // Load config file
|
if (which == 0) // Load config file
|
||||||
{
|
{
|
||||||
old_bw = ordenador.bw;
|
old_bw = ordenador.bw;
|
||||||
old_model= get_machine_model();
|
old_mode= ordenador.mode128k;
|
||||||
if (!load_config(&ordenador,config_path)) msgInfo("General confs loaded",3000,NULL);
|
if (!load_config(&ordenador,config_path)) msgInfo("General confs loaded",3000,NULL);
|
||||||
if (old_bw!=ordenador.bw) computer_set_palete();
|
if (old_bw!=ordenador.bw) computer_set_palete();
|
||||||
if (old_model != get_machine_model()) ResetComputer();
|
if (old_mode != ordenador.mode128k) ResetComputer();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else // Delete config file
|
else // Delete config file
|
||||||
|
@ -495,7 +495,7 @@ void sound_play() {
|
|||||||
#ifdef GEKKO
|
#ifdef GEKKO
|
||||||
case SOUND_ASND: // ASND
|
case SOUND_ASND: // ASND
|
||||||
if (!started_sound_asnd) {
|
if (!started_sound_asnd) {
|
||||||
ASND_SetVoice(1,VOICE_MONO_8BIT,48000,0,sound[0],ordenador.buffer_len,
|
ASND_SetVoice(1,VOICE_MONO_8BIT_U,48000,0,sound[0],ordenador.buffer_len,
|
||||||
MID_VOLUME, MID_VOLUME, callback);
|
MID_VOLUME, MID_VOLUME, callback);
|
||||||
started_sound_asnd = 1;
|
started_sound_asnd = 1;
|
||||||
}
|
}
|
||||||
|
14
src/spk_ay.c
14
src/spk_ay.c
@ -230,7 +230,7 @@ inline void play_ay (unsigned int tstados) {
|
|||||||
(unsigned
|
(unsigned
|
||||||
char) ((((unsigned int) ordenador.
|
char) ((((unsigned int) ordenador.
|
||||||
ay_envel_value)) *
|
ay_envel_value)) *
|
||||||
(unsigned int) ordenador.volume) / 15;
|
(unsigned int) ordenador.volume) / 10;
|
||||||
else
|
else
|
||||||
ordenador.vol_a =
|
ordenador.vol_a =
|
||||||
(unsigned
|
(unsigned
|
||||||
@ -238,14 +238,14 @@ inline void play_ay (unsigned int tstados) {
|
|||||||
ay_registers[8] &
|
ay_registers[8] &
|
||||||
0x0F)) *
|
0x0F)) *
|
||||||
(unsigned int) ordenador.volume) /
|
(unsigned int) ordenador.volume) /
|
||||||
15);
|
10);
|
||||||
|
|
||||||
if (ordenador.ay_registers[10] & 0x10)
|
if (ordenador.ay_registers[10] & 0x10)
|
||||||
ordenador.vol_c =
|
ordenador.vol_c =
|
||||||
(unsigned
|
(unsigned
|
||||||
char) ((((unsigned int) ordenador.
|
char) ((((unsigned int) ordenador.
|
||||||
ay_envel_value)) *
|
ay_envel_value)) *
|
||||||
(unsigned int) ordenador.volume) / 15;
|
(unsigned int) ordenador.volume) / 10;
|
||||||
else
|
else
|
||||||
ordenador.vol_c =
|
ordenador.vol_c =
|
||||||
(unsigned
|
(unsigned
|
||||||
@ -253,14 +253,14 @@ inline void play_ay (unsigned int tstados) {
|
|||||||
ay_registers[10] &
|
ay_registers[10] &
|
||||||
0x0F)) *
|
0x0F)) *
|
||||||
(unsigned int) ordenador.volume) /
|
(unsigned int) ordenador.volume) /
|
||||||
15);
|
10);
|
||||||
|
|
||||||
if (ordenador.ay_registers[9] & 0x10)
|
if (ordenador.ay_registers[9] & 0x10)
|
||||||
ordenador.vol_b =
|
ordenador.vol_b =
|
||||||
(unsigned
|
(unsigned
|
||||||
char) ((((unsigned int) ordenador.
|
char) ((((unsigned int) ordenador.
|
||||||
ay_envel_value)) *
|
ay_envel_value)) *
|
||||||
(unsigned int) ordenador.volume) / 15;
|
(unsigned int) ordenador.volume) / 10;
|
||||||
else
|
else
|
||||||
ordenador.vol_b =
|
ordenador.vol_b =
|
||||||
(unsigned
|
(unsigned
|
||||||
@ -268,7 +268,7 @@ inline void play_ay (unsigned int tstados) {
|
|||||||
ay_registers[9] &
|
ay_registers[9] &
|
||||||
0x0F)) *
|
0x0F)) *
|
||||||
(unsigned int) ordenador.volume) /
|
(unsigned int) ordenador.volume) /
|
||||||
15);
|
10);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -292,7 +292,7 @@ inline void play_sound (unsigned int tstados) {
|
|||||||
for (bucle = 0; bucle < ordenador.increment; bucle++) {
|
for (bucle = 0; bucle < ordenador.increment; bucle++) {
|
||||||
sample_v = ordenador.sample1b[bucle];
|
sample_v = ordenador.sample1b[bucle];
|
||||||
if ((ordenador.sound_bit) && (sample_v))
|
if ((ordenador.sound_bit) && (sample_v))
|
||||||
ordenador.sound_current_value=ordenador.volume*4;
|
ordenador.sound_current_value=ordenador.volume*6;
|
||||||
else ordenador.sound_current_value=0;
|
else ordenador.sound_current_value=0;
|
||||||
value = ordenador.sound_current_value;
|
value = ordenador.sound_current_value;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user