Skip to content

Commit

Permalink
Merge pull request #85 from stijnfrishert/develop
Browse files Browse the repository at this point in the history
v2.0.1
  • Loading branch information
stijnfrishert authored May 26, 2020
2 parents 5172cc8 + a4a730c commit cd7fe2d
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 4 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build and Test

on: [push, pull_request]

jobs:
Windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
with:
lfs: true
submodules: recursive

- name: Configure
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..

- name: Build
run: cmake --build build --config Release

- name: Test
run: build\liblsdj\test\Release\test.exe

macOS:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
with:
lfs: true
submodules: recursive

- name: Configure
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..

- name: Build
run: cmake --build build --config Release

- name: Test
run: ./build/liblsdj/test/test

Ubuntu:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
lfs: true
submodules: recursive

- name: Configure
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..

- name: Build
run: cmake --build build --config Release

- name: Test
run: ./build/liblsdj/test/test
75 changes: 75 additions & 0 deletions .github/workflows/deploy_tools.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Deploy Tools

on:
release:
types: [created]

jobs:
Windows:
runs-on: windows-latest
env:
ARCHIVE: liblsdj_windows_${{ github.event.release.tag_name }}.zip

steps:
- uses: actions/checkout@v2
with:
lfs: true
submodules: recursive

- name: Configure
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..

- name: Build
run: cmake --build build --config Release

- name: Zip
run: |
7z a ${{ env.ARCHIVE }} -tzip .\build\lsdsng_export\Release\lsdsng-export.exe
7z a ${{ env.ARCHIVE }} -tzip .\build\lsdsng_import\Release\lsdsng-import.exe
7z a ${{ env.ARCHIVE }} -tzip .\build\lsdj_mono\Release\lsdj-mono.exe
7z a ${{ env.ARCHIVE }} -tzip .\build\lsdj_wavetable_import\Release\lsdj-wavetable-import.exe
- name: Upload
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: .\${{ env.ARCHIVE }}
asset_name: ${{ env.ARCHIVE }}
asset_content_type: binary/octet-stream

macOS:
runs-on: macos-latest
env:
ARCHIVE: liblsdj_macos_${{ github.event.release.tag_name }}.zip

steps:
- uses: actions/checkout@v2
with:
lfs: true
submodules: recursive

- name: Configure
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release ..

- name: Build
run: cmake --build build --config Release

- name: Zip
run: |
zip -j ${{ env.ARCHIVE }} \
./build/lsdsng_export/lsdsng-export \
./build/lsdsng_import/lsdsng-import \
./build/lsdj_mono/lsdj-mono \
./build/lsdj_wavetable_import/lsdj-wavetable-import
- name: Upload
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./${{ env.ARCHIVE }}
asset_name: ${{ env.ARCHIVE }}
asset_content_type: binary/octet-stream
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![libLSDJ logo](https://4ntler.com/liblsdj_banner_github.png)

![Continuous Integration](https://github.com/stijnfrishert/libLSDJ/workflows/Continuous%20Integration/badge.svg)
![Passing Tests](https://github.com/stijnfrishert/libLSDJ/workflows/Build%20and%20Test/badge.svg)

[Little Sound DJ](http://littlesounddj.com) is a wonderful tool that transforms your old gameboy into a music making machine. It has a thriving community of users that pushes their old hardware to its limits, in pursuit of new musical endeavours. It can however be cumbersome to manage songs and sounds outside of the gameboy.

Expand Down
1 change: 1 addition & 0 deletions common/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

#include <algorithm>
#include <array>
#include <cstring>
#include <iostream>

#include "common.hpp"
Expand Down
9 changes: 6 additions & 3 deletions liblsdj/src/sav.c
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ lsdj_error_t compress_projects(lsdj_project_t* const* projects, uint8_t* blocks,

lsdj_vio_t wvio = lsdj_create_memory_vio(&state);

unsigned int current_block = 1;
unsigned int currentBlock = 1;
for (int i = 0; i < LSDJ_SAV_PROJECT_COUNT; i++)
{
// See if there's a project in this slot
Expand All @@ -507,14 +507,17 @@ lsdj_error_t compress_projects(lsdj_project_t* const* projects, uint8_t* blocks,

// Compress and store success + how many bytes were written
size_t compressionSize = 0;
const lsdj_error_t result = lsdj_compress(song->bytes, &wvio, current_block, &compressionSize);
const lsdj_error_t result = lsdj_compress(song->bytes, &wvio, currentBlock, &compressionSize);

// Bail out if this failed
if (result != LSDJ_SUCCESS)
return result;

// Set the block allocation table
memset(blockAllocTable, i, compressionSize / LSDJ_BLOCK_SIZE);
const unsigned int blockCount = (unsigned int)(compressionSize / LSDJ_BLOCK_SIZE);
memset(blockAllocTable + currentBlock - 1, i, blockCount);

currentBlock += blockCount;
}

return LSDJ_SUCCESS;
Expand Down
1 change: 1 addition & 0 deletions liblsdj/test/project.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <array>
#include <cassert>
#include <catch2/catch.hpp>
#include <cstring>
#include <lsdj/compression.h>

#include "file.hpp"
Expand Down
1 change: 1 addition & 0 deletions liblsdj/test/sav.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <array>
#include <cassert>
#include <catch2/catch.hpp>
#include <cstring>

#include "file.hpp"

Expand Down
2 changes: 2 additions & 0 deletions liblsdj/test/song.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <array>
#include <catch2/catch.hpp>
#include <cstring>

#include <lsdj/chain.h>
#include <lsdj/command.h>
#include <lsdj/groove.h>
Expand Down

0 comments on commit cd7fe2d

Please sign in to comment.