• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Our weekly protagonist poll is now up! Vote for your favorite Conquest protagonist in the poll by clicking here.
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Other] Read external data

  • 14
    Posts
    2
    Years
    • Seen Oct 21, 2023
    I try to put the binary file of text or image on the outside, and then write a code to load them into RAM.
    But when I compile it, it has the following errors:
    `fopen' referenced in section `.text' of src/filename.o: defined in discarded section `.text' of ../../tools/agbcc/lib/libc.a(fopen.o)
    `fread' referenced in section `.text' of src/filename.o: defined in discarded section `.text' of ../../tools/agbcc/lib/libc.a(fread.o)



    How can I make it compile successfully?Please help me!
     
    I try to put the binary file of text or image on the outside, and then write a code to load them into RAM.
    But when I compile it, it has the following errors:
    `fopen' referenced in section `.text' of src/filename.o: defined in discarded section `.text' of ../../tools/agbcc/lib/libc.a(fopen.o)
    `fread' referenced in section `.text' of src/filename.o: defined in discarded section `.text' of ../../tools/agbcc/lib/libc.a(fread.o)



    How can I make it compile successfully?Please help me!
    Make sure to add entries for your file inside the ld_script.txt file.
    Code:
        .text :
        ALIGN(4)
        {
            (...)
            src/international_string_util.o(.text);
    [COLOR="Green"]+       src/filename.o(.text);[/COLOR]
        } =0
     
    fopen and fread don't exist on the GBA because there's no filesystem. If you look around in pokeemerald, you'll see that INCBIN macros are used to make the contents of a file available in the ROM.
     
    fopen and fread don't exist on the GBA because there's no filesystem. If you look around in pokeemerald, you'll see that INCBIN macros are used to make the contents of a file available in the ROM.

    OK,I see. Is there a way to read binary files? If we can, we will no longer be limited by 32MB
     
    Last edited:
    strictly speaking, we're not limited to 32MB. some real GBA cartridges use more space than that. here's an explanation for how the shrek 2 video cartridge, which uses 64MB of space, was dumped: https://mgba.io/2015/10/20/dumping-the-undumped/

    however, i have no idea how you would implement this sort of thing into pokeemerald, or whether it would run on any emulator.
     
    Back
    Top