From d81a386479a044aa9b6acb801fa9cd01e26c59aa Mon Sep 17 00:00:00 2001 From: jwearnes Date: Tue, 8 May 2012 22:49:28 -0400 Subject: [PATCH] Addressed issue #7- documentation for the AU port- and went ahead and did the same for KY. --- Readme.txt | 2 +- docs/makoBasics.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Readme.txt b/Readme.txt index c5a5940..37df0a5 100644 --- a/Readme.txt +++ b/Readme.txt @@ -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. diff --git a/docs/makoBasics.md b/docs/makoBasics.md index 46952ef..fb57eea 100644 --- a/docs/makoBasics.md +++ b/docs/makoBasics.md @@ -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 --------