void main() { TRISB=0x00; TRISA=0x3C; TRISC=0x00; ADCON1=0x06; init_lcd(); start_sw=0; init(); GIE=1; PEIE=1; cmd_wr(0xc0); for(i=0;i<9;i++) { data_wr(cnt[i]); } //test_display(); //disp_sw(); while(1) { get_key(); keyprocess(); } }
unsigned long gp2x_joystick_read() { // Reset mouse incase there is no motion mouse_motion_process(0,0); SDL_Event event; while (SDL_PollEvent(&event) > 0) { switch(event.type) { case SDL_KEYDOWN: keyprocess(event.key.keysym.scancode, true); break; case SDL_KEYUP: keyprocess(event.key.keysym.scancode, false); break; case SDL_JOYBUTTONDOWN: joyprocess(event.jbutton.button, SDL_TRUE, event.jbutton.which); break; case SDL_JOYBUTTONUP: joyprocess(event.jbutton.button, SDL_FALSE, event.jbutton.which); break; case SDL_MOUSEMOTION: mouse_motion_process(event.motion.xrel, event.motion.yrel); break; case SDL_MOUSEBUTTONDOWN: mouse_button_process(event.button.button, SDL_TRUE); break; case SDL_MOUSEBUTTONUP: mouse_button_process(event.button.button, SDL_FALSE); break; case SDL_QUIT: gp2x_exit(); break; default: break; } } return 0; }
void main() { TRISB=0x00; TRISA=0x3C; TRISC=0x00; ADCON1=0x06; start_sw=0; init(); GIE=1; PEIE=1; //test_display(); //disp_sw(); while(1) { get_key(); keyprocess(); } }