PDA

View Full Version : LEDs ON/OFF script



ShadoW2004
21-08-2004, 03:41 PM
Hello All!

I have Nokia 3315 with white LEDs
Some body can help with creating script for ON & OFF LED's?! :eek:

JUNT
28-08-2004, 06:22 AM
Hello All!

I have Nokia 3315 with white LEDs
Some body can help with creating script for ON & OFF LED's?! :eek:

This script is very helpful especially during daytime. this is a kind of an energy saving.

belabs
30-08-2004, 05:55 PM
hi! im not good explaining things, here's a very brief tutorial

1. patch your fls with g3n0lite 2's slideshow
2. locate & edit the slideshow's cmd table (check out g3n's patch log)
3. Use only CMD 6 (fade leds toggle) and delete the other commands in the table (or put "00" after the fade_leds_toggle command)
4. edit Ur menustructure and add menu that toggles Ur leds on/off

***maybe adding/using CMD 7 will also help
***slideshow command info's can be found @ g3n0lite's read 1st

i hope u got the idea... good luck! ;)

ShadoW2004
31-08-2004, 07:27 AM
2 belabs

Thank you for answer...

But I find only this in log of g3n0lite....:


found 0010 bytes for function own_led_on at 0x001306C8
- bl: 001306CC -> 00130644: F7 FF FF BA
found 0022 bytes for function own_toggle_led at 0x001306D4
- bl: 001306D6 -> 00130608: F7 FF FF 97
- bl: 001306E4 -> 00130644: F7 FF FF AE
found 0084 bytes for function own_fade_led at 0x001306EC
- bl: 001306F0 -> 001306D4: F7 FF FF F0
- bl: 001306F4 -> 001305E8: F7 FF FF 78
- bl: 00130708 -> 001305E8: F7 FF FF 6E
- bl: 00130718 -> 001305E8: F7 FF FF 66
- bl: 00130728 -> 001306D4: F7 FF FF D4
- bl: 00130734 -> 001306D4: F7 FF FF CE

How to delete not need functions? And how to add 5e0 ID's for fade on/off?

mestrini
31-08-2004, 12:28 PM
I think you must go to the given addresses (check with winarm) and edit manually with an hexeditor...

ShadoW2004
02-09-2004, 03:49 AM
I tryed byt not successfull =(
Need help...

mestrini
02-09-2004, 11:01 AM
Why don't you go through Nokix's scripts and look for the code to TOGGLE_LEDS, FADE_LEDS, etc and try to make a script based on that ;)

cheers

belabs
02-09-2004, 05:06 PM
try this at Ur own risk :razz:

the idea is... instead of doing the whole slideshow, we'll just use the fade in/out effect

-patch Ur fls with g3n 2's Slideshow & create a menu (name it TOGGLE LED ON/OFF or whatever U want) or create shortkey for it (more practical)

-using hexeditor, search for
0000 5430 0000 000F 0054 0030 0000 000F (you should find this at the address indicated by own_slideshow_table at from g3nolite)
and replace it with
0400 0000 0000 0000 0000 0000 0000 0000

also,
0503 0503 0601 0203 0203 0206 0000 0000 (own_cmd_table)
with
0600 0000 0000 0000 0000 0000 0000 0000

kraze1984
02-09-2004, 09:08 PM
try this at Ur own risk :razz:

the idea is... instead of doing the whole slideshow, we'll just use the fade in/out effect

-patch Ur fls with g3n 2's Slideshow & create a menu (name it TOGGLE LED ON/OFF or whatever U want) or create shortkey for it (more practical)

-using hexeditor, search for
0000 5430 0000 000F 0054 0030 0000 000F (you should find this at the address indicated by own_slideshow_table at from g3nolite)
and replace it with
0400 0000 0000 0000 0000 0000 0000 0000

also,
0503 0503 0601 0203 0203 0206 0000 0000 (own_cmd_table)
with
0600 0000 0000 0000 0000 0000 0000 0000

I'll try making something similar in NokiX...

mestrini
02-09-2004, 10:12 PM
I already did it but the problem is that after a while lights come back once you press any key; like when you leave phone and when press a key, lights come back on.

What i'm trying to figure out is how the SPYMODE by krisha makes light stay off all the time :-?

maby some one can look from there...

enjoy

kraze1984
03-09-2004, 07:54 PM
I already did it but the problem is that after a while lights come back once you press any key; like when you leave phone and when press a key, lights come back on.

What i'm trying to figure out is how the SPYMODE by krisha makes light stay off all the time :-?

maby some one can look from there...

enjoy

SMART!

i made it in other way, like a parameter file for slideshow.nrx (see attachment).

About spymode: IMHO krisha made loopcheck: everytime theres a keypress, toggle_led is activated. Then the lights just dont turn on.

ShadoW2004
04-09-2004, 04:04 PM
Good job kraze1984 and mestrini
Thanks a lot 2 belabs for information - great IDEA

ShadoW2004
04-09-2004, 06:39 PM
What about script with functions: allways on, allways off, automatic?
...it must remember choise to eeprom, becouse slideshow.nrx with kraze1984's parameter file dont remember choise...

mestrini
07-09-2004, 05:55 PM
I think i'm getting closer now. :-D

I made two scripts that do (separately) what we want: One makes lights be always ON and the other does the opposite.

I'm trying to patch both in same flash and see what it does :???:


wait for updates...

cheers

kraze1984
07-09-2004, 06:09 PM
I think i'm getting closer now. :-D

I made two scripts that do (separately) what we want: One makes lights be always ON and the other does the opposite.

I'm trying to patch both in same flash and see what it does :???:


wait for updates...

cheers

I made a script that makes the lights always on, but i don't know how to make it off. made this hooking in task_0 own_leds_on (or leds_on) routine. Simple but not economic.

mestrini
07-09-2004, 06:23 PM
I made a script that makes the lights always on, but i don't know how to make it off. made this hooking in task_0 own_leds_on (or leds_on) routine. Simple but not economic.

LOL that's exactly what i did :lol:

To have the lights always off just write the same script but instead of calling and then hooking to leds_on, do it to set_leds ;-)

Another script i made makes the lights flash all the time :lol: jus call and then hook to own_toggle :-D


cheers

kraze1984
08-09-2004, 08:29 PM
LOL that's exactly what i did :lol:

To have the lights always off just write the same script but instead of calling and then hooking to leds_on, do it to set_leds ;-)

Another script i made makes the lights flash all the time :lol: jus call and then hook to own_toggle :-D


cheers

Maybe we should insert an own routine that should check whether there is some byte on an address in ram (ram_id) and then if, say, byte is 0 - then bl to set_leds (leds always off), if byte=1 then no bl's (normal operation), if byte=2 then bl to leds_on (always on). Then hook this own routine in task_0;
And create a routine that would set those 0,1,2 (maybe even using config ids!). The only thing, i don't know how to make those if-s in assembler. :(

grreetz!

danwood76
08-09-2004, 10:36 PM
Ifs in assembler

Use a Register for Example R1
then load 1 or 0 into register
and compare with a set number
then you can use several different commands
One is B if not Equal To BNE is assembler

eg:

CMP R1, #1
BNE @Set_lights

If the value in R1 was 1 then it would not jump and it would just process next command
If the Value in R1 was not 1 then it would jump to Set_lights

you can set these up on a loop like on the invert toggle patch

you will need an eeprom location to load to register I guess
then use a function to change the data in that eeprom address like the invert screen patch I guess

then get the constant running patch to check that eeprom address and set lights on or off as applicable

BTW I am newbie with ARM/Assembler so it may not be 100% correct but from what I have studied this should be right

regards,
Danny

mestrini
08-09-2004, 11:58 PM
aha... finally someone in our rescue ;-)

thanks for the info m8

i must finish reading my notes in asm and arm to start doing some stuff

cheers

danwood76
09-09-2004, 08:29 AM
Just as a little extra help
here is invert toggle hack

