yashsingh1/xdaforums huggingface dataset:
[Touch Cruise ROM Development] bally3:
does the stock polaris rom have a msm_clk?

might sound like a stupid question but I just noticed that the msn_clk is a ks520 msm_clk.dll file.

Might be a pointer if the timing is different and was modded for kaiser purposes.
[Touch Cruise ROM Development] NikMel:
This is one of the missing puzzles.

Polaris has no msm_clk and these files that are here on the forum coming from diamond and ks520
[Touch Cruise ROM Development] bally3:
ok... I see wce_ref.dll mentioned here...(looking at msm_clk file)
[Touch Cruise ROM Development] NikMel:
I think wce_ref.dll is the edited version of wce_rex.dll from xip of diamond or ks520
[Touch Cruise ROM Development] bally3:
wce_REF.dll provides msm_clk with a virtual address...

Ii'm onto something.. NikMel.. can you give me a COMPLETE dump of ALL the dll files in our rom please? I mean disptools the lot!
[Touch Cruise ROM Development] NikMel:
Here you go an update version!

wce_REX.dll has the same function too.
[Touch Cruise ROM Development] bally3:
Thanks NikMel...!

I'm still missing the following files - may be in the HIDDEN directory?

COREDLL.DLL

DISPTOOLS.DLL

MMMAP.DLL

MMTIMER.DLL

TRSTAI_EXTENSION.DLL

WCE_PMEM.DLL

WCE_REX.DLL

Some of these I can see as being on the rom - but I cant copy them off my device.

I really need these.. they are the "missing bits of the puzzle".
[Touch Cruise ROM Development] NikMel:
I updated the same file from my previous thread
[Touch Cruise ROM Development] bally3:
what previous thread?? :confused:
[Touch Cruise ROM Development] NikMel:
this one http://xdaforums.com/showpost.php?p=2677153&postcount=589 :)
[Touch Cruise ROM Development] bally3:
oh good.. got me all confused there! hee hee! :p

right.. I now need:

WCE_TRAMP.DLL

honest..I'm not making these up!
[Touch Cruise ROM Development] bally3:
Some info from another forum:

"First there's these new ScreenUpdateByFlip () and ScreenUpdateByCopy () functions in DDI.dll that only existed before in the KS20 DDI.dll.

Investigating ScreenUpdateByFlip (), I see embedded code that resembles AhiDevRegRead () that only existed before in ahi2dati.dll and call the whole resembles the AhiEnableSoftInterrupt () call that spinlocks on a certain 0x40000 bit to be set in ATI 0x200 register that was giving me so much problems when porting libgles_cm.dll.

It also uses get_virtual_address() from wce_rex.dll that existed previously only on the KS20, and DDI.dll imports functions from disptools.dll which also only existed before on the KS20.​

So, YES, this thing has some hardware acceleration for screen flips and updates, image transfers, etc, and I think we just need a compatible libgles_cm.dll to finish this off.

I'm not sure if it's as complete as the KS20, the ATI code doesn't look as efficient as the KS20's code, but it's there.​
[Touch Cruise ROM Development] NikMel:
the same post
[Touch Cruise ROM Development] NikMel:
even our wce_rex.dll contains this function call the problem is that msm_time.dll must make use of it but it uses just only get_virtual_address but in diamond msm_time.dll uses get_virtual_address and free_virtual_address
[Touch Cruise ROM Development] bally3:
Some more...

"There's binary API issues that need to be dealt with first:

You need a wce_rex.dll that fully-supports the get_virtual_address()/free_virtual_address() calls (not just stubs like on the NLD rom), DDI.dll that has ScreenUpdateByFlip() and uses it (NLD doesn't use it), msm_clk.dll (if needed), disptools.dll, wce_pmem.dll that can actually allocate certain chunks of ram (probably use qct_wce_pmem.dll instead), clkregim.dll, TrsTai_extension.dll that supports pm_vid_en() (don't know what this does), maybe a matching smem.dll, and ahi2dati.dll (if needed).

