#66169 - Linkiboy - Sun Jan 08, 2006 6:52 pm
Hi, I am having a problem with making the touch screen draw pixels when it's touched. (Note I'm using an emulator, I can't afford a PassMe/GBMP2...yet). My makefile compiles the code fine; no errors, but when I run it in a emulator it doesn't work. Here is the source code:
ARM9:
ARM7:
What Am I doing wrong?
ARM9:
Code: |
#include "..\nds.h"
#include "..\ipc.h" #include "..\memory.h" #include "..\screen.h" #include "..\system.h" int main() { u16 x,y; powerON(POWER_ALL); videoSetMode(MODE_FB0); VRAM_BANK_A(VRAM_LCD); lcdSwap(); while(1) { x = IPC[0]; y = IPC[1]; VRAM_A[y * SCREEN_WIDTH + x] = RGB(31,0,0); } } |
ARM7:
Code: |
#include "..\nds.h"
#include "..\ipc.h" #include "..\serial.h" #include "..\touch.h" int main() { while(1) { IPC[0] = (touchRead(TOUCH_X) - TOUCH_CAL_X1) * (TOUCH_CNTRL_X2 - TOUCH_CNTRL_X1) / (TOUCH_CAL_X2 - TOUCH_CAL_X1) + TOUCH_CNTRL_X1; IPC[1] = (touchRead(TOUCH_Y) - TOUCH_CAL_Y1) * (TOUCH_CNTRL_Y2 - TOUCH_CNTRL_Y1) / (TOUCH_CAL_Y2 - TOUCH_CAL_Y1) + TOUCH_CNTRL_Y1; } } |
What Am I doing wrong?