PDA

View Full Version : every_hour_beep script



ShadoW2004
04-09-2004, 06:47 PM
Hello All!
Somebody can help me to write every_hour_beep.nrx with functions ON/OFF? It function like in samsung phones...

ShadoW2004
06-09-2004, 06:46 AM
I trying to change minute_beep.nrx by Yak

What we have now...

/*
hour_beep.nrx Version 0.1
--------------- Copyright (c) 2004 ShadoW


After patching, you will hear a short beep every hour.


Config ID:

hour_beep

Set it to:

hour_beep/on - if you want to hear the beep every hour
hour_beep/off - if you want to disable it

*/

pool="ENVIRONMENT"


say "Patching..."

patt=x2c(203E217DF02AF9F048D1210022002301F044F8FF4CCF78202801D10548D4210022002301F044F8F578602801D000E22148D32100)
mask=x2c(FF00FF00F800F800FF00FFFFFFFFFFFFF800F800FF00FFFFFFFFFF00FF00FFFFFFFFFFFFF800F800FF00FFFFFFFFF000FF00FFFF)
find x2d(200000) "patt" "mask"
inc_phonetime=rc
place=inc_phonetime+x2d(10)

if inc_phonetime=0 then do
patt=x2c(203E217DF000F800260024011C2348D61C311C32F000F8004DD488282801D10548D61C311C321C23F000F8008868)
mask=x2c(FF00FFFFF800F800FFFFFFFFFFFFFF00FFFFFFFFF800F800FF00FFFFFFFFFFFFFF00FFFFFFFFFFFFF800F800FFFF)
find x2d(200000) "patt" "mask"
inc_phonetime=rc
place=inc_phonetime+x2d(14)
end

if inc_phonetime=0 then do; say "# Can't find needed functions!"; exit 1; end
else if vb>0 then say "inc_phonetime found at 0x"d2x(inc_phonetime)


call locate "play_tone_hour"; play_tone_hour=result

call create_config_id 2; config_id=result
own_get_config=value("func/own_get_config",,pool)

call value "confid/hour_beep",config_id,pool

call value "arg/hour_beep/off",0,pool
call value "arg/hour_beep/on",1,pool


/* create tone */
tone_data=x2c(8a029002890290028802920287029002860290028502900284029002830290028202900281020bc0)
create "tone_data"; tone_data=rc
tone=d2c(tone_data,4)||x2c(02040000)
create "tone"; tone=rc


code=x2c(B50F1C03480BF000F8002800D010A10B5C092900D1047818785A18802800D00778984288D104480421002200F000F800BD0F46C0000000000000

0000FF003732)
create "code"; own_hour_beep=rc
setbl own_hour_beep+x2d(06) OWN_GET_CONFIG
setbl own_hour_beep+x2d(2c) PLAY_TONE_HOUR
setlong own_hour_beep+x2d(34) CONFIG_ID
setlong own_hour_beep+x2d(38) TONE

code=x2c(B50046C046C0F000F800BD0000000000)
create "code"; own_hook=rc
setbl own_hook+x2d(06) OWN_HOUR_BEEP

if vb>0 then say "own_hour_beep created at 0x"d2x(own_hour_beep)

hook place own_hook 2 12
if vb>0 then say "Hooked at 0x"d2x(rc)


/* done */

say "Done!"
exit 0





Now it's working like minute_beep.nrx OFF=OFF ON=beep every minute during the call...

How to change it? ON must be beep every hour (without call)

danwood76
06-09-2004, 10:18 AM
I guess you would have to hook this in when the phone is idle
so it would need to run this all the time right?

I think this would slow your phone down alot but it is possible

You will need to find a function that is run all the time

so for example a draw function
then hook this in so it runs it aswell

regards,
Danny

mestrini
06-09-2004, 11:39 AM
@shadow

You can't change it this way, i think. Things aren't that linear.

The minute_beep script works when phone is on call so to have your script beeping you'd have to make a call for more than an hour, right? :-o

i think dan's way is a good way, but my bet goes to checking the clock and then beep or vibrate (or both) when it reaches the hour.

Nokix already has a script that checks if the clock is set. From there all the new code has to do is what i said above

just a thought
cheers

ShadoW2004
07-09-2004, 10:14 AM
mestrini can you help me with this?

mestrini
07-09-2004, 05:32 PM
I surely would if i knew how to write a script with arm code. :???:

All i can do so far is link to other codes and functions already existent in nokix

I'm reading some ASM notes and soon, i hope, will start with ARM/THUMB.
Then i'll probably start doing my own scripts :-D

Let's wait for yak's return... or someone else's help

cheers

ShadoW2004
07-09-2004, 06:19 PM
2 mestrini

Ok! Lets wait....