Fixed warnings, changed version/game strings

This commit is contained in:
MysterD 2023-05-03 01:12:13 -07:00
parent 0a4dfd17a4
commit d60349663e
4 changed files with 37 additions and 18 deletions

View file

@ -530,14 +530,15 @@ s64 m64_read_s64(struct M64ScriptState* state) {
assert(state != NULL);
assert(state->pc != NULL);
#endif
s64 ret = *(state->pc++) << 56;
ret = (*(state->pc++) << 48) | ret;
ret = (*(state->pc++) << 40) | ret;
ret = (*(state->pc++) << 32) | ret;
ret = (*(state->pc++) << 24) | ret;
ret = (*(state->pc++) << 16) | ret;
ret = (*(state->pc++) << 8) | ret;
ret = *(state->pc++) | ret;
s64 ret = 0;
ret = (((u64)*(state->pc++)) << 56) | ret;
ret = (((u64)*(state->pc++)) << 48) | ret;
ret = (((u64)*(state->pc++)) << 40) | ret;
ret = (((u64)*(state->pc++)) << 32) | ret;
ret = (((u64)*(state->pc++)) << 24) | ret;
ret = (((u64)*(state->pc++)) << 16) | ret;
ret = (((u64)*(state->pc++)) << 8) | ret;
ret = (((u64)*(state->pc++)) << 0) | ret;
return ret;
}
@ -2365,7 +2366,6 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
s32 i;
u8 u8v;
u16 u16v;
u32 u32v;
u64 u64v;
u8 *tempPtr;
struct M64ScriptState *state;

View file

@ -14,12 +14,6 @@
#ifdef COOPNET
#ifdef DEVELOPMENT
#define CN_GAME_STR "sm64ex-dev"
#else
#define CN_GAME_STR "sm64ex-coop"
#endif
uint64_t gCoopNetDesiredLobby = 0;
char gCoopNetPassword[64] = "";
char sCoopNetDescription[256] = "";
@ -35,7 +29,7 @@ bool ns_coopnet_query(QueryCallbackPtr callback, QueryFinishCallbackPtr finishCa
gCoopNetCallbacks.OnLobbyListGot = callback;
gCoopNetCallbacks.OnLobbyListFinish = finishCallback;
if (coopnet_initialize() != COOPNET_OK) { return false; }
if (coopnet_lobby_list_get(CN_GAME_STR, password) != COOPNET_OK) { return false; }
if (coopnet_lobby_list_get(get_game_name(), password) != COOPNET_OK) { return false; }
return true;
}
@ -202,12 +196,12 @@ void ns_coopnet_update(void) {
if (sReconnecting) {
LOG_INFO("Update lobby");
coopnet_populate_description();
coopnet_lobby_update(sLocalLobbyId, CN_GAME_STR, get_version(), configPlayerName, mode, sCoopNetDescription);
coopnet_lobby_update(sLocalLobbyId, get_game_name(), get_version(), configPlayerName, mode, sCoopNetDescription);
} else {
LOG_INFO("Create lobby");
snprintf(gCoopNetPassword, 64, "%s", configPassword);
coopnet_populate_description();
coopnet_lobby_create(CN_GAME_STR, get_version(), configPlayerName, mode, (uint16_t)configAmountofPlayers, gCoopNetPassword, sCoopNetDescription);
coopnet_lobby_create(get_game_name(), get_version(), configPlayerName, mode, (uint16_t)configAmountofPlayers, gCoopNetPassword, sCoopNetDescription);
}
} else if (sNetworkType == NT_CLIENT) {
LOG_INFO("Join lobby");

View file

@ -6,11 +6,19 @@ static char sVersionString[MAX_VERSION_LENGTH] = { 0 };
static char sLocalVersionString[MAX_LOCAL_VERSION_LENGTH] = { 0 };
char* get_version(void) {
#if defined(VERSION_US)
if (MINOR_VERSION_NUMBER > 0) {
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s %d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER);
} else {
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s %d", VERSION_TEXT, VERSION_NUMBER);
}
#else
if (MINOR_VERSION_NUMBER > 0) {
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s %d.%d %s", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, VERSION_REGION);
} else {
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s %d %s", VERSION_TEXT, VERSION_NUMBER, VERSION_REGION);
}
#endif
return sVersionString;
}
@ -18,6 +26,22 @@ char* get_version_local(void) {
if (PATCH_VERSION_NUMBER <= 0) {
return get_version();
}
#if defined(VERSION_US)
snprintf(sLocalVersionString, MAX_LOCAL_VERSION_LENGTH, "%s %d.%d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, PATCH_VERSION_NUMBER);
#else
snprintf(sLocalVersionString, MAX_LOCAL_VERSION_LENGTH, "%s %d.%d.%d %s", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, PATCH_VERSION_NUMBER, VERSION_REGION);
#endif
return sLocalVersionString;
}
char* get_game_name(void) {
#ifdef DEVELOPMENT
return "sm64ex-coop-dev";
#elif !defined(VERSION_US)
return "sm64ex-coop-intl";
#else
return "sm64ex-coop";
#endif
}

View file

@ -20,5 +20,6 @@
#define MAX_LOCAL_VERSION_LENGTH 36
char* get_version(void);
char* get_version_local(void);
char* get_game_name(void);
#endif