# HG changeset patch # User Michael Pavone # Date 1472619869 25200 # Node ID 5f30c4d18d79e23b45570818c6cac35bfdb3e0df # Parent 9a3b9d86dabf8118ee1eaae67700f7efbe3555db Updated the HTML documentation a bit diff -r 9a3b9d86dabf -r 5f30c4d18d79 simple16.html --- a/simple16.html Tue Aug 30 21:27:33 2016 -0700 +++ b/simple16.html Tue Aug 30 22:04:29 2016 -0700 @@ -10,9 +10,9 @@

Simple 16

- Simple 16 is a toy 16-bit video game console designed with simplicity of implementation in mind. While it is technically a 16-bit system, - it's capabilites are in many ways closer to an 8-bit system. Ultimately, the hope is that Simple 16 is simple enough to provide an easy - introduction for the novice emudev while still containing all the essential features of an older game console. + Simple 16 is a toy 16-bit video game console designed with simplicity of implementation in mind. The hope is that + Simple 16 is simple enough to provide an easy introduction for the novice emudev while still containing all the + essential features of an older game console and providing sufficient capabilities to support compelling games.

Table of Contents

@@ -48,14 +48,17 @@

Overview

The Simple 16 CPU is a 16-bit RISC design. It has a main register file of 16 16-bit registers. Additionally, there are five special - purpose registers dedicated to exception processing. It has a flag 16-bit addres space. Instructions are a fixed size and are also 16-bits. + purpose registers dedicated to exception processing and an additional special register for holding the upper bits of the program counter. + It has a 23-bit addres space addressable with 16-bit offsets. Instructions are a fixed size and are also 16-bits.

Registers

- The first 14 registers in the main file have no fixed function and are named r0 through r13. r14 serves as the program counter and - points to the next instruction to be fetched. More information about instruction fetch and execution can be found in + The first 12 registers in the main file have no fixed function and are named r0 through r11. r12 holds the upper 8-bits of the + upper and lower data segments and is also named db. r13 holds the stack pointer and is also named sp. r14 serves as the program + counter and points to the next instruction to be fetched. More information about instruction fetch and execution can be found in Execution Details. r15 serves as the status register. The status register contains bits corresponding - to the result of the last arithmetic instruction and the interrupt mask. The layout of the status register is given below. + to the result of the last arithmetic instruction and the interrupt mask. It also contains the uppper 7-bits of the stack segment. + The layout of the status register is given below.

@@ -63,11 +66,16 @@ - + + + + + + @@ -128,6 +136,10 @@
  • cmpi IM, rD
  • reti rD
  • trapi IM
  • +
  • push rD
  • +
  • pop rD
  • +
  • getpch rD
  • +
  • setpch rD
  • getepc rD
  • setepc rD
  • getesr rD
  • @@ -787,19 +799,23 @@

    Flags: Updated corresponding to the value in ESR.

    -

    trap rD

    -

    - Causes an exception to be taken to the vector indicated by rD. -

    -

    - Flags: Condition code flags unchanged, interrupt enable bits cleared. -

    trapi IM

    Causes an exception to be taken to the vector indicated by IM

    +

    push rD

    - Flags: Condition code flags unchanged, interrupt enable bits cleared. + Pushes the value in register rD onto the stack. +

    +

    + Flags: Condition code flags unchanged. +

    +
    pop rD +

    + Pops a value of the stack and stores it in rD +

    +

    + Flags: Condition code flags unchanged.

    getepc rD

    @@ -874,9 +890,9 @@

    Video

    Overview

    - Simple 16 features a tile-based video processor using 8x8 pixel tiles. It supports a single background plane with a fixed width of 64 tiles and configurable height. - 64 sprites can be displayed simultaneously and 20 can be displayed on each line. Each sprite can either be 8x8 or 16x16 pixels and can use either of the first two - 16 color palettes. The background plane can make use of all 4 palettes. + Simple 16 features a simple linear framebuffer using indexed color. There is 128KB of VRAM arranged as two 64KB framebuffers. At any given time one buffer is used for + display and the other is accessible to the CPU. Both 4bpp and 8bpp depths are available. The resolution of the display is fixed at 320x240, but up to 31 lines can be + blanked at the top and bottom of the display to save on VRAM usage or to implement a letterbox effect.

    Audio

    Overview

    Use Notes
    15-515 Unused Should be set to zero.
    14-8Stack SegmentBits 8-14 of the 23-bit address for stack-relative load and stores
    4 Negative Flag Indicates the last result was negative.