ROM Buildfile.txtand paste:
Hello World.txt. Go back to your
ROM Buildfile.txtand add this to the bottom:
ROM Buildfile.txt, take your clean ROM and make a copy of it. We'll edit this copy so that we always have a clean ROM available in case something goes wrong.
ROM Buildfile.txt. Set the ROM as the copy you made earlier. Make sure Game matches the one you're working on. When that's done, click Assemble!
"No errors or warnings. Please continue being awesome."
1000000as the offset, ensuring that the
hexoption is selected.
Hello World!Congratulations, you inserted some data!
#include "some/file.txt"do? Basically, it inserts the entire contents of
#include "Hello World.txt"becomes
The file you #include can #include other files!
ROM Buildfileagain. What does
ORG 0x1000000mean? ORG stands for Origin meaning the starting offset of our data. In the previous example, we saw that our data was inserted to the offset 0x1000000.
If we don't put an ORG at all, Event Assembler just starts at offset 0, or the very beginning of the ROM. This breaks the ROM horribly!
#include "Hello World.txt"twice?
Hello World!twice at the end of the data. The "cursor" doesn't stay where you put the ORG, it moves forward as you insert data. After the first Hello World is inserted, the cursor is now at the end of that data, ready to add the second Hello World.
Hellow Orld.txt. Now
#includethis in your buildfile between the two
We'll want to start fresh for this, so delete the ROM you've beenassembling to and make another copy of the clean ROM.
Hello World!at 0x1000000, and
Hellow Orld!HelloWorld!at 0x1000050. But what if we wanted the two Hello Worlds together?
Hellow Orld.txtand add
PUSHto the top, and
POPto the bottom. PUSH creates a "bookmark" that remembers your position, and POP jumps back to the last bookmark you created.
You can PUSH multiple times, and each POP will take you to the newest bookmark you placed.
Hello Worldstogether, and
Hellow Orldon its own at 0x1000050.
#definesimply replaces one thing with another.
offsetwhen you write the macro!
TestMacro(0x10), you're telling EA that offset = 0x10. This expands out into:
TestMacro(0x100), it would instead become:
TestMacro(offset)looks very similar to something we've seen before. Yep,
String(text)is also a macro!
#define. There is one more way to create a shortcut: Labels.
A Label is a shortcut for an offset.
Finished. Messages: Hellow Orld is inserted at 0x100000BNo errors or warnings. Please continue being awesome.
Enter MAKE HACK.cmd!
MAKE HACK.cmdin Root.
In other words, you can now build an entire hack from scratch in one click.