Initial Commit

This commit is contained in:
2020-07-11 08:41:14 -05:00
parent 55c0f7f3cd
commit 1478a597cf
176 changed files with 11933 additions and 0 deletions

View 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) *~

View File

@@ -0,0 +1,6 @@
# Input State
![](screenshot.png)
Prints the pressed button every 100ms.

View 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;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB