• 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?".
  • Staff applications for our PokéCommunity Daily and Social Media team are now open! Interested in joining staff? Then click here for more info!
  • 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] How to compile Jambo51's OakTutorial codes

  • 58
    Posts
    9
    Years
    • Seen Jan 7, 2017
    I've found a pack of code on Jambo's GitHub: https://github.com/Jambo51/OakTutorial
    I use windows 8.1 as my operating system, but i just can't compile this code.
    I have installed make, and copied the 3 files from the bin directory as is shown in the "mega evolution code compilation tutorial".
    Then I create a new folder naming "build" in the folder.
    Then I rename the ROM to test.gba and then put it in the folder with the codes.
    Then I double-click the configure.py to get the "makefile" and it seems successful.
    Then I open the terminal in the directory and write "make" but there's an error saying that the system can't find the specific file.
    The words shown in it is:
    Code:
    arm-linux-gnueabi-as -c bootstrap.s -o bootsrtrap.o
    process_begin: CreateProcess([COLOR="Red"]NULL[/COLOR], arm-linux-gnueabi-as -c bootstrap.s -o bootsrtrap.o, ...) failed.

    The makefile generated by the python script is:
    Code:
    CC=arm-linux-gnueabi-gcc-4.7
    CXX=arm-linux-gnueabi-gcc-4.7
    AS=arm-linux-gnueabi-as
    LD=arm-linux-gnueabi-ld
    OBJCOPY=arm-linux-gnueabi-objcopy
    OBJDUMP=arm-linux-gnueabi-objcopy
    XXD=xxd
    IMG=todo
    COMPRESS=toolchain/gbalzss
    PADBIN=toolchain/padbin
    
    OPTS=-fauto-inc-dec -fcompare-elim -fcprop-registers -fdce -fdefer-pop -fdse -fguess-branch-probability -fif-conversion2 -fif-conversion -fipa-pure-const -fipa-profile -fipa-reference -fmerge-constants -fsplit-wide-types -ftree-bit-ccp -ftree-builtin-call-dce -ftree-ccp -ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre -ftree-phiprop -ftree-sra -ftree-pta -ftree-ter -funit-at-a-time -fomit-frame-pointer -fthread-jumps -falign-functions -falign-jumps -falign-loops  -falign-labels -fcaller-saves -fcrossjumping -fcse-follow-jumps  -fcse-skip-blocks -fdelete-null-pointer-checks -fdevirtualize -fexpensive-optimizations -fgcse -fgcse-lm -finline-small-functions -findirect-inlining -fipa-sra -foptimize-sibling-calls -fpartial-inlining -fpeephole2 -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop -fsched-interblock -fsched-spec -fschedule-insns -fschedule-insns2 -fstrict-aliasing -fstrict-overflow -ftree-switch-conversion -ftree-tail-merge -ftree-pre -ftree-vrp -finline-functions -funswitch-loops -fpredictive-commoning -fgcse-after-reload -ftree-slp-vectorize -fvect-cost-model -fipa-cp-clone -ffast-math -fforward-propagate -finline-functions-called-once -fmerge-all-constants -fmodulo-sched -fmodulo-sched-allow-regmoves -fgcse-sm -fgcse-las -funsafe-loop-optimizations -fconserve-stack
    DEFINES=-DBPRE -DSOFTWARE_VERSION=0
    CFLAGS=-mthumb -mthumb-interwork -mcpu=arm7tdmi $(OPTS) -mlong-calls -march=armv4t -Wall -O3 $(DEFINES)
    CXXFLAGS=-mthumb -mthumb-interwork -mcpu=arm7tdmi $(OPTS) -mlong-calls -march=armv4t -Wall -O3 $(DEFINES)
    ASFLAGS=-mthumb
    LDFLAGS=
    
    all: bootstrap.o strings.h main.o
    	$(LD) $(LDFLAGS) -o a.o -T linker.lsc -T BPRE.sym bootstrap.o main.o
    	$(OBJCOPY) -O binary a.o a.bin
    
    main.o: main.c
    	$(CC) $(CFLAGS) -c main.c
    
    bootstrap.o: bootstrap.s
    	$(AS) $(AFLAGS) -c bootstrap.s -o bootstrap.o
    
    strings.h: strings.csv
    	python3 poke2c.py strings.csv
    
    clean:
    	rm -rf bootstrap.o strings.h main.o a.o a.bin
    
    insert:
    	dd conv=notrunc of=test.gba if=a.bin bs=1 seek=8388608

    Could anyone solve this problem?
     
    Well, first of all, that is my code, not Jambo's. You need to click the "forked from Touched/OakTutorial" underneath the title to get to my version of the repository which is probably more up to date.

    In order to compile this code, you need to point it to the binaries you'll be using to compile. Most people use devkitARM, and they're in the format "arm-none-eabi-as" instead of "arm-linux-gnueabi-as". You need gcc, ld, as, objcopy and objdump. Simply replace the names on the right hand side of the code in configure.py lines 129 - 136. Then re-run the script and try make again. Make sure the binaries for devkitARM are in your path environment variable otherwise you'll get similar errors.
     
    Well, first of all, that is my code, not Jambo's. You need to click the "forked from Touched/OakTutorial" underneath the title to get to my version of the repository which is probably more up to date.

    In order to compile this code, you need to point it to the binaries you'll be using to compile. Most people use devkitARM, and they're in the format "arm-none-eabi-as" instead of "arm-linux-gnueabi-as". You need gcc, ld, as, objcopy and objdump. Simply replace the names on the right hand side of the code in configure.py lines 129 - 136. Then re-run the script and try make again. Make sure the binaries for devkitARM are in your path environment variable otherwise you'll get similar errors.

    i've solve the command problem by you leading, thank you. But there's another issue (I use your pack instead)
    Information shown in the command prompt:
    Code:
    D:\OakTutorial-master>make
    arm-none-eabi-gcc -mthumb -mthumb-interwork -mcpu=arm7tdmi -fauto-inc-dec -fcomp
    are-elim -fcprop-registers -fdce -fdefer-pop -fdse -fguess-branch-probability -f
    if-conversion2 -fif-conversion -fipa-pure-const -fipa-profile -fipa-reference -f
    merge-constants -fsplit-wide-types -ftree-bit-ccp -ftree-builtin-call-dce -ftree
    -ccp -ftree-ch -ftree-copyrename -ftree-dce -ftree-dominator-opts -ftree-dse -ft
    ree-forwprop -ftree-fre -ftree-phiprop -ftree-sra -ftree-pta -ftree-ter -funit-a
    t-a-time -fomit-frame-pointer -fthread-jumps -falign-functions -falign-jumps -fa
    lign-loops  -falign-labels -fcaller-saves -fcrossjumping -fcse-follow-jumps  -fc
    se-skip-blocks -fdelete-null-pointer-checks -fdevirtualize -fexpensive-optimizat
    ions -fgcse -fgcse-lm -finline-small-functions -findirect-inlining -fipa-sra -fo
    ptimize-sibling-calls -fpartial-inlining -fpeephole2 -fregmove -freorder-blocks
    -freorder-functions -frerun-cse-after-loop -fsched-interblock -fsched-spec -fsch
    edule-insns -fschedule-insns2 -fstrict-aliasing -fstrict-overflow -ftree-switch-
    conversion -ftree-tail-merge -ftree-pre -ftree-vrp -finline-functions -funswitch
    -loops -fpredictive-commoning -fgcse-after-reload -ftree-slp-vectorize -fvect-co
    st-model -fipa-cp-clone -ffast-math -fforward-propagate -finline-functions-calle
    d-once -fmerge-all-constants -fmodulo-sched -fmodulo-sched-allow-regmoves -fgcse
    -sm -fgcse-las -funsafe-loop-optimizations -fconserve-stack -mlong-calls -march=
    armv4t -Wall -O3 -DBPRE -DSOFTWARE_VERSION=0 -c src/main.c -o src/main.o
    src/main.c:4:31: fatal error: ../images/tilemap.h: No such file or directory
     #include "../images/tilemap.h"
                                   ^
    compilation terminated.
    make: *** [src/main.o] Error 1

    It seems that tilemap.h is missing.
     
    Just remove that line from main.c and it should work.

    Thanks for your guidance.
    Now the "a.bin" is generated successfully, so i type make insert to make it be inserted at the default offset (0x800000) and it seems to succeed.
    But how can i use it? Where should i place a pointer or something to make it replace the original intro? I think it's not included in the Readme file.
     
    Last edited:
    Thanks for your guidance.
    Now the "a.bin" is generated successfully, so i type make insert to make it be inserted at the default offset (0x800000) and it seems to succeed.
    But how can i use it? Where should i place a pointer or something to make it replace the original intro? I think it's not included in the Readme file.

    If you can't use make insert because you don't have dd, then you need to insert at the chosen location (0x800000).

    Then make the following byte changes.

    The offset is on the left, the old byte in the middle and the byte you must change it to on the right.

    Spoiler:

    Then pointer a pointer to the location +1 at both 0x12f7c0 and 0x12ee90. That should insert it over the old intro. Hopefully that works, since I can't seem to find any of the ROMs that I was using.
     
    If you can't use make insert because you don't have dd, then you need to insert at the chosen location (0x800000).

    Then make the following byte changes.

    The offset is on the left, the old byte in the middle and the byte you must change it to on the right.

    Spoiler:

    Then pointer a pointer to the location +1 at both 0x12f7c0 and 0x12ee90. That should insert it over the old intro. Hopefully that works, since I can't seem to find any of the ROMs that I was using.

    I haven't tried yet, but for the first one:
    0012EBA1 9A E6
    In my ROM it's ED instead 0f 9A and 9A appears at 0x12EBA0...

    Edit: I subtract 1 from all the offsets given and the value are correct. Then I done all the byte changes and placed 2 pointers (01 00 80 08) at 0x12f7c0 and 0x12ee90.

    But after the title screen, the game goes to the bootscreen again, so it failed.
     
    Last edited:
    Back
    Top