Создание Эльфов : Эльфостроение : Форум

Страница 69 из 211: « 1 ... 65 66 67 68 [69] 70 71 72 73 ... 211 »

 eddmund:
14.11.08, 15:58
 UltraShot, yes, thank you, that worked :-D !

I have updated the Elf code above, now with unregistering the image on Elf exit. However, my phone reboots then. Do you know what I am missing?

Edit:
Completely removing

Код:
Standby_Redraw(DO, a, b, c);

introduced the problem that existing items between the status row and softkey menu disappered.
Moving that line from the beginning to the end of the myRedraw() function did the trick :-) !

[ Edited by eddmund в 14.11.08 23:28 ]

 UltraShot:
14.11.08, 16:00
 eddmund, you forgot to restore old redraw when you closing book
DISP_DESC_SetOnRedraw(Standby_DD, Standby_DO);

 eddmund:
14.11.08, 18:23
 UltraShot, thanks again! After adding

Код:
DISP_DESC_SetOnRedraw(Standby_DD, Standby_Redraw);

exiting now works fine. I have updated the entire code of the Elf from my original post.




[ Edited by eddmund в 15.11.08 22:20 ]

 myrzeug:
15.11.08, 02:37
 Привет всем
Пожалуйста,
Может ли кто-нибудь объяснить,
Как сканировать папки, а также получить список всех файлов внутри? (Имена и расширений.)

--In English-----------
Hi all
Please
can anyone explain,
How to scan a folder, and get a list of all files inside? (name and extensions.)



[ Edited by myrzeug в 15.11.08 02:40 ]

 UltraShot:
15.11.08, 12:54
 myrzeug, "Launching daemons" from elfpack sources:
char * mem = malloc(0x300);
int * handle=AllocDirHandle(GetDir(DIR_ELFS_DAEMONS | MEM_INTERNAL));

FILELISTITEM * fli;

do
{
if(fli=GetFname(handle,mem))
{
u16 * filename = malloc((wstrlen(fli->path)+wstrlen(fli->fname)+2)*2);
wstrcpy(filename,fli->path);
wstrcat(filename,L"/");
wstrcat(filename,fli->fname);

elfload(filename,0,0,0);
mfree(filename);
}
}
while(fli);
if (handle) DestroyDirHandle(handle);
mfree(mem);

 xander150:
15.11.08, 16:23
 This may sound stupid but I can't find rand() function in the lib and nothing what seems to be similar, nothing with rand or rnd. Is there any clean way to get random numbers in elfpack or do I have to write my own rand function?

 FreeMan8:
15.11.08, 19:58
 xander150, there is no lib function.
just try
int rand()
{
DATETIME dt;
REQUEST_DATEANDTIME_GET(0 ,&dt);
return dt.time.sec; // or somethink else like minutes,date... etc. :-)
}

if you need bigger number you can make a sum or multiplication of any values ;-)

P.S. sorry for my English

[ Редактировано FreeMan8 в 15.11.08 18:59 ]

 Joker XT:
15.11.08, 21:02
 
Код: 
unsigned int randseed;

#define random randint
#define randomize Randomize
unsigned int randint( int max )
{
  randseed = randseed * 0x08088405;
  randseed++;
  return ((long long)randseed * max ) >> 32;
}

unsigned int rand(){
  return randint(0x100000);//?
}

void Randomize(){ // Вызываем при старте для случайной последовательности
  DATETIME dt;
  REQUEST_DATEANDTIME_GET(SYNC, &dt);
  //rndindex = (unsigned char)time.param;
  randseed=(dt.time.min | (dt.time.sec<<5));
}


 myrzeug:
15.11.08, 22:24
 UltraShot
super thanks!

Another question:
Is posible to take the info of file, I mean the time and date when it was created

 xander150:
15.11.08, 23:23
 Thanks FreeMan8 I already had this idea (a little bit more complicated) but it's not usable if you need many random numbers in one moment ;)

Thanks JokerXT, this looks really good =)
Страница 69 из 211: « 1 ... 65 66 67 68 [69] 70 71 72 73 ... 211 »

URL этой темы:
https://mobilefree.justdanpo.ru/newbb_plus/viewtopic.php?topic_id=2479&start=680

© 2005-2018 supertrubka.org