All About Symbian - Nokia (S60) and Sony Ericsson (UIQ) smartphones unwrapped

  #1  
Old 28-03-2004, 03:22 AM
redshift redshift is offline
Registered User
 
Join Date: Oct 2002
Posts: 124
redshift is on a distinguished road
Direct screen write - 9200, 9500

Hello!

I'm just porting our game, Legacy, for the Communicator (www.redshift.hu). I used this code in the past to access 9200's screen directly:

#ifdef __WINS__
bScreen=new(ELeave) CFbsBitmap();
bScreen->Create(TSize(640,200),EColor4K);
pbScreen=(Uint8 *)bScreen->DataAddress();
dScreen->CreateContext(cScreen);
pBuf=new(ELeave) TUint8[640*200];
#else
pBuf=new(ELeave) TUint8[640*200];
TScreenInfoV01 iScreenInfo;
TPckg<TScreenInfoV01> sI(iScreenInfo);
UserSvr::ScreenInfo(sI);
pScreen=(Uint8 *)(iScreenInfo.iScreenAddress)+32;
#endif

So... that was 9200 series. 4r/4g/4b, 2 bytes for each pixel, only 12 bits used. What about the 9500? How can I access the pixels, and what are the bit mapping? With 5/5/5, then it would 32768 colors.

Another question: I have the Nokia 9200 SDK, and the Series 80 SDK for 9500. Can I use only the 9200 SDK to compile our game for both 9200 and 9500 ?
I won't use too many APIs, we have a strong engine, with system-independent routines.

Thank you!

Stewe/Redshift

  #2  
Old 28-03-2004, 03:57 AM
Ismail's Avatar
Ismail Ismail is offline
Registered User
 
Join Date: Sep 2002
Location: Q8
Posts: 1,195
Ismail is on a distinguished road
i dont know the answer but u might want to post this in the devoleper section
__________________
If you can read this, than you can read!

  #3  
Old 28-03-2004, 04:01 AM
redshift redshift is offline
Registered User
 
Join Date: Oct 2002
Posts: 124
redshift is on a distinguished road
Oops, you're right! thanks!

Stewe

  #4  
Old 28-03-2004, 04:22 AM
Ismail's Avatar
Ismail Ismail is offline
Registered User
 
Join Date: Sep 2002
Location: Q8
Posts: 1,195
Ismail is on a distinguished road
anytime
__________________
If you can read this, than you can read!

  #5  
Old 11-09-2004, 07:22 PM
earamsey's Avatar
earamsey earamsey is offline
Registered User
 
Join Date: Sep 2004
Posts: 16
earamsey is on a distinguished road
Hi, I am trying to do direct screen access too, how is bScreen, dScreen,cScreen,pBuf used in __WINS__ mode? what about in __ARMI__ mode? was this taken from an example that I can follow? Can you show me how dScreen, cScreen,pBuf is used and how they work together?

THanks,!

Quote:
Originally Posted by redshift
Hello!

I'm just porting our game, Legacy, for the Communicator (www.redshift.hu). I used this code in the past to access 9200's screen directly:

#ifdef __WINS__
bScreen=new(ELeave) CFbsBitmap();
bScreen->Create(TSize(640,200),EColor4K);
pbScreen=(Uint8 *)bScreen->DataAddress();
dScreen->CreateContext(cScreen);
pBuf=new(ELeave) TUint8[640*200];
#else
pBuf=new(ELeave) TUint8[640*200];
TScreenInfoV01 iScreenInfo;
TPckg<TScreenInfoV01> sI(iScreenInfo);
UserSvr::ScreenInfo(sI);
pScreen=(Uint8 *)(iScreenInfo.iScreenAddress)+32;
#endif

So... that was 9200 series. 4r/4g/4b, 2 bytes for each pixel, only 12 bits used. What about the 9500? How can I access the pixels, and what are the bit mapping? With 5/5/5, then it would 32768 colors.

Another question: I have the Nokia 9200 SDK, and the Series 80 SDK for 9500. Can I use only the 9200 SDK to compile our game for both 9200 and 9500 ?
I won't use too many APIs, we have a strong engine, with system-independent routines.

Thank you!

Stewe/Redshift

  #6  
Old 11-09-2004, 09:31 PM
Ismail's Avatar
Ismail Ismail is offline
Registered User
 
Join Date: Sep 2002
Location: Q8
Posts: 1,195
Ismail is on a distinguished road
same answer as the one i said up
ask in the devolpoer section
__________________
If you can read this, than you can read!

  #7  
Old 11-09-2004, 10:19 PM
redshift redshift is offline
Registered User
 
Join Date: Oct 2002
Posts: 124
redshift is on a distinguished road
Hi!

Yea.

In our display.h:


CFbsScreenDevice *dScreen;

CFbsBitmap *bScreen;
CFbsBitGc *cScreen;
TUint8 *pbScreen;
TUint8 *pBuf;

#ifndef __WINS__
TUint8 *pScreen;
#endif


in display.cpp:

Init function (the example you saw)


dScreen=CFbsScreenDevice::NewL(_L(""),EColor4K,TRg b(255,255,255));
dScreen->ChangeScreenDevice(NULL);
dScreen->SetAutoUpdate(EFalse);

pBuf=new(ELeave) TUint8[640*200];

#ifdef __WINS__
bScreen=new(ELeave) CFbsBitmap();
bScreen->Create(TSize(640,200),EColor4K);
pbScreen=(TUint8 *)bScreen->DataAddress();
dScreen->CreateContext(cScreen);
#else
TScreenInfoV01 iScreenInfo;
TPckg<TScreenInfoV01> sI(iScreenInfo);
UserSvr::ScreenInfo(sI);
pScreen=(TUint8 *)(iScreenInfo.iScreenAddress)+32;
#endif


update function:


RThread().SetPriority(EPriorityRealTime);

#ifdef __WINS__
TUint8 *b=pBuf;
TUint16 *s=(TUint16 *)pbScreen;
TUint16 *ends=s+128000;

while(s<ends)
*s++=cPalette[*b++];

cScreen->BitBlt(TPoint(0,0),bScreen);
dScreen->Update();
#else
TUint8 *b=pBuf;
TUint16 *s=(TUint16 *)pScreen;
TUint16 *ends=s+128000;

while(s<ends)
*s++=cPalette[*b++];
#endif

RThread().SetPriority(EPriorityNormal);



Note: Legacy uses 8bpp. So the cPalette points to a 256 word buffer, contains EColor4K values of the palette items.
It's not Nokia 9500 - compatible. I have the routines for that, just I didn't have chance to check it (yet).


Quote:
Originally Posted by earamsey
Hi, I am trying to do direct screen access too, how is bScreen, dScreen,cScreen,pBuf used in __WINS__ mode? what about in __ARMI__ mode? was this taken from an example that I can follow? Can you show me how dScreen, cScreen,pBuf is used and how they work together?

THanks,!
Ads

  #8  
Old 12-09-2004, 03:50 PM
GhostDog's Avatar
GhostDog GhostDog is offline
Super Moderator
 
Join Date: Aug 2002
Location: Skopje,Macedonia
Posts: 6,356
GhostDog will become famous soon enough
Thread moved to the developers section.
__________________
www.symbiandiaries.com/ghostdog



Please don't PM me with something that belongs in the forums.Search first,then ask.

  #9  
Old 14-09-2004, 09:22 AM
movax's Avatar
movax movax is offline
Registered User
 
Join Date: Apr 2003
Posts: 2
movax is on a distinguished road
You can access the screen of the 9500 directly in the same way, but it uses a 16 bit graphics mode. The pixel format is 5/6/5, but since you're using a palette the only thing you need to do is to generate a new one for the 9500. You might also want to stop drawing if your program loses focus or if a system menu pops up, but this you probably already know
__________________
_\|/_

  #10  
