fork/GramFirmware
git clone https://git.julia.blue/fork/GramFirmware
1f92ae6
v0.1.1
1#include "modes/extra/ShovelKnight.hpp" 2 3#define ANALOG_STICK_MIN 1 4#define ANALOG_STICK_NEUTRAL 128 5#define ANALOG_STICK_MAX 255 6 7ShovelKnight ::ShovelKnight (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 ShovelKnight ::UpdateDigitalOutputs (InputState & inputs ,OutputState & outputs ) { 18outputs .dpadLeft = inputs .left ; 19outputs .dpadRight = inputs .right ; 20outputs .dpadDown = inputs .down ; 21outputs .dpadUp = inputs .mod_x ; 22 23outputs .b = inputs .x ;// Jump 24outputs .a = inputs .a ;// Attack 25outputs .y = inputs .b ;// Attack 26outputs .x = inputs .z ;// Subweapon 27outputs .buttonL = inputs .r ;// Subweapon prev 28outputs .buttonR = inputs .y ;// Subweapon next 29 30outputs .select = inputs .lightshield ;// Inventory 31outputs .start = inputs .start ;// Pause 32} 33 34void ShovelKnight ::UpdateAnalogOutputs (InputState & inputs ,OutputState & outputs ) { 35UpdateDirections ( 36inputs .left , 37inputs .right , 38inputs .down , 39inputs .mod_x , 40inputs .c_left , 41inputs .c_right , 42inputs .c_down , 43inputs .c_up , 44ANALOG_STICK_MIN , 45ANALOG_STICK_NEUTRAL , 46ANALOG_STICK_MAX , 47outputs 48 ); 49}