130e8c :b51f µ. : PUSH { R0,R1,R2,R3,R4, LR }
130e8e :2001 . : MOV R0, #1
130e90 :f7fffd9c: BL 1309cc (Routine (2 calls))
130e94 :2800 (. : CMP R0, #0
130e96 :d001 Ð. : BEQ 130e9c
130e98 :2100 !. : MOV R1, #0
130e9a :e000 à. : B 130e9e
130e9c :2101 !. : MOV R1, #1
130e9e :2001 . : MOV R0, #1
130ea0 :f7fffdaa: BL 1309f8 (Routine (1 calls))
130ea4 :2000 . : MOV R0, #0
130ea6 :2154 !T : MOV R1, #54
130ea8 :f753fa62: BL 84370 (Routine (7 calls))
130eac :bd1f ½. : POP { R0,R1,R2,R3,R4, PC }

regards,
Danny

kraze1984
09-09-2004, 07:27 PM
Just as a little extra help
here is invert toggle hack

130e8c :b51f µ. : PUSH { R0,R1,R2,R3,R4, LR }
130e8e :2001 . : MOV R0, #1
130e90 :f7fffd9c: BL 1309cc (Routine (2 calls))
130e94 :2800 (. : CMP R0, #0
130e96 :d001 Ð. : BEQ 130e9c
130e98 :2100 !. : MOV R1, #0
130e9a :e000 à. : B 130e9e
130e9c :2101 !. : MOV R1, #1
130e9e :2001 . : MOV R0, #1
130ea0 :f7fffdaa: BL 1309f8 (Routine (1 calls))
130ea4 :2000 . : MOV R0, #0
130ea6 :2154 !T : MOV R1, #54
130ea8 :f753fa62: BL 84370 (Routine (7 calls))
130eac :bd1f ½. : POP { R0,R1,R2,R3,R4, PC }

regards,
Danny

So that's how it works...
Thank you Danny!

Maybe you could have a look also in Problem writing script threed (last post) and give some suggestions? Not trying to bother you very much. :)

danwood76
09-09-2004, 11:12 PM
Maybee have a look through an on going function like the clock

there might be a good hooking point there
and the time is set all the time ;)
I would look but I am working on something at the moment :)

Maybee I will look sometime later next week

And about the toggle
It seems like it could be quite simple to write somehwere in the RAM or eeprom for a set byte
then all you need to do is a similar thing to the code I posted before where it checks the current LED value (maybee stored in another byte) with the one from the script

If it is different then it runs toggle LEDs
If not then it continues the same

Sounds so simple I know :eek:

regards,
Danny

ShadoW2004
13-09-2004, 12:05 PM
Somebody have good result?

danwood76
13-09-2004, 05:01 PM
I think the method I described before would make the phone quite slow
hmmmm

There must be an easier way to change the LEDs function to always on or always off
Maybee you could stop the thing that turns them on or off in the first place??

regards,
Danny

mestrini
13-09-2004, 07:46 PM
Has anybody noticed that when playing any game, one can choose to have lights on or off? that doesn't slow the phone and probably the answer lies there :-?

cheers

danwood76
14-09-2004, 08:35 AM
Yes I remember that stuff :)
I think I will try look for that
although games area is a bit complicated :(

I finished my other mod now so I think i will help here :)

regards,
Danny

ShadoW2004
14-09-2004, 07:27 PM
When keypad blocked and we pressing some key lights not turn on...I thing it's way...

mestrini
14-09-2004, 07:50 PM
When keypad blocked and we pressing some key lights not turn on...I thing it's way...

Not absolutely true m8. If you press the power button you turn on the lights (even with keypad locked)

I whish krisha and geggo could pass by this threads and leave some hints for us to follow. I'm not talking about making the scripts but give us a hand to make them ourselves

The german guys (and those who can read german) are the lucky ones 'cause GSMboard has a lot of usefull info regarding ARM and script writing... :-(

Let's keep on waiting and hoping for good news

danwood76
15-09-2004, 02:49 PM
Here is the answer that weve been looking for: (special thanks to Nokdoc for pointing me to answer)

For this example I use 3310 v6.33

The config bytes for the LEDs are located at 020033 (LCD lights) and 020020 (keypad lights)

The answer to this is very simple all we need to do is stop the original sw from turning the lights on and off
So what you do is search for all refernces to those bytes of data using winARM

The SW will use an LDR to load the address of the LEDs setting so the addresses will be in hex data

Search for hex data when you get areas that look like this: (taken from winARM)

044040 :00020033: : ...3
044044 :00020024: : ...$
044048 :00020020: : ...
04404c :00020039: : ...9

you simply need to change the 020033 and the 020020 to a dummy address
For example you can set them to 000000

There are several places in the flash file that contains these addresses
This is what I found so far:

044040
044048

0851E0
0851E8

0D1B0C
0D1B14

0E40C8
0E40D0

0E7FD0
0E7FCC

There might be more but as far as I can tell from my tests changing the data in these addresses stops the original SW from changing lights
Then you need to patch the slideshow for example and use the toggle function to turn your lights on and off

Maybee one of you guys might be able to make a script??
I am not good with scripting ;)

regards,
Danny

danwood76
15-09-2004, 04:43 PM
Here is a demo file I just made

You will have to remove the .txt off the end of each file name then use winRAR to unRAR it ;)
Also you will need all four parts in the same directory

*+0 turns LEDs on
*+1 turns LEDs off

Function addresses:

Set LEDs @ 130998
Get LEDs @ 13095C
Toggle Lights @ 130A1C
LEDs on @ 130A32
LEDs off @ 130A3C

regards,
Danny

ShadoW2004
16-09-2004, 05:20 AM
Good work danwood76 ;)

Now lights may be allways on and allways off only....

What about standart (automatic mode)?

danwood76
16-09-2004, 07:39 AM
Standard is a little harder :)

What I have done is stopped the phone from being able to turn lights on or off

I think the only way to make it standard again is to reverse the process or reroute the normal lights function to a free RAM address which you can use to switch on or off
but again I am not really sure

regards,
Danny

NokDoc
16-09-2004, 04:40 PM
Hi,

Nice job Dan.

I wouldn't be NokDoc if I shouldn't have comments too. :)

So; from all added functions, U need basically need... none.

Just zero'ing those 0002.0033 stuff is sufficient.

Just copy two parts of the functions for own useage, one for on, one for off.

The parts between disable and enable irq's, including them, is sufficient to use.

Then add 2 menulines somewhere, for setting on and off by using the BL to them two functions.

In case U want it to return the normal functioning for certain commands, it's not to hard to test one by one resetting the 0000.0000's into 0002.0033's again.

NokDoc

danwood76
16-09-2004, 05:52 PM
Just zero'ing those 0002.0033 stuff is sufficient.


It is also necessary in 3310 to 0 the 00020020 aswell as that controls the keypad LEDs :)

The extra functions I added were stolen from the slideshow patch
as you said they use the enable IRQ and disable IRQ functions to switch the LEDs :)

regards,
Danny

Lignomat1
26-09-2004, 07:44 AM
I must to congratulate danwood76...he has created for me patch for SWITCH OFF LEDs in Nokia 6210!!! Nobody in Poland couldn't do it for me!!!

THANKS A LOT!

Lignomat1

danwood76
26-09-2004, 10:43 PM
I am writing a script for this :)

the 3310 version is ready now I think
Just need some testers :)

I cant seem to patch it right as I cant get 5E0's to add ??
Comes up with an error (posted in nokix section already)
it should work

regards,
Danny

mestrini
27-09-2004, 12:51 PM
I tried your script it has one error that prevents it from patching at all.

You begin your script by defining next_address = x2d(200000) but before searching for LED_FUNC.B you have the end instruction that ( i believe) dumps the var. So the problem is that the start address to find LED_FUNC.B is no longer 200000 but 0!!


