Search found 7 matches

by chukmunnlee
Thu Apr 16, 2009 11:14 am
Forum: DS/DSi Development
Topic: Q: Overlaying keyboard on background
Replies: 1
Views: 2892

Q: Overlaying keyboard on background

HI I've been trying to display the keyboard over a bitmap background. I got the background but the graphics for the keyboard is garbled. Any pointers appreciated. Thanks Here is the code videoSetMode(MODE_5_2D); vramSetMainBanks(VRAM_A_MAIN_BG_0x06000000, VRAM_B_MAIN_BG_0x06020000, VRAM_C_SUB_BG, VR...
by chukmunnlee
Wed Jan 21, 2009 6:05 am
Forum: DS/DSi Development
Topic: Reading KEY_X, KEY_Y from timer interrupt
Replies: 3
Views: 4898

Re: Reading KEY_X, KEY_Y from timer interrupt

That was actually an example. But I've manged to solve the problem. I found that you cannot call irqInit(). The reason is that this seems to disable the ARM7 interrupt for the touch, X and Y keys. After I remove the irqInit() the buttons worked.

Thanks
by chukmunnlee
Tue Jan 13, 2009 8:39 am
Forum: DS/DSi Development
Topic: Reading KEY_X, KEY_Y from timer interrupt
Replies: 3
Views: 4898

Re: Reading KEY_X, KEY_Y from timer interrupt

This is what I want to do. In poll_keys(), I can only detect A, not X. TIA Regards #include <nds.h> #include <stdio.h> //Setup a timer to read the keys void poll_keys(void) { scanKeys(); u16 held = keysDown(); if (held & KEY_A) iprintf("KEY_A\n"); if (held & KEY_X) iprintf("KE...
by chukmunnlee
Mon Jan 12, 2009 7:03 am
Forum: DS/DSi Development
Topic: Reading KEY_X, KEY_Y from timer interrupt
Replies: 3
Views: 4898

Reading KEY_X, KEY_Y from timer interrupt

Hi, I'm using the latest version of libnds (1.3.1). I have setup a timer interrupt that fires every 1ms and what it does is to read the keypress. I'm having trouble reading X, Y and touch pad. I'm guessing that the timer interrupt is running on arm 9. Is there a way that I can emulate the old IPC st...
by chukmunnlee
Thu Oct 23, 2008 3:33 am
Forum: DS/DSi Development
Topic: Q: Setting 50ms timer
Replies: 0
Views: 3575

Q: Setting 50ms timer

Hi all, I've use the following code to set a 50ms timer. Does the following code correctly sets it? TIMER3_CR = 0; TIMER3_DATA = TIMER_FREQ_64(20); TIMER3_CR = TIMER_ENABLE | TIMER_DIV_64 | TIMER_IRQ_REQ; irqSet(IRQ_TIMER3, timer_50ms); irqEnable(IRQ_TIMER3); More specifically, am I using the correc...
by chukmunnlee
Fri Aug 22, 2008 6:18 am
Forum: DS/DSi Development
Topic: Calculating 1ms with timers
Replies: 1
Views: 4933

Calculating 1ms with timers

Hi, I've setup an interrupt routine for the timers but I'm not sure how to set it to call at 1ms. Here is what I have TIMER0_CR = 0; TIMER0_DATA = TIMER_FREQ(1); TIMER0_CR = TIMER_ENABLE | TIMER_DIV_1 | TIMER_IRQ_REQ; irqSet(IRQ_TIMER0, timerIRQ); It's working but I'm not sure if it is going at 1ms....
by chukmunnlee
Wed Aug 13, 2008 3:08 am
Forum: libfat
Topic: Question on fopen() and open()
Replies: 0
Views: 5273

Question on fopen() and open()

Hi

I'm using fopen() to create files on the SD card. What I find is that fopen() creates the names of the files in upper case. Is there a way to create case sensitive file names?

BTW, I've also noticed that open() does not support LFN only 8.3 but fopen() do. Is this correct?

TIA

Regards
Chuk