Care Unlock  
Your online unlock store
GSM-Forum  

Welcome to the GSM-Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   GSM-Forum > GSM Mobile / Tablets Brands -Software Area- > Various > Siemens-Benq > Siemens-Benq Flash Patching > x6x and x7x Flashpatching

x6x and x7x Flashpatching x6x and x7x Flashpatching (and newer phones).

Reply
 
LinkBack Thread Tools Display Modes
Old 01-03-2006, 18:28   #1 (permalink)
Junior Member
 
Join Date: Jan 2006
Posts: 2
Member: 216352
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
Question MasterPatch (technical)

Hello!

I've searched for serveral hours now and found not a bit I understood (that is: not russian...):
I just want to know how to write own patches using MasterPatch.. that is:
* Do I sort of "register" my patch with MP?
* How does is enable/disable the patch? Does it restore the entry point?
* How to use the configuraton-parts?

(Alternatively, I think a source code of any patch written for MP would be enough...)

Can somebody provide some information in english? ;-)

TIA, KKaul

PS: Btw, where (which forum) is the current development of MP going on? [The actual answer please, can be russian]
  Reply With Quote
Old 01-04-2006, 02:55   #2 (permalink)
Freak Poster
 
Join Date: Jul 2004
Location: Brasil - FoxGSM
Posts: 125
Member: 71324
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
I think that siemens-club, see: http://forum.siemens-club.org/viewto...?TopicID=56798

WBR
  Reply With Quote
Old 01-04-2006, 08:19   #3 (permalink)
Freak Poster
 
Join Date: Jan 2004
Location: Kiev, Ukraine
Age: 42
Posts: 291
Member: 48709
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
>Do I sort of "register" my patch with MP?
No, you don't have to "register" your patch. But your patch must have section like this:
Code:
0FC1080: 0xB1C2D3E4,0x0000AB01,0000000000000000,"\
{patch=BottomDate ver=8 cp=avkiev id=AB01 mem=20}\
{1 cb ShowComma v=1}\
",00
where 0xB1C2D3E4 - magic constant, 0x0000AB01 - PatchID
In this case MasterMidlet can control your patch.
>How does is enable/disable the patch? Does it restore the entry point?
No, MasterMidlet doesn't restore entry-point.
In example above patch needs 20 byte of RAM as its own buffer.
MasterMidlet just switch high bit of byte #0.
In patch we have code like this:
Code:
            LoadReg 0, config+4 ; r0=PatchID
bl      GetBuffer       ; Getting buffer for Patch
beq     exit             ; If no patch or patch disabled - exit
>How to use the configuraton-parts?
In example above we will have checkbox (cb) in MasterMidlet. User can check or uncheck it...
  Reply With Quote
Old 01-17-2006, 10:16   #4 (permalink)
Junior Member
 
Join Date: Jul 2005
Posts: 39
Member: 158963
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
hi, the "mem" token in:
Code:
{patch=BottomDate ver=8 cp=avkiev id=AB01 mem=20}
i have a patch with some 100 bytes config ram. but it runs also WITHOUT mem=100. what is the purpose of "mem"?

another question: if i have e.g. such thin in config:
Code:
{sm Profile1}","\
{1 cb `screen output` v=00}","\
{endsm}","\
....
{sm Profile7}","\
{7 cb `screen output` v=00}","\
{endsm}","\
the masterpatch doesnt recognize string "Profile7" as a profile token, it's just a string. so i have to do "GetProfile" in patch to find out the current profile.

could be the token "pf" for any use for me? how i could use it? could you give me an example, please?
  Reply With Quote
Old 01-17-2006, 10:42   #5 (permalink)
Freak Poster
 
Join Date: Jan 2004
Location: Kiev, Ukraine
Age: 42
Posts: 291
Member: 48709
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by benj9
what is the purpose of "mem"?
Example:
{patch=BottomDate ver=8 cp=avkiev id=AB01 mem=20}\
{1 cb ShowComma v=1}
In this example I use byte#1 as checkbox.
But I too use bytes 2-19 for my own purposes. So, I have to write "mem=20". Size of buffer is 20 bytes.
In this example:
{patch=BottomDate ver=8 cp=avkiev id=AB01}\
{1 cb ShowComma v=1}
I will have buffer, which size is just 2 bytes.
So, we have to write "mem=..." if we use some area of buffer as a internal RAM for patch...
Quote:
Originally Posted by benj9
the masterpatch doesnt recognize string "Profile7" as a profile token, it's just a string. so i have to do "GetProfile" in patch to find out the current profile.
could be the token "pf" for any use for me? how i could use it? could you give me an example, please?
Yes, in this example: Profile7 - just string.
We have to use command PROFILES=Y if we want to have ability check/uncheck patch in some profiles. Default value of PROFILES is Y, so we can omit it.
But, if you want do some complex check in patch - you have to call GetProfile...
See example:
"{patch=KeyLightTrg id=EA01}\
{sm Bright.}\
{1 b(7) r=0..100}\
{endsm}\
{sm Delay}\
{8 b(7)}\
{endsm}",00
Quote:
Originally Posted by benj9
could you give me an example
You can find some sources of MP-patches here:
http://forum.siemens-club.org/viewto...?TopicID=57987
PS. Sorry for my keeping silence, I was very busy
  Reply With Quote
Old 01-17-2006, 10:52   #6 (permalink)
Junior Member
 