Time to Find other(s).....
# FIND: Start address out of range (0xC)!
# 50 *-* find next_address "patt" "mask"
# +++ RC=1 +++

I corrected by placing another next_address = x2d(200000) before the second patt search ;)

Problem solved another comes up. You finish the script by addding a 5e0 id to own_toggle_led but you don't save it to the pool. How will we call it?

I added it also but all i get after patching and flashing is a phone with lights off all the time :???:

Did i miss something??

cheers

ShadoW2004
27-09-2004, 01:36 PM
I too have this error...

mestrini
27-09-2004, 03:10 PM
I too have this error...


which one?

danwood76
27-09-2004, 04:47 PM
You begin your script by defining next_address = x2d(200000) but before searching for LED_FUNC.B you have the end instruction that ( i believe) dumps the var. So the problem is that the start address to find LED_FUNC.B is no longer 200000 but 0!!


Time to Find other(s).....
# FIND: Start address out of range (0xC)!
# 50 *-* find next_address "patt" "mask"
# +++ RC=1 +++

I corrected by placing another next_address = x2d(200000) before the second patt search ;)


That is correct I accidentally deleted it from my patch oops!

About the 5E0 id thing
I have a problem and that is I cannot add 5E0 ids for some reason
I always get errors and I get errors with other scripts that are supposidly working

But anyway my scripting sucks
I made a good demo flash with hex editor but obviously not so with nokix :)

The LEDs are not supposed to light until you use the toggle script then they will turn on :)
But wont turn off until you toggle again

It is a bit hard for me to see how to get them to work normally as well as this on/off function

I think it might be possible if we make the automatic patch to search for the LED registers in the eeprom then save our values to their but anyway it is a bit hard for me right now :)

thanks guys
regards,
Danny ;)

mestrini
27-09-2004, 04:56 PM
i know i'm blowing my own horn but i can write scripts well. The problem is that i don't know what is supposed to be changed (haven't studied your flash yet).

If you could explain what you did exactly with the hex editor i could try to make it with a script :D

thanks

danwood76
27-09-2004, 05:04 PM
OK this could be long :)

First of all I found all locations with the 00020033 and 00020020 in their and I changed those sections to 00's so that the original phone sw cannot change the LEDs status

I then patched another file with the slideshow from g3n0lite and took the LED functions from their and recalculated bls so that it worked good :)

I then made a shortcut using krisha's shortkey patch to turn leds on and off
I hope this makes sence mate :)

obviously you can use nokix to add the toggle LED function and shortkey if you want??

But I just cant get the damn thing to work good :)
Anyway if you can write a good script for it I have infos about the 8210 aswell so you could make a script that does both :)

regards,
Danny

danwood76
27-09-2004, 05:13 PM
I forgot to say that in the 3310 the LED register addresses are stored in two different formats

first goes like this: 00020033 00020024 00020020
scond like this: 00020020 00020033

thats why I made two sections to look for my data

just change the 00020033 and 00020020 to 00000000 and it stops the phones original sw from switching lights :)

regards,
Danny

mestrini
27-09-2004, 06:41 PM
I then patched another file with the slideshow from g3n0lite and took the LED functions from their and recalculated bls so that it worked good :)

I then made a shortcut using krisha's shortkey patch to turn leds on and off
I hope this makes sence mate :)

obviously you can use nokix to add the toggle LED function and shortkey if you want??

But I just cant get the damn thing to work good :)
Anyway if you can write a good script for it I have infos about the 8210 aswell so you could make a script that does both :)

regards,
Danny


That was a smart move, using the BL's from the slideshow patch

I already edited your script to be more eficient, i.e, used other means to get same result and added the 5E0 id but all get is a phone with lights OFF all the time :???:

Gonna revise it to see what i might be missing

I have a doubt about the patterns. How did you know that that was the right sequence of RAM addresses? If you look for those values separately you find an infinty of locations :???:

cheers

Lignomat1
27-09-2004, 08:25 PM
I believe to You danwood76:-)

danwood76
27-09-2004, 09:52 PM
It is simple I used my tool I call nokdoc
he gave me a staring point

then I looked in g3n0lite and it had the other LED locations :)

I then searched, patched and tested

I had a thought when I was doing this and that is the 3310 keypad never lights without the LCD lights

so it must call the 00020033 and 00020020 at the same time

also if you look in winARM it helps as you can see what is instruction code and what is characters so you can see if a chunk of code is

I hope this makes sence to you mate :)

I think nokix and g3n0lite search in blocks of bytes so say 2 at a time whereas a hex editor searches byte by byte
I might be wrong :)

Post up your patch to me so I can test and compare the code
it should toggle the LEDs hmmm
I will think about it :)

regards,
Danny

mestrini
27-09-2004, 10:47 PM
I think what we miss here is the relocation of the pointers. You did it by patching the slideshow with genolite (been studying your file with Winarm ;) )

The script you made, all it does is deleting the refs to the pointers and phone can't find them to toggle leds.

But that's my big problem when studying [CODE] lines in genolite/nokix scripts :mad: I still can't figure how they relocate and then link to the functions. It's the hook_task, i know, but how???

danwood76
27-09-2004, 10:48 PM
I found the problem :)

View the attached files

The patch that nokix uses must search for the LED data within the flash file :???:
As in the nokix version where the 00020033 and 00020020 should be is just 00000000

It is missing in both instances in the nokix version

I would expect if you changed these values back in your nokix modded file it would work

regards,
Danny

danwood76
27-09-2004, 10:58 PM
The script you made, all it does is deleting the refs to the pointers and phone can't find them to toggle leds.

Yes that is how I did it :)

Hooking is probably best explained by my modding machine nokdoc :)
I guess I will ask him when I see him next

Hooking in a task requires you to be able to relocate the data that was their originally

for example you might re-write an entire function somewhere else in the flash and change it slightly you would then need to point all the other functions to yours for it to work

I had problems recently hooking in my stuff for my power menu mod as BLs change some of the registers which can mess up some functions (when you use PUSH () and POP () for you new function)

(it would be nice if you think you could make a script for that but that is very complicated :))

regards,
Danny

NokDoc
28-09-2004, 04:38 PM
Hi,

If U patch the memory editor, U can set the values while phone is running.

When U change the value 02 to eg 00 at 0002.0033, it will set the lights off.

See 0002.0033 as a sort off 'lightswitch' button.

Now, when U know that, and U make all Nokia functions using that pointing to 'nowhere' (0), there won't be anyone pressing the switch.

All U need to add is Ur own 2 functions with menu entries to put the value 00 or 02 at the real 0002.0033 manually, like as U done with the memory editor manually.

I saw there already is 2 of such functions in every Nokia.
(xx AND FD, xx ORR 02)

So add 2 05E0's pointing to them, with 2 menu lines to set the On/Off state would be sufficient.

NokDoc

mestrini
28-09-2004, 05:17 PM
I've done it :-D

It's now possible to have leds always ON/OFF via patch.

It's been tested with 3310, 3330 and 3410 but 3350 must work also (3390 is out!)

So far it's possible to use it with shortkey and menu entry but both via 5E0. This means that it' not possible to have a menu with two entries: one for ON and other for OFF. For that it would require to have a Config ID and i don't know how to inject it into the flash :(


enjoy and post comments

cheers 8-)


edit:
new version uploaded with minor fixes. no changes to patching process :)

mestrini
28-09-2004, 05:43 PM
Hi,

If U patch the memory editor, U can set the values while phone is running.

When U change the value 02 to eg 00 at 0002.0033, it will set the lights off.

See 0002.0033 as a sort off 'lightswitch' button.

Now, when U know that, and U make all Nokia functions using that pointing to 'nowhere' (0), there won't be anyone pressing the switch.

All U need to add is Ur own 2 functions with menu entries to put the value 00 or 02 at the real 0002.0033 manually, like as U done with the memory editor manually.

