📄 mktable.c
字号:
/* Copyright 1998-1999, ESS Technology, Inc. */
/* SCCSID @(#)mktable.c 1.118 10/20/98 */
/*
* $Log$
*/
/* Automatically generate:
const.h : all micro define and pointer define
const.dat: table data file
init_t.c : initial subroutine
constdat : const.dat's ascii file, which can be included
in init_t.c , if you define -DSRAM. This file
is generated only when you want your const.dat
merged into your .sun file.
*/
/* Automatically put all table data together, named const.dat.
* and generate one initial routine to initial array's data pointer.
* which is called by top.c. When add table in, pay attention:
* 1. put array name in the first field of the table array. This
name is the array name which you want to use in your function.
* 2. T_$(name) is defined as the initial value of the array.
* 3. T_$(name)_SZ define the array's size(byte)
* 4. put array's type in the last field of table array.
CHAR char UCHAR unsigned char
INT int UINT unsigned int
LONG long ULONG unsigned long
SHORT short USHORT unsigned short
* 5. All pointer in this table will be declared automatically
in const.h, and will be initialized in init_t.c.
So, when you use the pointer, just include "const.h",
and use it freely. The pointer should have been initialized
before you use it.
* 6. Don't use pointer[][].
*/
/*
* SERVO command tables was also included
*/
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#define PRIVATE static
#define SIZEOF(x) ((sizeof(x) & 3) ? ((sizeof(x) + 4) & ~3) : sizeof(x))
#define SIZE(x) ((x & 3) ? (x + 4) & ~3 : x)
#define MAX_TBL_NUM (sizeof(tables)/sizeof(tables[0]))
#define MKTABLE
#define ushort unsigned short
#define uchar unsigned char
/* define array 's type */
#define INT 1
#define SHORT 2
#define CHAR 3
#define LONG 4
#define USHORT 5
#define UCHAR 6
#define ULONG 7
#define UINT 8
#define FILTER_SET 9
#define OSDMESSAGE 10
#define FONT 11 /* Uncompressed OSD data (ushort) */
#define COMPFONTDATA 12 /* Compressed OSD data (uchar) */
#define COMPFONTCODE 13 /* Code table (uchar) */
#define COMPFONTOFFSET 14 /* Offset table (ushort) */
#include "wj.h"
#include "hufftab.h"
#include "xpucode.h"
#include "audio.h"
#include "vpucode.h"
#if (!S215 && !P315)
#ifdef CUST71
#include "smfont7.c"
#else
#include "smfont.c"
#endif /* CUST71 */
#else
#include "smfont1.c"
#endif
#include "dgs_fnt.c"
#include "bcdhex.c"
#if 0 /* for code cutting */
#ifdef CUST71
#include "volume.c"
#endif
#endif
#ifdef C80
#include "cdtbl.c"
#endif
#ifdef MPEG1
#ifdef PLAYONLY
#include "e1logos.c"
#else
#include "e1logo.c"
#endif /* PLAYONLY */
#else
#include "e2logo.c"
#endif /* MPEG1 */
#ifdef CUST4
#include "c4logo.c"
#endif
#ifdef NO_MICRO
#ifdef P315
#include "vfd_tbl1.c"
#else
#ifdef CUST6
#include "./cust6/const.c"
#include "vfd_tbl6.c"
#else
#ifdef CUST71
#include "vfd_tbl7.c"
#else
#ifdef CUSTDVD
#include "vfd_tbl8.c"
#else
#include "vfd_tbl.c"
#endif /* CUSTDVD */
#endif /* CUST71 */
#endif /* CUST6 */
#endif /* P315 */
#endif
#if (!NO_MICRO && CUST3 && VCDROM && SHARE_DATA)
#include "vfd_tbl.c"
#endif
#include "font30.c"
#include "ucode30.h"
#include "custfilt.c"
#if (CUST71 || CUSTDVD)
#include "osdmsg7.c"
#else
#include "osdmsg.c"
#endif
#include "misctbl.c"
#if (TCSERVO || (SERVO && (!SERVO2545)))
#include "servocmd.c"
#endif SERVO
/************************************************************************
* Imported functions *
************************************************************************/
extern void process_osd(int, int, int, unsigned int *, unsigned int *,
unsigned short *, unsigned short *);
/************************************************************************
* Imported variables *
************************************************************************/
extern unsigned short *osd_font,
*osd_cfont;
extern unsigned char * osd_comp_font;
extern int szCompFont, szCompCFont;
extern int szCodeBook;
extern unsigned char *code_book;
extern unsigned short * osd_offset_tbl;
extern int szOffsetTbl;
/************************************************************************
* Global variables *
************************************************************************/
int size_osd_font00 = sizeof(osd_font00);
int size_osd_cfont00 = sizeof(osd_cfont00);
/************************************************************************
* Local functions *
************************************************************************/
PRIVATE unsigned long write_long(unsigned long *data, long count, FILE *fp);
PRIVATE unsigned long write_short(unsigned short *data, long count, FILE *fp);
PRIVATE unsigned long write_char(unsigned char *data, long count, FILE *fp);
PRIVATE unsigned long write_osdmsg(OSDMSG *, int, FILE *);
PRIVATE void write_message_defines(OSDMSG *, int, FILE *);
PRIVATE unsigned long output_table(int tb, FILE *fp);
PRIVATE struct {
int genvar; /* 1 to generate variable; 0 to save DRAM */
char * name; /* Use to #define name of array
T_$(name) is used to define
array's initial pointer, and
T_$(name)_SZ define array's
size */
char * table; /* Use to #define pointer of array */
unsigned long size;
int type;
int entries; /* Only used by OSD messages. */
} tables[] = {
/***************************************************************************
Misc.
***************************************************************************/
{1, "MSG_array", (char *)osdmsg, 0, OSDMESSAGE,
sizeof(osdmsg)/sizeof(OSDMSG)},
{0, "dgs_font",(char *)dgs_font,sizeof(dgs_font), ULONG}, /* dgs_fnt.c */
{1, "hex2bcd", (char *) hex2bcd, sizeof(hex2bcd), USHORT},
{1, "bcd2hex", (char *) bcd2hex, sizeof(bcd2hex), USHORT},
{1, "ptrLshift", (char *) ptrLshift, sizeof(ptrLshift), USHORT},
#if (!NO_MICRO && CUST3 && VCDROM && SHARE_DATA)
{0, "VFD_key_tbl", (char *) VFD_KEY_TABLE, sizeof(VFD_KEY_TABLE), UCHAR},
#endif
#ifdef NO_MICRO
{0, "VFD_refresh_tbl", (char *) REFRESH_ADDRESS, sizeof(REFRESH_ADDRESS),
UCHAR},
{0, "VFD_key_tbl", (char *) VFD_KEY_TABLE, sizeof(VFD_KEY_TABLE), UCHAR},
{0, "IR_key_tbl", (char *) IR_KEY_TABLE, sizeof(IR_KEY_TABLE), UCHAR},
{0, "VFD_calendar_tbl", (char *) CALENDAR_TABLE, sizeof(CALENDAR_TABLE),
USHORT},
{0, "VFD_indicator_tbl", (char *) INDICATOR_TABLE, sizeof(INDICATOR_TABLE),
USHORT},
{0, "VFD_msg_tbl", (char *) MESSAGE_TABLE, sizeof(MESSAGE_TABLE), UCHAR},
{0, "VFD_digit_tbl", (char *) DIGIT_TABLE, sizeof(DIGIT_TABLE), UCHAR},
#endif
#if 0 /* for code cutting */
#ifdef CUST71
{1, "vcxVolume", (char *) VCX_VOLUME, sizeof(VCX_VOLUME), USHORT},
#endif
#endif
#ifdef CUST6
{0, "VFD_digit_tbl1", (char *) DIGIT_TABLE1, sizeof(DIGIT_TABLE1), UCHAR}, /*khjedit digit*/
{0, "VFD_r_disp_tbl", (char *) R_DISP_TABLE, sizeof(R_DISP_TABLE), UCHAR}, /*khjedit 1110_1 round display*/
{1,"ram_default_value", (char *) ram_default_value, sizeof(ram_default_value),UCHAR},
{1,"ram_address_value", (char *) ram_address_value, sizeof(ram_address_value),UCHAR},
{1,"cd_high_search_table",(char *) cd_high_search_table, sizeof(cd_high_search_table),
UCHAR},
#endif /* CUST6 */
#ifdef CUST4
{1, "filter_normal",(char *)filter_normal, sizeof(filter_normal), USHORT},
{1, "filter_soft",(char *)filter_soft, sizeof(filter_soft), USHORT},
#endif /* CUST4 */
{1, "filter_sharp",(char *)filter_sharp, sizeof(filter_sharp), USHORT},
{1, "filter_repeat",(char *)filter_repeat, sizeof(filter_repeat), USHORT},
#ifdef BF43
{1, "filter_bf43",(char *)filter_bf43, sizeof(filter_bf43), USHORT},
{1, "filter_uv_bf43",(char *)filter_uv_bf43, sizeof(filter_uv_bf43),
USHORT},
#endif
#ifdef SVCD
{0, "huffman_high_table_MPEG1",
(char *)huffman_high_table_MPEG1, sizeof(huffman_high_table_MPEG1), LONG},
{0, "huffman_high_table_MPEG2",
(char *)huffman_high_table_MPEG2, sizeof(huffman_high_table_MPEG2), LONG},
#else
{0, "huffman_high_table",
(char *)huffman_high_table, sizeof(huffman_high_table), LONG},
#endif
{0, "VP_ucode_offset1", (char *)VP_ucode_offset1, sizeof(VP_ucode_offset1),
USHORT},
{0, "VP_ucode_offset2", (char *)VP_ucode_offset2, sizeof(VP_ucode_offset2),
USHORT},
{0, "tdmsettings", (char*)tdmsettings, sizeof(tdmsettings), USHORT},
{1, "palette_std", (char*)palette_std, sizeof(palette_std), UCHAR},
#ifdef IR
{0, "IR_powerup_tbl", (char*)IR_powerup_tbl, sizeof(IR_powerup_tbl),
UINT},
#ifndef DSC_IRQ
{0, "IR_powerdn_tbl", (char*)IR_powerdn_tbl, sizeof(IR_powerdn_tbl),
UINT},
#endif
#ifdef DSC_IRQ_USETIMER2
{0, "IR_powerdn_tbl", (char*)IR_powerdn_tbl, sizeof(IR_powerdn_tbl),
UINT},
#endif
#endif
#ifdef SPATIAL
{1, "bp_ham", (char*)bp_ham, sizeof(bp_ham), UINT},
#endif /* SPATIAL */
#ifdef KARAOKE
{1, "vp_key_port", (char *)vp_key_port, sizeof(vp_key_port), INT},
#endif
#if (SERVO && (!SERVO2545))
{1, "mute_cmd", (char *) mute_cmd, sizeof(mute_cmd), UCHAR},
{1, "unmute_cmd", (char *) unmute_cmd, sizeof(unmute_cmd), UCHAR},
{1, "reset_cmd1", (char *) reset_cmd1, sizeof(reset_cmd1), UCHAR},
{1, "focus_cmd1", (char *) focus_cmd1, sizeof(focus_cmd1), UCHAR},
{1, "focus_cmd11", (char *) focus_cmd11, sizeof(focus_cmd11), UCHAR},
{1, "focus_cmd2", (char *) focus_cmd2, sizeof(focus_cmd2), UCHAR},
{1, "focus_cmd3", (char *) focus_cmd3, sizeof(focus_cmd3), UCHAR},
/*
* {1, "track_jump_time1", (char *) track_jump_time1,
* sizeof(track_jump_time1), UCHAR},
*/
{1, "track_jump_time16", (char *) track_jump_time16,
sizeof(track_jump_time16), UCHAR},
{1, "track_jump_time32", (char *) track_jump_time32,
sizeof(track_jump_time32), UCHAR},
{1, "track_jump_time64", (char *) track_jump_time64,
sizeof(track_jump_time64), UCHAR},
{1, "track_jump_time128", (char *) track_jump_time128,
sizeof(track_jump_time128), UCHAR},
{1, "track_jump_time240", (char *) track_jump_time240,
sizeof(track_jump_time240), UCHAR},
/*
* {1, "track_jump_in_cmd1", (char *) track_jump_in_cmd1,
* sizeof(track_jump_in_cmd1), UCHAR},
*/
/*
* {1, "track_jump_in_cmd16", (char *) track_jump_in_cmd16,
* sizeof(track_jump_in_cmd16), UCHAR},
* {1, "track_jump_in_cmd32", (char *) track_jump_in_cmd32,
* sizeof(track_jump_in_cmd32), UCHAR},
* {1, "track_jump_in_cmd64", (char *) track_jump_in_cmd64,
* sizeof(track_jump_in_cmd64), UCHAR},
* {1, "track_jump_in_cmd128", (char *) track_jump_in_cmd128,
* sizeof(track_jump_in_cmd128), UCHAR},
*/
{1, "track_jump_in_cmd240", (char *) track_jump_in_cmd240,
sizeof(track_jump_in_cmd240), UCHAR},
/*
* {1, "track_jump_out_cmd1", (char *) track_jump_out_cmd1,
* sizeof(track_jump_out_cmd1), UCHAR},
*/
/*
* {1, "track_jump_out_cmd16", (char *) track_jump_out_cmd16,
* sizeof(track_jump_out_cmd16), UCHAR},
* {1, "track_jump_out_cmd32", (char *) track_jump_out_cmd32,
* sizeof(track_jump_out_cmd32), UCHAR},
* {1, "track_jump_out_cmd64", (char *) track_jump_out_cmd64,
* sizeof(track_jump_out_cmd64), UCHAR},
* {1, "track_jump_out_cmd128", (char *) track_jump_out_cmd128,
* sizeof(track_jump_out_cmd128), UCHAR},
*/
{1, "track_jump_out_cmd240", (char *) track_jump_out_cmd240,
sizeof(track_jump_out_cmd240), UCHAR},
{1, "track_jump_cancelcmd", (char *) track_jump_cancelcmd,
sizeof(track_jump_cancelcmd), UCHAR},
{1, "clvon_cmd1", (char *) clvon_cmd1, sizeof(clvon_cmd1), UCHAR},
{1, "clvon_cmd2", (char *) clvon_cmd2, sizeof(clvon_cmd2), UCHAR},
{1, "clvon_cmd3", (char *) clvon_cmd3, sizeof(clvon_cmd3), UCHAR},
{1, "stop_cmd1", (char *) stop_cmd1, sizeof(stop_cmd1), UCHAR},
{1, "stop_cmd2", (char *) stop_cmd2, sizeof(stop_cmd2), UCHAR},
/*
* {1, "sled_in", (char *) sled_in, sizeof(sled_in), UCHAR},
* {1, "sled_out", (char *) sled_out, sizeof(sled_out), UCHAR},
* {1, "sled_stop", (char *) sled_stop, sizeof(sled_stop), UCHAR},
*
* {1, "test_cmd1", (char *) test_cmd1, sizeof(test_cmd1), UCHAR},
*/
#ifdef CMDINROM
{1, "track_jump_time1", (char *) track_jump_time1,
sizeof(track_jump_time1), UCHAR},
{1, "track_jump_in_cmd1", (char *) track_jump_in_cmd1,
sizeof(track_jump_in_cmd1), UCHAR},
{1, "track_jump_out_cmd1", (char *) track_jump_out_cmd1,
sizeof(track_jump_out_cmd1), UCHAR},
{1, "sled_in", (char *) sled_in, sizeof(sled_in), UCHAR},
{1, "sled_out", (char *) sled_out, sizeof(sled_out), UCHAR},
{1, "sled_stop", (char *) sled_stop, sizeof(sled_stop), UCHAR},
{1, "test_cmd1", (char *) test_cmd1, sizeof(test_cmd1), UCHAR},
#endif CMDINROM
#endif SERVO
#ifdef TCSERVO
{1, "TINIT_9432", (char *) TINIT_9432, sizeof(TINIT_9432), UINT},
{1, "TINIT9296EQ", (char *) TINIT9296EQ, sizeof(TINIT9296EQ), UINT},
{1, "AMinuteTrack", (char *) AMinuteTrack, sizeof(AMinuteTrack), UINT},
#endif TCSERVO
/***************************************************************************
VP ucode.
***************************************************************************/
#ifdef AC3
{1, "ac3both_ucode", (char *)ac3both_ucode, sizeof(ac3both_ucode), INT},
{1, "ac3shot_ucode", (char *)ac3shot_ucode, sizeof(ac3shot_ucode), INT},
{1, "ac3long_ucode", (char *)ac3long_ucode, sizeof(ac3long_ucode), INT},
{1, "fft64_ucode", (char *)fft64_ucode, sizeof(fft64_ucode), INT},
#endif
#ifdef MPEG2
{1, "m2vram2_ucode",(char *)m2vram2_ucode, sizeof(m2vram2_ucode), INT},
#endif
#ifdef MPEG1
#ifdef SVCD
{1, "m2vram2_ucode",(char *)m2vram2_ucode, sizeof(m2vram2_ucode), INT},
#endif
#ifdef ECHO_ANALOG_BYPASS
#ifdef ECHO_HALF
/* Analog by pass, MIC/2+CD/2 */
{0, "nonpage_ucode", (char *)nonpage4_ucode, sizeof(nonpage4_ucode), INT},
#else
/* Analog by pass, MIC+CD */
{0, "nonpage_ucode", (char *)nonpage3_ucode, sizeof(nonpage3_ucode), INT},
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -