From 4259c5b833122fea0fadc726502240d25ef5bd21 Mon Sep 17 00:00:00 2001 From: eadmaster <51NMBsFda0ab1> Date: Mon, 7 Dec 2020 00:48:49 +0100 Subject: [PATCH] changed volumes array types to avoid casting (#223) --- libretro/libretro.c | 6 ++--- libretro/libretro_core_options.h | 38 ++++++++++++++++---------------- libretro/osd.h | 6 ++--- 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/libretro/libretro.c b/libretro/libretro.c index 4db8327b1..d9b56d520 100644 --- a/libretro/libretro.c +++ b/libretro/libretro.c @@ -940,9 +940,9 @@ static void config_default(void) config.ym2612 = YM2612_DISCRETE; config.ym2413 = 2; /* AUTO */ config.mono = 0; /* STEREO output */ - memset( config.psg_ch_volumes, 100, sizeof(config.psg_ch_volumes)); /* individual channel volumes */ - memset( config.md_ch_volumes, 100, sizeof(config.md_ch_volumes)); /* individual channel volumes */ - memset( config.sms_fm_ch_volumes, 100, sizeof(config.sms_fm_ch_volumes)); /* individual channel volumes */ + for (i = 0; i < 4; i++) config.psg_ch_volumes[i] = 100; /* individual channel volumes */ + for (i = 0; i < 6; i++) config.md_ch_volumes[i] = 100; /* individual channel volumes */ + for (i = 0; i < 9; i++) config.sms_fm_ch_volumes[i] = 100; /* individual channel volumes */ #ifdef HAVE_YM3438_CORE config.ym3438 = 0; #endif diff --git a/libretro/libretro_core_options.h b/libretro/libretro_core_options.h index 15610eaaf..3012b089a 100644 --- a/libretro/libretro_core_options.h +++ b/libretro/libretro_core_options.h @@ -602,7 +602,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_psg_channel_0_volume", "PSG Tone Channel 0 Volume %", - "Reduces the volume of the PSG Tone Channel 0.", + "Reduce the volume of the PSG Tone Channel 0.", { { "0", NULL }, { "10", NULL }, @@ -622,7 +622,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_psg_channel_1_volume", "PSG Tone Channel 1 Volume %", - "Reduces the volume of the PSG Tone Channel 1.", + "Reduce the volume of the PSG Tone Channel 1.", { { "0", NULL }, { "10", NULL }, @@ -642,7 +642,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_psg_channel_2_volume", "PSG Tone Channel 2 Volume %", - "Reduces the volume of the PSG Tone Channel 2.", + "Reduce the volume of the PSG Tone Channel 2.", { { "0", NULL }, { "10", NULL }, @@ -662,7 +662,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_psg_channel_3_volume", "PSG Noise Channel 3 Volume %", - "Reduces the volume of the PSG Noise Channel 3.", + "Reduce the volume of the PSG Noise Channel 3.", { { "0", NULL }, { "10", NULL }, @@ -682,7 +682,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_md_channel_0_volume", "Mega Drive / Genesis FM Channel 0 Volume %", - "Reduces the volume of the Mega Drive / Genesis FM Channel 0.", + "Reduce the volume of the Mega Drive / Genesis FM Channel 0.", { { "0", NULL }, { "10", NULL }, @@ -702,7 +702,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_md_channel_1_volume", "Mega Drive / Genesis FM Channel 1 Volume %", - "Reduces the volume of the Mega Drive / Genesis FM Channel 1.", + "Reduce the volume of the Mega Drive / Genesis FM Channel 1.", { { "0", NULL }, { "10", NULL }, @@ -722,7 +722,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_md_channel_2_volume", "Mega Drive / Genesis FM Channel 2 Volume %", - "Reduces the volume of the Mega Drive / Genesis FM Channel 2.", + "Reduce the volume of the Mega Drive / Genesis FM Channel 2.", { { "0", NULL }, { "10", NULL }, @@ -742,7 +742,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_md_channel_3_volume", "Mega Drive / Genesis FM Channel 3 Volume %", - "Reduces the volume of the Mega Drive / Genesis FM Channel 3.", + "Reduce the volume of the Mega Drive / Genesis FM Channel 3.", { { "0", NULL }, { "10", NULL }, @@ -762,7 +762,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_md_channel_4_volume", "Mega Drive / Genesis FM Channel 4 Volume %", - "Reduces the volume of the Mega Drive / Genesis FM Channel 4.", + "Reduce the volume of the Mega Drive / Genesis FM Channel 4.", { { "0", NULL }, { "10", NULL }, @@ -782,7 +782,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_md_channel_5_volume", "Mega Drive / Genesis FM Channel 5 Volume %", - "Reduces the volume of the Mega Drive / Genesis FM Channel 5.", + "Reduce the volume of the Mega Drive / Genesis FM Channel 5.", { { "0", NULL }, { "10", NULL }, @@ -802,7 +802,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_sms_fm_channel_0_volume", "Master System FM (YM2413) Channel 0 Volume %", - "Reduces the volume of the Master System FM Channel 0.", + "Reduce the volume of the Master System FM Channel 0.", { { "0", NULL }, { "10", NULL }, @@ -822,7 +822,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_sms_fm_channel_1_volume", "Master System FM (YM2413) Channel 1 Volume %", - "Reduces the volume of the Master System FM Channel 1.", + "Reduce the volume of the Master System FM Channel 1.", { { "0", NULL }, { "10", NULL }, @@ -842,7 +842,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_sms_fm_channel_2_volume", "Master System FM (YM2413) Channel 2 Volume %", - "Reduces the volume of the Master System FM Channel 2.", + "Reduce the volume of the Master System FM Channel 2.", { { "0", NULL }, { "10", NULL }, @@ -862,7 +862,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_sms_fm_channel_3_volume", "Master System FM (YM2413) Channel 3 Volume %", - "Reduces the volume of the Master System FM Channel 3.", + "Reduce the volume of the Master System FM Channel 3.", { { "0", NULL }, { "10", NULL }, @@ -882,7 +882,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_sms_fm_channel_4_volume", "Master System FM (YM2413) Channel 4 Volume %", - "Reduces the volume of the Master System FM Channel 4.", + "Reduce the volume of the Master System FM Channel 4.", { { "0", NULL }, { "10", NULL }, @@ -902,7 +902,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_sms_fm_channel_5_volume", "Master System FM (YM2413) Channel 5 Volume %", - "Reduces the volume of the Master System FM Channel 5.", + "Reduce the volume of the Master System FM Channel 5.", { { "0", NULL }, { "10", NULL }, @@ -922,7 +922,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_sms_fm_channel_6_volume", "Master System FM (YM2413) Channel 6 Volume %", - "Reduces the volume of the Master System FM Channel 6.", + "Reduce the volume of the Master System FM Channel 6.", { { "0", NULL }, { "10", NULL }, @@ -942,7 +942,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_sms_fm_channel_7_volume", "Master System FM (YM2413) Channel 7 Volume %", - "Reduces the volume of the Master System FM Channel 7.", + "Reduce the volume of the Master System FM Channel 7.", { { "0", NULL }, { "10", NULL }, @@ -962,7 +962,7 @@ struct retro_core_option_definition option_defs_us[] = { { "genesis_plus_gx_sms_fm_channel_8_volume", "Master System FM (YM2413) Channel 8 Volume %", - "Reduces the volume of the Master System FM Channel 8.", + "Reduce the volume of the Master System FM Channel 8.", { { "0", NULL }, { "10", NULL }, diff --git a/libretro/osd.h b/libretro/osd.h index da7df2f42..adde19dfa 100644 --- a/libretro/osd.h +++ b/libretro/osd.h @@ -129,9 +129,9 @@ typedef struct uint8 gun_cursor; uint32 overclock; uint8 no_sprite_limit; - uint8 psg_ch_volumes[4]; - uint8 md_ch_volumes[6]; - uint8 sms_fm_ch_volumes[9]; + unsigned int psg_ch_volumes[4]; + int32 md_ch_volumes[6]; + signed int sms_fm_ch_volumes[9]; } t_config; extern t_config config;