Skip to content

Commit

Permalink
Addressed issue #7- documentation for the AU port- and went ahead and…
Browse files Browse the repository at this point in the history
… did the same for KY.
  • Loading branch information
JohnEarnest committed May 9, 2012
1 parent 6b963bb commit d81a386
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Readme.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Mako is a simple stack-based virtual game console, designed to be as simple as possible to implement. Maker is a compiler for a Forth-like language that targets the Mako VM.

Mako has two stacks- a parameter stack and a return stack. Most MakoVM instructions manipulate the top elements of the parameter stack. Instructions are normally a single word (signed 32-bit integer), but some (like JUMP and CALL) are followed by a second word which provides an argument. The Mako memory layout is controlled by a number of memory-mapped registers starting in the lowest address- 0. In addition to the program counter and stack pointers, Mako has registers which control a pixel-scrollable 30x40 grid of 8x8 background tiles, a set of 256 variable-size sprites and a random number generator.
Mako has two stacks- a parameter stack and a return stack. Most MakoVM instructions manipulate the top elements of the parameter stack. Instructions are normally a single word (signed 32-bit integer), but some (like JUMP and CALL) are followed by a second word which provides an argument. The Mako memory layout is controlled by a number of memory-mapped registers starting in the lowest address- 0. In addition to the program counter and stack pointers, Mako has registers which control a pixel-scrollable 31x41 grid of 8x8 background tiles, a set of 256 variable-size sprites, a random number generator, optional character I/O facilities for debugging and an 8-bit audio output port.

The Maker source files provided in the examples directory can be executed by compiling Maker and then invoking it with a filename and the '--run' flag. Without the flag, Maker will simply print a disassembly of the prepared Mako memory image.

Expand Down
4 changes: 4 additions & 0 deletions docs/makoBasics.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,10 @@ Mako uses a single, contiguous addressing space for memory. The first dozen or s

`CO` is a (possibly) bidirectional debug port. Writing a value to this address should print the corresponding ASCII character to stdout. Some implementations may also support reading from this register to grab input from stdin. The `Print.fs` and `String.fs` standard library files contain useful definitions for printing values and reading values with the debug port, respectively. When it doesn't make sense, or for simplicity, MakoVM implementations may choose to do nothing when this register is manipulated- as the name would suggest, it's mainly for debugging.

`AU` is an 8-bit, unsigned, mono, 8khz pipeline to the DSP, facilitating crude music and sound effects. Writing to this address will enqueue a sample which will be played at the VM's nearest convenience. Implementations may (and really probably should) supply their own buffering. Implementations are free to ignore the `AU` register if sound cannot be conveniently provided. `Game/Blip.fs` has several helpful code examples and utility routines for dealing with sound.

`KB` provides access to typed keyboard input. As the VM runs, keyboard characters are buffered in a FIFO queue. Reading from KB will pop the next ASCII character out of this queue, or return a -1 if no more characters are buffered. Characters will always reflect the modifiers depressed when the key is typed- for example, shift+A will result in a capital A (ASCII 65) and ctrl+C will result in ASCII 3. Implementations which cannot provide keyboard input capabilities should always return -1 when reading from this address.

The Grid
--------

Expand Down

0 comments on commit d81a386

Please sign in to comment.