0 Members and 1 Guest are viewing this topic.
void clear_buffer(char* buffer){ __asm__ __volatile__ ( "mov r1,#120\n\t" "mvn r2,#0\n\t" "mvn r3,#0\n\t" "mvn r4,#0\n\t" "mvn r5,#0\n\t" "mvn r6,#0\n\t" "mvn r7,#0\n\t" "mvn r8,#0\n\t" "mvn r9,#0\n\t" "mvn r10,#0\n\t" "mvn r11,#0\n\t" "1:\n\t" "stmia %0!,{r2-r11}\n\t" "stmia %0!,{r2-r11}\n\t" "stmia %0!,{r2-r11}\n\t" "stmia %0!,{r2-r11}\n\t" "stmia %0!,{r2-r11}\n\t" "stmia %0!,{r2-r11}\n\t" "stmia %0!,{r2-r11}\n\t" "stmia %0!,{r2-r11}\n\t" "subs r1,r1,#1\n\t" "bne 1b\t" : : "r"(buffer) : "r1","r2","r3","r4","r5","r6","r7","r8","r9","r10","r11" );}
int dirlist(char* path, char* pattern, char** result)path: the folder you are looking in, e.g. "/documents/examples"pattern: a search pattern, e.g. "*.tns"result: a pointer to a char* (i.e. a list of strings) that will store the resulting filenamesreturn value: the number of files found
struct event { unsigned int timestamp; unsigned short type; unsigned short ascii; unsigned int key; unsigned int unknown[3]; unsigned int control;};#ifdef CAS#define get_event (_oscall(int, 0x100CBF78, struct event *))#else#define get_event (_oscall(int, 0x100CBF44, struct event *))#endifint getch() { struct event event; do { get_event(&event); } while (event.type != 8 || event.ascii == 0); return event.ascii;}