Segment-based pseudo-3D road (curves + hills, Jake Gordon technique): perspective trapezoid rendering near->far with hill clipping, scrolling rumble strips and lane dashes, depth fog, low camera for planted feel. Sprites extracted from the provided spritesheet: red Miata player car, blue/dark/yellow traffic with collision, palms/pines/bushes/billboards, start-finish arch, tire stacks. Off-road excursions trigger a rollover crash animation cycling the extra car views with dust, slide and camera whiplash; rear-ending traffic jolts the camera. Manual driving by default (arrows/WASD, P toggles demo AI); 3 laps with checkpoint time, score, speed HUD. SDL emulator target added to the emulator Makefile and platformio.ini src_dir switched to Lotus3.
58 lines
1.7 KiB
Makefile
58 lines
1.7 KiB
Makefile
# SDL2 emulator for T-Deck example sketches (run the app on your PC)
|
|
#
|
|
# 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
|
|
ifeq ($(APP),Lotus3)
|
|
APP_TITLE := Lotus 3
|
|
DEFS += -DEMU_APP_LOTUS3
|
|
endif
|
|
APP_TITLE ?= $(APP)
|
|
|
|
CXX ?= g++
|
|
CXXFLAGS ?= -std=gnu++17 -O2 -Wall -Wextra
|
|
SDLFLAGS := -I/usr/include/SDL2
|
|
INC := -Isrc/shim -I$(APP_DIR)
|
|
LIBS := -lSDL2 -lSDL2_ttf
|
|
|
|
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 $(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 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
|