Page 5 of 7 FirstFirst ... 34567 LastLast
Results 41 to 50 of 69

Thread: FPC4NDS: first raw demo

  1. #41

    FPC4NDS: first raw demo

    Quote Originally Posted by Legolas
    Quote Originally Posted by FPK
    Quote Originally Posted by Legolas
    translate 1:1, like bit fields inside a struct, but I'll provide some bit masking functions, if needed
    You can. FPC 2.1.1 supports bit packed records.
    Nice! So if I have something like
    Code:
    typedef struct tPERSONAL_DATA {
      u8 RESERVED0&#91;2&#93;;			//!<	??? &#40;0x05 0x00&#41;.
    
      u8 theme;					//!<	The user's theme color &#40;0-15&#41;.
      u8 birthMonth;			//!<	The user's birth month &#40;1-12&#41;.
      u8 birthDay;				//!<	The user's birth day &#40;1-31&#41;.
    
      u8 RESERVED1&#91;1&#93;;			//!<	???
    
    ---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
    
      packed_struct &#123;
        unsigned language    &#58; 3;	//!<	User's language.
        unsigned gbaScreen   &#58; 1;	//!<	GBA screen selection &#40;lower screen if set, otherwise upper screen&#41;.
        unsigned RESERVED3   &#58; 2;	//!<	???
        unsigned autoMode    &#58; 1;	//!<	The DS should boot from the DS cart or GBA cart automatically if one is inserted.
        unsigned RESERVED4   &#58; 1;	//!<	???
      &#125;;
    &#125; PACKED PERSONAL_DATA ;
    how should I convert that packed_struct part? :think:
    Using bitpacked and range types:

    Code:
    type
      PERSONAL_DATA = bitpacked record
        RESERVED0 &#58; array&#91;0..1&#93; of byte;
    
        &#123; ... &#125;
    
        language &#58; 0..7;
        gbaScreen &#58; 0..1;
        RESERVED3  &#58; 0..3;
        autoMode &#58; 0..1;
        RESERVED4 &#58; 0..1;
      end;
    <a>http://www.freepascal.org</a>

  2. #42

    FPC4NDS: first raw demo

    Here's a piece of IRC chat i had with fpcfan on this topic, he asked me to post it here, he registered an account but is still waiting for an admin to approve it, so if you can speed that up it'd be great.

    fpcfan I think the difference between arm7 and arm9 should be implemented by using the -Cparm7 and -Cparm9 switches
    fpcfan and not but setting the apptype
    fpcfan Legolas writes this on 8 december: Now I need to know how to handle 2 linker script with fpc without using external files (and - of course - without upsetting fpc's design rules...).
    fpcfan I'm thinking to something like a compiler switch or, (maybe) even better, a define like this:
    fpcfan Pascal Code:
    fpcfan {$define ARM7} / {$define ARM9}
    This is my game project - Top Down City:
    http://www.pascalgamedevelopment.com...y-Topic-Reboot

    My OpenAL audio wrapper with Intelligent Source Manager to use unlimited:
    http://www.pascalgamedevelopment.com...source+manager

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

    FPC4NDS: first raw demo

    Ah yes... he may or may not have mentioned this in the FPC Wiki page for NDS.
    Jason McMillen
    Pascal Game Development
    Co-Founder





  4. #44

    FPC4NDS: first raw demo

    -Cp is to set the target processor within a cpu architecture. This is not the case here; as far as I understood a NDS needs two executables, one will run on the ARM7, the other on the ARM9. -Cp should never have an effect on the linker script.

    The apptype should be used to specify what executable should be generated. Then the executable for the ARM9 can still be compiled in with a potential -Cparm9 to enable ARM9 instructions.

  5. #45

    FPC4NDS: first raw demo

    [quote="dmantione"]-Cp is to set the target processor within a cpu architecture. This is not the case here; as far as I understood a NDS needs two executables, one will run on the ARM7, the other on the ARM9. -Cp should never have an effect on the ]

    Yes, it works in this way. I was thinking about a couple of defines because, depending on arm9 or arm7, I should use a different library too: in fact libnds is divided in two parts (libnds7.a and libnds9.a) and in the headers I have found a lot of "#ifdef arm9" and "#ifdef arm7". As far as I have read, I can't detect apptype at compile time, so I'm investigating about a way to reorganize libnds headers
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  6. #46

    FPC4NDS: first raw demo

    I (fpcfan) still don't understand it.

    In what way is a the relation between ARM7 and ARM9 different from the relation between a Pentium and a 80386? Can't an ARM9 run ARM7 code? Are they much more different from each other than Pentium IV and 80386?

    Maybe the -P command line parameter is a better option then.

  7. #47

    FPC4NDS: first raw demo

    I can't find -P command line in the documentation online. What about it?

    However, the only reason for apptype was that arm9 and arm7 binaries for nds need two different prt0 and linker script, and that seemed the best way to handle it. If we'll find a better way, it can be changed, of course


    BTW, I have uploaded the binaries :mrgreen:
    Get your fpc4gba copy now!
    Get your fpc4nds copy now!

  8. #48

    FPC4NDS: first raw demo

    Quote Originally Posted by Legolas
    I can't find -P command line in the documentation online. What about it?
    It is badly documented indeed :-(

    It is a parameter to pass to fpc, so that it selects the correct ppcXXX for the target. For example to compile for arm-wince, I could do:
    Code:
    fpc -Parm -Twince
    .

    [quote]However, the only reason for apptype was that arm9 and arm7 binaries for nds need two different prt0 and ]
    I don't know what is hetter, using {$apptype} just felt wrong, no 'hard evidence'.

  9. #49

    FPC4NDS: first raw demo

    Quote Originally Posted by Vincent
    I don't know what is hetter, using {$apptype} just felt wrong, no 'hard evidence'.
    As said on irc, the correct solution would be probably having two targets ndsarm7 and ndsarm9 but this is over engineering.
    <a>http://www.freepascal.org</a>

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

    FPC4NDS: first raw demo

    Well as I mentioned to fpcfan (Vincent) in IRC the ARM7 was put into the NDS simply for backwards compatibility for GBA games so if you're gonna make a NDS game you might aswell just use ARM9.
    Jason McMillen
    Pascal Game Development
    Co-Founder





Page 5 of 7 FirstFirst ... 34567 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
  •