The PokéCommunity Forums

The PokéCommunity Forums (https://www.pokecommunity.com/index.php)
-   Binary ROM Hacking (https://www.pokecommunity.com/forumdisplay.php?f=284)
-   -   Other How to compile Jambo51's OakTutorial codes (https://www.pokecommunity.com/showthread.php?t=355426)

Pokemon_XY September 11th, 2015 2:32 AM

How to compile Jambo51's OakTutorial codes
 
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(NULL, 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?

Touched September 12th, 2015 1:08 AM

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.

Pokemon_XY September 12th, 2015 6:38 AM

Quote:

Originally Posted by Touched (Post 8924672)
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.

Touched September 12th, 2015 10:39 AM

Quote:

Originally Posted by Pokemon_XY (Post 8924936)
It seems that tilemap.h is missing.

Just remove that line from main.c and it should work.

Pokemon_XY September 12th, 2015 7:01 PM

Quote:

Originally Posted by Touched (Post 8925251)
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.

Touched September 13th, 2015 3:29 AM

Quote:

Originally Posted by Pokemon_XY (Post 8925891)
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:
Code:

0012EBA1 9A E6
0012ED29 1E B4
0012ED2A 30 E0
0012ED2C 21 00
0012ED2D 02 00
0012ED2E 22 00
0012ED2F 41 00
0012ED30 F7 00
0012ED31 5D 00
0012ED32 FB 00
0012ED33 AF 00
0012ED34 E0 00
0012ED53 05 9F
0012ED54 49 E0
0012ED56 93 00
0012ED57 01 00
0012ED58 20 00
0012ED5A 22 00
0012ED5B C7 00
0012ED5C F7 00
0012ED5D 8D 00
0012ED5E FD 00
0012ED5F 99 00
0012ED60 E0 00
0012ED69 E8 00
0012ED6A 05 00
0012ED6B 46 00
0012ED6C 08 00
0012ED9B E2 00
0012ED9C 20 00
0012ED9D 40 00
0012EDA0 90 00
0012EDA2 20 00
0012EDA3 1E 00
0012EDA4 21 00
0012EDA6 22 00
0012EDA7 0D 00
0012EDA8 23 00
0012EDA9 E0 00
0012EDAA F7 00
0012EDAB D6 00
0012EDAC FB 00
0012EDAD 1B 00
0012EDAE 49 00
0012EDAF 1E 00
0012EDB0 24 00
0012EDB2 94 00
0012EDB3 02 00
0012EDB4 20 00
0012EDB5 01 00
0012EDB6 90 00
0012EDB7 01 00
0012EDB8 20 00
0012EDBA 22 00
0012EDBC 23 00
0012EDBD D3 00
0012EDBE F6 00
0012EDBF 4A 00
0012EDC0 FB 00
0012EDC1 17 00
0012EDC2 49 00
0012EDC4 94 00
0012EDC5 01 00
0012EDC6 25 00
0012EDC7 01 00
0012EDC8 95 00
0012EDC9 01 00
0012EDCA 20 00
0012EDCC 22 00
0012EDCD 02 00
0012EDCE 23 00
0012EDCF D3 00
0012EDD0 F6 00
0012EDD1 41 00
0012EDD2 FB 00
0012EDD3 14 00
0012EDD4 49 00
0012EDD6 94 00
0012EDD7 01 00
0012EDD8 95 00
0012EDD9 01 00
0012EDDA 20 00
0012EDDC 22 00
0012EDDD 13 00
0012EDDE 23 00
0012EDDF D3 00
0012EDE0 F6 00
0012EDE1 39 00
0012EDE2 FB 00
0012EDE4 F0 00
0012EDE5 65 00
0012EDE6 F8 00
0012EDF2 20 00
0012EDF4 90 00
0012EDF5 E6 00
0012EDF6 21 00
0012EDF7 95 00
0012EDF8 22 00
0012EDFA 23 00
0012EDFB D7 00
0012EDFC F6 00
0012EDFD 81 00
0012EDFE FA 00
0012EDFF 0B 00
0012EE00 4A 00
0012EE01 B1 00
0012EE03 89 00
0012EE04 19 00
0012EE05 C9 00
0012EE07 89 00
0012EE08 18 00
0012EE0A 06 00
0012EE0C 0E 00
0012EE0D 48 00
0012EE0E 82 00
0012EE1D 0F 00
0012EE1E D0 00
0012EE21 02 00
0012EE22 D0 00
0012EE25 0E 00
0012EE26 D0 00
0012EE31 01 00
0012EE32 20 00
0012EE33 40 00
0012EE34 42 00
0012EE36 24 00
0012EE38 94 00
0012EE3A 21 00
0012EE3B 10 00
0012EE3C 22 00
0012EE3E 23 00
0012EE3F 41 00
0012EE40 F7 00
0012EE41 A3 00
0012EE42 FB 00
0012EE5F 09 00
0012EE60 48 00
0012EE61 43 00
0012EE62 F7 00
0012EE63 1E 00
0012EE64 FA 00
0012EE85 43 00
0012EE86 01 00
0012EE8D B1 C1
0012EE8E F0 F7




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.

Pokemon_XY September 13th, 2015 4:04 AM

Quote:

Originally Posted by Touched (Post 8926328)
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:
Code:

0012EBA1 9A E6
0012ED29 1E B4
0012ED2A 30 E0
0012ED2C 21 00
0012ED2D 02 00
0012ED2E 22 00
0012ED2F 41 00
0012ED30 F7 00
0012ED31 5D 00
0012ED32 FB 00
0012ED33 AF 00
0012ED34 E0 00
0012ED53 05 9F
0012ED54 49 E0
0012ED56 93 00
0012ED57 01 00
0012ED58 20 00
0012ED5A 22 00
0012ED5B C7 00
0012ED5C F7 00
0012ED5D 8D 00
0012ED5E FD 00
0012ED5F 99 00
0012ED60 E0 00
0012ED69 E8 00
0012ED6A 05 00
0012ED6B 46 00
0012ED6C 08 00
0012ED9B E2 00
0012ED9C 20 00
0012ED9D 40 00
0012EDA0 90 00
0012EDA2 20 00
0012EDA3 1E 00
0012EDA4 21 00
0012EDA6 22 00
0012EDA7 0D 00
0012EDA8 23 00
0012EDA9 E0 00
0012EDAA F7 00
0012EDAB D6 00
0012EDAC FB 00
0012EDAD 1B 00
0012EDAE 49 00
0012EDAF 1E 00
0012EDB0 24 00
0012EDB2 94 00
0012EDB3 02 00
0012EDB4 20 00
0012EDB5 01 00
0012EDB6 90 00
0012EDB7 01 00
0012EDB8 20 00
0012EDBA 22 00
0012EDBC 23 00
0012EDBD D3 00
0012EDBE F6 00
0012EDBF 4A 00
0012EDC0 FB 00
0012EDC1 17 00
0012EDC2 49 00
0012EDC4 94 00
0012EDC5 01 00
0012EDC6 25 00
0012EDC7 01 00
0012EDC8 95 00
0012EDC9 01 00
0012EDCA 20 00
0012EDCC 22 00
0012EDCD 02 00
0012EDCE 23 00
0012EDCF D3 00
0012EDD0 F6 00
0012EDD1 41 00
0012EDD2 FB 00
0012EDD3 14 00
0012EDD4 49 00
0012EDD6 94 00
0012EDD7 01 00
0012EDD8 95 00
0012EDD9 01 00
0012EDDA 20 00
0012EDDC 22 00
0012EDDD 13 00
0012EDDE 23 00
0012EDDF D3 00
0012EDE0 F6 00
0012EDE1 39 00
0012EDE2 FB 00
0012EDE4 F0 00
0012EDE5 65 00
0012EDE6 F8 00
0012EDF2 20 00
0012EDF4 90 00
0012EDF5 E6 00
0012EDF6 21 00
0012EDF7 95 00
0012EDF8 22 00
0012EDFA 23 00
0012EDFB D7 00
0012EDFC F6 00
0012EDFD 81 00
0012EDFE FA 00
0012EDFF 0B 00
0012EE00 4A 00
0012EE01 B1 00
0012EE03 89 00
0012EE04 19 00
0012EE05 C9 00
0012EE07 89 00
0012EE08 18 00
0012EE0A 06 00
0012EE0C 0E 00
0012EE0D 48 00
0012EE0E 82 00
0012EE1D 0F 00
0012EE1E D0 00
0012EE21 02 00
0012EE22 D0 00
0012EE25 0E 00
0012EE26 D0 00
0012EE31 01 00
0012EE32 20 00
0012EE33 40 00
0012EE34 42 00
0012EE36 24 00
0012EE38 94 00
0012EE3A 21 00
0012EE3B 10 00
0012EE3C 22 00
0012EE3E 23 00
0012EE3F 41 00
0012EE40 F7 00
0012EE41 A3 00
0012EE42 FB 00
0012EE5F 09 00
0012EE60 48 00
0012EE61 43 00
0012EE62 F7 00
0012EE63 1E 00
0012EE64 FA 00
0012EE85 43 00
0012EE86 01 00
0012EE8D B1 C1
0012EE8E F0 F7




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.


All times are GMT -8. The time now is 2:30 AM.


Like our Facebook Page Follow us on Twitter © 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.

Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.