I saw there already is 2 of such functions in every Nokia.
(xx AND FD, xx ORR 02)

So add 2 05E0's pointing to them, with 2 menu lines to set the On/Off state would be sufficient.

NokDoc

Believe that it's one of the things it makes me love you and hate you at same time :lol: You talk by riddles or use expressions very hard to decipher

It makes me work twice in order to keep up with you and get the results :-D

Any more clues about the AND FD / ORR 02 ?

cheers

NokDoc
28-09-2004, 06:01 PM
Hi,

8210-531, 0ECA90, 0ECAA6.

Those toggles that byte in 0002.0033.

NokDoc

mestrini
28-09-2004, 07:11 PM
Hi,

If U patch the memory editor, U can set the values while phone is running.

When U change the value 02 to eg 00 at 0002.0033, it will set the lights off.

See 0002.0033 as a sort off 'lightswitch' button.



been trying to change the value at 00020033 (and 00020020 also) on my 3310 but the phone won't let me :???: values return to original as soon as i navigate the addresses

can it be because i'm using nokix's memory editor and not genolite's? or there's a trick i don't know of?

NokDoc
28-09-2004, 08:59 PM
Hi,

Dono.

Here's a working one. ;)

NokDoc

mestrini
29-09-2004, 01:14 AM
Well, looks like the problem was in the flash i was using and not nokix's patch. Since the flash was heavily modded the memory editor got screwed. :razz: tested it in a clean flash and now it saves changes ok :)

what i found out after playing around is that, since 3310 has different RAM locations for keypad and LCD leds, one has to edit both 00020033 and 00020020 else gets LCD OFF but keypad ON and vice-versa :lol:
Another thing i noticed is that after a while phone writes back to those locations. For instance, if we change 00020033 value from 02 to 01 it changes back to 03 (adds +2). I noticed also that every pair of numbers (0 and 1, 2 and 3, 4 and 5, etc until E and F) corresponds to a led state
like this:
0 and 1 - LEDs OFF
2 and 3 - LEDS ON
4 and 5 - LEDS OFF
6 and 7 - LEDS ON
...

This means that the led_state function (let's call it for now :razz: ) after a pre-defined period adds 2 to the existing value thus changing the LEDs condition.

danwood76
29-09-2004, 08:40 AM
Hi,

8210-531, 0ECA90, 0ECAA6.

Those toggles that byte in 0002.0033.

NokDoc

We are injecting our own functions to toggle LEDs (well G3's actually)
this is perfect for it

What I was thinking of doing is maybee re-writing the automatic on/off function that checks keypad etc
and add in a check for a config bit

example if the config bit was 0 then it would skip the entire function and not automatically switch on/off the lights

I need some info on config nibbles I think :)

regards,
Danny

mestrini
29-09-2004, 10:05 AM
We are injecting our own functions to toggle LEDs (well G3's actually)
this is perfect for it

What I was thinking of doing is maybee re-writing the automatic on/off function that checks keypad etc
and add in a check for a config bit

regards,
Danny


continuing my previous post i found out that at the location 00020020 the bytes that control the keypad leds work like this:
0 to 7 - LEDS OFF
8 to F - LEDS ON

also noticed that after lights go OFF and then refreshing the screen (* key in memory editor ;) ) the values would change to 0 and then again to 8. Which means that for this pointer the phone adds 8 to change led state.



Went to look for these values in 3310 v6.33 and found several places responsible for the change in led state. At 0E3EC2 there's a fine example of what i said. You can see there references to the pointers, BL's to enable/disable IRQ and two instructions like these - MOV R0, #2 and MOV R0, #8 - ;)

NokDoc, do you have any idea what can be done with this function ??

thnx

NokDoc
29-09-2004, 04:41 PM
Hi,

The trigger is a toggle which means setting (1) or unsetting (0) the 7th bit of that byte at 0002.0033.

That's why U always see this ON-ON-OFF-OFF-ON-ON-OFF-OFF.. cycles.

Some advices:

- Config nibbles etc. is way beyond the purpose, we not need to use own allocated memory or eeprom backup values stuff. (yet?)

- Not ask Urself why there still is those 6 to 10 other functions that uses this 0002.0033 toggle normally.
.. We'll disable them instead, so we're sure noone will interfear our experiment here.

I know I failed in explaining, therefore I will make U a working demo file now.

Hope to be back within the hour. ;)

NokDoc

NokDoc
29-09-2004, 07:03 PM
Hi,

ToggleLed 3310-579:

043CD4: 0002.0033 > 0000.0000
082844: 0002.0033 > 0000.0000
0915C4: 0002.0033 > 0000.0000
0D16B4: 0002.0033 > 0000.0000
0D63DC: 0002.0033 > 0000.0000
0D6714: 0002.0033 > 0000.0000
0D73D0: 0002.0033 > 0000.0000
0E34C0: 0002.0033 > 0000.0000
0E7090: 0002.0033 > 0000.0000

10E5A7: 30 > BA < Menu NetMon Now is 05E0_BA ToggleLed.

122471: E6 > 33 < added 05E0_BA
122472: 00 > FF
122473: E7 > D1
122475: E6 > 00
122477: E7 > 00

ToggleFunction at 13FFD0: (B500F7A4F8A04908780807820FD22A01D00322024302700AE00222FD4002700AF7A4F89EBD0046C000020033)

Tested working.

NokDoc

NokDoc
29-09-2004, 07:08 PM
Hi,

I addition, 8210_531:
00080378 > 00000000
000ECC60 > 00000000
000ECF98 > 00000000
000F64AC > 00000000
000FB014 > 00000000

3310-633:
00044040 > 00000000
000851E0 > 00000000
0009209C > 00000000
000D1B0C > 00000000
000D68B8 > 00000000
000D6C0C > 00000000
000D7FA0 > 00000000
000E40C8 > 00000000
000E7FD0 > 00000000

Not tested, though will work too. ;)

NokDoc

NokDoc
29-09-2004, 07:18 PM
Hi,

>> NokDoc, do you have any idea what can be done with this function ??

Yep,

One of them is my WakeUp Alert in the morning.

Find out which one of the 0002.0033 > 0000.0000 is for alert.

My boss would appreciate that.

NokDoc

mestrini
30-09-2004, 02:19 PM
Hi,

ToggleLed 3310-579:

043CD4: 0002.0033 > 0000.0000
...

10E5A7: 30 > BA < Menu NetMon Now is 05E0_BA ToggleLed.

122471: E6 > 33 < added 05E0_BA
122472: 00 > FF
122473: E7 > D1
122475: E6 > 00
122477: E7 > 00

ToggleFunction at 13FFD0: (B500F7A4F8A04908780807820FD22A01D00322024302700AE00222FD4002700AF7A4F89EBD0046C000020033)

Tested working.

NokDoc


Hi,

already tested it and it works good except the fact that it only toggles LCD leds :P
Still, i think that the idea is same as my script above, because when i call function own_toggle_led, nokix creates a code to enable/disable IRQ and leds masks.

I must say that i'm really enjoying editing the memory directly on the phone and also with hexeditor :-D but i'm still kinda lost with all these functions and your answer regarding the 7th bit :-?

What would happen if we would change the added value to R0 in those addresses i mentioned? For instance, adding 3 instead of two would probably get leds to remain in same state no?

A lot of work must be done (home work study :lol: )

cheers

mestrini
30-09-2004, 04:06 PM
Can you explain how to get to the "code"? :o


B500F7A4F8A04908780807820FD22A01D00322024302700AE 00222FD4002700AF7A4F89EBD0046C000020033


this is a bit off topic, i know but...

Let's say i want to change the third bit at 00020001. How can i write a function to do that? (it resets the phone without the need tyo enter pin code ;-) )

plz

NokDoc
30-09-2004, 04:36 PM
Hi,

