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

|
||||
|
||||
Detect which GB is being used/emulated.
|
21
z_gbdk_playground_original/detect_gb/detect_gb.c
Normal file
21
z_gbdk_playground_original/detect_gb/detect_gb.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <gb/gb.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern UBYTE _cpu;
|
||||
|
||||
void main() {
|
||||
switch (_cpu) {
|
||||
case 0x01:
|
||||
printf("DMG or SGB");
|
||||
break;
|
||||
case 0xFF:
|
||||
printf("POCKET or SGB2");
|
||||
break;
|
||||
case 0x11:
|
||||
printf("COLOR");
|
||||
break;
|
||||
default:
|
||||
printf("OTHER");
|
||||
break;
|
||||
}
|
||||
}
|
BIN
z_gbdk_playground_original/detect_gb/screenshot.png
Normal file
BIN
z_gbdk_playground_original/detect_gb/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
Reference in New Issue
Block a user