Browse Source

* move database format description to separate file

master
Alex 'AdUser' Z 7 years ago
parent
commit
882e5cdbc9
  1. 27
      docs/database-format.md
  2. 27
      src/database.h

27
docs/database-format.md

@ -0,0 +1,27 @@
SIMDB version 2
===============
Database header format - fixed length, 48 bytes
Bits | Contents
------+------------------------------------------
0-15 : "IMDB vXX, CAPS: "
16-23 : capabilities, terminated with ';'
24-48 : padding with null's
Database record format - also fixed length, 48 bytes:
# | off | len | description
---+-----+-----+-------------------------------------------------------
1 | 0 | 1 | record is used
2 | 1 | 1 | overall level of color: R--
3 | 2 | 1 | overall level of color: -G-
4 | 3 | 1 | overall level of color: --B
5 | 4 | 2 | image width
6 | 6 | 2 | image height
- | 8 | 8 | reserved for future use
7 | 16 | 32 | bitmap, each 2 bytes is row of monochrome image 16x16
field | 12345 6 + 7
map | XRGBWWHH________MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
sect | [ 0-15 ][ 16-31 ][ 32-48 ]

27
src/database.h

@ -24,33 +24,6 @@
typedef struct _simdb_t simdb_t; /* opaque database type */
/**
Database header format - fixed length, 48 bytes
0-15 : "IMDB vXX, CAPS: "
16-23 : capabilities, terminated with ';'
24-48 : padding with null's
*/
/**
Database record format - fixed length, 48 bytes
# | off | len | description
---+-----+-----+-------------------------------------------------------
1 | 0 | 1 | record is used
2 | 1 | 1 | overall level of color: R--
3 | 2 | 1 | overall level of color: -G-
4 | 3 | 1 | overall level of color: --B
5 | 4 | 2 | image width
6 | 6 | 2 | image height
- | 8 | 8 | reserved for future use
7 | 16 | 32 | bitmap, each 2 bytes is row of monochrome image 16x16
field | 12345 6 + 7
map | XRGBWWHH________MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
sect | [ 0-15 ][ 16-31 ][ 32-48 ]
*/
#define REC_OFF_RU 0 /* record is used */
#define REC_OFF_CR 1 /* color level: red */
#define REC_OFF_CG 2 /* color level: green */

Loading…
Cancel
Save