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

|
||||
|
||||
Prints the pressed button every 100ms.
|
||||
|
41
z_gbdk_playground_original/input_state/input_state.c
Normal file
41
z_gbdk_playground_original/input_state/input_state.c
Normal file
@@ -0,0 +1,41 @@
|
||||
#include <stdio.h>
|
||||
#include <gb/gb.h>
|
||||
|
||||
void main() {
|
||||
while(1) {
|
||||
switch(joypad()) {
|
||||
case J_LEFT:
|
||||
printf("Left!\n");
|
||||
delay(100);
|
||||
break;
|
||||
case J_RIGHT:
|
||||
printf("Right!\n");
|
||||
delay(100);
|
||||
break;
|
||||
case J_UP:
|
||||
printf("Up!\n");
|
||||
delay(100);
|
||||
break;
|
||||
case J_DOWN:
|
||||
printf("Down!\n");
|
||||
delay(100);
|
||||
break;
|
||||
case J_START:
|
||||
printf("Start!\n");
|
||||
delay(100);
|
||||
break;
|
||||
case J_SELECT:
|
||||
printf("Select!\n");
|
||||
delay(100);
|
||||
break;
|
||||
case J_A:
|
||||
printf("A!\n");
|
||||
delay(100);
|
||||
break;
|
||||
case J_B:
|
||||
printf("B!\n");
|
||||
delay(100);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
BIN
z_gbdk_playground_original/input_state/screenshot.png
Normal file
BIN
z_gbdk_playground_original/input_state/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 29 KiB |
Reference in New Issue
Block a user