yashsingh1/xdaforums huggingface dataset:
[Touch Diamond, MDA Compact IV ROM Development] masterbox:
D-MAN666,

First congratulation for all you achieved, it's impressive !

This is soooo interesting, but I never used lua, and ASM is a long time ago...

My goal would be to :

- change the home tab in order to add tasks into it... (not sure if it's possible, don't know how to access the tasks for the moment, will see later)

- Change the program tab having "directories" in order to classify programs, and have more of them.

But before that I need to understand how you proceeded a little bit more...

1) I think the package you provided is not enough, lua.exe does not want to start, probably miss some dll. Anyway I downloaded the package from the lua site and now it's ok.

2) I managed to disassemble a script (script 1 of home page), and I understood how to get function name. But here starts the interesting part, how do you write the function ??? Could you post a simple example of a disassemble function, and the original function pleeeeeaaase ?

For example :

000C ** function [0] definition (level 1)

** start of function **

000C 00000000 string size (0)

source name: (none)

0010 00000000 line defined (0)

0014 00000000 last line defined (0)

0018 00 nups (0)

0019 00 numparams (0)

001A 02 is_vararg (2)

001B 04 maxstacksize (4)

* code:

001C 93010000 sizecode (403)

0020 24000000 [001] closure 0 0 ; 0 upvalues

0024 07000000 [002] setglobal 0 0 ; machineStatus_OnTimeChanged2

0028 05400000 [003] getglobal 0 1 ; DataBindingEnabled

002C 1A000000 [004] test 0 0 ; to [6] if true

0030 16C00B80 [005] jmp 48 ; to [54]

0034 05800000 [006] getglobal 0 2 ; ListTimeText

0038 06C04000 [007] gettable 0 0 259 ; "onPress"

003C 0B004100 [008] self 0 0 260 ; "connect"

0040 85400100 [009] getglobal 2 5 ; OnTimePressed

0044 1C408001 [010] call 0 3 1

0048 05800000 [011] getglobal 0 2 ; ListTimeText

004C 06804100 [012] gettable 0 0 262 ; "onRelease"

0050 0B004100 [013] self 0 0 260 ; "connect"

0054 85C00100 [014] getglobal 2 7 ; OnTimeReleased

0058 1C408001 [015] call 0 3 1

005C 05800000 [016] getglobal 0 2 ; ListTimeText

0060 06004200 [017] gettable 0 0 264 ; "onReleaseOutside"

0064 0B004100 [018] self 0 0 260 ; "connect"

0068 85400200 [019] getglobal 2 9 ; OnTimeReleasedOutside

...

I see the test, and jump corresponding, I see the call, and the gets before defining the parameters, but I don't know exactly how to convert this into lua code (deeply missing lua experience)

So some examples would probably help me to understand...

For example at [006] is it

ListTimeText("onPress","connect",OnTimePressed) or something like that ???

(OnTimePressed is probably a function, do I have to use a pointer or something like that ?)

Thanks in advance, I think you got how lost I am...

MasterBOX
[Touch Diamond, MDA Compact IV ROM Development] D-MAN666:
Check .pdf in the package - it has all you need.
[Touch Diamond, MDA Compact IV ROM Development] masterbox:
Sorry I missed it !

I'll have a look.
[Touch Diamond, MDA Compact IV ROM Development] mccune:
Don't know if I should open a new thread. So I will try my luck here first ;)

I've started to cook my own ROM and one strange thing happens when leaving out Manila.

The font of the Diamond Keyboard and things like the USB-popup are not showing the correct font.

So this must somewhere inside Manila. My guess would that the Helvetica font is also hidden in some of the files.

So my actual question would be:

What do I put in my Manila OEM package just to keep the fonts like they should?

Already tried to cook a ROM with just the EXE and DLL files but that would be to easy of course :P
[Touch Diamond, MDA Compact IV ROM Development] GRIM.657:
This is so trippy :)

I've always loved Lua.. clean, fast, and fun.

