Name: Generic Clock (compatible) | ID: 0x12d0b402 | Version: 1
Interrupts do different things depending on contents of the A register:
A | BEHAVIOR |
---|---|
0 | The B register is read, and the clock will tick 60/B times per second. |
If B is 0, the clock is turned off. | |
1 | Store number of ticks elapsed since last call to 0 in C register |
2 | If register B is non-zero, turn on interrupts with message B. If B is zero, |
disable interrupts |
When interrupts are enabled, the clock will trigger an interrupt whenever it ticks.
Name: Mackapar 3.5" Floppy Drive (M35FD) | ID: 0x4fd524c5, version: 0x000b | Manufacturer: 0x1eb37e91 (MACKAPAR)
The Mackapar 3.5" Floppy Drive is compatible with all standard 3.5" 1440 KB floppy disks. The floppies need to be formatted in 16 bit mode, for a total of 737,280 words of storage. Data is saved on 80 tracks with 18 sectors per track, for a total of 1440 sectors containing 512 words each. The M35FD works is asynchronous, and has a raw read/write speed of 30.7kw/s. Track seeking time is about 2.4 ms per track.
A, B, C, X, Y, Z, I, J below refer to the registers on the DCPU
A: Behavior:
0 Poll device. Sets B to the current state (see below) and C to the last error since the last device poll.
1 Set interrupt. Enables interrupts and sets the message to X if X is anything other than 0, disables interrupts if X is 0. When interrupts are enabled, the M35FD will trigger an interrupt on the DCPU-16 whenever the state or error message changes.
2 Read sector. Reads sector X to DCPU ram starting at Y. Sets B to 1 if reading is possible and has been started, anything else if it fails. Reading is only possible if the state is STATE_READY or STATE_READY_WP. Protects against partial reads.
3 Write sector. Writes sector X from DCPU ram starting at Y. Sets B to 1 if writing is possible and has been started, anything else if it fails. Writing is only possible if the state is STATE_READY. Protects against partial writes.
0x0000 STATE_NO_MEDIA There's no floppy in the drive.
0x0001 STATE_READY The drive is ready to accept commands.
0x0002 STATE_READY_WP Same as ready, except the floppy is write protected.
0x0003 STATE_BUSY The drive is busy either reading or writing a sector.
0x0000 ERROR_NONE There's been no error since the last poll.
0x0001 ERROR_BUSY Drive is busy performing an action
0x0002 ERROR_NO_MEDIA Attempted to read or write with no floppy inserted.
0x0003 ERROR_PROTECTED Attempted to write to write protected floppy.
0x0004 ERROR_EJECT The floppy was removed while reading or writing.
0x0005 ERROR_BAD_SECTOR The requested sector is broken, the data on it is lost.
0xffff ERROR_BROKEN There's been some major software or hardware problem, try turning off and turning on the device again.
Name: Generic Keyboard (compatible) | ID: 0x30cf7406 | Version: 1
Interrupts do different things depending on contents of the A register:
A | BEHAVIOR |
---|---|
0 | Clear keyboard buffer |
1 | Store next key typed in C register, or 0 if the buffer is empty |
2 | Set C register to 1 if the key specified by the B register is pressed, or |
0 if it's not pressed | |
3 | If register B is non-zero, turn on interrupts with message B. If B is zero, |
disable interrupts |
When interrupts are enabled, the keyboard will trigger an interrupt when one or more keys have been pressed, released, or typed.
Key numbers are:
0x10: Backspace
0x11: Return
0x12: Insert
0x13: Delete
0x20-0x7f: ASCII characters
0x80: Arrow up
0x81: Arrow down
0x82: Arrow left
0x83: Arrow right
0x90: Shift
0x91: Control
Name: LEM1802 - Low Energy Monitor | ID: 0x7349f615, version: 0x1802 | Manufacturer: 0x1c6c8b36 (NYA_ELEKTRISKA)
The LEM1802 is a 128x96 pixel color display compatible with the DCPU-16. The display is made up of 32x12 16 bit cells. Each cell displays one monochrome 4x8 pixel character out of 128 available. Each cell has its own foreground and background color out of a palette of 16 colors.
The LEM1802 is fully backwards compatible with LEM1801 (0x7349f615/0x1801), and adds support for custom palettes and fixes the double buffer color bleed bug.
When a HWI is received by the LEM1802, it reads the A register and does one of the following actions:
0: MEM_MAP_SCREEN
Reads the B register, and maps the video ram to DCPU-16 ram starting
at address B. See below for a description of video ram.
If B is 0, the screen is disconnected.
When the screen goes from 0 to any other value, the the LEM1802 takes
about one second to start up. Other interrupts sent during this time
are still processed.
1: MEM_MAP_FONT
Reads the B register, and maps the font ram to DCPU-16 ram starting
at address B. See below for a description of font ram.
If B is 0, the default font is used instead.
2: MEM_MAP_PALETTE
Reads the B register, and maps the palette ram to DCPU-16 ram starting
at address B. See below for a description of palette ram.
If B is 0, the default palette is used instead.
3: SET_BORDER_COLOR
Reads the B register, and sets the border color to palette index B&0xF
4: MEM_DUMP_FONT
Reads the B register, and writes the default font data to DCPU-16 ram
starting at address B.
Halts the DCPU-16 for 256 cycles
5: MEM_DUMP_PALETTE
Reads the B register, and writes the default palette data to DCPU-16
ram starting at address B.
Halts the DCPU-16 for 16 cycles
The LEM1802 has no internal video ram, but rather relies on being assigned an area of the DCPU-16 ram. The size of this area is 384 words, and is made up of 32x12 cells of the following bit format (in LSB-0):
ffffbbbbBccccccc
The lowest 7 bits (ccccccc) select define character to display. ffff and bbbb select which foreground and background color to use. If B (bit 7) is set the character color will blink slowly.
The LEM1802 has a default built in font. If the user chooses, they may supply their own font by mapping a 256 word memory region with two words per character in the 128 character font. By setting bits in these words, different characters and graphics can be achieved. For example, the character F looks like this:
word0 = 1111111100001001
word1 = 0000100100000000
Or, split into octets:
word0 = 11111111 / 00001001
word1 = 00001001 / 00000000
The LEM1802 has a default built in palette. If the user chooses, they may supply their own palette by mapping a 16 word memory region with one word per palette entry in the 16 color palette. Each color entry has the following bit format (in LSB-0):
0000rrrrggggbbbb
Where r, g, b are the red, green and blue channels. A higher value means a lighter color.
A message from Ola:
Hello!
It is fun to see that so many people use our products. When I was a small
boy, my dad used to tell me "Ola, take care of those who understand less
than you. Lack of knowledge is dangerous, but too much is worse".
Here at Nya Elektriska have we always tried to improve mankind by showing
them the tools required to improve and reach their true potential.
Together, you will wake up in time.
- Ola Kristian Carlsson
Name: SPC2000 - Suspension Chamber 2000 | ID: 0x40e41d9d, version: 0x005e | Manufacturer: 0x1c6c8b36 (NYA_ELEKTRISKA)
=== WARNING WARNING WARNING WARNING
FERMIONS NEAR THE ACTIVATION RADIUS ARE CATASTROPHICALLY DESTROYED. DO NOT USE NEAR EARTH OR MARS OR ANY OTHER FUTURE EARTH COLONIES. DO NOT TAMPER WITH THE VACUUM DETECTOR. DO NOT USE IN AN INHOMOGENEOUS GRAVITATIONAL FIELD. DO NOT USE WHEN ROTATING. DO NOT USE WHEN ACCELERATING. ABSOLUTELY NO WARRANTY IS PROVIDED, USE AT YOUR OWN RISK. THE ZEF882 INCLUDED IN THIS SUSPENSION CHAMBER IS ILLEGAL IN ALL COUNTRIES.
=== WARNING WARNING WARNING WARNING
The SPC2000 is a deep sleep cell based on the ZEF882 time dilation field generator (available from Polytron Corporation Incorporated). It provides safe and nearly instantaneous time passage, making long journeys in space much easier on the passengers, and allowing cargo to reach its destination with minimal aging occurring. Due to the nature of the ZEF882, it affects the entire vessel (50 meter radius, and will only engage in a near vacuum. Once the SPC2000 is active, the vessel will be almost nowhere to an external observer, and detection of the vessel is beyond unlikely. Because of the strong extra-dimensional acceleration and non-linear temporal distortion that occurs, it's highly recommended that passengers are strapped in and asleep when triggering the SCP2000.
When a HWI is received by the SPC2000, it reads the A register and does one of the following actions:
0: GET_STATUS
Sets the C register to 1 if the SPC2000 is ready to trigger. If it's not,
the B register is set to one of the following values:
0x0000: ######################## - EVACUATE VESSEL IMMEDIATELY
0x0001: Not in a vacuum
0x0002: Not enough fuel
0x0003: Inhomogeneous gravitational field
0x0004: Too much angular momentum
0x0005: One or more cell doors are open
0x0006: Mechanical error
0xffff: Unknown error - EVACUATE VESSEL IMMEDIATELY
1: SET_UNIT_TO_SKIP
Reads the B register, and reads a 64 bit number from memory address B
in big endian, and sets the number of units to skip to that number.
2: TRIGGER_DEVICE
Performs GET_STATUS, and if C is 1, triggers the SCP2000. The status can
be read as the result of the GET_STATUS call.
3: SET_SKIP_UNIT
Reads the B register, and sets the size of the unit to skip to one of:
0x0000: Milliseconds
0x0001: Minutes
0x0002: Days
0x0003: Years
A message from Ola:
Good morning,
Thanks for purchasing this piece of hardware! I hope it will enlighten you
and give you new hope in life. As this suspension chamber basically works as
a one way time machine, I suppose I should wish you a pleasant journey, and
ask of you to enjoy the future. It is yours now. All of it.
- Ola Kristian Carlsson
Name: Mackapar Suspended Particle Exciter Display, Rev 3 (SPED-3) | ID: 0x42babf3c, version: 0x0003 | Manufactorer: 0x1eb37e91 (MACKAPAR)
The Mackapar Suspended Particle Exciter Display, Rev 3 ("the device") is a 3D vector display unit. Straight lines are drawn between consecutive vertices in a constant loop, with customizable colors per vertex. The effect is similar to a free floating 3D model. The area of the projected model is about 1x1x1 meters, and projection occurs 1.5 meters above the device. The emitters are capable to rotate around the Z axis at 50 degrees per second, allowing for easy animation of projected models. Up to 128 lines may be projected, but the more lines are projected, the more severe the flickering gets.
A, B, C, X, Y, Z, I, J below refer to the registers on the DCPU
A: Behavior:
0 Poll device. Sets B to the current state (see below) and C to the last error since the last device poll.
1 Map region. Sets the memory map offset to X, and the total number of vertices to render to Y. See below for the encoding information.
2 Rotate device. Sets the target rotation for the device to X%360 degrees.
Each vertex occupies two words of information in the main DCPU RAM. The data is encoded as (in LSB-0 format):
First word: YYYYYYYYXXXXXXXX
Second word: 00000ICCZZZZZZZZ
Where XXXXXXXX is the X-coordinate of the vertex, YYYYYYYY is the Y-coordinate, ZZZZZZZZ is the Z-coordinate, CC is color, and I is intensity. Z is deeper into the screen, if the device is placed face up on the ground, this translates to "up" relative to the user. Possible color values are 0: black, 1: red, 2: green, 3: blue. If the intensity bit is set, the color is drawn as more intense. The black color is meant to barely be visible at all, except for in very dim environments, or if the intensity bit is set.
0x0000 STATE_NO_DATA No vertices queued up, device is in stand-by
0x0001 STATE_RUNNING The device is projecting lines
0x0002 STATE_TURNING The device is projecting lines and turning
0x0000 ERROR_NONE There's been no error since the last poll.
0xffff ERROR_BROKEN There's been some major software or hardware problem, try turning off and turning on the device again.