[][src]Crate monotron_app

Monotron run-time application support for Rust.

You need to supply a function with this prototype, marked #[no_mangle] in your crate.

This example is not tested
#![no_std]
#![no_main]
extern crate monotron_app;
#[no_mangle]
pub extern "C" fn main() -> i32 {
    123
}

If you want to test your app on Linux, you'll need something like:

This example is not tested
#![cfg_attr(target_os = "none", no_std)]
#![cfg_attr(target_os = "none", no_main)]

use monotron_app::prelude::*;
use monotron_app::Host;

#[cfg(not(target_os = "none"))]
pub fn main() {
    std::process::exit(monotron_main());
}

#[no_mangle]
pub extern "C" fn monotron_main() -> i32 {
    write!(Host, "Hello, Rust!\n").unwrap();
    0
}

Modules

prelude

Useful things people should have in scope.

target

Implementation used when building code for Linux/Windows

Structs

Col

Represents a column on screen. Valid values are 0..=47.

Context

An internal representation of the context we're given by the Host.

Frequency

A frequency we can give to the synthesiser.

Host

Represents the Monotron we're running on. Can be passed to write! and friends.

JoystickState

Represents the current state of an Atari 9-pin joystick.

Row

Represents a row on screen. Valid values are 0..=36.

Table

The callbacks supplied by the Monotron OS.

Enums

Channel

A channel on the synthesiser. They all run concurrently.

Font

Represents a font we can set the screen to use. The whole screen uses the same font. Custom fonts must be exactly 4096 bytes (256 chars x 16 bytes/char) long.

Note

Notes on an piano keyboard, where A4 = 440 Hz.

Waveform

A waveform on the synthesiser. You can change this note by note.

Functions

_close

_close is required by newlib

_fstat

_fstat is required by newlib

_isatty

_isatty is required by newlib

_lseek

_lseek is required by newlib

_read

_read is required by newlib

_sbrk

_sbrk is required by newlib

_write

_write is required by newlib

deinit

C FFI for Host::deinit

font_normal

C FFI for Host::set_font

font_teletext

C FFI for Host::set_font

get_joystick

C FFI for Host::get_joystick

getchar

C FFI for Host::readc

getsize

C FFI for Host::getsize

init

C FFI for Host::init

joystick_fire_pressed

True if joystick is pointing right.

joystick_is_down

True if joystick is pointing down.

joystick_is_left

True if joystick is pointing left.

joystick_is_right

True if joystick is pointing right.

joystick_is_up

True if joystick is pointing up.

kbhit

C FFI for Host::kbhit

move_cursor

C FFI for Host::move_cursor

play

C FFI for Host::play

put_separated_sixel

Ugh

putchar

C FFI for Host::putchar

puts

C FFI for Host::puts

set_cursor_visible

C FFI for Host::set_cursor_visible

wfvbi

C FFI for Host::wfvbi