Thanks and Congrats to everyone who's been contributing, this is awesome.
[Touch Diamond, MDA Compact IV ROM Development] D-MAN666:
No offence man, really, but LUA is nearly worst programming language i know: no clean OOP, no getters/setters, no event flow, no code isolation, no strict typing, etc. :) I mean it is ok for entry-level coders and small projects, but when you're working on something large-scale (especially in team) it turns into a nightmare.
[Touch Diamond, MDA Compact IV ROM Development] ChiefmasterB:
Same happend to me.... when leaving out manila from your ROM the font in USBPopUp or full querty keyboard are different from other keyboards (think times new roman to helvetica )...

any hints how this is affected by manila?

thx...
[Touch Diamond, MDA Compact IV ROM Development] kooled:
It seems that full qwerty keyboard and USBPCPopup are using Helvetica font, but ttf files for the font are not located in Windows\Font. I guess they are loaded by Manila somehow.

I changed that font by editing the registry (HKLM\Software\Tegic\eT9\Sip\QwertyAndSymbolFont & QwertyAndSymbolFont1) to SegoeUI, while putting SegoeUI.ttf into Windows\Font, and it seems to work for both keyboard and Usb popup.

You can try it by using the following cab, by backup your registry beforehand
[Touch Diamond, MDA Compact IV ROM Development] ryousuke:
question...

has anyone been able to change a 'page' ??

i'd like to change the Music tab and the Photos/album tab...

they're just TOO DAMN SLOWWWW...

if someone can provide the xml for manila2d to upgrade these pages as a cab... that would be fantasic...
[Touch Diamond, MDA Compact IV ROM Development] fillippe:
D-MAN

I have got your ManilaReverserPack and have successfully disassembled a luac file. It displays OK in WordPad. Then I get a bit lost. I have no real coding or programming knowledge except for a bit of visual basic and sql in MSAccess. You may think I should give up at that stage, but I am willing!

Your example for manually reversing the disassembled code:

My questions:

Is the code in this example LUA?

Is the purpose to make the files editable?

Why isn't there a decompiler that will allow editing and re-compiling?

Am I thick?

If I can't work it out from the LUA manual should I give up?

How do I differentiate between level 1 and 2 code?

I am quite keen to understand Manila better for my own mods. For example, I 'd like to add SMS/MMS "account" to Mail tab and do away with Text tab.

Sorry, if you decide I'm beyond hope, but I do follow instruction extremely well!

Best wishes and I think you grossly under estimate your knowledge of the subject. You would appear to be the nerd equivalent to a genious!

Phil
[Touch Diamond, MDA Compact IV ROM Development] iXiR:
This is interesting. Why didn't I think of it myself :confused:;)
[Touch Diamond, MDA Compact IV ROM Development] D-MAN666:
Sure :D

Partly. The main purpose is to know Manila API

Coz compilation is generally a lossy process. You can read something about decompilation problems here:

http://luadec.luaforge.net/

Dunno what it means. Seriously :)

You should re-read included .pdf and LUA reference manual (at lua.org) carefully and try to understand what's going on there.

Functions are often declared in nested manner (one function(s) inside other) and level is just a depth in hierarchy. PDF tells well about that ;)
[Touch Diamond, MDA Compact IV ROM Development] fillippe:
Sorry D-MAN, my brain just doesn't work like this.

The language in the documentation and the whole Lua site is inaccessible to me. I just don't have enough programming knowledge. It looked to me from your example that it was simply a translation exercise i.e. miss out the two columns of numbers in the dump file and put the words in order. I know just how unforgiving programming syntax is and so I'm a none-starter.

It's what I meant by you seem to be a genious and I'm thick. This is your field and I just don't get it.

Big apologies.

Phil
[Touch Diamond, MDA Compact IV ROM Development] mderm:
Hey D-Man: this is really really hot!

I'd like to contribute in this. I dunno anything about Lua but since I'm a developer it should be just another language. So, in the next time I'd like to to give the decompilation a try together with reading all the docs (essentially:rolleyes:).