​

"And this bit where developers HAVE to be involved:

"There's still a whole bunch of mutexes/semaphores/reg-entries that has dependencies between them all that I don't fully understand either.​

There's still a whole bunch of mutexes / semaphores / reg entries that has dependencies between them all that I do not fully understand either."
[Touch Cruise ROM Development] bally3:
ok... one last one... honest...(fingers crossed!)

I need COREDLL.DLL from a Kaiser rom.

any takers???
[Touch Cruise ROM Development] NikMel:
This is coredll.dll from at&t 3.57
[Touch Cruise ROM Development] imfloflo:
Complete HS : is there hardware graphic driver in android SDK ?
[Touch Cruise ROM Development] cbandarrinha:
Tools for dlls ...

Hello ppl,

I'm new around here but I'm constantly looking at your updated posts and, sincerely, I'd like to help. You are contantly talking about functions inside the dlls. What are the tools you use to see inside the dlls?

Can you please tell me so that I can be of any help?!

Thx
[Touch Cruise ROM Development] bally3:
no idea.. it does the job very well from what I can see but then linux kernel has been known to optimise lesser machines and make them work faster... just look at puppy linux amongst many... still runs on a 486... not many os's that can do that anymore!

As far as I have read, no-one has talked about hardware acceleration.. people just see the globe spinning and I think the bloke on youtube video had quake running at decent frame rates and they think "wow - thats got to be hardware accelerated!" next minute its become a fact.

Any reason for question?
[Touch Cruise ROM Development] bally3:
Hi Chandarrinha, nice of you to offer support :)

We're just using normal hex editors... do you have any experience in this area?
[Touch Cruise ROM Development] pananza:
Dependency walker (http://www.dependencywalker.com/) will tell you which functions a DLL exports. Similar to public functions in a class. It's a windows program so you need to copy all DLL's from \Windows on the polaris to some folder in windows before starting to examine them.
[Touch Cruise ROM Development] cbandarrinha:
I'm not a experienced programmer but I'm an electronics engineer with some experience on software ... Can you give one example of your Hex editor?

I really want to help!
[Touch Cruise ROM Development] bally3:
Excellent.. I'm just usinga bog standard freeware one.. I'm sure theres better ones out there but I havent looked yet.

I'm attaching it below:
[Touch Cruise ROM Development] bally3:
Yup .. thats what I've done... and I've narrowed the problem down to this:

WCE_REX.DLL - "Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.

COREDLL.DLL - Error: Modules with different CPU types were found."
[Touch Cruise ROM Development] NikMel:
what we need is function cal free_virtual_address from diamonds msm_time.dll patch it to msm_time.dll of kaiser or polaris
[Touch Cruise ROM Development] bally3:
damn... semi-bricked my polaris.. couldnt even get it to hard reset lol!

thank god for sd-card flashing... mwwwaaaah! I luv you POLAIMG.nbh :p

pheww.. thought that was going to be the end of my polaris related adventures!
[Touch Cruise ROM Development] cbandarrinha:
Thx everyone
[Touch Cruise ROM Development] NeoS:
General tip for ANYONE:

DO NOT CHANGE COREDLL.DLL!!!

It's like Windows XP's Rundll32.exe. Once it's changed or not written for your device, it will brick your device, like it did with Bally3's. (well, almost ;)) It's like the system kernel.

Anyone looked into the msm_clk.dll timing issue? I think this is one of the essential .dll functions to research, since it sets the timer for your display.
[Touch Cruise ROM Development] bally3:
NOW YOU TELL ME!! :mad:

Dammit.. I should have remembered to take out the core files... just over zealous.. :D

somthing new though, tried fresh NikMel R2 with new kaiser driver and changed to 3.28.

Rebooted - fine

Added wce_rex.dll to windows directory... crashed.

