📄 sector_private.h
字号:
/* $Id: sector_private.h,v 1.2 2004/04/11 12:20:32 miguelfreitas Exp $ Copyright (C) 2000 Herbert Valerio Riedel <hvr@gnu.org> (C) 1998 Heiko Eissfeldt <heiko@colossus.escape.de> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA*/#ifndef __VCD_CD_SECTOR_PRIVATE_H__#define __VCD_CD_SECTOR_PRIVATE_H__#define RS_L12_BITS 8 #define L2_RAW (1024*2) #define L2_Q (26*2*2) #define L2_P (43*2*2) typedef enum { MODE_0, MODE_2, MODE_2_FORM_1, MODE_2_FORM_2} sectortype_t;#define SYNC_LEN 12#define DATA_LEN 2336#define HEADER_LEN 4typedef struct { uint8_t sync[SYNC_LEN]; msf_t msf; uint8_t mode; uint8_t user_data[EMPTY_ARRAY_SIZE];} raw_cd_sector_t;#define raw_cd_sector_t_SIZEOF (SYNC_LEN+HEADER_LEN)typedef struct { uint8_t sync[SYNC_LEN]; msf_t msf; uint8_t mode;} sector_header_t;#define sector_header_t_SIZEOF (SYNC_LEN+HEADER_LEN)typedef struct { sector_header_t sector_header; uint8_t data[M2RAW_SECTOR_SIZE];} mode0_sector_t;#define mode0_sector_t_SIZEOF CDIO_CD_FRAMESIZE_RAWtypedef struct { sector_header_t sector_header; uint8_t subheader[CDIO_CD_SUBHEADER_SIZE]; uint8_t data[CDIO_CD_FRAMESIZE]; uint32_t edc; uint8_t l2_p[L2_P]; uint8_t l2_q[L2_Q];} mode2_form1_sector_t;#define mode2_form1_sector_t_SIZEOF CDIO_CD_FRAMESIZE_RAWtypedef struct { sector_header_t sector_header; uint8_t subheader[CDIO_CD_SUBHEADER_SIZE]; uint8_t data[M2F2_SECTOR_SIZE]; uint32_t edc;} mode2_form2_sector_t;#define mode2_form2_sector_t_SIZEOF CDIO_CD_FRAMESIZE_RAW/*****************************************************************//* *//* CRC LOOKUP TABLE *//* ================ *//* The following CRC lookup table was generated automagically *//* by the Rocksoft^tm Model CRC Algorithm Table Generation *//* Program V1.0 using the following model parameters: *//* *//* Width : 4 bytes. *//* Poly : 0x8001801BL *//* Reverse : TRUE. *//* *//* For more information on the Rocksoft^tm Model CRC Algorithm, *//* see the document titled "A Painless Guide to CRC Error *//* Detection Algorithms" by Ross Williams *//* (ross@guest.adelaide.edu.au.). This document is likely to be *//* in the FTP archive "ftp.adelaide.edu.au/pub/rocksoft". *//* *//*****************************************************************/static const uint32_t EDC_crctable[256] ={ 0x00000000U, 0x90910101U, 0x91210201U, 0x01B00300U, 0x92410401U, 0x02D00500U, 0x03600600U, 0x93F10701U, 0x94810801U, 0x04100900U, 0x05A00A00U, 0x95310B01U, 0x06C00C00U, 0x96510D01U, 0x97E10E01U, 0x07700F00U, 0x99011001U, 0x09901100U, 0x08201200U, 0x98B11301U, 0x0B401400U, 0x9BD11501U, 0x9A611601U, 0x0AF01700U, 0x0D801800U, 0x9D111901U, 0x9CA11A01U, 0x0C301B00U, 0x9FC11C01U, 0x0F501D00U, 0x0EE01E00U, 0x9E711F01U, 0x82012001U, 0x12902100U, 0x13202200U, 0x83B12301U, 0x10402400U, 0x80D12501U, 0x81612601U, 0x11F02700U, 0x16802800U, 0x86112901U, 0x87A12A01U, 0x17302B00U, 0x84C12C01U, 0x14502D00U, 0x15E02E00U, 0x85712F01U, 0x1B003000U, 0x8B913101U, 0x8A213201U, 0x1AB03300U, 0x89413401U, 0x19D03500U, 0x18603600U, 0x88F13701U, 0x8F813801U, 0x1F103900U, 0x1EA03A00U, 0x8E313B01U, 0x1DC03C00U, 0x8D513D01U, 0x8CE13E01U, 0x1C703F00U, 0xB4014001U, 0x24904100U, 0x25204200U, 0xB5B14301U, 0x26404400U, 0xB6D14501U, 0xB7614601U, 0x27F04700U, 0x20804800U, 0xB0114901U, 0xB1A14A01U, 0x21304B00U, 0xB2C14C01U, 0x22504D00U, 0x23E04E00U, 0xB3714F01U, 0x2D005000U, 0xBD915101U, 0xBC215201U, 0x2CB05300U, 0xBF415401U, 0x2FD05500U, 0x2E605600U, 0xBEF15701U, 0xB9815801U, 0x29105900U, 0x28A05A00U, 0xB8315B01U, 0x2BC05C00U, 0xBB515D01U, 0xBAE15E01U, 0x2A705F00U, 0x36006000U, 0xA6916101U, 0xA7216201U, 0x37B06300U, 0xA4416401U, 0x34D06500U, 0x35606600U, 0xA5F16701U, 0xA2816801U, 0x32106900U, 0x33A06A00U, 0xA3316B01U, 0x30C06C00U, 0xA0516D01U, 0xA1E16E01U, 0x31706F00U, 0xAF017001U, 0x3F907100U, 0x3E207200U, 0xAEB17301U, 0x3D407400U, 0xADD17501U, 0xAC617601U, 0x3CF07700U, 0x3B807800U, 0xAB117901U, 0xAAA17A01U, 0x3A307B00U, 0xA9C17C01U, 0x39507D00U, 0x38E07E00U, 0xA8717F01U, 0xD8018001U, 0x48908100U, 0x49208200U, 0xD9B18301U, 0x4A408400U, 0xDAD18501U, 0xDB618601U, 0x4BF08700U, 0x4C808800U, 0xDC118901U, 0xDDA18A01U, 0x4D308B00U, 0xDEC18C01U, 0x4E508D00U, 0x4FE08E00U, 0xDF718F01U, 0x41009000U, 0xD1919101U, 0xD0219201U, 0x40B09300U, 0xD3419401U, 0x43D09500U, 0x42609600U, 0xD2F19701U, 0xD5819801U, 0x45109900U, 0x44A09A00U, 0xD4319B01U, 0x47C09C00U, 0xD7519D01U, 0xD6E19E01U, 0x46709F00U, 0x5A00A000U, 0xCA91A101U, 0xCB21A201U, 0x5BB0A300U, 0xC841A401U, 0x58D0A500U, 0x5960A600U, 0xC9F1A701U, 0xCE81A801U, 0x5E10A900U, 0x5FA0AA00U, 0xCF31AB01U, 0x5CC0AC00U, 0xCC51AD01U, 0xCDE1AE01U, 0x5D70AF00U, 0xC301B001U, 0x5390B100U, 0x5220B200U, 0xC2B1B301U, 0x5140B400U, 0xC1D1B501U, 0xC061B601U, 0x50F0B700U, 0x5780B800U, 0xC711B901U, 0xC6A1BA01U, 0x5630BB00U, 0xC5C1BC01U, 0x5550BD00U, 0x54E0BE00U, 0xC471BF01U, 0x6C00C000U, 0xFC91C101U, 0xFD21C201U, 0x6DB0C300U, 0xFE41C401U, 0x6ED0C500U, 0x6F60C600U, 0xFFF1C701U, 0xF881C801U, 0x6810C900U, 0x69A0CA00U, 0xF931CB01U, 0x6AC0CC00U, 0xFA51CD01U, 0xFBE1CE01U, 0x6B70CF00U, 0xF501D001U, 0x6590D100U, 0x6420D200U, 0xF4B1D301U, 0x6740D400U, 0xF7D1D501U, 0xF661D601U, 0x66F0D700U, 0x6180D800U, 0xF111D901U, 0xF0A1DA01U, 0x6030DB00U, 0xF3C1DC01U, 0x6350DD00U, 0x62E0DE00U, 0xF271DF01U, 0xEE01E001U, 0x7E90E100U, 0x7F20E200U, 0xEFB1E301U, 0x7C40E400U, 0xECD1E501U, 0xED61E601U, 0x7DF0E700U, 0x7A80E800U, 0xEA11E901U, 0xEBA1EA01U, 0x7B30EB00U, 0xE8C1EC01U, 0x7850ED00U, 0x79E0EE00U, 0xE971EF01U, 0x7700F000U, 0xE791F101U, 0xE621F201U, 0x76B0F300U, 0xE541F401U, 0x75D0F500U, 0x7460F600U, 0xE4F1F701U, 0xE381F801U, 0x7310F900U, 0x72A0FA00U, 0xE231FB01U, 0x71C0FC00U, 0xE151FD01U, 0xE0E1FE01U, 0x7070FF00U,};static const uint16_t L2sq[43][256] = { { 0, 44719, 16707, 61420, 33414, 11305, 50117, 28010, 6417, 47038, 22610, 63229, 39831, 13624, 56020, 29819, 12834, 40077, 29537, 56782, 45220, 7691, 61927, 24392, 11059, 34204, 27248, 50399, 43445, 1818, 59638, 18009, 25668, 51947, 9479, 35752, 59074, 18541, 42881, 2350, 32085, 54266, 15382, 37561, 65491, 20860, 48784, 4159, 22118, 63689, 5925, 47498, 54496, 31311, 38307, 15116, 20343, 57816, 3636, 41115, 52721, 25438, 36018, 8733, 51336, 26151, 35275, 10084, 18958, 58529, 2893, 42466, 53657, 32566, 37082, 15989, 21279, 64944, 4700, 48371, 64170, 21509, 48105, 5446, 30764, 54915, 14703, 38848, 58299, 19732, 41720, 3159, 24893, 53138, 8318, 36561, 44236, 611, 60815, 17184, 11850, 32997, 28425, 49574, 46557, 7026, 62622, 23089, 14171, 39412, 30232, 55479, 40686, 12353, 57261, 28930, 7272, 45767, 23851, 62340, 34815, 10576, 50876, 26643, 1401, 43990, 17466, 60053, 36109, 9122, 52302, 25313, 3979, 41252, 20168, 57447, 37916, 15027, 54623, 31728, 5786, 47157, 22489, 63862, 48943, 4480, 65132, 20675, 15785, 37638, 31978, 53829, 42558, 2193, 59261, 18898, 9400, 35351, 26107, 52052, 59721, 18406, 43018, 1701, 27599, 50528, 10892, 33827, 61528, 24311, 45339, 8116, 29406, 56433, 13213, 40242, 56171, 30148, 39464, 13447, 23021, 63298, 6318, 46593, 49786, 27861, 33593, 11670, 16636, 61011, 447, 44816, 17797, 60202, 1222, 43625, 50947, 27052, 34368, 10479, 23700, 62011, 7639, 45944, 56850, 28861, 40785, 12798, 30631, 55560, 14052, 38987, 62753, 23438, 46178, 6861, 28342, 49177, 12277, 33114, 60464, 17055, 44403, 988, 8641, 36718, 24706, 52781, 41799, 3560, 57860, 19627, 14544, 38527, 31123, 55100, 47702, 5369, 64277, 21946, 5091, 48460, 21152, 64527, 37221, 16330, 53286, 32393, 2802, 42077, 19377, 58654, 34932, 9947, 51511, 26520, }, { 0, 55768, 44973, 30325, 17223, 39583, 60650, 13618, 34446, 24406, 10531, 61691, 50633, 7185, 27236, 46012, 4353, 51417, 48812, 26484,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -