Skip to main content

Do you know where your Home Screen is?

Published: April 17, 2008

My most famous code :)

Actually, I "stole" the assembly routine from Samuel and converted it to C. I happened to see it being used on the internet today, and thought wow... it's amazing how long ago I wrote that :) Probably 5+ years ago!

TEXT_EDIT *TE_findHomeScreen(void)
    register void *a=HomeExecute;
    while(*(unsigned long*)a!=(unsigned long)TE_select) a+=2;
    return (TEXT_EDIT*)(unsigned long)(*(unsigned short*)(a-4));