diff --git a/arch/nds/audio.c b/arch/nds/audio.c index 4a03f0bee..38281faef 100644 --- a/arch/nds/audio.c +++ b/arch/nds/audio.c @@ -539,7 +539,7 @@ void init_audio_platform(struct config_info *conf) pcs_frequency = 0; pcs_duration = 0; - // master volume init + // global volume init nds_sound_volume(10); // maxmod init diff --git a/config.sh b/config.sh index aa306a2ce..793bf0aa4 100755 --- a/config.sh +++ b/config.sh @@ -684,7 +684,7 @@ if [ "$PLATFORM" = "unix" ] || [ "$PLATFORM" = "darwin" ]; then echo "#define SHAREDIR \"$SHAREDIR/megazeux/\"" >> src/config.h echo "#define LICENSEDIR \"$LICENSEDIR/megazeux/\"" >> src/config.h else - LICENSEDIR=$SHAREDIR + LICENSEDIR="." GAMESDIR=$SHAREDIR BINDIR=$SHAREDIR echo "#define CONFFILE \"config.txt\"" >> src/config.h diff --git a/config.txt b/config.txt index 3d3151222..f63205495 100644 --- a/config.txt +++ b/config.txt @@ -235,7 +235,7 @@ # enable_oversampling = 0 -# Set master resample mode. This affects how OGGs, SAMs, WAVs, and +# Set global resample mode. This affects how OGGs, SAMs, WAVs, RADs, and # frequency shifted modules sound. Choices are: # none (fastest, poor quality) # linear (fast, good quality) diff --git a/src/about.c b/src/about.c index fa0f5dd16..8d6eb6b0c 100644 --- a/src/about.c +++ b/src/about.c @@ -24,6 +24,7 @@ #include "io/path.h" #include "io/vio.h" +#include #include #ifdef CONFIG_SDL @@ -211,8 +212,8 @@ static void load_license_list(char *names[MAX_FILES], char *files[MAX_FILES], vdir *dir; enum vdir_type type; char buf[MAX_PATH]; - int license = -1; - int license_3rd = -1; + char *license = NULL; + char *license_3rd = NULL; int num_files = 0; int i = 0; @@ -227,21 +228,28 @@ static void load_license_list(char *names[MAX_FILES], char *files[MAX_FILES], if(type == DIR_TYPE_DIR) continue; - if((!strcasecmp(buf, "LICENSE") || !strcasecmp(buf, "LICENSE.")) && license == -1) + if((!strcasecmp(buf, "LICENSE") || !strcasecmp(buf, "LICENSE.")) && !license) { - names[num_files] = about_line("License"); - files[num_files++] = about_line("%s", buf); - license = i; + license = about_line("%s", buf); } else - if(!strcasecmp(buf, "LICENSE.3rd") && license_3rd == -1) + if(!strcasecmp(buf, "LICENSE.3rd") && !license_3rd) { - names[num_files] = about_line("3rd Party"); - files[num_files++] = about_line("%s", buf); - license_3rd = i; + license_3rd = about_line("%s", buf); } } + // MegaZeux's license should always go first. + if(license) + { + names[num_files] = about_line("License"); + files[num_files++] = license; + } + if(license_3rd) + { + names[num_files] = about_line("3rd Party"); + files[num_files++] = license_3rd; + } // Pass 2: add all other license files. vdir_rewind(dir); @@ -260,7 +268,10 @@ static void load_license_list(char *names[MAX_FILES], char *files[MAX_FILES], #ifdef CONFIG_DJGPP else - if(!strncasecmp(buf, "LICENS~1.", 9) && buf[9]) + /* Even if the extensions are completely different, having multiple of + * these licenses might cause SFN numbers greater than 1. */ + if(!strncasecmp(buf, "LICENS~", 7) && isdigit((unsigned char)buf[7]) && + buf[8] == '.' && buf[9] != '\0') { names[num_files] = about_line("%-.16s", buf + 9); files[num_files++] = about_line("%s", buf); diff --git a/src/audio/audio.c b/src/audio/audio.c index 13acbf938..f532e3835 100644 --- a/src/audio/audio.c +++ b/src/audio/audio.c @@ -252,7 +252,7 @@ void init_audio(struct config_info *conf) #endif audio.output_frequency = conf->output_frequency; - audio.master_resample_mode = conf->resample_mode; + audio.global_resample_mode = conf->resample_mode; audio.max_simultaneous_samples = -1; audio.max_simultaneous_samples_config = conf->max_simultaneous_samples; diff --git a/src/audio/audio_struct.h b/src/audio/audio_struct.h index c4d42af93..d6153db36 100644 --- a/src/audio/audio_struct.h +++ b/src/audio/audio_struct.h @@ -108,7 +108,7 @@ struct audio size_t buffer_samples; size_t output_frequency; - unsigned int master_resample_mode; + unsigned int global_resample_mode; int max_simultaneous_samples; int max_simultaneous_samples_config; diff --git a/src/audio/sampled_stream.cpp b/src/audio/sampled_stream.cpp index 110ca5965..f861eec8d 100644 --- a/src/audio/sampled_stream.cpp +++ b/src/audio/sampled_stream.cpp @@ -312,7 +312,7 @@ void sampled_mix_data(struct sampled_stream *s_src, int16_t *src_buffer = (int16_t *)(output_data + s_src->prologue_length); size_t write_len = dest_frames * dest_channels; int volume = ((struct audio_stream *)s_src)->volume; - int resample_mode = audio.master_resample_mode + 1; + int resample_mode = audio.global_resample_mode + 1; enum mixer_volume use_volume = DYNAMIC; enum mixer_channels use_channels = STEREO; diff --git a/src/configure.c b/src/configure.c index f051f78f7..02b5f29dd 100644 --- a/src/configure.c +++ b/src/configure.c @@ -112,7 +112,7 @@ #ifdef CONFIG_DJGPP #define RESAMPLE_MODE_DEFAULT RESAMPLE_MODE_NONE -#define MOD_RESAMPLE_MODE_DEFAULT RESAMPLE_MODE_NONE +#define MOD_RESAMPLE_MODE_DEFAULT RESAMPLE_MODE_LINEAR #define FULLSCREEN_DEFAULT 1 // Uncomment if Ogg Vorbis files need to be forced into memory. //#define VFS_ENABLE_DEFAULT true diff --git a/src/editor/debug.c b/src/editor/debug.c index 38c9824fd..dba676b09 100644 --- a/src/editor/debug.c +++ b/src/editor/debug.c @@ -2356,6 +2356,15 @@ enum board_node_ids NUM_BOARD_NODES }; +/** + * Some variable values may be cached, such as the clock time. + * This resets those values so they will update when the var list refreshes. + */ +static void clear_cached_data(struct world *mzx_world) +{ + mzx_world->command_cache = 0; +} + // Create new counter lists. // (Re)make the child nodes static void repopulate_tree(struct world *mzx_world, struct debug_node *root) @@ -2367,6 +2376,8 @@ static void repopulate_tree(struct world *mzx_world, struct debug_node *root) // Clear the debug tree recursively (but preserve the base structure). clear_debug_tree(root, false); + clear_cached_data(mzx_world); + // Initialize the tree. init_counters_node(mzx_world, &(root->nodes[NODE_COUNTERS])); init_strings_node(mzx_world, &(root->nodes[NODE_STRINGS])); @@ -3277,8 +3288,11 @@ void __debug_counters(context *ctx) } } if(focus->refresh_on_focus) + { + clear_cached_data(mzx_world); for(i = 0; i < focus->num_vars; i++) read_var(mzx_world, &(focus->vars[i])); + } // If the current position in the tree was changed by a search, bring it // to focus in the tree list. This should only be used after a search. diff --git a/src/legacy_board.c b/src/legacy_board.c index c5967d2d5..a53103d43 100644 --- a/src/legacy_board.c +++ b/src/legacy_board.c @@ -446,8 +446,11 @@ int legacy_load_board_direct(struct world *mzx_world, struct board *cur_board, cur_board->scroll_x = (signed char)vfgetc(vf); cur_board->scroll_y = (signed char)vfgetc(vf); - // Fix world default centered value for message column... - if(!savegame && cur_board->b_mesg_col == 0) + // World files have different values to indicate centered messages, + // typically -128. VER1TO2 fixes values <=0 and >=80. However, in save + // files 0 corresponds to column 0 (as with later versions). + if(cur_board->b_mesg_col < 0 || cur_board->b_mesg_col >= 80 || + (!savegame && cur_board->b_mesg_col == 0)) cur_board->b_mesg_col = -1; } }