PDA

View Full Version : [SCRIPT] Another World Clock



nuukiaworld
08-01-2006, 03:13 PM
I was going to make some minor adjustments in joci2000's w_clock.nrx, e.g. reduce its flash footprint because I am out of flash, but finally ended to create a program from scratch. It gave me possibility to start using the great SDK V2, too.

Thanks to joci2000 for the idea! 8-)
http://www.panuworld.net/nuukiaworld/download/nokix/worldcl2.gif
Download the newest version 1.04 from:
www.panuworld.net/nuukiaworld/download/nokix/worldclk.htm (http://www.panuworld.net/nuukiaworld/download/nokix/worldclk.htm)

joci2000
08-01-2006, 03:48 PM
cool :D another nice script.

and i must say that i like your script better than mine :wink: It need less space and has more function.

This is a professional work :-)

and finally: I'm still a beginer in C programming & NokiX commands :cry: so i don't know a lot of things about C, and i'm sure this is the reason for the unoptimised codes.

but now i can improve my knowledge of NokiX commands from Yak site :grin: (thx for Yak for his great documentation).

Regards

Joci2000

Daryl Saludares
10-01-2006, 02:07 AM
i replaced joci2000's world_clock.nrx with the latest from nuukiaworld's world_clock.nrx, i find it more comprehensive and detailed indeed, the only problem i encountered is that my phone (3310-using V06.39B) intermittently hangs wherever i accesses the World clock sub-menu, i already re-arranged the scripts in NokiX processing list, i did it several times but to no avail, the problem still exist. please help, i really like the application for my phone...

Daryl Saludares
10-01-2006, 04:45 AM
I was going to make some minor adjustments in joci2000's w_clock.nrx, e.g. reduce its flash footprint because I am out of flash, but finally ended to create a program from scratch. It gave me possibility to start using the great SDK V2, too.

Thanks to joci2000 for the idea! 8-)

