Skip to content

Commit 45c5158

Browse files
committed
Add justification for favoring smaller files
1 parent d5e4a6f commit 45c5158

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/part2/title-screen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Note that we are using our `Memcopy` function from the [Functions](./functions.m
1818
And just like that we have ourselves a title screen!
1919

2020
## Organizing Our Code
21-
Our project is getting quite large with all the functionality we're building in! Let's briefly go over how to better organize things. Until now, we have always added new code into the same assembly file (`main.asm`). This file can get pretty large if we're not careful. Instead, RGBDS has a handy feature for making [functions](./functions.md) or other labels visible to external files. As an example, let's take everything we added in our [input](./input.md) lesson, and put it in a separate file named [`input.asm`](https://github.com/gbdev/gb-asm-tutorial/raw/master/unbricked/title-screen/input.asm).
21+
Our project is getting quite large with all the functionality we're building in! Let's briefly go over how to better organize things. Until now, we have always added new code into the same assembly file (`main.asm`). This file can get pretty large if we're not careful, making it harder to read and maintain. Instead, RGBDS has a handy feature for making [functions](./functions.md) or other labels visible to external files. This will help our codebase be nice and clean, making it more manageable (in the case where one might collaborate with others, this is essential!). As an example, let's take everything we added in our [input](./input.md) lesson, and put it in a separate file named [`input.asm`](https://github.com/gbdev/gb-asm-tutorial/raw/master/unbricked/title-screen/input.asm).
2222

2323
Notice the use of the double colon (`::`) after the function and variable names. This is how we can export a label to other files, also known as broadening its [scope](https://en.wikipedia.org/wiki/Scope_%28computer_programming%29). Now that we have all of the input-related code in a separate file, and everything else in main, all that is left is to build the ROM. Now that we have multiple files, we have to assemble each assembly file, then link them together in one ROM, like so:
2424

0 commit comments

Comments
 (0)