Initial Commit
This commit is contained in:
17
z_gbdk_playground_original/beep/Makefile
Normal file
17
z_gbdk_playground_original/beep/Makefile
Normal file
@@ -0,0 +1,17 @@
|
||||
AS = lcc -c
|
||||
CC = lcc -Wa-l -Wl-m
|
||||
|
||||
BIN = beep.gb
|
||||
OBJS = beep.o
|
||||
|
||||
all: $(BIN)
|
||||
|
||||
%.s: %.ms
|
||||
maccer -o $@ $<
|
||||
|
||||
$(BIN): $(OBJS)
|
||||
$(CC) -o $(BIN) $(OBJS)
|
||||
|
||||
clean:
|
||||
rm -rf $(BIN) $(OBJS) *~
|
||||
|
6
z_gbdk_playground_original/beep/README.md
Normal file
6
z_gbdk_playground_original/beep/README.md
Normal file
@@ -0,0 +1,6 @@
|
||||
# Beep
|
||||
|
||||

|
||||
|
||||
Demonstrates how to play a simple SFX sound.
|
||||
|
31
z_gbdk_playground_original/beep/beep.c
Normal file
31
z_gbdk_playground_original/beep/beep.c
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <gb/gb.h>
|
||||
#include <gb/drawing.h>
|
||||
|
||||
void main() {
|
||||
NR50_REG = 0xFF;
|
||||
NR51_REG = 0xFF;
|
||||
NR52_REG = 0x80;
|
||||
|
||||
gotogxy(1, 1);
|
||||
gprintf("====== Beep ======");
|
||||
|
||||
gotogxy(2, 3);
|
||||
gprintf("Press any button");
|
||||
|
||||
while(1) {
|
||||
UBYTE joypad_state = joypad();
|
||||
|
||||
if(joypad_state) {
|
||||
NR10_REG = 0x38U;
|
||||
NR11_REG = 0x70U;
|
||||
NR12_REG = 0xE0U;
|
||||
NR13_REG = 0x0AU;
|
||||
NR14_REG = 0xC6U;
|
||||
|
||||
NR51_REG |= 0x11;
|
||||
|
||||
delay(200);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
BIN
z_gbdk_playground_original/beep/screenshot.png
Normal file
BIN
z_gbdk_playground_original/beep/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
Reference in New Issue
Block a user