Not receiving some input keys? (L, R, X, Y, TOUCH)

Post Reply
Senshi
Posts: 7
Joined: Wed Mar 16, 2011 2:29 am

Not receiving some input keys? (L, R, X, Y, TOUCH)

Post by Senshi » Wed Mar 16, 2011 2:42 am

Hello everyone,

I'm new to console programming (but with experience in UnityScript, real Javascript and Python). So far I'm happily following along the dev-scene tutorial, but I noticed something odd: Keys L, R, X, Y and TOUCH don't seem to register. I searched quite a bit for a solution, but all I was able to find were a few people experiencing the same issue.
I'm developing on OSX, so I couldn't try it out on any other emulator than DeSmuME. However, the buttons work fine on a ROM I downloaded (just for this occasion, mind you), so I suspect devkitARM/ libnds to be the culprit. Also, though I'm pretty sure it's not the code (as A, B, UP, DOWN, etc. work fine), here's my ARM9 main.c:

Code: Select all

#include <nds.h>
#include <stdio.h>

int main(void){
	consoleDemoInit(); //enable printf
	while(1){
		scanKeys();
		int held = keysHeld();
		
		if(held & KEY_A){
			printf("Key A is pressed!\n");
		}
		else{
			printf("Key A is released!\n");
		}
		if(held & KEY_B){
			printf("Key B is pressed!\n");
		}
		else{
			printf("Key B is released!\n");
		}
		if(held & KEY_X){
			printf("Key X is pressed!\n");
		}
		else{
			printf("Key X is released!\n");
		}
		if(held & KEY_Y){
			printf("Key Y is pressed!\n");
		}
		else{
			printf("Key Y is released!\n");
		}
		if(held & KEY_TOUCH){
			printf("Touchpad is touched!\n");
		}
		else{
			printf("Touchpad is not touched!\n");
		}		
		swiWaitForVBlank();
		consoleClear();
	}	
	return 0;
}
Any help would be much appreciated,
Patrick

WinterMute
Site Admin
Posts: 1845
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Not receiving some input keys? (L, R, X, Y, TOUCH)

Post by WinterMute » Wed Mar 16, 2011 11:05 am

You need Desmume 0.9.7, previous versions didn't emulate the FIFO hardware sufficiently for recent libnds versions.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Senshi
Posts: 7
Joined: Wed Mar 16, 2011 2:29 am

Re: Not receiving some input keys? (X, Y, TOUCH)

Post by Senshi » Wed Mar 16, 2011 11:46 am

Ah, thanks for you reply. Guess I'm out for now then though. From their site: "The latest version is 0.9.7 ; but we haven’t made the OSX build yet". Glad to know it's not just me though.

Thanks again,
Patrick

PS: I made a small boo-boo, L and R are working fine, it seems to just be the input from ARM7.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests