Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
wtetzner committed Feb 3, 2021
1 parent 070b39a commit 8eea533
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ before_deploy: mkdir -p target/release/artifacts && if [ "$TRAVIS_OS_NAME" == "w
deploy:
provider: releases
api_key:
secure: TGPUPwLwBZ1NtJ6lDMxSChenodSqbIq5ZxJesTE3LmOfzgwtdpJ0eC44s7qb1F0v/yZ+4aanCcSo0mB9iVDjGeaTBXkTgBRf4TYHp7X+bLakGUIHphyH1FO5usKun0nmOTaUHytqQ0x4SCF238r42LgU/9kZSKDofwWJoYKNsaK7uB/MITJ+eMlU509cXuTYxr33+Ta8xPkUQe5yKU6VK6q3DxhJdpbEvQNrQW+oJDL/MGxopKqNutCM5MCAorYhjHxwUpqg5Z4cPjjwf3928Me0UlGrGxaWqIenQUb/sUU+ofH5Jjs6grhnO3WjIc3nSn20oaAtDL0rhRPApm5boJ/sZR52LS87zrBr++OTNZjfhvDPfN4ccpR5Hj11ZdmVKOEAahDg61GX+xkmABWmKPcL3TqkyfM9I9BvYW5bVs9jFxPrFphv54vaSzpDlThBceNhgG8yaRoeAcZd9L1YnTorVivHrdISeqfXHs4xfe6q2nUhlNjO+F6GHCj3fiNnzp7QDtgeEUHnLcwD3Cm6x7iFvg9/gg/t3A+bwGc30aBJ22Vx21aBQtuuBKHvj8P9yjmM/TIpGi7OCQhKaZx835BbqAzQtxDAe9AoaJDFVpMSykHIGSRopKzgYsrQslsQWzZXgtHi3QPtIat8pcIVhgaRSziUUwB23p5vq8b7QDU=
secure: jE9u+Y5n4twL1mnEQwZCxv0iUu5/VbOqdgi11Bq7+cHKEuDi3P2gCk8tqoVIB9D2V3B/YgXBxJtMQ88Ry2cQ/cDKCBKN/5VRdD7MyWjLQD1CciTHgj2hQK54ltQ9CSjqAwt5IJKjbYBMjKfVq1lSXTeyOlppq5P/QhxsRHKFZ1Pe2M31Dr5+aS1QYOtGAtdvgzPqW9gIrKx9rH9UALmaBZsQxwti6FUEAqHs5R0GYqYTVGuk1bL2r3PICPyizCbCw0PbIuMQS7SC7TAB4qtNNkK7e9nOIdl7FJYWIfk2orW8lmaUlowPPYMXARkKzKmVDl+34gDMJE8/RBHzk9/LYqNFvzVe29LW8fKfxlltABcJtFxO+c/i7inzmUo+4GzAEc7XkH3SC2YQapdqB806sfi2pBY+1p5iPOABjx2JW55g/GAkXd9FxAaHdZTAsxPHJztD5f095oQeYDWjJ5J1+eBwUqznkCF0DAG5SfH1ReIQha7Ethn3LeWK6pael3IogOmuMOdW7HUcu/JoeQdfe3oxAZ8bN8qvHy92EamgPI53UUDKwevkdpDg2pTOmdlTpFPv81GjfdrdKiXDZTa2qiyg1jnnNj8M8HBD4GYxMiy3K4eMFr2s4kj28CsYlXMeaaz2yYlhRgCQZma68p24HFyDsnNg82q1LtnGHeUjrDg=
file_glob: true
file: target/release/artifacts/*
skip_cleanup: true
on:
tags: true
condition: $TRAVIS_RUST_VERSION = stable
condition: "$TRAVIS_RUST_VERSION = stable"
repo: wtetzner/waterbear

23 changes: 23 additions & 0 deletions docs/directives.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ line.
* [bytes](#include-binary-data)
* [cpp](#include-c-header-file)
* [icon](#include-icon)
* [sprite](#include-sprite)
* [`.cnop` Directive](#cnop)
<!--te-->

Expand Down Expand Up @@ -227,6 +228,28 @@ Both `speed` and `eyecatch` are optional, e.g. you can use any of these variatio
If `speed` is omitted, a default value will be used. If `eyecatch` is
omitted, then an eyecatch image will not be included.

### Include Sprite

The VMU hardware doesn't have the concept of sprites, unlike other
well-known 2D gaming hardware. However, it is still a useful concept
when writing games.

An image file can be included in your ROM by using the
`.include sprite` directive.

```
.include sprite "images/character.png"
```

If you specify `type="masked"`, it will embed a transparency mask
along with the pixel data.

```
.include sprite "images/character.png" type="masked"
```

The sprite format is compatible with the format used by [LibPerspective](http://slum.online/dreamcast/).

.cnop
-----

Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ mod disasm;
mod env;
mod cheader;
pub mod img;
mod metadata;

use crate::disasm::DisasmError;
use crate::location::{Span};
Expand Down
31 changes: 31 additions & 0 deletions src/metadata.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

use serde::{Deserialize, Serialize};

#[derive(Debug,Clone,Deserialize,Serialize)]
pub struct Metadata {
labels: Vec<Label>,
variables: Vec<Variable>
}

#[derive(Debug,Clone,Deserialize,Serialize)]
pub struct Label {
name: String,
address: i32
}

#[derive(Debug,Clone,Deserialize,Serialize)]
pub struct Variable {
mnemonic: String,
name: Option<String>,
description: Option<String>,
address: i32,
bitfields: Vec<Bitfield>
}

#[derive(Debug,Clone,Deserialize,Serialize)]
pub struct Bitfield {
bit: u8,
mnemonic: String,
name: Option<String>,
description: Option<String>
}
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1268,7 +1268,7 @@ mod test {
let line = ".byte $44, $65, 0x32, 0b10110";
let stmt = parse_statement(line).expect("failed to parse statement");
let printed = format!("{}", stmt);
assert_eq!(".byte $44, $65, $32, %00010110", printed.trim());
assert_eq!(".byte $44,$65,$32,%00010110", printed.trim());
}

#[test]
Expand Down

0 comments on commit 8eea533

Please sign in to comment.