Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Is it possibe to use Lazarus fir NDS development

  1. #1

    Is it possibe to use Lazarus fir NDS development

    Hi

    I've installed and got v 2.4 fpc4nds compilig all the examples, and working on real hardware - so thanks!

    (I've always given up on homebrew before as my C isn't so great - but I've been "doing" delphi development for the past 5 years or so, so this seems idea for me. Just a shame that your Wii port for fpc will not be progressed).

    I was wondering it is possible to use Lazarus (or other front end may bloodshed-dev-pascal) that would give code-compeltion and would invoke the arm-fpc compiler? If so - any hints on how to do it? I miss the code completion/ide!

    Thanks

  2. #2

    Re: Is it possibe to use Lazarus fir NDS development

    Of course you can
    You will need a Lazarus distro with fpc 2.4.0, maybe a 0.9.29 snapshot should be fine. In order to create a NDS project, please do the following steps:

    1 Select Project->New project->Program
    2 modify the code removing the unneded parts:
    [code=pascal]program Project1;
    {$mode objfpc}
    uses
    ctypes, nds9;

    begin

    end. [/code]

    3 From the menu Project->Project options...->Compiler options select "NoGUI" as LCL widget type
    4 move on Compiler options->Code then select "arm" as Target CPU and "nds" as Target OS
    5 move on Compiler options->Other then check "Use additional Compiler Config file", writing the config file of your nds compiler (maybe something like c:\lazarus\fpc\2.4.0\bin\arm-nds\fpc.cfg). Lazarus will complain about some conflicting names, but just do ok and all will be fine

    6 From the menu Run->Run parameters...->Local->Host Application select your emulator with full path (something like c:\desmume\desmume.exe)
    7 Put $ProjPath()\$NameOnly($ProjFile()).nds on "Command line parameters" field

    The code completion feature should work fine now. Of course you can't debug, but you can build and run your nds app on the emulator just by pressing F9, as for win32 applications
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  3. #3

    Re: Is it possibe to use Lazarus fir NDS development

    Hi - thanks for the reply - but I can't get it working...

    On my windows xp machine, I've installed
    Lazarus-0.9.29-23873-fpc-2.4.0-20100308-win32.exe
    into C:\lazarus

    I've also got
    arm-nds-fpc-2.4.0.i386-win32.zip
    installed to C:\fpc4nds.

    Are these the correct packages?

    (Oh - and devkitpro in C:\devkitPro)

    Using this config - lazarus kept saying that it couldn't find ppcarm.exe, so I copied
    arm-nds folder from C:\fpc4nds\bin & C:\fpc4nds\units and placed these in C:\lazarus\fpc\2.4.0.

    Your post seemed to suggest that this should be the directory structure.

    When I try compiling this program

    Code:
    program helloworld;
    {$mode objfpc}
    
    uses nds9;
    
    
    begin
     consoleDemoInit();
    
     printf('Hello World !!!');
    end.
    I get an information box, saying "unable to find file "".
    If it belongs to your projectm check search path in project-<compiler options..-> ......

    The message window logs :-

    Error: ppcarm.exe can't be executed, error message: Failed to execute ""ppcarm.exe" -B -MObjFPC -Scghi -O1 -Tnds -gl -vewnhi -l -n @c:\lazarus\fpc\2.4.0\bin\arm-nds\fpc.cfg "-FiC:\temp\New Folder\lib\arm-nds\" -FuC:\lazarus\fpc\2.4.0\units\arm-nds\libndsfpc\ -FuC:\lazarus\fpc\2.4.0\units\arm-nds\ "-FuC:\temp\New Folder\" -Fu. "-FUC:\temp\New Folder\lib\arm-nds\" -oproject1 project1.lpr

    Does the path to "ppcarm.exe" need to be in the "path" variable - or should lazaus work out where it is from (C:\lazarus\fpc\2.4.0\bin\arm-nds)

    Whats also strange - is if in the IDE, I click "find declartion" on consoleDemoInit -
    project1.lpr(4,11) Error: source not found: unit C:\lazarus\fpc\2.4.0\units\arm-nds\libndsfpc\nds9.ppu

    BUT in C:\lazarus\fpc\2.4.0\units\arm-nds\libndsfpc\ there is nds9.ppu and nds9.o


    When I click project options "TEST" - the top box displays

    c:\lazarus\fpc\2.4.0\bin\i386-win32\fpc.exe -MObjFPC -Scghi -O1 -Tnds -Parm -gl -va -l -n @c:\lazarus\fpc\2.4.0\bin\arm-nds\fpc.cfg "-FiC:\temp\New Folder\lib\arm-nds\" -FuC:\lazarus\fpc\2.4.0\units\arm-nds\libndsfpc\ -FuC:\lazarus\fpc\2.4.0\units\arm-nds\ -Fu. -FUlib\arm-nds\ C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\testcompileropt ions.pas


    And the bottom windows says ERROR: compiled FPC unit not found:,:-
    system.ppu
    sysutils.ppu
    classes.ppu
    avl_tree.ppu
    zstream.ppu


    And I definately DO have the target os as nds, target cpu as arm.

    Any other ideas please?

    Help

    I seem to think there was a wiki page for a lazarus console/gamers edition (can't find the link now) - which would have all this already configured. Any news on that?


  4. #4

    Re: Is it possibe to use Lazarus fir NDS development

    Try compiling it in a directory without spaces. I saw you used C:\temp\New Folder. The old release apparently had a few problems with that
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  5. #5

    Re: Is it possibe to use Lazarus fir NDS development

    Thanks for the help - I've got it working now. (I needed to change the enviroment compiler to use c:\lazarus\fpc\2.4.0\bin\arm-nds\ppcarm.exe rather than c:\lazarus\fpc\2.4.0\bin\i386-win32\fpc.exe) and with the above instructions from Legolas its working now!

    PS :
    I've got a few screen shots/instructions of how I got it installed - I'll post the instructions here over the next week as it might help others new to the world of lazarus/fpc and targeting different cpus to get up and running.


  6. #6
    Co-Founder / PGD Elder WILL's Avatar
    Join Date
    Apr 2003
    Location
    Canada
    Posts
    6,107
    Blog Entries
    25

    Re: Is it possibe to use Lazarus fir NDS development

    Quote Originally Posted by AAG
    PS :
    I've got a few screen shots/instructions of how I got it installed - I'll post the instructions here over the next week as it might help others new to the world of lazarus/fpc and targeting different cpus to get up and running.
    Hey that'd be awesome. Also if you are interested in making a magazine article out of it I can see about putting it into issue 3 of Pascal Gamer Magazine. I'm always on the look out for some good solid articles like this.

    Glad you got your platform setup now go show us some NDS games!
    Jason McMillen
    Pascal Game Development
    Co-Founder





  7. #7
    I got it working too thanks
    Last edited by slenkar; 13-11-2010 at 06:17 PM.

  8. #8
    the examples work except for the ones that need an include like texture.bin.inc
    I have the texture.bin file but it needs to be texture.bin.inc
    if i rename it I get errors

  9. #9
    Remember, you need to convert it into delphi code from binary data

    There should be a tool that can do that. I cant remember the name. bin2inc or something
    Peregrinus, expectavi pedes meos in cymbalis
    Nullus norvegicorum sole urinat

  10. #10
    texture.bin is converted in an include file by using the provided makefile:

    Code:
    set PATH=%PATH%;c:\fpc4nds\bin\arm-nds
    make OS_TARGET=nds CPU_TARGET=arm BINUTILSPREFIX=arm-eabi- PP=ppcarm.exe
    I don't know if "make" can be called by Lazarus; however you could call "make" the very first time, in order to generate the inc files, then use Lazarus as usual
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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