12ED1C [(#05E0 BA: (00000000) Own_Led Toggle)]
-----------------------------------------------v start routine
(+000 12ED1C) B500.... : PUSH {, LR}
(+004 12ED1E) F7B5F9FA : BL 0E4116 Routine [Fun: DisableIrq])
(+006 12ED22) 4908.... : LDR R1, #00020033
(+008 12ED24) 7808.... : LDRB R0, [R1, #0]
(+00A 12ED26) 0782.... : LSL R2, R0, #.30
(+00C 12ED28) 0FD2.... : LSR R2, R2, #.31
(+00E 12ED2A) 2A01.... : CMP R2, #1
(+010 12ED2C) D003.... : BEQ+ 12ED36 ->
(+012 12ED2E) 2202.... : MOV R2, #2
(+014 12ED30) 4302.... : ORR R2, R0
(+016 12ED32) 700A.... : STRB R2, [R1, #0]
(+018 12ED34) E002.... : B+ 12ED3C ->
(+01A 12ED36) 22FD.... : MOV R2, #FD <-
(+01C 12ED38) 4002.... : AND R2, R0
(+01E 12ED3A) 700A.... : STRB R2, [R1, #0]
(+022 12ED3C) F7B5F9F8 : BL 0E4130 Routine <- [Fun: EnableIrq])
(+024 12ED40) BD00.... : POP {, LR}
-----------------------------------------------^ end routine

Do note it's at another address as in the demo I gave..

Bit7:

02 = 0000.0010
FD = 1111.1101

Actually it doesnot matter what value is there in bytes, just bit 7 will react.

In the demo I did some LSL/ LSR shifting to get the 31th bit from a dword.

>> already tested it and it works good except the fact that it only toggles LCD leds

Well, what else I missed then?

In my 3310 all lights went on or off, both the screen and keypad ones.

Anyway, based on this I'm already making a new demo file (8210) with a 3th option, On, Off or Set Nokia Default which will the lights behave like original.

NokDoc

mestrini
30-09-2004, 04:57 PM
Hi, ...

Bit7:
02 = 0000.0010
FD = 1111.1101

Actually it does not matter what value is there in bytes, just bit 7 will react.

In the demo I did some LSL/ LSR shifting to get the 31th bit from a dword.

NokDoc
About the bits i got it a after i posted and that's why i was asking how to change the third bit at 00020001. In Project Blaksphere's page there's a great list with RAM addresses ;) there are a lot of cool things to do with memory editor
Just one thing i'm missing. Where to start counting the bits? I think the Indians are involved right? :lol: and how to know only the 7th bit matters?



>> already tested it and it works good except the fact that it only toggles LCD leds

Well, what else I missed then?

In my 3310 all lights went on or off, both the screen and keypad ones.
NokDoc
About the keypad leds it means you have an old board where all leds are controlled by same address. My boards have independant circuits and i must change values in 00020020 and 00020033 ;)


Anyway, based on this I'm already making a new demo file (8210) with a 3th option, On, Off or Set Nokia Default which will the lights behave like original.


That's our main gold i believe :-D

danwood76
30-09-2004, 05:00 PM
In my 3310 all lights went on or off, both the screen and keypad ones.


You might have the old 3310 hardware where there is one control for both LED sets

I will test this later am a little busy right now :)

regards,
Danny

NokDoc
30-09-2004, 05:31 PM
Hi,

Oh, oops. :)

It was a 406 when I bought it some 3 years ago.

Anyway, U know the same toggle idea can be used on the other, or even at both addresses.

NokDoc

mestrini
01-10-2004, 05:59 PM
Hi,
can you help me understand your code?

(+006 12ED22) 4908.... : LDR R1, #00020033
this means loading that RAM address to R1

(+008 12ED24) 7808.... : LDRB R0, [R1, #0]
this means loading the lower 8 bits of R1 to R0 (but why add 0 ??)

(+00A 12ED26) 0782.... : LSL R2, R0, #.30
this means that you shift R0 to the left to get bit #30 and load it to R2

(+00C 12ED28 ) 0FD2.... : LSR R2, R2, #.31
why shift right after doing it to the left?

(+00E 12ED2A) 2A01.... : CMP R2, #1
check if the 7th bit has value 1 (??)

(+010 12ED2C) D003.... : BEQ+ 12ED36 ->
If last statement is true then jump to given address

(+012 12ED2E) 2202.... : MOV R2, #2
this means give R2 the value 00000010 in binary of course

(+014 12ED30) 4302.... : ORR R2, R0
this means that it's either R0 or R2 (what for?)

(+016 12ED32) 700A.... : STRB R2, [R1, #0]
this means store byte's address to memory (??)

(+018 12ED34) E002.... : B+ 12ED3C ->
this means that job is done and so jump to end of routine and call enable IRQ function

(+01A 12ED36) 22FD.... : MOV R2, #FD <-
this means changing value of R2 to 11111101 thus changing value of 7th bit
(+01C 12ED38 ) 4002.... : AND R2, R0
another boolean but why (??)

(+01E 12ED3A) 700A.... : STRB R2, [R1, #0]
store value

(+022 12ED3C) F7B5F9F8 : BL 0E4130 Routine <- [Fun: EnableIrq])
jump to enable leds function to sett leds

(+024 12ED40) BD00.... : POP {, LR}
-----------------------------------------------^ end routine


>> Actually it doesnot matter what value is there in bytes, just bit 7 will react.
how to manage it?


hpoe you can find time to enlighten me a bit

thanks

NokDoc
01-10-2004, 09:33 PM
Hi,

1st, Bit 7 in a byte is same as Bit 31 in a dword.
(counting in 1-8 or 1-32 sequence)

(+006 12ED22) 4908.... : LDR R1, #00020033
(+008 12ED24) 7808.... : LDRB R0, [R1, #0]
This means loading the byte of the 0'th pos at R1 to R0

(+00A 12ED26) 0782.... : LSL R2, R0, #.30
(+00C 12ED28 ) 0FD2.... : LSR R2, R2, #.31
shift right get to rid if the 32th bit too, not only the 30 in front.

(+00E 12ED2A) 2A01.... : CMP R2, #1
since the 31th bit is at the 32th place now, I can use it as 0 or 1 in the CMP.

(+012 12ED2E) 2202.... : MOV R2, #2
(+014 12ED30) 4302.... : ORR R2, R0
00 ORR 02 = 02
02 ORR 02 = 02
So this ORR function does force an ON

(+016 12ED32) 700A.... : STRB R2, [R1, #0]
Put a 02 at the loc 0002.0033 is setting the lights on.

(+01A 12ED36) 22FD.... : MOV R2, #FD <-
(+01C 12ED38 ) 4002.... : AND R2, R0
00 AND FD = 00
02 AND FD = 00
So this AND function does force an OFF

(+01E 12ED3A) 700A.... : STRB R2, [R1, #0]
Put a 00 at the loc 0002.0033 is setting the lights off.

>> how to manage it?

Keep looking at it... ;)

It will come soon.

NokDoc

NokDoc
02-10-2004, 10:30 AM
Hi,

Some more about the bitshifting.

LSL30, LSR31:
xxxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxAx
Axxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
xxxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxA

After this all x's are always set to zeros, so we always and with 0 or 1.

Which say the current bit state of 31.

The 0002.0022 one: >> 0 to 7 - LEDS OFF >> 8 to F - LEDS ON

Try to see this pattern for that in same way:

LSL28, LSR31:
xxxxxxxx.xxxxxxxx.xxxxxxxx.xxxxAxxx
Axxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxx
xxxxxxxx.xxxxxxxx.xxxxxxxx.xxxxxxxA

U'll see then U must ORR/ AND with 08 and F7 instead of 02/ FD.

NokDoc

mestrini
02-10-2004, 10:45 AM
thanks for the info m8 :)

it's makes sense now, but what was making me really confused was the fact that in the manuals i have about ASM, shifting means pushing bits to one side and, at same time, perform multiply or division operations :???:

still, my previous request about 3rd bit of 00020001 is already solved because i found a place in the firmware where the operation is being made (you must have seen my answer to another thread startedd by User32 ;) )

mestrini
03-10-2004, 12:57 PM
Hi, i've done it!!!

I followed your explanation and managed to create my own code to change a bit value at address 00020001. :D

now i can reboot my phone via 5e0 id either from nokia's function or my own ;)

thanks m8

both scripts will be released soon

cheers

mestrini
04-10-2004, 03:09 PM
just to let you know a new version of LED_toggle script has been uploaded

check my thread above ;) http://nokiafree.org/forums/showpost.php?p=335587&postcount=51

cheers

ShadoW2004
04-10-2004, 05:05 PM
2 mestrini

What changed in new version?!

mestrini
04-10-2004, 05:43 PM
2 mestrini

What changed in new version?!


the changes are mentioned both in the thread and in the script ;)

