• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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
1
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!
     

    Lunos

    Random Uruguayan User
    3,114
    Posts
    15
    Years
  • 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
     
    1,403
    Posts
    10
    Years
    • Seen Apr 29, 2024
    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.
     
    14
    Posts
    1
    Years
    • Seen Oct 21, 2023
    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:

    ellabrella

    PKMN Trainer
    57
    Posts
    5
    Years
    • She/It
    • Seen Apr 17, 2024
    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