No touch input on homebrew

Discuss anything about DraStic here.
Wolfgange
Posts:7
Joined:Tue May 26, 2015 11:33 am
No touch input on homebrew

Post by Wolfgange » Tue May 26, 2015 1:28 pm

I am developing an open source homebrew game for the DS and was hoping I could test it using drastic. For some reason, I am not able to get touch input to work using the emulator. I'm positive the emulator has not crashed. When outputing the touch data, I consistently see "0". Touch input works fine on actual DS roms, and I'm positive there is no X across the stylus in drastic's menu.

More information:
-I am using libnds (touchRead()) for handling touch input
-Here is the source code (I had to remove NiFi initialization to prevent drastic from crashing)
-I've attached my test nds file. I have it printing random numbers, to ensure the game hasn't crashed, and beneath I have it printing the touch input X.

Since the file is too large to attach (2MB), I've uploaded it to Google Drive:
https://drive.google.com/file/d/0B7VRus ... sp=sharing

Exophase
Posts:1715
Joined:Mon Aug 05, 2013 9:08 pm

Re: No touch input on homebrew

Post by Exophase » Tue May 26, 2015 1:36 pm

I'll check it out. There's a good chance it's triggering something that isn't working properly that normal games wouldn't due to all using the same Nitro ARM7 code. Homebrew sometimes uncovers this sort of thing. I do have other homebrew that touch works for, but I don't know if it's using libnds.

User avatar
ericbazinga
Posts:1123
Joined:Mon Apr 13, 2015 6:46 pm
Location:Somewhere in VRchat
Contact:

Re: No touch input on homebrew

Post by ericbazinga » Tue May 26, 2015 1:39 pm

Just wondering... What's the game about?
Image

You can also find me on Reddit (u/Ericbazinga) and Discord (in the DraStic Discord server). You'll find me in those places almost daily and here almost never.

Wolfgange
Posts:7
Joined:Tue May 26, 2015 11:33 am

Re: No touch input on homebrew

Post by Wolfgange » Tue May 26, 2015 1:46 pm

I've attached a simpler example pulled from the devkitPro examples. It has the source and compiled binary. I could not get this to work either.
In the case it is related to my setup, I'm running the Drastic Demo (Latest version), on a Samsung Galaxy Avant (Quad core, 1200 MHz, ARM Cortex-A7).
ericbazinga wrote:Just wondering... What's the game about?
It's essentially Minecraft for the DS, but in 2D.

Note: I realize now, I posted this in the wrong forum. I believe it should be in the help and compatibility section.
Attachments
hello_world.zip
(204.03KiB)Downloaded 347 times
Last edited by Wolfgange on Tue May 26, 2015 2:08 pm, edited 1 time in total.

Lordus
Posts:517
Joined:Mon Aug 05, 2013 9:05 pm

Re: No touch input on homebrew

Post by Lordus » Tue May 26, 2015 2:04 pm

The touch input works fine for me on both, your game and the devkitPro sample.
Which version of DraStic are you using?

Wolfgange
Posts:7
Joined:Tue May 26, 2015 11:33 am

Re: No touch input on homebrew

Post by Wolfgange » Tue May 26, 2015 2:07 pm

Lordus wrote:The touch input works fine for me on both, your game and the devkitPro sample.
Which version of DraStic are you using?
Drastic "r2.3.0.2a Demo build 29"

Edit: BTW, I have confirmed, pressing buttons work fine, but the bitwise libnds function for touch input ("if (keysHeld() & KEY_A)") does not work.

Lordus
Posts:517
Joined:Mon Aug 05, 2013 9:05 pm

Re: No touch input on homebrew

Post by Lordus » Tue May 26, 2015 2:24 pm

You're right, it doesn't work in the current demo release.
It works in the latest beta version, though.

Exophase
Posts:1715
Joined:Mon Aug 05, 2013 9:08 pm

Re: No touch input on homebrew

Post by Exophase » Tue May 26, 2015 2:27 pm

Well that's weird.

The only fix I can think of that could be related to this was the one that fixed the Syoban Action homebrew. It was relying on a BIOS call to not modify one of the caller save registers. Had to update the custom BIOS to use a different register.

You could try using a Nintendo BIOS with the demo to see if that fixes the problem.

I'm also going to have to look into this issue of the NiFi initialization crashing the emulator. Could you upload an NDS that does that?

Wolfgange
Posts:7
Joined:Tue May 26, 2015 11:33 am

Re: No touch input on homebrew

Post by Wolfgange » Tue May 26, 2015 2:50 pm

Exophase wrote:Well that's weird.

The only fix I can think of that could be related to this was the one that fixed the Syoban Action homebrew. It was relying on a BIOS call to not modify one of the caller save registers. Had to update the custom BIOS to use a different register.

You could try using a Nintendo BIOS with the demo to see if that fixes the problem.

I'm also going to have to look into this issue of the NiFi initialization crashing the emulator. Could you upload an NDS that does that?
Here's the nds file that crashes:
https://docs.google.com/file/d/0B8XNIxT ... cslist_api

I have it printing out an increasing number (before 5, the graphics hadn't initialized). As you should see, it crashes after printing 5, which runs the NiFi initialization.

Lordus
Posts:517
Joined:Mon Aug 05, 2013 9:05 pm

Re: No touch input on homebrew

Post by Lordus » Tue May 26, 2015 2:51 pm

Yes, both work on the current demo release, when using the original BIOS or the current (post-demo) drastic_bios.

Post Reply