|
|
| version 1.1.1.1, 2003/10/16 17:58:37 | 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 x68kknjcpy(BYTE *dst, const BYTE *src, int from, int to) { | static void x68kknjcpy(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 44 const BYTE *p; | Line 44 const BYTE *p; |
| } | } |
| } | } |
| BYTE fontx68k_read(const char *filename, BYTE loading) { | UINT8 fontx68k_read(const char *filename, UINT8 loading) { |
| FILEH fh; | FILEH fh; |
| BYTE *work; | UINT8 *work; |
| // ファイルをオープン | // ファイルをオープン |
| fh = file_open_rb(filename); | fh = file_open_rb(filename); |
| Line 56 BYTE fontx68k_read(const char *filename, | Line 56 BYTE fontx68k_read(const char *filename, |
| } | } |
| // メモリアロケート | // メモリアロケート |
| work = (BYTE *)_MALLOC(0x3b800, "x68kfont"); | work = (UINT8 *)_MALLOC(0x3b800, "x68kfont"); |
| if (work == NULL) { | if (work == NULL) { |
| goto fr68_err2; | goto fr68_err2; |
| } | } |
| Line 69 BYTE fontx68k_read(const char *filename, | Line 69 BYTE fontx68k_read(const char *filename, |
| // 8dot ANKを読む必要があるか | // 8dot ANKを読む必要があるか |
| if (loading & FONT_ANK8) { | if (loading & FONT_ANK8) { |
| loading &= ~FONT_ANK8; | loading &= ~FONT_ANK8; |
| CopyMemory(font + 0x82100, work + 0x3a100, 0x60*8); | fontdata_ank8store(work + 0x3a100, 0x20, 0x60); |
| CopyMemory(font + 0x82500, work + 0x3a500, 0x40*8); | fontdata_ank8store(work + 0x3a500, 0xa0, 0x40); |
| } | } |
| // 16dot ASCIIを読む必要があるか | // 16dot ASCIIを読む必要があるか |
| if (loading & FONT_ANK16a) { | if (loading & FONT_ANK16a) { |
| loading &= ~FONT_ANK16a; | loading &= ~FONT_ANK16a; |
| CopyMemory(font + 0x80200, work + 0x3aa00, 0x60*16); | CopyMemory(fontrom + 0x80200, work + 0x3aa00, 0x60*16); |
| fontdata_patch16a(); | fontdata_patch16a(); |
| } | } |
| // 16dot ANK(0x80〜)を読む必要があるか | // 16dot ANK(0x80〜)を読む必要があるか |
| if (loading & FONT_ANK16b) { | if (loading & FONT_ANK16b) { |
| loading &= ~FONT_ANK16b; | loading &= ~FONT_ANK16b; |
| CopyMemory(font + 0x80a00, work + 0x3b200, 0x40*16); | CopyMemory(fontrom + 0x80a00, work + 0x3b200, 0x40*16); |
| fontdata_patch16b(); | fontdata_patch16b(); |
| } | } |
| // 第一水準漢字を読み込む? | // 第一水準漢字を読み込む? |
| if (loading & FONT_KNJ1) { | if (loading & FONT_KNJ1) { |
| loading &= ~FONT_KNJ1; | loading &= ~FONT_KNJ1; |
| x68kknjcpy(font, work, 0x01, 0x30); | x68kknjcpy(fontrom, work, 0x01, 0x30); |
| fontdata_patchjis(); | fontdata_patchjis(); |
| } | } |
| // 第二水準を読む必要はある? | // 第二水準を読む必要はある? |
| if (loading & FONT_KNJ2) { | if (loading & FONT_KNJ2) { |
| loading &= ~FONT_KNJ2; | loading &= ~FONT_KNJ2; |
| x68kknjcpy(font, work, 0x30, 0x60); | x68kknjcpy(fontrom, work, 0x30, 0x60); |
| } | } |
| fr68_err3: | fr68_err3: |