mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-10-30 08:01:01 +00:00
Fixed warnings, changed version/game strings
This commit is contained in:
parent
0a4dfd17a4
commit
d60349663e
4 changed files with 37 additions and 18 deletions
|
|
@ -530,14 +530,15 @@ s64 m64_read_s64(struct M64ScriptState* state) {
|
||||||
assert(state != NULL);
|
assert(state != NULL);
|
||||||
assert(state->pc != NULL);
|
assert(state->pc != NULL);
|
||||||
#endif
|
#endif
|
||||||
s64 ret = *(state->pc++) << 56;
|
s64 ret = 0;
|
||||||
ret = (*(state->pc++) << 48) | ret;
|
ret = (((u64)*(state->pc++)) << 56) | ret;
|
||||||
ret = (*(state->pc++) << 40) | ret;
|
ret = (((u64)*(state->pc++)) << 48) | ret;
|
||||||
ret = (*(state->pc++) << 32) | ret;
|
ret = (((u64)*(state->pc++)) << 40) | ret;
|
||||||
ret = (*(state->pc++) << 24) | ret;
|
ret = (((u64)*(state->pc++)) << 32) | ret;
|
||||||
ret = (*(state->pc++) << 16) | ret;
|
ret = (((u64)*(state->pc++)) << 24) | ret;
|
||||||
ret = (*(state->pc++) << 8) | ret;
|
ret = (((u64)*(state->pc++)) << 16) | ret;
|
||||||
ret = *(state->pc++) | ret;
|
ret = (((u64)*(state->pc++)) << 8) | ret;
|
||||||
|
ret = (((u64)*(state->pc++)) << 0) | ret;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2365,7 +2366,6 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) {
|
||||||
s32 i;
|
s32 i;
|
||||||
u8 u8v;
|
u8 u8v;
|
||||||
u16 u16v;
|
u16 u16v;
|
||||||
u32 u32v;
|
|
||||||
u64 u64v;
|
u64 u64v;
|
||||||
u8 *tempPtr;
|
u8 *tempPtr;
|
||||||
struct M64ScriptState *state;
|
struct M64ScriptState *state;
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,6 @@
|
||||||
|
|
||||||
#ifdef COOPNET
|
#ifdef COOPNET
|
||||||
|
|
||||||
#ifdef DEVELOPMENT
|
|
||||||
#define CN_GAME_STR "sm64ex-dev"
|
|
||||||
#else
|
|
||||||
#define CN_GAME_STR "sm64ex-coop"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
uint64_t gCoopNetDesiredLobby = 0;
|
uint64_t gCoopNetDesiredLobby = 0;
|
||||||
char gCoopNetPassword[64] = "";
|
char gCoopNetPassword[64] = "";
|
||||||
char sCoopNetDescription[256] = "";
|
char sCoopNetDescription[256] = "";
|
||||||
|
|
@ -35,7 +29,7 @@ bool ns_coopnet_query(QueryCallbackPtr callback, QueryFinishCallbackPtr finishCa
|
||||||
gCoopNetCallbacks.OnLobbyListGot = callback;
|
gCoopNetCallbacks.OnLobbyListGot = callback;
|
||||||
gCoopNetCallbacks.OnLobbyListFinish = finishCallback;
|
gCoopNetCallbacks.OnLobbyListFinish = finishCallback;
|
||||||
if (coopnet_initialize() != COOPNET_OK) { return false; }
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -202,12 +196,12 @@ void ns_coopnet_update(void) {
|
||||||
if (sReconnecting) {
|
if (sReconnecting) {
|
||||||
LOG_INFO("Update lobby");
|
LOG_INFO("Update lobby");
|
||||||
coopnet_populate_description();
|
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 {
|
} else {
|
||||||
LOG_INFO("Create lobby");
|
LOG_INFO("Create lobby");
|
||||||
snprintf(gCoopNetPassword, 64, "%s", configPassword);
|
snprintf(gCoopNetPassword, 64, "%s", configPassword);
|
||||||
coopnet_populate_description();
|
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) {
|
} else if (sNetworkType == NT_CLIENT) {
|
||||||
LOG_INFO("Join lobby");
|
LOG_INFO("Join lobby");
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,19 @@ static char sVersionString[MAX_VERSION_LENGTH] = { 0 };
|
||||||
static char sLocalVersionString[MAX_LOCAL_VERSION_LENGTH] = { 0 };
|
static char sLocalVersionString[MAX_LOCAL_VERSION_LENGTH] = { 0 };
|
||||||
|
|
||||||
char* get_version(void) {
|
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) {
|
if (MINOR_VERSION_NUMBER > 0) {
|
||||||
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s %d.%d %s", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, VERSION_REGION);
|
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s %d.%d %s", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, VERSION_REGION);
|
||||||
} else {
|
} else {
|
||||||
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s %d %s", VERSION_TEXT, VERSION_NUMBER, VERSION_REGION);
|
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s %d %s", VERSION_TEXT, VERSION_NUMBER, VERSION_REGION);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return sVersionString;
|
return sVersionString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -18,6 +26,22 @@ char* get_version_local(void) {
|
||||||
if (PATCH_VERSION_NUMBER <= 0) {
|
if (PATCH_VERSION_NUMBER <= 0) {
|
||||||
return get_version();
|
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);
|
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;
|
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
|
||||||
|
}
|
||||||
|
|
@ -20,5 +20,6 @@
|
||||||
#define MAX_LOCAL_VERSION_LENGTH 36
|
#define MAX_LOCAL_VERSION_LENGTH 36
|
||||||
char* get_version(void);
|
char* get_version(void);
|
||||||
char* get_version_local(void);
|
char* get_version_local(void);
|
||||||
|
char* get_game_name(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue