fork/GramFirmware
git clone https://git.julia.blue/fork/GramFirmware
1f92ae6
v0.1.0
1#include "modes/extra/SaltAndSanctuary.hpp" 2 3#define ANALOG_STICK_MIN 1 4#define ANALOG_STICK_NEUTRAL 128 5#define ANALOG_STICK_MAX 255 6 7SaltAndSanctuary ::SaltAndSanctuary (socd::SocdType socd_type ) { 8_socd_pair_count = 4 ; 9_socd_pairs = new socd::SocdPair [_socd_pair_count ]{ 10 socd::SocdPair {& InputState ::left ,& InputState ::right ,socd_type }, 11 socd::SocdPair {& InputState ::down ,& InputState ::mod_x ,socd_type }, 12 socd::SocdPair {& InputState ::c_left ,& InputState ::c_right ,socd_type }, 13 socd::SocdPair {& InputState ::c_down ,& InputState ::c_up ,socd_type }, 14 }; 15} 16 17void SaltAndSanctuary ::UpdateDigitalOutputs (InputState & inputs ,OutputState & outputs ) { 18outputs .dpadRight = inputs .l ;// Block 19outputs .b = inputs .b ;// Roll 20outputs .a = inputs .a ;// Attack 21outputs .y = inputs .z ;// Strong 22outputs .dpadDown = inputs .mod_y ;// Use 23outputs .x = inputs .x ;// Jump 24 25outputs .buttonL = inputs .r ;// Previous item 26outputs .buttonR = inputs .y ;// Next item 27outputs .triggerLDigital = inputs .lightshield ;// Use item 28 29outputs .triggerRDigital = inputs .midshield ;// Use torch 30 31outputs .dpadLeft = inputs .up ;// Switch loadout 32 33outputs .start = inputs .start ;// Inventory 34} 35 36void SaltAndSanctuary ::UpdateAnalogOutputs (InputState & inputs ,OutputState & outputs ) { 37// Coordinate calculations to make modifier handling simpler. 38UpdateDirections ( 39inputs .left , 40inputs .right , 41inputs .down , 42inputs .mod_x , 43inputs .c_left , 44inputs .c_right , 45inputs .c_down , 46inputs .c_up , 47ANALOG_STICK_MIN , 48ANALOG_STICK_NEUTRAL , 49ANALOG_STICK_MAX , 50outputs 51 ); 52}