Had to hard reset... any clues?
[Touch Cruise ROM Development] NikMel:
where is it coming from your wce_rex.dll from the zip file or other rom?

DO NOT USE wce_rex.dll FROM AN OTHER ROM!:D
[Touch Cruise ROM Development] NeoS:
Hey i've had a party over here. ;) And a couple of beers.

Anyway, i found some time to dump the Kaiser and Diamond Roms. Now i need you guys to make me a list of .dll's you want. (i've not looked into the dependancies yet, plus, i'm a bit drowzy and lazy tonight...)
[Touch Cruise ROM Development] bally3:
yeah it was the diamond one.. my bad!

its the one file that was missing and Dependency Walker was complaining of missing..

So where do we get a kaiser wce_rex.dll?

Theres one in there but its called wce_rex_dm.dll

Renamed that and same thing again! :rolleyes:

so we need this file.. wherever it is.. may be the answer.
[Touch Cruise ROM Development] bally3:
just checked - wce_rex_dm.dll in our rom and wce_rex.dll (diamond) are both the same size - 17.5kb.
[Touch Cruise ROM Development] NeoS:
I have it. From the Diamond ROM.

What about the Diamond's DDI.DLL? It's ver. 1.93?
[Touch Cruise ROM Development] NikMel:
I think we need msm_time.dll to path and not msm_clk.dll
[Touch Cruise ROM Development] bally3:
wce_rex.dll from kaiser we want neos2007... see if you can find it.. put it in the windows directory and see what happens.

I'm off to bed.. shattered.. its been a long day.

Night everyone.. and if you solve it.. shout louf enough to wake me here :p
[Touch Cruise ROM Development] NikMel:
I'm outta too

see you tomorrow
[Touch Cruise ROM Development] NuShrike:
No, it is not. It is brand new programmed.
[Touch Cruise ROM Development] cbandarrinha:
PLEASE ... !

PLEASE .. before you go off to bed:

Can you please tell me where to find the dlls we need to examine?

When I try to copy the dlls from the \windows directory to on my Polaris to my PC, some of them (most of them) are not allowed to copy. I get an "access denied" dialog. How can I do this?

I'm from Brazil so I still have a few more work hours here ...

Thx
[Touch Cruise ROM Development] NuShrike:
You know, it would be nice if you left the credit to these posts to my name.
[Touch Cruise ROM Development] cbandarrinha:
I know that my questions may seem basic ones but I'm trying...

Can anyone help me?!
[Touch Cruise ROM Development] NeoS:
I hope you read the warning in the first post of this topic: NOBODY takes responsibility if your device gets broken by anyhting posted in this thread.

That said, you should first hard-reset your device. Then try and copy the files. Once you soft reset, the system starts using them, making you unable overwrite these files again.
[Touch Cruise ROM Development] Chainfire:
Just want to nudge you people to take anything NuShrike says to heart, there is nobody here who knows this better than him.

Further, someone asked for original libgles_cm file - there isn't one. At least the original Kaiser did not include this file (which is the OpenGL ES driver). The one included with the HTC-CA drivers is originally from either KS20 or Diamond, forget which one.

