본 글의 최신 내용은 http://www.hwport.com/wiki.php/Positive_and_Negative_filter 에서 보실수 있습니다.

MPEG TS 의 SectionFilter 를 구현하는데 있어서
Positive&Negative mask filter 알고리즘으로 적절한 H/W 적인 Filter와 유사한 동작을 구현할수 있게 됩니다.

여기서 Positive mask 는 주어진 data 와 mask 값을 AND연산후 comp 와 비교하는 일반적인 mask 동작으로 특정 비트패턴을 일치조건으로 취하는 동작입니다.
반면에 Negative mask 는 주어진 data 와 mask 값을 AND연산후 주어진 비트패턴이 주어진 comp 값과 다른 경우 일치조건으로 취하는 동작입니다.

Positive mask 는 특정 비트열을 통과시키는 용도로 구현되며
Negative mask 는 현재조건이 변경되는 시점을 통과시키는 용도로 구현되는것이죠.

아래의 예제가 충분할지는 모르겠지만 대략 다음과 같이 구현된다고 보시면 됩니다. 당연히 H/W 설계적인 관점에서도 가능한
구조로 되어 있습니다.

거의 기능상 구현으로 봤을때는 Positive mask 만 있으면 충분합니다.
하지만 불필요한 반복적인 data를 무시하지 않기 때문에 CPU가 과도하게 피곤해지겠죠.
Negative mask 는 이것을 방지하게 됩니다.

#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <unistd.h>

static __inline int __mzmatch_filter(const unsigned char *s_data, const unsigned char *s_mask, const unsigned char *s_mode, const unsigned char *s_comp, size_t s_size);
int mzmatch_filter(const void *s_data, const void *s_mask, const void *s_mode, const void *s_comp, size_t s_size);

static __inline int __mzmatch_filter(const unsigned char *s_data, const unsigned char *s_mask, const unsigned char *s_mode, const unsigned char *s_comp, size_t s_size)
{
    size_t s_offset = (size_t)0;
    unsigned char s_positive_mask, s_negative_mask;
    while(s_offset < s_size) {
        s_positive_mask = s_mask[s_offset] & s_mode[s_offset];
        s_negative_mask = s_mask[s_offset] & (~s_mode[s_offset]);
        if(((s_positive_mask & s_data[s_offset]) != (s_positive_mask & s_comp[s_offset])) ||
           ((s_negative_mask != ((unsigned char)0)) && ((s_negative_mask & (s_data[s_offset] ^ s_comp[s_offset])) == ((unsigned char)0)))) {
            return(0);
        }
        s_offset++;
    }
    return(1);
}

int mzmatch_filter(const void *s_data, const void *s_mask, const void *s_mode, const void *s_comp, size_t s_size)
{
    return(__mzmatch_filter((const unsigned char *)s_data, (const unsigned char *)s_mask, (const unsigned char *)s_mode, (const unsigned char *)s_comp, s_size));
}

void test(unsigned char s_mask, unsigned char s_mode, unsigned char s_comp)
{
    int s_match_condition;
    unsigned int s_data_min = 0x00u, s_data_max = 0xffu;
    (void)fprintf(stdout, "TEST => data=%02X~%02X mask=%02X mode=%02X comp=%02X",
        (unsigned int)s_data_min,
        (unsigned int)s_data_max,
        (unsigned int)s_mask,
        (unsigned int)s_mode,
        (unsigned int)s_comp
    );
    do {
        if((s_data_min % 0x10u) == 0x00u)(void)fputs("\n", stdout);
        s_match_condition = mzmatch_filter(&s_data_min, &s_mask, &s_mode, &s_comp, (size_t)1);
#if defined(__linux__) /* can use ansi code(escape sequence code) */
        (void)fprintf(stdout,
            " %s%02X\x1b[0m",
            (s_match_condition == 0) ? "\x1b[1;31m" : "\x1b[1;33m",
            (unsigned int)s_data_min);
#else
        if(s_match_condition != 0) {
            (void)fprintf(stdout,
                " %02X",
                (unsigned int)s_data_min);
        }
#endif
    }while((s_data_min++) < s_data_max);
    (void)fputs("\n", stdout);
}

int main(void)
{
    test(0xffu, 0xffu, 0x80u);
    test(0xffu, 0x00u, 0x80u);
    test(0xffu, 0xf9u, 0xceu);
    test(0xffu, 0xf0u, 0x24u);
    test(0x3fu, ~((unsigned char)0x3fu), 0x04u);
    /* TS filter */
    test(0xffu, 0xffu, 0x00u); /* PAT */
    test(0xffu, 0xffu, 0x01u); /* CAT */
    test(0xffu, 0xffu, 0x02u); /* PMT */
    test(0xffu, 0xffu, 0x3eu); /* DSM CC */
    test(0xfcu, 0xffu, 0x80u); /* ECM 0x80, 0x81, 0x82 */
    return(EXIT_SUCCESS);
}
크리에이티브 커먼즈 라이센스
Creative Commons License
2008/02/05 09:53 2008/02/05 09:53
받은 트랙백이 없고, 댓글 하나가 달렸습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/437

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/437

간혹 nsc 파일이란것을 접할 기회가 있을겁니다.
근데 그 안에 내용을 보면 이런식으로 암호문처럼 적혀 있을겁니다.

인용:
[Address]
....

[Description]
....

[Formats]
....

Description1=02PG000000000KRG1m06K0Pm0q02u0OG1p06O0000
....



이런식으로 <name>=<encode value> 로 열거되어 있을겁니다.
여기서 <encode value> 에 해당하는 문자열을 우리가 볼수 있는 형식으로 decode 하는 예제를 한번 만들어 봤습니다.

아래의 소스를 리눅스에서 test.c 로 저장후 아래와 같이 컴파일 하신후에 실행하시면 됩니다.

인용:
bash# gcc -o test test.c
bash# ./test 02PG000000000KRG1m06K0Pm0q02u0OG1p06O0000
Decode string="mpeg4.asf"
bash# _


코드:

/*
Copyright (C) Information Equipment co.,LTD.
All rights reserved.
Code by JaeHyuk Cho <mailto:minzkn@infoeq.com>
CVSTAG="$Header$"

filename="test.c"

 

Simple is best !


*/

#include <stdio.h>        /* fprintf */
#include <string.h>       /* strlen */
#include <netinet/in.h>   /* ntohl */

int main(int s_argc, char **s_argv)
{
static const unsigned char c_inverse_table[ /* 128 */ ] = {
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
  0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0xff, 0xff, 0xff, 0xff, 0xff,
  0xff, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32,
  0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0xff, 0x3f, 0xff, 0xff};
if(s_argc > 1)
{
  int s_encode_length = strlen(s_argv[1]), s_decode_length = (-1), s_index;
  unsigned char s_bit = 0, s_remain_bit, s_byte, s_temp[ 20 ], *s_byte_ptr = (unsigned char *)(&s_temp[0]), s_out[ 8 << 10 ];
  for(s_index = 2;s_index < s_encode_length;s_index++)
  {
   s_byte = c_inverse_table[(int)s_argv[1][s_index]] & ((unsigned char)0x3f);
   s_remain_bit = 8 - s_bit;
   if(s_remain_bit <= 6)
   {
    s_bit = 6 - s_remain_bit;
    *(s_byte_ptr) |= (s_byte >> s_bit);
    if((s_byte_ptr - ((unsigned char *)(&s_temp[0]))) == 9)
    {
     s_decode_length = (int)ntohl(*((unsigned long *)(s_byte_ptr - 4)));
     if(s_decode_length >= sizeof(s_out)){ s_decode_length = (-1); break; }
     *(s_out) = *(s_byte_ptr);
     s_byte_ptr = &s_out[0];
    }
    s_byte_ptr++;
    *(s_byte_ptr) = s_byte << (8 - s_bit);
   }
   else *(s_byte_ptr) = (s_byte << 2), s_bit = 6;
  }
  if(s_decode_length > 0)
  {
   (void)fprintf(stdout, "Decode string=\"\x1b[1;33m");
   for(s_index = 0;s_index < s_decode_length;s_index += 2)(void)fprintf(stdout, "%c", s_out[s_index]);
   (void)fprintf(stdout, "\x1b[0m\"\n");
  }
  else (void)fprintf(stdout, "Invalid value ! (result=%d)\n", s_decode_length);
}
else (void)fprintf(stdout, "usage: %s <nsc value>\n\texample: %s %s\n", s_argv[0], s_argv[0], "02PG000000000KRG1m06K0Pm0q02u0OG1p06O0000");
return(0);
}

/* End of source */



NSC 에서 실제 stream과 header 의 일치하는지를 판별하기 위한 key(packet id)를 얻어야 하는데 해당 key(packet id)를 얻는 부분을 추가한 소스입니다..


코드:
/*
 Copyright (C) Information Equipment co.,LTD.
 All rights reserved.
 Code by JaeHyuk Cho <mailto:minzkn@infoeq.com>
 CVSTAG="$Id$"

 Simple is best !
*/

#include <sys/types.h>
#include <stdio.h>
#include <string.h>
#include <netinet/in.h>
#include <unistd.h>
#include <fcntl.h>

int main(int s_argc, char **s_argv)
{
 static const unsigned char c_inverse_table[ /* 128 */ ] = {
  /* 0x00 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  /* 0x10 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  /* 0x20 */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  /* 0x30 */ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
  /* 0x40 */ 0xff, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18,
  /* 0x50 */ 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0xff, 0xff, 0xff, 0xff, 0xff,
  /* 0x60 */ 0xff, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 0x32,
  /* 0x70 */ 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0xff, 0x3f, 0xff, 0xff
 };
 if(s_argc > 1)
 {
  int s_arg_index;
  for(s_arg_index = 1;s_arg_index < s_argc;s_arg_index++)
  {
   int s_encode_length = (int)strlen(s_argv[s_arg_index]), s_decode_length = (-1), s_index;
   unsigned char s_bit = 0, s_remain_bit, s_byte, s_temp[ 20 ], *s_byte_ptr = (unsigned char *)(&s_temp[0]), s_out[ 8 << 10 ];
   unsigned long s_decode_key = 0lu;
   for(s_index = 2;s_index < s_encode_length;s_index++)
   {
    s_byte = c_inverse_table[(int)s_argv[s_arg_index][s_index]] & ((unsigned char)0x3f);
    s_remain_bit = 8 - s_bit;
    if(s_remain_bit <= 6)
    {
     s_bit = 6 - s_remain_bit;
     *(s_byte_ptr) |= (s_byte >> s_bit);
     if((s_byte_ptr - ((unsigned char *)(&s_temp[0]))) == 5)
     { /* decode key (packet id) */
      s_decode_key = (unsigned long)ntohl(*((unsigned long *)(s_byte_ptr - 4)));
     }
     else if((s_byte_ptr - ((unsigned char *)(&s_temp[0]))) == 9)
     { /* body */
      s_decode_length = (int)ntohl(*((unsigned long *)(s_byte_ptr - 4)));
      if(s_decode_length >= sizeof(s_out)){ s_decode_length = (-1); break; }
      *(s_out) = *(s_byte_ptr);
      s_byte_ptr = &s_out[0];
     }
     s_byte_ptr++;
     *(s_byte_ptr) = s_byte << (8 - s_bit);
    }
    else *(s_byte_ptr) = (s_byte << 2), s_bit = 6;
   }
   if(s_decode_length > 0)
   {
#if 0
    int s_handle;
    s_handle = open("dump.bin", O_WRONLY | O_CREAT | O_TRUNC, 0644);
    if(s_handle != (-1))
    {
     (void)write(s_handle, (void *)(&s_out[0]), (size_t)s_decode_length);
     close(s_handle);
    }
#endif
    (void)fprintf(stdout, "Decode string[key=%04lXH]=\"\x1b[1;33m", s_decode_key & 0xfffflu);
    for(s_index = 0;s_index < s_decode_length;s_index += 2)(void)fprintf(stdout, "%c", s_out[s_index]);
    (void)fprintf(stdout, "\x1b[0m\"\nDecode length = %d", s_decode_length);
   }
   else (void)fprintf(stdout, "Invalid value ! (result=%d)\n", s_decode_length);
  }
 }
 else (void)fprintf(stdout, "usage: %s <nsc value> [...]\n\texample: %s %s\n", s_argv[0], s_argv[0], "02PG000000000KRG1m06K0Pm0q02u0OG1p06O0000");
 return(0);
}

/* End of source */
크리에이티브 커먼즈 라이센스
Creative Commons License
2007/06/02 00:44 2007/06/02 00:44
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/175

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/175

사용자 삽입 이미지


Frame buffer의 구조 및 그래픽의 기본적인 각도 계산 및 재귀호출, 베지어곡선의 수학개념을 이해하기 위해서 만들어 본겁니다.
lilo.conf 에 "vga=0x0317" 이라는 옵션을 주고 해보세요.

코드:

/*
  Copyright (C) Information Equipment co.,LTD
  All rights reserved.
  Code by JaeHyuk Cho <mailto:minzkn@infoeq.com>
  CVSTAG="$Header$"
*/

#include <sys/types.h>
#include <sys/select.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>
#include <math.h>
#include <signal.h>

#include <linux/fb.h>

#define DEF_2PI (2.0 * 3.14159265358)

static int                        g_FB_Handle, g_FB_Cx, g_FB_Cy, g_FB_ScreenSize;
static struct fb_fix_screeninfo   g_FB_FIX;
static struct fb_var_screeninfo   g_FB_VAR;
static void                      *g_FB_Map;
static void (*DrawPixel)(int, int, int);

volatile int g_break_clock = 0;

static void clock_signal(int s_signal)
{
 g_break_clock = 1;
 (void)signal(s_signal, clock_signal);
}

static void (clock_load_balance)(void)
{
#if 1
 struct timeval s_timeval = {0l, 1000000l / 100l /* hz */};
 (void)select(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, (struct timeval *)(&s_timeval));
#endif
}

static void DrawPixel8(int s_Color, int s_x, int s_y)
{
 *(((unsigned char *)g_FB_Map) + (s_y * g_FB_FIX.line_length) + s_x) = (unsigned char)s_Color;
}

static void DrawPixel16(int s_Color, int s_x, int s_y)
{
 *((unsigned short *)(((unsigned char *)g_FB_Map) + (s_y * g_FB_FIX.line_length) + (s_x << 1))) = (unsigned short)s_Color;
}

static void DrawPixel24(int s_Color, int s_x, int s_y)
{
 unsigned char *s_FB_Ptr = ((unsigned char *)g_FB_Map) + (s_y * g_FB_FIX.line_length) + ((s_x << 1) + s_x);
 *((unsigned short *)s_FB_Ptr) = (unsigned short)s_Color;
 *(s_FB_Ptr + sizeof(unsigned short)) = (unsigned char)(s_Color >> 16);
}

static void DrawPixel32(int s_Color, int s_x, int s_y)
{
 *((unsigned long *)(((unsigned char *)g_FB_Map) + (s_y * g_FB_FIX.line_length) + (s_x << 2))) = (unsigned long)s_Color;
}

static void PinXY(int s_Angle, int *s_x, int *s_y, int s_r)
{ /* s_To(Grid) : X = s_From(Grid) : s_Current */
 double s_Value = ((DEF_2PI * (double)(s_Angle % 360)) / 360.0);
 *(s_x) = (int)(sin(s_Value) * s_r); *(s_y) = (int)(-cos(s_Value) * s_r);
}

static void __DrawLine__(int s_Color, float s_x1, float s_y1, float s_x2, float s_y2, int s_Level)
{ /* Call by call level 16 optimize draw line : JaeHyuk algorithm ^^ */
 float s_cx = (s_x1 + s_x2) / 2.0, s_cy = (s_y1 + s_y2) / 2.0;
 if(((int)s_x1 == (int)s_x2 && (int)s_y1 == (int)s_y2) || s_Level > 16)DrawPixel(s_Color, (int)s_cx, (int)s_cy);
 else
 {
  s_Level++;
  __DrawLine__(s_Color, s_x1, s_y1, s_cx, s_cy, s_Level); __DrawLine__(s_Color, s_cx, s_cy, s_x2, s_y2, s_Level);
 }
}

static void DrawLine(int s_Color, int s_x1, int s_y1, int s_x2, int s_y2)
{
 __DrawLine__(s_Color, (float)s_x1, (float)s_y1, (float)s_x2, (float)s_y2, 0);
}

static void DrawCircle(int s_Color, int s_x, int s_y, int s_r)
{
 double s_Pi, s_Grid = 1.0 / ((double)s_r), s_sinX, s_cosY;
 for(s_Pi = 0.0;s_Pi < (DEF_2PI / 4.0);s_Pi += s_Grid)
 {
  s_sinX = sin(s_Pi) * (double)s_r; s_cosY = -cos(s_Pi) * (double)s_r;
  DrawPixel(s_Color, (int)(s_x + s_sinX), (int)(s_y + s_cosY));
  DrawPixel(s_Color, (int)(s_x - s_sinX), (int)(s_y + s_cosY));
  DrawPixel(s_Color, (int)(s_x + s_sinX), (int)(s_y - s_cosY));
  DrawPixel(s_Color, (int)(s_x - s_sinX), (int)(s_y - s_cosY));
 }
}