Plz let me know if the list of the script files (you posted within your pack) that are to be disassambled is up to date, so I do nothing doubled, since time is a very critical point for me!

Greets
[Touch Diamond, MDA Compact IV ROM Development] D-MAN666:
mderm, messaging, email, settings, weather, people :)

fillippe, don't worry too much, man. At least, you gave it a try :)
[Touch Diamond, MDA Compact IV ROM Development] NisseDILLIGAF:
Strange thing happened!

I was playing around with the manila files trying to get the sprint clock to work in standard TF3D..

when this happened!! (see image)

This is not my appontments or meetings! :confused:

Very strange ..

Nothing important or useful :p

just wanted to share this with u guys ...
[Touch Diamond, MDA Compact IV ROM Development] D-MAN666:
Coz you f*cked up the code flow and everything got replaced with default(testing) values (i've seen all of them in the code). :D
[Touch Diamond, MDA Compact IV ROM Development] mun_rus:
btw, i think it's real to make sprint clock in black style manila)) coz i was able to make smth like that) but i inserted standart manila clock to sprint theme:)

http://xdaforums.com/showpost.php?p=2394521&postcount=15
[Touch Diamond, MDA Compact IV ROM Development] chicosabroso:
Source

Hi everybody,

thanks to everyone who contributed in this Thread specially to D-MAN666 and sushilange.

I'm not really into editing the image files, I like them in their original way.

But i'd really like to do some programming. I've downloaded the manilareverserpack and I miss the already decompiled lua files in it, come on DMAN-666 share what you already know.

What about the Wiki Page to know what has been decompiled and what not?

D-MAN at the moment your the only one who is able to code some nice tabs, don't you think you would profit of tabs made by other ones? ;) Share your knowledge please. Or do you expect us to start another thread and start decompiling your code? ;)

Greets

chico
[Touch Diamond, MDA Compact IV ROM Development] mderm:
Just finished my first decompilation try with 1Kb home.script5.luac as training. Now trying something more weird from the messaging section ;) *Proud being*
[Touch Diamond, MDA Compact IV ROM Development] mderm:
Man, I really think everything we need for now is to get the whole API decompilated. So only the wiki with an updated list of remaining files would be cool, for the rest, correct me if I understood s/t false, Suhi and D-Man are working on the Manila Editor wich will be a complete SDK in the end. So why don't we go step by step.

Also I read that with that editor there enough work for programmers to help, so you could spend some effort there, so in the end everybody with little programming knowledge will be in position to mak the tabs he wants in the comfortably way with API, specs, docs, tutorial (perhaps the calendar tab:D) ... and of course the graphics editor.
[Touch Diamond, MDA Compact IV ROM Development] devilteki:
I've problem with edit the file coded in the "GLES"

any idea about how to Edit it

such as 1c684cd8_manila

It might contain the font color , subject, and clock in the mainpage of TF3D

I wish to change the font color of front page.

I've tried to modify the xml files such as 209b5cdc_manila or 6027440d_manila

but nothing changed

Other finding

in different theme of TF3D

just copying the GLES that contain the page of the page to a new theme

will change the default color to the new one.

But I would like to keep the original files and format in the 1c684cd8_manila, just change color of font only .

Anyone could give me a hand

thanks anyway.
[Touch Diamond, MDA Compact IV ROM Development] NisseDILLIGAF:
You were absolutely right ...

I had totally forgotten about 'the early days' of manila edititing :D:p

That's right u did the clock change first...

But it was a bit different the other way around..

Sprint 2 flip clock there is

1 Gles file - 1c684cd8_manila

1 Luaq file - 2a0ac464_manila

and 6 image files

while Flip clock 2 Sprint clock there is

1 Gles file - 1c684cd8_manila

6 Luaq files

2a0ac464_manila

4e545289_manila

6a29dd4a_manila

64a3d10d_manila

71eb8356_manila

1877c214_manila

and 7 image files

and in the 'new' sprint TF3D the Sprintlogo is hardcoded in the manila file

I've been looking in on the Lua programming.. (a little confusing :p)

but I'm learning...

Have a small question, hope u guys can answer it...

How do u get the 'FriendlyName' from the manila file name?

I've been looking up and down in this thread and I get it's something about hash-algorithm..?

don't know much about that.. but would there be a 'formula' to get the name from "1d1ee632_manila" to "HTC\Scripts\orangecalllogtransitions.luac" ?

and i tried to dissasemble 1d1ee632_manila, but it didn't work.. there is some difference in file from 1d1ee632_manila to orangecalllogtransitions.luac..??

Thanx for all the help... and sorry if I'm a bit annoying with all my questions... :rolleyes:
[Touch Diamond, MDA Compact IV ROM Development] devilteki:
I think the friendly name of files isn't at the file itself.

It might have some other way to define it.

Because I change the name of image manila to other

It could be replace and function normally just like the original one.

Although I did not notice if the friendly name changed.
[Touch Diamond, MDA Compact IV ROM Development] D-MAN666:
No, hash is not reversable... Only a recursive file parsing (from manila.xml) can get reliable results. As for Manila Editor, sushilange implemented a simple ".qtc" string lookup, but it works only for unmodded manila :)
[Touch Diamond, MDA Compact IV ROM Development] jerem':
EDIT : Sorry triple post --> pb with my network....

Hi I already post on a separate thread but this one seems to be a good place to ask :

I'm looking for a weather tab with 4 days forecast like on the HTC HD, is there manila files for Diamond with these modifications ?

If not, what are the filses used by the weather tab we could edit to obtain the same result ?

Does the TF2d using similar files ?

Sorry for all these questions but you seem far more advanced than me on the subject ;-)

Thanks
[Touch Diamond, MDA Compact IV ROM Development] jerem':
EDIT : Sorry double post

Hi,

I already post on a separate thread but this subject seems to be a better place to ask :

Is there a way to have four days forecast on the weather tab like the HTC HD ?

D-MANN you aswered me you already tried, what are the manilia filers used by this weather tab ?

What type of modifications should be done (xml or harder) ?

Sorry for all this questions but a weaher tab with forecast would be great...;-)

Thanks
[Touch Diamond, MDA Compact IV ROM Development] jerem':
For days weather forecast...?

Hi,

I already post on a separate thread but this subject seems to be a better place to ask :rolleyes::

Is there a way to have four days forecast on the weather tab like the HTC HD ?

D-MANN you aswered me you already tried, what are the manilia filers used by this weather tab ?

What type of modifications should be done (xml or harder) ?

Sorry for all this questions but a weaher tab with forecast would be great...:D

Thanks
[Touch Diamond, MDA Compact IV ROM Development] AppStar:
Resize Images

Hey guys,

Just got my diamond a few days ago so I have a bit of catching up to do here. I've started a theme to familiarize myself with the graphics and capabilities, then I'll start working on some custom LUA programming (although it's a new language to me).

Anyhow, quick question, though this might be difficult to explain. Does anyone know where to change the QTC file paths and dimensions of the selected tab icons? After doing a bit of research it appears the selected tab icons are the same QTCs as the large images that are displayed in the middle of the screen when sliding your finger across the tabs. Therefore I can't just replace the QTC file. If I replace the file it will change both the selected icon and the large centered image, which I don't want. I can't imagine the developers would have hard coded those tab icons file paths in LUA, it must be a setting somewhere.

Btw, excellent work to D-MAN666, sushilange, and everyone else who has contributed to exposing the inner workings of manila and created tools for us to work with. It's opened up a whole new fun world to explore for us developers and enthusiasts. I look forward to making my own contributions.
[Touch Diamond, MDA Compact IV ROM Development] NisseDILLIGAF:
ok... so if I want to get the manila file name from this...

'HTC\Scripts\orangemessaging.luac'

how would i do?

have a look here... I think this is what u are looking for?

http://xdaforums.com/showthread.php?p=2664825#post2664825
[Touch Diamond, MDA Compact IV ROM Development] D-MAN666:
you should implement the following asm code in any language you prefer:

.text:78CE19D0 loc_78CE19D0
.text:78CE19D0 LDRH R2, [R4],#2
.text:78CE19D4 ADD R3, R3, R3,LSL#5
.text:78CE19D8 SUBS R1, R1, #1
.text:78CE19DC ADD R3, R3, R2
.text:78CE19E0 BNE loc_78CE19D0
.text:78CE19E4 BIC R3, R3, #0x80000000

Oh, yeah, also: path s/b in unicode format, lowercase, and begin with "\windows\", i.e. "\windows\htc\scripts\orangemessaging.luac"
[Touch Diamond, MDA Compact IV ROM Development] GriFolle:
Nisse...maybe are you trying to display messages into default black manila as they are shown into orange one (I mean left align and with the fkoating background under the text)?

I'm trying to do that from several days (obiously without any succes! :p) and I've noticed that into manila.xml the only on difference between orange/black versions about that is the reference about those file...

PS:If is this the case, can you tell me how should do in noob words :D?
[Touch Diamond, MDA Compact IV ROM Development] NisseDILLIGAF:
hmm.. ok...

I haven't got a clue how to make this work...

I've never programmed Assembly language!

I've done some research and I guess I have to make a dll file from Assembly language? (I normally work in VisualBasic)

I found NASM that will help me in that...

But I don't know how to write it or how to call it in VB..???

Sorry to be such a pain :rolleyes: but can u help me with some VB programming instead of Assembly?? :o

That's what I wanted to do :D

But I don't know if it will work without changing the Lua coding also??

My idea was to get the script manila file and implement it like the CallHistory script and see what happens :p
[Touch Diamond, MDA Compact IV ROM Development] D-MAN666:
Nono! It's just a couple of lines of code :D Here's my ActionScript implementation:

private static function countHash(v: String): uint {
v = v.toLowerCase();
var hash: Number = 0x1505;
for (var c: uint = 0; c<v.length; c++) {
hash += hash * Math.pow(2, 5);
hash += v.charCodeAt(c);
hash = hash % 0x100000000;
}
hash = hash % 0x80000000;
return hash;
}

Simple :)
[Touch Diamond, MDA Compact IV ROM Development] HaiLe512:
Is there a way to allow 6x4 item in launcher?

Right now it is 6x3 items in the launcher, is there a way to increase it to 6x4 as has been done so in the M2D for Polaris?

Thanks
[Touch Diamond, MDA Compact IV ROM Development] AppStar:
Haha, awesome... I see now that I ran into the same problem you did when skinning the tab bar; there isn't a separate 3rd icon for the hover/selected state. You've solved the issue wonderfully, but it creates a new problem. If you use transparent images for the new selected icons, then the standard tray icons need to be elevated above the tab.

Also, how are you editing the Mode9 files? I'm able to view your modified 61f866ab_manila with D-MAN666's mode9parser, but I can't edit and save it.
[Touch Diamond, MDA Compact IV ROM Development] mderm:
Decompiling update

Just to give a little update, I've got the sms lua script at hmm... lets say 70%. when i'm done I will upload the lua code, so people who are interested can look into.

But how to go further? Can I then add a bit of code into the lua code, to lets say, add a menu option to to reply to a sms with a call, compile it, and replace the script in the windows path? and then it will work???

D-Man, I think u r the one who can answer this :rolleyes:
[Touch Diamond, MDA Compact IV ROM Development] NisseDILLIGAF:
I have to admit , I just couldent get it to work...

since I dont have much C programming skills I tried to translate it to VB..

shouldn't be so hard.. but I got stuck on..

the variable 'Number = 0x1505' I don't know how to handle hex in VB? (I guessing this is a hex number?)

v.charCodeAt(c) - all I could find about this when i searched was some java scripting!?

