Skip to content

Commit c900595

Browse files
committed
ci
1 parent 941af88 commit c900595

File tree

4 files changed

+44
-8
lines changed

4 files changed

+44
-8
lines changed

.github/workflows/build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build Brus-16
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
linux:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@main
10+
- uses: libsdl-org/setup-sdl@main
11+
with:
12+
version: 3-head
13+
install-linux-dependencies: true
14+
- run: make emu
15+
- uses: actions/upload-artifact@main
16+
with:
17+
name: brus16_linux
18+
path: brus16
19+
20+
windows:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@main
24+
- run: |
25+
sudo apt-get install -y mingw-w64
26+
wget https://github.com/libsdl-org/SDL/releases/download/prerelease-3.3.4/SDL3-devel-3.3.4-mingw.tar.gz
27+
tar -xzf SDL3-devel-3.3.4-mingw.tar.gz
28+
- run: make emu OS=Windows_NT CC=x86_64-w64-mingw32-gcc SDL=SDL3-3.3.4/x86_64-w64-mingw32
29+
- run: |
30+
mkdir release
31+
mv brus16.exe release/
32+
cp SDL3-3.3.4/x86_64-w64-mingw32/bin/SDL3.dll release/
33+
- uses: actions/upload-artifact@main
34+
with:
35+
name: brus16_windows
36+
path: release/

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ __pycache__/
88
*.so
99
*.dll
1010
*.exe
11-
SDL
11+
SDL3*
1212

1313
# Distribution / packaging
1414
.Python

games/sine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from brus16 import *
22

3-
save_game('sine.bin', f'''
3+
asm = save_game('sine.bin', f'''
44
def main():
55
freq = {get_freq(880)}
66
poke({OSC_MEM + OSC_ABS}, 1)

makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ EMCC = emcc
33
CFLAGS = -O2 -Wall -Wextra -Wpedantic
44
LDFLAGS = -lSDL3
55
SRC = src/brus16_emu.c src/brus16_cpu.c src/brus16_sfx.c
6+
TARGET = brus16
67

78
ifeq ($(OS),Windows_NT)
8-
TARGET = brus16.exe
9-
SDL = SDL/x86_64-w64-mingw32
9+
TARGET := $(TARGET).exe
10+
SDL = SDL3-3.3.4/x86_64-w64-mingw32
11+
CFLAGS += -I"$(SDL)/include"
1012
LDFLAGS += -L"$(SDL)/lib"
1113
else
12-
TARGET = brus16
13-
SDL = SDL/include/SDL3
14+
CFLAGS += $(shell pkg-config --cflags sdl3)
15+
LDFLAGS += $(shell pkg-config --libs sdl3)
1416
endif
1517

16-
CFLAGS += -I"$(SDL)/include"
17-
1818
emu:
1919
$(CC) $(CFLAGS) -DDEBUG $(SRC) -o $(TARGET) $(LDFLAGS)
2020

0 commit comments

Comments
 (0)