www.panuworld.net/nuukiaworld/download/nokix/worldclk.htm (http://www.panuworld.net/nuukiaworld/download/nokix/worldclk.htm)
@nuukiaworld
what causes this one to form a gap? this happens when i put world_clock.nrx(nuukiaworld version) in the processing list.

*******************************
# Processing: RESERVE_RAM.rx THE_END
Reserved 1056 (0x420) bytes in 72 blocks.
Defaults mechanism used by 19 blocks.
Reserved blocks contain 2 bytes of gaps.
Done!
*******************************

pls help...

mestrini
10-01-2006, 12:09 PM
That's no patching error :lol:

you'd have to study RESERVE_RAM.nrx in order to understand how gaps work

like this: First script reserves only one byte ( reserve_ram(1) ) and second script reserves 2 then you get first block with one empty location that will be filled when another script reserves a single byte because the 2 bytes must be in same block

got the idea?

PS anyone correct me if i'm wrong

nuukiaworld
10-01-2006, 01:14 PM
like this: First script reserves only one byte ( reserve_ram(1) ) and second script reserves 2 then you get first block with one empty location that will be filled when another script reserves a single byte because the 2 bytes must be in same blockLike in most 16/32-bit CPU's, there are limitations for RAM addresses of variables; in ARM7:
1-byte variables (char) can be at any address
2-byte (word) variables (short) must begin at an even address
4-byte (int) variables must begin at an address divisible by four
Because NokiX standard macro reserve_ram.rx takes care about these align requirements, we do not need to think about them.

Free RAM example (imaginary example at address 0x110000):
0x110000 .. .. .. .. .. .. .. ..
0x110008 .. .. .. .. .. .. .. ..
After first script which needs 1 byte ('A') of RAM (-> @ 0x110000):
0x110000 AA .. .. .. .. .. .. ..
0x110008 .. .. .. .. .. .. .. ..
After second script which needs 4 bytes ('B') (-> @ 0x110004):
0x110000 AA .. .. .. BB BB BB BB
0x110008 .. .. .. .. .. .. .. ..
After third script which needs 2 bytes ('C') (-> @ 0x110002):
0x110000 AA .. CC CC BB BB BB BB
0x110008 .. .. .. .. .. .. .. ..
Legend: .. free byte, AA/BB/CC reserved byte

This is because B (4 bytes) must start at an address divisible by four, reserve_ram.rx must leave three bytes of gap between A and B. However, when positioning C, reserve_ram.rx detects that it can use that gap, so finally only one byte of gap will remain. If no more 1-byte reservations occur, that byte will be left unsed (gap).

This is not the exact way how reserve_ram.rx works, only my guess. But in short, the user does not need to worry about the gaps. They will appear only when required and are not harmful, and the amount of them depends on what scripts you have in your NokiX project (may be also on the order of the scripts in your NokiX project?)

@Daryl Saludares
Your problem is not present on my 6110. World Clock does not contain anything special, its way of working is the same as in the NokiX SDK template project. Does the problem continue to occur if you reduce the number of other (enabled) patches in your NokiX project?
Does the world_clock have problems (only) if the phone clock is not set? I have not tested the behaviour of the application if the clock is not set. (It is too difficult on 6110 to reset the clock...! :( )

Daryl Saludares
11-01-2006, 12:53 AM
i flashed the modified SW to two 3310 phones but still the same thing troubles me, sometimes even if i just open "World clock" sub-folder the phone hangs for about 15 seconds then it re-starts. so i just replaced it with the previous one "joci2000 script". do you have some plans to re-write the script for a more stable output re: 3310 HW?

@mestrini
thanks for the info =:)

nuukiaworld
11-01-2006, 09:05 PM
...if i just open "World clock" sub-folder the phone hangs for about 15 seconds then it re-starts... do you have some plans to re-write the script for a more stable output re: 3310 HW?I do not have a 3310, so I cannot reproduce your problem. With 6110 it works well, and by quickly reading through the source, there should not be any possibility of crashes. It is short, simple, and follows closely the NokiX SDK's application example. :confused:

Tell me more: Is the map displayed when the phone hangs or will the application hang before displaying anything?

I made two special testing builds (_test1 and _test2). If you want to help to solve your problem, test both of them and tell if either one does not crash in the same way. (They have rather limited functionality, they are only for finding the reason of the crash.)

However, I cannot guarantee that I can solve your problem. (Nobody else have reported about similar problem.)

joci2000
11-01-2006, 09:44 PM
well on 3310 the problem is there. the freegfx open with map,clock,gmt time and after it hangs

as i see there is also a problem with the 24H format. for example at 10am it show 10pm for me.

the test_1 still hang, while test_2 is working.

Daryl Saludares
12-01-2006, 06:53 AM
Tell me more: Is the map displayed when the phone hangs or will the application hang before displaying anything?

I made two special testing builds (_test1 and _test2). If you want to help to solve your problem, test both of them and tell if either one does not crash in the same way. (They have rather limited functionality, they are only for finding the reason of the crash.)

1st: there are times that the map is displayed then it hangs/re-starts itself;
2nd: i can view the entire application features, i.e. GMT+ to GMT-, but in the middle of my scrolling/viewing, phone hangs/re-starts itself;
3rd: i can view the entire application features, but when i try to exit from the application, upon seeing the folder title "World clock" the phone hangs/re-start itself.

now in your test package 1, this is the result: upon entering the sub-folder title "World clock" i can only view the map, exactly the map only, no more possibility for scrolling, then the phone hangs/re-starts itself.

test package 2 is the stable script, time is displayed at the bottom left of the screen, however accessing to the Navi key for time zone cannot be viewed, key#5 says "Own time zone selected" so far this is the assessment i can tell you by now. if you can concentrate at test package 2 for 3310 then maybe it will be fine. thanks in advance, RPN calc and temp screen saver are two pretty awesome apps, thanks :)

nuukiaworld
12-01-2006, 04:36 PM
Thanks for the testing reports. They gave some info where the problem can be. If possible, please test _test3 and _test4 similarly. They are attached below. If the results are those that I expect, next I can try fixing the problem. Note that these testing versions are still limited in functionality. They are just for pinging the origin of the problem.
as i see there is also a problem with the 24H format. for example at 10am it show 10pm for me :confused: Do you mean 12h format? However, in my phone, the am/pm indicator works as expected (' for am, . for pm). Does the problem occur on your own (home) zone or somewhere else (on which zone, and which is your selected "own" zone)?

joci2000
12-01-2006, 05:48 PM
So the test_3 version still hangs while test_4 works it seems to work correctly except the navi button(may be this is the limitation)

about the clock: with 24H type at 10.00 it showed 22.00(may be because i can't set the zone (on the first release)) but now it seems to work corretly with test_4 :wink:

nuukiaworld
12-01-2006, 07:33 PM
Yes, that was the result I expected! I guess now that the reason is that the clock and GMT offset texts are printed with own_print_string() using y=47. This causes actually one raster row (although empty) printed below the display bottom saving space for the map. (On 6110 it was not a problem, at least with my current configuration.) :-x

I fixed it by making the map lower and moving the texts up by one pixel (y=46); now their vertical position is the same as Navi label's. I hope it works now also on 3310 and others. Tell if you still have problems!

Download URL in the first message. Thank you for hard testing...! :wink:

joci2000
13-01-2006, 09:57 AM
Well now there is an other problem :-(

the world clock open properly and the buttons work fine, but when i press the navi button the country name, time appear but i cannot exit from this message with C nor Navi i have to turn off the phone with power button. (may be action(this is current action:nop-back) problem).

Daryl Saludares
13-01-2006, 10:41 AM
Well now there is an other problem :-(

the world clock open properly and the buttons work fine, but when i press the navi button the country name, time appear but i cannot exit from this message with C nor Navi i have to turn off the phone with power button. (may be action(this is current action:nop-back) problem).
i do have the same problem encountered just now and the phone doesn't re-start anymore it stays like a in an idle state and "Back" menu is left on the screen, pls see the attached screen shot...

Daryl Saludares
13-01-2006, 10:44 AM
additional...

nuukiaworld
13-01-2006, 12:52 PM
...the country name, time appear but i cannot exit from this message with C nor Navi i have to turn off the phone with power buttonOh no, this is an indefinite loop of problems - and all the time the app. is working properly on my 6110. :( But I want to make it work also on your phones. I hope that you don't lose your nerves with this app before that. :cry:

The country name message is generated using standard display_msg(), so I should not need to take care of the actions during the message. However, v1.01 uses a non-standard display_msg format, "dmi_clock" (the message with a clock icon, the one displayed when you set the clock manually). On 6110 it works great (see pictures on the download page) but may be it is not compatible with 3310.

To use a standard info-message instead, insert
dmi_clock=2
just before /* inserting code */ in world_clock.nrx. Does it solve the problem?

Which version of 3310 you are patching? If the problem is really the "dmi_clock" value, I want to find out why it does not work correctly on your software. If you run the script in "Verbose 1" level, what number is displayed as "Clock message format ID"?

joci2000
13-01-2006, 04:35 PM
To use a standard info-message instead, insert
dmi_clock=2
just before /* inserting code */ in world_clock.nrx. Does it solve the problem?

Which version of 3310 you are patching? If the problem is really the "dmi_clock" value, I want to find out why it does not work correctly on your software. If you run the script in "Verbose 1" level, what number is displayed as "Clock message format ID"?

okay that was the problem if i insert this(dmi_clock=2) the script works correctly :D

i use 3310 V6.07 and give this value: Clock message format ID: 0x29

nuukiaworld
13-01-2006, 07:10 PM
i use 3310 V6.07 and give this value: Clock message format ID: 0x29I tested patching 3310/6.39 and got the same result. But it is wrong: the correct value for 3310 is 0x36.

I disassembled a little and found that the "Clock is set" message is shown differently on 3310 compared to 6110, 5110, 8210, 3330, 3210 (the ones I tested yesterday before releasing 1.01). -- I didn't test 3310, and then just it is different than the others...! :x

Fixed 1.02 (available now) should work correctly also on 3310, displaying a clock icon without beep when pressing the Navi key. I hope (but don't expect) this was the last thing to fix. :roll:

joci2000
13-01-2006, 09:04 PM
the last version seems to be perfect :wink: till now i haven't found any bug :grin:

Daryl Saludares
14-01-2006, 02:58 AM
the last version is working correctly in my phone now, i can sleep with worry free thoughts, ;-)
thank you Nuukiaworld for fixing, joci2000 for the support. :-D

YaHaa
21-01-2006, 01:46 AM
Ya.. It working nicely at my phone..
Thanx nuukiaworld..

nuukiaworld
03-02-2007, 08:25 PM
I made a minor update to my World Clock application, may be just because I have to travel next week... Now the application shows the time of the selected time zone directly in the menu (see below).

http://www.panuworld.net/nuukiaworld/download/nokix/worldcl1.gif

It was not so straight-forward to display a menu value and update it automatically every minute... In addition to processing the MSG_DISPLAY_MENU_VALUE in the main dispatcher, a UI hook is required for updating the value if one keeps displaying our menu item for a long time.

joci2000
03-02-2007, 08:49 PM
Xcellent ;) Nice update.

nuukiaworld
10-12-2007, 12:15 PM
Fixed the menu display when the clock is not set. Now shows "--:--" like the normal clock menu. Download link in the first message.