PDA

View Full Version : I want add things, but without menus.



dested
30-05-2005, 05:33 PM
i need help to edit "light_settings.nrx", "vibra_power.nrx"

I want lights will be standard OFF. And Vibra level to 2.


/*
light_settings.nrx Version 1.0
------------------ Copyright (c) 2005 [Yak]

Creates a settings menu, where you can choose if you want the backlight of your
phone to be permanently switched off, switched on or act as usual (switch off
after 15s).

Even if 'switched off' setting is selected, the light is turned on when:
- someone is calling you,
- alarm clock reaches its time,
- reminder reaches its time,
- POWER key is pressed.

Then the light stays on as long as keyboard is used. After 15 of inactivity the
light is turned off again.

The POWER key feature (see above) lets you use the phone in the dark. This feature
is known from 3110 (DCT2) model.


Configure with following definition:

light_settings

*/

pool="ENVIRONMENT"
vb=getenv("sys/verbose")


/* create config id */

config_id=create_config_id(2,2)


/* insert hook */

/* #object <hook.x> */
code=x2c(B5101C04482642A0D00F482642A0D00C482542A0D01220FF30F642A0D01C2CC8D02D1C2046C046C0BD104821F7FFFFFE2800D1F6481D21017001E7F2481E78002802D0024819210070014819F7FFFFFE2801D1E624DCE7E4481778002802D0E04813F7FFFFFE2800D1DB481078002800D1D7480B3801F7FFFFFE24DCE7D1480D6880280DD1CD480C78002802D0C94808F7FFFFFE2800D1C4480421017001E7C000001B5E000013880000059600000000000000000000000000000000)
create "code"; hook_o_1=rc /* .text */
hook_o_4w=reserve_ram(1) /* .bss */
if symbol("own_get_config")~="VAR" then own_get_config=locate("own_get_config")
if symbol("send_message")~="VAR" then send_message=locate("send_message")
if symbol("config_id")~="VAR" then config_id=locate("config_id")
if symbol("message")~="VAR" then message=locate("message")
if symbol("lights_owner")~="VAR" then lights_owner=locate("lights_owner")
setbl hook_o_1+44 own_get_config
setbl hook_o_1+76 own_get_config
setbl hook_o_1+98 own_get_config
setbl hook_o_1+118 send_message
setbl hook_o_1+144 own_get_config
setlong hook_o_1+172 hook_o_4w
setlong hook_o_1+176 config_id
setlong hook_o_1+180 message
setlong hook_o_1+184 lights_owner
hook_task5=hook_o_1
hook_task5_code=hook_o_1+36
/* #end */


/* infect firmware */

patt=x2c(F7FFFDC880E0F7FBFDB3)
mask=x2c(f800f800fffff800f800)
find locate("task_5") "patt" "mask"
hook rc hook_task5 hook_task5_code


/* add strings to PPM */

call add_ppm_strings "light_settings_ppm.txt"


/* create config menu */

m=ezmenu("start",get_ppm_str("light_settings"),,getenv("confmode/arg"),config_id)
call ezmenu "add",m,get_ppm_str("neuter/off"),x2d(1f5),0,19,locate("action_ok_back")
call ezmenu "add",m,get_ppm_str("neuter/on"),x2d(1f5),1,19,locate("action_ok_back")
call ezmenu "add",m,get_ppm_str("auto"),x2d(1f5),2,19,locate("action_ok_back")
config_menu=ezmenu("end",m)


/* expose definition */

call value "def/light_settings/title",get_ppm_str("light_settings"),pool
call value "def/light_settings/msg",x2d(387),pool
call value "def/light_settings/arg",config_menu,pool
call value "def/light_settings/flags",x2d(8),pool
call value "def/light_settings/action",locate("action_select_back"),pool


/* done */

say "Done!"
return 0 /* success */


/**********************************************************/

get_ppm_str: procedure
arg id
ptr=getenv("text/light_settings/"id)
if ptr~="" then return ptr
return getenv("text/"id)


Vibra power standart to level 2

/*
vibra_power.nrx Version 1.0
--------------- Copyright (c) 2004 [Yak]

Enables you to set the strentgh of the vibra signals generated
during play of ringtones.


Access settings menu with following definition:

vibra_power

*/

pool="ENVIRONMENT"
vb=getenv("sys/verbose")

config_id=create_config_id(2,1)

/* #object <hook_set_vibra.x> */
code=x2c(B5014804F7FFFFFE00803904180946C046C0BD0100000000)
create "code"; hook_set_vibra_o_1=rc /* .text */
if symbol("own_get_config")~="VAR" then own_get_config=locate("own_get_config")
if symbol("config_id")~="VAR" then config_id=locate("config_id")
setbl hook_set_vibra_o_1+4 own_get_config
setlong hook_set_vibra_o_1+20 config_id
hook_set_vibra=hook_set_vibra_o_1
hook_set_vibra_code=hook_set_vibra_o_1+14
/* #end */

findb locate("set_vibra")
getb rc
hook rc hook_set_vibra hook_set_vibra_code

call add_ppm_strings "vibra_power_ppm.txt"

action=locate("action_ok_back")
m=ezmenu("start",get_ppm_str("title"),,getenv("confmode/arg"),config_id)
call ezmenu "add",m,get_ppm_str("level1"),,0,19,action
call ezmenu "add",m,get_ppm_str("level2"),,1,19,action
call ezmenu "add",m,get_ppm_str("level3"),,2,19,action
call ezmenu "add",m,get_ppm_str("level4"),,3,19,action
menu=ezmenu("end",m)

call value "def/vibra_power/title",get_ppm_str("title"),pool
call value "def/vibra_power/msg",x2d(387),pool

call value "def/vibra_power/arg",menu,pool
call value "def/vibra_power/flags",x2d(8),pool
call value "def/vibra_power/action",locate("action_select_back"),pool

/* done */
say "Configure with 'vibra_power' definition"
say "Done!"
return 0

get_ppm_str: procedure
arg id
ptr=getenv("text/vibra_power/"id)
if ptr~="" then return ptr
return getenv("text/"id)


I do not understand Menu Structure (I don't want any extra menus).

Thank you if someone want to help.