As for all the dependencies, I did once create a whole pack of them. Are these files still needed? I did a quick search for them but couldnt find where I left the pack (don't really feel like searching my 6TB of disks manually ;))

If all the files from the Kaiser are still needed, let me know and I'll just dump the ROM my Kaiser is running right now and extract them from it (though truth be told, it's not that difficult to just download for example Dutty's Diamond V1 (Kaiser ROM) file from rapidshare or whatever and do it yourself)
[Touch Cruise ROM Development] NeoS:
Chainfire,

I already dumped both roms from Kaiser and Diamond. I just need to know what files should be needed to get the graphics working on Kaiser, and apply it to the Polaris.

Did you guys have the same scrolling issue with the Kaiser? If not, i think this problem has something to do with the touchscreen or timings instead of the drivers. Hardware specific instead of software.
[Touch Cruise ROM Development] NikMel:
As I understand from NuShrike and the posts that I read the problem was that the tools included in htc-ca was just running when they had an activesync connection and syncing or just by tapping start button on screen.

Me I too have that same think now. I can start the tools like triangle or others but it runs just when I do some syncing or tap on start button.
[Touch Cruise ROM Development] ouioui01:
did you resolve the scrolling problem ? :confused:
[Touch Cruise ROM Development] NikMel:
NuShrike,

I didn't know who made that file or how it was made just what I could make of it:o:p

Me I'm just at the discovery and learning path like we do that in our day-by-day live:o:D
[Touch Cruise ROM Development] NikMel:
scrolling can be solved by an older version of htc-ca but then as in my previouse post you can activate this tools only by trigering some other proccess like syncing by activesync or tapping on start button on your screen.
[Touch Cruise ROM Development] ouioui01:
so we need to focalise on what then ?
[Touch Cruise ROM Development] gregy74:
First copy this file from your computer to your mobile device (I prefer SD card)

The use copy/paste method on your mobile device to put this files to specific directory.

Use Resco explorer, dont forget to mark SHOW HIDDEN FILES on both devices (PC and mobile device). This method work for me every time and I can overwrite all files.
[Touch Cruise ROM Development] NeoS:
@Bally3: I've got all .dlls from your dependancies list. They were all in the Diamond rom. (i doubt you can use them all though)

The Kaiser rom had much less dlls.
[Touch Cruise ROM Development] bally3:
Hi everyone!

Its nice to come on here and read interesting posts from our learned friends :)

Nushrike, my apologies for not placing name on the quotes, to be honest I actually found them on a dutch website! http://translate.google.co.uk/translate?u=http%3A%2F%2Fgathering.tweakers.net%2Fforum%2Flist_messages%2F1288887%2F20&sl=nl&tl=en&hl=en&ie=UTF-8 Which I had to translate so had no idea who wrote the post! :p (Should have known it probably come from here anyway!) but I do not ever take credit for anyone elses posts - hence I always mention I got it from somewhere else. But either way its nice to have the poster of that knowledge to come here - I hope you will still stay and assist us in our goal to port the kaiser driver to the Polaris. Your advice and assistance will be greatly appreciated by all of us I am sure.
[Touch Cruise ROM Development] bally3:
Chainfire, from my understanding we dont need this file to get the driver working - is that correct? Dependency Walker which Pananza kindly pointed us to, doesnt show this as a dependency for the ddi.dll file.

Also my understanding of all this is the missing link is the wce_rex.dll here? Nushrike says this file was custom written, does this mean that we need it either modifying or a new one created for the Polaris then?
[Touch Cruise ROM Development] bally3:
Neos2007, if you're good at this, maybe the rom mentioned by Chainfire is the one we should extract and see what we have. If you are able to do that, please post the files on here and we will compare them to what we have.
[Touch Cruise ROM Development] bally3:
Ok.. right.. I think we should, for the time, discount the Diamond as it has a different gpu chip and nothing from it has worked for s so far.. the two major players here are the Kaiser files and the KS520 the latter which I read somewhere had some very messy custom code that was hard to pick at.

I'm looking today for the new device that Chainfire mentioned or one similar to see if we can find something there. As far as files are concerned, I think we should forget about making it work with the existing files we have by swapping around as I think we have most of them already.
[Touch Cruise ROM Development] whitealien:
I digg out this in some dutch forum. Maybe it can give you some clue:
[Touch Cruise ROM Development] bally3:
lol..hmm...I've read that somewhere...:rolleyes:
[Touch Cruise ROM Development] whitealien:
lol, yes, I just found that you already found that too :)
[Touch Cruise ROM Development] bally3:
Originally posted by Devtone on this thread:

http://xdaforums.com/showthread.php?t=381254&page=11