just a few lines i missed and some minor cosmetic changes to the output window but nothing that messes with the way it patches :)

cheers

anorien
06-10-2004, 10:54 AM
2 Mestrini

I tested your version 1.2 on 3315 v6.07.
It seems that not all pointers were "zeroed" because LEDs switch back on after a while when any key is pressed (nokia default).

anorien

mestrini
06-10-2004, 12:55 PM
Hi anorien,

just flashed my 3310 with a 6.07 flash and the script above and the behaviour you described didn't happen :-?

My lights stay ON or OFF forever...

Maybe you patched some other script . It's better to give full info of procedures otherwise we might be going wrong way to find out errors in sripts ;)

BTW, i already found out that only the last of the 4 pointers is needed to have the lights stay in a permanent state ;)

I also found a BL that when NOPed doesn't require to "zero" any pointers :D
Maybe soon i'll get a script with three options: ON, OFF, Default :cool:

cheers

kraze1984
06-10-2004, 06:47 PM
How much things can happen in only two weeks of september!
Those that i wasn't connected... and i'm completely out of the things that happen...

continue your doings!

grreetz

anorien
07-10-2004, 09:05 AM
Hi anorien,

just flashed my 3310 with a 6.07 flash and the script above and the behaviour you described didn't happen :-?



Hi mestrini,

you are right. I made a test. I patched only toggle_leds and shortkeys and problem disappearred. It is as you expected. There is an enterference with other script(s). I prefer to wait for your new script (on/off/default).

Here is a list what I patched before:
SCRIPT Y kill_faid_check.nrx
SCRIPT Y kill_mcu_check.nrx
SCRIPT Y add_ppm_strings.nrx new_ppm_strings.txt
SCRIPT Y true_7_bars.nrx true7bars.txt
SCRIPT Y call_duration.nrx
SCRIPT Y minute_beep.nrx
SCRIPT Y fade_leds.nrx
SCRIPT Y more_templates.nrx empty
SCRIPT Y rhythmic_leds.nrx
SCRIPT Y watch.nrx
SCRIPT Y guard.nrx 0x21 0x1e 0x1d 0x23 0xa0 0x8f
SCRIPT Y keylock_guard.nrx
SCRIPT Y keylock_clock.nrx
SCRIPT Y slideshow.nrx slideshow_nokia_3310.txt
SCRIPT Y slideshow.nrx slideshow_hands.txt
SCRIPT Y slideshow.nrx slideshow_hell.txt
SCRIPT Y write_main_menu.nrx menu_full.txt
SCRIPT Y write_main_menu.nrx menu_restricted.txt
SCRIPT Y led_toggle.nrx
SCRIPT Y shortkeys.nrx shortkeys.txt

anorien
12-10-2004, 09:59 AM
Hi anorien,

just flashed my 3310 with a 6.07 flash and the script above and the behaviour you described didn't happen :-?

My lights stay ON or OFF forever...



Hi mestrini,

I found where the conflict was. fade_leds.nrx v1.0 :)
Can you take it into consideration when you produce your new one?

Thanks

krisha
13-10-2004, 12:23 AM
in the past i'm trying to make a led patch, with that you would be able to use leds clock dependent. i never finished it... but it should be nearly complete.

i think it has support for fadeleds also, but there could be some misstakes :)

here you can get the source: http://www.gsmfreeboard.eu.org/forum/showthread.php?t=84158

maybe someone want to finish it :)

NokDoc
14-10-2004, 10:28 PM
Hi,

No worry, I already have a working demo for On/ Off/ Default.

Only it's based on those 'old' types, like my 8210 & 3310.

I will chat to Dan and hope I'll learn what's needed for those new ones.

More later.

NokDoc

NokDoc
15-10-2004, 09:18 PM
Hi,

Here's 8210 On/Off/Default demo.

NokDoc

ShadoW2004
16-10-2004, 05:31 AM
2 NokDoc

Hi, I cant test it becouse I dont have 8210, but I think it is work...

Can You do it for 3310?

danwood76
16-10-2004, 02:44 PM
We will be working on it in the next week I expect :)

I have already started looking through nokdocs code
and comparing it to stuff on the 3310

I have so far worked out the patterns needed for the function just need nokdoc to help with code ;)

regards,
Danny

NokDoc
17-10-2004, 10:01 PM
Hi,

Here's 3310 On/Off/Default demo.

Can be used on both old and new types I hope.

NokDoc

ShadoW2004
18-10-2004, 04:27 AM
Good work NokDoc ;)

What about .nrx?

gsmsikar
18-10-2004, 07:10 AM
Hi,

Here's 8210 On/Off/Default demo.

NokDoc


can we use this 8210 flash with the ROM 5 version of 8210?

danwood76
18-10-2004, 10:00 AM
What about .nrx?

Im working on it
It should hopefully be ready middle of the week :)

@Gsmsikar

yes it will work with any rom version on 8210

Nokdoc only has phones that pre-date around 4 years so you can gaurantee his flashes are backward compatible

regards,
Danny

danwood76
19-10-2004, 11:21 PM
Ok here is a new model of the script

Based on nokdocs patch
I think mestrini has one also :)

This allows you to toggle on/off/default

regards,
Danny

ShadoW2004
20-10-2004, 03:41 PM
2 danwood76

Hi I have error with your script:
# Processing: led_toggle_v2.nrx
3310 flash file loaded