This is what i got so far... (embarrassing.. it should be so easy doing this code :o)

Private Function countHash(ByVal v As String) As String

v = LCase(v)
Dim hash As Long = CLng("&H" & "1505") '<--- This shouldn't be Long, right?

For c As Integer = 0 To Len(v) - 1

hash += hash * Math.Pow(2, 5)
hash += v.charCodeAt(c)
hash = hash / CLng("&H" & "100000000")

Next c

hash = hash / CLng("&H" & "80000000")
Return hash
End Function

well don't use it as transparent .. but your own icon in the manila file 'focused'...

I have to admit I cheated :rolleyes:

I stole the manila files from the T-mobile TF3D... I noticed that they had done their TF3D with 3 icons instead of 2... :D

It would be awesome to be able to edit the mode9 files!

So much customizing could be done :D
[Touch Diamond, MDA Compact IV ROM Development] cocochannel:
im running sprint stock ROM.

i like my manilla except that big ass link of the sprint store in the music section. this thing takes so much space and result in the art cover appearing very slow.

would it be possible to create a cab that removes that link?
[Touch Diamond, MDA Compact IV ROM Development] Ximoon:
0x1505 looks very much like an hex number indeed, at least it is the C/C++/C# syntax for it. In VB, it should be &H1505.

I don't know VB that much, but why do you use CLong rather than just :

Dim hash as Long = &H1505

or so ?

v.charCodeAt(c) looks like the char (byte) which is at position c in string v, so you may use something like mid(v, c, 1), just mind that in the original code the first character is at index 0, and it might be at index 1 in VB.
[Touch Diamond, MDA Compact IV ROM Development] NisseDILLIGAF:
Since this is the 'editing manila' Thread ;)

Try to edit 26948339_manila... an look for this..

<Page Order="4" Name="music.page" PackageName="HTC" Title="[[IDS_MUSICTITLE]]" ExternalScriptPath="HTC\Scripts\sprintmusic.luac">
<ComponentReference Name="page"	Mode9Path="HTC\music.mode9" Component="GizmoRoot" SmartComponent="true" />
<ComponentReference Name="icon_normal" Mode9Path="HTC\icons.mode9" Component="Music_Off" />
<ComponentReference Name="icon_selected" Mode9Path="HTC\icons.mode9" Component="Music_On" />
<ComponentReference Name="icon_preview" Mode9Path="HTC\icons.mode9" Component="Music_Preview" />
</Page>

then remove this from it...

ExternalScriptPath="HTC\Scripts\sprintmusic.luac"

-----

Your right.. Dim hash as Long = &H1505 works..

But Im not sure that..

'var hash: Number = 0x1505;' translates 'Dim hash As Long = &H1505'

Number is Long ??

And I figured the 'mid(v, c, 1)' later... (sometimes I just go blind! :D)

but still I have the problem that when it comes to the line..

'hash += Mid(v, c, 1)' ...I get 'Can't convert / (or whatever character I put first) to Double'

So I think I have to convert character to hex somehow..

like..

hash += ToHex(Med(v,c,1)) <--- this dont work, because there is no souch thing as 'ToHex' :rolleyes:

Thanx for your help btw ... much appreciated!
[Touch Diamond, MDA Compact IV ROM Development] Ximoon:
1- Long seems fine to me, according to what I've read about action script, and looking at the algorithm, it should be ok.

2- Don't mind about hexadecimal encoding, it's just used here to make it easier to read the masks used in the algo. What we seem to need is the ascii code of the character, 'hash += Asc(Mid(v, c, 1))' maybe ?

3- You're welcome, since you're one of the few people doing all the hard work, I'm just happy to help a bit ;)
[Touch Diamond, MDA Compact IV ROM Development] NisseDILLIGAF:
Thanx for the help... you were right about 'hash += Asc(Mid(v, c, 1))' :D

Now the next problem :rolleyes:

hash = hash / &H100000000 '<-- This always becomes 0 :(