Display Driver Development Concepts

Application

The application can be simple, such as a Hello World application, or complex, such as a three-dimensional engineering application.

Whichever it is, the application calls GDI functions. Coredll.dll exposes these functions.

Coredll.dll

The major set of functions is exposed through a single DLL, called Coredll.dll.

In most cases, this library does not perform the work. Instead, the library packages the parameters for the function call and then triggers a Local Procedure Call (LPC) to another process.

The specific process depends on the function call. All drawing and windowing calls are sent to Gwes.exe.

Gwes.exe

The Graphics, Windowing and Events Subsystem (GWES) is responsible for all graphical output and all interactions with the user.

The drivers that reside in the GWES address space include display drivers, printer drivers, keyboard drivers, mouse drivers, and touch screen drivers.

Ddi.dll

The default name for the display driver is Ddi.dll. As with most DLLs, Ddi.dll communicates through exported functions.

Ddi.dll exports only the DrvEnableDriver function, which returns a pointer to an array of 27 function pointers to the caller. When GWES requires a display driver, it calls one of these 27 functions.

Writing a device driver involves writing the code for these 27 functions.

Three of these functions are specific to printer drivers, which leaves 24 for the display driver developer.

Hardware

The graphic pipeline ends at the hardware. The display driver communicates to the hardware using the mechanism required by the hardware.

This process typically involves a combination of memory-mapped video buffers and I/O registers.

*SOURCE

__________________

Siemens S35 > S45 > S65 > Wizard > (video crippled) Kaiser

Last edited by Devtone; 01-04-2008 at 01:55 AM.
[Touch Cruise ROM Development] NuShrike:
Can you guys isolate the changes (dll that changed) that caused this screen scrolling to start, or at least name which version of HTC-CA was okay, and what the next version wasn't?

We should focus a little on when the screen wasn't updating until Start Menu/Menu/ActiveSync. That was the key for getting it working on the Kaiser.

For the wce_rex dependencies, wce_rex should stay the system one, wce_reF is a custom proxy that offers some of the missing functions, but the actual code is in wce_rex_dm.dll (dm for Diamond). So, wce_reF and wce_rex_dm is a pair that shouldn't be separated. This of course requires the relevant dlls to be hex-edited to use wce_reF instead of rex.

You can't hex-edit DDI.dll easily because it is signed, and even if you strip the signing, I'm not sure the OS would use something unsigned.
[Touch Cruise ROM Development] NikMel:
This are the files where tools are freezing and then work only when I trigger some other proccees like activesync or tapping on start button
[Touch Cruise ROM Development] NikMel:
@NuShrike: this happens even when I install the original rom (its not as fast as with the edited rom that I made but it runs) from htc then just copy this files to a folder not the windows folder.

the diference in cab files are:
[Touch Cruise ROM Development] NeoS:
Well, i got it working as you say: no screen update until start menu with 2 versions of ddi.dll. Seriously, I renamed version 3.28 to ddi2.dll and copied it to my windows folder, then changed the HKLM\system\GDI\drivers\Maindisplay=ddi2.dll, and it worked without the scrolling but stop-n-go. No one thinks it's a good idea, but hey, it worked! :P
[Touch Cruise ROM Development] bally3:
Thanks for the info NuShrike, we originally started with the polaris ddi.dll ver 3.13 (from wm6.1) but neither kaiser cabs worked with this version with lights.exe and the 3d apps.

Ver 3.29 (Kaiser) of the ddi.dll gives error also with both versions of the Kaiser cabs.

Ver 3.28 (Kaiser) and 3.57 (Kaiser) of ddi.dll give scrolling with both Kaiser cabs.

UPDATE: Ver 3.14 ddi.dll (Kaiser) worked but very flaky - also scrolling.

Older versions of the ddi files (1.53) and diamond (1.56) versions give errors.

Dependency Walker on ver 3.28 showed that wce_rex.dll was missing.