Old LED calls Patched
OK new code patched
# FINDBL: Start address out of range (0x0)!
# 244 *-* findbl current_address
# +++ RC=1 +++
# SETDATA: Address out of range (0x0)!
# 246 *-* setdata current_address "nopx2"
# +++ RC=1 +++
# FIND: Start address out of range (0x0)!
# 247 *-* find current_address "fldrb" "fmask2"
# +++ RC=1 +++
# SETBL: Source address out of range (0x0)!
# 249 *-* setbl current_address led_action
# +++ RC=1 +++
# SETDATA: Address out of range (0x4)!
# 251 *-* setdata current_address "nopx3"
# +++ RC=1 +++
# FINDBL: Start address out of range (0x4)!
# 252 *-* findbl current_address
# +++ RC=1 +++
# FINDBL: Start address out of range (0x4)!
# 254 *-* findbl current_address
# +++ RC=1 +++
# FINDBL: Start address out of range (0x4)!
# 256 *-* findbl current_address
# +++ RC=1 +++
# SETDATA: Address out of range (0x0)!
# 258 *-* setdata current_address "nopx2"
# +++ RC=1 +++
# FIND: Start address out of range (0x0)!
# 259 *-* find current_address "fldrb" "fmask2"
# +++ RC=1 +++
# SETBL: Source address out of range (0x0)!
# 261 *-* setbl current_address led_action
# +++ RC=1 +++
# SETDATA: Address out of range (0x4)!
# 263 *-* setdata current_address "nopx3"
# +++ RC=1 +++
# FINDBL: Start address out of range (0x8)!
# 265 *-* findbl current_address
# +++ RC=1 +++
# FINDBL: Start address out of range (0x4)!
# 244 *-* findbl current_address
# +++ RC=1 +++
# SETDATA: Address out of range (0x0)!
# 246 *-* setdata current_address "nopx2"
# +++ RC=1 +++
# FIND: Start address out of range (0x0)!
# 247 *-* find current_address "fldrb" "fmask2"
# +++ RC=1 +++
# SETBL: Source address out of range (0x0)!
# 249 *-* setbl current_address led_action
# +++ RC=1 +++
# SETDATA: Address out of range (0x4)!
# 251 *-* setdata current_address "nopx3"
# +++ RC=1 +++
# FINDBL: Start address out of range (0x4)!
# 252 *-* findbl current_address
# +++ RC=1 +++
# FINDBL: Start address out of range (0x4)!
# 254 *-* findbl current_address
# +++ RC=1 +++
# FINDBL: Start address out of range (0x4)!
# 256 *-* findbl current_address
# +++ RC=1 +++
# SETDATA: Address out of range (0x0)!
# 258 *-* setdata current_address "nopx2"
# +++ RC=1 +++
# FIND: Start address out of range (0x0)!
# 259 *-* find current_address "fldrb" "fmask2"
# +++ RC=1 +++
# SETBL: Source address out of range (0x0)!
# 261 *-* setbl current_address led_action
# +++ RC=1 +++
# SETDATA: Address out of range (0x4)!
# 263 *-* setdata current_address "nopx3"
# +++ RC=1 +++
# FINDBL: Start address out of range (0x8)!
# 265 *-* findbl current_address
# +++ RC=1 +++
Toggle the LED mode with 'ledtoggle' 5E0

# Script error!


I use v.6.07...

danwood76
20-10-2004, 04:47 PM
Strange :-?

Well i wrote it from 6.33 but I also tested it on 5.57 and 5.79 both worked fine

Maybee it is another patch interfeering??
Try patching it just on its own

regards,
Danny

ShadoW2004
20-10-2004, 05:07 PM
I changed pisition in scripts list and all patching ok! :)

ShadoW2004
20-10-2004, 06:08 PM
I patched led_toggle_v2.nrx with all scripts and have some trouble:
did't work >> DEF << mode and Rithmic LEDs not working :sad:

danwood76
20-10-2004, 10:18 PM
I patched led_toggle_v2.nrx with all scripts and have some trouble:
did't work >> DEF << mode and Rithmic LEDs not working :sad:

Hmmm
I will take a look at what the Rythmic LEDs patch does

But it does work with out the rythmic being in same patch?

regards,
Danny

danwood76
20-10-2004, 10:40 PM
Try patching the rhythmic LEDs first

When I did a test patch the rythmic LEDs uses one of the LED patches to get its LED locations which my patch then removes :)
Patch that first and all should be fine

regards,
Danny

mestrini
20-10-2004, 11:24 PM
That happens because the locate.rx looks for pointers in flashes when it should give them values.
I'll explain. Since all DCT3 are already released it's easy to know which model calls which RAM address by studying their flashes (except 3210). My locate.rx gives the pointers (registers) specific values ;)

So, when applying patches that work on leds i never get errors :grin:

cheers

danwood76
21-10-2004, 10:49 AM
Also if you use Fade_Leds you will have a problem if my patch is used after as my patch will erase the hook that fade LEDs adds

And if you patch the other way round fade LEDs will not work

I will try to make a patch that allows for the fade_leds function

regards,
Danny

mestrini
21-10-2004, 03:52 PM
No solution there m8 :-x

I have same problem with my script and even editied the Fade_leds.nrx not to overwrite the hook BL . But problem still there, no more always on or always off; default is always working

Unless NokDoc changes his code i see no solution :(

danwood76
21-10-2004, 04:59 PM
I am going to edit nokdocs patch I think :)

I must first look for the right place for the hook
Then add it in Armada the code etc

I will have a try and post results in the next few days

regards,
Danny

JUNT
22-10-2004, 01:40 AM
Thanks To This Script, Its 100% Working On My 3310, No Problem

JUNT
22-10-2004, 01:44 AM
i just wanna ask if you can add or make another for blinking/default.

mestrini
22-10-2004, 02:10 AM
what do you mean?

there's already the rythmic back lights script that has on/off option and works simultaneously with this one ;)

JUNT
22-10-2004, 03:01 AM
Rhythmic backlights is different coz it only blinks when there is a sound, the other one we need here is the one automatically blinks the light when selected with out a tone. Just like the leds off option when selected it goes off the lights at once forever.

kraze1984
22-10-2004, 11:49 AM
Rhythmic backlights is different coz it only blinks when there is a sound, the other one we need here is the one automatically blinks the light when selected with out a tone. Just like the leds off option when selected it goes off the lights at once forever.
Make an empty melody without notes but with pauses (and maybe vibrations). I think it should solve it.

mestrini
22-10-2004, 01:09 PM
Rhythmic backlights is different coz it only blinks when there is a sound, the other one we need here is the one automatically blinks the light when selected with out a tone. Just like the leds off option when selected it goes off the lights at once forever.


I still don't get your point :-? You want to navigate through menus and have lights flashing all the time?

JUNT
23-10-2004, 01:52 AM
This is only for signal light purposes during night time especially walking in a dark road, not for menus navigation which is very bad if used.

danwood76
23-10-2004, 11:20 AM
I have now made a working LED_toggle_v2 and Fade_led flash
I just need to finalise the search functions and I will post

regards,
Danny

joci2000
24-10-2004, 04:43 PM
hi all

i have a little question

is it possible to turn on/off only the keypad or lcd lights?
i have quite new board of 3330 but if i try to turn off one of them with memory editor it change back to original position.

BUT if i convert my phone into 3350 it turn off/on only one what i want.

so is it possible with my 3330?

danwood76
24-10-2004, 11:36 PM
Your answer is at the start of this thread

You must 00 the original LED pointers to stop the firmware from changing the values back

regards,
Danny

JUNT
25-10-2004, 01:22 AM
What part of the script is the ON & OFF, coz i would like to customize the script to OFF/DEFAULT only. coz sometime i forget the lights that it was selected to >>ON<< and not the >>DEF<< option and my battery drains faster.

mestrini
25-10-2004, 12:04 PM
Ok guys,

took me a while but managed to acomplish the task of making my own "three_way" led toggle. (on-off-auto)

This one works in a completely different way from NokDoc's demo (Dan's script) because there's no need to zero any pointers and causes no conflicts with other led scripts since it doesn't write any code to the set/unset_lights routines :razz:
Tested on a 3310 but should work in all NHM plattform(except 3390)

To know how to use script just read its info in nokix

Post comments please, thanks

enjoy :cool:

mestrini
25-10-2004, 07:21 PM
Tested on a 3410 v5.30 with relative success since nokix has problems with this phone regarding the saving of configs in eeprom. So the script works but automode is always Off because it's not possible to change it. that's a problem for YAK to solve :razz:

About 3310 there's an issue that i must warn you about: If you turn phone off with automode in OFF, phone will remember that state when you turn it on. The problem is that lights will be ON because own_led_toggle isn't saved in eeprom but in RAM. If you forget that, you'll have phone with lights always ON ;)

I think i should have phone saving settings for automode in RAM also so that when phone is turned off it will be back to default condition. Later...

cheers

JUNT
26-10-2004, 12:49 AM
I think i should have phone saving settings for automode in RAM also so that when phone is turned off it will be back to default condition. Later...

cheers

Yes, its the best one to create. thanks in advance.

joci2000
27-10-2004, 08:40 AM
Your answer is at the start of this thread

You must 00 the original LED pointers to stop the firmware from changing the values back

regards,
Danny

hi
thx your answer but after i change these values it still changes back the lights :cry:

so what need i do?

change 000200020 & 000200033 to 00 it is two bytes am I right?

