![]() | ||
Views: 23,780,812 |
Home
| Forums
| Uploader
| Wiki
| Object databases
| IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search |
02-07-25 11:47 AM |
Guest: |
0 users reading all button press values? | 1 bot |
Main - General SM64DS hacking - all button press values? | Hide post layouts | New reply |
isceptul |
| ||
![]() Red Paragoomba Sparsite dupe Level: 17 Posts: 33/54 EXP: 23085 Next: 1658 Since: 11-03-15 Last post: 3182 days ago Last view: 3035 days ago |
WELP! Didnt want to make a thread, but no one replied in the help thread, soooo...
I'm trying to write ASM for sm64ds and i need the player to be able to perform an action when they press a certain button. All that was given in the asm patch template folder was the button press values for B (0x00F) and the the values for either L or R being pressed (0xF00), i need to know what the rest of the button pressed values are. Thanks in advance! |
CodingKoopa |
| ||
![]() Lakitu she/her Level: 48 ![]() Posts: 274/560 EXP: 813628 Next: 9915 Since: 10-13-14 Last post: 1295 days ago Last view: 524 days ago |
This is code from the NSMB Hacking Template, but I'm pretty sure that it's applicable to any DS game.
keys.cpp: #include<nds.h>
static int keys, oldKeys, keysDw; static bool first = true; void myScanKeys() { first = false; int keys = ~REG_KEYINPUT; if(first) oldKeys = keys; keysDw = keys & ~oldKeys; oldKeys = keys; } int myKeysHeld() { return keys; } int myKeysDown() { return keysDw; } //Custom key reading funcs.
Your code hook:
void myScanKeys(); int myKeysHeld(); int myKeysDown(); #include "SM64DS.h"
bool doNothing = false; void hook_020e50ac() { if (CHARACTER == CHAR_Mario) { myScanKeys(); if (myKeysDown() & KEY_SELECT); { if (isOnGround) {doNothing = true; doNothing = false}; else {Player_PerformAction (MarioActor *, char 0x9A, unsigned int loop_related, unsigned short playspeed_20_12);)} } } } The possible values are as follows: KEY_A = BIT(0), //!< Keypad A button. KEY_B = BIT(1), //!< Keypad B button. KEY_SELECT = BIT(2), //!< Keypad SELECT button. KEY_START = BIT(3), //!< Keypad START button. KEY_RIGHT = BIT(4), //!< Keypad RIGHT button. KEY_LEFT = BIT(5), //!< Keypad LEFT button. KEY_UP = BIT(6), //!< Keypad UP button. KEY_DOWN = BIT(7), //!< Keypad DOWN button. KEY_R = BIT(8), //!< Right shoulder button. KEY_L = BIT(9), //!< Left shoulder button. KEY_X = BIT(10), //!< Keypad X button. KEY_Y = BIT(11), //!< Keypad Y button. KEY_TOUCH = BIT(12), //!< Touchscreen pendown. KEY_LID = BIT(13) //!< Lid state. ____________________ Website | Twitter ![]() |
Main - General SM64DS hacking - all button press values? | Hide post layouts | New reply |
Page rendered in 0.028 seconds. (2048KB of memory used) MySQL - queries: 28, rows: 197/197, time: 0.008 seconds. ![]() © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |