PDA

View Full Version : [script] shutdown_anim.nrx



dvirus666
27-06-2005, 06:15 PM
This script will add animation to your shutdown. :-D

To use the script simply add to you main menu for the on/off/animation options.

You will also need to change the power button menu, add a shortkey or menu to add the new 5E0 id to shutdown the phone.

Use in the same way as the welcome_anim.nrx script.

Once added just use the new 5E0 to shutdown the phone.

If you shutdown the phone using the old power button then no animation will play.

mestrini
27-06-2005, 07:23 PM
thumbs up for this one m8

i had thought of it once and find strange u didn't make it sooner

was it hard? no way to make it use the original shutdwon ID?

cheers

Daryl Saludares
28-06-2005, 12:34 AM
thank you mr. D:Virus...
i'm gonna add this script to my processing list soon... :razz:

Adebisi
28-06-2005, 12:36 AM
great script mr. dvirus666

but can you tell how to change the power button menu?
power_button_menu_2.5.nrx didnt work if i remember right?

dvirus666
28-06-2005, 09:47 AM
@Adebisi:

The power_button_menu.nrx script works on mine. :confused:
Thats what I used.

n0tpr64
29-06-2005, 05:02 AM
Where do I get power_menu_button.nrx?

dvirus666
29-06-2005, 10:55 AM
Try and search next time.

http://nokiafree.org/forums/t68864/h/s.html

yak
29-06-2005, 03:44 PM
@ dvirus666

First: nice work man!
Then: how about hooking before the first UI task messages processor and waiting for message 0x322? You could reserve some 1 status byte and check it when 322 arrives, when it is 0 then the hook would fire up the animation 5E0 function and replace the message with 0xdc. This 5E0 function would set this status byte to 1 and send the 0x322 message when the anim is done (or key was pressed). The hook would then skip the message and the phone would shut down.

Seems a good idea to me :). What do you think? Can you make it?

Cheers
[Yak]

PS: Your site doesn't work correctly on Firefox :).

dvirus666
29-06-2005, 05:46 PM
First: nice work man!
Then: how about hooking before the first UI task messages processor and waiting for message 0x322? You could reserve some 1 status byte and check it when 322 arrives, when it is 0 then the hook would fire up the animation 5E0 function and replace the message with 0xdc.....


Thanks m8. I would love to do as you suggested but at the moment I am still learning and still not 100% sure on how it all works.
Also thanks for letting me know about my site. I will fix it.

yak
30-06-2005, 10:44 AM
Well, maybe my description was a little cryptic. Some hints: take a look at 3310 flash in WinARM, go to UI TASK (WinARM should locate it, just choose it from this combobox). You will find a series of BL and LDRH/STRH instructions. these are the jumps to UI task subsystems and the halfword loaded/stored by these LDRH/STRH instructions is the current message (MSG_...). The first BL is the processor, that replaces or sends the messages based on some conditions. This first BL handles the 0x322 (MSG_POWER_DOWN) message sent by the "Switch off!" menu item from power button menu. The second BL is a function, that handles the currently active 5E0 function. Others handle menus, dialogs and other stuff. In order to do something when MSG_POWER_DOWN message arrives, we have to prevent the processor (first BL) from handling this message. This can be done by installing a hook that will catch this message before this processor and in such case start your animation 5E0 funcion (with send_message). The MSG_POWER_DOWN message itself have to be canceled by replacing it with 0xdc (MSG_NOP) so the phone don't turn off. But when the animation is finished we have to turn it off. If we simply send the MSG_POWER_DOWN, it will be catched by our hook and the anim will be started again. To prevent this we can use a variable that will be 0 before the anim is played, and 1 after it is done. The hook will then start the anim (and cancel the MSG_POWER_DOWN) only when this variable==0.

mestrini
30-06-2005, 01:06 PM
hehe, nothing is as good a little brainstorming :D

One guy has an idea, the other suggests something and another wraps the issue with the tech explanation...

congrats!

cheers

spaceimpact33
30-06-2005, 02:23 PM
You can find the process like this
(stolen from dump_message_process.nrx)


patt=x2c(F7FFFDC880E0F7FBFDB3)
mask=x2c(f800f800fffff800f800)
find locate("task_5") "patt" "mask"
getbl rc; msg_process=rc

findbl msg_process; a=rc
getbl a; get_index=rc
findbl a+4; a=rc
getbl a; proc=rc
findbl a+2
getbl rc; func=rc

findldr get_index; findldr rc+2; getldr rc; getlong rc; tab_msgs=rc
findldr func; findldr rc+2; getldr rc; getlong rc; tab_cond=rc
findbl proc; getbl rc; findbl rc; a=rc
findbl a+4; getbl rc; findbl rc; findldr rc+4; getldr rc; getlong rc; tab_todo=rc
getbl a; a=rc; patt=x2c(28ff); find a "patt"; a=rc
getbyte rc+5; var_args=rc
findldr a; a=rc; getldr a; getlong rc; tab_func=rc
findldr a+2; findldr rc+2; getldr rc; getlong rc; spec_vars=rc

/*hook own message process*/
hook msg_process own_msg_process


Regards.

yak
30-06-2005, 04:49 PM
well, not quite. should look like this:


patt=x2c(F7FFFDC880E0F7FBFDB3)
mask=x2c(f800f800fffff800f800)
find locate("task_5") "patt" "mask"
msg_process_bl=rc

hook msg_process_bl hook_code
and we're done :D. well, the hook_code still has to be written :)

ShadoW2004
01-10-2005, 12:19 PM
This script didnot works on mine 3310 6.07 with all script from latest snapshot! :-(

dvirus666
17-03-2006, 04:44 PM
I have updated this script and removed the 5e0 ID. Also now with multiple tones supports played with the animation. :-D

This script uses another I made called add_tones.nrx which is included in the zip. (Made to save some MCU space as used with welcome_tones.nrx as well)

Simply add the tones through add_tones.nrx and and the animation through this script.

I have only tested on the 3310 BUT should work others.
Read the script info for more help.

Download from my site: Link below.

LoMaster
18-03-2006, 12:28 AM
... add_tones.nrx which is included in the zip...
Sorry but seems that the add_tones.nrx isn't included neither in welcome_tones.zip nor in shutdown_anim_tones.zip on your site :???:

dvirus666
18-03-2006, 06:48 PM
I forgot to add the script. :lol:

It is uploaded to my site: Link Below

dvirus666
14-04-2006, 03:21 PM
I have done a combination startup / shutdown animation & tone script to save some space in the flash. Download from my site. Link below.