Skip to content

Instantly share code, notes, and snippets.

@emiyl
Last active June 3, 2025 19:26
Show Gist options
  • Select an option

  • Save emiyl/84612b2b1252a417a5a8a51251c374bd to your computer and use it in GitHub Desktop.

Select an option

Save emiyl/84612b2b1252a417a5a8a51251c374bd to your computer and use it in GitHub Desktop.
TWEWY NDS Memory Mappings
// This list is incomplete and is comprised of only the psychs that I had in my deck while making it
Enum PsychActivationType {
PAT_TOUCH_PIN = 0x0
PAT_SLASH_NEKU = 0x1,
PAT_SLASH_ENEMY = 0x5,
PAT_TAP_MULTIPLE_ENEMY = 0x6,
PAT_SCRATCH_ENEMY = 0x8,
PAT_PRESS_ENEMY = 0x9,
PAT_SLASH_OBJECT = 0xE,
PAT_SLASH_VERTICAL_EMPTY_SPACE = 0x12,
PAT_TAP_EMPTY_SPACE = 0x13,
PAT_SCRATCH_EMPTY_SPACE = 0x15,
PAT_TAP_EMPTY_SPACE_FRAGMENTED = 0x16,
PAT_DRAG_EMPTY_SPACE = 0x17,
PAT_NONE = 0xFF
};
// This list is what determines the "Psych" field on the top screen of the pin menu
enum PsychDescription {
PD_SPARK_CORE_C,
PD_FLAME_CORE_S,
PD_SPLASH_CORE_T,
PD_ENERGY_ROUNDS_S,
PD_FORCE_ROUNDS_T,
PD_PATROL_ROUNDS_S,
PD_PATROL_ROUNDS_T,
PD_BURST_ROUNDS_P,
PD_PIERCING_PILLAR_S,
PD_PIERCING_PILLAR_R,
PD_LIGHTNING_BOLT_S,
PD_LIGHTNING_ARRESTER_T,
PD_FREEZE_P,
PD_ROCK_BIND_T,
PD_DISCHARGE_R,
PD_DISCHARGE_H,
PD_HOLY_LIGHT_D,
PD_IGNITION_H,
PD_FROSTBITE_R,
PD_PYROKINESIS_D,
PD_FLAME_PAST_P,
PD_SWEEPER_P,
PD_BLACK_HOLE_C,
PD_FIRE_BARRIER_P,
PD_AQUA_BARRIER_P,
PD_DARK_BARRIER_P,
PD_EARTHQUAKE_H,
PD_TWISTER_M,
PD_VELOCITY_ATTACK_D,
PD_VELOCITY_CRASH_D,
PD_INVISIBILITY_D,
PD_TIME_BOMB_T,
PD_EXPLOSION_P,
PD_PRESSURE_MINE_P,
PD_TELEPORT_T,
PD_ACROBATIC_SPIKE_T,
PD_SHOCKWAVE_S,
PD_MASSIVE_HIT_P,
PD_LANCE_LUNGE_T,
PD_SPEAR_STRIKE_S,
PD_STELLAR_FLURRY_R,
PD_VORTEX_SABER_M,
PD_VORTEX_SABER_C,
PD_VULCAN_UPPERCUT_S,
PD_GRAVE_MARKER_S,
PD_PSYCHOKINESIS_T,
PD_PSYCHOKINESIS_S,
PD_PSYCHOKINESIS_D,
PD_APPORT_T,
PD_APPORT_C,
PD_THUNDERBOLT_T,
PD_THUNDERSTORM_D,
PD_THUNDERCLOUD_P,
PD_ENTANGLEMENT_S,
PD_STREET_JAM_M,
PD_CURE_DRINK_B,
PD_HEALING_B,
PD_SUMMON_RHYME_T,
PD_NEXUS_RAY_P_1,
PD_NEXUS_RAY_P_2,
PD_IRREGULAR_NOTE_B,
PD_SUBCONSCIOUS_A_1,
PD_SUBCONSCIOUS_A_2,
PD_SUBCONSCIOUS_A_3,
PD_DEBUG
};
enum Brand {
MUS_RATTUS,
D_PLUS_B,
TIGRE_PUNKS,
LAPIN_ANGELIQUE,
DRAGON_COUUTURE,
HIP_SNAKE,
PEGASO,
SHEEP_HEAVENLY,
J_OF_THE_M,
PAVO_REAL,
NATURAL_PUPPY,
WILD_BOAR,
GATITO,
UNBRANDED // everything above this value, through to 255, is also unbranded
};
enum Class {
ANGEL,
REAPER,
A,
B,
C,
};
// ...
struct EquippedPin current_equipped_pins[6]; // 0x02071D84
struct StockpilePin stockpile_pins[256]; // 0x02071DC0
// ...
struct EquippedPin pin_decks[4][6]; // 0x02073AD2
// ...
struct MasteredPin mastered_pins[204]; // 0x020727C0
// ...
struct UnknownPinStruct unknown_pin_decks[4][6]; // 0x023984C4
#typedef u16 Psych_t
// Default values are shown in comments, as =[default]
// For pin structs, the default is defined as having no pin
struct EquippedPin {
u16 id; // =65535
u16 battle_pp; // When no pin, 0, when mastered, 80
u16 mingle_pp; // =0
u16 shutdown_pp; // =0
u16 unknown_0; // =0
u4 unknown_1; // When no pin, =0. When there is a pin, 8.
u4 level; // =1
};
struct StockpilePin {
u16 id; // =65535
u16 battle_pp; // =0
u16 mingle_pp; // =0
u16 shutdown_pp; // =0
u4 unknown_0; // When no pin, =0. When there is a pin, =8.
u4 level; // =1
u8 unknown_1; // =0
};
struct MasteredPin {
u16 id; // =65535
u8 count; // =0
u8 level; // =100
};
struct UnknownPinStruct {
u16 text_id; // =65535, this displays the "No. 86" in the top right hand corner of the pin menu
u16 battle_pp; // =0, for mastered pins this is 80
u16 mingle_pp; // =0, for mastered pins this is 80
u16 shutdown_pp; // =0, for mastered pins this is 80
u16 unknown_0; // =0
u16 total_pp; // =0, for mastered pins this is sometimes 240, sometimes 65535
u16 pp_level_up_req; // =0, this is the total cumulative required PP to move a pin to the next level
u16 unknown_3; // =0
u8 unknown_4; // =0
u8 pp_bar_scale; // =0, the PP bar on the top screen seems to decrease in length inversely to the size of this value
u16 unknown_5; // =0
u8 level_0; // =0
u8 unknown_6; // =0
u16 unknown_7; // =0
u16 unknown_8; // =1
u16 icon_id; // =0, this changes the ID of the pin icon on the top screen in the pin menu
u16 psych_description; // =0, use PsychDescription enum
u8 unknown_11; // =255
u8 brand; // =255, use Brand enum
u8 class; // =0, use Class enum
u8 unknown_12; // =5
u16 unknown_13; // =0
// No clue how these are encoded, I'll write about it later
// Just 6 bytes here, idk if it's three u16s, that's just there for placeholder
u16 yen_0; // =0
u16 yen_1; // =0
u16 yen_2; // =0
u16 base_attack; // =0
u16 unknown_18; // =0
u16 unknown_19; // =0
u16 usage_limit; // =0
u16 unknown_21; // =0
u16 unknown_22; // =0
u16 reboot_period; // =0, this is counted in 1/60s of a second, e.g. 180 = 3s
u16 unknown_24; // =0
u16 unknown_25; // =0
u16 boot_period; // =0, this is counted in 1/60s of a second, e.g. 180 = 3s
u16 unknown_27; // =0
u16 unknown_28; // =0
u8 unknown_29; // =256
u8 max_level; // =100
u8 psych_type; // =0, use PsychActivationType Enum
// psych_type is fun, because the last byte always stays 00, but if you change it to another value, you can get text from other parts of the game! (e.g. FF gets Pin Names)
u8 tin_pin_weight; // =0
u8 tin_pin_spin; // =0
u8 tin_pin_ko_length; // =0
u8 tin_pin_stinger; // =0
u8 tin_pin_bomber; // =0
u8 tin_pin_hammer; // =0
u8 tin_pin_hand; // =0
u16 unknown_36; // =0
};
Offset Length Type Description Notes
02071D84 3C EquippedPin Equipped Pins Saved Pin Menu
02071DC0 A00 StockpilePin Stockpile Pins Saved Pin Menu
02073AD2 F0 EquippedPin Equipped Pins Saved Pin Menu
020727C0 4C0 MasteredPin Mastered Pins Saved Pin Menu
023984C4 + n * 4C u32 Equipped Pin #(n-1) ID When no pin, value is 0xFFFF
023984DE + n * 4C u32 Equipped Pin #(n-1) ID When no pin, value is 0x000
02398BE4 u32 Stockpile Pin #1 ID When no pin, value is 0xFFFF
02398BFE u32 Stockpile Pin #1 ID When no pin, value is 0x0000
0239D7E4 + n * 4C u32 Mastered Pin #(n-1) ID Working Pin Menu, only when in menu
0239D7FB + n * 4C u8 Mastered Pin #(n-1) Count
0239D7FE + n * 4C u32 Mastered Pin #(n-1) ID Working Pin Menu, only when in menu
023A329C u32 Pin ID of cursor hover When no pin, value is 0xFFFF
023A32B6 u32 Pin ID of cursor hover When no pin, value is 0x0000
023A32E8 u32 Pin ID of last stylus tap When no pin, value is 0x0000. When out of menu, value is 0xFFFF.
023A3302 u32 Pin ID of last stylus tap When no pin, value is 0xFfFF. When out of menu, value is 0x0000.
023A33D0 u32 Money
023A33F6 + n * 2 u32 Pin #(n-1) Count Only in Pin Menu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment