Skip to content

Commit

Permalink
Merge pull request #13 from bakervm/release/0.3.0
Browse files Browse the repository at this point in the history
Release/0.3.0
  • Loading branch information
sphinxc0re authored Mar 16, 2018
2 parents 53c7c8a + 6b401c8 commit 8d92f40
Show file tree
Hide file tree
Showing 8 changed files with 143 additions and 143 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "melon"
version = "0.2.2"
version = "0.3.0"
authors = ["Julian Laubstein <[email protected]>"]
description = "A library for creating retro computing platforms"
repository = "https://github.com/bakervm/melon"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A library for creating retro computing platforms
[![dependency status][deps-image]][deps-link]

## Introduction
`melon` is like a virtual 16bit CPU. When building a retro computing platform e.g. a gaming console or old computer architecture, `melon` takes care of handling basic parts like stack management, calls or exception handling. Its most common interface, the `Shell` trait makes it possible to not only implement the CPU into any platform but makes it also really easy to extend the functionality of `melon`.
`melon` is like a virtual 16bit CPU. When building a retro computing platform e.g. a gaming console or old computer architecture, `melon` takes care of handling basic parts like stack management, calls or exception handling. Its most common interface, the `System` trait makes it possible to not only implement the CPU into any platform but makes it also really easy to extend the functionality of `melon`.

[deps-image]:https://deps.rs/repo/github/bakervm/melon/status.svg
[deps-link]: https://deps.rs/repo/github/bakervm/melon
Expand Down
2 changes: 1 addition & 1 deletion src/instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub enum Instruction {
Dup(IntegerType),
Drop(IntegerType),

Int(UInt),
SysCall(UInt),

Call(Address),
Ret,
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ mod instruction;
pub mod typedef;
mod vm;
mod program;
mod shell;
mod system;

pub use instruction::*;
pub use vm::*;
pub use program::*;
pub use shell::*;
pub use system::*;
4 changes: 2 additions & 2 deletions src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ use typedef::*;
pub struct Program {
/// The version of the VM API
pub core_version: String,
/// The ID of the Shell the program is compiled against
pub shell_id: String,
/// The ID of the System the program is compiled against
pub system_id: String,
/// The instuctions of the program
pub instructions: Vec<Instruction>,
/// (Optional) The number of allocated memory pages (1 page = 1024 Byte)
Expand Down
8 changes: 4 additions & 4 deletions src/shell.rs → src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ use typedef::*;

#[allow(unused_variables)]
/// An interface to communicate with the VM
pub trait Shell: Send {
/// A unique ID to identify the Shell
pub trait System: Send {
/// A unique ID to identify the System
const ID: &'static str;

/// Hook into the state after each cycle
Expand All @@ -40,8 +40,8 @@ pub trait Shell: Send {
Ok(())
}

/// React to the `Int` instruction and process the given signal
fn int(&mut self, vm: &mut VM, signal: UInt) -> Result<()> {
/// React to the `SysCall` instruction and process the given signal
fn system_call(&mut self, vm: &mut VM, signal: UInt) -> Result<()> {
Ok(())
}
}
Loading

0 comments on commit 8d92f40

Please sign in to comment.