Join Date: Jul 2005
Posts: 39
Member: 158963
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
thx, this is very helpful.
  Reply With Quote
Old 01-17-2006, 11:17   #7 (permalink)
BuG
Junior Member
 
Join Date: Jan 2005
Location: Germany
Posts: 31
Member: 102514
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by avkiev
...
where 0xB1C2D3E4 - magic constant
...
How about the other constants

0xA1234504 - onStartup, адрес процедуры, вызываемой при старте телефона
0xA1234508 - onConfigChange, адрес процедуры, вызываемой при изменении конфигурации

Are they supported in some way?
  Reply With Quote
Old 01-17-2006, 11:22   #8 (permalink)
Freak Poster
 
Join Date: Jan 2004
Location: Kiev, Ukraine
Age: 42
Posts: 291
Member: 48709
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by BuG
How about the other constants
0xA1234504 - onStartup, адрес процедуры, вызываемой при старте телефона
0xA1234508 - onConfigChange, адрес процедуры, вызываемой при изменении конфигурации
Are they supported in some way?
Yes. If onStartup <> 0 - MasterPatch.ConfigScaner will call this procedure during creating PatchTable.
But I didn't see any patch, which use it.
Also, I didn't see any patch which use onConfigChange...
  Reply With Quote
Old 01-17-2006, 12:20   #9 (permalink)
Junior Member
 
Join Date: Jul 2005
Posts: 39
Member: 158963
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
onConfigChange ... could one call the refresher?


and:
would i replace the "magic" address, or is it like this (first config-line):

adress: magic,id,onStartup,onConfigChange

e.g.
0FD1000: 0xB1C2D3E4,0x0000CCCC,0xA1234567,0xA1234589,"\

?

Last edited by benj9; 01-17-2006 at 12:36.
  Reply With Quote
Old 01-17-2006, 17:15   #10 (permalink)
Junior Member
 
Join Date: Jul 2005
Posts: 39
Member: 158963
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
onStartup works. that's nice, so for normal patches you dont need anymore any entrypoint, but you can start a CallAfterTimer thread, which cycles the patch body in an interval you like.

but unfortunetly onConfigChange seems to have absolutly no effect ...

--------------------

maybe in this context the "call after time" parametrers are for some coders interesting:
R0=pointer to 8 bytes free ram for timer internal purposes
R1=time value (approx. 216 units = 1 sec.)
R2=destination address
attention, all register are killed by CallAfterTimer

Last edited by benj9; 01-17-2006 at 17:38.
  Reply With Quote
Old 01-18-2006, 08:20   #11 (permalink)
Freak Poster
 
Join Date: Jan 2004
Location: Kiev, Ukraine
Age: 42
Posts: 291
Member: 48709
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by benj9
onStartup works
but unfortunetly onConfigChange seems to have absolutly no effect ...
attention, all register are killed by CallAfterTimer
Of course, onStartup works. I call it in Scaner.
But MasterPatch doesn't call onConfigChange - I don't see any reason for it.
PS. AFAIK, CallAfterTimer kills only R0-R3...
  Reply With Quote
Old 01-19-2006, 09:15   #12 (permalink)
Junior Member
 
Join Date: Jul 2005
Posts: 39
Member: 158963
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by avkiev
CallAfterTimer kills only R0-R3...
Interesting. But how it works? So with CallAfterTimer, you dont call directly the function in R2, but it's called by the CallAfterTimer-Function. So there is no direct register- and stack- pass-through. Also, the LR of the called function is somehow "invalid".

Actually I did'nt see any use of CallAfterTimer in patches outside of Blinker [/offtopic]

Last edited by benj9; 01-19-2006 at 09:39.
  Reply With Quote
Old 01-19-2006, 09:41   #13 (permalink)
Freak Poster
 
Join Date: Jan 2004
Location: Kiev, Ukraine
Age: 42
Posts: 291
Member: 48709
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by benj9
So there is no direct register- and stack- pass-through
...
Actually I did'nt see any use of CallAfterTimer in patches outside of Blinker
I use CallAfterTimer in my patch "Talking Phone".
I pass arguments via RAM of this patch.
  Reply With Quote
Old 01-19-2006, 17:01   #14 (permalink)
Junior Member
 
Join Date: Jul 2005
Posts: 39
Member: 158963
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
Okay, now I understand. Sure CallAfterTimer kills not all registers in the function calling it. But one cannot pass-thru regs to the function called by timer. So same do I, pass the arguments to destination func by ram.
-----------
Next question: the token "ms" like in:
Code:
{2 ms `Milisekunden` v=2167}",00
is damaged. Everytime you open then config in the midlet, close it, and open it again, it looses 4 ms ! So is smelts to zero

I dont have contact address to chaos. Could you pass him this midlet error, the shift from 1000ms to internal 216,7... is nice, but due this error now unusable

Last edited by benj9; 01-19-2006 at 20:21.
  Reply With Quote
Old 01-20-2006, 08:11   #15 (permalink)
Freak Poster
 
Join Date: Jan 2004
Location: Kiev, Ukraine
Age: 42
Posts: 291
Member: 48709
Status: Offline
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by benj9
I dont have contact address to chaos. Could you pass him this midlet error
Discussion about MasterMidlet on Siemens-club.org
E-mail to chaos
  Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 00:46.



Powered by Searchlight © 2013 Axivo Inc.
- GSM Hosting Ltd. - 1999-2013 -
Page generated in 0.34721 seconds with 10 queries

SEO by vBSEO