From e4205463db82a4ab7f511522d1267ba79ca446f4 Mon Sep 17 00:00:00 2001 From: yeti0904 Date: Sun, 5 Nov 2023 10:55:10 +0000 Subject: [PATCH] add better windows support and add github actions --- .github/workflows/d.yml | 38 ++++++++++++++++++++++++++++++++++++++ demos/tron.asm | 8 ++++++++ source/display.d | 9 ++++++++- 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/d.yml create mode 100644 demos/tron.asm diff --git a/.github/workflows/d.yml b/.github/workflows/d.yml new file mode 100644 index 0000000..f63be11 --- /dev/null +++ b/.github/workflows/d.yml @@ -0,0 +1,38 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. +name: D + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + + runs-on: ${{matrix.os}} + + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + + steps: + - uses: actions/checkout@v3 + - uses: dlang-community/setup-dlang@4c99aa991ce7d19dd3064de0a4f2f6b2f152e2d7 + + - name: 'Build & Test' + run: | + # Build the project, with its main file included, without unittests + dub build + + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: build-${{matrix.os}} + path: ${{github.workspace}}/yeti-16* diff --git a/demos/tron.asm b/demos/tron.asm new file mode 100644 index 0000000..71aa054 --- /dev/null +++ b/demos/tron.asm @@ -0,0 +1,8 @@ +; tron demo +; basically a player with a trail + +; load palette from YETI-16 graphics controller +set a 32 +set b 80 +out a b + diff --git a/source/display.d b/source/display.d index 97f7f0a..5cdf6dd 100644 --- a/source/display.d +++ b/source/display.d @@ -18,7 +18,14 @@ class Display { } void Init() { - if (loadSDL() != sdlSupport) { + version (Windows) { + auto res = loadSDL(dirName(thisExePath()) ~ "/sdl2.dll"); + } + else { + auto res = loadSDL(); + } + + if (res != sdlSupport) { stderr.writeln("No SDL support"); exit(1); }