|
|
| version 1.2, 2003/11/15 07:10:02 | version 1.6, 2005/02/09 20:11:34 |
|---|---|
| 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 fm7ankcpy(BYTE *dst, const BYTE *src, int from, int to) { | static void fm7ankcpy(UINT8 *dst, const UINT8 *src, int from, int to) { |
| int y; | int y; |
| const BYTE *p; | const UINT8 *p; |
| int ank; | int ank; |
| for (ank=from; ank<to; ank++) { | for (ank=from; ank<to; ank++) { |
| Line 22 const BYTE *p; | Line 22 const BYTE *p; |
| } | } |
| } | } |
| static void fm7knjcpy(BYTE *dst, const BYTE *src, int from, int to) { | static void fm7knjcpy(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 66 const BYTE *p; | Line 66 const BYTE *p; |
| } | } |
| } | } |
| BYTE fontfm7_read(const char *filename, BYTE loading) { | UINT8 fontfm7_read(const OEMCHAR *filename, UINT8 loading) { |
| FILEH fh; | FILEH fh; |
| BYTE *work; | UINT8 *work; |
| char fname[MAX_PATH]; | OEMCHAR fname[MAX_PATH]; |
| work = (BYTE *)_MALLOC(0x20000, "fm7font"); | work = (UINT8 *)_MALLOC(0x20000, "fm7font"); |
| if (work == NULL) { | if (work == NULL) { |
| goto frf7_err1; | goto frf7_err1; |
| } | } |
| file_cpyname(fname, filename, sizeof(fname)); | file_cpyname(fname, filename, NELEMENTS(fname)); |
| // 8dot ANKを読み込む必要はある? | // 8dot ANKを読み込む必要はある? |
| if (loading & FONT_ANK8) { | if (loading & FONT_ANK8) { |
| file_cutname(fname); | file_cutname(fname); |
| file_catname(fname, fm7ankname, sizeof(fname)); | file_catname(fname, fm7ankname, NELEMENTS(fname)); |
| fh = file_open_rb(fname); | fh = file_open_rb(fname); |
| if (fh != FILEH_INVALID) { | if (fh != FILEH_INVALID) { |
| if (file_read(fh, work, 2048) == 2048) { | if (file_read(fh, work, 2048) == 2048) { |
| loading &= ~FONT_ANK8; | loading &= ~FONT_ANK8; |
| CopyMemory(fontrom + 0x82100, work + 0x100, 0x60*8); | fontdata_ank8store(work + 0x100, 0x20, 0x60); |
| CopyMemory(fontrom + 0x82500, work + 0x500, 0x40*8); | fontdata_ank8store(work + 0x500, 0xa0, 0x40); |
| } | } |
| file_close(fh); | file_close(fh); |
| } | } |
| Line 96 BYTE fontfm7_read(const char *filename, | Line 96 BYTE fontfm7_read(const char *filename, |
| // 16dot ASCII 及び 漢字を読み込む必要はあるか? | // 16dot ASCII 及び 漢字を読み込む必要はあるか? |
| if (loading & (FONT_ANK16a | FONT_KNJ1)) { | if (loading & (FONT_ANK16a | FONT_KNJ1)) { |
| file_cutname(fname); | file_cutname(fname); |
| file_catname(fname, fm7knjname, sizeof(fname)); | file_catname(fname, fm7knjname, NELEMENTS(fname)); |
| fh = file_open_rb(fname); | fh = file_open_rb(fname); |
| if (fh != FILEH_INVALID) { | if (fh != FILEH_INVALID) { |
| if (file_read(fh, work, 0x20000) == 0x20000) { | if (file_read(fh, work, 0x20000) == 0x20000) { |