Skip to content

Commit 370db4e

Browse files
committed
Add sram as default build type
1 parent ccf9229 commit 370db4e

5 files changed

Lines changed: 33 additions & 6 deletions

File tree

.github/workflows/main.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ jobs:
3232
needs: check
3333
name: Build and Release
3434
runs-on: macOS-latest
35+
strategy:
36+
matrix:
37+
mode:
38+
- name: sram
39+
cargo_params: ""
40+
filename: sram
41+
- name: f64
42+
cargo_params: --no-default-features --features=flash64
43+
filename: flash64
3544
steps:
3645
- uses: actions/checkout@v4
3746
- uses: dtolnay/rust-toolchain@stable
@@ -43,13 +52,13 @@ jobs:
4352
cargo install agb-gbafix
4453
4554
- name: build
46-
run: cargo build --release
55+
run: cargo build --release ${{ matrix.mode.cargo_params}}
4756

4857
- name: build gba
49-
run: agb-gbafix target/thumbv4t-none-eabi/release/nonogram_advance -o nonogram_advance.gba -tNonogramAdv -cNGA1 -mEB -r93
58+
run: agb-gbafix target/thumbv4t-none-eabi/release/nonogram_advance -o nonogram_advance_v0.9.4_${{ matrix.mode.filename}}.gba -tNonogramAdv -cNGA1 -mEB -r94
5059

5160
- uses: softprops/action-gh-release@v1
5261
with:
53-
files: nonogram_advance.gba
62+
files: nonogram_advance_v0.9.4_${{ matrix.mode.filename}}.gba
5463
env:
5564
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.9.4
2+
3+
- Update code and actions to support SRAM and Flash64
4+
15
# 0.9.3
26

37
- Fix bug where deleting save duplicated bgm

Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nonogram_advance"
3-
version = "0.9.3"
3+
version = "0.9.4"
44
publish = false
55
authors = ["Emma Britton <emmabritton@pm.me>"]
66
readme = "README.md"
@@ -13,6 +13,11 @@ edition = "2024"
1313
[dependencies]
1414
agb = "0.22.6"
1515

16+
[features]
17+
default = ["sram"]
18+
sram = []
19+
flash64 = []
20+
1621
[profile.dev]
1722
opt-level = 3
1823
lto = "fat"

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ Nonogram game with 108 puzzles for the GBA
1010

1111
## Player Usage
1212

13-
Download gba file from [here](https://github.com/emmabritton/gba_nonogram_advance/releases/latest) and run in an emulator (mGBA recommended) or on an actual GBA
13+
Download gba file from [here](https://github.com/emmabritton/gba_nonogram_advance/releases/latest) and run in an emulator (mGBA recommended) or on an actual GBA
1414

15-
> Save type is FLASH64 / 512Kbit
15+
Use nonogram_advance_v0.9.4_sram.gba on SRAM carts or things like EverDrive
16+
Use nonogram_advance_v0.9.4_flash64.gba on 512KBit/64K Flash carts
1617

1718
## Dev Usage
1819

src/main.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,17 @@ include_background_gfx!(
9999
delete_save => deduplicate "gfx/menu/bg/settings_delete_save.aseprite",
100100
);
101101

102+
#[cfg(all(feature = "sram", feature = "flash64"))]
103+
compile_error!("Features `sram` and `flash64` are mutually exclusive. Enable only one.");
104+
102105
#[agb::entry]
103106
fn main(mut gba: agb::Gba) -> ! {
107+
#[cfg(feature = "sram")]
108+
gba.save.init_sram();
109+
110+
#[cfg(feature = "flash64")]
104111
gba.save.init_flash_64k();
112+
105113
let mut mixer = gba.mixer.mixer(Frequency::Hz18157);
106114

107115
let mut settings_data = match gba.save.access() {

0 commit comments

Comments
 (0)