static void Pin(int s_Color, int s_Angle, int s_Type)
{
 int s_x1, s_y1, s_x2, s_y2, s_x3, s_y3;
 int s_Size;
 s_Size = g_FB_ScreenSize >> 1;
 if(s_Type == 0)       s_Size -= ((g_FB_ScreenSize >> 1) >> 3);
 else if(s_Type == 10) s_Size -= ((g_FB_ScreenSize >> 1) >> 3);
 else if(s_Type == 20) s_Size -= ((g_FB_ScreenSize >> 1) >> 2);
 PinXY(s_Angle, &s_x1, &s_y1, s_Size >> 2); PinXY(s_Angle, &s_x2, &s_y2, s_Size);
 DrawLine(s_Color, g_FB_Cx - s_x1, g_FB_Cy - s_y1, g_FB_Cx + s_x2, g_FB_Cy + s_y2);
 if(s_Type > 0)
 {
  PinXY(s_Angle +  90, &s_x3, &s_y3, s_Type);
  DrawLine(s_Color, g_FB_Cx - s_x1, g_FB_Cy - s_y1, g_FB_Cx + s_x3, g_FB_Cy + s_y3);
  DrawLine(s_Color, g_FB_Cx + s_x2, g_FB_Cy + s_y2, g_FB_Cx + s_x3, g_FB_Cy + s_y3);
  DrawLine(s_Color, g_FB_Cx - s_x1, g_FB_Cy - s_y1, g_FB_Cx - s_x3, g_FB_Cy - s_y3);
  DrawLine(s_Color, g_FB_Cx + s_x2, g_FB_Cy + s_y2, g_FB_Cx - s_x3, g_FB_Cy - s_y3);
 }
}

int main(int s_argc, char **s_argv)
{
 (void)signal(SIGINT, clock_signal);
 printf("fbclock v1.0.1 - Code by JaeHyuk Cho <minzkn@infoeq.co.kr>\n\n");
 g_FB_Handle = open(s_argc >= 2 ? s_argv[1] : "/dev/fb0", O_RDWR);
 if(g_FB_Handle >= 0)
 {
  if(ioctl(g_FB_Handle, FBIOGET_FSCREENINFO, &g_FB_FIX) == 0)
  {
   if(ioctl(g_FB_Handle, FBIOGET_VSCREENINFO, &g_FB_VAR) == 0)
   {
    g_FB_Map = mmap((void *)0, g_FB_FIX.line_length * g_FB_VAR.yres, PROT_READ | PROT_WRITE, MAP_SHARED, g_FB_Handle, 0);
    if(g_FB_Map != (void *)(-1))
    {
     switch(g_FB_VAR.bits_per_pixel)
     {
      case  8: DrawPixel = DrawPixel8;  break;
      case 16: DrawPixel = DrawPixel16; break;
      case 24: DrawPixel = DrawPixel24; break;
      case 32: DrawPixel = DrawPixel32; break;
      default: DrawPixel = (void *)0;   break;
     }
     g_FB_Cx = g_FB_VAR.xres >> 1; g_FB_Cy = g_FB_VAR.yres >> 1;
     g_FB_ScreenSize = g_FB_VAR.xres < g_FB_VAR.yres ? g_FB_VAR.xres : g_FB_VAR.yres;
     if(DrawPixel)
     {
      int s_PreSecond = 0, s_PreMinute = 0, s_PreHour = 0, s_Count, s_Index, s_x, s_y;
      time_t s_UTC;
      struct tm *s_LocalTime;
      s_Count = 0;
      do
      {
       s_UTC = time((time_t *)0);
       s_LocalTime = localtime(&s_UTC);
       if(s_LocalTime->tm_sec != s_PreSecond)
       {
        if(s_LocalTime->tm_min != s_PreMinute)
        {
         if(s_LocalTime->tm_hour != s_PreHour)
         {
          Pin(0, s_PreHour * 30, 20);
          s_PreHour = s_LocalTime->tm_hour;
         }
         Pin(0, s_PreMinute * 6, 10);
         s_PreMinute = s_LocalTime->tm_min;
        }
        Pin(0, s_PreSecond * 6, 0);
        Pin(0xf00f, s_LocalTime->tm_hour * 30, 20);
        Pin(0x0ff0, s_LocalTime->tm_min  *  6, 10);
        Pin(0xffff, s_LocalTime->tm_sec  *  6, 0);
        DrawCircle(0x0fff, g_FB_Cx, g_FB_Cy, 5);
        s_PreSecond = s_LocalTime->tm_sec;
       }
       do
       {
        int s_tick;
        for(s_tick = 0;s_tick < 10;s_tick++)clock_load_balance();
       }while(0);
       PinXY(s_Count, &s_x, &s_y, (g_FB_ScreenSize >> 1) - (g_FB_ScreenSize >> 5));
       s_Index = (s_Count % 30) ? 5 : 10;
       DrawCircle(0xffff, g_FB_Cx + s_x, g_FB_Cy + s_y, s_Index);
       DrawCircle(0xffff, g_FB_Cx - s_x, g_FB_Cy + s_y, s_Index);
       DrawCircle(0xffff, g_FB_Cx + s_x, g_FB_Cy - s_y, s_Index);
       DrawCircle(0xffff, g_FB_Cx - s_x, g_FB_Cy - s_y, s_Index);
       s_Count+=6;
       if(s_Count > 90)s_Count = 0;
      }while(g_break_clock == 0);
     }
     else fprintf(stderr, "Err: %d\n", __LINE__);
     munmap(g_FB_Map, g_FB_FIX.line_length * g_FB_VAR.yres);
    }
    else fprintf(stderr, "Err: %d\n", __LINE__);
   }
   else fprintf(stderr, "Err: %d\n", __LINE__);
  }
  else fprintf(stderr, "Err: %d\n", __LINE__);
  close(g_FB_Handle);
 }
 else fprintf(stderr, "Err: %d\n", __LINE__);
 (void)fprintf(stdout, "End of clock\n");
 return(0);
}

/* vim: set expandtab: */
/* End of source */




Marius Konitzer 씨가 예전에 만들었던 fbclock을 개선하였다고 패치된 내용을 보내왔습니다. 외국인이 직접 제 소스를 패치해준것은 공식적으로 처음이군요.

잘 알지도 못하는 외국인으로부터 몇번 다른 여러 소스들에 대해서 개선점을 Mail 로 받아본적은 있지만 이렇게 패치로 보내준것은 처음인것 같네요.

Marius Konitzer 씨 에게 감사(Thanks)의 마음을 이자리를 빌어서 전합니다.

다음은 Marius Konitzer 씨가 저에게 보내준 Mail의 원문내용입니다.
인용:
Hello!

I recently needed a analog clock for fb output. It seemed that there was none - except from your fbclock. I liked it's charming simplicity and decided to improve it somewhat. So here is what I did:

* hour and minute hands are drawn on "in-between" positions, too
* added some commandline options for colour switching
* using default colours depending on the fb's bitdepth

I thought this could be of interest for you, if you like to implement it in the upstream version of your fbclock!? (perhaps even mentioning me in the source... ;-))


Nice greetings from Germany,
Marius Konitzer



아래의 패치가 patch명령으로 일부 적용되지 않을수 있습니다. 그래서 직접 손으로 해주어야 할지도 모릅니다. 원인은 제가 개념없이 버젼관리를 해서입니다. 버젼이 한가지라라면 문제가 없겠지만 비슷한 버젼이 꽤 많거든요...

코드:
--- fbclock.orig.c   2005-11-25 00:44:09.000000000 +0100
+++ fbclock.c   2005-11-26 14:21:43.000000000 +0100
@@ -8,6 +8,8 @@
 */
 
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <sys/types.h>
 #include <unistd.h>
 #include <fcntl.h>
@@ -25,6 +27,10 @@
 static struct fb_var_screeninfo   g_FB_VAR;
 static void                      *g_FB_Map;
 static void (*DrawPixel)(int, int, int);
+static char                      *g_Progname;
+static int                        g_Col8[4]  = {0x04, 0x01, 0x0e, 0x07}; /* red, blue, green, grey */
+static int                        g_Col16[4] = {0xf000, 0x00f0, 0xff00, 0x8410}; /* rgb565 */
+static int                        g_Col24[4] = {0xdd0000, 0x0000ff, 0xffff00, 0x808080}; /* rgb888 */
 
 static void DrawPixel8(int s_Color, int s_x, int s_y)
 {
@@ -103,11 +109,50 @@
  }
 }
 
