CRT Terminal app
This commit is contained in:
+33
-13
@@ -1,34 +1,54 @@
|
||||
# Local SDL2 emulator for MissileCommand (run the game on your PC)
|
||||
# SDL2 emulator for T-Deck example sketches (run the app on your PC)
|
||||
#
|
||||
# make build ./missilecommand-emu
|
||||
# make run build + launch the window
|
||||
# make smoke headless test: 240 frames, dump the last frame to a BMP
|
||||
# make build the MissileCommand emulator (default)
|
||||
# make APP=CrtTerminal build the CRT terminal emulator
|
||||
# make run [APP=...] build + launch the window
|
||||
# make smoke [APP=...] headless test: N frames, dump the last frame
|
||||
# make clean [APP=...] remove the binary + smoke frame
|
||||
#
|
||||
# The sketch is included by src/main.cpp as a single translation unit:
|
||||
# -DAPP_INO='"<App>.ino"'. Apps with a sound_engine.cpp get it linked
|
||||
# automatically (wildcard).
|
||||
|
||||
APP ?= MissileCommand
|
||||
APP_DIR := ../examples/$(APP)
|
||||
|
||||
ifeq ($(APP),MissileCommand)
|
||||
APP_TITLE := Missile Command
|
||||
DEFS += -DEMU_APP_MISSILECOMMAND
|
||||
endif
|
||||
ifeq ($(APP),CrtTerminal)
|
||||
APP_TITLE := CRT Terminal
|
||||
endif
|
||||
APP_TITLE ?= $(APP)
|
||||
|
||||
CXX ?= g++
|
||||
CXXFLAGS ?= -std=gnu++17 -O2 -Wall -Wextra
|
||||
SDLFLAGS := -I/usr/include/SDL2
|
||||
INC := -Isrc/shim -I../examples/MissileCommand
|
||||
INC := -Isrc/shim -I$(APP_DIR)
|
||||
LIBS := -lSDL2 -lSDL2_ttf
|
||||
|
||||
GAME_DIR := ../examples/MissileCommand
|
||||
SHIMS := $(wildcard src/shim/*.h) $(wildcard src/shim/driver/*.h)
|
||||
EMU := missilecommand-emu
|
||||
DEFS += -DAPP_INO='"$(APP).ino"' -DAPP_NAME='"$(APP_TITLE)"'
|
||||
|
||||
SHIMS := $(wildcard src/shim/*.h) $(wildcard src/shim/driver/*.h)
|
||||
SOUND_SRC := $(wildcard $(APP_DIR)/sound_engine.cpp)
|
||||
EMU := $(APP)-emu
|
||||
|
||||
.PHONY: all run smoke clean
|
||||
|
||||
all: $(EMU)
|
||||
|
||||
$(EMU): src/main.cpp $(GAME_DIR)/sound_engine.cpp $(GAME_DIR)/MissileCommand.ino $(SHIMS)
|
||||
$(CXX) $(CXXFLAGS) $(SDLFLAGS) $(INC) \
|
||||
src/main.cpp $(GAME_DIR)/sound_engine.cpp -o $@ $(LIBS)
|
||||
$(EMU): src/main.cpp $(SOUND_SRC) $(APP_DIR)/$(APP).ino $(SHIMS)
|
||||
$(CXX) $(CXXFLAGS) $(SDLFLAGS) $(INC) $(DEFS) \
|
||||
src/main.cpp $(SOUND_SRC) -o $@ $(LIBS)
|
||||
|
||||
run: $(EMU)
|
||||
./$(EMU)
|
||||
|
||||
# Headless smoke test: dummy video/audio, run N frames, save the last frame.
|
||||
# Feed some keys: 'a' starts the game, arrows steer, etc. via --script.
|
||||
# Feed keys via --type "text" (queued a few chars per frame).
|
||||
smoke: $(EMU)
|
||||
./$(EMU) --frames 240 --dump smoke_frame.bmp
|
||||
|
||||
clean:
|
||||
rm -f $(EMU) smoke_frame.bmp
|
||||
rm -f $(EMU) smoke_frame.bmp
|
||||
Reference in New Issue
Block a user