Site Notice - We are currently investigating an issue with missing download links. Apologies for any inconvenience caused. PaulOBrien

  • Announcements

    • Reminder - MoDaCo position on illegal content   07/30/15

      ILLEGAL CONTENT I'd like to just reaffirm MoDaCo's position regarding piracy and illegal content in the light of some recent questions / postings. Posts will be censored by myself or my moderation team if the contain or link to: Illegal / pirated / cracked software or sites that host such softwareNintendo emulators / ROMs or sites hosting them (in light of Nintendo's legal stance)CUSTOM ROMS You may discuss and post links to custom device ROMs on MoDaCo, provided the following rules are adhered to: ROMs must not contain any illegal 3rd party software (this includes trial versions included without permission)ROMs must give full credit to the original authorISSUES If you have any issues with this policy, please contact PaulOBrien directly via PM.
    • Reminder: Selling items on the forum directly is not allowed   07/30/15

      Please note that selling items on the forum directly is not allowed by the forum rules. There is a forum for eBay auctions whereby you can list the items on eBay and link to them there. This is the ONLY forum for this type of activity. You may also advertise links to the eBay forum in your signature. Please note that selling directly in contravention of these rules will result in a warning / suspension / ban.
Sign in to follow this  
Followers 0

GAPI to GDI wrapper for 8390

141 posts in this topic

Posted (edited) · Report post

mystery solved. together with schriss we finally found out why the original GAPI doesn't work. there is a miss configuration in mio8390's security system and to use direct video memory access (kernel mode) not only the GAPI dll have to be privileged signed but the application itself too. schriss wrote a small tutorial how can you do that for all your games and video applications. check this post. this is developer signing so your phone has to be unlocked (see other topics about unlocking )

never the less i updated the wrapper if someone doesn't want to bother with signing applications. but this solution is slower and doesn't work for all applications.

just install. no need for manual dll copying. (if you installed the old wrapper please uninstall it before upgrading and remove all manually copied gx.dll)

http://picard.exceed.hu/mio8390/gapi2gdi.exe with installer

http://picard.exceed.hu/mio8390/gapi2gdi.cab only cab

http://picard.exceed.hu/mio8390/gapi2gdi.zip source

ps: word definitions:

GDI http://msdn.microsoft.com/library/default....e_interface.asp

GAPI http://msdn.microsoft.com/library/default....htm/gx_bvrh.asp

Edited by picard_beta
0

Share this post


Link to post
Share on other sites

Posted · Report post

i would try it but indeed my phone has bought the farm. :/

0

Share this post


Link to post
Share on other sites

Posted · Report post

sorry man :D

i had no luck either. i just broke one of my pda's lcd screen

tonight :cry: fortunatelly it's only for development and still usable

at an acceptable level.

ps: i had to lookup the 'bought the farm' expression :D

0

Share this post


Link to post
Share on other sites

Posted · Report post

HOLY s***, THIS WRAPPER WORKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Picard is a genius :lol:

Games/apps that work with wrapper:

Eclipse First Wave - WORKS! It's fast without SmartPhone Turbo activated :D

6th Gear - WORKS fast :D

SPVQuake - runs!! I hear sounds but the screen is completely white :cry:

BetaPlayer - works in GAPI mode, see benchmark results below

PocketClive (ZX Spectrum) - WORKS

BetaPlayer WORKS in GAPI mode - here are benchmark results in both: GDI and GAPI mode, tested with the same movie (crystal clear quality, link to file at the bottom) :D

Results for GAPI wrapper (WITHOUT SmartPhoneTurbo):

Average Speed: 102.55%

Original Data Rate: 401 kbit/s

Bench. Data Rate: 411 kbit/s

Results for GDI:

Average Speed: 121.60%

Original Data Rate: 401 kbit/s

Bench. Data Rate: 487 kbit/s

Results WITH SmartPhoneTurbo activated :D

Results for GAPI wrapper:

Average Speed: 112.76%

Original Data Rate: 401 kbit/s

Bench. Data Rate: 452 kbit/s

Results for GDI:

Average Speed: 130.83%

Original Data Rate: 401 kbit/s

Bench. Data Rate: 524 kbit/s

--== AND NOW RESULTS WITH ORIGINAL GAPI (BetaPlayer signed) AND TURBO ==--

Average Speed: 147.09%

Original Data Rate: 401 kbit/s

Bench. Data Rate: 589 kbit/s

The test TopGun video is here: http://www.certihost.net/smartphone/

0

Share this post


Link to post
Share on other sites

Posted · Report post

are you sure there was no old gx.dll in the application folder when the program crashed? when worked did you copied my gx.dll from windows directory to the application folder? i don't understand why you have to copy gx.dll from windows directory if there was no old gx.dll in the application folder. maybe the OS gx.dll could not be "overwritten". on pocketpc any OS dll can be patched with just simple copying a file with the same name on it. if you delete the file the original OS file will reappear.

about BetaPlaye speed: this is a GDI wrapper so using directly GDI has the same or even better speed because only the actual video area is drawn.

0

Share this post


Link to post
Share on other sites

Posted · Report post

Installed GAPI2GDI wrapper:

- XRAlly Alpha doesn't work (freezes the phone)

- SPVMan doesn't work (back to Start Menu)

- Xtris doesn't work

- Picodrive doesn't work... :D

0

Share this post


Link to post
Share on other sites

Posted · Report post

ok so it seems overwriting the original gx.dll doesn't work :D

@mikevirgil: you should try copy the new gx.dll and gxorig.dll to each application folders as schriss suggested

(you can download them with the .zip file)

0

Share this post


Link to post
Share on other sites

Posted · Report post

Yes, I deleted original gx.dll from BetaPlayer's directory, but still didn't work. I had to copy your gx.dll to app folder. I think this is because there is a gx.dll in Windows folder (the gx.dll that does not work). Your gx.dll has been installed into Storage/Windows

Probably system first tries the gx.dll found in the original, protected Windows directory, not the one from Storage/Windows.

There are following directories:

Storage (this one contains windows folder)

Storage Card

Temp

Windows (this one is protected)

0

Share this post


Link to post
Share on other sites

Posted · Report post

ops. yes this is the problem

what does it mean windows is protected? i know you can't copy ROM files, but patching them should be possible at least on pocketpc. could you try to copy the new gx.dll over the one in windows?

0

Share this post


Link to post
Share on other sites

Posted · Report post

Hi,

the idea looks great and it should be possible to get this to work!

Here are some findings and bug fixes (which cause this not to work):

DC = GetDC(NULL);
requires a ReleaseDC... otherwise the complete GDI will lock up until you call GXCloseDisplay() :arrow: add the following line to GXOpenDisplay() and remove it from GXCloseDisplay()
GXDLL_API int GXOpenDisplay(HWND hWnd, DWORD dwFlags)


{


  ...


  Width = GetDeviceCaps(DC,HORZRES);


  Height = GetDeviceCaps(DC,VERTRES);


  


  ReleaseDC( NULL, DC ); //<== ADD THIS LINE


  ...


}




GXDLL_API int GXCloseDisplay()


{


  DeleteDC(DC2);


  DeleteObject(Bitmap);


  //ReleaseDC(NULL,DC);  //<== REMOVE THIS LINE


  ...


}
Of course you have to put GetDC() and ReleaseDC () now to each DC operation...
GXDLL_API void* GXBeginDraw()


{


  _GXBeginDraw();


  if (!FullScreen && ViewHeight > 0)


  {


    DC = GetDC(NULL);


    BitBlt(DC2,0,ViewTop,Width,ViewHeight,DC,0,ViewTop,SRCCOPY);


    ReleaseDC(NULL,DC);


  }


  return Buffer;


}




GXDLL_API int GXEndDraw()


{


  if (ViewHeight > 0)


  {


    DC = GetDC(NULL);


    BitBlt(DC,0,ViewTop,Width,ViewHeight,DC2,0,ViewTop,SRCCOPY);


    ReleaseDC(NULL,DC);


  }


  return _GXEndDraw();


}

Next thing:

It's not a good idea NOT to take the original device gx.dll!!!!

You better should rename the original and copy yours to Windows. To do this I suggest to write a little tool which will do it on each device startup since Windows folder is not persistent on smartphone.

Last but not least:

you can detect operations to your memory block (bitmap copy of the screen) by setting up an hardware breakpoint on memory write operations. So you will not need a timer for redraws... Unfortunately you will need priv. access to do this. But unlocked MIO's could use it.

Maik

0

Share this post


Link to post
Share on other sites

Posted · Report post

now using the source gx.gll and gxold.dll:

- SPVMan starts but black screen (sound ok)

- Picodrive works (but some glitches when switching between screen orientations) (no sound)

0

Share this post


Link to post
Share on other sites

Posted · Report post

@stohn: thanks for the feedback

requires a ReleaseDC... otherwise the complete GDI will lock up until you call GXCloseDisplay()
are you sure? i never had this problem on any windows platform yet. you can even create more DC's. example in BetaPlayer it work's perfectly even on the mio8390 for sure. btw you will need that DC for blitting so if you release it in opendisplay you have to requery/release it in begindraw/enddraw.

Why do you call BitBlt in GXBeginDraw() ? There should be no need for this.

in non fullscreen mode this is the correct operation for GAPI. you have to save the current displat state so the program using GAPI can draw only partially on the screen. ofcoz most of the games will use fullscreen mode so this won't slow them down.

you can detect operations to your memory block (bitmap copy of the screen) by setting up an hardware breakpoint on memory write operations. So you will not need a timer for redraws... Unfortunately you will need priv. access to do this. But unlocked MIO's could use it.

could you give me some hints how to do that? i'am really interested. but i'am not sure it can be done on an unlocked phone either. example even on unlocked phone i can't change to kernel mode with a non signed program.

0

Share this post


Link to post
Share on other sites

Posted · Report post

Picard:

I can't even read or copy the gx.dll that is in windows so overwriting it should be possible... yes, got "File is in ROM, are you sure..." and then "Access denied".

Stohn:

this wrapper already works :D maybe with your suggestions it will be even better! Thanks for those great suggestions :lol: (I'm not a programmer, for me it's like Chinese :D )

0

Share this post


Link to post
Share on other sites

Posted · Report post

I'm really sure about the GetDC(NULL). This will acquire the main device context and no other application or GDI operation can work then (even offscreen things are not possible... and windows sometimes use it e.g. for updating an invisible clock ;-) )

For priv. access there is a simple trick. You have to put your own certificate to trusted store (this is possible on unlocked devices). Then you have to sign your application with your own certificate. Voila... SetKMode() and stuff working well then :-D

Maik

0

Share this post


Link to post
Share on other sites

Posted · Report post

It's not a good idea NOT to take the original device gx.dll!!!!

You better should rename the original and copy yours to Windows. To do this I suggest to write a little tool which will do it on each device startup since Windows folder is not persistent on smartphone.

i thought you can't read nor rename the files in ROM. btw gx.dll is just a wrapper. it was designed this way. so games can install their own copy without compability issues. example if the device uses DMA transfer it's in a separate gxdma.dll, but gx.dll should do the same on all devices.

0

Share this post


Link to post
Share on other sites

Posted · Report post

I'm really sure about the GetDC(NULL). This will acquire the main device context and no other application or GDI operation can work then (even offscreen things are not possible... and windows sometimes use it e.g. for updating an invisible clock ;-) )
ok. i will change it.

For priv. access there is a simple trick. You have to put your own certificate to trusted store (this is possible on unlocked devices). Then you have to sign your application with your own certificate. Voila... SetKMode() and stuff working well then :-D

sorry. i'am really a novice smartphone programmer. how can i put my certificate to trusted store?

thanks for helping.

bye, Picard

0

Share this post


Link to post
Share on other sites

Posted · Report post

Stohn: Does it mean that with GetDC(NULL) I won't be able to have anything running in the background? Or answer the phone call?

Picard: can we try again the memdump with that priv. access trick? (certificate)

0

Share this post


Link to post
Share on other sites

Posted · Report post

Picard: can we try again the memdump with that priv. access trick? (certificate)

sure. if i get home and know how to add my certificate.

(i'am checking msdn...)

0

Share this post


Link to post
Share on other sites

Posted · Report post

Basically you are right about gx.dll is always the same except one thing...

The gx.dll on Smartphone is in ROM ==> IMPLICIT UNLIMITED TRUST (same as privileged signed).

Your copy is not signed...

Maik

P.S.

Stohn: Does it mean that with GetDC(NULL) I won't be able to have anything running in the background? Or answer the phone call?  
EXACT

how can i put my certificate to trusted store?

Check SDK documentation... ;-)

0

Share this post


Link to post
Share on other sites

Posted · Report post

EXACT

Is this a good idea? I mean until now, I was uble to answer a phone call while watching a video using BetaPlayer... It kept running in the background, but the system has lowered the volume automatically :D

0

Share this post


Link to post
Share on other sites

Posted · Report post

The gx.dll on Smartphone is in ROM ==> IMPLICIT UNLIMITED TRUST (same as privileged signed).

ok, but can i rename or copy the gx.dll ROM file? because i can't have two dll with same name in one process.

0

Share this post


Link to post
Share on other sites

Posted · Report post

Copy is impossible... (since it is in ROM ;-) )

But rename should be possible.

Maik

0

Share this post


Link to post
Share on other sites

Posted · Report post

No, rename of gx.dll in Windows also isn't possible, I tried that.

Funny is, that in case of other files, like .mid, when I try to rename I get the error: "can't delete file" BUT a copy with the new name is beeing created :D So we can write to that folder, it's just that some files are protected.

Additionally, I have read that in case of viruses, there may be patches released, so with proper permissions, an app could possibly get write permission for files in Windows... :twisted:

0

Share this post


Link to post
Share on other sites

Posted · Report post

Am I missing something? Every app that didn't run before installing this patch didn't run after installing it, too. I tried copying the DLLs to the app directory, windows directory and storagewindows directory to no avail.

0

Share this post


Link to post
Share on other sites

Posted · Report post

i updated the wrapper

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2015. MoDaCo uses IntelliTxt technology.