Old 14-09-2004, 09:37 AM
redshift redshift is offline
Registered User
 
Join Date: Oct 2002
Posts: 124
redshift is on a distinguished road
Yeah, I already have the 9500 defines/code. And the 5/6/5 since (lucky thing) the palm, ppc and symbian uiq Redshift engine use this.

I just need testers
And some "bumm" on the communicator market. If we compare the Legacy sales for Nokia Communicator, Symbian UIQ, PPC, Palm, well the Communicator version is the far worst. 68 sold pieces since 30th april.
Palm means thousands.

Stewe

  #11  
Old 16-09-2004, 03:22 AM
earamsey's Avatar
earamsey earamsey is offline
Registered User
 
Join Date: Sep 2004
Posts: 16
earamsey is on a distinguished road
Hello,

I am still having problems with my program, inside my display.h
Code:
private:
    TUint8* iScreenAdr;
    CFbsBitmap* iOffScreenBmp;
    CFbsScreenDevice* iScreenDevice;
    CFbsBitGc* iGc;
#endif
inside my engine,
Code:
void Test::Setup()
{
    iOffScreenBmp = new (ELeave) CFbsBitmap;
    iOffScreenBmp->Create(TSize(176,208), EColor4K);
    iScreenDevice = CFbsScreenDevice::NewL(_L(""), EColor4K, TRgb(255,255,255));
    iScreenDevice->ChangeScreenDevice(NULL);
    iScreenDevice->SetAutoUpdate(EFalse);
    iScreenAdr = (TUint8*)iOffScreenBmp->DataAddress();
    iScreenDevice->CreateContext(iGc);
}

void Test::TryIt()
{
    TUint16* ptr = (TUint16*)iScreenAdr;
    for(TInt k = 0; k < 208*176; k++)
    {
        *ptr++ = 0x0afe; // it crashes in here because it seems like iScreenAdr points
                                    //  to TUint8 [208*176] instead of 
                                    // TUint16[208*176];   :icon13: 
    }
// It never reaches here.
    CConsoleBase*cons=Console::NewL(_L("a"), TSize(-1,-1));
    cons->Printf(_L("here"));
    cons->Getch();
    delete cons;
}
As indicated above it crashes inside of the function Test::TryIt(), when I change ptr to TUint8* ptr = iScreenAdr; it works just fine, but it doesn't cover the hole device Emu Image

------------------- I made the following changes to the code ------------------------
Code:
void Test::Setup()
{
    iOffScreenBmp = new (ELeave) CFbsBitmap;
    iOffScreenBmp->Create(TSize(4*176,4*208), EColor4K);    
    iScreenDevice = CFbsScreenDevice::NewL(_L(""), EColor4K, TRgb(255,255,255));
    iScreenDevice->ChangeScreenDevice(NULL);
    iScreenDevice->SetAutoUpdate(EFalse);
    iScreenAdr = (TUint8*)iOffScreenBmp->DataAddress();
    iScreenDevice->CreateContext(iGc);
}
void Test::TryIt()
{
    TUint16* ptr = (TUint16*)iScreenAdr;
    for(TInt k = 0; k < 2*208*2*176; k++)
    {
        *ptr++ = 0x9afe; // this does NOT crash now!! unless I change loop to
                                    // 4 * 208 * 4 * 176. strange
    }
}
This almost works, it fills most of the screen although there are still some gaps there Emu Image ,
why do I have to multiply screen width/depth by 4 iOffScreenBmp->Create(TSize(4*176,4*208), EColor4K);

What do you think is going on here? Why don't you have to go through all this on your software?

I'm running Symbian 7.0s SDK on windows 2000 pro.

Thanks,
Erica

Last edited by earamsey; 16-09-2004 at 04:40 AM.

  #12  