+void Usage() {
+   printf("Usage: %s [-h] [-d fbdev] [-hc col] [-mc col] [-sc col] [-bc col]\n", g_Progname);
+   printf("  -h           show this help page\n");
+   printf("  -d fbdev     use fbdev as framebuffer device\n");
+   printf("  -hc col      specifies colour for hour hand\n");
+   printf("  -mc col      specifies colour for minute hand\n");
+   printf("  -sc col      specifies colour for second hand\n");
+   printf("  -bc col      specifies border colour\n");
+   printf("col is a hexadecimal colour code, that depends on your framebuffer's\n");
+   printf("colour depth, e.g. \"-hc 0xf0f0\" for 16 bit\n");
+   exit(1);
+}
+
 int main(int s_Argc, char *s_Argv[])
 {
+ int i, s_Colour[4], s_isColSet[4]={0,0,0,0};
  char *s_Device = "/dev/fb0";   
- if(s_Argc > 1)s_Device = s_Argv[1];
+ g_Progname = s_Argv[0];
  printf("fbclock v1.0.1 - Code by JaeHyuk Cho <minzkn@infoeq.co.kr>\n\n");
+ while(--s_Argc) {
+  s_Argv++;
+  if (s_Argc<=1) Usage();
+  if (!strcmp(s_Argv[0], "-d"))
+     s_Device = s_Argv[1];
+  else if (!strcmp(s_Argv[0], "-hc")) {
+     if (sscanf(s_Argv[1], "0x%x", &s_Colour[0])!=1)
+        Usage();
+     s_isColSet[0]=1;
+  } else if (!strcmp(s_Argv[0], "-mc")) {
+     if (sscanf(s_Argv[1], "0x%x", &s_Colour[1])!=1)
+        Usage();
+     s_isColSet[1]=1;
+  } else if (!strcmp(s_Argv[0], "-sc")) {
+     if (sscanf(s_Argv[1], "0x%x", &s_Colour[2])!=1)
+        Usage();
+     s_isColSet[2]=1;
+  } else if (!strcmp(s_Argv[0], "-bc")) {
+     if (sscanf(s_Argv[1], "0x%x", &s_Colour[3])!=1)
+        Usage();
+     s_isColSet[3]=1;
+  } else
+     Usage();
+  s_Argc--; s_Argv++;
+ }
  g_FB_Handle = open(s_Device, O_RDWR);
  if(g_FB_Handle >= 0)
  {
@@ -130,40 +175,49 @@
      g_FB_ScreenSize = g_FB_VAR.xres < g_FB_VAR.yres ? g_FB_VAR.xres : g_FB_VAR.yres;
      if(DrawPixel)
      {
-      int s_PreSecond = 0, s_PreMinute = 0, s_PreHour = 0, s_Count, s_Index, s_x, s_y;
+      int s_Count, s_Index, s_x, s_y;
+      int s_PreAngleSecond = 0, s_PreAngleMinute = 0, s_PreAngleHour = 0;
+      int s_AngleSecond = 0, s_AngleMinute = 0, s_AngleHour = 0;
       time_t s_UTC;
       struct tm *s_LocalTime;
       s_Count = 0;
+      for (i=0; i<4; i++) {
+        if (!s_isColSet[i])
+           s_Colour[i]=(DrawPixel==DrawPixel8?g_Col8[i]:(DrawPixel==DrawPixel16?g_Col16[i]:g_Col24[i]));
+      }
       do
       {
        s_UTC = time((time_t *)0);
        s_LocalTime = localtime(&s_UTC);
-       if(s_LocalTime->tm_sec != s_PreSecond)
+       s_AngleSecond = s_LocalTime->tm_sec * 6;
+       s_AngleMinute = s_LocalTime->tm_min * 6 + ((float)s_LocalTime->tm_sec / 10);
+       s_AngleHour = s_LocalTime->tm_hour * 30 + ((float)s_LocalTime->tm_min / 2);
+       if(s_AngleSecond != s_PreAngleSecond)
        {
-   if(s_LocalTime->tm_min != s_PreMinute)
+   if(s_AngleMinute != s_PreAngleMinute)
    {
-         if(s_LocalTime->tm_hour != s_PreHour)
+         if(s_AngleHour != s_PreAngleHour)
     {
-     Pin(0, s_PreHour * 30, 20);          
-     s_PreHour = s_LocalTime->tm_hour;
+     Pin(0, s_PreAngleHour, 20);
+     s_PreAngleHour = s_AngleHour;
     }
-    Pin(0, s_PreMinute * 6, 10);          
-    s_PreMinute = s_LocalTime->tm_min;
+    Pin(0, s_PreAngleMinute, 10);
+    s_PreAngleMinute = s_AngleMinute;
    }
-        Pin(0, s_PreSecond * 6, 0);          
-        Pin(0xf00f, s_LocalTime->tm_hour * 30, 20);          
-        Pin(0x0ff0, s_LocalTime->tm_min  *  6, 10);          
-        Pin(0xffff, s_LocalTime->tm_sec  *  6, 0);        
-        DrawCircle(0x0fff, g_FB_Cx, g_FB_Cy, 5);   
-        s_PreSecond = s_LocalTime->tm_sec;
+        Pin(0, s_PreAngleSecond, 0);
+        s_PreAngleSecond = s_AngleSecond;
+        Pin(s_Colour[0], s_AngleHour, 20);
+        Pin(s_Colour[1], s_AngleMinute, 10);
+        Pin(s_Colour[2], s_AngleSecond, 0);
+        DrawCircle(s_Colour[3], g_FB_Cx, g_FB_Cy, 5);   
        }
        usleep(DEF_HEAT_CPU);
        PinXY(s_Count, &s_x, &s_y, (g_FB_ScreenSize >> 1) - (g_FB_ScreenSize >> 5));
        s_Index = (s_Count % 30) ? 5 : 10;
-       DrawCircle(0xffff, g_FB_Cx + s_x, g_FB_Cy + s_y, s_Index);   
-       DrawCircle(0xffff, g_FB_Cx - s_x, g_FB_Cy + s_y, s_Index);   
-       DrawCircle(0xffff, g_FB_Cx + s_x, g_FB_Cy - s_y, s_Index);   
-       DrawCircle(0xffff, g_FB_Cx - s_x, g_FB_Cy - s_y, s_Index);
+       DrawCircle(s_Colour[3], g_FB_Cx + s_x, g_FB_Cy + s_y, s_Index);   
+       DrawCircle(s_Colour[3], g_FB_Cx - s_x, g_FB_Cy + s_y, s_Index);   
+       DrawCircle(s_Colour[3], g_FB_Cx + s_x, g_FB_Cy - s_y, s_Index);   
+       DrawCircle(s_Colour[3], g_FB_Cx - s_x, g_FB_Cy - s_y, s_Index);
        s_Count+=6;
        if(s_Count > 90)s_Count = 0;
       }while(1);

크리에이티브 커먼즈 라이센스
Creative Commons License
2007/05/25 01:59 2007/05/25 01:59
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/128

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/128

코드: /*
Copyright (C) Information Equipment co.,LTD.
All rights reserved.
Code by JaeHyuk Cho <mailto:minzkn@infoeq.com>
CVSTAG="$Header$"
*/

#include <stdio.h>

const unsigned char g_mz_bitmap_font_en[2048] = {
   /* 0 0x00 '^@' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 1 0x01 '^A' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7e, /* 01111110 */
   0x81, /* 10000001 */
   0xa5, /* 10100101 */
   0x81, /* 10000001 */
   0x81, /* 10000001 */
   0xbd, /* 10111101 */
   0x99, /* 10011001 */
   0x81, /* 10000001 */
   0x81, /* 10000001 */
   0x7e, /* 01111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 2 0x02 '^B' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7e, /* 01111110 */
   0xff, /* 11111111 */
   0xdb, /* 11011011 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xc3, /* 11000011 */
   0xe7, /* 11100111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0x7e, /* 01111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 3 0x03 '^C' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x6c, /* 01101100 */
   0xfe, /* 11111110 */
   0xfe, /* 11111110 */
   0xfe, /* 11111110 */
   0xfe, /* 11111110 */
   0x7c, /* 01111100 */
   0x38, /* 00111000 */
   0x10, /* 00010000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 4 0x04 '^D' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x10, /* 00010000 */
   0x38, /* 00111000 */
   0x7c, /* 01111100 */
   0xfe, /* 11111110 */
   0x7c, /* 01111100 */
   0x38, /* 00111000 */
   0x10, /* 00010000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 5 0x05 '^E' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x3c, /* 00111100 */
   0x3c, /* 00111100 */
   0xe7, /* 11100111 */
   0xe7, /* 11100111 */
   0xe7, /* 11100111 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x3c, /* 00111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 6 0x06 '^F' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x3c, /* 00111100 */
   0x7e, /* 01111110 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0x7e, /* 01111110 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x3c, /* 00111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 7 0x07 '^G' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x3c, /* 00111100 */
   0x3c, /* 00111100 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 8 0x08 '^H' */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xe7, /* 11100111 */
   0xc3, /* 11000011 */
   0xc3, /* 11000011 */
   0xe7, /* 11100111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */

   /* 9 0x09 '^I' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x3c, /* 00111100 */
   0x66, /* 01100110 */
   0x42, /* 01000010 */
   0x42, /* 01000010 */
   0x66, /* 01100110 */
   0x3c, /* 00111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 10 0x0a '^J' */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xc3, /* 11000011 */
   0x99, /* 10011001 */
   0xbd, /* 10111101 */
   0xbd, /* 10111101 */
   0x99, /* 10011001 */
   0xc3, /* 11000011 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */
   0xff, /* 11111111 */

   /* 11 0x0b '^K' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x1e, /* 00011110 */
   0x0e, /* 00001110 */
   0x1a, /* 00011010 */
   0x32, /* 00110010 */
   0x78, /* 01111000 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0x78, /* 01111000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 12 0x0c '^L' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x3c, /* 00111100 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x3c, /* 00111100 */
   0x18, /* 00011000 */
   0x7e, /* 01111110 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 13 0x0d '^M' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x3f, /* 00111111 */
   0x33, /* 00110011 */
   0x3f, /* 00111111 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x70, /* 01110000 */
   0xf0, /* 11110000 */
   0xe0, /* 11100000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 14 0x0e '^N' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7f, /* 01111111 */
   0x63, /* 01100011 */
   0x7f, /* 01111111 */
   0x63, /* 01100011 */
   0x63, /* 01100011 */
   0x63, /* 01100011 */
   0x63, /* 01100011 */
   0x67, /* 01100111 */
   0xe7, /* 11100111 */
   0xe6, /* 11100110 */
   0xc0, /* 11000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 15 0x0f '^O' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0xdb, /* 11011011 */
   0x3c, /* 00111100 */
   0xe7, /* 11100111 */
   0x3c, /* 00111100 */
   0xdb, /* 11011011 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 16 0x10 '^P' */
   0x00, /* 00000000 */
   0x80, /* 10000000 */
   0xc0, /* 11000000 */
   0xe0, /* 11100000 */
   0xf0, /* 11110000 */
   0xf8, /* 11111000 */
   0xfe, /* 11111110 */
   0xf8, /* 11111000 */
   0xf0, /* 11110000 */
   0xe0, /* 11100000 */
   0xc0, /* 11000000 */
   0x80, /* 10000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 17 0x11 '^Q' */
   0x00, /* 00000000 */
   0x02, /* 00000010 */
   0x06, /* 00000110 */
   0x0e, /* 00001110 */
   0x1e, /* 00011110 */
   0x3e, /* 00111110 */
   0xfe, /* 11111110 */
   0x3e, /* 00111110 */
   0x1e, /* 00011110 */
   0x0e, /* 00001110 */
   0x06, /* 00000110 */
   0x02, /* 00000010 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 18 0x12 '^R' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x3c, /* 00111100 */
   0x7e, /* 01111110 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x7e, /* 01111110 */
   0x3c, /* 00111100 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 19 0x13 '^S' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x00, /* 00000000 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 20 0x14 '^T' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7f, /* 01111111 */
   0xdb, /* 11011011 */
   0xdb, /* 11011011 */
   0xdb, /* 11011011 */
   0x7b, /* 01111011 */
   0x1b, /* 00011011 */
   0x1b, /* 00011011 */
   0x1b, /* 00011011 */
   0x1b, /* 00011011 */
   0x1b, /* 00011011 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 21 0x15 '^U' */
   0x00, /* 00000000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0x60, /* 01100000 */
   0x38, /* 00111000 */
   0x6c, /* 01101100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x6c, /* 01101100 */
   0x38, /* 00111000 */
   0x0c, /* 00001100 */
   0xc6, /* 11000110 */
   0x7c, /* 01111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 22 0x16 '^V' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xfe, /* 11111110 */
   0xfe, /* 11111110 */
   0xfe, /* 11111110 */
   0xfe, /* 11111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 23 0x17 '^W' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x3c, /* 00111100 */
   0x7e, /* 01111110 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x7e, /* 01111110 */
   0x3c, /* 00111100 */
   0x18, /* 00011000 */
   0x7e, /* 01111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 24 0x18 '^X' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x3c, /* 00111100 */
   0x7e, /* 01111110 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 25 0x19 '^Y' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x7e, /* 01111110 */
   0x3c, /* 00111100 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 26 0x1a '^Z' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x0c, /* 00001100 */
   0xfe, /* 11111110 */
   0x0c, /* 00001100 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 27 0x1b '^[' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x30, /* 00110000 */
   0x60, /* 01100000 */
   0xfe, /* 11111110 */
   0x60, /* 01100000 */
   0x30, /* 00110000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 28 0x1c '^\' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xc0, /* 11000000 */
   0xc0, /* 11000000 */
   0xc0, /* 11000000 */
   0xfe, /* 11111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 29 0x1d '^]' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x28, /* 00101000 */
   0x6c, /* 01101100 */
   0xfe, /* 11111110 */
   0x6c, /* 01101100 */
   0x28, /* 00101000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 30 0x1e '^^' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x10, /* 00010000 */
   0x38, /* 00111000 */
   0x38, /* 00111000 */
   0x7c, /* 01111100 */
   0x7c, /* 01111100 */
   0xfe, /* 11111110 */
   0xfe, /* 11111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 31 0x1f '^_' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xfe, /* 11111110 */
   0xfe, /* 11111110 */
   0x7c, /* 01111100 */
   0x7c, /* 01111100 */
   0x38, /* 00111000 */
   0x38, /* 00111000 */
   0x10, /* 00010000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 32 0x20 ' ' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 33 0x21 '!' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x3c, /* 00111100 */
   0x3c, /* 00111100 */
   0x3c, /* 00111100 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 34 0x22 '"' */
   0x00, /* 00000000 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x24, /* 00100100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 35 0x23 '#' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x6c, /* 01101100 */
   0x6c, /* 01101100 */
   0xfe, /* 11111110 */
   0x6c, /* 01101100 */
   0x6c, /* 01101100 */
   0x6c, /* 01101100 */
   0xfe, /* 11111110 */
   0x6c, /* 01101100 */
   0x6c, /* 01101100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 36 0x24 '$' */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0xc2, /* 11000010 */
   0xc0, /* 11000000 */
   0x7c, /* 01111100 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0x86, /* 10000110 */
   0xc6, /* 11000110 */
   0x7c, /* 01111100 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 37 0x25 '%' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xc2, /* 11000010 */
   0xc6, /* 11000110 */
   0x0c, /* 00001100 */
   0x18, /* 00011000 */
   0x30, /* 00110000 */
   0x60, /* 01100000 */
   0xc6, /* 11000110 */
   0x86, /* 10000110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 38 0x26 '&' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x38, /* 00111000 */
   0x6c, /* 01101100 */
   0x6c, /* 01101100 */
   0x38, /* 00111000 */
   0x76, /* 01110110 */
   0xdc, /* 11011100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0x76, /* 01110110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 39 0x27 ''' */
   0x00, /* 00000000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x60, /* 01100000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 40 0x28 '(' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x0c, /* 00001100 */
   0x18, /* 00011000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x18, /* 00011000 */
   0x0c, /* 00001100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 41 0x29 ')' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x30, /* 00110000 */
   0x18, /* 00011000 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x18, /* 00011000 */
   0x30, /* 00110000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 42 0x2a '*' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x66, /* 01100110 */
   0x3c, /* 00111100 */
   0xff, /* 11111111 */
   0x3c, /* 00111100 */
   0x66, /* 01100110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 43 0x2b '+' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x7e, /* 01111110 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 44 0x2c ',' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x30, /* 00110000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 45 0x2d '-' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xfe, /* 11111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 46 0x2e '.' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 47 0x2f '/' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x02, /* 00000010 */
   0x06, /* 00000110 */
   0x0c, /* 00001100 */
   0x18, /* 00011000 */
   0x30, /* 00110000 */
   0x60, /* 01100000 */
   0xc0, /* 11000000 */
   0x80, /* 10000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 48 0x30 '0' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x38, /* 00111000 */
   0x6c, /* 01101100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xd6, /* 11010110 */
   0xd6, /* 11010110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x6c, /* 01101100 */
   0x38, /* 00111000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 49 0x31 '1' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x38, /* 00111000 */
   0x78, /* 01111000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x7e, /* 01111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 50 0x32 '2' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0x06, /* 00000110 */
   0x0c, /* 00001100 */
   0x18, /* 00011000 */
   0x30, /* 00110000 */
   0x60, /* 01100000 */
   0xc0, /* 11000000 */
   0xc6, /* 11000110 */
   0xfe, /* 11111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 51 0x33 '3' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0x3c, /* 00111100 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0xc6, /* 11000110 */
   0x7c, /* 01111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 52 0x34 '4' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x0c, /* 00001100 */
   0x1c, /* 00011100 */
   0x3c, /* 00111100 */
   0x6c, /* 01101100 */
   0xcc, /* 11001100 */
   0xfe, /* 11111110 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x1e, /* 00011110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 53 0x35 '5' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xfe, /* 11111110 */
   0xc0, /* 11000000 */
   0xc0, /* 11000000 */
   0xc0, /* 11000000 */
   0xfc, /* 11111100 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0xc6, /* 11000110 */
   0x7c, /* 01111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 54 0x36 '6' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x38, /* 00111000 */
   0x60, /* 01100000 */
   0xc0, /* 11000000 */
   0xc0, /* 11000000 */
   0xfc, /* 11111100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x7c, /* 01111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 55 0x37 '7' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xfe, /* 11111110 */
   0xc6, /* 11000110 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0x0c, /* 00001100 */
   0x18, /* 00011000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 56 0x38 '8' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x7c, /* 01111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 57 0x39 '9' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x7e, /* 01111110 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0x0c, /* 00001100 */
   0x78, /* 01111000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 58 0x3a ':' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 59 0x3b ';' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x30, /* 00110000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 60 0x3c '<' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x06, /* 00000110 */
   0x0c, /* 00001100 */
   0x18, /* 00011000 */
   0x30, /* 00110000 */
   0x60, /* 01100000 */
   0x30, /* 00110000 */
   0x18, /* 00011000 */
   0x0c, /* 00001100 */
   0x06, /* 00000110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 61 0x3d '=' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7e, /* 01111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7e, /* 01111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 62 0x3e '>' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x60, /* 01100000 */
   0x30, /* 00110000 */
   0x18, /* 00011000 */
   0x0c, /* 00001100 */
   0x06, /* 00000110 */
   0x0c, /* 00001100 */
   0x18, /* 00011000 */
   0x30, /* 00110000 */
   0x60, /* 01100000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 63 0x3f '?' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x0c, /* 00001100 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 64 0x40 '@' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xde, /* 11011110 */
   0xde, /* 11011110 */
   0xde, /* 11011110 */
   0xdc, /* 11011100 */
   0xc0, /* 11000000 */
   0x7c, /* 01111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 65 0x41 'A' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x10, /* 00010000 */
   0x38, /* 00111000 */
   0x6c, /* 01101100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xfe, /* 11111110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 66 0x42 'B' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xfc, /* 11111100 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x7c, /* 01111100 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0xfc, /* 11111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 67 0x43 'C' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x3c, /* 00111100 */
   0x66, /* 01100110 */
   0xc2, /* 11000010 */
   0xc0, /* 11000000 */
   0xc0, /* 11000000 */
   0xc0, /* 11000000 */
   0xc0, /* 11000000 */
   0xc2, /* 11000010 */
   0x66, /* 01100110 */
   0x3c, /* 00111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 68 0x44 'D' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xf8, /* 11111000 */
   0x6c, /* 01101100 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x6c, /* 01101100 */
   0xf8, /* 11111000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 69 0x45 'E' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xfe, /* 11111110 */
   0x66, /* 01100110 */
   0x62, /* 01100010 */
   0x68, /* 01101000 */
   0x78, /* 01111000 */
   0x68, /* 01101000 */
   0x60, /* 01100000 */
   0x62, /* 01100010 */
   0x66, /* 01100110 */
   0xfe, /* 11111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 70 0x46 'F' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xfe, /* 11111110 */
   0x66, /* 01100110 */
   0x62, /* 01100010 */
   0x68, /* 01101000 */
   0x78, /* 01111000 */
   0x68, /* 01101000 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0xf0, /* 11110000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 71 0x47 'G' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x3c, /* 00111100 */
   0x66, /* 01100110 */
   0xc2, /* 11000010 */
   0xc0, /* 11000000 */
   0xc0, /* 11000000 */
   0xde, /* 11011110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x66, /* 01100110 */
   0x3a, /* 00111010 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 72 0x48 'H' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xfe, /* 11111110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 73 0x49 'I' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x3c, /* 00111100 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x3c, /* 00111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 74 0x4a 'J' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x1e, /* 00011110 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0x78, /* 01111000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 75 0x4b 'K' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xe6, /* 11100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x6c, /* 01101100 */
   0x78, /* 01111000 */
   0x78, /* 01111000 */
   0x6c, /* 01101100 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0xe6, /* 11100110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 76 0x4c 'L' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xf0, /* 11110000 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0x62, /* 01100010 */
   0x66, /* 01100110 */
   0xfe, /* 11111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 77 0x4d 'M' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xc6, /* 11000110 */
   0xee, /* 11101110 */
   0xfe, /* 11111110 */
   0xfe, /* 11111110 */
   0xd6, /* 11010110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 78 0x4e 'N' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xc6, /* 11000110 */
   0xe6, /* 11100110 */
   0xf6, /* 11110110 */
   0xfe, /* 11111110 */
   0xde, /* 11011110 */
   0xce, /* 11001110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 79 0x4f 'O' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x7c, /* 01111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 80 0x50 'P' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xfc, /* 11111100 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x7c, /* 01111100 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0xf0, /* 11110000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 81 0x51 'Q' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xd6, /* 11010110 */
   0xde, /* 11011110 */
   0x7c, /* 01111100 */
   0x0c, /* 00001100 */
   0x0e, /* 00001110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 82 0x52 'R' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xfc, /* 11111100 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x7c, /* 01111100 */
   0x6c, /* 01101100 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0xe6, /* 11100110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 83 0x53 'S' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x60, /* 01100000 */
   0x38, /* 00111000 */
   0x0c, /* 00001100 */
   0x06, /* 00000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x7c, /* 01111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 84 0x54 'T' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7e, /* 01111110 */
   0x7e, /* 01111110 */
   0x5a, /* 01011010 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x3c, /* 00111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 85 0x55 'U' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x7c, /* 01111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 86 0x56 'V' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x6c, /* 01101100 */
   0x38, /* 00111000 */
   0x10, /* 00010000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 87 0x57 'W' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xd6, /* 11010110 */
   0xd6, /* 11010110 */
   0xd6, /* 11010110 */
   0xfe, /* 11111110 */
   0xee, /* 11101110 */
   0x6c, /* 01101100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 88 0x58 'X' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x6c, /* 01101100 */
   0x7c, /* 01111100 */
   0x38, /* 00111000 */
   0x38, /* 00111000 */
   0x7c, /* 01111100 */
   0x6c, /* 01101100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 89 0x59 'Y' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x3c, /* 00111100 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x3c, /* 00111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 90 0x5a 'Z' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xfe, /* 11111110 */
   0xc6, /* 11000110 */
   0x86, /* 10000110 */
   0x0c, /* 00001100 */
   0x18, /* 00011000 */
   0x30, /* 00110000 */
   0x60, /* 01100000 */
   0xc2, /* 11000010 */
   0xc6, /* 11000110 */
   0xfe, /* 11111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 91 0x5b '[' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x3c, /* 00111100 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x3c, /* 00111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 92 0x5c '\' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x80, /* 10000000 */
   0xc0, /* 11000000 */
   0xe0, /* 11100000 */
   0x70, /* 01110000 */
   0x38, /* 00111000 */
   0x1c, /* 00011100 */
   0x0e, /* 00001110 */
   0x06, /* 00000110 */
   0x02, /* 00000010 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 93 0x5d ']' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x3c, /* 00111100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x3c, /* 00111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 94 0x5e '^' */
   0x10, /* 00010000 */
   0x38, /* 00111000 */
   0x6c, /* 01101100 */
   0xc6, /* 11000110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 95 0x5f '_' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xff, /* 11111111 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 96 0x60 '`' */
   0x00, /* 00000000 */
   0x30, /* 00110000 */
   0x18, /* 00011000 */
   0x0c, /* 00001100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 97 0x61 'a' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x78, /* 01111000 */
   0x0c, /* 00001100 */
   0x7c, /* 01111100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0x76, /* 01110110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 98 0x62 'b' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xe0, /* 11100000 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0x78, /* 01111000 */
   0x6c, /* 01101100 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x7c, /* 01111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 99 0x63 'c' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0xc0, /* 11000000 */
   0xc0, /* 11000000 */
   0xc0, /* 11000000 */
   0xc6, /* 11000110 */
   0x7c, /* 01111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 100 0x64 'd' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x1c, /* 00011100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x3c, /* 00111100 */
   0x6c, /* 01101100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0x76, /* 01110110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 101 0x65 'e' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0xfe, /* 11111110 */
   0xc0, /* 11000000 */
   0xc0, /* 11000000 */
   0xc6, /* 11000110 */
   0x7c, /* 01111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 102 0x66 'f' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x1c, /* 00011100 */
   0x36, /* 00110110 */
   0x32, /* 00110010 */
   0x30, /* 00110000 */
   0x78, /* 01111000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x78, /* 01111000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 103 0x67 'g' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x76, /* 01110110 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0x7c, /* 01111100 */
   0x0c, /* 00001100 */
   0xcc, /* 11001100 */
   0x78, /* 01111000 */
   0x00, /* 00000000 */

   /* 104 0x68 'h' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xe0, /* 11100000 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0x6c, /* 01101100 */
   0x76, /* 01110110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0xe6, /* 11100110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 105 0x69 'i' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x38, /* 00111000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x3c, /* 00111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 106 0x6a 'j' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0x00, /* 00000000 */
   0x0e, /* 00001110 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0x06, /* 00000110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x3c, /* 00111100 */
   0x00, /* 00000000 */

   /* 107 0x6b 'k' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xe0, /* 11100000 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0x66, /* 01100110 */
   0x6c, /* 01101100 */
   0x78, /* 01111000 */
   0x78, /* 01111000 */
   0x6c, /* 01101100 */
   0x66, /* 01100110 */
   0xe6, /* 11100110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 108 0x6c 'l' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x38, /* 00111000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x3c, /* 00111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 109 0x6d 'm' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xec, /* 11101100 */
   0xfe, /* 11111110 */
   0xd6, /* 11010110 */
   0xd6, /* 11010110 */
   0xd6, /* 11010110 */
   0xd6, /* 11010110 */
   0xc6, /* 11000110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 110 0x6e 'n' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xdc, /* 11011100 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 111 0x6f 'o' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x7c, /* 01111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 112 0x70 'p' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xdc, /* 11011100 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x66, /* 01100110 */
   0x7c, /* 01111100 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0xf0, /* 11110000 */
   0x00, /* 00000000 */

   /* 113 0x71 'q' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x76, /* 01110110 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0x7c, /* 01111100 */
   0x0c, /* 00001100 */
   0x0c, /* 00001100 */
   0x1e, /* 00011110 */
   0x00, /* 00000000 */

   /* 114 0x72 'r' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xdc, /* 11011100 */
   0x76, /* 01110110 */
   0x66, /* 01100110 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0x60, /* 01100000 */
   0xf0, /* 11110000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 115 0x73 's' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x7c, /* 01111100 */
   0xc6, /* 11000110 */
   0x60, /* 01100000 */
   0x38, /* 00111000 */
   0x0c, /* 00001100 */
   0xc6, /* 11000110 */
   0x7c, /* 01111100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 116 0x74 't' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x10, /* 00010000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0xfc, /* 11111100 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x30, /* 00110000 */
   0x36, /* 00110110 */
   0x1c, /* 00011100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 117 0x75 'u' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0xcc, /* 11001100 */
   0x76, /* 01110110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 118 0x76 'v' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x6c, /* 01101100 */
   0x38, /* 00111000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 119 0x77 'w' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xd6, /* 11010110 */
   0xd6, /* 11010110 */
   0xd6, /* 11010110 */
   0xfe, /* 11111110 */
   0x6c, /* 01101100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 120 0x78 'x' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xc6, /* 11000110 */
   0x6c, /* 01101100 */
   0x38, /* 00111000 */
   0x38, /* 00111000 */
   0x38, /* 00111000 */
   0x6c, /* 01101100 */
   0xc6, /* 11000110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 121 0x79 'y' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0x7e, /* 01111110 */
   0x06, /* 00000110 */
   0x0c, /* 00001100 */
   0xf8, /* 11111000 */
   0x00, /* 00000000 */

   /* 122 0x7a 'z' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0xfe, /* 11111110 */
   0xcc, /* 11001100 */
   0x18, /* 00011000 */
   0x30, /* 00110000 */
   0x60, /* 01100000 */
   0xc6, /* 11000110 */
   0xfe, /* 11111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 123 0x7b '{' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x0e, /* 00001110 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x70, /* 01110000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x0e, /* 00001110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 124 0x7c '|' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 125 0x7d '}' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x70, /* 01110000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x0e, /* 00001110 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x18, /* 00011000 */
   0x70, /* 01110000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 126 0x7e '~' */
   0x00, /* 00000000 */
   0x76, /* 01110110 */
   0xdc, /* 11011100 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */

   /* 127 0x7f '�' */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x10, /* 00010000 */
   0x38, /* 00111000 */
   0x6c, /* 01101100 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xc6, /* 11000110 */
   0xfe, /* 11111110 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00, /* 00000000 */
   0x00  /* 00000000 */
};

static void draw_puts_en(const char *s_string)
{
int s_x, s_y, s_byte;
const char *s_temp;
for(s_y = 0;s_y < 16;s_y++)
{
  for(s_temp = s_string;(s_byte = (int)*((unsigned char *)s_temp)) != '\0';s_temp++)
  {
   for(s_x = 0;s_x < 8;s_x++)(void)fputs((g_mz_bitmap_font_en[(s_byte << 4) + s_y] & ((unsigned char)(0x80 >> s_x))) ? "O" : " ", stdout);
  }
  (void)fputs("\n", stdout);
}
}

int main(void)
{
char *s_string[] = {"Bitmap", "Example", "minzkn", (char *)0};
int s_index;
for(s_index = 0;s_string[s_index] != ((char *)0);s_index++)draw_puts_en(s_string[s_index]);
return(0);
}

/* End of source */
크리에이티브 커먼즈 라이센스
Creative Commons License
2007/05/08 19:31 2007/05/08 19:31
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/96

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/96

기본 palette 값입니다.
보통은 RGB0233 과 같이 색을 일반화하여 사용하는게 더 낳다고 생각되지만
간혹 이게 쓸데가 있네요.

코드:
#define __mzexport__
struct ts_mz_palette
{
int red;
int green;
int blue;
};

__mzexport__ const struct ts_mz_palette cg_mz_default_palette[ /* 256 */ ] = {
/*   0 */ {0x00, 0x00, 0x00}, /*   0,   0,   0 */
/*   1 */ {0xff, 0x00, 0x00}, /* 255,   0,   0 */
/*   2 */ {0x00, 0xff, 0x00}, /*   0, 255,   0 */
/*   3 */ {0xda, 0xa5, 0x20}, /* 218, 165,  32 */
/*   4 */ {0xb0, 0xc4, 0xde}, /* 176, 196, 222 */
/*   5 */ {0xff, 0x00, 0xff}, /* 255,   0, 255 */
/*   6 */ {0x00, 0xcd, 0xcd}, /*   0, 205, 205 */
/*   7 */ {0xe5, 0xe5, 0xe5}, /* 229, 229, 229 */
/*   8 */ {0x4d, 0x4d, 0x4d}, /*  77,  77,  77 */
/*   9 */ {0xff, 0xa0, 0x7a}, /* 255, 160, 122 */
/*  10 */ {0x90, 0xee, 0x90}, /* 144, 238, 144 */
/*  11 */ {0xee, 0xdd, 0x82}, /* 238, 221, 130 */
/*  12 */ {0x87, 0xce, 0xfa}, /* 135, 206, 250 */
/*  13 */ {0xee, 0x82, 0xee}, /* 238, 130, 238 */
/*  14 */ {0x00, 0xff, 0xff}, /*   0, 255, 255 */
/*  15 */ {0xff, 0xff, 0xff}, /* 255, 255, 255 */
/*  16 */ {0xf0, 0xf8, 0xff}, /* 240, 248, 255 */
/*  17 */ {0xfa, 0xeb, 0xd7}, /* 250, 235, 215 */
/*  18 */ {0xcd, 0xc0, 0xb0}, /* 205, 192, 176 */
/*  19 */ {0x7f, 0xff, 0xd4}, /* 127, 255, 212 */
/*  20 */ {0x45, 0x8b, 0x74}, /*  69, 139, 116 */
/*  21 */ {0xf0, 0xff, 0xff}, /* 240, 255, 255 */
/*  22 */ {0xc1, 0xcd, 0xcd}, /* 193, 205, 205 */
/*  23 */ {0xf5, 0xf5, 0xdc}, /* 245, 245, 220 */
/*  24 */ {0xff, 0xe4, 0xc4}, /* 255, 228, 196 */
/*  25 */ {0xcd, 0xb7, 0x9e}, /* 205, 183, 158 */
/*  26 */ {0xff, 0xeb, 0xcd}, /* 255, 235, 205 */
/*  27 */ {0x8a, 0x2b, 0xe2}, /* 138,  43, 226 */
/*  28 */ {0x00, 0x00, 0xff}, /*   0,   0, 255 */
/*  29 */ {0x00, 0x00, 0xee}, /*   0,   0, 238 */
/*  30 */ {0xa5, 0x2a, 0x2a}, /* 165,  42,  42 */
/*  31 */ {0xee, 0x3b, 0x3b}, /* 238,  59,  59 */
/*  32 */ {0x8b, 0x23, 0x23}, /* 139,  35,  35 */
/*  33 */ {0xde, 0xb8, 0x87}, /* 222, 184, 135 */
/*  34 */ {0x8b, 0x73, 0x55}, /* 139, 115,  85 */
/*  35 */ {0x5f, 0x9e, 0xa0}, /*  95, 158, 160 */
/*  36 */ {0x53, 0x86, 0x8b}, /*  83, 134, 139 */
/*  37 */ {0x7f, 0xff, 0x00}, /* 127, 255,   0 */
/*  38 */ {0x45, 0x8b, 0x00}, /*  69, 139,   0 */
/*  39 */ {0xd2, 0x69, 0x1e}, /* 210, 105,  30 */
/*  40 */ {0xee, 0x76, 0x21}, /* 238, 118,  33 */
/*  41 */ {0xff, 0x7f, 0x50}, /* 255, 127,  80 */
/*  42 */ {0xee, 0x6a, 0x50}, /* 238, 106,  80 */
/*  43 */ {0x8b, 0x3e, 0x2f}, /* 139,  62,  47 */
/*  44 */ {0x64, 0x95, 0xed}, /* 100, 149, 237 */
/*  45 */ {0xff, 0xf8, 0xdc}, /* 255, 248, 220 */
/*  46 */ {0x8b, 0x88, 0x78}, /* 139, 136, 120 */
/*  47 */ {0x00, 0xee, 0xee}, /*   0, 238, 238 */
/*  48 */ {0x00, 0x00, 0x8b}, /*   0,   0, 139 */
/*  49 */ {0x00, 0x8b, 0x8b}, /*   0, 139, 139 */
/*  50 */ {0x00, 0x64, 0x00}, /*   0, 100,   0 */
/*  51 */ {0xa9, 0xa9, 0xa9}, /* 169, 169, 169 */
/*  52 */ {0xbd, 0xb7, 0x6b}, /* 189, 183, 107 */
/*  53 */ {0x8b, 0x00, 0x8b}, /* 139,   0, 139 */
/*  54 */ {0x8b, 0x00, 0x00}, /* 139,   0,   0 */
/*  55 */ {0xe9, 0x96, 0x7a}, /* 233, 150, 122 */
/*  56 */ {0x48, 0x3d, 0x8b}, /*  72,  61, 139 */
/*  57 */ {0x00, 0xce, 0xd1}, /*   0, 206, 209 */
/*  58 */ {0x94, 0x00, 0xd3}, /* 148,   0, 211 */
/*  59 */ {0xb8, 0x86, 0x0b}, /* 184, 134,  11 */
/*  60 */ {0x8b, 0x65, 0x08}, /* 139, 101,   8 */
/*  61 */ {0x55, 0x6b, 0x2f}, /*  85, 107,  47 */
/*  62 */ {0x6e, 0x8b, 0x3d}, /* 110, 139,  61 */
/*  63 */ {0xff, 0x8c, 0x00}, /* 255, 140,   0 */
/*  64 */ {0x8b, 0x45, 0x00}, /* 139,  69,   0 */
/*  65 */ {0x99, 0x32, 0xcc}, /* 153,  50, 204 */
/*  66 */ {0x68, 0x22, 0x8b}, /* 104,  34, 139 */
/*  67 */ {0x8f, 0xbc, 0x8f}, /* 143, 188, 143 */
/*  68 */ {0x69, 0x8b, 0x69}, /* 105, 139, 105 */
/*  69 */ {0x2f, 0x4f, 0x4f}, /*  47,  79,  79 */
/*  70 */ {0x52, 0x8b, 0x8b}, /*  82, 139, 139 */
/*  71 */ {0xff, 0x14, 0x93}, /* 255,  20, 147 */
/*  72 */ {0x8b, 0x0a, 0x50}, /* 139,  10,  80 */
/*  73 */ {0x00, 0xbf, 0xff}, /*   0, 191, 255 */
/*  74 */ {0x00, 0x68, 0x8b}, /*   0, 104, 139 */
/*  75 */ {0x1e, 0x90, 0xff}, /*  30, 144, 255 */
/*  76 */ {0x10, 0x4e, 0x8b}, /*  16,  78, 139 */
/*  77 */ {0xb2, 0x22, 0x22}, /* 178,  34,  34 */
/*  78 */ {0x8b, 0x1a, 0x1a}, /* 139,  26,  26 */
/*  79 */ {0xff, 0xfa, 0xf0}, /* 255, 250, 240 */
/*  80 */ {0x22, 0x8b, 0x22}, /*  34, 139,  34 */
/*  81 */ {0xdc, 0xdc, 0xdc}, /* 220, 220, 220 */
/*  82 */ {0xf8, 0xf8, 0xff}, /* 248, 248, 255 */
/*  83 */ {0xff, 0xd7, 0x00}, /* 255, 215,   0 */
/*  84 */ {0x8b, 0x75, 0x00}, /* 139, 117,   0 */
/*  85 */ {0xee, 0xb4, 0x22}, /* 238, 180,  34 */
/*  86 */ {0xcd, 0x9b, 0x1d}, /* 205, 155,  29 */
/*  87 */ {0x8b, 0x69, 0x14}, /* 139, 105,  20 */
/*  88 */ {0xad, 0xff, 0x2f}, /* 173, 255,  47 */
/*  89 */ {0x00, 0x8b, 0x00}, /*   0, 139,   0 */
/*  90 */ {0x1a, 0x1a, 0x1a}, /*  26,  26,  26 */
/*  91 */ {0xff, 0xff, 0xff}, /* 255, 255, 255 */
/*  92 */ {0x26, 0x26, 0x26}, /*  38,  38,  38 */
/*  93 */ {0x33, 0x33, 0x33}, /*  51,  51,  51 */
/*  94 */ {0x40, 0x40, 0x40}, /*  64,  64,  64 */
/*  95 */ {0x59, 0x59, 0x59}, /*  89,  89,  89 */
/*  96 */ {0x66, 0x66, 0x66}, /* 102, 102, 102 */
/*  97 */ {0x73, 0x73, 0x73}, /* 115, 115, 115 */
/*  98 */ {0x0d, 0x0d, 0x0d}, /*  13,  13,  13 */
/*  99 */ {0x7f, 0x7f, 0x7f}, /* 127, 127, 127 */
/* 100 */ {0x8c, 0x8c, 0x8c}, /* 140, 140, 140 */
/* 101 */ {0x99, 0x99, 0x99}, /* 153, 153, 153 */
/* 102 */ {0xa6, 0xa6, 0xa6}, /* 166, 166, 166 */
/* 103 */ {0xb3, 0xb3, 0xb3}, /* 179, 179, 179 */
/* 104 */ {0xbf, 0xbf, 0xbf}, /* 191, 191, 191 */
/* 105 */ {0xcc, 0xcc, 0xcc}, /* 204, 204, 204 */
/* 106 */ {0xd9, 0xd9, 0xd9}, /* 217, 217, 217 */
/* 107 */ {0xf2, 0xf2, 0xf2}, /* 242, 242, 242 */
/* 108 */ {0xf0, 0xff, 0xf0}, /* 240, 255, 240 */
/* 109 */ {0x83, 0x8b, 0x83}, /* 131, 139, 131 */
/* 110 */ {0xff, 0x69, 0xb4}, /* 255, 105, 180 */
/* 111 */ {0x8b, 0x3a, 0x62}, /* 139,  58,  98 */
/* 112 */ {0xcd, 0x5c, 0x5c}, /* 205,  92,  92 */
/* 113 */ {0x8b, 0x3a, 0x3a}, /* 139,  58,  58 */
/* 114 */ {0xff, 0xff, 0xf0}, /* 255, 255, 240 */
/* 115 */ {0x8b, 0x8b, 0x83}, /* 139, 139, 131 */
/* 116 */ {0xf0, 0xe6, 0x8c}, /* 240, 230, 140 */
/* 117 */ {0x8b, 0x86, 0x4e}, /* 139, 134,  78 */
/* 118 */ {0xe6, 0xe6, 0xfa}, /* 230, 230, 250 */
/* 119 */ {0xff, 0xf0, 0xf5}, /* 255, 240, 245 */
/* 120 */ {0x8b, 0x83, 0x86}, /* 139, 131, 134 */
/* 121 */ {0x7c, 0xfc, 0x00}, /* 124, 252,   0 */
/* 122 */ {0xff, 0xfa, 0xcd}, /* 255, 250, 205 */
/* 123 */ {0x8b, 0x89, 0x70}, /* 139, 137, 112 */
/* 124 */ {0xf0, 0x80, 0x80}, /* 240, 128, 128 */
/* 125 */ {0xfa, 0xfa, 0xd2}, /* 250, 250, 210 */
/* 126 */ {0xd3, 0xd3, 0xd3}, /* 211, 211, 211 */
/* 127 */ {0x20, 0xb2, 0xaa}, /*  32, 178, 170 */
/* 128 */ {0x77, 0x88, 0x99}, /* 119, 136, 153 */
/* 129 */ {0xad, 0xd8, 0xe6}, /* 173, 216, 230 */
/* 130 */ {0x68, 0x83, 0x8b}, /* 104, 131, 139 */
/* 131 */ {0xe0, 0xff, 0xff}, /* 224, 255, 255 */
/* 132 */ {0x7a, 0x8b, 0x8b}, /* 122, 139, 139 */
/* 133 */ {0xee, 0xdc, 0x82}, /* 238, 220, 130 */
/* 134 */ {0xcd, 0xbe, 0x70}, /* 205, 190, 112 */
/* 135 */ {0x8b, 0x81, 0x4c}, /* 139, 129,  76 */
/* 136 */ {0xff, 0xb6, 0xc1}, /* 255, 182, 193 */
/* 137 */ {0x8b, 0x5f, 0x65}, /* 139,  95, 101 */
/* 138 */ {0x8b, 0x57, 0x42}, /* 139,  87,  66 */
/* 139 */ {0x60, 0x7b, 0x8b}, /*  96, 123, 139 */
/* 140 */ {0x84, 0x70, 0xff}, /* 132, 112, 255 */
/* 141 */ {0x6e, 0x7b, 0x8b}, /* 110, 123, 139 */
/* 142 */ {0xff, 0xff, 0xe0}, /* 255, 255, 224 */
/* 143 */ {0x8b, 0x8b, 0x7a}, /* 139, 139, 122 */
/* 144 */ {0x32, 0xcd, 0x32}, /*  50, 205,  50 */
/* 145 */ {0xfa, 0xf0, 0xe6}, /* 250, 240, 230 */
/* 146 */ {0xee, 0x00, 0xee}, /* 238,   0, 238 */
/* 147 */ {0xb0, 0x30, 0x60}, /* 176,  48,  96 */
/* 148 */ {0x8b, 0x1c, 0x62}, /* 139,  28,  98 */
/* 149 */ {0x66, 0xcd, 0xaa}, /* 102, 205, 170 */
/* 150 */ {0x00, 0x00, 0xcd}, /*   0,   0, 205 */
/* 151 */ {0x3c, 0xb3, 0x71}, /*  60, 179, 113 */
/* 152 */ {0x7b, 0x68, 0xee}, /* 123, 104, 238 */
/* 153 */ {0x00, 0xfa, 0x9a}, /*   0, 250, 154 */
/* 154 */ {0x48, 0xd1, 0xcc}, /*  72, 209, 204 */
/* 155 */ {0xc7, 0x15, 0x85}, /* 199,  21, 133 */
/* 156 */ {0xba, 0x55, 0xd3}, /* 186,  85, 211 */
/* 157 */ {0x7a, 0x37, 0x8b}, /* 122,  55, 139 */
/* 158 */ {0x93, 0x70, 0xdb}, /* 147, 112, 219 */
/* 159 */ {0x5d, 0x47, 0x8b}, /*  93,  71, 139 */
/* 160 */ {0x19, 0x19, 0x70}, /*  25,  25, 112 */
/* 161 */ {0xf5, 0xff, 0xfa}, /* 245, 255, 250 */
/* 162 */ {0xff, 0xe4, 0xe1}, /* 255, 228, 225 */
/* 163 */ {0x8b, 0x7d, 0x7b}, /* 139, 125, 123 */
/* 164 */ {0xff, 0xe4, 0xb5}, /* 255, 228, 181 */
/* 165 */ {0xff, 0xde, 0xad}, /* 255, 222, 173 */
/* 166 */ {0x8b, 0x79, 0x5e}, /* 139, 121,  94 */
/* 167 */ {0x00, 0x00, 0x80}, /*   0,   0, 128 */
/* 168 */ {0xfd, 0xf5, 0xe6}, /* 253, 245, 230 */
/* 169 */ {0x6b, 0x8e, 0x23}, /* 107, 142,  35 */
/* 170 */ {0x69, 0x8b, 0x22}, /* 105, 139,  34 */
/* 171 */ {0xff, 0xa5, 0x00}, /* 255, 165,   0 */
/* 172 */ {0x8b, 0x5a, 0x00}, /* 139,  90,   0 */
/* 173 */ {0xff, 0x45, 0x00}, /* 255,  69,   0 */
/* 174 */ {0x8b, 0x25, 0x00}, /* 139,  37,   0 */
/* 175 */ {0xda, 0x70, 0xd6}, /* 218, 112, 214 */
/* 176 */ {0x8b, 0x47, 0x89}, /* 139,  71, 137 */
/* 177 */ {0xee, 0xe8, 0xaa}, /* 238, 232, 170 */
/* 178 */ {0x98, 0xfb, 0x98}, /* 152, 251, 152 */
/* 179 */ {0x54, 0x8b, 0x54}, /*  84, 139,  84 */
/* 180 */ {0xaf, 0xee, 0xee}, /* 175, 238, 238 */
/* 181 */ {0x66, 0x8b, 0x8b}, /* 102, 139, 139 */
/* 182 */ {0xdb, 0x70, 0x93}, /* 219, 112, 147 */
/* 183 */ {0xee, 0x79, 0x9f}, /* 238, 121, 159 */
/* 184 */ {0x8b, 0x47, 0x5d}, /* 139,  71,  93 */
/* 185 */ {0xff, 0xef, 0xd5}, /* 255, 239, 213 */
/* 186 */ {0xff, 0xda, 0xb9}, /* 255, 218, 185 */
/* 187 */ {0x8b, 0x77, 0x65}, /* 139, 119, 101 */
/* 188 */ {0xff, 0xc0, 0xcb}, /* 255, 192, 203 */
/* 189 */ {0x8b, 0x63, 0x6c}, /* 139,  99, 108 */
/* 190 */ {0xdd, 0xa0, 0xdd}, /* 221, 160, 221 */
/* 191 */ {0xee, 0xae, 0xee}, /* 238, 174, 238 */
/* 192 */ {0x8b, 0x66, 0x8b}, /* 139, 102, 139 */
/* 193 */ {0xb0, 0xe0, 0xe6}, /* 176, 224, 230 */
/* 194 */ {0xa0, 0x20, 0xf0}, /* 160,  32, 240 */
/* 195 */ {0x91, 0x2c, 0xee}, /* 145,  44, 238 */
/* 196 */ {0x55, 0x1a, 0x8b}, /*  85,  26, 139 */
/* 197 */ {0xff, 0x00, 0x00}, /* 255,   0,   0 */
/* 198 */ {0xcd, 0x00, 0x00}, /* 205,   0,   0 */
/* 199 */ {0xbc, 0x8f, 0x8f}, /* 188, 143, 143 */
/* 200 */ {0xee, 0xb4, 0xb4}, /* 238, 180, 180 */
/* 201 */ {0x8b, 0x69, 0x69}, /* 139, 105, 105 */
/* 202 */ {0x41, 0x69, 0xe1}, /*  65, 105, 225 */
/* 203 */ {0x43, 0x6e, 0xee}, /*  67, 110, 238 */
/* 204 */ {0x27, 0x40, 0x8b}, /*  39,  64, 139 */
/* 205 */ {0x8b, 0x45, 0x13}, /* 139,  69,  19 */
/* 206 */ {0xfa, 0x80, 0x72}, /* 250, 128, 114 */
/* 207 */ {0xee, 0x82, 0x62}, /* 238, 130,  98 */
/* 208 */ {0x8b, 0x4c, 0x39}, /* 139,  76,  57 */
/* 209 */ {0xf4, 0xa4, 0x60}, /* 244, 164,  96 */
/* 210 */ {0x2e, 0x8b, 0x57}, /*  46, 139,  87 */
/* 211 */ {0x4e, 0xee, 0x94}, /*  78, 238, 148 */
/* 212 */ {0xff, 0xf5, 0xee}, /* 255, 245, 238 */
/* 213 */ {0x8b, 0x86, 0x82}, /* 139, 134, 130 */
/* 214 */ {0xa0, 0x52, 0x2d}, /* 160,  82,  45 */
/* 215 */ {0x8b, 0x47, 0x26}, /* 139,  71,  38 */
/* 216 */ {0x87, 0xce, 0xeb}, /* 135, 206, 235 */
/* 217 */ {0x4a, 0x70, 0x8b}, /*  74, 112, 139 */
/* 218 */ {0x6a, 0x5a, 0xcd}, /* 106,  90, 205 */
/* 219 */ {0x7a, 0x67, 0xee}, /* 122, 103, 238 */
/* 220 */ {0x47, 0x3c, 0x8b}, /*  71,  60, 139 */
/* 221 */ {0x70, 0x80, 0x90}, /* 112, 128, 144 */
/* 222 */ {0xb9, 0xd3, 0xee}, /* 185, 211, 238 */
/* 223 */ {0x6c, 0x7b, 0x8b}, /* 108, 123, 139 */
/* 224 */ {0xff, 0xfa, 0xfa}, /* 255, 250, 250 */
/* 225 */ {0xee, 0xe9, 0xe9}, /* 238, 233, 233 */
/* 226 */ {0x8b, 0x89, 0x89}, /* 139, 137, 137 */
/* 227 */ {0x00, 0xff, 0x7f}, /*   0, 255, 127 */
/* 228 */ {0x00, 0xee, 0x76}, /*   0, 238, 118 */
/* 229 */ {0x00, 0x8b, 0x45}, /*   0, 139,  69 */
/* 230 */ {0x46, 0x82, 0xb4}, /*  70, 130, 180 */
/* 231 */ {0x5c, 0xac, 0xee}, /*  92, 172, 238 */
/* 232 */ {0x36, 0x64, 0x8b}, /*  54, 100, 139 */
/* 233 */ {0xd2, 0xb4, 0x8c}, /* 210, 180, 140 */
/* 234 */ {0xee, 0x9a, 0x49}, /* 238, 154,  73 */
/* 235 */ {0x8b, 0x5a, 0x2b}, /* 139,  90,  43 */
/* 236 */ {0xd8, 0xbf, 0xd8}, /* 216, 191, 216 */
/* 237 */ {0xee, 0xd2, 0xee}, /* 238, 210, 238 */
/* 238 */ {0x8b, 0x7b, 0x8b}, /* 139, 123, 139 */
/* 239 */ {0xff, 0x63, 0x47}, /* 255,  99,  71 */
/* 240 */ {0xee, 0x5c, 0x42}, /* 238,  92,  66 */
/* 241 */ {0x8b, 0x36, 0x26}, /* 139,  54,  38 */
/* 242 */ {0x40, 0xe0, 0xd0}, /*  64, 224, 208 */
/* 243 */ {0x00, 0xe5, 0xee}, /*   0, 229, 238 */
/* 244 */ {0x00, 0x86, 0x8b}, /*   0, 134, 139 */
/* 245 */ {0xd0, 0x20, 0x90}, /* 208,  32, 144 */
/* 246 */ {0xee, 0x3a, 0x8c}, /* 238,  58, 140 */
/* 247 */ {0x8b, 0x22, 0x52}, /* 139,  34,  82 */
/* 248 */ {0xff, 0xe7, 0xba}, /* 255, 231, 186 */
/* 249 */ {0xee, 0xd8, 0xae}, /* 238, 216, 174 */
/* 250 */ {0xcd, 0xba, 0x96}, /* 205, 186, 150 */
/* 251 */ {0x8b, 0x7e, 0x66}, /* 139, 126, 102 */
/* 252 */ {0x9a, 0xcd, 0x32}, /* 154, 205,  50 */
/* 253 */ {0xff, 0xff, 0x00}, /* 255, 255,   0 */
/* 254 */ {0xee, 0xee, 0x00}, /* 238, 238,   0 */
/* 255 */ {0x8b, 0x8b, 0x00}  /* 139, 139,   0 */
};
크리에이티브 커먼즈 라이센스
Creative Commons License
2007/05/08 19:30 2007/05/08 19:30
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/95

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/95

그냥 받아서 컴파일해서 실행해보세요.
bitblit 의 원리를 간략하게 구현해본겁니다.
엄밀히 말하면 bitblit 이라기 보다는 byteblit 이긴 하지만 원리는 같습니다.

코드:
/*
Copyright (C) Information Equipment co.,LTD.
All rights reserved.
Code by JaeHyuk Cho <mailto:minzkn@infoeq.com>
CVSTAG="$Header$"
*/

#include <stdio.h>
#include <memory.h>

#define __def_bitblit_fastcall__
#define __bitblit_peek_vector__(m_cast,m_base,m_sign,m_offset) ((m_cast)(((unsigned char *)(m_base)) m_sign (size_t)(m_offset)))
#define __bitblit_peek__(m_base,m_offset)                      __bitblit_peek_vector__(void *,m_base,+,m_offset)

void (__def_bitblit_fastcall__ bitblit)(
void *s_map, int s_bpp, int s_resx, int s_resy, int s_line_length,
const void *s_data, int s_x, int s_y, int s_w, int s_h)
{
int s_nbytes, s_tw;
void *s_ptr;
s_nbytes = s_bpp >> 3;
if(s_y < 0)
{
  s_h += s_y;
  s_data = __bitblit_peek__(s_data, (-s_y) * s_w * s_nbytes);
  s_y = 0;
}
if((s_y + s_h) >= s_resy)s_h = s_resy - s_y;
if(s_h <= 0)return;
if(s_x < 0)
{
  s_tw = s_w + s_x;
  s_data = __bitblit_peek__(s_data, (-s_x) * s_nbytes);
  s_x = 0;
}
else s_tw = s_w;
if((s_x + s_tw) >= s_resx)s_tw = s_resx - s_x;\
if(s_tw <= 0)return;
s_tw = s_tw * s_nbytes;
s_w = s_w * s_nbytes;
s_ptr = __bitblit_peek__(s_map, (s_y * s_line_length) + (s_x * s_nbytes));
while(s_h--)
{ /* 실제 blit 수행 */
  (void)memcpy(s_ptr, s_data, (size_t)s_tw); /* bpp가 다른 경우 이줄을 수정해야 겠지요. 색상변환과 함께 */
  s_data = __bitblit_peek__(s_data, s_w);
  s_ptr = __bitblit_peek__(s_ptr, s_line_length);
}
}

int main(void)
{
unsigned char s_source_map[] = { /* 5x5 8bpp bitmap : 그리고자 하는 맵 */
  1, 1, 1, 1, 1,
  1, 0, 0, 0, 1,
  1, 0, 0, 0, 1,
  1, 0, 0, 0, 1,
  1, 1, 1, 1, 1,
};

#define resx (40)   /* pixel : x 해상도 */
#define resy (25)   /* pixel : y 해상도 */
#define bpp  (8)    /* bit : 픽셀당 비트수 */
#define shadow (4) /* pixel : 보이지 않는 영역 (이 부분은 명확히 의미를 파악하셔야 합니다. 보통은 0 입니다.) */
#define line_length ((resx + shadow) * bpp)    /* bytes */
unsigned char s_fbmap[ line_length * resy ] = {0, }; /* frame buffer map */

bitblit((void *)(&s_fbmap[0]), bpp, resx, resy, line_length,
  (void *)(&s_source_map[0]), -2, -2, 5, 5);

bitblit((void *)(&s_fbmap[0]), bpp, resx, resy, line_length,
  (void *)(&s_source_map[0]), 10, 10, 5, 5);

bitblit((void *)(&s_fbmap[0]), bpp, resx, resy, line_length,
  (void *)(&s_source_map[0]), 13, 13, 5, 5);

bitblit((void *)(&s_fbmap[0]), bpp, resx, resy, line_length,
  (void *)(&s_source_map[0]), 22, 22, 5, 5);

do
{ /* H/W refresh : 여기는 그냥 하드웨어가 하는 일종의 Frame buffer 라고 보시면 됩니다. 즉, H/W 를 Text 로 에뮬레이션했다고 가정하시면 되겠습니다. */
  int s_cx, s_cy, s_offset;
  s_offset = 0;
  for(s_cy = 0;s_cy < resy;s_cy++, s_offset += line_length)
  {
   for(s_cx = 0;s_cx < resx;s_cx++)
   { /* real view */
    if(s_fbmap[s_offset + s_cx])(void)fputc('O', stdout);
    else fputc('.', stdout);
   }
   for(;s_cx < resx + shadow;s_cx++)
   { /* shadow */
    (void)fputc('X', stdout);
   }
   (void)fputc('\n', stdout);
  }
  (void)fflush(stdout);
}while(0);

return(0);
}

/* End of source */
크리에이티브 커먼즈 라이센스
Creative Commons License
2007/05/08 18:11 2007/05/08 18:11
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/88

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/88

이 소스는 WAVE 파일을 재생하는 예제로 만들려고 했으나
솔직히 버그가 좀 있습니다.
일부러 버그 못잡은게 아니고 몰라서 못잡고 있습니다.

코드:

/*
Copyright (c) 2002 Information Equipment co.,LTD.
All Right Reserved.

Code by JaeHyuk Cho <minzkn@infoeq.co.kr>

  - Little endian base
  - Simple is best
*/

#if !defined(DEF_wave_c)
#define DEF_wave_c "wave.c"

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <string.h>
#include <linux/soundcard.h>

/* Little endian */
#define DEF_WAVE_MAGIC(a,b,c,d) ( (a) | (b << 8) | (c << 16) | (d << 24) )

typedef struct
{
unsigned long Magic;           /* "RIFF" */
unsigned long Length;          /* File length */
unsigned long Type;            /* "WAVE" */
}t_WAVE_Header;

typedef struct
{
unsigned short Format;
unsigned short Channels;       /* 1 = Mono, 2 = Stereo */
unsigned long  Frequency;      /* Frequency of sample */
unsigned long  BytesPerSecond; /* Bytes per second */
unsigned short BytesPerSample; /* Bytes per sample */
unsigned short BitsPerSample;  /* Bits per sample */
}t_WAVE_FMT;

typedef struct
{
unsigned long Magic;           /* "data" */
unsigned long Length;          /* Sample count */
}t_WAVE_Chunk;

int main(int s_Argc, char **s_Argv);
int MZ_WAVE_Play(int s_Handle);

int main(int s_Argc, char **s_Argv)
{
fprintf(stdout, "MZWAVE Release 0.0.1 - Copyright (c) Information Equipment co.,LTD. - %s %s\n", __DATE__, __TIME__);
fprintf(stdout, "Code by JaeHyuk Cho , ApplicationName: MZ PCM player  , Made in korea.\n\n");   
if(s_Argc > 1)
{
  int s_Handle;
  s_Handle = open(s_Argv[1], O_RDONLY);
  if(s_Handle >= 0)
  {
   MZ_WAVE_Play(s_Handle);
   close(s_Handle);
  }
  else fprintf(stderr, "Can not open \"%s\"\n", s_Argv[1]);
}
else fprintf(stderr, "Usage: %s <wave file>\n", s_Argv[0]);
fprintf(stdout, "\nEnd of %s\n", s_Argv[0]);
return(0);
}

int MZ_WAVE_Play(int s_Handle)
{
int s_Return = (-1);
int s_ReadSize, s_DSP, s_DSP_Format, s_DSP_Channels;
t_WAVE_Header s_WAVE_Header;
t_WAVE_FMT    s_WAVE_FMT;
t_WAVE_Chunk  s_WAVE_Chunk;
s_ReadSize = read(s_Handle, (void *)&s_WAVE_Header, sizeof(s_WAVE_Header));
if(s_ReadSize == sizeof(s_WAVE_Header))
{
  if(s_WAVE_Header.Magic == DEF_WAVE_MAGIC('R', 'I', 'F', 'F'))
  {
   fprintf(stdout, "INFO: File length = %lu\n", s_WAVE_Header.Length);
   switch(s_WAVE_Header.Type)
   {
    case DEF_WAVE_MAGIC('W', 'A', 'V', 'E'):
         s_ReadSize = read(s_Handle, (void *)&s_WAVE_Chunk, sizeof(s_WAVE_Chunk));
         if(s_ReadSize == sizeof(s_WAVE_Chunk))
         {
          if(s_WAVE_Chunk.Magic == DEF_WAVE_MAGIC('f', 'm', 't', ' '))
     {
      fprintf(stdout, "INFO: Chunk length = %lu\n", s_WAVE_Chunk.Length);      
      s_ReadSize = read(s_Handle, (void *)&s_WAVE_FMT, sizeof(s_WAVE_FMT));
      if(s_ReadSize == sizeof(s_WAVE_FMT))
      {
            fprintf(stdout, "INFO: Format           = 0x%04x\n" , (unsigned int )s_WAVE_FMT.Format);
            fprintf(stdout, "INFO: Channels         = %u\n"     , (unsigned int )s_WAVE_FMT.Channels);
            fprintf(stdout, "INFO: Frequency        = %lu\n"    , (unsigned long)s_WAVE_FMT.Frequency);
            fprintf(stdout, "INFO: Bytes per second = %lu\n"    , (unsigned long)s_WAVE_FMT.BytesPerSecond);
            fprintf(stdout, "INFO: Bytes per sample = %u\n"     , (unsigned int )s_WAVE_FMT.BytesPerSample);
            fprintf(stdout, "INFO: Bits per sample  = %u\n"     , (unsigned int )s_WAVE_FMT.BitsPerSample);
            s_DSP = open("/dev/dsp", O_WRONLY);
            if(s_DSP < 0)s_DSP = open("/dev/audio", O_WRONLY);
       if(s_DSP >= 0)
       {
             if(s_WAVE_FMT.BytesPerSample == 1)s_DSP_Format = AFMT_S8;
             else s_DSP_Format   = AFMT_S16_LE;      
        s_DSP_Channels = s_WAVE_FMT.Channels;
             if(ioctl(s_DSP, SNDCTL_DSP_SETFMT, &s_DSP_Format) == 0)
        {
         if(ioctl(s_DSP, SNDCTL_DSP_CHANNELS, &s_DSP_Channels) == 0)
         {
               if(ioctl(s_DSP, SNDCTL_DSP_SPEED, &s_WAVE_FMT.Frequency) == 0)
          {
      unsigned char s_Buffer[32 << 10];   
      s_Return = 0;
           do
           {
                 s_ReadSize = read(s_Handle, (void *)&s_Buffer[0], sizeof(s_Buffer));
       if(s_ReadSize > 0)
            {
             s_Return += s_ReadSize;       
                  write(s_DSP, (void *)&s_Buffer[0], s_ReadSize);
            }
           }while(s_ReadSize > 0);   
          }
               else fprintf(stderr, "Can not ioctl SNDCTL_DSP_SPEED !!!\n");
         }
              else fprintf(stderr, "Can not ioctl SNDCTL_DSP_CHANNELS !!!\n");
        }
             else fprintf(stderr, "Can not ioctl SNDCTL_DSP_SETFMT !!!\n");
             close(s_DSP);
       }
       else fprintf(stderr, "Can not open DSP !!!\n");
      }
      else fprintf(stderr, "Can not read s_WAVE_FMT !!!\n");    
     }
     else fprintf(stderr, "Invalid Magic #1\n");
    }
         else fprintf(stderr, "Can not read s_WAVE_Chunk !!!\n");
    break;
    default:
         fprintf(stderr, "Not support format !!!\n");
         break;
   }
  }
  else fprintf(stderr, "Invalid Magic #0 !!!\n");
}
else fprintf(stderr, "Can not read s_WAVE_Header !!!\n");
return(s_Return);
}

#endif

/* End of source */
크리에이티브 커먼즈 라이센스
Creative Commons License
2007/05/08 17:33 2007/05/08 17:33
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/75

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/75

이것은 MPEG transport packet header 를 정리해본겁니다.

코드:

/* Transport stream header
   Edit by JaeHyuk Cho <mailto@infoeq.com>
*/

#define Transport stream header preview
  32bit big endian - AAAAAAAA BCDEEEEE EEEEEEEE FFGGHHHH

#define Transport stream header bit index
  A: [31..24] : Sync byte (0x47)
  B: [23]     : Transport error indicator
  C: [22]     : Payload unit start indicator
  D: [21]     : Transport priority
  E: [20..8]  : PID (Program ID)
  F: [7..6]   : Transport scrambling control
  G: [5..4]   : Adaptation field control
  H: [3..0]   : Continuity counter

#define PID range description
  PID(0)        : Program association table
  PID(1)        : Condition access table
  PID(2..15)    : Reserved packet
  PID(16..8190) : Packet
  PID(8191)     : Null packet

#define Adaptation field control description
  '00': Reserved for future use by ISO/IEC
  '01': No adaptation field, Payload only
  '10': Adaptation field only, No payload
  '11': Adaptation field followed by payload

/* End of README */
크리에이티브 커먼즈 라이센스
Creative Commons License
2007/05/08 17:29 2007/05/08 17:29
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/72

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/72

이것은 MPEG audio 에 대한 기본적인 헤더구조와 bitrate table을 정리해본겁니다.

MPEG audio header
코드:

/* MPEG audio header
   Edit by JaeHyuk Cho <mailto@infoeq.com>
*/
   
#define Frame header preview 
  32bit big endian - AAAAAAAA AAABBCCD EEEEFFGH IIJJKLMM

#define Frame header bit index
  A[31..21] : Frame sync
  B[20..19] : MPEG audio version indentification
  C[18..17] : Layer description
  D[16]     : Protection bit
  E[15..12] : Bitrate index
  F[11..10] : Sampling rate frequency index
  G[9]      : Padding bit
  H[8]      : Private bit
  I[7..6]   : Channel mode
  J[5..4]   : Mode extension
  K[3]      : Copyright
  L[2]      : Original
  M[1..0]   : Emphasis

#define Frame header description
    A: 11bit - Frame sync (All bit '1')
               '11111111 111'
    B:  2bit - MPEG audio version identification
               '00': MPEG version 2.5
          '01': Reserved
          '10': MPEG version 2.0 (ISO/IEC 13818-3)
          '11': MPEG version 1.0 (ISO/IEC 11172-3)
    C:  2bit - Layer description
               '00': Reserved
          '01': Layer III
          '10': Layer II
          '11': Layer I
    D:  1bit - Protection bit
               '0': Protected by CRC (16bit crc follow header)
          '1': Not protected
    E:  4bit - Bitrate index
               See also mpeg_audio_bitrate.txt
    F:  2bit - Sampling rate frequency index
               MPEG version 1.0
                 '00': 44100
       '01': 48000
       '10': 32000
       '11': Reserved
               MPEG version 2.0
                 '00': 22050
       '01': 24000
       '10': 16000
       '11': Reserved
               MPEG version 2.5
                 '00': 11025
       '01': 12000
       '10': 8000
       '11': Reserved
    G:  1bit - Padding bit
               '0': Frame is not padded
          '1': Frame is padded with one extra slot
          Layer I frame size
            ((12000 * Bitrate / Samplerate) + Padding) * 4
          Layer II/III frame size
            (144000 * Bitrate / Samplerate) + Padding
    H:  1bit - Private bit
    I:  2bit - Channel mode
               '00': Stereo
          '01': Joint stereo (Stereo)
          '10': Dual channel (Stereo)
          '11': Single channel (Mono)
    J:  2bit - Mode extension (Only if joint stereo)
               Layer I/II
                 '00': Bands 4 to 31
       '01': Bands 8 to 31
       '10': Bands 12 to 31
       '11': Bands 16 to 31
               Layer III
            '00': Intensity stereo off, MS stereo off
            '01': Intensity stereo on , MS stereo off
            '10': Intensity stereo off, MS stereo on
            '11': Intensity stereo on , MS stereo on
    K:  1bit - Copyright
               '0': Audio is not copyrighted
          '1': Audio is copyrighted
    L:  1bit - Original
               '0': Copy of original media
          '1': Original media
    M:  2bit - Emphasis
               '00': None
          '01': 50/15ms
          '10': Reserved
          '11': CCIT J.17

/* End of README */


MPEG audio bitrate table
코드:

/* MPEG audio bitrate table
   Edit by JaeHyuk Cho <mailto:minzkn@infoeq.com>
*/

#define hint
A: MPEG version 1.0, Layer I
B: V1,Layer II
C: V1,Layer III
D: V2,Layer I
E: V2, L2 & L3
-: Free format
x: Not use (Invalid bitrate !)

#define table
     [A] [B] [C] [D] [E]
0000   -   -   -   -   -
0001  32  32  32  32   8
0010  64  48  40  48  16
0011  96  56  48  56  24
0100 128  64  56  64  32
0101 160  80  64  80  40
0110 192  96  80  96  48
0111 224 112  96 112  56
1000 256 128 112 128  64
1001 288 160 128 144  80
1010 320 192 160 160  96
1011 352 224 192 176 112
1100 384 256 224 192 128
1101 416 320 256 224 144
1110 448 384 320 256 160
1111   x   x   x   x   x

/* End of README */
크리에이티브 커먼즈 라이센스
Creative Commons License
2007/05/08 17:28 2007/05/08 17:28
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/71

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/71

ASF 파일 demuxer 를 만들면서 정리한 GUID들입니다.
이것은 ASF specification 문서에 전부 찾을수 있는 내용입니다.(자료실 참조)

코드:

ASF_Header_Object                                               75B22630-668E-11CF-A6D9-00AA0062CE6C
ASF_Data_Object                                                 75B22636-668E-11CF-A6D9-00AA0062CE6C
ASF_Simple_Index_Object                                         33000890-E5B1-11CF-89F4-00A0C90349CB
ASF_Index_Object                                                D6E229D3-35DA-11D1-9034-00A0C90349BE
ASF_Media_Object_Index_Object                                   FEB103F8-12AD-4C64-840F-2A1D2F7AD48C
ASF_Timecode_Index_Object                                       3CB73FD0-0C4A-4803-953D-EDF7B6228F0C
ASF_File_Properties_Object                                      8CABDCA1-A947-11CF-8EE4-00C00C205365
ASF_Stream_Properties_Object                                    B7DC0791-A9B7-11CF-8EE6-00C00C205365
ASF_Header_Extension_Object                                     5FBF03B5-A92E-11CF-8EE3-00C00C205365
ASF_Codec_List_Object                                           86D15240-311D-11D0-A3A4-00A0C90348F6
ASF_Script_Command_Object                                       1EFB1A30-0B62-11D0-A39B-00A0C90348F6
ASF_Marker_Object                                               F487CD01-A951-11CF-8EE6-00C00C205365
ASF_Bitrate_Mutual_Exclusion_Object                             D6E229DC-35DA-11D1-9034-00A0C90349BE
ASF_Error_Correction_Object                                     75B22635-668E-11CF-A6D9-00AA0062CE6C
ASF_Content_Description_Object                                  75B22633-668E-11CF-A6D9-00AA0062CE6C
ASF_Extended_Content_Description_Object                         D2D0A440-E307-11D2-97F0-00A0C95EA850
ASF_Content_Branding_Object                                     2211B3FA-BD23-11D2-B4B7-00A0C955FC6E
ASF_Stream_Bitrate_Properties_Object                            7BF875CE-468D-11D1-8D82-006097C9A2B2
ASF_Content_Encryption_Object                                   2211B3FB-BD23-11D2-B4B7-00A0C955FC6E
ASF_Extended_Content_Encryption_Object                          298AE614-2622-4C17-B935-DAE07EE9289C
ASF_Digital_Signature_Object                                    2211B3FC-BD23-11D2-B4B7-00A0C955FC6E
ASF_Padding_Object                                              1806D474-CADF-4509-A4BA-9AABCB96AAE8
ASF_Extended_Stream_Properties_Object                           14E6A5CB-C672-4332-8399-A96952065B5A
ASF_Advanced_Mutual_Exclusion_Object                            A08649CF-4775-4670-8A16-6E35357566CD
ASF_Group_Mutual_Exclusion_Object                               D1465A40-5A79-4338-B71B-E36B8FD6C249
ASF_Stream_Prioritization_Object                                D4FED15B-88D3-454F-81F0-ED5C45999E24
ASF_Bandwidth_Sharing_Object                                    A69609E6-517B-11D2-B6AF-00C04FD908E9
ASF_Language_List_Object                                        7C4346A9-EFE0-4BFC-B229-393EDE415C85
ASF_Metadata_Object                                             C5F8CBEA-5BAF-4877-8467-AA8C44FA4CCA
ASF_Metadata_Library_Object                                     44231C94-9498-49D1-A141-1D134E457054
ASF_Index_Parameters_Object                                     D6E229DF-35DA-11D1-9034-00A0C90349BE
ASF_Media_Object_Index_Parameters_Object                        6B203BAD-3F11-48E4-ACA8-D7613DE2CFA7
ASF_Timecode_Index_Parameters_Object                            F55E496D-9797-4B5D-8C8B-604DFE9BFB24
ASF_Compatibility_Object                                        75B22630-668E-11CF-A6D9-00AA0062CE6C
ASF_Advanced_Content_Encryption_Object                          43058533-6981-49E6-9B74-AD12CB86D58C
ASF_Audio_Media                                                 F8699E40-5B4D-11CF-A8FD-00805F5C442B
ASF_Video_Media                                                 BC19EFC0-5B4D-11CF-A8FD-00805F5C442B
ASF_Command_Media                                               59DACFC0-59E6-11D0-A3AC-00A0C90348F6
ASF_JFIF_Media                                                  B61BE100-5B4E-11CF-A8FD-00805F5C442B
ASF_Degradable_JPEG_Media                                       35907DE0-E415-11CF-A917-00805F5C442B
ASF_File_Transfer_Media                                         91BD222C-F21C-497A-8B6D-5AA86BFC0185
ASF_Binary_Media                                                3AFB65E2-47EF-40F2-AC2C-70A90D71D343
ASF_Web_Stream_Media_Subtype                                    776257D4-C627-41CB-8F81-7AC7FF1C40CC
ASF_Web_Stream_Format                                           DA1E6B13-8359-4050-B398-388E965BF00C
ASF_No_Error_Correction                                         20FB5700-5B55-11CF-A8FD-00805F5C442B
ASF_Audio_Spread                                                BFC3CD50-618F-11CF-8BB2-00AA00B4E220
ASF_Reserved_1                                                  ABD3D211-A9BA-11cf-8EE6-00C00C205365
ASF_Content_Encryption_System_Windows_Media_DRM_Network_Devices 7A079BB6-DAA4-4e12-A5CA-91D38DC11A8D
ASF_Reserved_2                                                  86D15241-311D-11D0-A3A4-00A0C90348F6
ASF_Reserved_3                                                  4B1ACBE3-100B-11D0-A39B-00A0C90348F6
ASF_Reserved_4                                                  4CFEDB20-75F6-11CF-9C0F-00A0C90349CB
ASF_Mutex_Language                                              D6E22A00-35DA-11D1-9034-00A0C90349BE
ASF_Mutex_Bitrate                                               D6E22A01-35DA-11D1-9034-00A0C90349BE
ASF_Mutex_Unknown                                               D6E22A02-35DA-11D1-9034-00A0C90349BE
ASF_Bandwidth_Sharing_Exclusive                                 AF6060AA-5197-11D2-B6AF-00C04FD908E9
ASF_Bandwidth_Sharing_Partial                                   AF6060AB-5197-11D2-B6AF-00C04FD908E9
ASF_Payload_Extension_System_Timecode                           399595EC-8667-4E2D-8FDB-98814CE76C1E
ASF_Payload_Extension_System_File_Name                          E165EC0E-19ED-45D7-B4A7-25CBD1E28E9B
ASF_Payload_Extension_System_Content_Type                       D590DC20-07BC-436C-9CF7-F3BBFBF1A4DC
ASF_Payload_Extension_System_Pixel_Aspect_Ratio                 1B1EE554-F9EA-4BC8-821A-376B74E4C4B8
ASF_Payload_Extension_System_Sample_Duration                    C6BD9450-867F-4907-83A3-C77921B733AD
ASF_Payload_Extension_System_Encryption_Sample_ID               6698B84E-0AFA-4330-AEB2-1C0A98D7A44D


코드:

enum
{
def_mzapi_asf_Header_Object = 0,
def_mzapi_asf_Data_Object,
def_mzapi_asf_Simple_Index_Object,
def_mzapi_asf_Index_Object,
def_mzapi_asf_Media_Object_Index_Object,
def_mzapi_asf_Timecode_Index_Object,
def_mzapi_asf_File_Properties_Object,
def_mzapi_asf_Stream_Properties_Object,
def_mzapi_asf_Header_Extension_Object,
def_mzapi_asf_Codec_List_Object,
def_mzapi_asf_Script_Command_Object,
def_mzapi_asf_Marker_Object,
def_mzapi_asf_Bitrate_Mutual_Exclusion_Object,
def_mzapi_asf_Error_Correction_Object,
def_mzapi_asf_Content_Description_Object,
def_mzapi_asf_Extended_Content_Description_Object,
def_mzapi_asf_Content_Branding_Object,
def_mzapi_asf_Stream_Bitrate_Properties_Object,
def_mzapi_asf_Content_Encryption_Object,
def_mzapi_asf_Extended_Content_Encryption_Object,
def_mzapi_asf_Digital_Signature_Object,
def_mzapi_asf_Padding_Object,
def_mzapi_asf_Extended_Stream_Properties_Object,
def_mzapi_asf_Advanced_Mutual_Exclusion_Object,
def_mzapi_asf_Group_Mutual_Exclusion_Object,
def_mzapi_asf_Stream_Prioritization_Object,
def_mzapi_asf_Bandwidth_Sharing_Object,
def_mzapi_asf_Language_List_Object,
def_mzapi_asf_Metadata_Object,
def_mzapi_asf_Metadata_Library_Object,
def_mzapi_asf_Index_Parameters_Object,
def_mzapi_asf_Media_Object_Index_Parameters_Object,
def_mzapi_asf_Timecode_Index_Parameters_Object,
def_mzapi_asf_Compatibility_Object,
def_mzapi_asf_Advanced_Content_Encryption_Object,
def_mzapi_asf_Audio_Media,
def_mzapi_asf_Video_Media,
def_mzapi_asf_Command_Media,
def_mzapi_asf_JFIF_Media,
def_mzapi_asf_Degradable_JPEG_Media,
def_mzapi_asf_File_Transfer_Media,
def_mzapi_asf_Binary_Media,
def_mzapi_asf_Web_Stream_Media_Subtype,
def_mzapi_asf_Web_Stream_Format,
def_mzapi_asf_No_Error_Correction,
def_mzapi_asf_Audio_Spread,
def_mzapi_asf_Reserved_1,
def_mzapi_asf_Content_Encryption_System_Windows_Media_DRM_Network_Devices,
def_mzapi_asf_Reserved_2,
def_mzapi_asf_Reserved_3,
def_mzapi_asf_Reserved_4,
def_mzapi_asf_Mutex_Language,
def_mzapi_asf_Mutex_Bitrate,
def_mzapi_asf_Mutex_Unknown,
def_mzapi_asf_Bandwidth_Sharing_Exclusive,
def_mzapi_asf_Bandwidth_Sharing_Partial,
def_mzapi_asf_Payload_Extension_System_Timecode,
def_mzapi_asf_Payload_Extension_System_File_Name,
def_mzapi_asf_Payload_Extension_System_Content_Type,
def_mzapi_asf_Payload_Extension_System_Pixel_Aspect_Ratio,
def_mzapi_asf_Payload_Extension_System_Sample_Duration,
def_mzapi_asf_Payload_Extension_System_Encryption_Sample_ID,
def_mzapi_asf_end_of_guid,
};


코드:

struct guid
{
dword v1; /* FourCC */
word  v2;
word  v3;
byte  v4[8];
}guids[] = {
/* Top-level ASF object GUIDS */
{0x75B22630, 0x668E, 0x11CF, {0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C}}, /* Header_Object                          */
{0x75B22636, 0x668E, 0x11CF, {0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C}}, /* Data_Object                            */
{0x33000890, 0xE5B1, 0x11CF, {0x89, 0xF4, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xCB}}, /* Simple_Index_Object                    */
{0xD6E229D3, 0x35DA, 0x11D1, {0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE}}, /* Index_Object                           */
{0xFEB103F8, 0x12AD, 0x4C64, {0x84, 0x0F, 0x2A, 0x1D, 0x2F, 0x7A, 0xD4, 0x8C}}, /* Media_Object_Index_Object              */
{0x3CB73FD0, 0x0C4A, 0x4803, {0x95, 0x3D, 0xED, 0xF7, 0xB6, 0x22, 0x8F, 0x0C}}, /* Timecode_Index_Object                  */
/* Header Object GUIDs */
{0x8CABDCA1, 0xA947, 0x11CF, {0x8E, 0xE4, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65}}, /* File_Properties_Object                 */
{0xB7DC0791, 0xA9B7, 0x11CF, {0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65}}, /* Stream_Properties_Object               */
{0x5FBF03B5, 0xA92E, 0x11CF, {0x8E, 0xE3, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65}}, /* Header_Extension_Object                */
{0x86D15240, 0x311D, 0x11D0, {0xA3, 0xA4, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6}}, /* Codec_List_Object                      */
{0x1EFB1A30, 0x0B62, 0x11D0, {0xA3, 0x9B, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6}}, /* Script_Command_Object                  */
{0xF487CD01, 0xA951, 0x11CF, {0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65}}, /* Marker_Object                          */
{0xD6E229DC, 0x35DA, 0x11D1, {0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE}}, /* Bitrate_Mutual_Exclusion_Object        */
{0x75B22635, 0x668E, 0x11CF, {0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C}}, /* Error_Correction_Object                */
{0x75B22633, 0x668E, 0x11CF, {0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C}}, /* Content_Description_Object             */
{0xD2D0A440, 0xE307, 0x11D2, {0x97, 0xF0, 0x00, 0xA0, 0xC9, 0x5E, 0xA8, 0x50}}, /* Extended_Content_Description_Object    */
{0x2211B3FA, 0xBD23, 0x11D2, {0xB4, 0xB7, 0x00, 0xA0, 0xC9, 0x55, 0xFC, 0x6E}}, /* Content_Branding_Object                */
{0x7BF875CE, 0x468D, 0x11D1, {0x8D, 0x82, 0x00, 0x60, 0x97, 0xC9, 0xA2, 0xB2}}, /* Stream_Bitrate_Properties_Object       */
{0x2211B3FB, 0xBD23, 0x11D2, {0xB4, 0xB7, 0x00, 0xA0, 0xC9, 0x55, 0xFC, 0x6E}}, /* Content_Encryption_Object              */
{0x298AE614, 0x2622, 0x4C17, {0xB9, 0x35, 0xDA, 0xE0, 0x7E, 0xE9, 0x28, 0x9C}}, /* Extended_Content_Encryption_Object     */
{0x2211B3FC, 0xBD23, 0x11D2, {0xB4, 0xB7, 0x00, 0xA0, 0xC9, 0x55, 0xFC, 0x6E}}, /* Digital_Signature_Object               */
{0x1806D474, 0xCADF, 0x4509, {0xA4, 0xBA, 0x9A, 0xAB, 0xCB, 0x96, 0xAA, 0xE8}}, /* Padding_Object                         */
/* Header Extension Object GUIDs */
{0x14E6A5CB, 0xC672, 0x4332, {0x83, 0x99, 0xA9, 0x69, 0x52, 0x06, 0x5B, 0x5A}}, /* Extended_Stream_Properties_Object      */
{0xA08649CF, 0x4775, 0x4670, {0x8A, 0x16, 0x6E, 0x35, 0x35, 0x75, 0x66, 0xCD}}, /* Advanced_Mutual_Exclusion_Object       */
{0xD1465A40, 0x5A79, 0x4338, {0xB7, 0x1B, 0xE3, 0x6B, 0x8F, 0xD6, 0xC2, 0x49}}, /* Group_Mutual_Exclusion_Object          */
{0xD4FED15B, 0x88D3, 0x454F, {0x81, 0xF0, 0xED, 0x5C, 0x45, 0x99, 0x9E, 0x24}}, /* Stream_Prioritization_Object           */
{0xA69609E6, 0x517B, 0x11D2, {0xB6, 0xAF, 0x00, 0xC0, 0x4F, 0xD9, 0x08, 0xE9}}, /* Bandwidth_Sharing_Object               */
{0x7C4346A9, 0xEFE0, 0x4BFC, {0xB2, 0x29, 0x39, 0x3E, 0xDE, 0x41, 0x5C, 0x85}}, /* Language_List_Object                   */
{0xC5F8CBEA, 0x5BAF, 0x4877, {0x84, 0x67, 0xAA, 0x8C, 0x44, 0xFA, 0x4C, 0xCA}}, /* Metadata_Object                        */
{0x44231C94, 0x9498, 0x49D1, {0xA1, 0x41, 0x1D, 0x13, 0x4E, 0x45, 0x70, 0x54}}, /* Metadata_Library_Object                */
{0xD6E229DF, 0x35DA, 0x11D1, {0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE}}, /* Index_Parameters_Object                */
{0x6B203BAD, 0x3F11, 0x48E4, {0xAC, 0xA8, 0xD7, 0x61, 0x3D, 0xE2, 0xCF, 0xA7}}, /* Media_Object_Index_Parameters_Object   */
{0xF55E496D, 0x9797, 0x4B5D, {0x8C, 0x8B, 0x60, 0x4D, 0xFE, 0x9B, 0xFB, 0x24}}, /* Timecode_Index_Parameters_Object       */
{0x75B22630, 0x668E, 0x11CF, {0xA6, 0xD9, 0x00, 0xAA, 0x00, 0x62, 0xCE, 0x6C}}, /* Compatibility_Object                   */
{0x43058533, 0x6981, 0x49E6, {0x9B, 0x74, 0xAD, 0x12, 0xCB, 0x86, 0xD5, 0x8C}}, /* Advanced_Content_Encryption_Object     */
/* Stream Properties Object Stream Type GUIDs */
{0xF8699E40, 0x5B4D, 0x11CF, {0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B}}, /* Audio_Media                            */
{0xBC19EFC0, 0x5B4D, 0x11CF, {0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B}}, /* Video_Media                            */
{0x59DACFC0, 0x59E6, 0x11D0, {0xA3, 0xAC, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6}}, /* Command_Media                          */
{0xB61BE100, 0x5B4E, 0x11CF, {0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B}}, /* JFIF_Media                             */
{0x35907DE0, 0xE415, 0x11CF, {0xA9, 0x17, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B}}, /* Degradable_JPEG_Media                  */
{0x91BD222C, 0xF21C, 0x497A, {0x8B, 0x6D, 0x5A, 0xA8, 0x6B, 0xFC, 0x01, 0x85}}, /* File_Transfer_Media                    */
{0x3AFB65E2, 0x47EF, 0x40F2, {0xAC, 0x2C, 0x70, 0xA9, 0x0D, 0x71, 0xD3, 0x43}}, /* Binary_Media                           */
/* Web stream Type-Specific Data GUIDs */
{0x776257D4, 0xC627, 0x41CB, {0x8F, 0x81, 0x7A, 0xC7, 0xFF, 0x1C, 0x40, 0xCC}}, /* Web_Stream_Media_Subtype               */
{0xDA1E6B13, 0x8359, 0x4050, {0xB3, 0x98, 0x38, 0x8E, 0x96, 0x5B, 0xF0, 0x0C}}, /* Web_Stream_Format                      */
/* Stream Properties Object Error Correction Type GUIDs */
{0x20FB5700, 0x5B55, 0x11CF, {0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B}}, /* No_Error_Correction                    */
{0xBFC3CD50, 0x618F, 0x11CF, {0x8B, 0xB2, 0x00, 0xAA, 0x00, 0xB4, 0xE2, 0x20}}, /* Audio_Spread                           */
/* Header Extension Object GUIDs */
{0xABD3D211, 0xA9BA, 0x11cf, {0x8E, 0xE6, 0x00, 0xC0, 0x0C, 0x20, 0x53, 0x65}}, /* Reserved_1                             */
/* Advanced Content Encryption Object System ID GUIDs */
{0x7A079BB6, 0xDAA4, 0x4e12, {0xA5, 0xCA, 0x91, 0xD3, 0x8D, 0xC1, 0x1A, 0x8D}}, /* Content_Encryption_System_Windows_Media_DRM_Network_Devices */
/* Codec List Object GUIDs */
{0x86D15241, 0x311D, 0x11D0, {0xA3, 0xA4, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6}}, /* Reserved_2                             */
/* Script Command Object GUIDs */
{0x4B1ACBE3, 0x100B, 0x11D0, {0xA3, 0x9B, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6}}, /* Reserved_3                             */
/* Marker Object GUIDs */
{0x4CFEDB20, 0x75F6, 0x11CF, {0x9C, 0x0F, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xCB}}, /* Reserved_4                             */
/* Mutual Exclusion Object Exclusion Type GUIDs */
{0xD6E22A00, 0x35DA, 0x11D1, {0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE}}, /* Mutex_Language                         */
{0xD6E22A01, 0x35DA, 0x11D1, {0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE}}, /* Mutex_Bitrate                          */
{0xD6E22A02, 0x35DA, 0x11D1, {0x90, 0x34, 0x00, 0xA0, 0xC9, 0x03, 0x49, 0xBE}}, /* Mutex_Unknown                          */
/* Bandwidth Sharing Object GUIDs */
{0xAF6060AA, 0x5197, 0x11D2, {0xB6, 0xAF, 0x00, 0xC0, 0x4F, 0xD9, 0x08, 0xE9}}, /* Bandwidth_Sharing_Exclusive            */
{0xAF6060AB, 0x5197, 0x11D2, {0xB6, 0xAF, 0x00, 0xC0, 0x4F, 0xD9, 0x08, 0xE9}}, /* Bandwidth_Sharing_Partial              */
/* Standard Payload Extension System GUIDs */
{0x399595EC, 0x8667, 0x4E2D, {0x8F, 0xDB, 0x98, 0x81, 0x4C, 0xE7, 0x6C, 0x1E}}, /* Payload_Extension_System_Timecode      */
{0xE165EC0E, 0x19ED, 0x45D7, {0xB4, 0xA7, 0x25, 0xCB, 0xD1, 0xE2, 0x8E, 0x9B}}, /* Payload_Extension_System_File_Name     */
{0xD590DC20, 0x07BC, 0x436C, {0x9C, 0xF7, 0xF3, 0xBB, 0xFB, 0xF1, 0xA4, 0xDC}}, /* Payload_Extension_System_Content_Type  */
 {0x1B1EE554, 0xF9EA, 0x4BC8, {0x82, 0x1A, 0x37, 0x6B, 0x74, 0xE4, 0xC4, 0xB8}}, /* Payload_Extension_System_Pixel_Aspect_Ratio                 */
 {0xC6BD9450, 0x867F, 0x4907, {0x83, 0xA3, 0xC7, 0x79, 0x21, 0xB7, 0x33, 0xAD}}, /* Payload_Extension_System_Sample_Duration                    */
 {0x6698B84E, 0x0AFA, 0x4330, {0xAE, 0xB2, 0x1C, 0x0A, 0x98, 0xD7, 0xA4, 0x4D}}, /* Payload_Extension_System_Encryption_Sample_ID               */
/* end of guid */
{0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}  /* end of guid -------------------------- */
};
크리에이티브 커먼즈 라이센스
Creative Commons License
2007/05/08 17:26 2007/05/08 17:26
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/70

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/70

sin함수와 cos함수의 기본적인 사용을 이해하고 /dev/dsp 의 조작에 대한 간략한 예를 위해 만들어봤습니다.

코드:

/*
Copyright (c) 2002 Information Equipment co.,LTD.
All Right Reserved.

Code by JaeHyuk Cho <minzkn@infoeq.com>
*/

#if !defined(DEF_sound_c)
#define DEF_sound_c "sound.c"

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <string.h>
#include <math.h>
#include <linux/soundcard.h>

int MZ_SetupDSP(int s_Handle, int s_Channels, int s_Freq);
void MZ_Beep(int s_Second, int s_Freq);
int main(int s_Argc, char **s_Argv);

int MZ_SetupDSP(int s_Handle, int s_Channels, int s_Freq)
{
int s_Return = (-1);
int s_Format;
s_Format = AFMT_S16_NE;
if(ioctl(s_Handle, SNDCTL_DSP_SETFMT, &s_Format) != (-1))
{
  if(s_Format == AFMT_S16_NE)
  {
   if(ioctl(s_Handle, SNDCTL_DSP_CHANNELS, &s_Channels) != (-1))
   {
    if(ioctl(s_Handle, SNDCTL_DSP_SPEED, &s_Freq) != -1)s_Return = s_Freq;
    else fprintf(stderr, "sound.c: MZ_SetupDSP - [ERROR] Can not ioctl SPEED !!!\n");
   }
   else fprintf(stderr, "sound.c: MZ_SetupDSP - [ERROR] Can not ioctl CHANNEL !!!\n");
  }
  else fprintf(stderr, "sound.c: MZ_SetupDSP - [ERROR] s_Format is not support AFMT_S16_NE !!!\n");
}
else fprintf(stderr, "sound.c: MZ_SetupDSP - [ERROR] Can not ioctl DSP_SETFMT !!!\n");
return(s_Return);
}

void MZ_Beep(int s_Second, int s_Freq)
{
short *s_Sample;
int s_Handle;
s_Handle = open("/dev/dsp", O_RDWR);
if(s_Handle >= 0)
{
  MZ_SetupDSP(s_Handle, 2, 44100);
  s_Sample = (short *)malloc((44100 << 1) * sizeof(short));
  if(s_Sample)
  {
   double s_PI = 0.0, s_Grid;
   int s_Index = 0, s_Level;
   s_Grid = ((double)s_Freq / 44100.0) * (2.0 * M_PI);
   s_Level = (32768 >> 1) - 1;
   for(s_Index = 0;s_Index < 44100;s_Index++)
   {
    *(s_Sample + (s_Index << 1) + 0) = (short)(sin(s_PI) * (double)(s_Level));
    *(s_Sample + (s_Index << 1) + 1) = (short)(-sin(s_PI) * (double)(s_Level));
    s_PI += s_Grid;
    if(s_PI >= (2.0 * M_PI))s_PI = 0.0;
   }
   while(s_Second--)write(s_Handle, (void *)s_Sample, (44100 << 1) * sizeof(short));
   free(s_Sample);
  }
  else fprintf(stderr, "%s: %s - [ERROR] s_Sample is null !!!\n", __FILE__, __FUNCTION__);
  close(s_Handle);
}
else fprintf(stderr, "%s: %s - [ERROR] Can not open dsp !!!\n", __FILE__, __FUNCTION__);
}

int main(int s_Argc, char **s_Argv)
{
if(s_Argc >= 3)
{
  int s_PlayTime;
  int s_Frequency;
  sscanf(s_Argv[1], "%i", &s_PlayTime);
  sscanf(s_Argv[2], "%i", &s_Frequency);
  MZ_Beep(s_PlayTime, s_Frequency /* Hz */);
}
else
{
  fprintf(stdout, "usage: %s <Play second> <Frequency>\n", s_Argv[0]);
  fprintf(stdout, "\tExample: bash# %s 1 1000\n", s_Argv[0]);
}
return(0);
}

#endif

/* End of source */
크리에이티브 커먼즈 라이센스
Creative Commons License
2007/05/05 02:35 2007/05/05 02:35
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/55

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/55

다음과 같이 AL에 VESA기능 함수번호를 넣고 인자를 전달해주면 됩니다.
코드:

MOV AH, 04FH ; VESA BIOS function
MOV AL, <VESA function>
INT 10H


반환상태는 AH에 성공여부 및 기타 반환값을 넘겨받게 되며 VESA지원이 가능하다면
AL에는 04FH값이 항상 반환됩니다.
AH의 반환값이 0인 경우는 성공이며 나머지는 에러입니다.

* 첫번째 기능 : 비디오 정보 얻어오기
코드:
  MOV AH, 04FH
  MOV AL, 00H
  ES:DI = <256 byte buffer : 이곳에 정보가 실려집니다.>
  INT 10H


* 두번째 기능 : 비디오 모드의 유효정보 얻어오기
코드:
  MOV AH, 04FH
  MOV AL, 01H
  MOV CX, <비디오 모드>
  ES:DI = <256 byte buffer : 이곳에 정보가 실려집니다.>
  INT 10H


* 세번째 기능 : 비디오 모드의 설정
코드:
  MOV AH, 04FH
  MOV AL, 02H
  MOV BX, <비디오 모드>
  INT 10H


- 주요 비디오 모드 번호
인용:
0100H 640x400 8bpp
0101H 640x480 8bpp
0102H 800x600 4bpp
0103H 800x600 8bpp
0104H 1024x768 4bpp
0105H 1024x768 8bpp
0106H 1280x1024 4bpp
0107H 1280x1024 8bpp
0111H 640x480 16bpp
0112H 640x480 24bpp
0114H 800x600 16bpp
0115H 800x600 24bpp
0117H 1024x768 16bpp (제가 가장 애용하는 이쁜모드 ㅋㅋ)
0118H 1024x768 24bpp
011AH 1280x1024 16bpp
011BH 1280x1024 24bpp


비디오 모드는 0~7번 비트는 모드번호를 사용하며 8번 비트는 1인경우 VESA mode 를 뜻하며
9~14번 비트는 잘모르겠고 15번 비트가 1인경우 화면을 소거해주는 기능을 동반합니다.

Linux 에서의 VESA frame buffer mode 번호는 이 VESA 모드에 0200H를 더해서 표현을 합니다.

* 네번째 기능 : 비디오 모드 검출
코드:
  MOV AH, 04FH
  MOV AL, 03H
  INT 10H

반환: BX에 현재 비디오 모드값이 반환됩니다.

* 다섯번째 기능 : 비디오 상태의 저장 및 복구
코드:
  MOV AH, 04FH
  MOV AL, 04H
  MOV DL, <세부기능 번호 : 0=상태확인, 1=상태저장, 2=상태복구>
  MOV CX, <상태선택번호 : 잘 모르겠음... 누군가 알려주세요.>
  ES:BX = <DL이 1 또는 2인 경우 저장/복구할 버퍼의 주소>
  INT 10H


* 여섯번쨰 기능 : 뱅크(페이지) 선택제어
코드:
  MOV AH, 04FH
  MOV AL, 05H
  MOV BH, <00H=뱅크선택, 01H=뱅크얻기>
  MOV BL, <00H=페이지0, 01H=페이지1>
  MOV DX, <뱅크번호>
  INT 10H



이상이 VESA주요기능이며
다섯번째 기능은 저도 정확히 버퍼의 내용이 어떻게 채워지는지 모르겠습니다.
혹시 아시는분은 리플 부탁드려요.

기본적인 기능은 세번째/여벗번째 기능만으로 점하나 표시는 할수 있을겁니다.

32비트 보호모드에서는 좀더 세련된 방법이 있는지 저도 잘 모르겠으나 vm86 모드를 사용하는게
적합하지 않을까라는 생각만 하고 있습니다. 혹시 다른 좋은 방안 있다면 이것도 리플 부탁합니다.

혹시 듀얼뱅트 지원이 VESA에서 가능한지 가능유무를 알고 계시다면 그것도 리플좀 부탁합니다.
크리에이티브 커먼즈 라이센스
Creative Commons License
2007/05/05 02:08 2007/05/05 02:08
TAG
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/41

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/41

YM3812 driver

Programming/Multimedia RSS Icon ATOM Icon 2007/05/01 03:02 조재혁
지금보면 내가 이거 어떻게 만들었는지 전혀 이해안감.




; /***************************************
;  *         Copyright(c)1998-1998       *
;  *        MC Compiler source (SOUND)   *
;  *         Code by Cho JaeHyuk         *
;  *     MINZ <mailto:minzkn@infoeq.com  *
;  ***************************************/

; SOUN.ASM

.286

include            mcseg.inc

public             YM_register
public             YM_enablewave
public             YM_disablewave
public             YM_method1
public             YM_method2
public             YM_method3
public             YM_method4
public             YM_method5
public             YM_method6
public             YM_selectwave
public             YM_frequency_on
public             YM_frequency_off
public             YM_iscard

                   assume cs:_TEXT
_TEXT              segment byte public use16 'CODE'
YM_register        proc far ; void far pascal YM_register(unsigned int, unsigned int)
                   push bp
                   mov bp, sp
                   mov dx, 0388h
                   mov al, byte ptr [bp + 8]
                   out dx, al
                   mov cx, 0006h
YM_reg00@:         in al, dx
                   loop short YM_reg00@
                   inc dx
                   mov al, [bp + 6]
                   out dx, al
                   dec dx
                   mov cx, 35
YM_reg01@:         in al, dx
                   loop short YM_reg01@
                   pop bp
                   retf 2 + 2
YM_register        endp
YM_enablewave      proc far ; void far pascal YM_enablewave(void)
                   push 0001h
                   push 0020h
                   call far ptr _TEXT:YM_register
                   retf
YM_enablewave      endp
YM_disablewave     proc far ; void far pascal YM_disablewave(void)
                   push 0001h
                   push 0000h
                   call far ptr _TEXT:YM_register
                   retf
YM_disablewave     endp
YM_method1         proc far ; void far pascal YM_method1(word, word, word, word, word, word)
                   push bp
                   mov bp, sp
                   mov ax, 0020h
                   add ax, word ptr [bp + 16]
                   push ax
                   mov dx, word ptr [bp + 14]
                   shl dx, 7
                   mov ax, word ptr [bp + 12]
                   shl ax, 6
                   or dx, ax
                   mov ax, word ptr [bp + 10]
                   shl ax, 5
                   or dx, ax
                   mov ax, word ptr [bp + 8]
                   shl ax, 4
                   or ax, dx
                   or ax, word ptr [bp + 6]
                   push ax
                   call far ptr _TEXT:YM_register
                   pop bp
                   retf 2 + 2 + 2 + 2 + 2 + 2
YM_method1         endp
YM_method2         proc far ; void far pascal YM_method2(word, word, word)
                   push bp
                   mov bp, sp
                   mov ax, 0040h
                   add ax, word ptr [bp + 10]
                   push ax
                   mov ax, word ptr [bp + 8]
                   shl ax, 6
                   or ax, word ptr [bp + 6]
                   push ax
                   call far ptr _TEXT:YM_register
                   pop bp
                   retf 2 + 2 + 2
YM_method2         endp
YM_method3         proc far ; void far pascal YM_method3(word, word, word)
                   push bp
                   mov bp, sp
                   mov ax, 0060h
                   add ax, word ptr [bp + 10]
                   push ax
                   mov ax, word ptr [bp + 8]
                   shl ax, 4
                   or ax, word ptr [bp + 6]
                   push ax
                   call far ptr _TEXT:YM_register
                   pop bp
                   retf 2 + 2 + 2
YM_method3         endp
YM_method4         proc far ; void far pascal YM_method4(word, word, word)
                   push bp
                   mov bp, sp
                   mov ax, 0080h
                   add ax, word ptr [bp + 10]
                   push ax
                   mov ax, word ptr [bp + 8]
                   shl ax, 4
                   or ax, word ptr [bp + 6]
                   push ax
                   call far ptr _TEXT:YM_register
                   pop bp
                   retf 2 + 2 + 2
YM_method4         endp
YM_method5         proc far ; void far pascal YM_method5(word, word, word)
                   push bp
                   mov bp, sp
                   push 00bdh
                   mov dx, word ptr [bp + 10]
                   shl dx, 7
                   mov ax, word ptr [bp + 8]
                   shl ax, 6
                   or dx, ax
                   mov ax, word ptr [bp + 6]
                   shl ax, 5
                   or dx, ax
                   mov ax, word ptr [bp + 6]
                   and ax, 001fh
                   or ax, dx
                   push ax
                   call far ptr _TEXT:YM_register
                   pop bp
                   retf 2 + 2 + 2
YM_method5         endp
YM_method6         proc far ; void far pascal YM_method6(word, word, word)
                   push bp
                   mov bp, sp
                   mov ax, 00c0h
                   add ax, word ptr [bp + 10]
                   push ax
                   mov ax, word ptr [bp + 8]
                   shl ax, 1
                   or ax, word ptr [bp + 6]
                   push ax
                   call far ptr _TEXT:YM_register
                   pop bp
                   retf 2 + 2 + 2
YM_method6         endp
YM_selectwave      proc far ; void far pascal YM_selectwave(unsigned int, unsigned int)
                   push bp
                   mov bp, sp
                   mov ax, 00e0h
                   add ax, word ptr [bp + 8]
                   push ax
                   push word ptr [bp + 6]
                   call far ptr _TEXT:YM_register
                   pop bp
                   retf 2 + 2
YM_selectwave      endp
YM_frequency_on    proc far ; void far pascal YM_frquency_on(unsigned int, unsigned int, unsigned int)
                   push bp
                   mov bp, sp
                   mov ax, 00a0h
                   add ax, word ptr [bp + 10]
                   push ax
                   push word ptr [bp + 8]
                   call far ptr _TEXT:YM_register
                   mov ax, 00b0h
                   add ax, word ptr [bp + 10]
                   push ax
                   mov ax, word ptr [bp + 8]
                   shr ax, 8
                   or ax, word ptr [bp + 6]
                   or ax, 0032h
                   push ax
                   call far ptr _TEXT:YM_register
                   pop bp
                   retf 2 + 2 + 2
YM_frequency_on    endp
YM_frequency_off   proc far ; void far pascal YM_frquency_off(unsigned int, unsigned int, unsigned int)
                   push bp
                   mov bp, sp
                   mov ax, 00a0h
                   add ax, word ptr [bp + 10]
                   push ax
                   push word ptr [bp + 8]
                   call far ptr _TEXT:YM_register
                   mov ax, 00b0h
                   add ax, word ptr [bp + 10]
                   push ax
                   mov ax, word ptr [bp + 8]
                   shr ax, 8
                   or ax, word ptr [bp + 6]
                   push ax
                   call far ptr _TEXT:YM_register
                   pop bp
                   retf 2 + 2 + 2
YM_frequency_off   endp
YM_iscard          proc far ; unsigned int far pascal YM_iscard(void)
                   push 0004h
                   push 0060h
                   call far ptr _TEXT:YM_register
                   push 0004h
                   push 0080h
                   call far ptr _TEXT:YM_register
                   mov dx, 0388h
                   in al, dx
                   push ax ; ---------- _time[0]
                   push 0002h
                   push 00ffh
                   call far ptr _TEXT:YM_register
                   push 0004h
                   push 0021h
                   call far ptr _TEXT:YM_register
                   mov dx, 0388h
                   mov cx, 201
YM_iscard00@:      in al, dx
                   loop short YM_iscard00@
                   push ax ; ---------- _time[1]
                   push 0004h
                   push 0060h
                   call far ptr _TEXT:YM_register
                   push 0004h
                   push 0080h
                   call far ptr _TEXT:YM_register
                   pop dx ; ----------- _time[1]
                   pop ax ; ----------- _time[0]
                   and dx, 00e0h
                   and ax, 00e0h
                   or ax, ax
                   jnz YM_iscard01@
                   cmp dx, 00c0h
                   jne YM_iscard01@
                   mov ax, 0001h
                   retf
YM_iscard01@:      xor ax, ax
                   retf
YM_iscard          endp
_TEXT              ends

                   assume ds:DGROUP
_CONST             segment byte public use16 'CONST'
YM_instrument      db  0,  0,  0,  0,  1,  1, 15, 15,  1,  5,  3,  0 ; unsigned char YM_instrument[6][12]
                   db  0,  0,  1,  0,  0,  0, 18, 13,  1, 14,  3,  0
                   db  0,  0,  1,  1,  1,  0, 15, 11,  7,  7,  0,  0
                   db  0,  0,  0,  1,  1,  1, 20,  3,  2,  2,  2,  0
                   db  0,  0,  1,  1,  2,  1, 22,  3,  2,  2,  2,  0
                   db  0,  0,  1,  1,  1,  0, 28, 15,  2,  2,  2,  0
YM_frequency       dw 345, 365, 387, 410, 435, 460, 488, 517, 547, 580, 615, 651 ; unsigned int YM_frequency[12]
_CONST             ends

                   assume ds:DGROUP
_DATA              segment byte public use16 'DATA'
_DATA              ends
                   end

; End of source
크리에이티브 커먼즈 라이센스
Creative Commons License
2007/05/01 03:02 2007/05/01 03:02
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/30

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/30

Beep 프로시져에서 Delay부분은 직접 구현하며 Delay구현은 꽤 양이 많은 관계로 올리지 않음
아니면 Sound 프로시져만 복사하셔서 스택에 herz 값만 넣고 호출해도 된다는...




; -------------------------- pcspeaker.asm -------------------------
COMMENT #
Copyright (c) 2000 MINZ O/S
Code by JaeHyuk Cho <mailto:minzkn@infoeq.com>
#

Sound              PROC FAR ; void far pascal Sound(unsigned int s_herz)
                   PUSH BP
                   MOV BP, SP
                   PUSH AX
                   PUSH BX
                   PUSH DX
                   MOV BX, WORD PTR [BP + 06h]             ; s_herz
                   MOV AX, 34DDh
                   MOV DX, 0012h
                   CMP DX, BX
                   JNB SHORT L_Sound_01
                   DIV BX
                   MOV BX, AX
                   IN AL, 61h
                   TEST AL, 03h
                   JNE SHORT L_Sound_00
                   OR AL, 03h
                   OUT 61h, AL
                   MOV AL, 0B6h
                   OUT 43h, AL
L_Sound_00         LABEL SHORT
                   MOV AL, BL
                   OUT 42h, AL
                   MOV AL, BH
                   OUT 42h, AL
L_Sound_01         LABEL SHORT
                   POP DX
                   POP BX
                   POP AX
                   POP BP
                   RETF 2
Sound              ENDP
NoSound            PROC FAR ; void far pascal NoSound(void)
                   PUSH AX
                   IN AL, 61h
                   AND AL, 0FCh
                   OUT 61h, AL
                   POP AX
                   RETF
NoSound            ENDP
Beep               PROC FAR ; void far pascal Beep(unsigned int s_herz, unsigned int s_delay)
                   PUSH BP
                   MOV BP, SP
                   PUSH WORD PTR [BP + 08h]                ; s_herz
                   CALL FAR PTR CODE_SPEAKER:Sound
                   PUSH WORD PTR [BP + 06h]                ; s_delay
                   CALL FAR PTR CODE_TIME:Delay
                   CALL FAR PTR CODE_SPEAKER:NoSound
                   POP BP
                   RETF 2 + 2
Beep               ENDP

; End of source
크리에이티브 커먼즈 라이센스
Creative Commons License
2007/05/01 02:14 2007/05/01 02:14
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/19

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/19


dsp.asm 을 compile & link 하여 실행파일을 만들고 실행하면 천둥소리 나도록 만들었던 오래된 소스
크리에이티브 커먼즈 라이센스
Creative Commons License
2007/05/01 02:11 2007/05/01 02:11
받은 트랙백이 없고, 댓글이 없습니다.

댓글+트랙백 RSS :: http://blog.hwport.com/rss/response/18

댓글+트랙백 ATOM :: http://blog.hwport.com/atom/response/18