I'm trying to write LUA script for pokemon black/white to show/hide controls in certain moments of the game. How can I debug and get values from this part of NDS memory? Or in other words how to easily debug it?

Tried to test the Lua script for desmume which helps with Learn with Pokemon - Typing Adventure but game will always have a white screen no matter which rom I try (normal or patched rom)..

The Retroarch desmume core and all those 1000 DS emulators in the Google store based on desmume can open the patched rom and run the game fine without a keyboard but saving won't work and Lua scripts ain't supported :/
Normal rom will give a error saying "the setup for the keyboard has failed bla bla"

Is there any way to have this game working in drastic and have the in-game saving work too?