Skip to content

Commit

Permalink
add safety codeset option
Browse files Browse the repository at this point in the history
  • Loading branch information
JLaferri committed Dec 22, 2021
1 parent beb3f22 commit dc277ac
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 3 deletions.
44 changes: 44 additions & 0 deletions common/config/MeleeCodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include "../../kernel/gecko/g_screen_wide.h" // Screen: Widescreen
#include "../../kernel/gecko/g_screen_wide_shutters.h" // Screen: 4:3 -> 73:60

#include "../../kernel/gecko/g_safety.h" // Safety codeset

#define NULL ((void *)0)

/***************************************
Expand Down Expand Up @@ -412,6 +414,47 @@ const MeleeCodeLineItem screenLineItem = {
screenOptions,
};

/***************************************
* Version Options
***************************************/
const MeleeCodeOption safetyOptionOff = {
1,
"Off",
0,
NULL,
};

const MeleeCodeOption safetyOptionOn = {
2,
"On",
g_safety_size,
g_safety,
};

const MeleeCodeOption *safetyOptions[MELEE_CODES_SAFETY_OPTION_COUNT] = {
&safetyOptionOff,
&safetyOptionOn,
};

static const char *safetyDescription[] = {
"Codes used for tournament safety.",
"",
" [On]",
" Force 1.0 Damage Ratio",
" Pause always on for timed mode",
" Pause always on for 5+ stock",
NULL
};

const MeleeCodeLineItem safetyLineItem = {
MELEE_CODES_SAFETY_OPTION_ID, // identifier
"Safety",
safetyDescription,
1,
MELEE_CODES_SAFETY_OPTION_COUNT,
safetyOptions,
};

/***************************************
* Combine Everything
***************************************/
Expand All @@ -423,6 +466,7 @@ const MeleeCodeLineItem *meleeCodeLineItems[] = {
&stagesLineItem,
&gameplayLineItem,
&screenLineItem,
&safetyLineItem,
};

const MeleeCodeConfig mcconfig = {
Expand Down
6 changes: 4 additions & 2 deletions common/config/MeleeCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define MELEE_CODES_STAGES_OPTION_COUNT 3
#define MELEE_CODES_SCREEN_OPTION_COUNT 3
#define MELEE_CODES_GAMEPLAY_OPTION_COUNT 4
#define MELEE_CODES_SAFETY_OPTION_COUNT 2

#define MELEE_CODES_CF_OPTION_ID 0
#define MELEE_CODES_VERSION_OPTION_ID 1
Expand All @@ -16,12 +17,13 @@
#define MELEE_CODES_STAGES_OPTION_ID 4
#define MELEE_CODES_GAMEPLAY_OPTION_ID 5
#define MELEE_CODES_SCREEN_OPTION_ID 6
#define MELEE_CODES_SAFETY_OPTION_ID 7

// Indicates the maximum number possible for ID. This is important in case the line items change,
// we don't want to persist setting values for a different line item
#define MELEE_CODES_MAX_ID 6
#define MELEE_CODES_MAX_ID 7

#define MELEE_CODES_LINE_ITEM_COUNT 7
#define MELEE_CODES_LINE_ITEM_COUNT 8

#define MELEE_CODES_WIDE_SHUTTERS_VALUE 2
#define MELEE_CODES_WIDE_VALUE 3
Expand Down
2 changes: 1 addition & 1 deletion common/include/NintendontVersion.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef __NINTENDONT_VERSION_H__
#define __NINTENDONT_VERSION_H__

#define NIN_VERSION "1.9.2"
#define NIN_VERSION "1.9.3"

#endif
Binary file modified kernel/gecko/g_core.bin
Binary file not shown.
Binary file modified kernel/gecko/g_core_porta.bin
Binary file not shown.
Binary file added kernel/gecko/g_safety.bin
Binary file not shown.

0 comments on commit dc277ac

Please sign in to comment.