Old 16-09-2004, 09:34 AM
redshift redshift is offline
Registered User
 
Join Date: Oct 2002
Posts: 124
redshift is on a distinguished road
Article

Hello!

My example is for Nokia Communicator... on Series 60, I do this:

// init

iScreenMode=iEikonEnv->DefaultDisplayMode(); // from appui

dScreen=CFbsScreenDevice::NewL(_L(""),iScreenMode) ;
dScreen->ChangeScreenDevice(NULL);
dScreen->SetAutoUpdate(EFalse);
dScreen->CreateContext(cScreen);

bScreen=new(ELeave) CFbsBitmap();
bScreen->Create(TSize(176,208),iScreenMode);
// doesn't matter: pbScreen=(TUint16 *)bScreen->DataAddress();

pBuf=new(ELeave) TUint8[176*208];

// update

pbScreen=(TUint16 *)bScreen->DataAddress(); // !!!!!!! the ptr can change!!!!

TUint16 *s=(TUint16 *)pbScreen;
TUint8 *p=pBuf;

TUint8 *endp=pBuf+176*208;

while(p<endp)
*s++=cPalette[*p++];

cScreen->BitBlt(TPoint(),bScreen);
dScreen->Update();


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

you could use the various "directdraw" examples you found. However, I had problems using them, and they weren't so faster.

check it: I always ask again the ptr to the offscreen bitmap!!! It can be changed, beceuase of heap modifications!

Stewe

  #13  
Old 16-09-2004, 04:10 PM
movax's Avatar
movax movax is offline
Registered User
 
Join Date: Apr 2003
Posts: 2
movax is on a distinguished road
Well, since I'm looking at three 9500 mobiles sitting on my desktop I'm thinking I should help you. Since I'm also looking at a deadline approaching really fast for my own project I can't stress test it though. But firing it up just to see if the graphics and audio etc is working on a real device would be no problem. Just let me know if you need that kind of help.

Regarding the communicator market I think that it will get a real boost with the introduction of the 9300, so you might just get exactly what you need
__________________
_\|/_

Last edited by movax; 16-09-2004 at 04:13 PM.

  #14  
Old 16-09-2004, 10:09 PM
redshift redshift is offline
Registered User
 
Join Date: Oct 2002
Posts: 124
redshift is on a distinguished road
Cool!!!
Thanks.
Please gimme a mail at stewe@redshift.hu

Btw could you please check the currently released version? http://www.redshift.hu/redshift/Legacy.sis

Stewe

Quote:
Originally Posted by movax
Well, since I'm looking at three 9500 mobiles sitting on my desktop I'm thinking I should help you. Since I'm also looking at a deadline approaching really fast for my own project I can't stress test it though. But firing it up just to see if the graphics and audio etc is working on a real device would be no problem. Just let me know if you need that kind of help.

Regarding the communicator market I think that it will get a real boost with the introduction of the 9300, so you might just get exactly what you need

  #15  
Old 17-09-2004, 10:51 AM
earamsey's Avatar
earamsey earamsey is offline
Registered User
 
Join Date: Sep 2004
Posts: 16
earamsey is on a distinguished road
Hi,

I got it working! I have another question now. The series60 is has 12bit resolution that gives me 4096 colors, what kind of tool are you using to convert 16bit or 24bit graphics down to 12bit graphics?
 

Bookmarks

Tags
9200, 9500, direct, screen, write

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Putting on a Screen Protector Sony Ericsson P800, P900 and P910 6 09-05-2007 09:56 AM
Nokia to unwrap the new communicator!!!! n1ghtFLY Nokia 9300 and 9500 134 16-03-2004 03:28 AM
New: SCap - free screen capture for the P800 Rafe UIQ 1 25-02-2003 12:01 PM



All times are GMT. The time now is 12:11 AM.


vBulletin skins developed by: eXtremepixels
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright Notes || Contact Us || Privacy Policy