aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/utils/crc.h
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-06-02 02:31:59 +0200
committerEinar Johan Trøan Sømåen2012-06-02 13:09:41 +0200
commitb02b3ebb217473f670570860d0914aee59b1e656 (patch)
treed69fdffaa04678a4dd705668287f3015b0359011 /engines/wintermute/utils/crc.h
parent221490a93df13fb6b17589c48c536c73ef6576b5 (diff)
downloadscummvm-rg350-b02b3ebb217473f670570860d0914aee59b1e656.tar.gz
scummvm-rg350-b02b3ebb217473f670570860d0914aee59b1e656.tar.bz2
scummvm-rg350-b02b3ebb217473f670570860d0914aee59b1e656.zip
WINTERMUTE: Add folders for utils and video
Diffstat (limited to 'engines/wintermute/utils/crc.h')
-rw-r--r--engines/wintermute/utils/crc.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/engines/wintermute/utils/crc.h b/engines/wintermute/utils/crc.h
new file mode 100644
index 0000000000..578b423de8
--- /dev/null
+++ b/engines/wintermute/utils/crc.h
@@ -0,0 +1,81 @@
+/**********************************************************************
+ *
+ * Filename: crc.h
+ *
+ * Description: A header file describing the various CRC standards.
+ *
+ * Notes:
+ *
+ *
+ * Copyright (c) 2000 by Michael Barr. This software is placed into
+ * the public domain and may be used for any purpose. However, this
+ * notice must not be changed or removed and no warranty is either
+ * expressed or implied by its publication or distribution.
+ **********************************************************************/
+
+#ifndef _crc_h
+#define _crc_h
+
+#ifndef TRUE
+#define FALSE 0
+#define TRUE !FALSE
+#endif
+
+/*
+ * Select the CRC standard from the list that follows.
+ */
+#define CRC32
+
+
+#if defined(CRC_CCITT)
+
+typedef unsigned short crc;
+
+#define CRC_NAME "CRC-CCITT"
+#define POLYNOMIAL 0x1021
+#define INITIAL_REMAINDER 0xFFFF
+#define FINAL_XOR_VALUE 0x0000
+#define REFLECT_DATA FALSE
+#define REFLECT_REMAINDER FALSE
+#define CHECK_VALUE 0x29B1
+
+#elif defined(CRC16)
+
+typedef unsigned short crc;
+
+#define CRC_NAME "CRC-16"
+#define POLYNOMIAL 0x8005
+#define INITIAL_REMAINDER 0x0000
+#define FINAL_XOR_VALUE 0x0000
+#define REFLECT_DATA TRUE
+#define REFLECT_REMAINDER TRUE
+#define CHECK_VALUE 0xBB3D
+
+#elif defined(CRC32)
+
+typedef unsigned long crc;
+
+#define CRC_NAME "CRC-32"
+#define POLYNOMIAL 0x04C11DB7
+#define INITIAL_REMAINDER 0xFFFFFFFF
+#define FINAL_XOR_VALUE 0xFFFFFFFF
+#define REFLECT_DATA TRUE
+#define REFLECT_REMAINDER TRUE
+#define CHECK_VALUE 0xCBF43926
+
+#else
+
+#error "One of CRC_CCITT, CRC16, or CRC32 must be #define'd."
+
+#endif
+
+void crcInit(void);
+crc crcSlow(unsigned char const message[], int nBytes);
+crc crcFast(unsigned char const message[], int nBytes);
+
+extern "C" crc crc_initialize(void);
+extern "C" crc crc_process_byte(unsigned char byte, crc remainder);
+extern "C" crc crc_finalize(crc remainder);
+
+
+#endif /* _crc_h */