LibXenon Examples: Difference between revisions

From Xenon Wiki
Jump to navigation Jump to search
imported>Sbrqt
(Created page with ''''XMENU source code by User:cpasjuste: '''<br /> Download: [http://mydedibox.fr/index.php?option=com_docman&task=doc_details&gid=14&Itemid=29 mydedibox.fr] <br /> <br /> ''…')
 
imported>Tuxuser
(Added download to HelloWorld sourcecode)
Line 9: Line 9:


'''Controller Button test code by [[User:ced2911]]: '''<br />
'''Controller Button test code by [[User:ced2911]]: '''<br />
Source Code (incl. Makefile): [http://file.libxenon.org/free60/LibXenon_HelloWorld.tar.gz Download]
<pre>
<pre>
  #include <stdio.h>
  #include <stdio.h>

Revision as of 00:50, 26 February 2011

XMENU source code by User:cpasjuste:
Download: mydedibox.fr

Genesis Plus + SMS Plus source code by User:ced2911:
Genesis Plus: http://www.multiupload.com/6QYQL218GB
SMS Plus: http://www.multiupload.com/62T7RVYB5A

Controller Button test code by User:ced2911:
Source Code (incl. Makefile): Download

 #include <stdio.h>
 #include <stdlib.h>
 #include <input/input.h>
 #include <xenos/xenos.h>
 #include <console/console.h>  

 void mainInit()
 { 
 	//init
 	xenos_init();
 	console_init();
 
 	kmem_init();
 	usb_init();
 	usb_do_poll();
 }
 int main()
 {
 	mainInit();
 	printf("Test\n");
 
 	struct controller_data_s oldc;
 	while(1)
 	{
 		struct controller_data_s c;
 		if (get_controller_data(&c, 0))
 		{
 
 			if((c.a)&&(!oldc.a))
 			{
 				printf("a pushed\n");
 			}
 			if((!c.a)&&(oldc.a))
 			{
 				printf("a released\n");
 			}
 			oldc=c;
 		}
 		usb_do_poll();
 	}
 	return 0;
 }