m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2018-05-26 21:49:47 +0200
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2018-05-26 21:49:47 +0200
commit3b8c536f437a6114c1653eb1635a84116c08e8f6 (patch)
tree2e388c54a0383890742db752fb0eeb7931d628e6
parentc5e76238315f07d5224949d4454658082db2a78f (diff)
Add missing headers
-rw-r--r--doomcode.h572
-rw-r--r--doomdev.h144
2 files changed, 716 insertions, 0 deletions
diff --git a/doomcode.h b/doomcode.h
new file mode 100644
index 0000000..4b2e9b7
--- /dev/null
+++ b/doomcode.h
@@ -0,0 +1,572 @@
+static const uint32_t doomcode[] = {
+ 0x12000000,
+ 0x12800000,
+ 0x12c00000,
+ 0x12a00000,
+ 0x12e00000,
+ 0x13000000,
+ 0x13200000,
+ 0x13c00000,
+ 0x0001f000,
+ 0x00fff00c,
+ 0x0a007f44,
+ 0x00140010,
+ 0x0003f000,
+ 0x00100008,
+ 0x0003f001,
+ 0x00100008,
+ 0x00100030,
+ 0x00100032,
+ 0x00100034,
+ 0x00100036,
+ 0x0010003a,
+ 0x0010003f,
+ 0x00100044,
+ 0x0010005b,
+ 0x0010005f,
+ 0x00100063,
+ 0x00100067,
+ 0x0010006e,
+ 0x00100075,
+ 0x00100077,
+ 0x00100079,
+ 0x0010007c,
+ 0x001000a3,
+ 0x001000c1,
+ 0x001000d1,
+ 0x0010013b,
+ 0x00100149,
+ 0x0010021c,
+ 0x0010000c,
+ 0x0010000c,
+ 0x0010000c,
+ 0x0010000c,
+ 0x0010000c,
+ 0x0010000c,
+ 0x00100081,
+ 0x00100083,
+ 0x00100085,
+ 0x0010007e,
+ 0x0007f001,
+ 0x00100008,
+ 0x0007f002,
+ 0x00100008,
+ 0x0009f001,
+ 0x00100008,
+ 0x0a007e85,
+ 0x0500000e,
+ 0x000bf001,
+ 0x00100008,
+ 0x0a007f01,
+ 0x0500000e,
+ 0x0b207c1f,
+ 0x0fc40000,
+ 0x00100008,
+ 0x0a007f01,
+ 0x0500000e,
+ 0x0b307c1f,
+ 0x0fc30000,
+ 0x00100008,
+ 0x0a007cc1,
+ 0x0500000e,
+ 0x0a007e85,
+ 0x0500000e,
+ 0x0a007c05,
+ 0x04000053,
+ 0x06020055,
+ 0x0a007d0b,
+ 0x04000057,
+ 0x10200800,
+ 0x01801059,
+ 0x0b807c05,
+ 0x0b907d0b,
+ 0x0007f003,
+ 0x00100008,
+ 0x0003f002,
+ 0x00100008,
+ 0x0003f004,
+ 0x00100008,
+ 0x0003f003,
+ 0x00100008,
+ 0x0003f005,
+ 0x00100008,
+ 0x0a007d41,
+ 0x0500000e,
+ 0x0009f002,
+ 0x00100008,
+ 0x0a007d11,
+ 0x0500000e,
+ 0x0bd07c1f,
+ 0x00100008,
+ 0x0a007c76,
+ 0x0500000e,
+ 0x09e07c02,
+ 0x00100008,
+ 0x0a007d60,
+ 0x0500000e,
+ 0x0a007ee2,
+ 0x0500000e,
+ 0x0b407c0a,
+ 0x0b507d8a,
+ 0x00100008,
+ 0x0a007d60,
+ 0x0500000e,
+ 0x0a007ee2,
+ 0x0500000e,
+ 0x0b607c0a,
+ 0x0b707d8a,
+ 0x00100008,
+ 0x0ba07c1f,
+ 0x00100008,
+ 0x0bb07c1f,
+ 0x00100008,
+ 0x0bc07c1f,
+ 0x000bf004,
+ 0x00100008,
+ 0x000bf005,
+ 0x00100008,
+ 0x0007f00a,
+ 0x000ff001,
+ 0x00100008,
+ 0x000ff002,
+ 0x00100008,
+ 0x000ff003,
+ 0x00100008,
+ 0x00040000,
+ 0x00100008,
+ 0x0a007f01,
+ 0x0500000e,
+ 0x0a307c0b,
+ 0x04180008,
+ 0x0a207d8b,
+ 0x04100008,
+ 0x1814ffe3,
+ 0x0a7000c5,
+ 0x01f0709b,
+ 0x18150002,
+ 0x0181909d,
+ 0x0a4050c4,
+ 0x1d270024,
+ 0x0842d40a,
+ 0x0848240b,
+ 0x0a60501f,
+ 0x08630c0b,
+ 0x0a02880b,
+ 0x19640000,
+ 0x00151000,
+ 0x0003f006,
+ 0x00100008,
+ 0x0003f007,
+ 0x00100008,
+ 0x0003f008,
+ 0x00100008,
+ 0x0003f009,
+ 0x00100008,
+ 0x00131087,
+ 0x1816ffe3,
+ 0x0a8000c5,
+ 0x01f0809f,
+ 0x18170002,
+ 0x018190a1,
+ 0x0a5058c4,
+ 0x1d480025,
+ 0x0852dc0a,
+ 0x0858280b,
+ 0x000f600b,
+ 0x055010b0,
+ 0x044810b9,
+ 0x00160000,
+ 0x00065006,
+ 0x00064004,
+ 0x000e6009,
+ 0x00160001,
+ 0x14a50020,
+ 0x14840020,
+ 0x0148b0b1,
+ 0x00100008,
+ 0x00160002,
+ 0x0866080b,
+ 0x0848080b,
+ 0x0858080b,
+ 0x00065007,
+ 0x00064005,
+ 0x000e600a,
+ 0x00100008,
+ 0x00131087,
+ 0x000fd004,
+ 0x044810cb,
+ 0x00160003,
+ 0x00064004,
+ 0x000e6007,
+ 0x00160004,
+ 0x14840020,
+ 0x0148b0c5,
+ 0x00100008,
+ 0x00160005,
+ 0x0866080b,
+ 0x0848080b,
+ 0x00064005,
+ 0x000e6008,
+ 0x00100008,
+ 0x0a007c19,
+ 0x0500000e,
+ 0x000fd004,
+ 0x1c540016,
+ 0x00c5f0d7,
+ 0x1c560014,
+ 0x1c750017,
+ 0x00c7f0da,
+ 0x1c770015,
+ 0x0186210d,
+ 0x00160006,
+ 0x01a960e2,
+ 0x0a40501f,
+ 0x0a50541f,
+ 0x0a60581f,
+ 0x25170015,
+ 0x001000e6,
+ 0x0a40581f,
+ 0x0a505c1f,
+ 0x0a60501f,
+ 0x25150017,
+ 0x18630003,
+ 0x1ce30002,
+ 0x18420002,
+ 0x0a90101f,
+ 0x0016000a,
+ 0x001000ef,
+ 0x0016000a,
+ 0x14840001,
+ 0x18e70003,
+ 0x01086101,
+ 0x008ff0ec,
+ 0x0a1010c4,
+ 0x0a0024c4,
+ 0x1c210020,
+ 0x0a0024c4,
+ 0x0802940a,
+ 0x08080405,
+ 0x00060004,
+ 0x0a002405,
+ 0x1c240029,
+ 0x0803040b,
+ 0x000e0007,
+ 0x15240001,
+ 0x18a50008,
+ 0x1ce70002,
+ 0x00160008,
+ 0x001000ec,
+ 0x0a1010c4,
+ 0x0a0024c4,
+ 0x1c210020,
+ 0x0a0024c4,
+ 0x0802940a,
+ 0x08080405,
+ 0x00060004,
+ 0x0a002405,
+ 0x1c240029,
+ 0x0803040b,
+ 0x000e0007,
+ 0x00100008,
+ 0x00160007,
+ 0x01ab7114,
+ 0x0a40501f,
+ 0x0a50541f,
+ 0x0a605c1f,
+ 0x25160014,
+ 0x00100118,
+ 0x0a40581f,
+ 0x0a505c1f,
+ 0x0a60541f,
+ 0x25140016,
+ 0x18420002,
+ 0x1ce20003,
+ 0x18630003,
+ 0x0a90141f,
+ 0x0016000b,
+ 0x00100121,
+ 0x0016000b,
+ 0x14a50001,
+ 0x18e70002,
+ 0x010a6131,
+ 0x008ff11e,
+ 0x1c250029,
+ 0x0a0010c4,
+ 0x0802a40a,
+ 0x0808040b,
+ 0x00060005,
+ 0x0a001005,
+ 0x0c060025,
+ 0x0806040b,
+ 0x000e0008,
+ 0x15250001,
+ 0x18840008,
+ 0x1ce70003,
+ 0x00160009,
+ 0x0010011e,
+ 0x1c250029,
+ 0x0a0010c4,
+ 0x0802a40a,
+ 0x0808040b,
+ 0x00060005,
+ 0x0a001005,
+ 0x0c060025,
+ 0x0806040b,
+ 0x000e0008,
+ 0x00100008,
+ 0x0a007c19,
+ 0x0500000e,
+ 0x000b9006,
+ 0x0a286005,
+ 0x0a32e40b,
+ 0x18630002,
+ 0x0a466005,
+ 0x0016000c,
+ 0x000ff00c,
+ 0x00062004,
+ 0x000e4007,
+ 0x14420020,
+ 0x01443143,
+ 0x00100008,
+ 0x01ab715f,
+ 0x00bc414f,
+ 0x00bc214d,
+ 0x00fc014f,
+ 0x000f2005,
+ 0x0fc40020,
+ 0x00bc3154,
+ 0x00bc0154,
+ 0x00fc1154,
+ 0x000f3006,
+ 0x0fc30020,
+ 0x11800000,
+ 0x11a00000,
+ 0x11e00000,
+ 0x0ae050c4,
+ 0x00fc015d,
+ 0x0016000e,
+ 0x0007f00a,
+ 0x000ff001,
+ 0x001001a7,
+ 0x0016000d,
+ 0x001001a7,
+ 0x0003f00a,
+ 0x00100008,
+ 0x0001f000,
+ 0x00fff1c8,
+ 0x0a007f44,
+ 0x00140165,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x00100185,
+ 0x001001c8,
+ 0x00100189,
+ 0x00100190,
+ 0x00100197,
+ 0x00100199,
+ 0x0010019b,
+ 0x0010019e,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001a0,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c8,
+ 0x001001c6,
+ 0x001001c8,
+ 0x0a007d11,
+ 0x050001c8,
+ 0x0bd07c1f,
+ 0x00100161,
+ 0x0a007d60,
+ 0x050001c8,
+ 0x0a007ee2,
+ 0x050001c8,
+ 0x0b407c0a,
+ 0x0b507d8a,
+ 0x00100161,
+ 0x0a007d60,
+ 0x050001c8,
+ 0x0a007ee2,
+ 0x050001c8,
+ 0x0b607c0a,
+ 0x0b707d8a,
+ 0x00100161,
+ 0x0ba07c1f,
+ 0x00100161,
+ 0x0bb07c1f,
+ 0x00100161,
+ 0x0bc07c1f,
+ 0x000bf004,
+ 0x00100161,
+ 0x000bf005,
+ 0x00100161,
+ 0x01ab71c8,
+ 0x047e61c8,
+ 0x0a0050c4,
+ 0x0140e1c8,
+ 0x019941c8,
+ 0x015941a7,
+ 0x01ead1c8,
+ 0x0ac0501f,
+ 0x0ad05c1f,
+ 0x0234f0cd,
+ 0x0238f133,
+ 0x023ef199,
+ 0x00fc01b0,
+ 0x0220f199,
+ 0x1c170035,
+ 0x22100640,
+ 0x144f0001,
+ 0x0823d005,
+ 0x0826d40b,
+ 0x186f002f,
+ 0x001311bd,
+ 0x10400000,
+ 0x0823d005,
+ 0x14170001,
+ 0x0826800b,
+ 0x186f004f,
+ 0x001311bd,
+ 0x15ef0001,
+ 0x00100161,
+ 0x041811c4,
+ 0x0a000c3e,
+ 0x02420000,
+ 0x01c221c4,
+ 0x02023000,
+ 0x0a30001f,
+ 0x001001bd,
+ 0x02043000,
+ 0x00151000,
+ 0x00040000,
+ 0x00100161,
+ 0x184f000f,
+ 0x10600000,
+ 0x10e00001,
+ 0x024c7000,
+ 0x02522000,
+ 0x1442ffff,
+ 0x19070007,
+ 0x019021da,
+ 0x02408000,
+ 0x011021d6,
+ 0x02428001,
+ 0x01c011d6,
+ 0x0a00041f,
+ 0x15080001,
+ 0x01d201da,
+ 0x02007000,
+ 0x0a70201f,
+ 0x001001ce,
+ 0x02127000,
+ 0x0a5019ab,
+ 0x041801ee,
+ 0x010a41ee,
+ 0x1ce50004,
+ 0x00bc01e8,
+ 0x0a00381f,
+ 0x0802900a,
+ 0x08081c0b,
+ 0x00060005,
+ 0x00087007,
+ 0x087c7821,
+ 0x000e7011,
+ 0x001001ee,
+ 0x0a00381f,
+ 0x0802900a,
+ 0x08081c0b,
+ 0x00060009,
+ 0x000c7002,
+ 0x000e700e,
+ 0x0a40141f,
+ 0x0a801806,
+ 0x0a7018e5,
+ 0x00bc0200,
+ 0x044001fc,
+ 0x024080cc,
+ 0x00080003,
+ 0x02408132,
+ 0x00080004,
+ 0x02408198,
+ 0x080b1c05,
+ 0x00080005,
+ 0x14630001,
+ 0x001001ca,
+ 0x00087006,
+ 0x1463ffff,
+ 0x051001ca,
+ 0x00100009,
+ 0x000e7010,
+ 0x04400211,
+ 0x02408198,
+ 0x08031c05,
+ 0x000c0001,
+ 0x14630001,
+ 0x051811ca,
+ 0x0a00381f,
+ 0x1425ffff,
+ 0x0528020b,
+ 0x10200000,
+ 0x0802840a,
+ 0x0c10002b,
+ 0x00060008,
+ 0x000e000f,
+ 0x000e7010,
+ 0x001001ca,
+ 0x1463ffff,
+ 0x051801ca,
+ 0x0a00381f,
+ 0x0802940a,
+ 0x014b9218,
+ 0x1439ffff,
+ 0x0802840a,
+ 0x0c10002b,
+ 0x00060008,
+ 0x051001ca,
+ 0x00100009,
+ 0x0a007c19,
+ 0x0500000e,
+ 0x01a96238,
+ 0x00bc4223,
+ 0x00fc2223,
+ 0x000f2005,
+ 0x0fc40020,
+ 0x00bc3227,
+ 0x00fc1227,
+ 0x000f3006,
+ 0x0fc30020,
+ 0x000ba002,
+ 0x000bb003,
+ 0x1c560034,
+ 0x000a2007,
+ 0x0a0050c4,
+ 0x0a1058c4,
+ 0x1c210020,
+ 0x0a0050c4,
+ 0x0802d40a,
+ 0x08080405,
+ 0x00060004,
+ 0x0a005005,
+ 0x0803080b,
+ 0x080c7821,
+ 0x000e000d,
+ 0x0016000f,
+ 0x00100008,
+ 0x0003f00b,
+ 0x00100008,
+};
diff --git a/doomdev.h b/doomdev.h
new file mode 100644
index 0000000..01f9961
--- /dev/null
+++ b/doomdev.h
@@ -0,0 +1,144 @@
+#ifndef DOOMDEV_H
+#define DOOMDEV_H
+
+#ifdef __KERNEL__
+#include <linux/kernel.h>
+#else
+#include <stdint.h>
+#endif
+
+#include <linux/ioctl.h>
+
+/* /dev/doom* ioctls. */
+
+struct doomdev_ioctl_create_surface {
+ uint16_t width;
+ uint16_t height;
+};
+
+struct doomdev_ioctl_create_texture {
+ uint64_t data_ptr;
+ uint32_t size;
+ uint16_t height;
+ uint16_t _pad;
+};
+
+struct doomdev_ioctl_create_flat {
+ uint64_t data_ptr;
+};
+
+struct doomdev_ioctl_create_colormaps {
+ uint64_t data_ptr;
+ uint32_t num;
+ uint32_t _pad;
+};
+
+#define DOOMDEV_IOCTL_CREATE_SURFACE _IOW('D', 0x00, struct doomdev_ioctl_create_surface)
+#define DOOMDEV_IOCTL_CREATE_TEXTURE _IOW('D', 0x01, struct doomdev_ioctl_create_texture)
+#define DOOMDEV_IOCTL_CREATE_FLAT _IOW('D', 0x02, struct doomdev_ioctl_create_flat)
+#define DOOMDEV_IOCTL_CREATE_COLORMAPS _IOW('D', 0x03, struct doomdev_ioctl_create_colormaps)
+
+struct doomdev_surf_ioctl_copy_rects {
+ uint64_t rects_ptr;
+ uint32_t surf_src_fd;
+ uint16_t rects_num;
+ uint16_t _pad;
+};
+
+struct doomdev_copy_rect {
+ uint16_t pos_dst_x;
+ uint16_t pos_dst_y;
+ uint16_t pos_src_x;
+ uint16_t pos_src_y;
+ uint16_t width;
+ uint16_t height;
+};
+
+struct doomdev_surf_ioctl_fill_rects {
+ uint64_t rects_ptr;
+ uint16_t rects_num;
+ uint16_t _pad[3];
+};
+
+struct doomdev_fill_rect {
+ uint16_t pos_dst_x;
+ uint16_t pos_dst_y;
+ uint16_t width;
+ uint16_t height;
+ uint8_t color;
+ uint8_t _pad;
+};
+
+struct doomdev_surf_ioctl_draw_lines {
+ uint64_t lines_ptr;
+ uint16_t lines_num;
+ uint16_t _pad[3];
+};
+
+struct doomdev_line {
+ uint16_t pos_a_x;
+ uint16_t pos_a_y;
+ uint16_t pos_b_x;
+ uint16_t pos_b_y;
+ uint8_t color;
+ uint8_t _pad;
+};
+
+struct doomdev_surf_ioctl_draw_background {
+ uint32_t flat_fd;
+};
+
+struct doomdev_surf_ioctl_draw_columns {
+ uint64_t columns_ptr;
+ uint32_t texture_fd;
+ uint32_t translations_fd;
+ uint32_t colormaps_fd;
+ uint16_t columns_num;
+ uint8_t draw_flags;
+ uint8_t translation_idx;
+};
+
+struct doomdev_column {
+ uint32_t texture_offset;
+ uint32_t ustart;
+ uint32_t ustep;
+ uint16_t y1;
+ uint16_t y2;
+ uint16_t x;
+ uint8_t colormap_idx;
+ uint8_t _pad;
+};
+
+struct doomdev_surf_ioctl_draw_spans {
+ uint64_t spans_ptr;
+ uint32_t flat_fd;
+ uint32_t translations_fd;
+ uint32_t colormaps_fd;
+ uint16_t spans_num;
+ uint8_t draw_flags;
+ uint8_t translation_idx;
+};
+
+struct doomdev_span {
+ uint32_t ustart;
+ uint32_t vstart;
+ uint32_t ustep;
+ uint32_t vstep;
+ uint16_t x1, x2;
+ uint16_t y;
+ uint8_t colormap_idx;
+ uint8_t _pad;
+};
+
+#define DOOMDEV_SURF_IOCTL_COPY_RECTS _IOW('D', 0x10, struct doomdev_surf_ioctl_copy_rects)
+#define DOOMDEV_SURF_IOCTL_FILL_RECTS _IOW('D', 0x11, struct doomdev_surf_ioctl_fill_rects)
+#define DOOMDEV_SURF_IOCTL_DRAW_LINES _IOW('D', 0x12, struct doomdev_surf_ioctl_draw_lines)
+#define DOOMDEV_SURF_IOCTL_DRAW_BACKGROUND _IOW('D', 0x13, struct doomdev_surf_ioctl_draw_background)
+#define DOOMDEV_SURF_IOCTL_DRAW_COLUMNS _IOW('D', 0x14, struct doomdev_surf_ioctl_draw_columns)
+#define DOOMDEV_SURF_IOCTL_DRAW_SPANS _IOW('D', 0x15, struct doomdev_surf_ioctl_draw_spans)
+
+#define DOOMDEV_DRAW_FLAGS_FUZZ 0x01
+#define DOOMDEV_DRAW_FLAGS_TRANSLATE 0x02
+#define DOOMDEV_DRAW_FLAGS_COLORMAP 0x04
+
+#endif