Diff for /np2/font/fontpc88.c between versions 1.1 and 1.5

version 1.1, 2003/10/16 17:58:36 version 1.5, 2005/02/07 14:46:10
Line 1 Line 1
 #include        "compiler.h"  #include        "compiler.h"
 #include        "dosio.h"  #include        "dosio.h"
 #include        "memory.h"  #include        "cpucore.h"
 #include        "font.h"  #include        "font.h"
 #include        "fontdata.h"  #include        "fontdata.h"
   
   
 static void pc88knjcpy1(BYTE *dst, const BYTE *src, int from, int to) {  static void pc88knjcpy1(UINT8 *dst, const UINT8 *src, int from, int to) {
   
         int             i;          int             i;
         int             j;          int             j;
         int             k;          int             k;
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
   
         for (i=from; i<to; i++) {          for (i=from; i<to; i++) {
                 q = dst + 0x21000 + (i << 4);                  q = dst + 0x21000 + (i << 4);
Line 42  const BYTE *p; Line 42  const BYTE *p;
         }          }
 }  }
   
 static void pc88knjcpy2(BYTE *dst, const BYTE *src, int from, int to) {  static void pc88knjcpy2(UINT8 *dst, const UINT8 *src, int from, int to) {
   
         int             i, j, k;          int             i, j, k;
 const BYTE      *p;  const UINT8     *p;
         BYTE    *q;          UINT8   *q;
   
         for (i=from; i<to; i++) {          for (i=from; i<to; i++) {
                 q = dst + 0x21000 + (i << 4);                  q = dst + 0x21000 + (i << 4);
Line 78  const BYTE *p; Line 78  const BYTE *p;
         }          }
 }  }
   
 BYTE fontpc88_read(const char *filename, BYTE loading) {  UINT8 fontpc88_read(const char *filename, UINT8 loading) {
   
         FILEH   fh;          FILEH   fh;
         BYTE    *work;          UINT8   *work;
         char    fname[MAX_PATH];          char    fname[MAX_PATH];
   
         work = (BYTE *)_MALLOC(0x20000, "pc88font");          work = (UINT8 *)_MALLOC(0x20000, "pc88font");
         if (work == NULL) {          if (work == NULL) {
                 goto fr88_err1;                  goto fr88_err1;
         }          }
Line 103  BYTE fontpc88_read(const char *filename, Line 103  BYTE fontpc88_read(const char *filename,
                                 // 8dot ANKを読む必要があるか                                  // 8dot ANKを読む必要があるか
                                 if (loading & FONT_ANK8) {                                  if (loading & FONT_ANK8) {
                                         loading &= ~FONT_ANK8;                                          loading &= ~FONT_ANK8;
                                         CopyMemory(font + 0x82000, work + 0x1000, 8*256);                                          fontdata_ank8store(work + 0x1000, 0, 256);
                                 }                                  }
   
                                 // 16dot ASCIIを読む必要があるか                                  // 16dot ASCIIを読む必要があるか
                                 if (loading & FONT_ANK16a) {                                  if (loading & FONT_ANK16a) {
                                         loading &= ~FONT_ANK16a;                                          loading &= ~FONT_ANK16a;
                                         CopyMemory(font + 0x80000, work + 0x0000, 16*128);                                          CopyMemory(fontrom + 0x80000, work + 0x0000, 16*128);
                                 }                                  }
   
                                 // 16dot ANK(0x80〜)を読む必要があるか                                  // 16dot ANK(0x80〜)を読む必要があるか
                                 if (loading & FONT_ANK16b) {                                  if (loading & FONT_ANK16b) {
                                         loading &= ~FONT_ANK16b;                                          loading &= ~FONT_ANK16b;
                                         CopyMemory(font + 0x80800, work + 0x0800, 16*128);                                          CopyMemory(fontrom + 0x80800, work + 0x0800, 16*128);
                                 }                                  }
   
                                 // 第一水準漢字を読み込む?                                  // 第一水準漢字を読み込む?
                                 if (loading & FONT_KNJ1) {                                  if (loading & FONT_KNJ1) {
                                         loading &= ~FONT_KNJ1;                                          loading &= ~FONT_KNJ1;
                                         pc88knjcpy1(font, work, 0x01, 0x30);                                          pc88knjcpy1(fontrom, work, 0x01, 0x30);
                                         fontdata_patchjis();                                          fontdata_patchjis();
                                 }                                  }
                         }                          }
Line 142  BYTE fontpc88_read(const char *filename, Line 142  BYTE fontpc88_read(const char *filename,
                         if (file_read(fh, work, 0x20000) == 0x20000) {                          if (file_read(fh, work, 0x20000) == 0x20000) {
   
                                 loading &= ~FONT_KNJ2;                                  loading &= ~FONT_KNJ2;
                                 pc88knjcpy2(font, work, 0x31, 0x56);                                  pc88knjcpy2(fontrom, work, 0x31, 0x56);
                         }                          }
   
                         // クローズして セクション終わり                          // クローズして セクション終わり
Line 165  BYTE fontpc88_read(const char *filename, Line 165  BYTE fontpc88_read(const char *filename,
                                 // 8dot ANKを読む必要があるか                                  // 8dot ANKを読む必要があるか
                                 if (loading & FONT_ANK8) {                                  if (loading & FONT_ANK8) {
                                         loading &= ~FONT_ANK8;                                          loading &= ~FONT_ANK8;
                                         CopyMemory(font + 0x82000, work + 0x0000, 8*256);                                          fontdata_ank8store(work + 0x0000, 0, 256);
                                 }                                  }
   
                                 // 16dot ASCIIを読む必要があるか                                  // 16dot ASCIIを読む必要があるか
                                 if (loading & FONT_ANK16a) {                                  if (loading & FONT_ANK16a) {
                                         loading &= ~FONT_ANK16a;                                          loading &= ~FONT_ANK16a;
                                         CopyMemory(font + 0x80000, work + 0x0800, 16*128);                                          CopyMemory(fontrom + 0x80000, work + 0x0800, 16*128);
                                 }                                  }
   
                                 // 16dot ANK(0x80〜)を読む必要があるか                                  // 16dot ANK(0x80〜)を読む必要があるか
                                 if (loading & FONT_ANK16b) {                                  if (loading & FONT_ANK16b) {
                                         loading &= ~FONT_ANK16b;                                          loading &= ~FONT_ANK16b;
                                         CopyMemory(font + 0x80800, work + 0x1000, 16*128);                                          CopyMemory(fontrom + 0x80800, work + 0x1000, 16*128);
                                 }                                  }
                         }                          }
   

Removed from v.1.1  
changed lines
  Added in v.1.5


RetroPC.NET-CVS <cvs@retropc.net>