Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
wiki:conventions [2017/03/25 16:01] – [Casing] zdimensionwiki:conventions [2017/06/16 16:28] (current) zdimension
Line 12: Line 12:
 ===== Indentation ===== ===== Indentation =====
  
-Thou shalt in all your code use the Allman's style brace indentation (i.e. braces should always be on their own line, no matter if ''struct'', ''if'', ''while'', etc.)+Thou shalt in all of thy code let ye Allman's style brace indentation be used (i.e. braces should always be on their own line, no matter if ''struct'', ''if'', ''while'', etc.)
 <code cpp> <code cpp>
 struct MyStruct struct MyStruct
Line 43: Line 43:
 uint32_t* fieldName; uint32_t* fieldName;
 </code> </code>
 +
 +===== Bit fields =====
 +
 +==== Horizontal (long descriptions) ====
 +
 +=== 8-bit ===
 +
 +^ Hex ^ Bit ^ Description ^
 +^  ''0x0001'' ^  0 | text |
 +^  ''0x0002'' ^  1 | text |
 +^  ''0x0004'' ^  2 | text |
 +^  ''0x0008'' ^  3 | text |
 +^  ''0x0010'' ^  4 | {{:icons:tr4.png?nolink|TR4 only}} Example of double line |
 +^ ::: ^ ::: | {{:icons:tr5.png?nolink|TR5 only}} Example of double line |
 +^  ''0x0020'' ^  5 | text |
 +^  ''0x0040'' ^  6 | text |
 +^  ''0x0080'' ^  7 | text |
 +
 +=== 16-bit ===
 +
 +^ Hex ^ Bit ^ Description ^
 +^  ''0x0001'' ^  0 | text |
 +^  ''0x0002'' ^  1 | text |
 +^  ''0x0004'' ^  2 | text |
 +^  ''0x0008'' ^  3 | text |
 +^  ''0x0010'' ^  4 | {{:icons:tr4.png?nolink|TR4 only}} Example of double line |
 +^ ::: ^ ::: | {{:icons:tr5.png?nolink|TR5 only}} Example of double line |
 +^  ''0x0020'' ^  5 | text |
 +^  ''0x0040'' ^  6 | text |
 +^  ''0x0080'' ^  7 | text |
 +^  ''0x0100'' ^  8 | text |
 +^  ''0x0200'' ^  9 | text |
 +^  ''0x0400'' ^  10 | text |
 +^  ''0x0800'' ^  11 | text |
 +^  ''0x1000'' ^  12 | text |
 +^  ''0x2000'' ^  13 | text |
 +^  ''0x4000'' ^  14 | text |
 +^  ''0x8000'' ^  15 | text |
 +
 +==== Vertical (field names only) ====
 +
 +^ Hex value ^ ''%%0x8000%%'' ^ ''%%0x7F00%%'' ^^^^^^^ ^^^ ''%%0x001F%%'' ^^^^^
 +^ Bit ^ 15 ^ 14 ^ 13 ^ 12 ^ 11 ^ 10 ^ 9 ^ 8 ^ 7 ^ 6 ^ 5 ^ 4 ^ 3 ^ 2 ^ 1 ^ 0 ^
 +^ Field |  ''%%Field1%%''  |  ''%%Field2%%''  ||||||| |||  ''%%Field3%%''  |||||
wiki/conventions.1490457678.txt.gz · Last modified: 2017/03/25 16:01 by zdimension
Back to top
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0