Question about libc in the 3ds. (Also, NTR plugin creation)

Discussion in '3DS - Homebrew Development and Emulators' started by AlphonseElric, Sep 22, 2016.

  1. AlphonseElric
    OP

    AlphonseElric Member

    Newcomer
    28
    26
    Dec 20, 2014
    United States
    Hello,

    I'm creating a pokegen NTR plugin, and I'm using the template someone gave out (I don't remember who). Here is the important code:
    C Code

    I know, I know, it's pretty primitive. In the future, I plan to add a file selection, but that's beyond my abilities as of now.

    When I try to build the cheat.plg file, it throws a bunch of weird errors while linking:
    Linking Error

    My question is, does the libc/libgcc included with the template have support for file functions, and if so, what am I doing wrong? If anyone actually knows this convoluted question, please feel free to respond.

    Thanks!
     
    Last edited by AlphonseElric, Sep 22, 2016
  2. Coto

    Coto GBAtemp Addict

    Member
    2,379
    419
    Jun 4, 2010
    Chile
    not directly related but @
    Code:
    fseek(pokemon_ekx,0, SEEK_END);
    size = ftell(pokemon_ekx);
    
    you should right after:
    Code:
    fseek(pokemon_ekx,0,SEEK_SET); //set file handle at zero pos 
    
    otherwise you will read exactly from end of file (out of bounds)
     
  3. AlphonseElric
    OP

    AlphonseElric Member

    Newcomer
    28
    26
    Dec 20, 2014
    United States
    Thanks, I will update that in my source.

    Also, I read here that some Embedded ARM devices do not have support for fopen(), fread(), etc, and instead have to use the open() and read() syscalls.

    I will try those, and will reply with the results.
     
  4. Coto

    Coto GBAtemp Addict

    Member
    2,379
    419
    Jun 4, 2010
    Chile