NikMel correct me here if I'm wrong, its been more than a few days since I played with different ddi versions! :)
[Touch Cruise ROM Development] NeoS:
Right on it Chief!
[Touch Cruise ROM Development] NikMel:
Why I put the different file names?

If I use the older cab file it runs after I trigger some other process (like activesync ro ...)

If I use the latest cab file from the website of htcclass... the screen start to scroll.

And the only difference is 4 files.
[Touch Cruise ROM Development] bally3:
Thanks Neos2007 - and now this is going to sound like a REALLY STUPID question... but... did wm6.0 have a ddi.dll and what version was it? :eek:
[Touch Cruise ROM Development] NeoS:
So, to sum it up: you use 2 cabs. An older one, which doesn't scroll with ddi.dll ver.3.28, and a newer cab, which scrolls with 3.28. Right? You're saying we should use the OLD HTC CA drivers for testing? And where do we get those?
[Touch Cruise ROM Development] NikMel:
Forget about wm6.0!
[Touch Cruise ROM Development] NikMel:
I just putted it in my previous post:)

htcorg.zip
[Touch Cruise ROM Development] bally3:
As far as I recall, and now I think I need to flash back to a stock rom to see it.. the Polaris doesnt have a wce_rex.dll?

Funnily enough dependency walker complains its missing on the Polaris stock ver 3.13 ddi.dll and its the only one thats not there. Hex editor shows wce_reF.dll which is apparently a wce_rex.dll wrapper apparently.
[Touch Cruise ROM Development] NikMel:
the file is there in stock rom.

It's in xip part
[Touch Cruise ROM Development] NeoS:
So, what do you want, a WCE_rex or ReF? Because i have both. ReF from the CA drivers, and rex dumped from Diamond. And you're correct: Polaris doesn't have Rex. (sounds an awful lot like Metal Gear Solid to me, lol)
[Touch Cruise ROM Development] NeoS:
Ah, that's why i couldn't find it. I haven't checked the XIP.
[Touch Cruise ROM Development] bally3:
That "trick" was tried and we found the same... unfortunately thats all it is - a trick... its a good way of testing a ddi.dll without having to hard reset though! :p
[Touch Cruise ROM Development] NeoS:
Do the old CA drivers make the blank screen issue return? Cuz my device suffers from it suddenly.
[Touch Cruise ROM Development] bally3:
aah.. that makes sense.. dont know a lot of the inner workings of xip but I do remember reading on the Kaiser forum about it.. was it the KS520 which had the wce_rex.dll in the xip?
[Touch Cruise ROM Development] bally3:
tried the wce_rex.dll from diamond last night remember? it froze my polaris... now I understand better.. its there in the xip.. Windows Mobile always looks for the file in the Windows folder and if it doesnt find it there it looks in the hidden folder (I assume xip). If you place a file that isnt in the windows folder by default (coredll.dll, wce_rex.dll etc) the phone will not start if the file is incompatible with your device. I assume that because they are that hidden they are probably device specific too.
[Touch Cruise ROM Development] NuShrike:
I'm sorry but will probably require a hard-reset afterwards (which is why I avoided it myself). Can you try:

o removing/renaming ddi2.dll while the registry is still set to ddi2

o soft-reset

We should make sure it's actually using that dll and not falling back to ddi.dll in some hidden way. If the device boots back up, then the registry setting isn't doing anything. If it fails to boot, then we have confirmation that ddi2 is being used.

It is a lot more optimistic if ddi2 is being used because I think it sets up a scratch page that's needed later.

Does the Polaris support screen rotation by some button? To maybe avoid hard-reset, on the Kaiser we tested which DDI was in use by how fast the Today screen rotates. WM6.0 DDI was piece by piece, WM6.1+3.28 is all at once.
[Touch Cruise ROM Development] bally3:
screen rotation can be set to a hard button yes.. so you think theres mileage in this method then?