WIP version of 8.12...

This commit is contained in:
Max Bradbury 2024-09-09 22:46:51 +01:00
parent a36313341d
commit 4388c75bb8
15 changed files with 286 additions and 69 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "bitsy-parser"
version = "0.710.1"
version = "0.812.0"
authors = ["Max Bradbury <max@tinybird.info>"]
edition = "2021"
description = "A parser and utilities for working with Bitsy game data"
@ -12,6 +12,6 @@ keywords = ["gamedev"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
data-encoding = "^2.3.1"
data-encoding = "^2.6.0"
radix_fmt = "^1.0.0"
loe = "^0.2.0"
loe = "0.3.0"

View File

@ -1,6 +1,6 @@
MIT License
Copyright © 2021 Max Bradbury
Copyright © 2024 Max Bradbury
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

9
TODO.md Normal file
View File

@ -0,0 +1,9 @@
# 8.0 changes
* NAME fields have moved underneath the main body of data
* "BGC *" / "BGC 1" property (transparent / palette colour index)
* flags near top of game data ("! VER_MAJ 8" etc.)
* blips
* implement from_str, display
* tunes
* implement from_str, display

View File

@ -2,6 +2,7 @@ use core::fmt;
use std::fmt::Formatter;
use crate::note::Note;
#[derive(Clone, Debug, PartialEq)]
pub enum PulseWidth {
/// 50% duty cycle
Half,
@ -43,9 +44,8 @@ pub struct Blip {
/// first value is milliseconds per note;
/// second value is a modifier to the first note (add or subtract milliseconds)
beat: [i16; 2],
/// potential values are P2, P4 and P8.
pulse_width: PulseWidth,
/// Notes can sound repeatedly, or just once as the blip fades out.
/// Notes can cycle repeatedly, or just play once
repeat: bool,
}

View File

@ -1,6 +1,6 @@
use std::fmt;
#[derive(Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq)]
pub enum NotFound {
Anything,
Avatar,
@ -21,13 +21,13 @@ impl fmt::Display for NotFound {
}
}
#[derive(Debug)]
#[derive(Clone, Debug)]
pub enum ImageError {
MalformedPixel,
WrongSize,
}
#[derive(Debug)]
#[derive(Clone, Debug)]
pub