|
|
| 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" |
| #define V98FILESIZE 0x46800 | #define V98FILESIZE 0x46800 |
| static void v98knjcpy(BYTE *dst, const BYTE *src, int from, int to) { | static void v98knjcpy(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++) { |
| p = src + 0x1800 + (0x60 * 32 * (i - 1)); | p = src + 0x1800 + (0x60 * 32 * (i - 1)); |
| Line 27 const BYTE *p; | Line 27 const BYTE *p; |
| } | } |
| } | } |
| BYTE fontv98_read(const char *filename, BYTE loading) { | UINT8 fontv98_read(const char *filename, UINT8 loading) { |
| FILEH fh; | FILEH fh; |
| BYTE *v98fnt; | UINT8 *v98fnt; |
| if (!(loading & FONTLOAD_ALL)) { | if (!(loading & FONTLOAD_ALL)) { |
| goto frv_err1; | goto frv_err1; |
| Line 42 BYTE fontv98_read(const char *filename, | Line 42 BYTE fontv98_read(const char *filename, |
| goto frv_err1; | goto frv_err1; |
| } | } |
| v98fnt = (BYTE *)_MALLOC(V98FILESIZE, "v98font"); | v98fnt = (UINT8 *)_MALLOC(V98FILESIZE, "v98font"); |
| if (v98fnt == NULL) { | if (v98fnt == NULL) { |
| goto frv_err2; | goto frv_err2; |
| } | } |
| Line 55 BYTE fontv98_read(const char *filename, | Line 55 BYTE fontv98_read(const char *filename, |
| // 8x8 フォントを読む必要がある? | // 8x8 フォントを読む必要がある? |
| if (loading & FONT_ANK8) { | if (loading & FONT_ANK8) { |
| loading &= ~FONT_ANK8; | loading &= ~FONT_ANK8; |
| CopyMemory(font + 0x82000, v98fnt, 8*256); | fontdata_ank8store(v98fnt, 0, 256); |
| } | } |
| // 8x16 フォント(〜0x7f)を読む必要がある? | // 8x16 フォント(〜0x7f)を読む必要がある? |
| if (loading & FONT_ANK16a) { | if (loading & FONT_ANK16a) { |
| loading &= ~FONT_ANK16a; | loading &= ~FONT_ANK16a; |
| CopyMemory(font + 0x80000, v98fnt + 0x0800, 16*128); | CopyMemory(fontrom + 0x80000, v98fnt + 0x0800, 16*128); |
| } | } |
| // 8x16 フォント(0x80〜)を読む必要がある? | // 8x16 フォント(0x80〜)を読む必要がある? |
| if (loading & FONT_ANK16b) { | if (loading & FONT_ANK16b) { |
| loading &= ~FONT_ANK16b; | loading &= ~FONT_ANK16b; |
| CopyMemory(font + 0x80800, v98fnt + 0x1000, 16*128); | CopyMemory(fontrom + 0x80800, v98fnt + 0x1000, 16*128); |
| } | } |
| // 第一水準漢字を読む必要がある? | // 第一水準漢字を読む必要がある? |
| if (loading & FONT_KNJ1) { | if (loading & FONT_KNJ1) { |
| loading &= ~FONT_KNJ1; | loading &= ~FONT_KNJ1; |
| v98knjcpy(font, v98fnt, 0x01, 0x30); | v98knjcpy(fontrom, v98fnt, 0x01, 0x30); |
| } | } |
| // 第二水準漢字を読む必要がある? | // 第二水準漢字を読む必要がある? |
| if (loading & FONT_KNJ2) { | if (loading & FONT_KNJ2) { |
| loading &= ~FONT_KNJ2; | loading &= ~FONT_KNJ2; |
| v98knjcpy(font, v98fnt, 0x30, 0x56); | v98knjcpy(fontrom, v98fnt, 0x30, 0x56); |
| } | } |
| // 拡張漢字を読む必要がある? | // 拡張漢字を読む必要がある? |
| if (loading & FONT_KNJ3) { | if (loading & FONT_KNJ3) { |
| loading &= ~FONT_KNJ3; | loading &= ~FONT_KNJ3; |
| v98knjcpy(font, v98fnt, 0x58, 0x5d); | v98knjcpy(fontrom, v98fnt, 0x58, 0x5d); |
| } | } |
| frv_err3: | frv_err3: |