Skip to content

Commit

Permalink
Init workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
belen-albeza committed Jul 15, 2024
1 parent 4b8bb08 commit 56af1e6
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@ Cargo.lock

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb


# Added by cargo

/target
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[workspace]
resolver = "2"
members = ["coco-core"]
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# COCO-8

COCO-8 (or 👻-8) is a fantasy VM for games and creative coding. COCO-8 runs on Wasm and it's written in Rust.

COCO-8 is [made of these parts](./docs/architecture.md):

- `coco-core`, the virtual CPU. It is basically [Uxn](https://wiki.xxiivv.com/site/uxn.html), as _documented_ (COCO-8 follows the documented spec, not the reference implementation of Uxn).

- Devices, which interface with the CPU and provide input / output with peripherals or other systems (e.g. video, audio, controller input, etc.).

- A web-based GUI, for users to load and run COCO-8 roms.
6 changes: 6 additions & 0 deletions coco-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "coco-core"
version = "0.1.0"
edition = "2021"

[dependencies]
3 changes: 3 additions & 0 deletions coco-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# coco-core

This is the CPU part of COCO-8. It mimics the design of the [Uxn spec](https://wiki.xxiivv.com/site/uxn.html) and its [opcodes](https://wiki.xxiivv.com/site/uxntal_opcodes.html).
14 changes: 14 additions & 0 deletions coco-core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pub fn add(left: usize, right: usize) -> usize {
left + right
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn it_works() {
let result = add(2, 2);
assert_eq!(result, 4);
}
}
Binary file modified docs/coco8.excalidraw.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 56af1e6

Please sign in to comment.