Initial Commit
This commit is contained in:
17
z_gbdk_playground_original/hello_world/Makefile
Normal file
17
z_gbdk_playground_original/hello_world/Makefile
Normal file
@@ -0,0 +1,17 @@
|
||||
AS = lcc -c
|
||||
CC = lcc -Wa-l -Wl-m
|
||||
|
||||
BIN = hello_world.gb
|
||||
OBJS = hello_world.o
|
||||
|
||||
all: $(BIN)
|
||||
|
||||
%.s: %.ms
|
||||
maccer -o $@ $<
|
||||
|
||||
$(BIN): $(OBJS)
|
||||
$(CC) -o $(BIN) $(OBJS)
|
||||
|
||||
clean:
|
||||
rm -rf $(BIN) $(OBJS) *~
|
||||
|
95
z_gbdk_playground_original/hello_world/README.md
Normal file
95
z_gbdk_playground_original/hello_world/README.md
Normal file
@@ -0,0 +1,95 @@
|
||||
|
||||
|
||||
|
||||
|
||||
# Hello World
|
||||
<div style="text-align: center"><img src="screenshot.png" alt="" /></div>
|
||||
|
||||
Prints `Hello World!` to the screen using GBDK's `printf` function.
|
||||
|
||||
## Source
|
||||
Includes `<gb/gb.h>`. This file contains all Gameboy specific functions.
|
||||
It's the one you're going to use the most.
|
||||
|
||||
|
||||
|
||||
|
||||
```c
|
||||
#include <gb/gb.h>
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Includes `<stdio.h>` it contains funtions for basic file/console input and
|
||||
output.
|
||||
|
||||
|
||||
|
||||
|
||||
```c
|
||||
#include <stdio.h>
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
A C program always starts by calling the `main()` function. If you are
|
||||
unfamiliar with this I suggest reading up on C first.
|
||||
|
||||
|
||||
|
||||
|
||||
```c
|
||||
void main() {
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Prints the string `Hello World!` to the screen. Internally it uses the
|
||||
background layer to do so as you can see in the VRAM of your favorite
|
||||
emulator.
|
||||
|
||||
|
||||
|
||||
|
||||
```c
|
||||
printf("Hello World!");
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Using `\n` you can create a new line. In this case it is used to create some
|
||||
space between the previous sentence and the next.
|
||||
|
||||
|
||||
|
||||
|
||||
```c
|
||||
printf("\n\nPress Start");
|
||||
}
|
||||
|
||||
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
3
z_gbdk_playground_original/hello_world/docs.sh
Normal file
3
z_gbdk_playground_original/hello_world/docs.sh
Normal file
@@ -0,0 +1,3 @@
|
||||
docco -t ../docs/res/readme_c.jst -o ./ hello_world.c
|
||||
mv hello_world.html README.md
|
||||
|
24
z_gbdk_playground_original/hello_world/hello_world.c
Normal file
24
z_gbdk_playground_original/hello_world/hello_world.c
Normal file
@@ -0,0 +1,24 @@
|
||||
// # Hello World
|
||||
// <div style="text-align: center"><img src="screenshot.png" alt="" /></div>
|
||||
//
|
||||
// Prints `Hello World!` to the screen using GBDK's `printf` function.
|
||||
//
|
||||
// ## Source
|
||||
// Includes `<gb/gb.h>`. This file contains all Gameboy specific functions.
|
||||
// It's the one you're going to use the most.
|
||||
#include <gb/gb.h>
|
||||
// Includes `<stdio.h>` it contains funtions for basic file/console input and
|
||||
//output.
|
||||
#include <stdio.h>
|
||||
// A C program always starts by calling the `main()` function. If you are
|
||||
// unfamiliar with this I suggest reading up on C first.
|
||||
void main() {
|
||||
// Prints the string `Hello World!` to the screen. Internally it uses the
|
||||
// background layer to do so as you can see in the VRAM of your favorite
|
||||
// emulator.
|
||||
printf("Hello World!");
|
||||
// Using `\n` you can create a new line. In this case it is used to create some
|
||||
// space between the previous sentence and the next.
|
||||
printf("\n\nPress Start");
|
||||
}
|
||||
|
BIN
z_gbdk_playground_original/hello_world/screenshot.png
Normal file
BIN
z_gbdk_playground_original/hello_world/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
Reference in New Issue
Block a user