×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    May 2014
    Posts
    6

    Exclamation Porting Emu48 to S60v5

    I am a owner of a Nokia 5800 and one thing that I always upset me with Symbian was is not having an emulator for the HP48 that run in Symbian s60v5. So, I decided to learn some principles of the language, went to study C++ and dowloaded the Carbide C++3.2 besides the source code from http://psiomas.free.fr/emu48e_en.html and start to port it.

    Well, I try to start in a small way doing step by step, but when I included the file "engine.cpp" (had included the file "engine.h" in advance) I am having several errors.

    The original files had the following includes:
    #include <stdlib.h>
    #include <stdio.h>

    but as for the s60v5_SDK_v1.0 those files are under "libc" folder, I modify those includesto <libc/stdlib.h> / <libc/stdio.h> but when try to build, several errors appear (42 in total) like this one:
    ...epoc32\include\libc\stdlib.h:26: the file 'stddef.h' cannot be opened

    Does anybody know how to fix this?

  2. #2
    Registered User
    Join Date
    May 2014
    Posts
    6

    Re: Porting Emu48 to S60v5

    Just got a way: I included the following library at the .mmp file: \epoc32\include\libc and it get rid of the errors I was having. Seems this application was written as a mix of Symbian c++ and c++.

    Now I have some other errors to solve, like the TInt64 x MAKE_TINT64. I am struggling to solve the following snipped:
    if (Chipset.cycles-dwOldCyc >= T2CYCLES)
    {
    TTime tst;
    TInt64 dwTime;
    do
    {
    tst.HomeTime();
    dwTime = tst.Int64()/1000;
    }
    while (dwTime.Low()-dwSpeedRef <= dwTickRef);
    dwOldCyc += T2CYCLES; // adjust cycles reference
    dwSpeedRef += dwTickRef; // adjust reference time
    }

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,752

    Re: Porting Emu48 to S60v5

    What do you mean on "solving the following snippet"? Is there some compiler error, or is it doing something else than what it is supposed to?

  4. #4
    Registered User
    Join Date
    May 2014
    Posts
    6

    Re: Porting Emu48 to S60v5

    Hello Wizard_hu_, in fact I am having problems with "TInt64 type" due seems that before the S60v3 versions it was a class and now is just a long long declaration.

    About errors, I decide to import the other .cpp/.h files of the original source code (like engine.cpp) and now here follow some errors I am having with the file "timer.cpp":

    Errors caused tool to abort.
    ..\src\timer.cpp:56: not a struct/union/class
    ..\src\timer.cpp:57: not a struct/union/class
    ..\src\timer.cpp:59: not a struct/union/class
    ..\src\timer.cpp:60: not a struct/union/class
    ..\src\timer.cpp:63: not a struct/union/class
    ..\src\timer.cpp:103: not a struct/union/class
    ..\src\timer.cpp:197: not a struct/union/class
    ..\src\timer.cpp:343: not a struct/union/class

    Below follow the line 56 as an example:

    line 56: ticks = TInt64((TInt)dw).operator<<(13).operator+( (TInt64((TInt)(tsdt.MicroSecond()/1000)).operator<<(10)).operator/(TInt64(125)));

    Well, I am still learning C++, but the ".operator" declaration above is strange to me and my guess is that here is were the errors are, but don't know how to sort it.

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,752

    Re: Porting Emu48 to S60v5

    Shifting and simple algebraic operations on native integral types are part of C/C++ language. As a first attempt just remove the .operator parts. Without that, << will be shifting to the left (http://en.wikipedia.org/wiki/Arithmetic_shift), + will be addition, / will be division.

  6. #6
    Registered User
    Join Date
    May 2014
    Posts
    6

    Re: Porting Emu48 to S60v5

    Thank you very much! Even though I was inclined to remove the ".operator" I wasn't willing to do it without some advice of somebody that knows deeper Symbian/C++. About the other operators I am already in knowledge of it (at least I need to know something!), but related to shifting, that is really interesting. Thumbs up to you!
    Last edited by GPistore; 2014-07-06 at 04:29.

  7. #7
    Registered User
    Join Date
    May 2014
    Posts
    6

    Re: Porting Emu48 to S60v5

    Gentlemen, I need help again!

    At the source code the author used the class CEikFileOpenDialog which is not supported in S60 phones for test is the ROM was properly loaded:

    the code is the following:
    CEikFileOpenDialog* dialog=new(ELeave) CEikFileOpenDialog(&filename);
    if(ETrue) fileLogs.Write(_L8("RomSelectL..\n"));
    dialog->SetShowSystem(ETrue);
    dialog->SetRequiredExtension(&fileExt);
    if (dialog->ExecuteLD(R_EIK_DIALOG_FILE_OPEN))
    {
    Pref.RomFileName = filename;
    if(ETrue) fileLogs.Write(_L8("RomSelectL Ok.\n"));
    return ETrue;
    }
    if(ETrue) fileLogs.Write(_L8("RomSelectL Nok.\n"));
    return EFalse;

    so, I tried to use the AknCommonDialogsDynMem library function RunSelectDlgLD but have not being successful so far. Does someone can give me an example of how open a file with this or some similar guiding? As I read AknCommonDialogs is deprecated and I should not use it ....even seems simplier!
    Thanks in advance!

  8. #8
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,752

    Re: Porting Emu48 to S60v5

    CAknFileSelectionDialog? A simple example is here: http://developer.nokia.com/community...ymbian_C%2B%2B, however it cheats with pre-setting the drive. However there is a CAknMemorySelectionDialog too, however it may have issues with multi-drive support, as discussed in http://developer.nokia.com/community...ng-Mass-memory. Unfortunately the link is gone, try checking the documentation (multi-drive support is available for S60 3rd FP2 and later).

  9. #9
    Registered User
    Join Date
    May 2014
    Posts
    6

    Re: Porting Emu48 to S60v5

    Hello wizard_hu_, thanks again! I start to dig more about CAknFileSelectionDialog and had found the following example that is perfect: http://developer.nokia.com/community...lection_dialog due that not only select but I can browse files around phone or mass memory. I just could not verify if the variable "folder" can store the file selection as well, even it seems .... So, if you can provide me a code that I use in my test program to pop up in the simulator variable results that would be great. Sorry if that seems simple, but for me it isn't !

  10. #10
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,752

    Re: Porting Emu48 to S60v5

    TFileName is actually a TBuf<256>, so it can store any text up to 256 characters.
    The interpretation of TFileName is described somewhere in the docs, in short there are 3 optional parts: a drive letter followed by a colon at the beginning (like c: for the built-in smaller "system" drive, d: is a RAM drive, e: is the first mass storage drive and z: is the ROM), then an absolute or relative path ("current" folder is maintained for each drive, RFs has methods for working with it), ending with a backslash, and then a filename.
    All of the components are optional, up to the limits of the use case of course, like RFile methods will not work without specifying an actual file.
    The only tricky part is the path, here the trailing backslash is the key:
    c:test = file "test" in the current folder of drive c:
    c:test\ = folder "test" in the current folder of drive c:
    c:\test = file "test" in the root of drive c:
    c:\test\ = folder "test" in the root of c:
    c:\test1\test2 = file "test2" in folder "test1" in the root of c:
    Otherwise yes, CAknFileSelectionDialog lets you selecting files.

    Tricky thing 2: the root of "visible" phone memory is not c:\, but c:\data\. So if you want to put something accessible into the emulator, put it into epoc32\winscw\c\data (as the "File Manager" application is part of the emulator, you can use it for looking around)

Similar Threads

  1. conversion from s60v5 to s60v5
    By yahoo2010 in forum Symbian
    Replies: 3
    Last Post: 2011-01-31, 03:09
  2. S60V5 SDK + GCC 4
    By 3DGamer in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2010-08-20, 09:29
  3. S60v5 or N97 SDK ?
    By rahulkadukar in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2010-05-19, 22:27
  4. Accelerometer S60v5
    By kiranraj.mdbu in forum Symbian User Interface
    Replies: 0
    Last Post: 2009-05-21, 12:47

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×