PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

flipHack of Pocket PC

I am a part-time windows ce developer. I am now working on a program that invert the screen in my leisure time. I think it is very useful when you need to show the content of your pocket pc to the opposite person. The function of the software is just like the "flipHack" in the palm platform.

I have done some research and programming on this software. I have to code at least two drivers. One is display driver and the other one is touch panel driver. Also, I need a program communicating with two drivers, but it is not a problem for me. I successfully code the touch panel driver. I use functiion GetProcAddress get the exported functions of the original driver touch.dll and substitute with my functions. That means the driver I coded resides between the kernel and touch.dll. This works prefectly and I can easily alter the returned coordinates by touch.dll.

However, I have some difficulties in the display driver. I use the same method on display driver. Although I can replace all the ddi functions exported by the original display driver ddi.dll. I have no idea how to change the value passed to or returned by ddi.dll. I had tried to create the PDEV handle myself and useed function EngCreateDeviceSurface to create the device surface myself. But both did not sucess because I do not know how to create them exactly.

I have thought of using the GPE class provided by microsoft, but it means i need to program with the hardware directly. This is not universal when dealing with other machines. Also, I have thought of using some game libraries, but most game libraries use gx.dll which depends on the display driver. I think this do not think. The second problem is that I have no debugging platform for this software because I do not know how to debug with my pocket pc using platform builder.

I am very amazed with what JimmySofware Landscape and Nyditot Virtual Display have done. It does exceed what I require, but I just need the ability of inverting screen. Could anyone have rich device driver experience help me? In fact, I have some experience on windows device driver, but it do not help.
I would guess that you're going to be in pretty much the same boat as I am. This will be StrongARM specific here... The way I'd invert the screen would be like this:

make a new physical RAM buffer
copy the current screen into it, but inverted
point the LCD DMA base register DBAR1 at the address of your physical buffer

it'll slow things down with an extra buffer copy in there, but it'd work.

(AFAICR there'd be no way of modifying the direction that the DMA buffer is thrown at the LCD from the original buffer, but I might be wrong).


Note that there are lots of technical pit-falls in there. It sounds easy, but it isn't. (My frame-buffer setup doesn't actually work yet, but I'm working on it and I'm getting ever-closer). As Compaq have been not-at-all-helpful I've been doing "hacky" things to try and figure out what their interrupt handler is doing (or the virtual identifier for the LCD interrupt).

Cheers,

Ref.
It certainly can be done, as has been proven by JS Landscape. Unfortunately Jimmy Software usually isn't too forthright in revealing their techniques or source code. :(

Dan East
JSLandscape dont' work on my IPAQ h3950 :(
Locks it up completely, I had to do a hard reset
As far as I know (I may be wrong), the JS Landscape, etc, work by tweaking the StrongARM's hardware registers... as the 3950 is an XScale device (I think?), I wouldn't expect it to work at all.

I'm still working on the interrupt thing myself, but at the moment I'm still forced to do hacky things like dumping memory and disassembling it to track down what I want to know. Kinda fun :twisted: ... but slow-going. :?
It wasn't as hard as I anticipated. For a one-off flip-and-hold it's reasonably simple. If you want something that allows the user standing opposite you to input, then that's going to need a little more work.. you'd have to somehow trap the input before the OS, and munge the coordinates (we're probably back to interrupt handling).

I hacked together a "flip-hack" using the method I mentioned in my previous post (actually I did everything but the screen-flip, 'cos I was feeling lazy), and it works fine (I didn't touch a single driver, either 8) ...but it'll also only work on a StrongARM and has no input).

It could also be done really easily with GAPI. Just invert and copy the screen as your application starts, then blit it at the screen until they let go of the button or whatever.

Cheers,

Ref.
Refractor, it sounded like he already had the input issue taken care of.

Dan East
Oh yeah. :oops: I really shouldn't scan-read things so much. :? Sorry.