originally the first 18 the second 02 but how could i turn on/off only the first or second?

danwood76
27-10-2004, 11:24 AM
Use this nokix patch

http://nokiafree.org/forums/attachment.php?attachmentid=13145

It will search and destroy all the pointers for you
The pointer 00020033 should be replaced by 00000000 if you were to read the entire thread you would know this!!

regards,
Danny

joci2000
29-10-2004, 06:24 PM
Use this nokix patch

http://nokiafree.org/forums/attachment.php?attachmentid=13145

It will search and destroy all the pointers for you
The pointer 00020033 should be replaced by 00000000 if you were to read the entire thread you would know this!!

regards,
Danny


thx your reply

yes i try to change the all at 00020033 but it isn't change the all only the first two byte :cry:

danwood76
30-10-2004, 01:45 AM
I think you missed what I mean

In the flash file (open with hex edit and winarm) search in winarm for addresses that LDR the 00020033 and then zero the address it loads so change the 00020033 to 00000000

There will be four of five places that this occurs
then when you turn on your phone you will get no LEDs lit
You can then change these to on a nd off with memory editor

regards,
Danny

mestrini
30-10-2004, 02:07 AM
@ joci

if you read the whole thread (3 pages) carefully (take your time) you see the steps we've taken to reach this point. Somewhere in the middle are a lot of references to the pointers you're supposed to zero.

some info: 00020033 is for LCD leds
00020020 is for keypad leds

compare a virgin flash with a patched one (use an hexeditor) and see which places were changed. all you have to to is replace the zeros with the original values depending on which hardware part (lcd or keypad) you want to restore

cheers

PS:
see my signature ;)

joci2000
02-11-2004, 10:14 AM
I think you missed what I mean

In the flash file (open with hex edit and winarm) search in winarm for addresses that LDR the 00020033 and then zero the address it loads so change the 00020033 to 00000000

There will be four of five places that this occurs
then when you turn on your phone you will get no LEDs lit
You can then change these to on a nd off with memory editor

regards,
Danny

yes i missed
thx your answer :)

joci2000
12-11-2004, 06:32 PM
hi everybody

i have a little question about leds.

is it possible to put 16 led into 1 phone?

i mean that i would like to put 2 leds into 1 place. will this work? or it is impossible to put more than 8 leds.

i want to made this because here is the led on/off script and after that i want to make my phone has 2 colours. one on the lcd line ant other in the keypad line.

danwood76
12-11-2004, 06:59 PM
It would be possible to put that many LEDs in but they would be quite dim and you would drain your battery very quickly

regards,
Danny

joci2000
13-11-2004, 06:15 PM
It would be possible to put that many LEDs in but they would be quite dim and you would drain your battery very quickly

regards,
Danny


yes really but for that i use led on/off script :-D

ShadoW2004
27-11-2004, 07:57 PM
Ok guys,

took me a while but managed to acomplish the task of making my own "three_way" led toggle. (on-off-auto)

This one works in a completely different way from NokDoc's demo (Dan's script) because there's no need to zero any pointers and causes no conflicts with other led scripts since it doesn't write any code to the set/unset_lights routines :razz:
Tested on a 3310 but should work in all NHM plattform(except 3390)

To know how to use script just read its info in nokix

Post comments please, thanks

enjoy :cool:

Is your script saving settings in the EEPROM?

mestrini
28-11-2004, 03:01 AM
Is your script saving settings in the EEPROM?

It stores one bit only; to tell the phone that lights automode is ON or OFF (1 or 0).
The leds toggle is simply made with yak's toggle_led script.

ShadoW2004
28-11-2004, 09:32 PM
Try to test it with intro...i think something wrong isn't it?

LGHTS_ON or LGHTS_OFF is not saving...if we do lights turned off after reboot we have lights turned on :sad: I think we need save it ...what you think?

So, functions in one menu must be:

Automatic
Allways ON
Allways OFF

It will be grate!

danwood76
28-11-2004, 09:49 PM
Shadow there are 2 different controls for mestrini's patch

Nokia Auto Mode (that is the coinfig ID)
On/Off

LEDs (5E0 id)
On/Off

If you have auto mode off the leds will be off when you turn on the phone but if you restore that to on the lights will come on as usual

regards,
Danny

mestrini
29-11-2004, 01:53 AM
@ shadow

what dan said is correct and is also explained in script's info (maybe not so good :-P )

nokdoc's patch works only with own_ram meaning that every time phone is turned off the selected state is erased, being always Automatic when phone turned on

I'm thinking of making a new version only to enable/disable the automode and storing it with own_ram (not eeprom). This means that to have lights always off user must wait until lights go out (keypad locked) and then disables the automode. To have lights always on must have lights already on and then disable automode aswell

Like this:

Lights On => have lights on and automode switched off
Lights Off => have lights off (keypad locked) and automode switched off
Automode => switch on automode

:D

what u guys think? worth making this version?


cheers

ShadoW2004
29-11-2004, 05:48 AM
There is bug...it not working corectly with slideshow/intro.nrx and with rhithmic_leds.nrx :-( try to patch your script and this two and see result....

2 NokDoc

I know it... ;)

2 mestrini

I think it will be cool to do new version... ;)

danwood76
29-11-2004, 10:42 AM
Nokdoc was making another version of his patch which saved a config nibble to the eeprom

Not sure if he is still working on it
But it could be nice ;)

regards,
Danny

NokDoc
29-11-2004, 05:13 PM
Nokdoc was making another version of his patch which saved a config nibble to the eeprom
Danny

Hi Dan,

I have this file working.
(3310-633)

U may have it, though I still was planning to make it spy, fader and/ or rhytmic compatible too.

NokDoc

NokDoc
29-11-2004, 06:17 PM
Hi,

Here's the 3310-366 ledtoggle demo with setting memory.

It uses SafeRam 0x0D, config nibble 0x0d.

NokDoc

ShadoW2004
27-12-2004, 11:30 AM
2 NokDoc

Can you make script for it?

NokDoc
28-12-2004, 09:31 AM
2 NokDoc

Can you make script for it?

Hi,

No, sorry.

Well, maybe I could, but I dono much bout scripts myself.

The ones I made never seemed to do what I intended.

NokDoc

spaceimpact33
31-12-2004, 04:07 AM
@all developers

just thought i would say that the leds are controlled by the Message system also. :wink:


//Snippet from nokix/messages.h in nokix development snapshot
#define MSG_LIGHTS_ON (0x1b5c)
#define MSG_LIGHTS_OFF (0x1b5d)
#define MSG_TIMED_LIGHTS_ON (0x1f5)
//#define MSG_SET_LIGHTS_OWNER (0x1a2f) // 3310+
MSG_TIMED_LIGHTS_ON comes when the lights timer starts (15 seconds before lights turn off)
MSG_LIGHTS_ON Comes when lights are switched on (use send message with this msg to switch lights on i thing :))
MSG_LIGHTS_OFF Comes when lights are switched off (use send message with this msg to switch lights Off i think :))

Regards
Spaceimpact33

danwood76
31-12-2004, 12:06 PM
@all developers

just thought i would say that the leds are controlled by the Message system also. :wink:


//Snippet from nokix/messages.h in nokix development snapshot
#define MSG_LIGHTS_ON (0x1b5c)
#define MSG_LIGHTS_OFF (0x1b5d)
#define MSG_TIMED_LIGHTS_ON (0x1f5)
//#define MSG_SET_LIGHTS_OWNER (0x1a2f) // 3310+
MSG_TIMED_LIGHTS_ON comes when the lights timer starts (15 seconds before lights turn off)
MSG_LIGHTS_ON Comes when lights are switched on (use send message with this msg to switch lights on i thing :))
MSG_LIGHTS_OFF Comes when lights are switched off (use send message with this msg to switch lights Off i think :))


Interesting
I will make a quick script to test :)

regards,
Danny