v50 Steam/Premium information for editors
  • v50 information can now be added to pages in the main namespace. v0.47 information can still be found in the DF2014 namespace. See here for more details on the new versioning policy.
  • Use this page to report any issues related to the migration.
This notice may be cached—the current version can be found here.

User:Immibis/RAM

From Dwarf Fortress Wiki
< User:Immibis
Revision as of 05:25, 12 February 2010 by Immibis (talk | contribs) (Created page with 'Please note that the content of this page is (currently) only an idea and has not been tested. ==Space-efficient Random Access Memory== The basic idea is to have a grid of 1x1 c…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Please note that the content of this page is (currently) only an idea and has not been tested.

Space-efficient Random Access Memory

The basic idea is to have a grid of 1x1 cells that can hold some water (or magma). The specific cell to read/write would be selected by selecting the row and the column of the desired cell. This will require some complicated machinery to manage, however.

The overall layout is like this:

Z -1
x x x x    x = wall
x x x x    H = hatch
x x x x    All the hatches in a single (horizontal) row are connected to one pressure plate
x x x x
x x x x
x x x x
x x x x
Z 0       Z +1
xxxxxxx   xxxxxxx
xHxHxHx   x x x x
xxxxxxx   xxxxxxx
xHxHxHx   x x x x
xxxxxxx   xxxxxxx
xHxHxHx   x x x x
xxxxxxx   xxxxxxx

continued for a while in each direction.

The values would be stored in the cells on Z+1.

Notes:

  • The "desired column" means the column containing the cell to be read/written.
  • The "desired row" means the row containing the cell to be read/written.
  • "Flood XXX to ZZ" means to flood the area up to and including the Z-level ZZ.
  • "Drain XXX" means the area should not be flooded at all.

To read a cell:

  1. Flood all columns except the desired column to Z0. Flood the desired column to Z-1.
  2. Open the hatches in the desired row.
  3. If the cell contains water, the water will flow onto a pressure plate on Z0 of the column (not shown in the diagram)

This is a destructive read, so the data must be rewritten afterwards.

To write a 1 to a cell:

  1. Flood all columns except the desired column to Z0. Flood the desired column to Z1.
  2. Open the hatches in the desired row.
  3. Water will flow into the cell, if it isn't already there.

To write a 0 to a cell:

  1. Flood all columns except the desired column to Z0. Drain the desired column.
  2. Open the hatches in the desired row.
  3. Water will flow out of the cell, if it's there.