Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
103ffe29f1 | ||
|
|
d1cde9116a | ||
|
|
d3f3c6903d | ||
|
|
c0b964b4f4 |
10
COPYRIGHT
10
COPYRIGHT
@@ -1,7 +1,7 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* WonX - WonderWitch on X. */
|
/* WonX - WonderWitch on X. */
|
||||||
/* */
|
/* */
|
||||||
/* WonX Copyright (c) 2000 Sakai Hiroaki. */
|
/* WonX Copyright (c) 2000-2002 Sakai Hiroaki. */
|
||||||
/* All Rights Reserved. */
|
/* All Rights Reserved. */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* This program is free software; you can redistribute it and/or modify */
|
/* This program is free software; you can redistribute it and/or modify */
|
||||||
@@ -37,10 +37,14 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΤȤ<CEA4><C8A4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΤȤ<CEA4><C8A4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* <20><><EFBFBD>湰μ<E6B9B0><CEBC>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>Υ<CEA5>륢<EFBFBD>ɥ쥹<C9A5>ϡ<EFBFBD> */
|
/* <20><><EFBFBD>湰μ<E6B9B0><CEBC>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD>Υ<CEA5>륢<EFBFBD>ɥ쥹<C9A5>ϡ<EFBFBD> */
|
||||||
/* sakai@seki.ee.kagu.sut.ac.jp */
|
/* hsakai@m8.people.or.jp */
|
||||||
/* hsakai@pfu.co.jp */
|
|
||||||
/* <20>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>ܥ<EFBFBD><DCA5>եȥ<D5A5><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κǿ<CEBA><C7BF>Ǥ<EFBFBD><C7A4><EFBFBD> */
|
/* <20>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>ܥ<EFBFBD><DCA5>եȥ<D5A5><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κǿ<CEBA><C7BF>Ǥ<EFBFBD><C7A4><EFBFBD> */
|
||||||
/* http://www.seki.ee.kagu.sut.ac.jp/~sakai/WonderWitch/index.html */
|
/* http://www.seki.ee.kagu.sut.ac.jp/~sakai/WonderWitch/index.html */
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ۤ<EFBFBD><DBA4>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ۤ<EFBFBD><DBA4>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||||
|
/* <20>ʲ<EFBFBD><CAB2>ϥߥ顼<DFA5><E9A1BC><EFBFBD><EFBFBD><EFBFBD>ȤǤ<C8A4><C7A4><EFBFBD> */
|
||||||
|
/* http://hp.vector.co.jp/authors/VA014157/index.html */
|
||||||
|
/* http://www.people.or.jp/~hsakai/index.html */
|
||||||
|
/* <20>ߥ顼<DFA5><E9A1BC><EFBFBD><EFBFBD><EFBFBD>Ȥϡ<C8A4><CFA1><EFBFBD><EFBFBD>椬<EFBFBD><E6A4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>˥<EFBFBD><CBA5>åץǡ<D7A5><C7A1>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>Τǡ<CEA4><C7A1><EFBFBD><EFBFBD>˺ǿ<CBBA><C7BF><EFBFBD> */
|
||||||
|
/* <20>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>櫓<EFBFBD>ǤϤ<C7A4><CFA4><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><F3A1A5A4><EFBFBD><EFBFBD>ޤǥХå<D0A5><C3A5><EFBFBD><EFBFBD>å<EFBFBD><C3A5>ѤǤ<D1A4><C7A4><EFBFBD> */
|
||||||
/* <20><><EFBFBD>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۤ<EFBFBD><DBA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>顤<EFBFBD><E9A1A4><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>ո<EFBFBD><D5B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۤ<EFBFBD><DBA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>顤<EFBFBD><E9A1A4><EFBFBD><EFBFBD>Ϣ<EFBFBD><CFA2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
186
HISTORY
186
HISTORY
@@ -1,3 +1,189 @@
|
|||||||
|
2002/2/4(<28><>)
|
||||||
|
|
||||||
|
wonx-2.2 <20><><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
mmap() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ū<EFBFBD>ˤ<EFBFBD> README <20><><EFBFBD>ȡ<EFBFBD>
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӥ<EFBFBD><EFBFBD>ؿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲá<EFBFBD>(<28>ǥХå<D0A5><C3A5>Ѥξ<D1A4><CEBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>פ<EFBFBD><D7A4>륵<EFBFBD><EBA5B5><EFBFBD>ӥ<EFBFBD><D3A5>ؿ<EFBFBD><D8BF>ȡ<EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ON/OFF<46><46><EFBFBD><EFBFBD><EFBFBD>ѤΥ<D1A4><CEA5><EFBFBD><EFBFBD>ӥ<EFBFBD><D3A5>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>ɲ<EFBFBD>) <20><><EFBFBD><EFBFBD>Ū<EFBFBD>ˤ<EFBFBD> README <20><><EFBFBD>ȡ<EFBFBD>
|
||||||
|
|
||||||
|
bios_exit() <20><><EFBFBD>饪<EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȤΥǥ<CEA5><C7A5>ȥ饯<C8A5><E9A5AF><EFBFBD><EFBFBD><EFBFBD>ƤФ<C6A4><D0A4><EFBFBD><EFBFBD>褦<EFBFBD>ˤ<EFBFBD><CBA4>ơ<EFBFBD>
|
||||||
|
<EFBFBD>ƥ<EFBFBD><EFBFBD>֥<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD>Ŭ<EFBFBD>ڤ<EFBFBD> Destroy <20>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>ɲá<C9B2><C3A1><EFBFBD><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD><EFBFBD><EFBFBD>Ŭ<EFBFBD>ڤ<EFBFBD>
|
||||||
|
<EFBFBD>Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ˡ<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ū<EFBFBD>˥<EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
key_wait() <20><><EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>դ<EFBFBD><D5A4><EFBFBD><EFBFBD>褦<EFBFBD>˽<EFBFBD><CBBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
(<28><><EFBFBD><EFBFBD><EFBFBD>ϥ<EFBFBD><CFA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>դ<EFBFBD><D5A4>Ƥ<EFBFBD><C6A4>ʤ<EFBFBD><CAA4>ä<EFBFBD>)
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɡ<EFBFBD>(UNIXTimer.c)
|
||||||
|
|
||||||
|
wonx_include <20>ǥ<EFBFBD><C7A5>쥯<EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD> wonx <20><>̾<EFBFBD><CCBE><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>
|
||||||
|
|
||||||
|
perl <20>ؤΥե<CEA5><D5A5>ѥ<EFBFBD><D1A5><EFBFBD><EFBFBD><EFBFBD>ư<EFBFBD>Ǹ<EFBFBD><C7B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> perl <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ץȤ<D7A5><C8A4><EFBFBD>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>
|
||||||
|
|
||||||
|
Makefile <20><>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɡ<EFBFBD>
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ON/OFF <20><><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD>٥<EFBFBD><D9A5>ˤ<EFBFBD><CBA4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD>ؤ<EFBFBD><D8A4><EFBFBD><EFBFBD>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>
|
||||||
|
(<28>ܤ<EFBFBD><DCA4><EFBFBD><EFBFBD><EFBFBD> README <20><><EFBFBD><EFBFBD>)
|
||||||
|
<EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>F9 <20><>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD>٥<EFBFBD><D9A5><EFBFBD><F2B2BCA4><EFBFBD>F10 <20><>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD>٥<EFBFBD><D9A5><EFBFBD><EFBFBD>夲<EFBFBD><E5A4B2><EFBFBD>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD><EFBFBD>碌<EFBFBD>ơ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ON/OFF<46><46>ʬ<EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϥ<EFBFBD><CFA5>٥<EFBFBD><D9A5>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD>ΰ<EFBFBD><CEB0><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD><F2A4B7A4><EFBFBD>
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>β<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˥<EFBFBD><EFBFBD>å<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
Obj ObjListData_GetPrev(ObjListData data)
|
||||||
|
Obj ObjListData_GetNext(ObjListData data)
|
||||||
|
<EFBFBD><EFBFBD>
|
||||||
|
ObjListData ObjListData_GetPrev(ObjListData data)
|
||||||
|
ObjListData ObjListData_GetNext(ObjListData data)
|
||||||
|
<EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
Makefile <20><> install, uninstall <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>åȤ<C3A5><C8A4>ɲá<C9B2>challsrc.sh <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2001/1/13(<28><>)
|
||||||
|
|
||||||
|
wonx-2.1 <20><><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
<EFBFBD>ѥ<EFBFBD><EFBFBD>åȥǡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD>RGB<EFBFBD>ͤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>פ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ˤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD>ǡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
perl <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ץȤι<C8A4>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD>/usr/bin/perl <20><><EFBFBD><EFBFBD> /usr/local/bin/perl <20><><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>
|
||||||
|
(FreeBSD <20>Ǥϡ<C7A4><CFA1><EFBFBD><EFBFBD>ܸ<EFBFBD> perl <20><> /usr/local/bin <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD>)
|
||||||
|
|
||||||
|
disp.c, libwwc.c <20>Ρ<EFBFBD><CEA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>饯<EFBFBD><E9A5AF><EFBFBD>Υӥåȥޥåץǡ<D7A5><C7A1><EFBFBD><EFBFBD>ɤ߹<C9A4><DFB9><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѵؿ<D1B4><D8BF>ǡ<EFBFBD>
|
||||||
|
<EFBFBD>ӥåȥޥåץǡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>η<EFBFBD><EFBFBD><EFBFBD> unsigned char * <20>Ǥʤ<C7A4> short int *, long int * <20>ʤɤ<CAA4>
|
||||||
|
Ŭ<EFBFBD>ڤʷ<EFBFBD><EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
WWCharacter <20><><EFBFBD>饹<EFBFBD>Υӥåȥޥåפ<C3A5><D7A4><EFBFBD>uchar, ushort, ulong <20><> union <20>Ȥ<EFBFBD><C8A4><EFBFBD>
|
||||||
|
WWCharacter_GetPixel() <20>Ǥ<EFBFBD>Ŭ<EFBFBD>ڤʷ<DAA4><CAB7>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤳<EFBFBD>Ȥˤ<C8A4><CBA4>ꡤ
|
||||||
|
<EFBFBD>ӥåȥޥåץǡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΰ<EFBFBD>¸<EFBFBD><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(i386, SPARC <20>dz<EFBFBD>ǧ<EFBFBD><C7A7>)
|
||||||
|
|
||||||
|
WWCharacter_GetPixel() <20><> 16PACKED <20><><EFBFBD>顼<EFBFBD>⡼<EFBFBD>ɻ<EFBFBD><C9BB><EFBFBD><EFBFBD>ͤμ<CDA4><CEBC><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
(<28><><EFBFBD><EFBFBD><EFBFBD>饯<EFBFBD><E9A5AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȿžɽ<C5BE><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>Х<EFBFBD><D0A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD>)
|
||||||
|
|
||||||
|
F11 <20><>10<31>ô<EFBFBD><C3B4><EFBFBD><EFBFBD>ߡ<EFBFBD><DFA1>⤷<EFBFBD><E2A4B7><EFBFBD><EFBFBD> Ctrl-c <20>⤷<EFBFBD><E2A4B7><EFBFBD><EFBFBD> F12 <20>Ƕ<EFBFBD><C7B6><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>
|
||||||
|
Ctrl-i <20>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3B2BDA4>ɲá<C9B2>(<28><><EFBFBD>Ȥ<EFBFBD><C8A4>Ȥ<EFBFBD><C8A4>ä<EFBFBD><C3A4><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD><CBBA><EFBFBD>Ƥ<EFBFBD><C6A4>Τ<EFBFBD><CEA4><EFBFBD>
|
||||||
|
¿<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD><EFBFBD>Ȥˤ<EFBFBD><EFBFBD><EFBFBD>)
|
||||||
|
|
||||||
|
ɽ<EFBFBD><EFBFBD>/<2F><>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؤ<EFBFBD><D8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> p <20><><EFBFBD><EFBFBD> F10 <20>˰<EFBFBD>ư<EFBFBD><C6B0><EFBFBD>ޥ˥奢<CBA5>뽤<EFBFBD><EBBDA4><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
XDisplay.c:XDisplay_DrawLCDWindow() <20>ǡ<EFBFBD>XColorGC_CreateFromRGB() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
XColorGC <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD> Destroy() <20><><EFBFBD>Ƥ<EFBFBD><C6A4>ʤ<EFBFBD><CAA4>Τǡ<CEA4><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>Х<EFBFBD><D0A5><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(XColorGC_Destroy(x_color_gc) <20>ɲ<EFBFBD>)
|
||||||
|
|
||||||
|
wonx_include/fcntl.h <20>ɲá<C9B2><C3A1><EFBFBD><EFBFBD>Ƥϡ<C6A4>/usr/include/fcntl.h,
|
||||||
|
/usr/include/sys/fcntl.h <20>롼<F3A5AFA5>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD>ꥢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϻ<EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD>å<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(output to serial port : )<29>ν<EFBFBD><CEBD><EFBFBD><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>
|
||||||
|
("" <20>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD>)
|
||||||
|
etc.c:wonx_print_character() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(\", \\ <20>ʤɤ<CAA4><C9A4>ɲ<EFBFBD>)
|
||||||
|
sout2str.pl <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(\", \\ <20>ʤɤ<CAA4><C9A4>ɲá<C9B2><C3A1>嵭<EFBFBD>Υ<EFBFBD><CEA5>ꥢ<EFBFBD><EAA5A2><EFBFBD><EFBFBD><EFBFBD>ϻ<EFBFBD><CFBB>Υ<EFBFBD><CEA5>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD>ˤ<EFBFBD><EFBFBD>碌<EFBFBD>ƽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||||
|
|
||||||
|
int2sint.pl, filters.pl, challsrc.sh <20>ɲá<C9B2>
|
||||||
|
sys2wonx.pl <20>ѹ<EFBFBD><D1B9><EFBFBD>
|
||||||
|
|
||||||
|
wonx_include/types.h <20><>
|
||||||
|
typedef unsigned short WORD;
|
||||||
|
typedef unsigned long DWORD;
|
||||||
|
<EFBFBD><EFBFBD>
|
||||||
|
typedef unsigned short int WORD;
|
||||||
|
typedef unsigned long int DWORD;
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
README <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2001/1/3(<28><>)
|
||||||
|
|
||||||
|
wonx-2.0 <20><><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>GC<EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥˡ<EFBFBD>XColorGC <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD>ɲá<C9B2>(XFireworks <20><><EFBFBD><EFBFBD>ή<EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD>)
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD>transparent(Ʃ<>ῧ)<29><>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWPalette <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD>
|
||||||
|
WWDisplay <20><><EFBFBD>饹<EFBFBD>˰<EFBFBD>ư<EFBFBD><C6B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
WWLCDPanel <20><> pixel <20><><EFBFBD><EFBFBD>unsigned short int * <20><><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>(<28><><EFBFBD>顼<EFBFBD>б<EFBFBD>)
|
||||||
|
|
||||||
|
<EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥե<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥγ<EFBFBD>Ǽ<EFBFBD>ե<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޥåȤ<EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD>(WWTextFonts.c)
|
||||||
|
|
||||||
|
<EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD>ɽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWDisplay_GetForegroundColor(),
|
||||||
|
WWDisplay_GetBackgroundColor() <20>ƥ<F2B8ABA4><C6A5>ԡ<EFBFBD><D4A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>˽<EFBFBD><CBBD><EFBFBD><EFBFBD><EFBFBD>(WWText.c)
|
||||||
|
(WWText <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD> WWCharacter <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݤ<EFBFBD><DDA4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>פˤʤä<CAA4><C3A4>Τǡ<CEA4>
|
||||||
|
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤳<EFBFBD><EBA4B3>)
|
||||||
|
|
||||||
|
WWDisplay <20><><EFBFBD>饹<EFBFBD>˥ܡ<CBA5><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>Υѥ<CEA5><D1A5>å<EFBFBD><C3A5>ɲá<C9B2>
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
(<28><><EFBFBD><EFBFBD><EFBFBD>饯<EFBFBD><E9A5AF><EFBFBD>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>γ<EFBFBD>Ǽ<EFBFBD><C7BC>ˡ<EFBFBD><CBA1><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD>ʤ<EFBFBD>)
|
||||||
|
|
||||||
|
display_control(), display_status() <20>ǡ<EFBFBD><C7A1>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>Υӥåȥ<C3A5><C8A5>եȤ<D5A5>
|
||||||
|
7 <20>ˤʤäƤ<C3A4><C6A4><EFBFBD><EFBFBD>Х<EFBFBD><D0A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(8 <20>˽<EFBFBD><CBBD><EFBFBD>)
|
||||||
|
|
||||||
|
while(1){/*none*/} <20>Ǥγ<C7A4><CEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4>롼<EFBFBD><EBA1BC><EFBFBD><EFBFBD><EFBFBD>ˤ⡤F1 <20>ʤɤΥ<C9A4><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>դ<EFBFBD><D5A4><EFBFBD>
|
||||||
|
<EFBFBD>褦<EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(WonXSystem.c <20>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD><EFBFBD><DEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤΥ<DFA4><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD>
|
||||||
|
WonXTimer_Callback() <20>ˡ<EFBFBD>WonXDisplay_PrintData() <20><><EFBFBD>ɲ<EFBFBD>)
|
||||||
|
|
||||||
|
fcntl_attention.h, filesys.h, indirect.h, oswork.h, process.h <20><><EFBFBD>ɲá<C9B2>
|
||||||
|
(<28><><EFBFBD>Ȥϥ<C8A4><CFA5>顤<EFBFBD>⤷<EFBFBD><E2A4B7><EFBFBD><EFBFBD>Ŭ<EFBFBD><C5AC><EFBFBD>ʥե<CAA5><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롼<F3A5AFA5>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||||
|
|
||||||
|
wonx_configure.h <20>ǡ<EFBFBD>
|
||||||
|
#ifndef _WONX_winx_configure_h_INCLUDED_
|
||||||
|
#define _WONX_wonx_configure_h_INCLUDED_
|
||||||
|
<EFBFBD>ˤʤäƤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Х<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
2000/12/28(<28><>)
|
||||||
|
|
||||||
|
wonx-1.1 <20><><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
_asm_*() <20>Υ<EFBFBD><CEA5>ߡ<EFBFBD><DFA1>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>ɲá<C9B2>
|
||||||
|
FP_OFF(), FP_SEG() <20><><EFBFBD><EFBFBD>WonderWitch <20>Ǥγ<C7A4><CEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD>ˤ<EFBFBD><EFBFBD>碌<EFBFBD>ơ<EFBFBD>Ŭ<EFBFBD>ڤ<EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD>(wwterm <20>˹<EFBFBD><CBB9>碌<EFBFBD><EFA4BB>)
|
||||||
|
|
||||||
|
UNIXTimer.c:UNIXTimer_Unpause() <20>ǡ<EFBFBD>
|
||||||
|
((unix_timer->pause == 1) && (unix_timer->interrupt_in_pause == 0))
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD><EFBFBD> unix_timer->pause--; <20><><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>Х<EFBFBD><D0A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
(<28>ݡ<EFBFBD><DDA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD><DDA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ʤ<EFBFBD><CAA4>ä<EFBFBD>)
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD>ꥢ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܡ<EFBFBD><EFBFBD>ɳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲá<EFBFBD>(wwterm <20><><EFBFBD>б<EFBFBD><D0B1><EFBFBD>ư<EFBFBD><C6B0><EFBFBD><EFBFBD>ǧ<EFBFBD><C7A7>)
|
||||||
|
UNIXSerialPort <20><><EFBFBD>饹<EFBFBD>ɲá<C9B2>
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD><EFBFBD>ꡤWonderWitch <20>ǤΡ<C7A4>
|
||||||
|
com_intvector.callback = (void (near *)())FP_OFF(com_handler);
|
||||||
|
com_intvector.cs = _asm_inline("\tmov\tax,cs");
|
||||||
|
com_intvector.ds = _asm_inline("\tmov\tax,ds");
|
||||||
|
sys_interrupt_set_hook(SYS_INT_RECEIVEREADY,
|
||||||
|
&com_intvector, &com_last_intvector);
|
||||||
|
<EFBFBD>Τ褦<EFBFBD>ʳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>꤬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¹Ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ˤʤä<EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD>˥<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥˡ<EFBFBD>WonX_Warning() <20>ɲá<C9B2>
|
||||||
|
WonX_Error() <20><> WonX.c <20>˰<EFBFBD>ư<EFBFBD><C6B0>
|
||||||
|
|
||||||
|
comm_send_string(), text_put_string(), text_put_substring() <20>¹Ի<C2B9><D4BB><EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD>ϥ<EFBFBD><EFBFBD>å<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(WWCursor <20><><EFBFBD>饹<EFBFBD>ɲ<EFBFBD>)(<28><><EFBFBD>ǤϤ<C7A4><CFA4>ʤ<EFBFBD><CAA4><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD>Τ<EFBFBD>)
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݤˡ<EFBFBD>WWDisplay_DrawLCDPanel() <20><><EFBFBD><EFBFBD><EFBFBD>ǥƥ<C7A5><C6A5><EFBFBD><EFBFBD>Ⱦ<EFBFBD><C8BE><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
<EFBFBD>ɤ<EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<EFBFBD>WonXText <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD>ѻߤ<D1BB><DFA4>ơ<EFBFBD>WWText <20><><EFBFBD>饹<EFBFBD><E9A5B9>
|
||||||
|
WWDisplay <20><><EFBFBD>饹<EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>Ф˰<D0A4>ư<EFBFBD><C6B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
palette_get_color() <20><><EFBFBD>ǡ<EFBFBD>WWPalette_GetMappedColors() <20>μ¹Ի<C2B9><D4BB><EFBFBD>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
-1<>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>뤳<EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD>θ<EFBFBD><CEB8><EFBFBD>Ƥ<EFBFBD><C6A4>ʤ<EFBFBD><CAA4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD>palette_get_color() <20><>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤˤʤäƤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Х<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>饯<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>ѥ<EFBFBD><EFBFBD>åȡ<EFBFBD>LCD<EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>ѥ<EFBFBD><EFBFBD>åȤν<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD><EFBFBD><EFBFBD>WonderWitch <20>Ǥ<EFBFBD>
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤȰ<EFBFBD><EFBFBD>פ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ץ<EFBFBD><EFBFBD>Ȥ<EFBFBD><EFBFBD>ơ<EFBFBD>wwterm-b05 <20><><EFBFBD>ɲá<C9B2>(Makefile <20><> wwterm <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>åȤ<C3A5><C8A4>ɲ<EFBFBD>)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
2000/11/23(<28><>)
|
2000/11/23(<28><>)
|
||||||
|
|
||||||
wonx-1.0 <20><><EFBFBD><EFBFBD>
|
wonx-1.0 <20><><EFBFBD><EFBFBD>
|
||||||
|
|||||||
20
MANUAL
20
MANUAL
@@ -29,23 +29,23 @@ WonderWitch
|
|||||||
<20><><EFBFBD><EFBFBD> WWCharacter[512]
|
<20><><EFBFBD><EFBFBD> WWCharacter[512]
|
||||||
<20><><EFBFBD><EFBFBD>WWDisplay <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWSprite[128]
|
<20><><EFBFBD><EFBFBD>WWDisplay <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWSprite[128]
|
||||||
<20><><EFBFBD><EFBFBD> WonXDisplay <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> WWScreen[2]
|
<20><><EFBFBD><EFBFBD> WonXDisplay <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> WWScreen[2]
|
||||||
<20><> <20><><EFBFBD><EFBFBD>XDisplay <20><><EFBFBD><EFBFBD> WWLCDPanel
|
<20><> <20><><EFBFBD><EFBFBD>XDisplay <20><><EFBFBD><EFBFBD> WWLCDPanel
|
||||||
<20><>
|
<20><> <20><><EFBFBD><EFBFBD> WWText
|
||||||
|
<20><> <20><><EFBFBD><EFBFBD> WWCursor
|
||||||
<20><> <20><><EFBFBD><EFBFBD> WWInterrupt
|
<20><> <20><><EFBFBD><EFBFBD> WWInterrupt
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> WonXSystem <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWTimer[3]
|
WonX <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WonXSystem <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWTimer[3]
|
||||||
<20><> <20><><EFBFBD><EFBFBD> UNIXTimer
|
<20><> <20><><EFBFBD><EFBFBD> UNIXTimer
|
||||||
WonX <20><><EFBFBD><EFBFBD>
|
|
||||||
<20><>
|
|
||||||
<20><><EFBFBD><EFBFBD> WonXText <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWText
|
|
||||||
<20><>
|
<20><>
|
||||||
<20><>
|
<20><>
|
||||||
<20><><EFBFBD><EFBFBD> WonXSerialPort <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWSerialPort
|
<20><> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWSerialPort
|
||||||
|
<20><><EFBFBD><EFBFBD> WonXSerialPort <20><><EFBFBD><EFBFBD>
|
||||||
|
<20><><EFBFBD><EFBFBD> UNIXSerialPort
|
||||||
|
|
||||||
WW <20>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD>줬<EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD>饹<EFBFBD><E9A5B9> WonderWitch <20><>¸<EFBFBD>Τ<EFBFBD><CEA4>ΤǤ<CEA4><C7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
WW <20>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD>줬<EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD>饹<EFBFBD><E9A5B9> WonderWitch <20><>¸<EFBFBD>Τ<EFBFBD><CEA4>ΤǤ<CEA4><C7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
WonderSwan <20>ξ<EFBFBD><CEBE>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD><C7BC><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
|
WonderSwan <20>ξ<EFBFBD><CEBE>־<EFBFBD><D6BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD><C7BC><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
|
||||||
X <20>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD>줬<EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD>饹<EFBFBD><E9A5B9> X <20><>¸<EFBFBD>Τ<EFBFBD><CEA4>Ρ<EFBFBD>UNIX <20>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD>줬<EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD>饹<EFBFBD><E9A5B9>
|
X <20>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD>줬<EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD>饹<EFBFBD><E9A5B9> X <20><>¸<EFBFBD>Τ<EFBFBD><CEA4>Ρ<EFBFBD>UNIX <20>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD>줬<EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD>饹<EFBFBD><E9A5B9>
|
||||||
UNIX <20><>¸<EFBFBD>Τ<EFBFBD><CEA4>ΤǤ<CEA4><C7A4><EFBFBD>
|
UNIX <20><>¸<EFBFBD>Τ<EFBFBD><CEA4>ΤǤ<CEA4><C7A4><EFBFBD>
|
||||||
Wonx <20>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD>줬<EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD>饹<EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>礹<EFBFBD><E7A4B9><EFBFBD><EFBFBD><EFBFBD>ΤǤ<CEA4><C7A4><EFBFBD>
|
WonX <20>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>Ƭ<EFBFBD>줬<EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD>饹<EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>礹<EFBFBD><E7A4B9><EFBFBD><EFBFBD><EFBFBD>ΤǤ<CEA4><C7A4><EFBFBD>
|
||||||
|
|
||||||
<EFBFBD>ĥ<EFBFBD><EFBFBD>¤<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD><EFBFBD>顤<EFBFBD>ƥ<EFBFBD><EFBFBD>饹<EFBFBD><EFBFBD> *P.h <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>Ф<EFBFBD><D0A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD>
|
<EFBFBD>ĥ<EFBFBD><EFBFBD>¤<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD><EFBFBD>顤<EFBFBD>ƥ<EFBFBD><EFBFBD>饹<EFBFBD><EFBFBD> *P.h <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>Ф<EFBFBD><D0A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD>
|
||||||
*.c <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *_Create() <20>ؿ<EFBFBD><D8BF>Ȥ<F2BBB2BE><C8A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
*.c <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> *_Create() <20>ؿ<EFBFBD><D8BF>Ȥ<F2BBB2BE><C8A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
@@ -56,8 +56,8 @@ Wonx
|
|||||||
<EFBFBD>ؿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѱդ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
|
<EFBFBD>ؿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѱդ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
WonX_Create() <20><><EFBFBD>ƤФ<C6A4><D0A4><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WonXDisplay_Create(), WonXSystem_Create(),
|
WonX_Create() <20><><EFBFBD>ƤФ<C6A4><D0A4><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WonXDisplay_Create(), WonXSystem_Create(),
|
||||||
WonXText_Create(), WonXSerialPort_Create() <20><><EFBFBD>ƤФ졤<D0A4>Ҥ<EFBFBD> WonXDisplay,
|
WonXSerialPort_Create() <20><><EFBFBD>ƤФ졤<D0A4>Ҥ<EFBFBD> WonXDisplay, WonXSystem,
|
||||||
WonXSystem, WonXText, WonXSerialPort <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
|
WonXSerialPort <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>
|
||||||
WonXDisplay_Create() <20><><EFBFBD>ƤФ<C6A4><D0A4><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWDisplay_Create(),
|
WonXDisplay_Create() <20><><EFBFBD>ƤФ<C6A4><D0A4><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWDisplay_Create(),
|
||||||
XDisplay_Create() <20><><EFBFBD>ƤФ졤... <20>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>褦<EFBFBD><E8A4A6>³<EFBFBD><C2B3><EFBFBD>ơ<EFBFBD><C6A1><EFBFBD><EFBFBD>٤ƤΥĥ<C4A5><EAA1BC>
|
XDisplay_Create() <20><><EFBFBD>ƤФ졤... <20>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>褦<EFBFBD><E8A4A6>³<EFBFBD><C2B3><EFBFBD>ơ<EFBFBD><C6A1><EFBFBD><EFBFBD>٤ƤΥĥ<C4A5><EAA1BC>
|
||||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
|
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
|||||||
89
Makefile
89
Makefile
@@ -2,28 +2,41 @@ XINCLUDEDIR = /usr/X11R6/include
|
|||||||
INCLUDEDIR = .
|
INCLUDEDIR = .
|
||||||
XLIBDIR = /usr/X11R6/lib
|
XLIBDIR = /usr/X11R6/lib
|
||||||
|
|
||||||
VERSION = WonX-1.0
|
VERSION = WonX-2.2
|
||||||
PKGNAME = wonx-1.0
|
PKGNAME = wonx-2.2
|
||||||
|
|
||||||
SMAC = smac-b02
|
SMAC = smac-b02
|
||||||
|
WWTERM = wwterm-b05
|
||||||
|
|
||||||
OBJS = WWCharacter.o WWColorMap.o WWDisplay.o WWLCDPanel.o WWPalette.o WWScreen.o WWSprite.o WWText.o WWInterrupt.o WWTimer.o WWSerialPort.o WonX.o WonXDisplay.o WonXText.o WonXSystem.o WonXSerialPort.o XDisplay.o UNIXTimer.o bank.o comm.o disp.o text.o key.o sound.o system.o timer.o etc.o
|
OBJS = WWCharacter.o WWColorMap.o WWDisplay.o WWLCDPanel.o WWPalette.o WWScreen.o WWSprite.o WWCursor.o WWText.o WWInterrupt.o WWTimer.o WWSerialPort.o WonX.o WonXDisplay.o WonXSystem.o WonXSerialPort.o XDisplay.o XColorGC.o UNIXTimer.o UNIXSerialPort.o Obj.o bank.o comm.o disp.o text.o key.o sound.o system.o timer.o libwwc.o service.o fcntl.o etc.o wonx.o
|
||||||
|
|
||||||
CC = gcc
|
PERLS = filters.pl int2sint.pl sout2str.pl sys2wonx.pl
|
||||||
|
#PERL = /usr/bin/perl
|
||||||
|
|
||||||
|
CC ?= gcc
|
||||||
|
AR ?= ar
|
||||||
|
RANLIB ?= ranlib
|
||||||
|
CFLAGS += -O
|
||||||
|
#CFLAGS += -g
|
||||||
|
CFLAGS += -Wall
|
||||||
|
|
||||||
|
PREFIX ?= /usr/local
|
||||||
|
|
||||||
.SUFFIXES: .c .o
|
.SUFFIXES: .c .o
|
||||||
|
.SUFFIXES: .perl .pl
|
||||||
|
|
||||||
all : libwonx.a
|
all : libwonx.a $(PERLS)
|
||||||
|
|
||||||
libwonx.a : $(OBJS)
|
libwonx.a : $(OBJS)
|
||||||
ar ruc libwonx.a $(OBJS)
|
$(AR) ruc libwonx.a $(OBJS)
|
||||||
# ranlib libwonx.a
|
# $(RANLIB) libwonx.a
|
||||||
|
|
||||||
.c.o : $*.c
|
.c.o : $*.c
|
||||||
$(CC) -c $*.c -O -Wall -I$(INCLUDEDIR) -I$(XINCLUDEDIR)
|
$(CC) -c $*.c $(CFLAGS) -I$(INCLUDEDIR) -I$(XINCLUDEDIR)
|
||||||
|
|
||||||
clean :
|
clean :
|
||||||
rm -f libwonx.a sample1 sample2 *.o
|
rm -f libwonx.a sample1 sample2 sample3 *.o *.pl
|
||||||
|
rm -fR $(SMAC) $(WWTERM)
|
||||||
|
|
||||||
sample1 : libwonx.a sample1.o
|
sample1 : libwonx.a sample1.o
|
||||||
$(CC) sample1.o -o sample1 \
|
$(CC) sample1.o -o sample1 \
|
||||||
@@ -33,25 +46,63 @@ sample2 : libwonx.a sample2.o
|
|||||||
$(CC) sample2.o -o sample2 \
|
$(CC) sample2.o -o sample2 \
|
||||||
-L. -L/usr/X11R6/lib -lwonx -lX11 -lXt
|
-L. -L/usr/X11R6/lib -lwonx -lX11 -lXt
|
||||||
|
|
||||||
smac : libwonx.a
|
sample3 : libwonx.a sample3.o
|
||||||
|
$(CC) sample3.o -o sample3 \
|
||||||
|
-L. -L/usr/X11R6/lib -lwonx -lX11 -lXt
|
||||||
|
|
||||||
|
smac : libwonx.a $(SMAC)
|
||||||
|
cd $(SMAC) ; $(MAKE)
|
||||||
|
|
||||||
|
$(SMAC) : $(SMAC).zip $(PERLS)
|
||||||
unzip $(SMAC).zip
|
unzip $(SMAC).zip
|
||||||
cp -R wonx_include $(SMAC)
|
mkdir -p $(SMAC)/wonx
|
||||||
|
cp wonx/*.h $(SMAC)/wonx
|
||||||
cp libwonx.a $(SMAC)
|
cp libwonx.a $(SMAC)
|
||||||
mv $(SMAC)/makefile $(SMAC)/makefile.orig
|
mv $(SMAC)/makefile $(SMAC)/makefile.orig
|
||||||
cp makefile_for_smac $(SMAC)/makefile
|
cp makefile_for_smac $(SMAC)/makefile
|
||||||
cp sys2wonx.pl $(SMAC)
|
cp challsrc.sh $(PERLS) $(SMAC)
|
||||||
echo "<22><><EFBFBD><EFBFBD><EFBFBD>ǻߤޤä<DEA4><C3A4>Ȥ<EFBFBD><C8A4>ϡ<EFBFBD>sys2wonx.pl <20>Σ<EFBFBD><CEA3><EFBFBD><EFBFBD>ܤ<EFBFBD>Ŭ<EFBFBD>ڤ<EFBFBD>perl<72><6C><EFBFBD><EFBFBD><EFBFBD>ꤷ<EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
cd $(SMAC) ; ./challsrc.sh *.[ch] makefile
|
||||||
cd $(SMAC) ; ./sys2wonx.pl *.[ch]
|
|
||||||
cd $(SMAC) ; $(MAKE)
|
wwterm : libwonx.a $(WWTERM)
|
||||||
|
cd $(WWTERM) ; $(MAKE)
|
||||||
|
|
||||||
|
$(WWTERM) : $(WWTERM).zip $(PERLS)
|
||||||
|
unzip $(WWTERM).zip
|
||||||
|
mkdir -p $(WWTERM)/wonx
|
||||||
|
cp wonx/*.h $(WWTERM)/wonx
|
||||||
|
cp libwonx.a $(WWTERM)
|
||||||
|
mv $(WWTERM)/makefile $(WWTERM)/makefile.orig
|
||||||
|
cp makefile_for_wwterm $(WWTERM)/makefile
|
||||||
|
cp challsrc.sh $(PERLS) $(WWTERM)
|
||||||
|
cd $(WWTERM) ; ./challsrc.sh *.[ch] makefile
|
||||||
|
|
||||||
|
.perl.pl : $*.perl
|
||||||
|
./findperl.sh $(PERL) | cat - $*.perl > $*.pl
|
||||||
|
chmod +x $*.pl
|
||||||
|
|
||||||
|
install : libwonx.a $(PERLS)
|
||||||
|
mkdir -p $(PREFIX)/include/wonx
|
||||||
|
cp wonx/*.h $(PREFIX)/include/wonx
|
||||||
|
cp libwonx.a $(PREFIX)/lib
|
||||||
|
cp challsrc.sh $(PERLS) $(PREFIX)/bin
|
||||||
|
|
||||||
|
uninstall :
|
||||||
|
rm -fR $(PREFIX)/include/wonx
|
||||||
|
rm -f $(PREFIX)/lib/libwonx.a
|
||||||
|
rm -f $(PREFIX)/bin/challsrc.sh
|
||||||
|
rm -f $(PREFIX)/bin/filters.pl
|
||||||
|
rm -f $(PREFIX)/bin/int2sint.pl
|
||||||
|
rm -f $(PREFIX)/bin/sout2str.pl
|
||||||
|
rm -f $(PREFIX)/bin/sys2wonx.pl
|
||||||
|
|
||||||
package :
|
package :
|
||||||
mkdir -p $(PKGNAME)
|
mkdir -p $(PKGNAME)
|
||||||
rm -fR $(PKGNAME)/*
|
rm -fR $(PKGNAME)/*
|
||||||
mkdir -p $(PKGNAME)/wonx_include
|
mkdir -p $(PKGNAME)/wonx
|
||||||
cp COPYING COPYRIGHT HISTORY README MANUAL OMAKE.jpn Makefile \
|
cp COPYING COPYRIGHT HISTORY README MANUAL OMAKE.jpn Makefile \
|
||||||
makefile_for_smac *.pl \
|
makefile_for_smac makefile_for_wwterm *.sh *.perl \
|
||||||
*.h *.c smac*.zip $(PKGNAME)
|
*.h *.c $(SMAC).zip $(WWTERM).zip $(PKGNAME)
|
||||||
cp wonx_include/*.h $(PKGNAME)/wonx_include
|
cp wonx/*.h $(PKGNAME)/wonx
|
||||||
tar cvzf $(PKGNAME).tar.gz $(PKGNAME)
|
tar cvzf $(PKGNAME).tar.gz $(PKGNAME)
|
||||||
|
|
||||||
# End of Makefile.
|
# End of Makefile.
|
||||||
|
|||||||
396
Obj.c
Normal file
396
Obj.c
Normal file
@@ -0,0 +1,396 @@
|
|||||||
|
/*****************************************************************************/
|
||||||
|
/* Obj.c - A library for object list. */
|
||||||
|
/* */
|
||||||
|
/* Obj.c Copyright (c) 2000 Sakai Hiroaki. */
|
||||||
|
/* All Rights Reserved. */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include "ObjP.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* ObjListData <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
static ObjListData ObjListData_Create(Obj obj, Obj (*destructor)())
|
||||||
|
{
|
||||||
|
ObjListData list_data;
|
||||||
|
|
||||||
|
list_data = (ObjListData)malloc(sizeof(_ObjListData));
|
||||||
|
|
||||||
|
list_data->obj = obj;
|
||||||
|
list_data->destructor = destructor;
|
||||||
|
|
||||||
|
return (list_data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static ObjListData ObjListData_Destroy(ObjListData list_data)
|
||||||
|
{
|
||||||
|
if (list_data == NULL) return (NULL);
|
||||||
|
|
||||||
|
/* <20>ǥ<EFBFBD><C7A5>ȥ饯<C8A5><E9A5AF><EFBFBD>μ¹<CEBC> */
|
||||||
|
if (list_data->destructor)
|
||||||
|
(*(list_data->destructor))(list_data->obj);
|
||||||
|
|
||||||
|
free(list_data);
|
||||||
|
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* ObjList <20><><EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
Obj ObjListData_GetObj(ObjListData data)
|
||||||
|
{
|
||||||
|
if (data == NULL) return (NULL);
|
||||||
|
return (data->obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjListData_GetPrev(ObjListData data)
|
||||||
|
{
|
||||||
|
if (data == NULL) return (NULL);
|
||||||
|
return (data->prev);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjListData_GetNext(ObjListData data)
|
||||||
|
{
|
||||||
|
if (data == NULL) return (NULL);
|
||||||
|
return (data->next);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ObjList_GetLength(ObjList list)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (-1);
|
||||||
|
return (list->length);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_GetStartEdge(ObjList list)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
return (list->start_edge);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_GetEndEdge(ObjList list)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
return (list->end_edge);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_GetStart(ObjList list)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
return (list->start_edge->next);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_GetEnd(ObjList list)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
return (list->end_edge->prev);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ObjList_IsEmpty(ObjList list)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (1);
|
||||||
|
return (list->start_edge->next == list->end_edge);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ObjList_IsStartEdge(ObjList list, ObjListData data)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (0);
|
||||||
|
return (data == list->start_edge);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ObjList_IsEndEdge(ObjList list, ObjListData data)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (0);
|
||||||
|
return (data == list->end_edge);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ObjList_IsStart(ObjList list, ObjListData data)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (0);
|
||||||
|
return (data == list->start_edge->next);
|
||||||
|
}
|
||||||
|
|
||||||
|
int ObjList_IsEnd(ObjList list, ObjListData data)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (0);
|
||||||
|
return (data == list->end_edge->prev);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_InsertObjToPrev(ObjList list, ObjListData current,
|
||||||
|
Obj obj, Obj (*destructor)())
|
||||||
|
{
|
||||||
|
ObjListData data;
|
||||||
|
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
if (ObjList_IsStartEdge(list, current)) return (NULL);
|
||||||
|
|
||||||
|
data = ObjListData_Create(obj, destructor);
|
||||||
|
if (data == NULL) return (NULL);
|
||||||
|
|
||||||
|
data->prev = current->prev;
|
||||||
|
data->next = current;
|
||||||
|
current->prev->next = data;
|
||||||
|
current->prev = data;
|
||||||
|
(list->length)++;
|
||||||
|
|
||||||
|
return (data);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_InsertObjToNext(ObjList list, ObjListData current,
|
||||||
|
Obj obj, Obj (*destructor)())
|
||||||
|
{
|
||||||
|
ObjListData data;
|
||||||
|
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
if (ObjList_IsEndEdge(list, current)) return (NULL);
|
||||||
|
|
||||||
|
data = ObjListData_Create(obj, destructor);
|
||||||
|
if (data == NULL) return (NULL);
|
||||||
|
|
||||||
|
data->next = current->next;
|
||||||
|
data->prev = current;
|
||||||
|
current->next->prev = data;
|
||||||
|
current->next = data;
|
||||||
|
(list->length)++;
|
||||||
|
|
||||||
|
return (data);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_InsertObjToStart(ObjList list, Obj obj,
|
||||||
|
Obj (*destructor)())
|
||||||
|
{
|
||||||
|
ObjListData current;
|
||||||
|
current = ObjList_GetStart(list);
|
||||||
|
return (ObjList_InsertObjToPrev(list, current, obj, destructor));
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_InsertObjToEnd(ObjList list, Obj obj,
|
||||||
|
Obj (*destructor)())
|
||||||
|
{
|
||||||
|
ObjListData current;
|
||||||
|
current = ObjList_GetEnd(list);
|
||||||
|
return (ObjList_InsertObjToNext(list, current, obj, destructor));
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_DeleteObjToPrev(ObjList list, ObjListData current)
|
||||||
|
{
|
||||||
|
ObjListData ret;
|
||||||
|
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
if (ObjList_IsStartEdge(list, current) || ObjList_IsEndEdge(list, current))
|
||||||
|
return (NULL);
|
||||||
|
|
||||||
|
current->prev->next = current->next;
|
||||||
|
current->next->prev = current->prev;
|
||||||
|
|
||||||
|
ret = current->prev;
|
||||||
|
ObjListData_Destroy(current);
|
||||||
|
(list->length)--;
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_DeleteObjToNext(ObjList list, ObjListData current)
|
||||||
|
{
|
||||||
|
ObjListData ret;
|
||||||
|
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
if (ObjList_IsStartEdge(list, current) || ObjList_IsEndEdge(list, current))
|
||||||
|
return (NULL);
|
||||||
|
|
||||||
|
current->prev->next = current->next;
|
||||||
|
current->next->prev = current->prev;
|
||||||
|
|
||||||
|
ret = current->next;
|
||||||
|
ObjListData_Destroy(current);
|
||||||
|
(list->length)--;
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_DeleteObjFromStart(ObjList list)
|
||||||
|
{
|
||||||
|
ObjListData current;
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
current = ObjList_GetStart(list);
|
||||||
|
return (ObjList_DeleteObjToNext(list, current));
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_DeleteObjFromEnd(ObjList list)
|
||||||
|
{
|
||||||
|
ObjListData current;
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
current = ObjList_GetEnd(list);
|
||||||
|
return (ObjList_DeleteObjToPrev(list, current));
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_MoveObjToPrev(ObjList list,
|
||||||
|
ObjListData current,
|
||||||
|
ObjListData to)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
return (ObjList_MoveObjToPrevOfOtherList(list, current, list, to));
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_MoveObjToNext(ObjList list,
|
||||||
|
ObjListData current,
|
||||||
|
ObjListData to)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
return (ObjList_MoveObjToNextOfOtherList(list, current, list, to));
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_MoveObjToStart(ObjList list, ObjListData current)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
return (ObjList_MoveObjToStartOfOtherList(list, current, list));
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_MoveObjToEnd(ObjList list, ObjListData current)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
return (ObjList_MoveObjToEndOfOtherList(list, current, list));
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjList ObjList_Create() /* ObjList <20><><EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
{
|
||||||
|
ObjList list;
|
||||||
|
|
||||||
|
list = (ObjList)malloc(sizeof(_ObjList));
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
|
||||||
|
list->start_edge = ObjListData_Create(NULL, NULL);
|
||||||
|
list->end_edge = ObjListData_Create(NULL, NULL);
|
||||||
|
list->length = 0; /* <20><><EFBFBD><EFBFBD>¸<EFBFBD>ߤ<EFBFBD><DFA4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>ο<EFBFBD> */
|
||||||
|
|
||||||
|
list->start_edge->prev = NULL;
|
||||||
|
list->start_edge->next = list->end_edge;
|
||||||
|
list->end_edge->prev = list->start_edge;
|
||||||
|
list->end_edge->next = NULL;
|
||||||
|
|
||||||
|
return (list);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjList ObjList_Destroy(ObjList list) /* */
|
||||||
|
{
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
|
||||||
|
while (!ObjList_IsEmpty(list))
|
||||||
|
ObjList_DeleteObjFromStart(list);
|
||||||
|
|
||||||
|
if (list->start_edge)
|
||||||
|
list->start_edge = ObjListData_Destroy(list->start_edge);
|
||||||
|
if (list->end_edge)
|
||||||
|
list->end_edge = ObjListData_Destroy(list->end_edge);
|
||||||
|
|
||||||
|
free(list);
|
||||||
|
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* ʣ<><CAA3><EFBFBD>Υꥹ<CEA5>ȴ֤Ǥ<D6A4><C7A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
ObjListData ObjList_MoveObjToPrevOfOtherList(ObjList list, ObjListData current,
|
||||||
|
ObjList to_list, ObjListData to)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
if (to_list == NULL) return (NULL);
|
||||||
|
if (ObjList_IsStartEdge(list, current) || ObjList_IsEndEdge(list, current))
|
||||||
|
return (NULL);
|
||||||
|
|
||||||
|
if (ObjList_IsStartEdge(to_list, to)) return (NULL);
|
||||||
|
if ((list == to_list) && (current == to)) return (current);
|
||||||
|
|
||||||
|
current->prev->next = current->next;
|
||||||
|
current->next->prev = current->prev;
|
||||||
|
|
||||||
|
current->prev = to->prev;
|
||||||
|
current->next = to;
|
||||||
|
to->prev->next = current;
|
||||||
|
to->prev = current;
|
||||||
|
|
||||||
|
(list->length)--;
|
||||||
|
(to_list->length)++;
|
||||||
|
|
||||||
|
return (current);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_MoveObjToNextOfOtherList(ObjList list, ObjListData current,
|
||||||
|
ObjList to_list, ObjListData to)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
if (ObjList_IsStartEdge(list, current) || ObjList_IsEndEdge(list, current))
|
||||||
|
return (NULL);
|
||||||
|
|
||||||
|
if (ObjList_IsEndEdge(to_list, to)) return (NULL);
|
||||||
|
if ((list == to_list) && (current == to)) return (current);
|
||||||
|
|
||||||
|
current->prev->next = current->next;
|
||||||
|
current->next->prev = current->prev;
|
||||||
|
|
||||||
|
current->next = to->next;
|
||||||
|
current->prev = to;
|
||||||
|
to->next->prev = current;
|
||||||
|
to->next = current;
|
||||||
|
|
||||||
|
(list->length)--;
|
||||||
|
(to_list->length)++;
|
||||||
|
|
||||||
|
return (current);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_MoveObjToStartOfOtherList(ObjList list,
|
||||||
|
ObjListData current,
|
||||||
|
ObjList to_list)
|
||||||
|
{
|
||||||
|
ObjListData to;
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
if (to_list == NULL) return (NULL);
|
||||||
|
to = ObjList_GetStart(to_list);
|
||||||
|
return (ObjList_MoveObjToPrevOfOtherList(list, current, to_list, to));
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjListData ObjList_MoveObjToEndOfOtherList(ObjList list,
|
||||||
|
ObjListData current,
|
||||||
|
ObjList to_list)
|
||||||
|
{
|
||||||
|
ObjListData to;
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
if (to_list == NULL) return (NULL);
|
||||||
|
to = ObjList_GetEnd(to_list);
|
||||||
|
return (ObjList_MoveObjToNextOfOtherList(list, current, to_list, to));
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjList ObjList_Concatenate(ObjList list1, ObjList list2)
|
||||||
|
{
|
||||||
|
ObjListData tmp;
|
||||||
|
|
||||||
|
if (list1 == NULL) {
|
||||||
|
list1 = list2;
|
||||||
|
return (list1);
|
||||||
|
}
|
||||||
|
if (list2 == NULL) return (list1);
|
||||||
|
|
||||||
|
list1->end_edge->prev->next = list2->start_edge->next;
|
||||||
|
list2->start_edge->next->prev = list1->end_edge->prev;
|
||||||
|
|
||||||
|
tmp = list1->end_edge;
|
||||||
|
list1->end_edge = list2->end_edge;
|
||||||
|
list2->end_edge = tmp;
|
||||||
|
|
||||||
|
list2->start_edge->next = list2->end_edge;
|
||||||
|
list2->end_edge->prev = list2->start_edge;
|
||||||
|
|
||||||
|
list1->length += list2->length;
|
||||||
|
list2->length = 0;
|
||||||
|
|
||||||
|
ObjList_Destroy(list2);
|
||||||
|
|
||||||
|
return (list1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* End of File. */
|
||||||
76
Obj.h
Normal file
76
Obj.h
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
/*****************************************************************************/
|
||||||
|
/* Obj.h - A library for object list. */
|
||||||
|
/* */
|
||||||
|
/* Obj.h Copyright (c) 2000 Sakai Hiroaki. */
|
||||||
|
/* All Rights Reserved. */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef _SAKAILIB_OBJ_H_INCLUDED_
|
||||||
|
#define _SAKAILIB_OBJ_H_INCLUDED_
|
||||||
|
|
||||||
|
typedef void * Obj;
|
||||||
|
typedef struct _ObjListData * ObjListData;
|
||||||
|
typedef struct _ObjList * ObjList;
|
||||||
|
typedef Obj (*ObjDestructor)(Obj);
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* ObjList <20><><EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
Obj ObjListData_GetObj(ObjListData data);
|
||||||
|
ObjListData ObjListData_GetPrev(ObjListData data);
|
||||||
|
ObjListData ObjListData_GetNext(ObjListData data);
|
||||||
|
int ObjList_GetLength(ObjList list);
|
||||||
|
ObjListData ObjList_GetStartEdge(ObjList list);
|
||||||
|
ObjListData ObjList_GetEndEdge(ObjList list);
|
||||||
|
ObjListData ObjList_GetStart(ObjList list);
|
||||||
|
ObjListData ObjList_GetEnd(ObjList list);
|
||||||
|
int ObjList_IsEmpty(ObjList list);
|
||||||
|
int ObjList_IsStartEdge(ObjList list, ObjListData data);
|
||||||
|
int ObjList_IsEndEdge(ObjList list, ObjListData data);
|
||||||
|
int ObjList_IsStart(ObjList list, ObjListData data);
|
||||||
|
int ObjList_IsEnd(ObjList list, ObjListData data);
|
||||||
|
ObjListData ObjList_InsertObjToPrev(ObjList list, ObjListData current,
|
||||||
|
Obj obj, Obj (*destructor)());
|
||||||
|
ObjListData ObjList_InsertObjToNext(ObjList list, ObjListData current,
|
||||||
|
Obj obj, Obj (*destructor)());
|
||||||
|
ObjListData ObjList_InsertObjToStart(ObjList list, Obj obj,
|
||||||
|
Obj (*destructor)());
|
||||||
|
ObjListData ObjList_InsertObjToEnd(ObjList list, Obj obj,
|
||||||
|
Obj (*destructor)());
|
||||||
|
ObjListData ObjList_DeleteObjToPrev(ObjList list, ObjListData current);
|
||||||
|
ObjListData ObjList_DeleteObjToNext(ObjList list, ObjListData current);
|
||||||
|
ObjListData ObjList_DeleteObjFromStart(ObjList list);
|
||||||
|
ObjListData ObjList_DeleteObjFromEnd(ObjList list);
|
||||||
|
ObjListData ObjList_MoveObjToPrev(ObjList list,
|
||||||
|
ObjListData current,
|
||||||
|
ObjListData to);
|
||||||
|
ObjListData ObjList_MoveObjToNext(ObjList list,
|
||||||
|
ObjListData current,
|
||||||
|
ObjListData to);
|
||||||
|
ObjListData ObjList_MoveObjToStart(ObjList list, ObjListData current);
|
||||||
|
ObjListData ObjList_MoveObjToEnd(ObjList list, ObjListData current);
|
||||||
|
ObjList ObjList_Create(); /* ObjList <20><><EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
ObjList ObjList_Destroy(ObjList list); /* */
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* ʣ<><CAA3><EFBFBD>Υꥹ<CEA5>ȴ֤Ǥ<D6A4><C7A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
ObjListData ObjList_MoveObjToPrevOfOtherList(ObjList list, ObjListData current,
|
||||||
|
ObjList to_list, ObjListData to);
|
||||||
|
ObjListData ObjList_MoveObjToNextOfOtherList(ObjList list, ObjListData current,
|
||||||
|
ObjList to_list, ObjListData to);
|
||||||
|
ObjListData ObjList_MoveObjToStartOfOtherList(ObjList list,
|
||||||
|
ObjListData current,
|
||||||
|
ObjList to_list);
|
||||||
|
ObjListData ObjList_MoveObjToEndOfOtherList(ObjList list,
|
||||||
|
ObjListData current,
|
||||||
|
ObjList to_list);
|
||||||
|
ObjList ObjList_Concatenate(ObjList list1, ObjList list2);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
28
ObjP.h
Normal file
28
ObjP.h
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
/*****************************************************************************/
|
||||||
|
/* ObjP.h - A library for object list. */
|
||||||
|
/* */
|
||||||
|
/* ObjP.h Copyright (c) 2000 Sakai Hiroaki. */
|
||||||
|
/* All Rights Reserved. */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef _SAKAILIB_OBJP_H_INCLUDED_
|
||||||
|
#define _SAKAILIB_OBJP_H_INCLUDED_
|
||||||
|
|
||||||
|
#include "Obj.h"
|
||||||
|
|
||||||
|
/* <20>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>ѹ<EFBFBD>¤<EFBFBD><C2A4> */
|
||||||
|
typedef struct _ObjListData {
|
||||||
|
struct _ObjListData * prev; /* <20><><EFBFBD>Υǡ<CEA5><C7A1><EFBFBD> */
|
||||||
|
struct _ObjListData * next; /* <20><><EFBFBD>Υǡ<CEA5><C7A1><EFBFBD> */
|
||||||
|
Obj obj; /* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
Obj (*destructor)(Obj); /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸ƤФ<C6A4><D0A4><EFBFBD><EFBFBD>ǥ<EFBFBD><C7A5>ȥ饯<C8A5><E9A5AF> */
|
||||||
|
} _ObjListData;
|
||||||
|
|
||||||
|
/* <20>ꥹ<EFBFBD>ȹ<EFBFBD>¤<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
typedef struct _ObjList {
|
||||||
|
struct _ObjListData * start_edge;
|
||||||
|
struct _ObjListData * end_edge;
|
||||||
|
int length;
|
||||||
|
} _ObjList;
|
||||||
|
|
||||||
|
#endif
|
||||||
182
UNIXSerialPort.c
Normal file
182
UNIXSerialPort.c
Normal file
@@ -0,0 +1,182 @@
|
|||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
|
||||||
|
#include "UNIXSerialPortP.h"
|
||||||
|
#include "WonX.h"
|
||||||
|
#include "etc.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20>ݡ<EFBFBD><DDA1>Ȥ<EFBFBD> open/close */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
int UNIXSerialPort_Open(UNIXSerialPort unix_serial_port)
|
||||||
|
{
|
||||||
|
unix_serial_port->opened = 1;
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
int UNIXSerialPort_Close(UNIXSerialPort unix_serial_port)
|
||||||
|
{
|
||||||
|
unix_serial_port->opened = 0;
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int UNIXSerialPort_IsOpened(UNIXSerialPort unix_serial_port)
|
||||||
|
{ return (unix_serial_port->opened != 0); }
|
||||||
|
int UNIXSerialPort_IsClosed(UNIXSerialPort unix_serial_port)
|
||||||
|
{ return (unix_serial_port->opened == 0); }
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤫<EFBFBD>ɤ<EFBFBD><C9A4><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD>ॢ<EFBFBD><E0A5A2><EFBFBD>Ȼ<EFBFBD><C8BB>֤<EFBFBD><D6A4>ߥ<EFBFBD><DFA5><EFBFBD>ñ<EFBFBD>̤ǻ<CCA4><C7BB>ꡥ
|
||||||
|
* 0 <20>ΤȤ<CEA4><C8A4>ϡ<EFBFBD>¨<EFBFBD><C2A8>
|
||||||
|
* -1 <20>ΤȤ<CEA4><C8A4>ϡ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD>
|
||||||
|
*/
|
||||||
|
|
||||||
|
int UNIXSerialPort_IsDataExisting(UNIXSerialPort unix_serial_port,
|
||||||
|
int timeout)
|
||||||
|
{
|
||||||
|
fd_set bitmap;
|
||||||
|
struct timeval t;
|
||||||
|
struct timeval * t_p;
|
||||||
|
#if 0
|
||||||
|
int c;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (UNIXSerialPort_IsClosed(unix_serial_port)) return (0);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 0 <20>ΤȤ<CEA4><C8A4>ϡ<EFBFBD>¨<EFBFBD><C2A8>
|
||||||
|
* -1 <20>ΤȤ<CEA4><C8A4>ϡ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD>
|
||||||
|
*/
|
||||||
|
if (timeout == -1) {
|
||||||
|
t_p = NULL;
|
||||||
|
} else {
|
||||||
|
t.tv_sec = timeout / 1000;
|
||||||
|
t.tv_usec = (timeout % 1000) * 1000;
|
||||||
|
t_p = &t;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* FreeBSD3.4 <20>Ǽ¸<C7BC><C2B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
* <20><><EFBFBD>顼<EFBFBD>ॷ<EFBFBD><E0A5B7><EFBFBD>ʥ<EFBFBD><CAA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>硤select()<29>ǤΥ֥<CEA5><D6A5>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
* <20><><EFBFBD>顼<EFBFBD>ॷ<EFBFBD><E0A5B7><EFBFBD>ʥ뤬ȯ<EBA4AC><C8AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD>select()<29>⥿<EFBFBD><E2A5BF><EFBFBD>ॢ<EFBFBD><E0A5A2><EFBFBD><EFBFBD>
|
||||||
|
* <20><><EFBFBD>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4>Τǡ<CEA4><C7A1><EFBFBD><EFBFBD>ա<EFBFBD>
|
||||||
|
* (select() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ॢ<EFBFBD><E0A5A2><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˥<EFBFBD><CBA5>顼<EFBFBD>ॷ<EFBFBD><E0A5B7><EFBFBD>ʥ뤬ȯ<EBA4AC><C8AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD>
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ư<EFBFBD><EFBFBD><EEA4B7>)
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̵꤬<EAA4AC><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>ԤäƤ<C3A4><C6A4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݤ<EFBFBD>
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롥
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
/* <20>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD>Ф<EFBFBD><D0A4><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD>ä<EFBFBD><C3A4>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ȥ<EFBFBD> */
|
||||||
|
do {
|
||||||
|
FD_ZERO(&bitmap);
|
||||||
|
FD_SET(fileno(stdin), &bitmap);
|
||||||
|
select(fileno(stdin) + 1, &bitmap, NULL, NULL, t_p);
|
||||||
|
|
||||||
|
if (!FD_ISSET(fileno(stdin), &bitmap))
|
||||||
|
return (0);
|
||||||
|
|
||||||
|
c = fgetc(stdin);
|
||||||
|
} while (0); /* <20>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD>Ф<EFBFBD><D0A4><EFBFBD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>c<EFBFBD><63><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
ungetc(c, stdin);
|
||||||
|
#else
|
||||||
|
FD_ZERO(&bitmap);
|
||||||
|
FD_SET(fileno(stdin), &bitmap);
|
||||||
|
select(fileno(stdin) + 1, &bitmap, NULL, NULL, t_p);
|
||||||
|
|
||||||
|
if (!FD_ISSET(fileno(stdin), &bitmap))
|
||||||
|
return (0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
int UNIXSerialPort_ReceiveCharacter(UNIXSerialPort unix_serial_port,
|
||||||
|
int timeout)
|
||||||
|
{
|
||||||
|
int c;
|
||||||
|
|
||||||
|
if (UNIXSerialPort_IsClosed(unix_serial_port)) return (-1);
|
||||||
|
|
||||||
|
c = UNIXSerialPort_IsDataExisting(unix_serial_port, timeout)
|
||||||
|
? fgetc(stdin) : -1;
|
||||||
|
c = (c == '\n') ? '\r' : c; /* \r <20>Υ<EFBFBD><CEA5>ߥ<EFBFBD><DFA5>졼<EFBFBD><ECA1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
|
||||||
|
return (c);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
int UNIXSerialPort_SendCharacter(UNIXSerialPort unix_serial_port,
|
||||||
|
unsigned char c)
|
||||||
|
{
|
||||||
|
if (UNIXSerialPort_IsClosed(unix_serial_port)) return (0);
|
||||||
|
|
||||||
|
wonx_print_character(stdout, c);
|
||||||
|
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
UNIXSerialPort UNIXSerialPort_Create()
|
||||||
|
{
|
||||||
|
UNIXSerialPort unix_serial_port;
|
||||||
|
|
||||||
|
unix_serial_port = (UNIXSerialPort)malloc(sizeof(_UNIXSerialPort));
|
||||||
|
if (unix_serial_port == NULL)
|
||||||
|
WonX_Error("UNIXSerialPort_Create", "Cannot allocate memory.");
|
||||||
|
|
||||||
|
unix_serial_port->opened = 0;
|
||||||
|
|
||||||
|
return (unix_serial_port);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
UNIXSerialPort UNIXSerialPort_Destroy(UNIXSerialPort unix_serial_port)
|
||||||
|
{
|
||||||
|
if (unix_serial_port == NULL)
|
||||||
|
WonX_Error("UNIXSerialPort_Destroy", "Object is not created.");
|
||||||
|
|
||||||
|
if (UNIXSerialPort_IsOpened(unix_serial_port)) {
|
||||||
|
UNIXSerialPort_Close(unix_serial_port);
|
||||||
|
unix_serial_port->opened = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
free(unix_serial_port);
|
||||||
|
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* End of File. */
|
||||||
|
/*****************************************************************************/
|
||||||
82
UNIXSerialPort.h
Normal file
82
UNIXSerialPort.h
Normal file
@@ -0,0 +1,82 @@
|
|||||||
|
#ifndef _UNIXSerialPort_h_INCLUDED_
|
||||||
|
#define _UNIXSerialPort_h_INCLUDED_
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
typedef struct _UNIXSerialPort * UNIXSerialPort;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20>ݡ<EFBFBD><DDA1>Ȥ<EFBFBD> open/close */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
int UNIXSerialPort_Open(UNIXSerialPort unix_serial_port);
|
||||||
|
int UNIXSerialPort_Close(UNIXSerialPort unix_serial_port);
|
||||||
|
|
||||||
|
int UNIXSerialPort_IsOpened(UNIXSerialPort unix_serial_port);
|
||||||
|
int UNIXSerialPort_IsClosed(UNIXSerialPort unix_serial_port);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤫<EFBFBD>ɤ<EFBFBD><C9A4><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD>ॢ<EFBFBD><E0A5A2><EFBFBD>Ȼ<EFBFBD><C8BB>֤<EFBFBD><D6A4>ߥ<EFBFBD><DFA5><EFBFBD>ñ<EFBFBD>̤ǻ<CCA4><C7BB>ꡥ
|
||||||
|
* 0 <20>ΤȤ<CEA4><C8A4>ϡ<EFBFBD>¨<EFBFBD><C2A8>
|
||||||
|
* -1 <20>ΤȤ<CEA4><C8A4>ϡ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD>
|
||||||
|
*/
|
||||||
|
|
||||||
|
int UNIXSerialPort_IsDataExisting(UNIXSerialPort unix_serial_port,
|
||||||
|
int timeout);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
int UNIXSerialPort_ReceiveCharacter(UNIXSerialPort unix_serial_port,
|
||||||
|
int timeout);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
int UNIXSerialPort_SendCharacter(UNIXSerialPort unix_serial_port,
|
||||||
|
unsigned char c);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
UNIXSerialPort UNIXSerialPort_Create();
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
UNIXSerialPort UNIXSerialPort_Destroy(UNIXSerialPort unix_serial_port);
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* End of File. */
|
||||||
|
/*****************************************************************************/
|
||||||
@@ -1,19 +1,19 @@
|
|||||||
#ifndef _WonXTextP_h_INCLUDED_
|
#ifndef _UNIXSerialPortP_h_INCLUDED_
|
||||||
#define _WonXTextP_h_INCLUDED_
|
#define _UNIXSerialPortP_h_INCLUDED_
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* ここから */
|
/* ここから */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WonXText.h"
|
#include "UNIXSerialPort.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* クラスの定義 */
|
/* クラスの定義 */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WonXText {
|
typedef struct _UNIXSerialPort {
|
||||||
WWText ww_text;
|
int opened; /* open/close */
|
||||||
} _WonXText;
|
} _UNIXSerialPort;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* ここまで */
|
/* ここまで */
|
||||||
20
UNIXTimer.c
20
UNIXTimer.c
@@ -6,7 +6,7 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include "UNIXTimerP.h"
|
#include "UNIXTimerP.h"
|
||||||
#include "etc.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
@@ -23,6 +23,7 @@ volatile static UNIXTimer pointed_unix_timer = NULL;
|
|||||||
static void UNIXTimer_CallBackFunction(int argument)
|
static void UNIXTimer_CallBackFunction(int argument)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
int old;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* static <20>ʥե饰<D5A5><E9A5B0>Ω<EFBFBD>Ƥơ<C6A4><C6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>饳<EFBFBD><E9A5B3><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF><EFBFBD>
|
* static <20>ʥե饰<D5A5><E9A5B0>Ω<EFBFBD>Ƥơ<C6A4><C6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>饳<EFBFBD><E9A5B3><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF><EFBFBD>
|
||||||
@@ -34,6 +35,9 @@ static void UNIXTimer_CallBackFunction(int argument)
|
|||||||
|
|
||||||
if (pointed_unix_timer->pause) {
|
if (pointed_unix_timer->pause) {
|
||||||
pointed_unix_timer->interrupt_in_pause++;
|
pointed_unix_timer->interrupt_in_pause++;
|
||||||
|
if (pointed_unix_timer->interrupt_in_pause > 1000) {
|
||||||
|
WonX_Error("UNIXTimer_CallBackFunction", "interrupt count is too much.");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (pointed_unix_timer->interrupt_in_pause == 0)
|
if (pointed_unix_timer->interrupt_in_pause == 0)
|
||||||
pointed_unix_timer->interrupt_in_pause = 1;
|
pointed_unix_timer->interrupt_in_pause = 1;
|
||||||
@@ -44,13 +48,15 @@ static void UNIXTimer_CallBackFunction(int argument)
|
|||||||
/*
|
/*
|
||||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>椫<EFBFBD><E6A4AB> UNIXTimer_Unpause() <20>ʤɤ<CAA4><C9A4>ƤФ<C6A4><D0A4>ơ<EFBFBD>
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>椫<EFBFBD><E6A4AB> UNIXTimer_Unpause() <20>ʤɤ<CAA4><C9A4>ƤФ<C6A4><D0A4>ơ<EFBFBD>
|
||||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>餵<EFBFBD><E9A4B5><EFBFBD>˥<EFBFBD><CBA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>ƤФ줿<D0A4>ꤷ<EFBFBD><EAA4B7><EFBFBD>Ȥ<EFBFBD><C8A4>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>ˡ<EFBFBD>
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>餵<EFBFBD><E9A4B5><EFBFBD>˥<EFBFBD><CBA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>ƤФ줿<D0A4>ꤷ<EFBFBD><EAA4B7><EFBFBD>Ȥ<EFBFBD><C8A4>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>ˡ<EFBFBD>
|
||||||
* <20>ݡ<EFBFBD><DDA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롥
|
* <20>ݡ<EFBFBD><DDA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롥<EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ΤȤ<EFBFBD><EFBFBD><EFBFBD>interrupt_in_pause <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3A5AFA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD>¥롼<C2A5>פ˴٤äƤ<C3A4><C6A4>ޤ<EFBFBD><DEA4><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(?)<29>Τǡ<CEA4>
|
||||||
|
* interrupt_in_pause <20><><EFBFBD><EFBFBD>¸<EFBFBD><C2B8><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF>μ¹Ը<C2B9><D4B8>˸<EFBFBD><CBB8><EFBFBD><EFBFBD>᤹<EFBFBD><E1A4B9>
|
||||||
*/
|
*/
|
||||||
pointed_unix_timer->pause++;
|
pointed_unix_timer->pause++;
|
||||||
|
old = pointed_unix_timer->interrupt_in_pause;
|
||||||
ret = (*pointed_unix_timer->callback)(pointed_unix_timer->parameter);
|
ret = (*pointed_unix_timer->callback)(pointed_unix_timer->parameter);
|
||||||
|
|
||||||
pointed_unix_timer->pause--;
|
pointed_unix_timer->pause--;
|
||||||
|
pointed_unix_timer->interrupt_in_pause = old;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> UNIXTimer_* <20><>Ϣ<EFBFBD>δؿ<CEB4><D8BF><EFBFBD><EFBFBD>ƤӽФ<D3BD><D0A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD>
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> UNIXTimer_* <20><>Ϣ<EFBFBD>δؿ<CEB4><D8BF><EFBFBD><EFBFBD>ƤӽФ<D3BD><D0A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD>
|
||||||
@@ -171,6 +177,8 @@ int UNIXTimer_Unpause(UNIXTimer unix_timer)
|
|||||||
{
|
{
|
||||||
if (unix_timer->pause == 0)
|
if (unix_timer->pause == 0)
|
||||||
WonX_Error("UNIXTimer_Unpause", "Duplicated unpause.");
|
WonX_Error("UNIXTimer_Unpause", "Duplicated unpause.");
|
||||||
|
if (unix_timer->pause < 0)
|
||||||
|
WonX_Error("UNIXTimer_Unpause", "Invalid pause.");
|
||||||
|
|
||||||
if (unix_timer->pause == 1) {
|
if (unix_timer->pause == 1) {
|
||||||
if (unix_timer->interrupt_in_pause > 0) {
|
if (unix_timer->interrupt_in_pause > 0) {
|
||||||
@@ -198,6 +206,10 @@ int UNIXTimer_Unpause(UNIXTimer unix_timer)
|
|||||||
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF>θƤӽФ<D3BD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF>θƤӽФ<D3BD> */
|
||||||
UNIXTimer_CallBackFunction(0);
|
UNIXTimer_CallBackFunction(0);
|
||||||
|
} else {
|
||||||
|
if (unix_timer->interrupt_in_pause < 0)
|
||||||
|
WonX_Error("UNIXTimer_Unpause", "Invalid interrupt_in_pause.");
|
||||||
|
unix_timer->pause--; /* <20>ݡ<EFBFBD><DDA1><EFBFBD><EFBFBD>ϥͥ<CFA5><CDA5>ȤǤ<C8A4><C7A4><EFBFBD> */
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
unix_timer->pause--; /* <20>ݡ<EFBFBD><DDA1><EFBFBD><EFBFBD>ϥͥ<CFA5><CDA5>ȤǤ<C8A4><C7A4><EFBFBD> */
|
unix_timer->pause--; /* <20>ݡ<EFBFBD><DDA1><EFBFBD><EFBFBD>ϥͥ<CFA5><CDA5>ȤǤ<C8A4><C7A4><EFBFBD> */
|
||||||
|
|||||||
10
UNIXTimer.h
10
UNIXTimer.h
@@ -5,9 +5,6 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -15,6 +12,13 @@
|
|||||||
typedef struct _UNIXTimer * UNIXTimer;
|
typedef struct _UNIXTimer * UNIXTimer;
|
||||||
typedef int (*UNIXTimerCallBack)(void *);
|
typedef int (*UNIXTimerCallBack)(void *);
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
272
WWCharacter.c
272
WWCharacter.c
@@ -2,29 +2,127 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "WWCharacterP.h"
|
#include "WWCharacterP.h"
|
||||||
|
#include "WonX.h"
|
||||||
#include "etc.h"
|
#include "etc.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* <20>ʥ<EFBFBD><CAA5>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
int WWCharacter_GetNumber(WWCharacter c)
|
int WWCharacter_GetNumber(WWCharacter c)
|
||||||
{
|
{
|
||||||
if (c == NULL) WonX_Error("WWCharacter_GetNumber()", "WWCharacter is NULL.");
|
if (c == NULL) WonX_Error("WWCharacter_GetNumber", "WWCharacter is NULL.");
|
||||||
|
|
||||||
return (c->number);
|
return (c->number);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WWCharacter_SetNumber(WWCharacter c, int n)
|
int WWCharacter_SetNumber(WWCharacter c, int n)
|
||||||
{
|
{
|
||||||
if ((n < 0) || (n >= 512))
|
if (c == NULL) WonX_Error("WWCharacter_SetNumber", "WWCharacter is NULL.");
|
||||||
WonX_Error("WWCharacter_SetNumber()", "Invalid range.");
|
|
||||||
|
if ((n < 0) || (n > 512 - 1))
|
||||||
|
WonX_Error("WWCharacter_SetNumber", "Invalid range.");
|
||||||
|
|
||||||
return (c->number = n);
|
return (c->number = n);
|
||||||
}
|
}
|
||||||
|
|
||||||
WWCharacter WWCharacter_Create(int number, unsigned char * bitmap)
|
/*===========================================================================*/
|
||||||
|
/* <20>ӥåȥޥåפ<C3A5><D7A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* char <20><><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤿<EFBFBD><EBA4BF><EFBFBD>δؿ<CEB4> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
unsigned char WWCharacter_GetBitmapAsChar(WWCharacter c, int n)
|
||||||
|
{
|
||||||
|
if (c == NULL)
|
||||||
|
WonX_Error("WWCharacter_GetBitmapAsChar", "WWCharacter is NULL.");
|
||||||
|
|
||||||
|
if ((n < 0) || (n > 32 - 1))
|
||||||
|
WonX_Error("WWCharacter_GetBitmapAsChar", "Invalid range.");
|
||||||
|
|
||||||
|
return (c->bitmap.bitmap_char[n]);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char WWCharacter_SetBitmapAsChar(WWCharacter c, int n,
|
||||||
|
unsigned char bitmap)
|
||||||
|
{
|
||||||
|
if (c == NULL)
|
||||||
|
WonX_Error("WWCharacter_SetBitmapAsChar", "WWCharacter is NULL.");
|
||||||
|
|
||||||
|
if ((n < 0) || (n > 32 - 1))
|
||||||
|
WonX_Error("WWCharacter_SetBitmapAsChar", "Invalid range.");
|
||||||
|
|
||||||
|
return (c->bitmap.bitmap_char[n] = bitmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* short int <20><><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤿<EFBFBD><EBA4BF><EFBFBD>δؿ<CEB4> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
unsigned short int WWCharacter_GetBitmapAsShortInt(WWCharacter c, int n)
|
||||||
|
{
|
||||||
|
if (c == NULL)
|
||||||
|
WonX_Error("WWCharacter_GetBitmapAsShortInt", "WWCharacter is NULL.");
|
||||||
|
|
||||||
|
if ((n < 0) || (n > 16 - 1))
|
||||||
|
WonX_Error("WWCharacter_GetBitmapAsShortInt", "Invalid range.");
|
||||||
|
|
||||||
|
return (c->bitmap.bitmap_short_int[n]);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned short int WWCharacter_SetBitmapAsShortInt(WWCharacter c, int n,
|
||||||
|
unsigned short int bitmap)
|
||||||
|
{
|
||||||
|
if (c == NULL)
|
||||||
|
WonX_Error("WWCharacter_SetBitmapAsShortInt", "WWCharacter is NULL.");
|
||||||
|
|
||||||
|
if ((n < 0) || (n > 16 - 1))
|
||||||
|
WonX_Error("WWCharacter_SetBitmapAsShortInt", "Invalid range.");
|
||||||
|
|
||||||
|
return (c->bitmap.bitmap_short_int[n] = bitmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* long int <20><><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤿<EFBFBD><EBA4BF><EFBFBD>δؿ<CEB4> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
unsigned long int WWCharacter_GetBitmapAsLongInt(WWCharacter c, int n)
|
||||||
|
{
|
||||||
|
if (c == NULL)
|
||||||
|
WonX_Error("WWCharacter_GetBitmapAsLongInt", "WWCharacter is NULL.");
|
||||||
|
|
||||||
|
if ((n < 0) || (n > 8 - 1))
|
||||||
|
WonX_Error("WWCharacter_GetBitmapAsLongInt", "Invalid range.");
|
||||||
|
|
||||||
|
return (c->bitmap.bitmap_long_int[n]);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned long int WWCharacter_SetBitmapAsLongInt(WWCharacter c, int n,
|
||||||
|
unsigned long int bitmap)
|
||||||
|
{
|
||||||
|
if (c == NULL)
|
||||||
|
WonX_Error("WWCharacter_SetBitmapAsLongInt", "WWCharacter is NULL.");
|
||||||
|
|
||||||
|
if ((n < 0) || (n > 8 - 1))
|
||||||
|
WonX_Error("WWCharacter_SetBitmapAsLongInt", "Invalid range.");
|
||||||
|
|
||||||
|
return (c->bitmap.bitmap_long_int[n] = bitmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ<EFBFBD><C8BA><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
WWCharacter WWCharacter_Create(int number)
|
||||||
{
|
{
|
||||||
WWCharacter character;
|
WWCharacter character;
|
||||||
|
|
||||||
@@ -33,7 +131,7 @@ WWCharacter WWCharacter_Create(int number, unsigned char * bitmap)
|
|||||||
WonX_Error("WWCharacter_Create", "Cannot allocate memory.");
|
WonX_Error("WWCharacter_Create", "Cannot allocate memory.");
|
||||||
|
|
||||||
WWCharacter_SetNumber(character, number);
|
WWCharacter_SetNumber(character, number);
|
||||||
WWCharacter_SetBitmap(character, bitmap);
|
WWCharacter_ClearAllPixels(character);
|
||||||
|
|
||||||
return (character);
|
return (character);
|
||||||
}
|
}
|
||||||
@@ -41,99 +139,135 @@ WWCharacter WWCharacter_Create(int number, unsigned char * bitmap)
|
|||||||
WWCharacter WWCharacter_Destroy(WWCharacter character)
|
WWCharacter WWCharacter_Destroy(WWCharacter character)
|
||||||
{
|
{
|
||||||
if (character == NULL)
|
if (character == NULL)
|
||||||
WonX_Error("WWCharacter_Destroy()", "WWCharacter is NULL.");
|
WonX_Error("WWCharacter_Destroy", "Object is not created.");
|
||||||
free(character);
|
free(character);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char * WWCharacter_GetBitmap(WWCharacter character)
|
/*===========================================================================*/
|
||||||
{
|
/* <20>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
return (character->bitmap);
|
/*===========================================================================*/
|
||||||
}
|
|
||||||
|
|
||||||
int WWCharacter_SetBitmap(WWCharacter character, unsigned char * bitmap)
|
int WWCharacter_GetPixel(WWCharacter character, int x, int y,
|
||||||
|
WWDisplay display)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned short int pixel;
|
||||||
|
unsigned short int spixel;
|
||||||
|
unsigned long int lpixel;
|
||||||
|
|
||||||
if (character == NULL)
|
if (character == NULL)
|
||||||
WonX_Error("WWCharacter_SetBitmap()", "WWCharacter is NULL.");
|
WonX_Error("WWCharacter_GetPixel", "WWCharacter is NULL.");
|
||||||
|
|
||||||
for (i = 0; i < 16; i++) {
|
if ((x < 0) || (x > 7))
|
||||||
if (bitmap == NULL) {
|
WonX_Error("WWCharacter_GetPixel", "x is out of range.");
|
||||||
character->bitmap[i] = 0x00;
|
if ((y < 0) || (y > 7))
|
||||||
} else {
|
WonX_Error("WWCharacter_GetPixel", "y is out of range.");
|
||||||
character->bitmap[i] = bitmap[i];
|
|
||||||
}
|
/* <20>ѥ<EFBFBD><D1A5>åȿ<C3A5><C8BF><EFBFBD><EFBFBD>֤<EFBFBD> */
|
||||||
|
pixel = 0;
|
||||||
|
switch (WWDisplay_GetColorMode(display)) {
|
||||||
|
case COLOR_MODE_GRAYSCALE:
|
||||||
|
case COLOR_MODE_4COLOR:
|
||||||
|
spixel = (character->bitmap.bitmap_short_int[y] >> (7-x)) & 0x0101;
|
||||||
|
pixel =
|
||||||
|
((spixel & 0x0001) ? 1 : 0) |
|
||||||
|
((spixel & 0x0100) ? 2 : 0);
|
||||||
|
#if 0
|
||||||
|
pixel = ((character->bitmap.bitmap_char[y * 2 + 0] >> (7-x)) & 1) << 0;
|
||||||
|
pixel |= ((character->bitmap.bitmap_char[y * 2 + 1] >> (7-x)) & 1) << 1;
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case COLOR_MODE_16COLOR:
|
||||||
|
lpixel = (character->bitmap.bitmap_long_int[y] >> (7-x)) & 0x01010101;
|
||||||
|
pixel =
|
||||||
|
((lpixel & 0x00000001) ? 1 : 0) |
|
||||||
|
((lpixel & 0x00000100) ? 2 : 0) |
|
||||||
|
((lpixel & 0x00010000) ? 4 : 0) |
|
||||||
|
((lpixel & 0x01000000) ? 8 : 0);
|
||||||
|
#if 0
|
||||||
|
pixel = ((character->bitmap[y * 4 + 0] >> (7-x)) & 1) << 0;
|
||||||
|
pixel |= ((character->bitmap[y * 4 + 1] >> (7-x)) & 1) << 1;
|
||||||
|
pixel |= ((character->bitmap[y * 4 + 2] >> (7-x)) & 1) << 2;
|
||||||
|
pixel |= ((character->bitmap[y * 4 + 3] >> (7-x)) & 1) << 3;
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
case COLOR_MODE_16PACKED:
|
||||||
|
lpixel = character->bitmap.bitmap_long_int[y];
|
||||||
|
lpixel = lpixel >> (3 - (7-x) / 2) * 8;
|
||||||
|
lpixel = lpixel >> ((7-x) % 2) * 4;
|
||||||
|
pixel = lpixel & 0x0f;
|
||||||
|
#if 0
|
||||||
|
pixel = character->bitmap[y * 4 + 3 - (7-x) / 2] >> (((7-x) % 2) * 4);
|
||||||
|
pixel &= 0x0f;
|
||||||
|
#endif
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
WonX_Error("WWCharacter_GetPixel", "Unknown color mode.");
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
int WWCharacter_GetPixel(WWCharacter character, int x, int y)
|
|
||||||
{
|
|
||||||
if (character == NULL)
|
|
||||||
WonX_Error("WWCharacter_GetPixel()", "WWCharacter is NULL.");
|
|
||||||
|
|
||||||
if ((x < 0) || (x > 7))
|
|
||||||
WonX_Error("WWCharacter_GetPixel()", "x is invalid value.");
|
|
||||||
if ((y < 0) || (y > 7))
|
|
||||||
WonX_Error("WWCharacter_GetPixel()", "y is invalid value.");
|
|
||||||
|
|
||||||
/* <20>ӥåȥޥåפ<C3A5>2<EFBFBD>ӥåȤǤԤȤĤΥԥ<CEA5><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>롥 */
|
|
||||||
/* 2<>ӥåȤ<C3A5><C8A4>ͤ<EFBFBD><CDA4><EFBFBD>palette <20>ο<EFBFBD><CEBF><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>롥 */
|
|
||||||
/* bitmap <20><> unsigned char bitmap[16]; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>롥 */
|
|
||||||
|
|
||||||
/* <20>ѥ<EFBFBD><D1A5>åȿ<C3A5>(0<><30>3)<29><><EFBFBD>֤<EFBFBD> */
|
|
||||||
return ( (character->bitmap[y * 2 + x / 4] >> ((x % 4) * 2)) & 0x03 );
|
|
||||||
}
|
|
||||||
|
|
||||||
int WWCharacter_SetPixel(WWCharacter character, int x, int y, int pixel)
|
|
||||||
{
|
|
||||||
unsigned char p;
|
|
||||||
if (character == NULL)
|
|
||||||
WonX_Error("WWCharacter_SetPixel()", "WWCharacter is NULL.");
|
|
||||||
|
|
||||||
if ((x < 0) || (x > 7))
|
|
||||||
WonX_Error("WWCharacter_SetPixel()", "x is invalid value.");
|
|
||||||
if ((y < 0) || (y > 7))
|
|
||||||
WonX_Error("WWCharacter_SetPixel()", "y is invalid value.");
|
|
||||||
if ((pixel < 0) || (pixel > 3))
|
|
||||||
WonX_Error("WWCharacter_SetPixel()", "Invalid pixel.");
|
|
||||||
|
|
||||||
p = ((unsigned char)pixel) & 0x03;
|
|
||||||
p = p << ((x % 4) * 2);
|
|
||||||
|
|
||||||
character->bitmap[y * 2 + x / 4] &= ~(0x03 << ((x % 4) * 2));
|
|
||||||
character->bitmap[y * 2 + x / 4] |= p;
|
|
||||||
|
|
||||||
return (pixel);
|
return (pixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WWCharacter_CopyBitmap(WWCharacter dst, WWCharacter src)
|
int WWCharacter_ClearAllPixels(WWCharacter character)
|
||||||
{
|
{
|
||||||
return (WWCharacter_SetBitmap(dst, src->bitmap));
|
if (character == NULL)
|
||||||
|
WonX_Error("WWCharacter_ClearAllPixels", "WWCharacter is NULL.");
|
||||||
|
|
||||||
|
memset(character->bitmap.bitmap_char, 0, 32);
|
||||||
|
|
||||||
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WWCharacter_PrintData(WWCharacter character, FILE * f)
|
int WWCharacter_CopyAllPixels(WWCharacter dst, WWCharacter src)
|
||||||
{
|
{
|
||||||
int x, y, i, n;
|
if (dst == NULL)
|
||||||
|
WonX_Error("WWCharacter_CopyAllPixel", "dst is NULL.");
|
||||||
|
if (src == NULL)
|
||||||
|
WonX_Error("WWCharacter_CopyAllPixel", "src is NULL.");
|
||||||
|
|
||||||
|
memcpy(dst->bitmap.bitmap_char, src->bitmap.bitmap_char, 32);
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
int WWCharacter_PrintData(WWCharacter character, WWDisplay display, FILE * f)
|
||||||
|
{
|
||||||
|
int i, x, y, n;
|
||||||
|
int pixel;
|
||||||
|
|
||||||
|
if (character == NULL)
|
||||||
|
WonX_Error("WWCharacter_PrintData", "WWCharacter is NULL.");
|
||||||
|
|
||||||
n = WWCharacter_GetNumber(character);
|
n = WWCharacter_GetNumber(character);
|
||||||
|
|
||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
|
|
||||||
fprintf(f, "character[%d] :\tnumber = %d\n",
|
fprintf(f, "character[%03d] :\tnumber = %d\n",
|
||||||
n, WWCharacter_GetNumber(character));
|
n, WWCharacter_GetNumber(character));
|
||||||
|
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 32; i += 8) {
|
||||||
fprintf(f, "character[%d] :\tbitmap[%d] = 0x%02x\n",
|
fprintf(f, "character[%03d] :\tbitmap[%02d] =", n, i);
|
||||||
n, i, (int)(WWCharacter_GetBitmap(character)[i]));
|
fprintf(f, " %02x", (int)WWCharacter_GetBitmapAsChar(character, i ));
|
||||||
|
fprintf(f, " %02x", (int)WWCharacter_GetBitmapAsChar(character, i+1));
|
||||||
|
fprintf(f, " %02x", (int)WWCharacter_GetBitmapAsChar(character, i+2));
|
||||||
|
fprintf(f, " %02x", (int)WWCharacter_GetBitmapAsChar(character, i+3));
|
||||||
|
fprintf(f, " %02x", (int)WWCharacter_GetBitmapAsChar(character, i+4));
|
||||||
|
fprintf(f, " %02x", (int)WWCharacter_GetBitmapAsChar(character, i+5));
|
||||||
|
fprintf(f, " %02x", (int)WWCharacter_GetBitmapAsChar(character, i+6));
|
||||||
|
fprintf(f, " %02x", (int)WWCharacter_GetBitmapAsChar(character, i+7));
|
||||||
|
fprintf(f, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fprintf(f, "character[%03d] :\tpixels : 01234567\n", n);
|
||||||
for (y = 0; y < 8; y++) {
|
for (y = 0; y < 8; y++) {
|
||||||
fprintf(f, "character[%d] :\tbitmap : ", n);
|
fprintf(f, "character[%03d] :\tpixels : %01d ", n, y);
|
||||||
for (x = 0; x < 8; x++) {
|
for (x = 0; x < 8; x++) {
|
||||||
fprintf(f, "%d", WWCharacter_GetPixel(character, x, y));
|
pixel = WWCharacter_GetPixel(character, x, y, display);
|
||||||
|
fprintf(f, "%c", wonx_dec_to_hex(pixel));
|
||||||
}
|
}
|
||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,29 +5,82 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WWCharacter * WWCharacter;
|
typedef struct _WWCharacter * WWCharacter;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "WWDisplay.h"
|
||||||
|
#include "wonx/libwwc.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* <20>ʥ<EFBFBD><CAA5>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
int WWCharacter_GetNumber(WWCharacter c);
|
int WWCharacter_GetNumber(WWCharacter c);
|
||||||
int WWCharacter_SetNumber(WWCharacter c, int n);
|
int WWCharacter_SetNumber(WWCharacter c, int n);
|
||||||
WWCharacter WWCharacter_Create(int number, unsigned char * bitmap);
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* <20>ӥåȥޥåפ<C3A5><D7A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* char <20><><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤿<EFBFBD><EBA4BF><EFBFBD>δؿ<CEB4> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
unsigned char WWCharacter_GetBitmapAsChar(WWCharacter c, int n);
|
||||||
|
unsigned char WWCharacter_SetBitmapAsChar(WWCharacter c, int n,
|
||||||
|
unsigned char bitmap);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* short int <20><><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤿<EFBFBD><EBA4BF><EFBFBD>δؿ<CEB4> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
unsigned short int WWCharacter_GetBitmapAsShortInt(WWCharacter c, int n);
|
||||||
|
unsigned short int WWCharacter_SetBitmapAsShortInt(WWCharacter c, int n,
|
||||||
|
unsigned short int bitmap);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* long int <20><><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤿<EFBFBD><EBA4BF><EFBFBD>δؿ<CEB4> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
unsigned long int WWCharacter_GetBitmapAsLongInt(WWCharacter c, int n);
|
||||||
|
unsigned long int WWCharacter_SetBitmapAsLongInt(WWCharacter c, int n,
|
||||||
|
unsigned long int bitmap);
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱥ<EFBFBD><C8BA><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
WWCharacter WWCharacter_Create(int number);
|
||||||
WWCharacter WWCharacter_Destroy(WWCharacter character);
|
WWCharacter WWCharacter_Destroy(WWCharacter character);
|
||||||
unsigned char * WWCharacter_GetBitmap(WWCharacter character);
|
|
||||||
int WWCharacter_SetBitmap(WWCharacter character, unsigned char * bitmap);
|
/*===========================================================================*/
|
||||||
int WWCharacter_GetPixel(WWCharacter character, int x, int y);
|
/* <20>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
int WWCharacter_SetPixel(WWCharacter character, int x, int y, int pixel);
|
/*===========================================================================*/
|
||||||
int WWCharacter_CopyBitmap(WWCharacter dst, WWCharacter src);
|
|
||||||
int WWCharacter_PrintData(WWCharacter character, FILE * f);
|
int WWCharacter_GetPixel(WWCharacter character, int x, int y,
|
||||||
|
WWDisplay display);
|
||||||
|
int WWCharacter_ClearAllPixels(WWCharacter character);
|
||||||
|
int WWCharacter_CopyAllPixels(WWCharacter dst, WWCharacter src);
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
int WWCharacter_PrintData(WWCharacter character, WWDisplay display, FILE * f);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||||
|
|||||||
@@ -14,9 +14,12 @@
|
|||||||
typedef struct _WWCharacter {
|
typedef struct _WWCharacter {
|
||||||
int number;
|
int number;
|
||||||
|
|
||||||
/* <20>ӥåȥޥåפ<EFBFBD>2<EFBFBD>ӥåȤǤԤȤĤΥԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD><EFBFBD>롥 */
|
/* <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD>饯<EFBFBD><EFBFBD><EFBFBD>Υӥåȥޥå<EFBFBD> */
|
||||||
/* 2<>ӥåȤ<C3A5><C8A4>ͤ<EFBFBD><CDA4><EFBFBD>palette <20>ο<EFBFBD><CEBF><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>롥 */
|
union {
|
||||||
unsigned char bitmap[16];
|
unsigned char bitmap_char[32];
|
||||||
|
unsigned short int bitmap_short_int[16];
|
||||||
|
unsigned long int bitmap_long_int[8];
|
||||||
|
} bitmap;
|
||||||
} _WWCharacter;
|
} _WWCharacter;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WWColorMapP.h"
|
#include "WWColorMapP.h"
|
||||||
#include "etc.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
@@ -24,7 +24,8 @@ WWColorMap WWColorMap_Create(int * lcd_colors)
|
|||||||
|
|
||||||
WWColorMap WWColorMap_Destroy(WWColorMap color_map)
|
WWColorMap WWColorMap_Destroy(WWColorMap color_map)
|
||||||
{
|
{
|
||||||
if (color_map == NULL) return (NULL);
|
if (color_map == NULL)
|
||||||
|
WonX_Error("WWColorMap_Destroy", "Object is not created.");
|
||||||
free(color_map);
|
free(color_map);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@@ -72,7 +73,7 @@ int WWColorMap_PrintData(WWColorMap c, FILE * f)
|
|||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
|
|
||||||
for (i = 0; i < 8; i++) {
|
for (i = 0; i < 8; i++) {
|
||||||
fprintf(f, "colormap :\tcolor[%d] = %d\n",
|
fprintf(f, "colormap :\tcolor[%01d] = %d\n",
|
||||||
i, WWColorMap_GetLCDColor(c, i));
|
i, WWColorMap_GetLCDColor(c, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
10
WWColorMap.h
10
WWColorMap.h
@@ -5,15 +5,19 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WWColorMap * WWColorMap;
|
typedef struct _WWColorMap * WWColorMap;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
68
WWCursor.c
Normal file
68
WWCursor.c
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include "WWCursorP.h"
|
||||||
|
#include "WonX.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
int WWCursor_ON( WWCursor p) { return (p->on = 1); }
|
||||||
|
int WWCursor_OFF( WWCursor p) { return (p->on = 0); }
|
||||||
|
int WWCursor_IsON( WWCursor p) { return (p->on != 0); }
|
||||||
|
int WWCursor_IsOFF(WWCursor p) { return (p->on == 0); }
|
||||||
|
|
||||||
|
int WWCursor_GetX( WWCursor p ) { return (p->x ); }
|
||||||
|
int WWCursor_SetX( WWCursor p, int n) { return (p->x = n); }
|
||||||
|
int WWCursor_GetY( WWCursor p ) { return (p->y ); }
|
||||||
|
int WWCursor_SetY( WWCursor p, int n) { return (p->y = n); }
|
||||||
|
int WWCursor_GetWidth( WWCursor p ) { return (p->width ); }
|
||||||
|
int WWCursor_SetWidth( WWCursor p, int n) { return (p->width = n); }
|
||||||
|
int WWCursor_GetHeight( WWCursor p ) { return (p->height ); }
|
||||||
|
int WWCursor_SetHeight( WWCursor p, int n) { return (p->height = n); }
|
||||||
|
int WWCursor_GetInterval(WWCursor p ) { return (p->interval ); }
|
||||||
|
int WWCursor_SetInterval(WWCursor p, int n) { return (p->interval = n); }
|
||||||
|
|
||||||
|
WWPalette WWCursor_GetPalette(WWCursor p)
|
||||||
|
{ return (p->palette ); }
|
||||||
|
WWPalette WWCursor_SetPalette(WWCursor p, WWPalette plt)
|
||||||
|
{ return (p->palette = plt); }
|
||||||
|
|
||||||
|
WWCursor WWCursor_Create(WWPalette palette)
|
||||||
|
{
|
||||||
|
WWCursor cursor;
|
||||||
|
|
||||||
|
cursor = (WWCursor)malloc(sizeof(_WWCursor));
|
||||||
|
if (cursor == NULL)
|
||||||
|
WonX_Error("WWCursor_Create", "Cannot allocate memory");
|
||||||
|
|
||||||
|
WWCursor_OFF(cursor);
|
||||||
|
|
||||||
|
WWCursor_SetX( cursor, 0);
|
||||||
|
WWCursor_SetY( cursor, 0);
|
||||||
|
WWCursor_SetWidth( cursor, 1);
|
||||||
|
WWCursor_SetHeight( cursor, 1);
|
||||||
|
WWCursor_SetInterval(cursor, 30);
|
||||||
|
|
||||||
|
WWCursor_SetPalette(cursor, palette);
|
||||||
|
|
||||||
|
return (cursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
WWCursor WWCursor_Destroy(WWCursor cursor)
|
||||||
|
{
|
||||||
|
if (cursor == NULL)
|
||||||
|
WonX_Error("WWCursor_Destroy", "Object is not created.");
|
||||||
|
free(cursor);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* End of File. */
|
||||||
|
/*****************************************************************************/
|
||||||
57
WWCursor.h
Normal file
57
WWCursor.h
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
#ifndef _WWCursor_h_INCLUDED_
|
||||||
|
#define _WWCursor_h_INCLUDED_
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
typedef struct _WWCursor * WWCursor;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "WWPalette.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
int WWCursor_ON( WWCursor p);
|
||||||
|
int WWCursor_OFF( WWCursor p);
|
||||||
|
int WWCursor_IsON( WWCursor p);
|
||||||
|
int WWCursor_IsOFF(WWCursor p);
|
||||||
|
|
||||||
|
int WWCursor_GetX( WWCursor p );
|
||||||
|
int WWCursor_SetX( WWCursor p, int n);
|
||||||
|
int WWCursor_GetY( WWCursor p );
|
||||||
|
int WWCursor_SetY( WWCursor p, int n);
|
||||||
|
int WWCursor_GetWidth( WWCursor p );
|
||||||
|
int WWCursor_SetWidth( WWCursor p, int n);
|
||||||
|
int WWCursor_GetHeight( WWCursor p );
|
||||||
|
int WWCursor_SetHeight( WWCursor p, int n);
|
||||||
|
int WWCursor_GetInterval(WWCursor p );
|
||||||
|
int WWCursor_SetInterval(WWCursor p, int n);
|
||||||
|
|
||||||
|
WWPalette WWCursor_GetPalette(WWCursor p);
|
||||||
|
WWPalette WWCursor_SetPalette(WWCursor p, WWPalette plt);
|
||||||
|
|
||||||
|
WWCursor WWCursor_Create(WWPalette palette);
|
||||||
|
WWCursor WWCursor_Destroy(WWCursor cursor);
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* End of File. */
|
||||||
|
/*****************************************************************************/
|
||||||
@@ -1,25 +1,23 @@
|
|||||||
#ifndef _WonXText_h_INCLUDED_
|
#ifndef _WWCursorP_h_INCLUDED_
|
||||||
#define _WonXText_h_INCLUDED_
|
#define _WWCursorP_h_INCLUDED_
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* ここから */
|
/* ここから */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WWText.h"
|
#include "WWCursor.h"
|
||||||
#include "WWScreen.h"
|
|
||||||
#include "WWPalette.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* クラスの定義 */
|
/* クラスの定義 */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WonXText * WonXText;
|
typedef struct _WWCursor {
|
||||||
|
int on; /* 表示/非表示のフラグ */
|
||||||
WWText WonXText_GetWWText(WonXText wonx_text);
|
int x, y; /* カーソル座標 */
|
||||||
WWText WonXText_SetWWText(WonXText wonx_text, WWText ww_text);
|
int width, height; /* カーソルのサイズ */
|
||||||
WonXText WonXText_Create(WWScreen screen, int x, int y, int width, int height,
|
int interval; /* 点滅周期 */
|
||||||
WWPalette palette);
|
WWPalette palette; /* カーソル表示用パレット */
|
||||||
WonXText WonXText_Destroy(WonXText wonx_text);
|
} _WWCursor;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* ここまで */
|
/* ここまで */
|
||||||
207
WWDisplay.c
207
WWDisplay.c
@@ -2,8 +2,12 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include "wonx/disp.h"
|
||||||
|
#include "wonx/text.h"
|
||||||
|
#include "wonx/libwwc.h"
|
||||||
|
|
||||||
#include "WWDisplayP.h"
|
#include "WWDisplayP.h"
|
||||||
#include "etc.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
@@ -20,6 +24,10 @@ WWCharacter WWDisplay_GetCharacter(WWDisplay d, int n)
|
|||||||
WWSprite WWDisplay_GetSprite(WWDisplay d, int n) { return (d->sprite[n]); }
|
WWSprite WWDisplay_GetSprite(WWDisplay d, int n) { return (d->sprite[n]); }
|
||||||
WWScreen WWDisplay_GetScreen(WWDisplay d, int n) { return (d->screen[n]); }
|
WWScreen WWDisplay_GetScreen(WWDisplay d, int n) { return (d->screen[n]); }
|
||||||
WWLCDPanel WWDisplay_GetLCDPanel(WWDisplay d) { return (d->lcd_panel); }
|
WWLCDPanel WWDisplay_GetLCDPanel(WWDisplay d) { return (d->lcd_panel); }
|
||||||
|
WWText WWDisplay_GetText(WWDisplay d) { return (d->text); }
|
||||||
|
WWCursor WWDisplay_GetCursor(WWDisplay d) { return (d->cursor); }
|
||||||
|
|
||||||
|
unsigned int WWDisplay_GetColorMode(WWDisplay d) { return (d->color_mode); }
|
||||||
|
|
||||||
int WWDisplay_GetSpriteEnable(WWDisplay d) { return (d->sprite_enable); }
|
int WWDisplay_GetSpriteEnable(WWDisplay d) { return (d->sprite_enable); }
|
||||||
int WWDisplay_GetSpriteWindowEnable(WWDisplay d)
|
int WWDisplay_GetSpriteWindowEnable(WWDisplay d)
|
||||||
@@ -34,7 +42,10 @@ int WWDisplay_GetSpriteWindowWidth(WWDisplay d)
|
|||||||
int WWDisplay_GetSpriteWindowHeight(WWDisplay d)
|
int WWDisplay_GetSpriteWindowHeight(WWDisplay d)
|
||||||
{ return (d->sprite_window_height); }
|
{ return (d->sprite_window_height); }
|
||||||
|
|
||||||
int WWDisplay_GetBorder(WWDisplay d) { return (d->border); }
|
WWPalette WWDisplay_GetBorderPalette(WWDisplay d)
|
||||||
|
{ return (d->border_palette); }
|
||||||
|
int WWDisplay_GetBorderColor(WWDisplay d)
|
||||||
|
{ return (d->border_color); }
|
||||||
|
|
||||||
int WWDisplay_GetForegroundColor(WWDisplay d) { return (d->foreground_color); }
|
int WWDisplay_GetForegroundColor(WWDisplay d) { return (d->foreground_color); }
|
||||||
int WWDisplay_GetBackgroundColor(WWDisplay d) { return (d->background_color); }
|
int WWDisplay_GetBackgroundColor(WWDisplay d) { return (d->background_color); }
|
||||||
@@ -58,6 +69,13 @@ WWScreen WWDisplay_SetScreen(WWDisplay d, int n, WWScreen s)
|
|||||||
{ return (d->screen[n] = s); }
|
{ return (d->screen[n] = s); }
|
||||||
WWLCDPanel WWDisplay_SetLCDPanel(WWDisplay d, WWLCDPanel p)
|
WWLCDPanel WWDisplay_SetLCDPanel(WWDisplay d, WWLCDPanel p)
|
||||||
{ return (d->lcd_panel = p); }
|
{ return (d->lcd_panel = p); }
|
||||||
|
WWText WWDisplay_SetText(WWDisplay d, WWText p)
|
||||||
|
{ return (d->text = p); }
|
||||||
|
WWCursor WWDisplay_SetCursor(WWDisplay d, WWCursor p)
|
||||||
|
{ return (d->cursor = p); }
|
||||||
|
|
||||||
|
unsigned int WWDisplay_SetColorMode(WWDisplay d, unsigned int mode)
|
||||||
|
{ return (d->color_mode = mode); }
|
||||||
|
|
||||||
int WWDisplay_SetSpriteEnable(WWDisplay d, int f)
|
int WWDisplay_SetSpriteEnable(WWDisplay d, int f)
|
||||||
{ return (d->sprite_enable = f); }
|
{ return (d->sprite_enable = f); }
|
||||||
@@ -73,7 +91,10 @@ int WWDisplay_SetSpriteWindowWidth(WWDisplay d, int n)
|
|||||||
int WWDisplay_SetSpriteWindowHeight(WWDisplay d, int n)
|
int WWDisplay_SetSpriteWindowHeight(WWDisplay d, int n)
|
||||||
{ return (d->sprite_window_height = n); }
|
{ return (d->sprite_window_height = n); }
|
||||||
|
|
||||||
int WWDisplay_SetBorder(WWDisplay d, int b) { return (d->border = b); }
|
WWPalette WWDisplay_SetBorderPalette(WWDisplay d, WWPalette p)
|
||||||
|
{ return (d->border_palette = p); }
|
||||||
|
int WWDisplay_SetBorderColor(WWDisplay d, int b)
|
||||||
|
{ return (d->border_color = b); }
|
||||||
|
|
||||||
int WWDisplay_SetForegroundColor(WWDisplay d, int c)
|
int WWDisplay_SetForegroundColor(WWDisplay d, int c)
|
||||||
{ return (d->foreground_color = c); }
|
{ return (d->foreground_color = c); }
|
||||||
@@ -94,20 +115,42 @@ WWDisplay WWDisplay_Create(int lcd_panel_width, int lcd_panel_height,
|
|||||||
{
|
{
|
||||||
WWDisplay display;
|
WWDisplay display;
|
||||||
int i;
|
int i;
|
||||||
|
static int default_lcd_colors[] = {
|
||||||
|
0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0f
|
||||||
|
};
|
||||||
|
static struct palette_colors {
|
||||||
|
int colors[4];
|
||||||
|
} default_palette_colors[] = {
|
||||||
|
{{0, 3, 5, 7}}, {{2, 3, 5, 7}}, {{0, 0, 0, 7}}, {{2, 0, 0, 7}},
|
||||||
|
{{0, 0, 3, 7}}, {{0, 7, 7, 7}}, {{0, 7, 7, 7}}, {{0, 0, 2, 7}},
|
||||||
|
{{2, 5, 7, 7}}, {{7, 7, 7, 7}}, {{7, 6, 5, 7}}, {{3, 7, 5, 7}},
|
||||||
|
{{0, 0, 4, 7}}, {{0, 0, 0, 7}}, {{0, 7, 7, 5}}, {{0, 7, 3, 7}}
|
||||||
|
};
|
||||||
|
|
||||||
display = (WWDisplay)malloc(sizeof(_WWDisplay));
|
display = (WWDisplay)malloc(sizeof(_WWDisplay));
|
||||||
if (display == NULL)
|
if (display == NULL)
|
||||||
WonX_Error("WWDisplay_Create", "Cannot allocate memory.");
|
WonX_Error("WWDisplay_Create", "Cannot allocate memory.");
|
||||||
|
|
||||||
WWDisplay_SetColorMap(display, WWColorMap_Create(NULL));
|
WWDisplay_SetColorMap(display, WWColorMap_Create(default_lcd_colors));
|
||||||
|
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
|
/*
|
||||||
|
* WonX-2.0 <20>ʹߤǤϡ<C7A4>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWPalette <20><><EFBFBD>饹<EFBFBD>Ǥϴ<C7A4><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>褦<EFBFBD><E8A4A6>
|
||||||
|
* <20>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD><C9AC>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD>
|
||||||
|
*/
|
||||||
|
#if 1
|
||||||
WWDisplay_SetPalette(display, i,
|
WWDisplay_SetPalette(display, i,
|
||||||
WWPalette_Create(i, NULL, ((i / 4) % 2) ? 1 : 0));
|
WWPalette_Create(i,default_palette_colors[i].colors));
|
||||||
|
#else /* WonX-2.0 <20><><EFBFBD><EFBFBD><EFBFBD>Ǥϡ<C7A4>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>꤬ɬ<EAA4AC>פ<EFBFBD><D7A4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD> */
|
||||||
|
WWDisplay_SetPalette(display, i,
|
||||||
|
WWPalette_Create(i,
|
||||||
|
default_palette_colors[i].colors,
|
||||||
|
((i / 4) % 2) ? 1 : 0));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 512; i++) {
|
for (i = 0; i < 512; i++) {
|
||||||
WWDisplay_SetCharacter(display, i, WWCharacter_Create(i, NULL));
|
WWDisplay_SetCharacter(display, i, WWCharacter_Create(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < 128; i++) {
|
for (i = 0; i < 128; i++) {
|
||||||
@@ -129,6 +172,24 @@ WWDisplay WWDisplay_Create(int lcd_panel_width, int lcd_panel_height,
|
|||||||
WWDisplay_SetLCDPanel(display, WWLCDPanel_Create(lcd_panel_width,
|
WWDisplay_SetLCDPanel(display, WWLCDPanel_Create(lcd_panel_width,
|
||||||
lcd_panel_height));
|
lcd_panel_height));
|
||||||
|
|
||||||
|
/* <20>ǥե<C7A5><D5A5><EFBFBD><EFBFBD>ȤΥƥ<CEA5><C6A5><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD>ѥѥ<D1A5><D1A5>åȤ<C3A5>0 */
|
||||||
|
WWDisplay_SetText(display,
|
||||||
|
WWText_Create(WWDisplay_GetScreen(display, SCREEN2),
|
||||||
|
0, 0,
|
||||||
|
TEXT_SCREEN_WIDTH, TEXT_SCREEN_HEIGHT,
|
||||||
|
WWDisplay_GetPalette(display, 0)));
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WWDisplay_GetPalette() <20><><EFBFBD>ƤӽФ<D3BD><D0A4>Τǡ<CEA4><C7A1>ѥ<EFBFBD><D1A5>åȤ<C3A5><C8A4><EFBFBD><EFBFBD>ꤷ<EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD>
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>ȡ<EFBFBD>
|
||||||
|
* <20>ǥե<C7A5><D5A5><EFBFBD><EFBFBD>ȤΥ<C8A4><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѥ<EFBFBD><D1A5>åȤϣ<C8A4>
|
||||||
|
*/
|
||||||
|
WWDisplay_SetCursor(display,
|
||||||
|
WWCursor_Create(WWDisplay_GetPalette(display, 1)));
|
||||||
|
|
||||||
|
/* <20>ǥե<C7A5><D5A5><EFBFBD><EFBFBD>ȤΥ<C8A4><CEA5>顼<EFBFBD>⡼<EFBFBD>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⡼<EFBFBD><E2A1BC> */
|
||||||
|
WWDisplay_SetColorMode(display, COLOR_MODE_GRAYSCALE);
|
||||||
|
|
||||||
WWDisplay_SetSpriteEnable(display, 0);
|
WWDisplay_SetSpriteEnable(display, 0);
|
||||||
WWDisplay_SetSpriteWindowEnable(display, 0);
|
WWDisplay_SetSpriteWindowEnable(display, 0);
|
||||||
|
|
||||||
@@ -137,7 +198,8 @@ WWDisplay WWDisplay_Create(int lcd_panel_width, int lcd_panel_height,
|
|||||||
WWDisplay_SetSpriteWindowWidth( display, lcd_panel_width);
|
WWDisplay_SetSpriteWindowWidth( display, lcd_panel_width);
|
||||||
WWDisplay_SetSpriteWindowHeight(display, lcd_panel_height);
|
WWDisplay_SetSpriteWindowHeight(display, lcd_panel_height);
|
||||||
|
|
||||||
WWDisplay_SetBorder(display, 0);
|
WWDisplay_SetBorderPalette(display, WWDisplay_GetPalette(display, 0));
|
||||||
|
WWDisplay_SetBorderColor(display, 0);
|
||||||
|
|
||||||
WWDisplay_SetForegroundColor(display, 3);
|
WWDisplay_SetForegroundColor(display, 3);
|
||||||
WWDisplay_SetBackgroundColor(display, 0);
|
WWDisplay_SetBackgroundColor(display, 0);
|
||||||
@@ -152,7 +214,8 @@ WWDisplay WWDisplay_Destroy(WWDisplay display)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (display == NULL) return (NULL);
|
if (display == NULL)
|
||||||
|
WonX_Error("WWDisplay_Destroy", "Object is not created.");
|
||||||
|
|
||||||
if (WWDisplay_GetColorMap(display) != NULL)
|
if (WWDisplay_GetColorMap(display) != NULL)
|
||||||
WWDisplay_SetColorMap(display,
|
WWDisplay_SetColorMap(display,
|
||||||
@@ -188,6 +251,14 @@ WWDisplay WWDisplay_Destroy(WWDisplay display)
|
|||||||
WWDisplay_SetLCDPanel(display,
|
WWDisplay_SetLCDPanel(display,
|
||||||
WWLCDPanel_Destroy(WWDisplay_GetLCDPanel(display)));
|
WWLCDPanel_Destroy(WWDisplay_GetLCDPanel(display)));
|
||||||
|
|
||||||
|
if (WWDisplay_GetText(display) != NULL)
|
||||||
|
WWDisplay_SetText(display,
|
||||||
|
WWText_Destroy(WWDisplay_GetText(display)));
|
||||||
|
|
||||||
|
if (WWDisplay_GetCursor(display) != NULL)
|
||||||
|
WWDisplay_SetCursor(display,
|
||||||
|
WWCursor_Destroy(WWDisplay_GetCursor(display)));
|
||||||
|
|
||||||
free(display);
|
free(display);
|
||||||
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
@@ -197,7 +268,8 @@ WWDisplay WWDisplay_Destroy(WWDisplay display)
|
|||||||
/* LCD<43>ѥͥ<D1A5><CDA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* LCD<43>ѥͥ<D1A5><CDA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
static int WWDisplay_DrawScreen(WWDisplay display, WWScreen screen)
|
static int WWDisplay_DrawScreen(WWDisplay display, WWScreen screen,
|
||||||
|
WWCursor cursor)
|
||||||
{
|
{
|
||||||
WWLCDPanel lcd_panel;
|
WWLCDPanel lcd_panel;
|
||||||
int lcd_panel_width;
|
int lcd_panel_width;
|
||||||
@@ -267,12 +339,25 @@ static int WWDisplay_DrawScreen(WWDisplay display, WWScreen screen)
|
|||||||
|
|
||||||
px = x + WWScreen_GetRollX(screen);
|
px = x + WWScreen_GetRollX(screen);
|
||||||
|
|
||||||
pixel = WWScreen_GetPixel(screen, px, py);
|
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD>ˤϡ<CBA4>-1<><31><EFBFBD>֤äƤ<C3A4><C6A4><EFBFBD> */
|
||||||
|
pixel = WWScreen_GetPixel(screen, px, py, display, cursor);
|
||||||
|
|
||||||
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD> */
|
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD> */
|
||||||
if (pixel == -1) continue;
|
if (pixel == -1) continue;
|
||||||
|
|
||||||
pixel = WWColorMap_GetLCDColor(WWDisplay_GetColorMap(display), pixel);
|
/* <20><><EFBFBD>顼<EFBFBD>б<EFBFBD> */
|
||||||
|
switch (WWDisplay_GetColorMode(display)) {
|
||||||
|
case COLOR_MODE_GRAYSCALE:
|
||||||
|
pixel = WWColorMap_GetLCDColor(WWDisplay_GetColorMap(display), pixel);
|
||||||
|
break;
|
||||||
|
case COLOR_MODE_4COLOR:
|
||||||
|
case COLOR_MODE_16COLOR:
|
||||||
|
case COLOR_MODE_16PACKED:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
WonX_Error("WWDisplay_DrawSprite", "Unknown color mode.");
|
||||||
|
}
|
||||||
|
|
||||||
WWLCDPanel_SetPixel(lcd_panel, x, y, pixel);
|
WWLCDPanel_SetPixel(lcd_panel, x, y, pixel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -300,7 +385,9 @@ static int WWDisplay_DrawSprite(WWDisplay display, WWSprite sprite)
|
|||||||
|
|
||||||
for (y = 0; y < 8; y++) {
|
for (y = 0; y < 8; y++) {
|
||||||
for (x = 0; x < 8; x++) {
|
for (x = 0; x < 8; x++) {
|
||||||
pixel = WWSprite_GetPixel(sprite, x, y);
|
|
||||||
|
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1<><31><EFBFBD>֤äƤ<C3A4><C6A4><EFBFBD> */
|
||||||
|
pixel = WWSprite_GetPixel(sprite, x, y, display);
|
||||||
|
|
||||||
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD> */
|
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD> */
|
||||||
if (pixel == -1) continue;
|
if (pixel == -1) continue;
|
||||||
@@ -321,7 +408,19 @@ static int WWDisplay_DrawSprite(WWDisplay display, WWSprite sprite)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pixel = WWColorMap_GetLCDColor(WWDisplay_GetColorMap(display), pixel);
|
/* <20><><EFBFBD>顼<EFBFBD>б<EFBFBD> */
|
||||||
|
switch (WWDisplay_GetColorMode(display)) {
|
||||||
|
case COLOR_MODE_GRAYSCALE:
|
||||||
|
pixel = WWColorMap_GetLCDColor(WWDisplay_GetColorMap(display), pixel);
|
||||||
|
break;
|
||||||
|
case COLOR_MODE_4COLOR:
|
||||||
|
case COLOR_MODE_16COLOR:
|
||||||
|
case COLOR_MODE_16PACKED:
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
WonX_Error("WWDisplay_DrawSprite", "Unknown color mode.");
|
||||||
|
}
|
||||||
|
|
||||||
WWLCDPanel_SetPixel(WWDisplay_GetLCDPanel(display), lcd_x, lcd_y, pixel);
|
WWLCDPanel_SetPixel(WWDisplay_GetLCDPanel(display), lcd_x, lcd_y, pixel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -336,25 +435,58 @@ int WWDisplay_DrawLCDPanel(WWDisplay display)
|
|||||||
int lcd_panel_width;
|
int lcd_panel_width;
|
||||||
int lcd_panel_height;
|
int lcd_panel_height;
|
||||||
WWColorMap color_map;
|
WWColorMap color_map;
|
||||||
int border;
|
WWPalette border_palette;
|
||||||
|
int border_color;
|
||||||
|
WWScreen screen;
|
||||||
WWSprite sprite;
|
WWSprite sprite;
|
||||||
|
WWCursor cursor;
|
||||||
|
|
||||||
lcd_panel = WWDisplay_GetLCDPanel(display);
|
lcd_panel = WWDisplay_GetLCDPanel(display);
|
||||||
lcd_panel_width = WWLCDPanel_GetWidth( lcd_panel);
|
lcd_panel_width = WWLCDPanel_GetWidth( lcd_panel);
|
||||||
lcd_panel_height = WWLCDPanel_GetHeight(lcd_panel);
|
lcd_panel_height = WWLCDPanel_GetHeight(lcd_panel);
|
||||||
color_map = WWDisplay_GetColorMap(display);
|
color_map = WWDisplay_GetColorMap(display);
|
||||||
border = WWDisplay_GetBorder(display);
|
border_palette = WWDisplay_GetBorderPalette(display);
|
||||||
|
border_color = WWDisplay_GetBorderColor(display);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>顼<EFBFBD>б<EFBFBD> */
|
||||||
|
switch (WWDisplay_GetColorMode(display)) {
|
||||||
|
case COLOR_MODE_GRAYSCALE:
|
||||||
|
border_color &= (DCM_BORDER_COLOR >> 8);
|
||||||
|
border_color = WWColorMap_GetLCDColor(color_map, border_color);
|
||||||
|
break;
|
||||||
|
case COLOR_MODE_4COLOR:
|
||||||
|
border_color &= 0x03;
|
||||||
|
border_color =
|
||||||
|
((unsigned short int)WWPalette_GetRed( border_palette,border_color)<<8)|
|
||||||
|
((unsigned short int)WWPalette_GetGreen(border_palette,border_color)<<4)|
|
||||||
|
((unsigned short int)WWPalette_GetBlue( border_palette,border_color)<<0);
|
||||||
|
break;
|
||||||
|
case COLOR_MODE_16COLOR:
|
||||||
|
case COLOR_MODE_16PACKED:
|
||||||
|
border_color &= 0x0f;
|
||||||
|
border_color =
|
||||||
|
((unsigned short int)WWPalette_GetRed( border_palette,border_color)<<8)|
|
||||||
|
((unsigned short int)WWPalette_GetGreen(border_palette,border_color)<<4)|
|
||||||
|
((unsigned short int)WWPalette_GetBlue( border_palette,border_color)<<0);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
WonX_Error("WWDisplay_DrawLCDPanel", "Unknown color mode.");
|
||||||
|
}
|
||||||
|
|
||||||
/* <20>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
for (x = 0; x < lcd_panel_width; x++) {
|
for (x = 0; x < lcd_panel_width; x++) {
|
||||||
for (y = 0; y < lcd_panel_height; y++) {
|
for (y = 0; y < lcd_panel_height; y++) {
|
||||||
WWLCDPanel_SetPixel(lcd_panel, x, y,
|
WWLCDPanel_SetPixel(lcd_panel, x, y, border_color);
|
||||||
WWColorMap_GetLCDColor(color_map, border));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EAA1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EAA1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
WWDisplay_DrawScreen(display, WWDisplay_GetScreen(display, 0));
|
screen = WWDisplay_GetScreen(display, 0);
|
||||||
|
if (WWText_GetScreen(WWDisplay_GetText(display)) == screen)
|
||||||
|
cursor = WWDisplay_GetCursor(display);
|
||||||
|
else
|
||||||
|
cursor = NULL;
|
||||||
|
WWDisplay_DrawScreen(display, screen, cursor);
|
||||||
|
|
||||||
/* <20><><EFBFBD>ץ饤<D7A5><E9A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3A3B2A4><EFBFBD>ͥ<EFBFBD><CDA5><EFBFBD>Ǥʤ<C7A4><CAA4><EFBFBD><EFBFBD><EFBFBD>) */
|
/* <20><><EFBFBD>ץ饤<D7A5><E9A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3A3B2A4><EFBFBD>ͥ<EFBFBD><CDA5><EFBFBD>Ǥʤ<C7A4><CAA4><EFBFBD><EFBFBD><EFBFBD>) */
|
||||||
/* <20>Ťʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><CFA1>ֹ<EFBFBD><D6B9>μ㤤<CEBC><E3A4A4><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20>Ťʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><CFA1>ֹ<EFBFBD><D6B9>μ㤤<CEBC><E3A4A4><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
@@ -369,7 +501,12 @@ int WWDisplay_DrawLCDPanel(WWDisplay display)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EAA1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EAA1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
WWDisplay_DrawScreen(display, WWDisplay_GetScreen(display, 1));
|
screen = WWDisplay_GetScreen(display, 1);
|
||||||
|
if (WWText_GetScreen(WWDisplay_GetText(display)) == screen)
|
||||||
|
cursor = WWDisplay_GetCursor(display);
|
||||||
|
else
|
||||||
|
cursor = NULL;
|
||||||
|
WWDisplay_DrawScreen(display, screen, cursor);
|
||||||
|
|
||||||
/* <20><><EFBFBD>ץ饤<D7A5><E9A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3A3B2A4><EFBFBD>ͥ<EFBFBD><CDA5><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD>) */
|
/* <20><><EFBFBD>ץ饤<D7A5><E9A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3A3B2A4><EFBFBD>ͥ<EFBFBD><CDA5><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD>) */
|
||||||
/* <20>Ťʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><CFA1>ֹ<EFBFBD><D6B9>μ㤤<CEBC><E3A4A4><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20>Ťʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><CFA1>ֹ<EFBFBD><D6B9>μ㤤<CEBC><E3A4A4><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
@@ -386,6 +523,38 @@ int WWDisplay_DrawLCDPanel(WWDisplay display)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4><EFBFBD>Ĵ<EFBFBD>٤<EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
int WWDisplay_IsTransparent(WWDisplay display, WWPalette palette, int color)
|
||||||
|
{
|
||||||
|
int mode;
|
||||||
|
int palette_num;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (color != 0) return (0);
|
||||||
|
|
||||||
|
mode = WWDisplay_GetColorMode(display);
|
||||||
|
palette_num = WWPalette_GetNumber(palette);
|
||||||
|
|
||||||
|
ret = 0;
|
||||||
|
switch (mode) {
|
||||||
|
case COLOR_MODE_GRAYSCALE :
|
||||||
|
case COLOR_MODE_4COLOR :
|
||||||
|
ret = ((palette_num / 4) % 2) ? 1 : 0;
|
||||||
|
break;
|
||||||
|
case COLOR_MODE_16COLOR :
|
||||||
|
case COLOR_MODE_16PACKED :
|
||||||
|
ret = 1;
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
WonX_Error("WWDisplay_IsTransparent", "Unknown color mode.");
|
||||||
|
}
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
43
WWDisplay.h
43
WWDisplay.h
@@ -5,13 +5,6 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WWColorMap.h"
|
|
||||||
#include "WWPalette.h"
|
|
||||||
#include "WWCharacter.h"
|
|
||||||
#include "WWSprite.h"
|
|
||||||
#include "WWScreen.h"
|
|
||||||
#include "WWLCDPanel.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -19,7 +12,20 @@
|
|||||||
typedef struct _WWDisplay * WWDisplay;
|
typedef struct _WWDisplay * WWDisplay;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20>إå<EFBFBD><EFBFBD>ե<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD>롼<EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include "WWColorMap.h"
|
||||||
|
#include "WWPalette.h"
|
||||||
|
#include "WWCharacter.h"
|
||||||
|
#include "WWSprite.h"
|
||||||
|
#include "WWScreen.h"
|
||||||
|
#include "WWLCDPanel.h"
|
||||||
|
#include "WWText.h"
|
||||||
|
#include "WWCursor.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
@@ -32,6 +38,11 @@ WWCharacter WWDisplay_GetCharacter(WWDisplay d, int n);
|
|||||||
WWSprite WWDisplay_GetSprite(WWDisplay d, int n);
|
WWSprite WWDisplay_GetSprite(WWDisplay d, int n);
|
||||||
WWScreen WWDisplay_GetScreen(WWDisplay d, int n);
|
WWScreen WWDisplay_GetScreen(WWDisplay d, int n);
|
||||||
WWLCDPanel WWDisplay_GetLCDPanel(WWDisplay d);
|
WWLCDPanel WWDisplay_GetLCDPanel(WWDisplay d);
|
||||||
|
WWText WWDisplay_GetText(WWDisplay d);
|
||||||
|
WWCursor WWDisplay_GetCursor(WWDisplay d);
|
||||||
|
|
||||||
|
unsigned int WWDisplay_GetColorMode(WWDisplay d);
|
||||||
|
|
||||||
int WWDisplay_GetSpriteEnable(WWDisplay d);
|
int WWDisplay_GetSpriteEnable(WWDisplay d);
|
||||||
int WWDisplay_GetSpriteWindowEnable(WWDisplay d);
|
int WWDisplay_GetSpriteWindowEnable(WWDisplay d);
|
||||||
|
|
||||||
@@ -40,7 +51,8 @@ int WWDisplay_GetSpriteWindowY(WWDisplay d);
|
|||||||
int WWDisplay_GetSpriteWindowWidth(WWDisplay d);
|
int WWDisplay_GetSpriteWindowWidth(WWDisplay d);
|
||||||
int WWDisplay_GetSpriteWindowHeight(WWDisplay d);
|
int WWDisplay_GetSpriteWindowHeight(WWDisplay d);
|
||||||
|
|
||||||
int WWDisplay_GetBorder(WWDisplay d);
|
WWPalette WWDisplay_GetBorderPalette(WWDisplay d);
|
||||||
|
int WWDisplay_GetBorderColor(WWDisplay d);
|
||||||
|
|
||||||
int WWDisplay_GetForegroundColor(WWDisplay d);
|
int WWDisplay_GetForegroundColor(WWDisplay d);
|
||||||
int WWDisplay_GetBackgroundColor(WWDisplay d);
|
int WWDisplay_GetBackgroundColor(WWDisplay d);
|
||||||
@@ -58,6 +70,10 @@ WWCharacter WWDisplay_SetCharacter(WWDisplay d, int n, WWCharacter c);
|
|||||||
WWSprite WWDisplay_SetSprite(WWDisplay d, int n, WWSprite s);
|
WWSprite WWDisplay_SetSprite(WWDisplay d, int n, WWSprite s);
|
||||||
WWScreen WWDisplay_SetScreen(WWDisplay d, int n, WWScreen s);
|
WWScreen WWDisplay_SetScreen(WWDisplay d, int n, WWScreen s);
|
||||||
WWLCDPanel WWDisplay_SetLCDPanel(WWDisplay d, WWLCDPanel p);
|
WWLCDPanel WWDisplay_SetLCDPanel(WWDisplay d, WWLCDPanel p);
|
||||||
|
WWText WWDisplay_SetText(WWDisplay d, WWText p);
|
||||||
|
WWCursor WWDisplay_SetCursor(WWDisplay d, WWCursor p);
|
||||||
|
|
||||||
|
unsigned int WWDisplay_SetColorMode(WWDisplay d, unsigned int mode);
|
||||||
|
|
||||||
int WWDisplay_SetSpriteEnable(WWDisplay d, int f);
|
int WWDisplay_SetSpriteEnable(WWDisplay d, int f);
|
||||||
int WWDisplay_SetSpriteWindowEnable(WWDisplay d, int f);
|
int WWDisplay_SetSpriteWindowEnable(WWDisplay d, int f);
|
||||||
@@ -67,7 +83,8 @@ int WWDisplay_SetSpriteWindowY(WWDisplay d, int n);
|
|||||||
int WWDisplay_SetSpriteWindowWidth(WWDisplay d, int n);
|
int WWDisplay_SetSpriteWindowWidth(WWDisplay d, int n);
|
||||||
int WWDisplay_SetSpriteWindowHeight(WWDisplay d, int n);
|
int WWDisplay_SetSpriteWindowHeight(WWDisplay d, int n);
|
||||||
|
|
||||||
int WWDisplay_SetBorder(WWDisplay d, int b);
|
WWPalette WWDisplay_SetBorderPalette(WWDisplay d, WWPalette p);
|
||||||
|
int WWDisplay_SetBorderColor(WWDisplay d, int b);
|
||||||
|
|
||||||
int WWDisplay_SetForegroundColor(WWDisplay d, int c);
|
int WWDisplay_SetForegroundColor(WWDisplay d, int c);
|
||||||
int WWDisplay_SetBackgroundColor(WWDisplay d, int c);
|
int WWDisplay_SetBackgroundColor(WWDisplay d, int c);
|
||||||
@@ -89,6 +106,12 @@ WWDisplay WWDisplay_Destroy(WWDisplay display);
|
|||||||
|
|
||||||
int WWDisplay_DrawLCDPanel(WWDisplay display);
|
int WWDisplay_DrawLCDPanel(WWDisplay display);
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4><EFBFBD>Ĵ<EFBFBD>٤<EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
int WWDisplay_IsTransparent(WWDisplay display, WWPalette palette, int color);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
10
WWDisplayP.h
10
WWDisplayP.h
@@ -19,8 +19,12 @@ typedef struct _WWDisplay {
|
|||||||
WWSprite sprite[128];
|
WWSprite sprite[128];
|
||||||
WWScreen screen[2];
|
WWScreen screen[2];
|
||||||
WWLCDPanel lcd_panel;
|
WWLCDPanel lcd_panel;
|
||||||
|
WWText text;
|
||||||
|
WWCursor cursor;
|
||||||
|
|
||||||
/* <20>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD>ץ쥤<D7A5><ECA5A4>°<EFBFBD><C2B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD>ץ쥤<D7A5><ECA5A4>°<EFBFBD><C2B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
unsigned int color_mode; /* <20><><EFBFBD>顼<EFBFBD>⡼<EFBFBD><E2A1BC> */
|
||||||
|
|
||||||
int sprite_enable; /* <20><><EFBFBD>ץ饤<D7A5><E9A5A4>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD>͡<EFBFBD><CDA1>֥<EFBFBD><D6A5>ե饰 */
|
int sprite_enable; /* <20><><EFBFBD>ץ饤<D7A5><E9A5A4>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD>͡<EFBFBD><CDA1>֥<EFBFBD><D6A5>ե饰 */
|
||||||
int sprite_window_enable; /* <20><><EFBFBD>ץ饤<D7A5>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD>͡<EFBFBD><CDA1>֥<EFBFBD><D6A5>ե饰 */
|
int sprite_window_enable; /* <20><><EFBFBD>ץ饤<D7A5>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD>͡<EFBFBD><CDA1>֥<EFBFBD><D6A5>ե饰 */
|
||||||
int sprite_window_x; /* <20><><EFBFBD>ץ饤<D7A5>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD> */
|
int sprite_window_x; /* <20><><EFBFBD>ץ饤<D7A5>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD> */
|
||||||
@@ -28,14 +32,16 @@ typedef struct _WWDisplay {
|
|||||||
int sprite_window_width; /* <20><><EFBFBD>ץ饤<D7A5>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD> */
|
int sprite_window_width; /* <20><><EFBFBD>ץ饤<D7A5>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD> */
|
||||||
int sprite_window_height; /* <20><><EFBFBD>ץ饤<D7A5>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD> */
|
int sprite_window_height; /* <20><><EFBFBD>ץ饤<D7A5>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD> */
|
||||||
|
|
||||||
int border; /* <20>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC>0<EFBFBD><30>7<EFBFBD>Υ<EFBFBD><CEA5>顼<EFBFBD>ޥå<DEA5><C3A5>ֹ<EFBFBD> */
|
/* <20>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>Υѥ<CEA5><D1A5>åȡ<C3A5><C8A1><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC>ɬ<EFBFBD><EFBFBD> */
|
||||||
|
WWPalette border_palette;
|
||||||
|
/* <20>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD>ˤϡ<CBA4>0<EFBFBD><30>7<EFBFBD>Υ<EFBFBD><CEA5>顼<EFBFBD>ޥå<DEA5><C3A5>ֹ<EFBFBD> */
|
||||||
|
int border_color;
|
||||||
|
|
||||||
int foreground_color; /* <20><><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD><EFBFBD>ο<EFBFBD> */
|
int foreground_color; /* <20><><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD><EFBFBD>ο<EFBFBD> */
|
||||||
int background_color; /* <20><><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD><EFBFBD>ο<EFBFBD> */
|
int background_color; /* <20><><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD><EFBFBD>ο<EFBFBD> */
|
||||||
|
|
||||||
int sprite_start; /* <20><><EFBFBD>ץ饤<D7A5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD> */
|
int sprite_start; /* <20><><EFBFBD>ץ饤<D7A5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD> */
|
||||||
int sprite_count; /* <20><><EFBFBD>ץ饤<D7A5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD> */
|
int sprite_count; /* <20><><EFBFBD>ץ饤<D7A5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD> */
|
||||||
|
|
||||||
} _WWDisplay;
|
} _WWDisplay;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WWInterruptP.h"
|
#include "WWInterruptP.h"
|
||||||
#include "etc.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
|||||||
@@ -5,11 +5,6 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "wonx_include/system.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -17,6 +12,15 @@
|
|||||||
typedef struct _WWInterrupt * WWInterrupt;
|
typedef struct _WWInterrupt * WWInterrupt;
|
||||||
typedef void (*WWInterruptCallback)();
|
typedef void (*WWInterruptCallback)();
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "wonx/system.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
54
WWLCDPanel.c
54
WWLCDPanel.c
@@ -3,7 +3,7 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WWLCDPanelP.h"
|
#include "WWLCDPanelP.h"
|
||||||
#include "etc.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
@@ -28,56 +28,59 @@ int WWLCDPanel_ResetAllDraw(WWLCDPanel p) { return (p->all_draw = 0); }
|
|||||||
int WWLCDPanel_SetAllDraw(WWLCDPanel p) { return (p->all_draw = 1); }
|
int WWLCDPanel_SetAllDraw(WWLCDPanel p) { return (p->all_draw = 1); }
|
||||||
int WWLCDPanel_IsAllDraw(WWLCDPanel p) { return (p->all_draw); }
|
int WWLCDPanel_IsAllDraw(WWLCDPanel p) { return (p->all_draw); }
|
||||||
|
|
||||||
unsigned char * WWLCDPanel_GetPixelMap(WWLCDPanel p)
|
unsigned short int * WWLCDPanel_GetPixelMap(WWLCDPanel p)
|
||||||
{
|
{
|
||||||
return (p->pixel[p->current]);
|
return (p->pixel[p->current]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* LCD<43>ϣ<EFBFBD><CFA3>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD>16<EFBFBD><EFBFBD>(<EFBFBD><EFBFBD><EFBFBD>ӥå<EFBFBD>ɬ<EFBFBD><EFBFBD>) */
|
/* LCD<43>ϣ<EFBFBD><CFA3>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD>4096<EFBFBD><EFBFBD>(12<EFBFBD>ӥå<EFBFBD>ɬ<EFBFBD><EFBFBD>) */
|
||||||
static int WWLCDPanel_GetPixelByCurrent(WWLCDPanel lcd_panel, int current,
|
static unsigned short int WWLCDPanel_GetPixelByCurrent(WWLCDPanel lcd_panel,
|
||||||
int x, int y)
|
int current,
|
||||||
|
int x, int y)
|
||||||
{
|
{
|
||||||
unsigned char pixel;
|
unsigned short int pixel;
|
||||||
|
|
||||||
if ( (x < 0) || (x > WWLCDPanel_GetWidth( lcd_panel) - 1) ||
|
if ( (x < 0) || (x > WWLCDPanel_GetWidth( lcd_panel) - 1) ||
|
||||||
(y < 0) || (y > WWLCDPanel_GetHeight(lcd_panel) - 1) )
|
(y < 0) || (y > WWLCDPanel_GetHeight(lcd_panel) - 1) )
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
pixel = lcd_panel->pixel[current][y * WWLCDPanel_GetWidth(lcd_panel) + x];
|
pixel = lcd_panel->pixel[current][y * WWLCDPanel_GetWidth(lcd_panel) + x];
|
||||||
pixel &= 0x0f;
|
|
||||||
return ((int)pixel);
|
return ((int)pixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int WWLCDPanel_GetOldPixel(WWLCDPanel lcd_panel, int x, int y)
|
static unsigned short int WWLCDPanel_GetOldPixel(WWLCDPanel lcd_panel,
|
||||||
|
int x, int y)
|
||||||
{
|
{
|
||||||
return (WWLCDPanel_GetPixelByCurrent(lcd_panel, 1 - lcd_panel->current, x, y));
|
return (WWLCDPanel_GetPixelByCurrent(lcd_panel,
|
||||||
|
1 - lcd_panel->current, x, y));
|
||||||
}
|
}
|
||||||
|
|
||||||
int WWLCDPanel_GetPixel(WWLCDPanel lcd_panel, int x, int y)
|
unsigned short int WWLCDPanel_GetPixel(WWLCDPanel lcd_panel, int x, int y)
|
||||||
{
|
{
|
||||||
return (WWLCDPanel_GetPixelByCurrent(lcd_panel, lcd_panel->current, x, y));
|
return (WWLCDPanel_GetPixelByCurrent(lcd_panel, lcd_panel->current, x, y));
|
||||||
}
|
}
|
||||||
|
|
||||||
int WWLCDPanel_SetPixel(WWLCDPanel lcd_panel, int x, int y, int pixel)
|
unsigned short int WWLCDPanel_SetPixel(WWLCDPanel lcd_panel, int x, int y,
|
||||||
|
unsigned short int pixel)
|
||||||
{
|
{
|
||||||
unsigned char p;
|
unsigned short int p;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
if ( (x < 0) || (x > WWLCDPanel_GetWidth( lcd_panel) - 1) ||
|
if ( (x < 0) || (x > WWLCDPanel_GetWidth( lcd_panel) - 1) ||
|
||||||
(y < 0) || (y > WWLCDPanel_GetHeight(lcd_panel) - 1) )
|
(y < 0) || (y > WWLCDPanel_GetHeight(lcd_panel) - 1) )
|
||||||
return (-1);
|
return (-1);
|
||||||
|
|
||||||
p = ((unsigned char)pixel) & 0x0f;
|
p = pixel & 0x0fff;
|
||||||
n = y * WWLCDPanel_GetWidth(lcd_panel) + x;
|
n = y * WWLCDPanel_GetWidth(lcd_panel) + x;
|
||||||
lcd_panel->pixel[lcd_panel->current][n] = p;
|
lcd_panel->pixel[lcd_panel->current][n] = p;
|
||||||
|
|
||||||
return (pixel);
|
return (p);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WWLCDPanel_IsPixelChanged(WWLCDPanel lcd_panel, int x, int y)
|
int WWLCDPanel_IsPixelChanged(WWLCDPanel lcd_panel, int x, int y)
|
||||||
{
|
{
|
||||||
int old_pixel;
|
unsigned short int old_pixel;
|
||||||
int current_pixel;
|
unsigned short int current_pixel;
|
||||||
|
|
||||||
if (WWLCDPanel_IsAllDraw(lcd_panel)) return (1);
|
if (WWLCDPanel_IsAllDraw(lcd_panel)) return (1);
|
||||||
old_pixel = WWLCDPanel_GetOldPixel(lcd_panel, x, y);
|
old_pixel = WWLCDPanel_GetOldPixel(lcd_panel, x, y);
|
||||||
@@ -90,6 +93,7 @@ WWLCDPanel WWLCDPanel_Create(int width, int height)
|
|||||||
{
|
{
|
||||||
WWLCDPanel lcd_panel;
|
WWLCDPanel lcd_panel;
|
||||||
int x, y, i;
|
int x, y, i;
|
||||||
|
unsigned short int * p;
|
||||||
|
|
||||||
lcd_panel = (WWLCDPanel)malloc(sizeof(_WWLCDPanel));
|
lcd_panel = (WWLCDPanel)malloc(sizeof(_WWLCDPanel));
|
||||||
if (lcd_panel == NULL)
|
if (lcd_panel == NULL)
|
||||||
@@ -99,15 +103,16 @@ WWLCDPanel WWLCDPanel_Create(int width, int height)
|
|||||||
WWLCDPanel_SetHeight(lcd_panel, height);
|
WWLCDPanel_SetHeight(lcd_panel, height);
|
||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
lcd_panel->pixel[i] =
|
p = (unsigned short int *)malloc(sizeof(unsigned short int) *
|
||||||
(unsigned char *)malloc(sizeof(unsigned char) *
|
WWLCDPanel_GetWidth(lcd_panel) *
|
||||||
WWLCDPanel_GetWidth(lcd_panel) *
|
WWLCDPanel_GetHeight(lcd_panel));
|
||||||
WWLCDPanel_GetHeight(lcd_panel));
|
if (p == NULL) WonX_Error("WWLCDPanel_Create", "Cannot allocate memory.");
|
||||||
|
lcd_panel->pixel[i] = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (y = 0; y < lcd_panel->height; y++) {
|
for (y = 0; y < lcd_panel->height; y++) {
|
||||||
for (x = 0; x < lcd_panel->width / 2; x++) {
|
for (x = 0; x < lcd_panel->width / 2; x++) {
|
||||||
WWLCDPanel_SetPixel(lcd_panel, x, y, 0x00);
|
WWLCDPanel_SetPixel(lcd_panel, x, y, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,11 +125,16 @@ WWLCDPanel WWLCDPanel_Create(int width, int height)
|
|||||||
WWLCDPanel WWLCDPanel_Destroy(WWLCDPanel lcd_panel)
|
WWLCDPanel WWLCDPanel_Destroy(WWLCDPanel lcd_panel)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
if (lcd_panel == NULL) return (NULL);
|
|
||||||
|
if (lcd_panel == NULL)
|
||||||
|
WonX_Error("WWLCDPanel_Destroy", "Object is not created.");
|
||||||
|
|
||||||
for (i = 0; i < 2; i++) {
|
for (i = 0; i < 2; i++) {
|
||||||
if (lcd_panel->pixel[i]) free(lcd_panel->pixel[i]);
|
if (lcd_panel->pixel[i]) free(lcd_panel->pixel[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(lcd_panel);
|
free(lcd_panel);
|
||||||
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
15
WWLCDPanel.h
15
WWLCDPanel.h
@@ -5,14 +5,18 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WWLCDPanel * WWLCDPanel;
|
typedef struct _WWLCDPanel * WWLCDPanel;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -28,9 +32,10 @@ int WWLCDPanel_ResetAllDraw(WWLCDPanel p);
|
|||||||
int WWLCDPanel_SetAllDraw(WWLCDPanel p);
|
int WWLCDPanel_SetAllDraw(WWLCDPanel p);
|
||||||
int WWLCDPanel_IsAllDraw(WWLCDPanel p);
|
int WWLCDPanel_IsAllDraw(WWLCDPanel p);
|
||||||
|
|
||||||
unsigned char * WWLCDPanel_GetPixelMap(WWLCDPanel p);
|
unsigned short int * WWLCDPanel_GetPixelMap(WWLCDPanel p);
|
||||||
int WWLCDPanel_GetPixel(WWLCDPanel lcd_panel, int x, int y);
|
unsigned short int WWLCDPanel_GetPixel(WWLCDPanel lcd_panel, int x, int y);
|
||||||
int WWLCDPanel_SetPixel(WWLCDPanel lcd_panel, int x, int y, int pixel);
|
unsigned short int WWLCDPanel_SetPixel(WWLCDPanel lcd_panel, int x, int y,
|
||||||
|
unsigned short int pixel);
|
||||||
int WWLCDPanel_IsPixelChanged(WWLCDPanel lcd_panel, int x, int y);
|
int WWLCDPanel_IsPixelChanged(WWLCDPanel lcd_panel, int x, int y);
|
||||||
WWLCDPanel WWLCDPanel_Create(int width, int height);
|
WWLCDPanel WWLCDPanel_Create(int width, int height);
|
||||||
WWLCDPanel WWLCDPanel_Destroy(WWLCDPanel lcd_panel);
|
WWLCDPanel WWLCDPanel_Destroy(WWLCDPanel lcd_panel);
|
||||||
|
|||||||
@@ -15,18 +15,20 @@ typedef struct _WWLCDPanel {
|
|||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
|
|
||||||
/* X<><58><EFBFBD><EFBFBD><EFBFBD>Ф<EFBFBD><D0A4><EFBFBD><EFBFBD>٤餹<F2B8BAA4><E9A4B9><EFBFBD>ᡤ<EFBFBD>ӥåȥޥåפ<C3A5><D7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* X<><58><EFBFBD><EFBFBD><EFBFBD>Ф<EFBFBD><D0A4><EFBFBD><EFBFBD>٤餹<F2B8BAA4><E9A4B9><EFBFBD>ᡤ<EFBFBD>ӥåȥޥåפ<C3A5><D7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>ʬ<EFBFBD>Ͻ<CFBD><F1A4ADB4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>褦<EFBFBD>ˤ<EFBFBD><CBA4>롥 */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>ʬ<EFBFBD>Ͻ<CFBD><F1A4ADB4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>褦<EFBFBD>ˤ<EFBFBD><CBA4>롥 */
|
||||||
/* pixel[current] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υӥåȥޥåפˤʤ롥 */
|
/* pixel[current] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υӥåȥޥåפˤʤ롥 */
|
||||||
/* pixel[1 - current] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υӥåȥޥåפˤʤ롥 */
|
/* pixel[1 - current] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υӥåȥޥåפˤʤ롥 */
|
||||||
int current;
|
int current;
|
||||||
|
|
||||||
/* all_draw == 1 <20>ΤȤ<CEA4><C8A4>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD><EFBFBD>ʬ<EFBFBD><CAAC>̵<EFBFBD><CCB5><EFBFBD>Τǡ<CEA4> */
|
/* all_draw == 1 <20>ΤȤ<CEA4><C8A4>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD><EFBFBD>ʬ<EFBFBD><CAAC>̵<EFBFBD><CCB5><EFBFBD>Τǡ<CEA4> */
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD>뤳<EFBFBD>Ȥ<C8A4><F2BCA8A4><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD>뤳<EFBFBD>Ȥ<C8A4><F2BCA8A4><EFBFBD> */
|
||||||
int all_draw;
|
int all_draw;
|
||||||
|
|
||||||
/* 16<EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD>顼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Х<EFBFBD><EFBFBD>Ȥǣ<EFBFBD><EFBFBD>ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʬ<EFBFBD>ξ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* 4096<EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD>顼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Х<EFBFBD><EFBFBD>Ȥǣ<EFBFBD><EFBFBD>ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʬ<EFBFBD>ξ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
unsigned char * pixel[2];
|
/* X<><58><EFBFBD><EFBFBD><EFBFBD>Ф<EFBFBD><D0A4><EFBFBD><EFBFBD>٤餹<F2B8BAA4><E9A4B9><EFBFBD>ᡤ<EFBFBD>ӥåȥޥåפ<C3A5><D7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>ʬ<EFBFBD>Ͻ<CFBD><F1A4ADB4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>褦<EFBFBD>ˤ<EFBFBD><CBA4>롥 */
|
||||||
|
unsigned short int * pixel[2];
|
||||||
} _WWLCDPanel;
|
} _WWLCDPanel;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
91
WWPalette.c
91
WWPalette.c
@@ -3,6 +3,7 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WWPaletteP.h"
|
#include "WWPaletteP.h"
|
||||||
|
#include "WonX.h"
|
||||||
#include "etc.h"
|
#include "etc.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -12,20 +13,57 @@
|
|||||||
int WWPalette_GetNumber(WWPalette p) { return (p->number); }
|
int WWPalette_GetNumber(WWPalette p) { return (p->number); }
|
||||||
int WWPalette_SetNumber(WWPalette p, int n) { return (p->number = n); }
|
int WWPalette_SetNumber(WWPalette p, int n) { return (p->number = n); }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
#if 0
|
||||||
int WWPalette_GetTransparent(WWPalette p) { return (p->transparent); }
|
int WWPalette_GetTransparent(WWPalette p) { return (p->transparent); }
|
||||||
int WWPalette_SetTransparent(WWPalette p, int f)
|
int WWPalette_SetTransparent(WWPalette p, int f)
|
||||||
{ return (p->transparent = f); }
|
{ return (p->transparent = f); }
|
||||||
|
#endif
|
||||||
|
|
||||||
WWPalette WWPalette_Create(int number, int * mapped_colors, int transparent)
|
int WWPalette_GetRed( WWPalette p, int n) { return (p->red[ n]); }
|
||||||
|
int WWPalette_GetGreen(WWPalette p, int n) { return (p->green[n]); }
|
||||||
|
int WWPalette_GetBlue( WWPalette p, int n) { return (p->blue[ n]); }
|
||||||
|
int WWPalette_SetRed( WWPalette p, int n, int value)
|
||||||
|
{ return (p->red[ n] = value); }
|
||||||
|
int WWPalette_SetGreen(WWPalette p, int n, int value)
|
||||||
|
{ return (p->green[n] = value); }
|
||||||
|
int WWPalette_SetBlue( WWPalette p, int n, int value)
|
||||||
|
{ return (p->blue[ n] = value); }
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD>
|
||||||
|
* <20><><EFBFBD>Ȥ<EFBFBD><C8A4>Ȥϡ<C8A4>
|
||||||
|
* WWPalette WWPalette_Create(int number, int * mapped_colors, int transparent)
|
||||||
|
* <20>Τ褦<CEA4>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD> transparent <20><><EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD>
|
||||||
|
*/
|
||||||
|
WWPalette WWPalette_Create(int number, int * mapped_colors)
|
||||||
{
|
{
|
||||||
WWPalette palette;
|
WWPalette palette;
|
||||||
|
int i;
|
||||||
|
|
||||||
palette = (WWPalette)malloc(sizeof(_WWPalette));
|
palette = (WWPalette)malloc(sizeof(_WWPalette));
|
||||||
if (palette == NULL)
|
if (palette == NULL)
|
||||||
WonX_Error("WWPalette_Create", "Cannot allocate memory");
|
WonX_Error("WWPalette_Create", "Cannot allocate memory");
|
||||||
|
|
||||||
WWPalette_SetNumber(palette, number);
|
WWPalette_SetNumber(palette, number);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
#if 0
|
||||||
WWPalette_SetTransparent(palette, transparent);
|
WWPalette_SetTransparent(palette, transparent);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for (i = 0; i < 16; i++) {
|
||||||
|
WWPalette_SetRed( palette, i, 0);
|
||||||
|
WWPalette_SetGreen(palette, i, 0);
|
||||||
|
WWPalette_SetBlue( palette, i, 0);
|
||||||
|
}
|
||||||
WWPalette_SetMappedColors(palette, mapped_colors);
|
WWPalette_SetMappedColors(palette, mapped_colors);
|
||||||
|
|
||||||
return (palette);
|
return (palette);
|
||||||
@@ -33,7 +71,8 @@ WWPalette WWPalette_Create(int number, int * mapped_colors, int transparent)
|
|||||||
|
|
||||||
WWPalette WWPalette_Destroy(WWPalette palette)
|
WWPalette WWPalette_Destroy(WWPalette palette)
|
||||||
{
|
{
|
||||||
if (palette == NULL) return (NULL);
|
if (palette == NULL)
|
||||||
|
WonX_Error("WWPalette_Destroy", "Object is not created.");
|
||||||
free(palette);
|
free(palette);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@@ -69,35 +108,73 @@ int WWPalette_GetMappedColor(WWPalette palette, int color)
|
|||||||
int pixel;
|
int pixel;
|
||||||
|
|
||||||
pixel = palette->mapped_color[color];
|
pixel = palette->mapped_color[color];
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
#if 0
|
||||||
if (WWPalette_GetTransparent(palette) && (pixel == 0)) {
|
if (WWPalette_GetTransparent(palette) && (pixel == 0)) {
|
||||||
pixel = -1;
|
pixel = -1;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return (pixel);
|
return (pixel);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WWPalette_SetMappedColor(WWPalette palette, int color, int mapped_color)
|
int WWPalette_SetMappedColor(WWPalette palette, int color, int mapped_color)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
#if 0
|
||||||
if (mapped_color == -1) mapped_color = 0;
|
if (mapped_color == -1) mapped_color = 0;
|
||||||
|
#endif
|
||||||
return (palette->mapped_color[color] = mapped_color);
|
return (palette->mapped_color[color] = mapped_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WWPalette_PrintData(WWPalette p, FILE * f)
|
int WWPalette_PrintData(WWPalette p, WWDisplay display, FILE * f)
|
||||||
{
|
{
|
||||||
int i, n;
|
int i, n;
|
||||||
|
int transparent;
|
||||||
|
int red, green, blue;
|
||||||
|
|
||||||
n = WWPalette_GetNumber(p);
|
n = WWPalette_GetNumber(p);
|
||||||
|
|
||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
|
|
||||||
fprintf(f, "palette[%d] :\tnumber = %d\n", n, WWPalette_GetNumber(p));
|
fprintf(f, "palette[%02d] :\tnumber = %d\n", n, WWPalette_GetNumber(p));
|
||||||
fprintf(f, "palette[%d] :\ttransparent = %s\n",
|
|
||||||
n, true_false(WWPalette_GetTransparent(p)));
|
/*
|
||||||
|
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
#if 1
|
||||||
|
transparent = WWDisplay_IsTransparent(display, p, 0);
|
||||||
|
fprintf(f, "palette[%02d] :\ttransparent = %s\n",
|
||||||
|
n, wonx_true_false(transparent));
|
||||||
|
#else
|
||||||
|
fprintf(f, "palette[%02d] :\ttransparent = %s\n",
|
||||||
|
n, wonx_true_false(WWPalette_GetTransparent(p)));
|
||||||
|
#endif
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) {
|
for (i = 0; i < 4; i++) {
|
||||||
fprintf(f, "palette[%d] :\tcolor[%d] = %d\n",
|
fprintf(f, "palette[%02d] :\tcolor[%01d] = %d\n",
|
||||||
n, i, WWPalette_GetMappedColor(p, i));
|
n, i, WWPalette_GetMappedColor(p, i));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0; i < 16; i++) {
|
||||||
|
red = WWPalette_GetRed( p, i);
|
||||||
|
green = WWPalette_GetGreen(p, i);
|
||||||
|
blue = WWPalette_GetBlue( p, i);
|
||||||
|
fprintf(f, "palette[%02d] :\tRGB[%02d] = 0x%c%c%c\n",
|
||||||
|
n, i,
|
||||||
|
wonx_dec_to_hex(red),
|
||||||
|
wonx_dec_to_hex(green),
|
||||||
|
wonx_dec_to_hex(blue));
|
||||||
|
}
|
||||||
|
|
||||||
fflush(f);
|
fflush(f);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
|||||||
37
WWPalette.h
37
WWPalette.h
@@ -5,30 +5,59 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WWPalette * WWPalette;
|
typedef struct _WWPalette * WWPalette;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "WWDisplay.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
int WWPalette_GetNumber(WWPalette p);
|
int WWPalette_GetNumber(WWPalette p);
|
||||||
int WWPalette_SetNumber(WWPalette p, int n);
|
int WWPalette_SetNumber(WWPalette p, int n);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
#if 0
|
||||||
int WWPalette_GetTransparent(WWPalette palette);
|
int WWPalette_GetTransparent(WWPalette palette);
|
||||||
int WWPalette_SetTransparent(WWPalette palette, int f);
|
int WWPalette_SetTransparent(WWPalette palette, int f);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int WWPalette_GetRed( WWPalette p, int n);
|
||||||
|
int WWPalette_GetGreen(WWPalette p, int n);
|
||||||
|
int WWPalette_GetBlue( WWPalette p, int n);
|
||||||
|
int WWPalette_SetRed( WWPalette p, int n, int value);
|
||||||
|
int WWPalette_SetGreen(WWPalette p, int n, int value);
|
||||||
|
int WWPalette_SetBlue( WWPalette p, int n, int value);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
#if 1
|
||||||
|
WWPalette WWPalette_Create(int number, int * mapped_colors);
|
||||||
|
#else
|
||||||
WWPalette WWPalette_Create(int number, int * mapped_colors, int transparent);
|
WWPalette WWPalette_Create(int number, int * mapped_colors, int transparent);
|
||||||
|
#endif
|
||||||
WWPalette WWPalette_Destroy(WWPalette palette);
|
WWPalette WWPalette_Destroy(WWPalette palette);
|
||||||
int * WWPalette_GetMappedColors(WWPalette palette, int * mapped_colors);
|
int * WWPalette_GetMappedColors(WWPalette palette, int * mapped_colors);
|
||||||
int WWPalette_SetMappedColors(WWPalette palette, int * mapped_colors);
|
int WWPalette_SetMappedColors(WWPalette palette, int * mapped_colors);
|
||||||
int WWPalette_GetMappedColor(WWPalette palette, int color);
|
int WWPalette_GetMappedColor(WWPalette palette, int color);
|
||||||
int WWPalette_SetMappedColor(WWPalette palette, int color, int mapped_color);
|
int WWPalette_SetMappedColor(WWPalette palette, int color, int mapped_color);
|
||||||
int WWPalette_PrintData(WWPalette p, FILE * f);
|
int WWPalette_PrintData(WWPalette p, WWDisplay display, FILE * f);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||||
|
|||||||
20
WWPaletteP.h
20
WWPaletteP.h
@@ -12,12 +12,28 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WWPalette {
|
typedef struct _WWPalette {
|
||||||
|
|
||||||
int number;
|
int number;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
#if 0
|
||||||
int transparent; /* 0 <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD>ˤʤ뤫<CAA4>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD>Υե饰 */
|
int transparent; /* 0 <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD>ˤʤ뤫<CAA4>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD>Υե饰 */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* <20><><EFBFBD>顼<EFBFBD>ޥåפ<C3A5>8<EFBFBD><38><EFBFBD>椫<EFBFBD><E6A4AB>4<EFBFBD><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>⡼<EFBFBD>ɤξ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤϡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>ޥåפ<EFBFBD>8<EFBFBD><EFBFBD><EFBFBD>椫<EFBFBD><EFBFBD>4<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
int mapped_color[4]; /* <20><><EFBFBD>顼<EFBFBD>ޥåפ<C3A5><D7A4>ֹ<EFBFBD>(0<><30>7)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
int mapped_color[4]; /* <20><><EFBFBD><EFBFBD><EFBFBD>⡼<EFBFBD>ɤǤϡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>ޥåפ<EFBFBD><EFBFBD>ֹ<EFBFBD>(0<><30>7)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 4<><34><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC>16<31><36><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>⡼<EFBFBD>ɤξ<C9A4><CEBE><EFBFBD><EFBFBD>ˤϡ<CBA4>rgb <20>ο<EFBFBD><CEBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4>롥
|
||||||
|
* 4<><34><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>⡼<EFBFBD>ɤξ<C9A4><CEBE><EFBFBD><EFBFBD>ˤϡ<CBA4>0<EFBFBD><30>3<EFBFBD>ޤǤ<DEA4><C7A4><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4>롥
|
||||||
|
* 16<31><36><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>⡼<EFBFBD>ɤξ<C9A4><CEBE><EFBFBD><EFBFBD>ˤϡ<CBA4>0<EFBFBD><30>15<31>ޤǤ<DEA4><C7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4>롥
|
||||||
|
*/
|
||||||
|
int red[16];
|
||||||
|
int green[16];
|
||||||
|
int blue[16];
|
||||||
|
|
||||||
} _WWPalette;
|
} _WWPalette;
|
||||||
|
|
||||||
|
|||||||
52
WWScreen.c
52
WWScreen.c
@@ -3,7 +3,7 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WWScreenP.h"
|
#include "WWScreenP.h"
|
||||||
#include "etc.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
@@ -54,7 +54,8 @@ static WWScreenCharacter WWScreenCharacter_Create(int horizontal, int vertical,
|
|||||||
static WWScreenCharacter WWScreenCharacter_Destroy(WWScreenCharacter
|
static WWScreenCharacter WWScreenCharacter_Destroy(WWScreenCharacter
|
||||||
screen_character)
|
screen_character)
|
||||||
{
|
{
|
||||||
if (screen_character == NULL) return (NULL);
|
if (screen_character == NULL)
|
||||||
|
WonX_Error("WWScreenCharacter_Destroy", "Object is not created.");
|
||||||
free(screen_character);
|
free(screen_character);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@@ -159,7 +160,8 @@ int WWScreen_SetDrawWidth( WWScreen s, int n) { return (s->draw_width = n); }
|
|||||||
int WWScreen_SetDrawHeight(WWScreen s, int n) { return (s->draw_height = n); }
|
int WWScreen_SetDrawHeight(WWScreen s, int n) { return (s->draw_height = n); }
|
||||||
|
|
||||||
/* <20><><EFBFBD>顼<EFBFBD>ޥåפο<D7A4>(0<><30>7)<29><><EFBFBD>֤<EFBFBD>(Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1<><31><EFBFBD>֤<EFBFBD>) */
|
/* <20><><EFBFBD>顼<EFBFBD>ޥåפο<D7A4>(0<><30>7)<29><><EFBFBD>֤<EFBFBD>(Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1<><31><EFBFBD>֤<EFBFBD>) */
|
||||||
int WWScreen_GetPixel(WWScreen screen, int x, int y)
|
int WWScreen_GetPixel(WWScreen screen, int x, int y,
|
||||||
|
WWDisplay display, WWCursor cursor)
|
||||||
{
|
{
|
||||||
int cx, cy, px, py;
|
int cx, cy, px, py;
|
||||||
int pixel;
|
int pixel;
|
||||||
@@ -180,10 +182,45 @@ int WWScreen_GetPixel(WWScreen screen, int x, int y)
|
|||||||
if (WWScreen_GetVertical( screen, cx, cy)) py = 7 - py;
|
if (WWScreen_GetVertical( screen, cx, cy)) py = 7 - py;
|
||||||
|
|
||||||
character = WWScreen_GetCharacter(screen, cx, cy);
|
character = WWScreen_GetCharacter(screen, cx, cy);
|
||||||
palette = WWScreen_GetPalette(screen, cx, cy);
|
|
||||||
|
|
||||||
pixel = WWCharacter_GetPixel(character, px, py);
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD> */
|
||||||
pixel = WWPalette_GetMappedColor(palette, pixel);
|
palette = WWScreen_GetPalette(screen, cx, cy);
|
||||||
|
if (cursor != NULL) {
|
||||||
|
if ( WWCursor_IsON(cursor) &&
|
||||||
|
(cx >= WWCursor_GetX(cursor)) &&
|
||||||
|
(cx <= WWCursor_GetX(cursor) + WWCursor_GetWidth( cursor) - 1) &&
|
||||||
|
(cy >= WWCursor_GetY(cursor)) &&
|
||||||
|
(cy <= WWCursor_GetY(cursor) + WWCursor_GetHeight(cursor) - 1) ) {
|
||||||
|
palette = WWCursor_GetPalette(cursor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pixel = WWCharacter_GetPixel(character, px, py, display);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>顼<EFBFBD>б<EFBFBD> */
|
||||||
|
switch (WWDisplay_GetColorMode(display)) {
|
||||||
|
case COLOR_MODE_GRAYSCALE:
|
||||||
|
/*
|
||||||
|
* WonX-2.0 <20>ʹߤǤϡ<C7A4>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD><EFBFBD> WWDisplay <20><><EFBFBD>饹<EFBFBD>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6>
|
||||||
|
* <20>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>WWPalette_GetMappedColor() <20><> -1 <20><><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>Ȥ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
pixel = WWPalette_GetMappedColor(palette, pixel);
|
||||||
|
break;
|
||||||
|
case COLOR_MODE_4COLOR:
|
||||||
|
case COLOR_MODE_16COLOR:
|
||||||
|
case COLOR_MODE_16PACKED:
|
||||||
|
pixel =
|
||||||
|
((unsigned short int)WWPalette_GetRed( palette, pixel) << 8) |
|
||||||
|
((unsigned short int)WWPalette_GetGreen(palette, pixel) << 4) |
|
||||||
|
((unsigned short int)WWPalette_GetBlue( palette, pixel) << 0);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
WonX_Error("WWScreen_GetPixel", "Unknown color mode.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD>ˤ<EFBFBD> -1 <20><><EFBFBD>֤<EFBFBD> */
|
||||||
|
if (WWDisplay_IsTransparent(display, palette, pixel))
|
||||||
|
pixel = -1;
|
||||||
|
|
||||||
return (pixel);
|
return (pixel);
|
||||||
}
|
}
|
||||||
@@ -236,7 +273,8 @@ WWScreen WWScreen_Destroy(WWScreen screen)
|
|||||||
int x, y;
|
int x, y;
|
||||||
WWScreenCharacter sc;
|
WWScreenCharacter sc;
|
||||||
|
|
||||||
if (screen == NULL) return (NULL);
|
if (screen == NULL)
|
||||||
|
WonX_Error("WWScreen_Destroy", "Object is not created.");
|
||||||
|
|
||||||
for (y = 0; y < screen->height; y++) {
|
for (y = 0; y < screen->height; y++) {
|
||||||
for (x = 0; x < screen->width; x++) {
|
for (x = 0; x < screen->width; x++) {
|
||||||
|
|||||||
19
WWScreen.h
19
WWScreen.h
@@ -5,17 +5,23 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "WWPalette.h"
|
|
||||||
#include "WWCharacter.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WWScreen * WWScreen;
|
typedef struct _WWScreen * WWScreen;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "WWPalette.h"
|
||||||
|
#include "WWCharacter.h"
|
||||||
|
#include "WWCursor.h"
|
||||||
|
#include "WWDisplay.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -66,7 +72,8 @@ int WWScreen_SetDrawY( WWScreen s, int n);
|
|||||||
int WWScreen_SetDrawWidth( WWScreen s, int n);
|
int WWScreen_SetDrawWidth( WWScreen s, int n);
|
||||||
int WWScreen_SetDrawHeight(WWScreen s, int n);
|
int WWScreen_SetDrawHeight(WWScreen s, int n);
|
||||||
|
|
||||||
int WWScreen_GetPixel(WWScreen screen, int x, int y);
|
int WWScreen_GetPixel(WWScreen screen, int x, int y,
|
||||||
|
WWDisplay display, WWCursor cursor);
|
||||||
|
|
||||||
WWScreen WWScreen_Create(int number,
|
WWScreen WWScreen_Create(int number,
|
||||||
int width, int height,
|
int width, int height,
|
||||||
|
|||||||
@@ -3,16 +3,16 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WWSerialPortP.h"
|
#include "WWSerialPortP.h"
|
||||||
#include "etc.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
int WWSerialPort_ON( WWSerialPort s) { return (s->port_on = 1); }
|
int WWSerialPort_Open( WWSerialPort s) { return (s->opened = 1); }
|
||||||
int WWSerialPort_OFF( WWSerialPort s) { return (s->port_on = 0); }
|
int WWSerialPort_Close( WWSerialPort s) { return (s->opened = 0); }
|
||||||
int WWSerialPort_IsON( WWSerialPort s) { return (s->port_on != 0); }
|
int WWSerialPort_IsOpened(WWSerialPort s) { return (s->opened != 0); }
|
||||||
int WWSerialPort_IsOFF(WWSerialPort s) { return (s->port_on == 0); }
|
int WWSerialPort_IsClosed(WWSerialPort s) { return (s->opened == 0); }
|
||||||
|
|
||||||
int WWSerialPort_GetBaudrate(WWSerialPort s) { return (s->baudrate); }
|
int WWSerialPort_GetBaudrate(WWSerialPort s) { return (s->baudrate); }
|
||||||
int WWSerialPort_SetBaudrate(WWSerialPort s, int baudrate)
|
int WWSerialPort_SetBaudrate(WWSerialPort s, int baudrate)
|
||||||
@@ -53,7 +53,7 @@ WWSerialPort WWSerialPort_Create()
|
|||||||
if (ww_serial_port == NULL)
|
if (ww_serial_port == NULL)
|
||||||
WonX_Error("WWSerialPort_Create", "Cannot allocate memory.");
|
WonX_Error("WWSerialPort_Create", "Cannot allocate memory.");
|
||||||
|
|
||||||
WWSerialPort_OFF(ww_serial_port);
|
WWSerialPort_Close(ww_serial_port);
|
||||||
WWSerialPort_SetBaudrate38400(ww_serial_port);
|
WWSerialPort_SetBaudrate38400(ww_serial_port);
|
||||||
WWSerialPort_SetSendTimeout(ww_serial_port, 100);
|
WWSerialPort_SetSendTimeout(ww_serial_port, 100);
|
||||||
WWSerialPort_SetReceiveTimeout(ww_serial_port, 100);
|
WWSerialPort_SetReceiveTimeout(ww_serial_port, 100);
|
||||||
@@ -70,6 +70,8 @@ WWSerialPort WWSerialPort_Destroy(WWSerialPort ww_serial_port)
|
|||||||
if (ww_serial_port == NULL)
|
if (ww_serial_port == NULL)
|
||||||
WonX_Error("WWSerialPort_Destroy", "Object is not created.");
|
WonX_Error("WWSerialPort_Destroy", "Object is not created.");
|
||||||
|
|
||||||
|
WWSerialPort_Close(ww_serial_port);
|
||||||
|
|
||||||
free(ww_serial_port);
|
free(ww_serial_port);
|
||||||
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|||||||
@@ -5,28 +5,36 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "wonx_include/comm.h"
|
|
||||||
|
|
||||||
#define WW_SERIAL_PORT_BAUDRATE_9600 0
|
|
||||||
#define WW_SERIAL_PORT_BAUDRATE_38400 1
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WWSerialPort * WWSerialPort;
|
typedef struct _WWSerialPort * WWSerialPort;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "wonx/comm.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#define WW_SERIAL_PORT_BAUDRATE_9600 0
|
||||||
|
#define WW_SERIAL_PORT_BAUDRATE_38400 1
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
int WWSerialPort_ON( WWSerialPort s);
|
int WWSerialPort_Open( WWSerialPort s);
|
||||||
int WWSerialPort_OFF( WWSerialPort s);
|
int WWSerialPort_Close( WWSerialPort s);
|
||||||
int WWSerialPort_IsON( WWSerialPort s);
|
int WWSerialPort_IsOpened(WWSerialPort s);
|
||||||
int WWSerialPort_IsOFF(WWSerialPort s);
|
int WWSerialPort_IsClosed(WWSerialPort s);
|
||||||
|
|
||||||
int WWSerialPort_GetBaudrate(WWSerialPort s);
|
int WWSerialPort_GetBaudrate(WWSerialPort s);
|
||||||
int WWSerialPort_SetBaudrate(WWSerialPort s, int baudrate);
|
int WWSerialPort_SetBaudrate(WWSerialPort s, int baudrate);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
typedef struct _WWSerialPort {
|
typedef struct _WWSerialPort {
|
||||||
|
|
||||||
int port_on; /* <20>ݡ<EFBFBD><DDA1>Ȥξ<C8A4><CEBE><EFBFBD> */
|
int opened; /* <20>ݡ<EFBFBD><DDA1>Ȥξ<C8A4><CEBE><EFBFBD>(open/close) */
|
||||||
int baudrate; /* <20>ܡ<EFBFBD><DCA1>졼<EFBFBD><ECA1BC> */
|
int baudrate; /* <20>ܡ<EFBFBD><DCA1>졼<EFBFBD><ECA1BC> */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
69
WWSprite.c
69
WWSprite.c
@@ -3,6 +3,7 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WWSpriteP.h"
|
#include "WWSpriteP.h"
|
||||||
|
#include "WonX.h"
|
||||||
#include "etc.h"
|
#include "etc.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -37,20 +38,45 @@ int WWSprite_SetPosition(WWSprite sprite, int x, int y)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WWSprite_GetPixel(WWSprite sprite, int x, int y)
|
/* <20><><EFBFBD>ץ饤<D7A5>ȤΥԥ<CEA5><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD><CDA4>֤<EFBFBD><D6A4><EFBFBD>(Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1<><31><EFBFBD>֤<EFBFBD>) */
|
||||||
|
int WWSprite_GetPixel(WWSprite sprite, int x, int y, WWDisplay display)
|
||||||
{
|
{
|
||||||
WWPalette p;
|
WWPalette palette;
|
||||||
WWCharacter c;
|
WWCharacter character;
|
||||||
int pixel;
|
int pixel;
|
||||||
|
|
||||||
p = WWSprite_GetPalette(sprite);
|
palette = WWSprite_GetPalette(sprite);
|
||||||
c = WWSprite_GetCharacter(sprite);
|
character = WWSprite_GetCharacter(sprite);
|
||||||
|
|
||||||
if (WWSprite_GetHorizontal(sprite)) x = 7 - x;
|
if (WWSprite_GetHorizontal(sprite)) x = 7 - x;
|
||||||
if (WWSprite_GetVertical( sprite)) y = 7 - y;
|
if (WWSprite_GetVertical( sprite)) y = 7 - y;
|
||||||
|
|
||||||
pixel = WWCharacter_GetPixel(c, x, y);
|
pixel = WWCharacter_GetPixel(character, x, y, display);
|
||||||
pixel = WWPalette_GetMappedColor(p, pixel);
|
|
||||||
|
/* <20><><EFBFBD>顼<EFBFBD>б<EFBFBD> */
|
||||||
|
switch (WWDisplay_GetColorMode(display)) {
|
||||||
|
case COLOR_MODE_GRAYSCALE:
|
||||||
|
/*
|
||||||
|
* WonX-2.0 <20>ʹߤǤϡ<C7A4>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD><EFBFBD> WWDisplay <20><><EFBFBD>饹<EFBFBD>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6>
|
||||||
|
* <20>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>WWPalette_GetMappedColor() <20><> -1 <20><><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>Ȥ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
pixel = WWPalette_GetMappedColor(palette, pixel);
|
||||||
|
break;
|
||||||
|
case COLOR_MODE_4COLOR:
|
||||||
|
case COLOR_MODE_16COLOR:
|
||||||
|
case COLOR_MODE_16PACKED:
|
||||||
|
pixel =
|
||||||
|
((unsigned short int)WWPalette_GetRed( palette, pixel) << 8) |
|
||||||
|
((unsigned short int)WWPalette_GetGreen(palette, pixel) << 4) |
|
||||||
|
((unsigned short int)WWPalette_GetBlue( palette, pixel) << 0);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
WonX_Error("WWSprite_GetPixel", "Unknown color mode.");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD>ˤ<EFBFBD> -1 <20><><EFBFBD>֤<EFBFBD> */
|
||||||
|
if (WWDisplay_IsTransparent(display, palette, pixel))
|
||||||
|
pixel = -1;
|
||||||
|
|
||||||
return (pixel);
|
return (pixel);
|
||||||
}
|
}
|
||||||
@@ -81,7 +107,8 @@ WWSprite WWSprite_Create(int number, int x, int y,
|
|||||||
|
|
||||||
WWSprite WWSprite_Destroy(WWSprite sprite)
|
WWSprite WWSprite_Destroy(WWSprite sprite)
|
||||||
{
|
{
|
||||||
if (sprite == NULL) return (NULL);
|
if (sprite == NULL)
|
||||||
|
WonX_Error("WWSprite_Destroy", "Object is not created.");
|
||||||
free(sprite);
|
free(sprite);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
@@ -94,21 +121,21 @@ int WWSprite_PrintData(WWSprite s, FILE * f)
|
|||||||
|
|
||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
|
|
||||||
fprintf(f, "sprite[%d] :\tnumber = %d\n", n, WWSprite_GetNumber(s));
|
fprintf(f, "sprite[%03d] :\tnumber = %d\n", n, WWSprite_GetNumber(s));
|
||||||
fprintf(f, "sprite[%d] :\thorizontal = %s\n",
|
fprintf(f, "sprite[%03d] :\thorizontal = %s\n",
|
||||||
n, true_false(WWSprite_GetHorizontal(s)));
|
n, wonx_true_false(WWSprite_GetHorizontal(s)));
|
||||||
fprintf(f, "sprite[%d] :\tvertical = %s\n",
|
fprintf(f, "sprite[%03d] :\tvertical = %s\n",
|
||||||
n, true_false(WWSprite_GetVertical( s)));
|
n, wonx_true_false(WWSprite_GetVertical( s)));
|
||||||
fprintf(f, "sprite[%d] :\tpriority = %s\n",
|
fprintf(f, "sprite[%03d] :\tpriority = %s\n",
|
||||||
n, true_false(WWSprite_GetPriority( s)));
|
n, wonx_true_false(WWSprite_GetPriority( s)));
|
||||||
fprintf(f, "sprite[%d] :\tclipping = %s\n",
|
fprintf(f, "sprite[%03d] :\tclipping = %s\n",
|
||||||
n, true_false(WWSprite_GetClipping( s)));
|
n, wonx_true_false(WWSprite_GetClipping( s)));
|
||||||
fprintf(f, "sprite[%d] :\tpalette number = %d\n",
|
fprintf(f, "sprite[%03d] :\tpalette number = %d\n",
|
||||||
n, WWPalette_GetNumber(WWSprite_GetPalette(s)));
|
n, WWPalette_GetNumber(WWSprite_GetPalette(s)));
|
||||||
fprintf(f, "sprite[%d] :\tcharacter number = %d\n",
|
fprintf(f, "sprite[%03d] :\tcharacter number = %d\n",
|
||||||
n, WWCharacter_GetNumber(WWSprite_GetCharacter(s)));
|
n, WWCharacter_GetNumber(WWSprite_GetCharacter(s)));
|
||||||
fprintf(f, "sprite[%d] :\tx = %d\n", n, WWSprite_GetX(s));
|
fprintf(f, "sprite[%03d] :\tx = %d\n", n, WWSprite_GetX(s));
|
||||||
fprintf(f, "sprite[%d] :\ty = %d\n", n, WWSprite_GetY(s));
|
fprintf(f, "sprite[%03d] :\ty = %d\n", n, WWSprite_GetY(s));
|
||||||
|
|
||||||
fflush(f);
|
fflush(f);
|
||||||
|
|
||||||
|
|||||||
17
WWSprite.h
17
WWSprite.h
@@ -5,17 +5,22 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "WWPalette.h"
|
|
||||||
#include "WWCharacter.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WWSprite * WWSprite;
|
typedef struct _WWSprite * WWSprite;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "WWPalette.h"
|
||||||
|
#include "WWCharacter.h"
|
||||||
|
#include "WWDisplay.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -39,7 +44,7 @@ WWCharacter WWSprite_SetCharacter(WWSprite s, WWCharacter c);
|
|||||||
int WWSprite_GetX(WWSprite sprite);
|
int WWSprite_GetX(WWSprite sprite);
|
||||||
int WWSprite_GetY(WWSprite sprite);
|
int WWSprite_GetY(WWSprite sprite);
|
||||||
int WWSprite_SetPosition(WWSprite sprite, int x, int y);
|
int WWSprite_SetPosition(WWSprite sprite, int x, int y);
|
||||||
int WWSprite_GetPixel(WWSprite sprite, int x, int y);
|
int WWSprite_GetPixel(WWSprite sprite, int x, int y, WWDisplay display);
|
||||||
|
|
||||||
WWSprite WWSprite_Create(int number, int x, int y,
|
WWSprite WWSprite_Create(int number, int x, int y,
|
||||||
int horizontal, int vertical,
|
int horizontal, int vertical,
|
||||||
|
|||||||
78
WWText.c
78
WWText.c
@@ -3,7 +3,7 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WWTextP.h"
|
#include "WWTextP.h"
|
||||||
#include "etc.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
/* <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD>ȤΥӥåȥޥåץǡ<D7A5><C7A1><EFBFBD> */
|
/* <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD>ȤΥӥåȥޥåץǡ<D7A5><C7A1><EFBFBD> */
|
||||||
#include "WWTextFonts.c"
|
#include "WWTextFonts.c"
|
||||||
@@ -57,7 +57,7 @@ int WWText_SetTextWindow(WWText ww_text, int x, int y,
|
|||||||
for (tx = 0; tx < WWText_GetWidth(ww_text); tx++) {
|
for (tx = 0; tx < WWText_GetWidth(ww_text); tx++) {
|
||||||
if (c >= 512) WonX_Error("WWText_SetTextWindow", "Over character.");
|
if (c >= 512) WonX_Error("WWText_SetTextWindow", "Over character.");
|
||||||
ww_character = WWDisplay_GetCharacter(ww_display, c);
|
ww_character = WWDisplay_GetCharacter(ww_display, c);
|
||||||
WWCharacter_SetBitmap(ww_character, NULL);
|
WWCharacter_ClearAllPixels(ww_character);
|
||||||
WWScreen_SetCharacter(WWText_GetScreen(ww_text),
|
WWScreen_SetCharacter(WWText_GetScreen(ww_text),
|
||||||
WWText_GetX(ww_text) + tx,
|
WWText_GetX(ww_text) + tx,
|
||||||
WWText_GetY(ww_text) + ty,
|
WWText_GetY(ww_text) + ty,
|
||||||
@@ -72,10 +72,13 @@ int WWText_PutCharacter(WWText ww_text, int x, int y, int character,
|
|||||||
WWDisplay ww_display)
|
WWDisplay ww_display)
|
||||||
{
|
{
|
||||||
WWCharacter ww_character;
|
WWCharacter ww_character;
|
||||||
|
int j, k, n;
|
||||||
|
int f, b;
|
||||||
|
unsigned short int pixel;
|
||||||
|
unsigned short int bitmap;
|
||||||
|
|
||||||
if ((character < 0) || (character > 127)) {
|
if ((character < 0) || (character > 127)) {
|
||||||
printf("warning : WWText_PutCharacter() : Character number is out of range.\n");
|
WonX_Warning("WWText_PutCharacter", "Character number is out of range.");
|
||||||
fflush(stdout);
|
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -86,8 +89,7 @@ int WWText_PutCharacter(WWText ww_text, int x, int y, int character,
|
|||||||
|
|
||||||
if ( (x < 0) || (x > WWText_GetWidth( ww_text) - 1) ||
|
if ( (x < 0) || (x > WWText_GetWidth( ww_text) - 1) ||
|
||||||
(y < 0) || (y > WWText_GetHeight(ww_text) - 1) ) {
|
(y < 0) || (y > WWText_GetHeight(ww_text) - 1) ) {
|
||||||
printf("warning : WWText_PutCharacter() : Position is out of range.\n");
|
WonX_Warning("WWText_PutCharacter", "Position is out of range.");
|
||||||
fflush(stdout);
|
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +104,34 @@ int WWText_PutCharacter(WWText ww_text, int x, int y, int character,
|
|||||||
WWText_GetY(ww_text) + y);
|
WWText_GetY(ww_text) + y);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
WWCharacter_CopyBitmap(ww_character, WWText_GetFont(ww_text, character));
|
/*
|
||||||
|
* <20>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>ȥե<C8A5><D5A5><EFBFBD><EFBFBD>Ȥ<EFBFBD>
|
||||||
|
* f = WWDisplay_GetForegroundColor(ww_display);
|
||||||
|
* b = WWDisplay_GetBackgroundColor(ww_display);
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><E8A4B9>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD>뤿<EFBFBD>ᡤ<EFBFBD><E1A1A4><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4>Ӥ˥ӥåȥޥåפԡ<F2A5B3A5><D4A1><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD>롥
|
||||||
|
* <20>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC><EFBFBD>κݤˡ<DDA4><CBA1><EFBFBD><EFBFBD>Τ褦<CEA4>˽<EFBFBD><CBBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
* <20><><EFBFBD>äơ<C3A4><C6A1>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>Ȥν<C8A4><CEBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWCharacter <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>
|
||||||
|
* ̵<><CCB5><EFBFBD>ʤä<CAA4><C3A4>Τǡ<CEA4>WWCharacter <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤳<EFBFBD>ȡ<EFBFBD>
|
||||||
|
*/
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
WWCharacter_CopyAllPixels(ww_character, WWText_GetFont(ww_text, character));
|
||||||
|
#else
|
||||||
|
f = WWDisplay_GetForegroundColor(ww_display);
|
||||||
|
b = WWDisplay_GetBackgroundColor(ww_display);
|
||||||
|
|
||||||
|
n = character * 8;
|
||||||
|
for (j = 0; j < 8; j++) {
|
||||||
|
bitmap = 0;
|
||||||
|
for (k = 0; k < 8; k++) {
|
||||||
|
pixel = (fonts[n] & (1 << k)) ? f : b;
|
||||||
|
bitmap |= ( pixel & 1) << k;
|
||||||
|
bitmap |= ((pixel >> 1) & 1) << (k + 8);
|
||||||
|
}
|
||||||
|
WWCharacter_SetBitmapAsShortInt(ww_character, j, bitmap);
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* ɽ<><C9BD><EFBFBD><EFBFBD><EFBFBD>˥ѥ<CBA5><D1A5>åȤ<C3A5><C8A4><EFBFBD><EFBFBD>ꤹ<EFBFBD><EAA4B9><EFBFBD>ΤǤ<CEA4><C7A4><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD> <20><><EFBFBD><EFBFBD> */
|
/* ɽ<><C9BD><EFBFBD><EFBFBD><EFBFBD>˥ѥ<CBA5><D1A5>åȤ<C3A5><C8A4><EFBFBD><EFBFBD>ꤹ<EFBFBD><EAA4B9><EFBFBD>ΤǤ<CEA4><C7A4><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD> <20><><EFBFBD><EFBFBD> */
|
||||||
WWScreen_SetPalette(WWText_GetScreen(ww_text),
|
WWScreen_SetPalette(WWText_GetScreen(ww_text),
|
||||||
@@ -122,20 +151,44 @@ WWText WWText_Create(WWScreen screen,
|
|||||||
WWPalette palette)
|
WWPalette palette)
|
||||||
{
|
{
|
||||||
WWText ww_text;
|
WWText ww_text;
|
||||||
int i;
|
WWCharacter ww_character;
|
||||||
|
int i, j, k, n;
|
||||||
|
int f, b;
|
||||||
|
unsigned short int pixel;
|
||||||
|
unsigned short int bitmap;
|
||||||
|
|
||||||
ww_text = (WWText)malloc(sizeof(_WWText));
|
ww_text = (WWText)malloc(sizeof(_WWText));
|
||||||
if (ww_text == NULL) WonX_Error("WWText_Create", "Cannot allocate memory.");
|
if (ww_text == NULL) WonX_Error("WWText_Create", "Cannot allocate memory.");
|
||||||
|
|
||||||
WWText_SetScreen(ww_text, screen);
|
WWText_SetScreen(ww_text, screen);
|
||||||
WWText_SetX(ww_text, 0);
|
WWText_SetX(ww_text, x);
|
||||||
WWText_SetY(ww_text, 0);
|
WWText_SetY(ww_text, y);
|
||||||
WWText_SetWidth( ww_text, width );
|
WWText_SetWidth( ww_text, width );
|
||||||
WWText_SetHeight(ww_text, height);
|
WWText_SetHeight(ww_text, height);
|
||||||
WWText_SetPalette(ww_text, palette);
|
WWText_SetPalette(ww_text, palette);
|
||||||
|
|
||||||
|
/* <20>ʲ<EFBFBD><CAB2>ϡ<EFBFBD>
|
||||||
|
f = WWDisplay_GetForegroundColor(ww_display);
|
||||||
|
b = WWDisplay_GetBackgroundColor(ww_display);
|
||||||
|
<20>Ǽ<EFBFBD><C7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>٤<EFBFBD><D9A4><EFBFBD><EFBFBD>⤷<EFBFBD><E2A4B7><EFBFBD>ʤ<EFBFBD>
|
||||||
|
*/
|
||||||
|
f = 3;
|
||||||
|
b = 0;
|
||||||
|
|
||||||
|
n = 0;
|
||||||
for (i = 0; i < 128; i++) {
|
for (i = 0; i < 128; i++) {
|
||||||
WWText_SetFont(ww_text, i, WWCharacter_Create(i, &(fonts[i * 16])));
|
ww_character = WWCharacter_Create(i);
|
||||||
|
for (j = 0; j < 8; j++) {
|
||||||
|
bitmap = 0;
|
||||||
|
for (k = 0; k < 8; k++) {
|
||||||
|
pixel = (fonts[n] & (1 << k)) ? f : b;
|
||||||
|
bitmap |= ( pixel & 1) << k;
|
||||||
|
bitmap |= ((pixel >> 1) & 1) << (k + 8);
|
||||||
|
}
|
||||||
|
WWCharacter_SetBitmapAsShortInt(ww_character, j, bitmap);
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
WWText_SetFont(ww_text, i, ww_character);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (ww_text);
|
return (ww_text);
|
||||||
@@ -145,7 +198,8 @@ WWText WWText_Destroy(WWText ww_text)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (ww_text == NULL) WonX_Error("WWText_Destroy", "Object is not created.");
|
if (ww_text == NULL)
|
||||||
|
WonX_Error("WWText_Destroy", "Object is not created.");
|
||||||
|
|
||||||
for (i = 0; i < 128; i++) {
|
for (i = 0; i < 128; i++) {
|
||||||
if (WWText_GetFont(ww_text, i))
|
if (WWText_GetFont(ww_text, i))
|
||||||
|
|||||||
27
WWText.h
27
WWText.h
@@ -5,16 +5,20 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WWDisplay.h"
|
|
||||||
#include "WWScreen.h"
|
|
||||||
#include "WWPalette.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WWText * WWText;
|
typedef struct _WWText * WWText;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include "WWDisplay.h"
|
||||||
|
#include "WWScreen.h"
|
||||||
|
#include "WWPalette.h"
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>Фμ<D0A4><CEBC><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>Фμ<D0A4><CEBC><EFBFBD> */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
@@ -53,21 +57,6 @@ WWText WWText_Create(WWScreen screen, int x, int y, int width, int height,
|
|||||||
WWPalette palette);
|
WWPalette palette);
|
||||||
WWText WWText_Destroy(WWText text);
|
WWText WWText_Destroy(WWText text);
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/* End of File. */
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
256
WWTextFonts.c
256
WWTextFonts.c
@@ -1,130 +1,130 @@
|
|||||||
static unsigned char fonts[] = {
|
static unsigned char fonts[] = {
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0 <20><><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8> */
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0 <20><><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8> */
|
||||||
0x00,0x00,0x00,0x00,0xc0,0x0c,0x00,0x00,0x30,0x30,0xc0,0x0f,0x00,0x00,0x00,0x00, /* 1 <20>д<EFBFBD> */
|
0x00, 0x00, 0x14, 0x00, 0x22, 0x1c, 0x00, 0x00, /* 1 <20>д<EFBFBD> */
|
||||||
0x00,0x00,0xf0,0x3f,0x3c,0xf3,0xfc,0xff,0xcc,0xcf,0x3c,0xf0,0xf0,0x3f,0x00,0x00, /* 2 <20>д<EFBFBD> */
|
0x00, 0x3e, 0x6b, 0x7f, 0x5d, 0x63, 0x3e, 0x00, /* 2 <20>д<EFBFBD> */
|
||||||
0x30,0x30,0xfc,0xfc,0xfc,0xff,0xfc,0xff,0xf0,0x3f,0xc0,0x0f,0x00,0x03,0x00,0x00, /* 3 <20>ϡ<EFBFBD><CFA1><EFBFBD> */
|
0x22, 0x77, 0x7f, 0x7f, 0x3e, 0x1c, 0x08, 0x00, /* 3 <20>ϡ<EFBFBD><CFA1><EFBFBD> */
|
||||||
0x00,0x03,0xc0,0x0f,0xf0,0x3f,0xfc,0xff,0xf0,0x3f,0xc0,0x0f,0x00,0x03,0x00,0x00, /* 4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
0x08, 0x1c, 0x3e, 0x7f, 0x3e, 0x1c, 0x08, 0x00, /* 4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
0x00,0x03,0xc0,0x0f,0xc0,0x0f,0xfc,0xfc,0xfc,0xfc,0x00,0x03,0xc0,0x0f,0x00,0x00, /* 5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD> */
|
0x08, 0x1c, 0x1c, 0x77, 0x77, 0x08, 0x1c, 0x00, /* 5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD> */
|
||||||
0x00,0x03,0xc0,0x0f,0xf0,0x3f,0xfc,0xff,0xf0,0x3f,0x00,0x03,0xc0,0x0f,0x00,0x00, /* 6 <20><><EFBFBD>ڡ<EFBFBD><DAA1><EFBFBD> */
|
0x08, 0x1c, 0x3e, 0x7f, 0x3e, 0x08, 0x1c, 0x00, /* 6 <20><><EFBFBD>ڡ<EFBFBD><DAA1><EFBFBD> */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x03,0xc0,0x03,0x00,0x00,0x00,0x00,0x00,0x00, /* 7 <20><> */
|
0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, /* 7 <20><> */
|
||||||
0x00,0x00,0x00,0x00,0xf0,0x0f,0x30,0x0c,0x30,0x0c,0xf0,0x0f,0x00,0x00,0x00,0x00, /* 8 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
0x00, 0x00, 0x3c, 0x24, 0x24, 0x3c, 0x00, 0x00, /* 8 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
0x00,0x00,0x00,0x00,0xc0,0x03,0x30,0x0c,0x30,0x0c,0xc0,0x03,0x00,0x00,0x00,0x00, /* 9 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
0x00, 0x00, 0x18, 0x24, 0x24, 0x18, 0x00, 0x00, /* 9 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
0x00,0x00,0xfc,0x3f,0x0c,0x30,0xcc,0x33,0xcc,0x33,0x0c,0x30,0xfc,0x3f,0x00,0x00, /* 10 <20><><EFBFBD>Żͳ<C5BB> */
|
0x00, 0x7e, 0x42, 0x5a, 0x5a, 0x42, 0x7e, 0x00, /* 10 <20><><EFBFBD>Żͳ<C5BB> */
|
||||||
0x00,0xff,0x00,0xf0,0x00,0xcc,0xf0,0xc3,0x0c,0x03,0x0c,0x03,0xf0,0x00,0x00,0x00, /* 11 <20><> */
|
0x0f, 0x03, 0x05, 0x39, 0x48, 0x48, 0x30, 0x00, /* 11 <20><> */
|
||||||
0xc0,0x0f,0x30,0x30,0x30,0x30,0xc0,0x0f,0x00,0x03,0xf0,0x3f,0x00,0x03,0x00,0x00, /* 12 <20><> */
|
0x1c, 0x22, 0x22, 0x1c, 0x08, 0x3e, 0x08, 0x00, /* 12 <20><> */
|
||||||
0xc0,0x03,0xc0,0x0f,0xc0,0x3c,0xc0,0x30,0xc0,0x30,0xfc,0x00,0x3c,0x00,0x00,0x00, /* 13 <20><> */
|
0x18, 0x1c, 0x16, 0x12, 0x12, 0x70, 0x60, 0x00, /* 13 <20><> */
|
||||||
0xc0,0x03,0xc0,0x3f,0xc0,0x3c,0xc0,0x30,0x3c,0x30,0x3c,0x3f,0x00,0x0f,0x00,0x00, /* 14 <20><><EFBFBD><EFBFBD> */
|
0x18, 0x1e, 0x16, 0x12, 0x62, 0x6e, 0x0c, 0x00, /* 14 <20><><EFBFBD><EFBFBD> */
|
||||||
0x00,0x03,0x30,0x33,0xc0,0x0f,0xfc,0xfc,0xc0,0x0f,0x30,0x33,0x00,0x03,0x00,0x00, /* 15 <20><>ȯ<EFBFBD><C8AF> */
|
0x08, 0x2a, 0x1c, 0x77, 0x1c, 0x2a, 0x08, 0x00, /* 15 <20><>ȯ<EFBFBD><C8AF> */
|
||||||
0xc0,0x00,0xc0,0x03,0xc0,0x0f,0xc0,0x3f,0xc0,0x0f,0xc0,0x03,0xc0,0x00,0x00,0x00, /* 16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
0x10, 0x18, 0x1c, 0x1e, 0x1c, 0x18, 0x10, 0x00, /* 16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
0x00,0x0c,0x00,0x0f,0xc0,0x0f,0xf0,0x0f,0xc0,0x0f,0x00,0x0f,0x00,0x0c,0x00,0x00, /* 17 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
0x04, 0x0c, 0x1c, 0x3c, 0x1c, 0x0c, 0x04, 0x00, /* 17 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
0x00,0x03,0xc0,0x0f,0xf0,0x3f,0x00,0x03,0xf0,0x3f,0xc0,0x0f,0x00,0x03,0x00,0x00, /* 18 <20>岼<EFBFBD><E5B2BC><EFBFBD><EFBFBD> */
|
0x08, 0x1c, 0x3e, 0x08, 0x3e, 0x1c, 0x08, 0x00, /* 18 <20>岼<EFBFBD><E5B2BC><EFBFBD><EFBFBD> */
|
||||||
0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0x00,0x00,0xf0,0x3c,0x00,0x00, /* 19 !! */
|
0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x36, 0x00, /* 19 !! */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x3c,0x30,0x0f,0xf0,0x03,0xc0,0x00,0x00,0x00, /* 20 <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD> */
|
0x00, 0x00, 0x02, 0x06, 0x2c, 0x38, 0x10, 0x00, /* 20 <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD> */
|
||||||
0x00,0x00,0x00,0x00,0xc0,0x03,0xf0,0x0f,0xf0,0x0f,0xc0,0x03,0x00,0x00,0x00,0x00, /* 21 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00, /* 21 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x3c,0x3c,0x3c,0x00,0x00,0x00,0x00,0x00,0x00, /* 22 <20><><EFBFBD><EFBFBD> */
|
0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, /* 22 <20><><EFBFBD><EFBFBD> */
|
||||||
0x00,0x03,0xc0,0x0f,0xf0,0x3f,0x00,0x03,0xf0,0x3f,0xc0,0x0f,0xf0,0x3f,0x00,0x00, /* 23 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
0x08, 0x1c, 0x3e, 0x08, 0x3e, 0x1c, 0x3e, 0x00, /* 23 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
0x00,0x03,0xc0,0x0f,0xf0,0x3f,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x00, /* 24 <20><> */
|
0x08, 0x1c, 0x3e, 0x08, 0x08, 0x08, 0x08, 0x00, /* 24 <20><> */
|
||||||
0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0xf0,0x3f,0xc0,0x0f,0x00,0x03,0x00,0x00, /* 25 <20><> */
|
0x08, 0x08, 0x08, 0x08, 0x3e, 0x1c, 0x08, 0x00, /* 25 <20><> */
|
||||||
0x00,0x00,0x00,0x0c,0x00,0x3c,0xfc,0xff,0x00,0x3c,0x00,0x0c,0x00,0x00,0x00,0x00, /* 26 <20><> */
|
0x00, 0x04, 0x06, 0x7f, 0x06, 0x04, 0x00, 0x00, /* 26 <20><> */
|
||||||
0x00,0x00,0xc0,0x00,0xf0,0x00,0xfc,0xff,0xf0,0x00,0xc0,0x00,0x00,0x00,0x00,0x00, /* 27 <20><> */
|
0x00, 0x10, 0x30, 0x7f, 0x30, 0x10, 0x00, 0x00, /* 27 <20><> */
|
||||||
0xf0,0x0f,0x0c,0x30,0xc3,0xcf,0x33,0xc0,0x33,0xc0,0xc3,0xcf,0x0c,0x30,0xf0,0x0f, /* 28 (C) */
|
0x3c, 0x42, 0x9d, 0xa1, 0xa1, 0x9d, 0x42, 0x3c, /* 28 (C) */
|
||||||
0x00,0x00,0xc0,0x0c,0xf0,0x3c,0xfc,0xff,0xf0,0x3c,0xc0,0x0c,0x00,0x00,0x00,0x00, /* 29 <20><><EFBFBD><EFBFBD> */
|
0x00, 0x14, 0x36, 0x7f, 0x36, 0x14, 0x00, 0x00, /* 29 <20><><EFBFBD><EFBFBD> */
|
||||||
0x00,0x00,0x00,0x03,0xc0,0x0f,0xf0,0x3f,0xfc,0xff,0x00,0x00,0x00,0x00,0x00,0x00, /* 30 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
0x00, 0x08, 0x1c, 0x3e, 0x7f, 0x00, 0x00, 0x00, /* 30 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
0x00,0x00,0x00,0x00,0xfc,0xff,0xf0,0x3f,0xc0,0x0f,0x00,0x03,0x00,0x00,0x00,0x00, /* 31 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
0x00, 0x00, 0x7f, 0x3e, 0x1c, 0x08, 0x00, 0x00, /* 31 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 32 <20><><EFBFBD><EFBFBD> */
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 32 <20><><EFBFBD><EFBFBD> */
|
||||||
0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x00,0xc0,0x03,0x00,0x00, /* 33 ! */
|
0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x00, /* 33 ! */
|
||||||
0xf0,0x3c,0xf0,0x3c,0xc0,0x30,0x30,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 34 " */
|
0x36, 0x36, 0x12, 0x24, 0x00, 0x00, 0x00, 0x00, /* 34 " */
|
||||||
0xc0,0x0c,0xc0,0x0c,0xfc,0xff,0xc0,0x0c,0xfc,0xff,0xc0,0x0c,0xc0,0x0c,0x00,0x00, /* 35 # */
|
0x14, 0x14, 0x7f, 0x14, 0x7f, 0x14, 0x14, 0x00, /* 35 # */
|
||||||
0x00,0x03,0xf0,0x3f,0x3c,0x03,0xf0,0x3f,0x00,0xf3,0xf0,0x3f,0x00,0x03,0x00,0x00, /* 36 $ */
|
0x08, 0x3e, 0x68, 0x3e, 0x0b, 0x3e, 0x08, 0x00, /* 36 $ */
|
||||||
0x30,0xc0,0xcc,0x30,0x30,0x0c,0x00,0x03,0xc0,0x30,0x30,0xcc,0x0c,0x30,0x00,0x00, /* 37 % */
|
0x21, 0x52, 0x24, 0x08, 0x12, 0x25, 0x42, 0x00, /* 37 % */
|
||||||
0xc0,0x03,0x30,0x0c,0x30,0x0c,0xf0,0xc3,0x0c,0x3f,0x0c,0x0c,0xf0,0xf3,0x00,0x00, /* 38 & */
|
0x18, 0x24, 0x24, 0x39, 0x4e, 0x44, 0x3b, 0x00, /* 38 & */
|
||||||
0x00,0x0f,0x00,0x0f,0x00,0x0c,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 39 ' */
|
0x0c, 0x0c, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, /* 39 ' */
|
||||||
0x00,0x0c,0x00,0x03,0xc0,0x00,0xc0,0x00,0xc0,0x00,0x00,0x03,0x00,0x0c,0x00,0x00, /* 40 ( */
|
0x04, 0x08, 0x10, 0x10, 0x10, 0x08, 0x04, 0x00, /* 40 ( */
|
||||||
0xc0,0x00,0x00,0x03,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x03,0xc0,0x00,0x00,0x00, /* 41 ) */
|
0x10, 0x08, 0x04, 0x04, 0x04, 0x08, 0x10, 0x00, /* 41 ) */
|
||||||
0x00,0x00,0x00,0x03,0x30,0x33,0xc0,0x0f,0x30,0x33,0x00,0x03,0x00,0x00,0x00,0x00, /* 42 * */
|
0x00, 0x08, 0x2a, 0x1c, 0x2a, 0x08, 0x00, 0x00, /* 42 * */
|
||||||
0x00,0x03,0x00,0x03,0x00,0x03,0xfc,0xff,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x00, /* 43 + */
|
0x08, 0x08, 0x08, 0x7f, 0x08, 0x08, 0x08, 0x00, /* 43 + */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x3c,0x00,0x30,0x00,0x0c,0x00, /* 44 , */
|
0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x20, 0x40, /* 44 , */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 45 - */
|
0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, /* 45 - */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x3c,0x00,0x00,0x00, /* 46 . */
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, /* 46 . */
|
||||||
0x00,0xc0,0x00,0x30,0x00,0x0c,0x00,0x03,0xc0,0x00,0x30,0x00,0x0c,0x00,0x00,0x00, /* 47 / */
|
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, /* 47 / */
|
||||||
0xf0,0x0f,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 48 0 */
|
0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, /* 48 0 */
|
||||||
0x00,0x0f,0xf0,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x00, /* 49 1 */
|
0x0c, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, /* 49 1 */
|
||||||
0xf0,0x0f,0x3c,0x3c,0x00,0x3c,0x00,0x0f,0xc0,0x03,0xf0,0x00,0xfc,0x3f,0x00,0x00, /* 50 2 */
|
0x3c, 0x66, 0x06, 0x0c, 0x18, 0x30, 0x7e, 0x00, /* 50 2 */
|
||||||
0xf0,0x0f,0x3c,0x3c,0x00,0x3c,0xf0,0x0f,0x00,0x3c,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 51 3 */
|
0x3c, 0x66, 0x06, 0x3c, 0x06, 0x66, 0x3c, 0x00, /* 51 3 */
|
||||||
0x00,0x3f,0xc0,0x3f,0xf0,0x3c,0x3c,0x3c,0x3c,0x3c,0xfc,0xff,0x00,0x3c,0x00,0x00, /* 52 4 */
|
0x0e, 0x1e, 0x36, 0x66, 0x66, 0x7f, 0x06, 0x00, /* 52 4 */
|
||||||
0xfc,0x3f,0x3c,0x00,0x3c,0x00,0xfc,0x0f,0x00,0x3c,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 53 5 */
|
0x7e, 0x60, 0x60, 0x7c, 0x06, 0x66, 0x3c, 0x00, /* 53 5 */
|
||||||
0xf0,0x0f,0x3c,0x3c,0x3c,0x00,0xfc,0x0f,0x3c,0x3c,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 54 6 */
|
0x3c, 0x66, 0x60, 0x7c, 0x66, 0x66, 0x3c, 0x00, /* 54 6 */
|
||||||
0xfc,0x3f,0x3c,0x3c,0x00,0x3c,0x00,0x0f,0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x00, /* 55 7 */
|
0x7e, 0x66, 0x06, 0x0c, 0x18, 0x18, 0x18, 0x00, /* 55 7 */
|
||||||
0xf0,0x0f,0x3c,0x3c,0x3c,0x3c,0xf0,0x0f,0x3c,0x3c,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 56 8 */
|
0x3c, 0x66, 0x66, 0x3c, 0x66, 0x66, 0x3c, 0x00, /* 56 8 */
|
||||||
0xf0,0x0f,0x3c,0x3c,0x3c,0x3c,0xf0,0x3f,0x00,0x3c,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 57 9 */
|
0x3c, 0x66, 0x66, 0x3e, 0x06, 0x66, 0x3c, 0x00, /* 57 9 */
|
||||||
0x00,0x00,0xc0,0x03,0xc0,0x03,0x00,0x00,0xc0,0x03,0xc0,0x03,0x00,0x00,0x00,0x00, /* 58 : */
|
0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, /* 58 : */
|
||||||
0x00,0x00,0xc0,0x03,0xc0,0x03,0x00,0x00,0xc0,0x03,0xc0,0x03,0x00,0x03,0xc0,0x00, /* 59 ; */
|
0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x08, 0x10, /* 59 ; */
|
||||||
0x00,0x0c,0x00,0x03,0xc0,0x00,0x30,0x00,0xc0,0x00,0x00,0x03,0x00,0x0c,0x00,0x00, /* 60 < */
|
0x04, 0x08, 0x10, 0x20, 0x10, 0x08, 0x04, 0x00, /* 60 < */
|
||||||
0x00,0x00,0x00,0x00,0xfc,0xff,0x00,0x00,0xfc,0xff,0x00,0x00,0x00,0x00,0x00,0x00, /* 61 = */
|
0x00, 0x00, 0x7f, 0x00, 0x7f, 0x00, 0x00, 0x00, /* 61 = */
|
||||||
0xc0,0x00,0x00,0x03,0x00,0x0c,0x00,0x30,0x00,0x0c,0x00,0x03,0xc0,0x00,0x00,0x00, /* 62 > */
|
0x10, 0x08, 0x04, 0x02, 0x04, 0x08, 0x10, 0x00, /* 62 > */
|
||||||
0xf0,0x0f,0x3c,0x3c,0x3c,0x3c,0x00,0x0f,0xc0,0x03,0x00,0x00,0xc0,0x03,0x00,0x00, /* 63 ? */
|
0x3c, 0x66, 0x66, 0x0c, 0x18, 0x00, 0x18, 0x00, /* 63 ? */
|
||||||
0xf0,0x3f,0x0c,0xcc,0xcc,0xcf,0xcc,0xcc,0xcc,0xff,0x0c,0x00,0xf0,0x3f,0x00,0x00, /* 64 @ */
|
0x3e, 0x45, 0x5d, 0x55, 0x5f, 0x40, 0x3e, 0x00, /* 64 @ */
|
||||||
0xc0,0x0f,0xf0,0x3c,0x3c,0xf0,0x3c,0xf0,0xfc,0xff,0x3c,0xf0,0x3c,0xf0,0x00,0x00, /* 65 A */
|
0x1c, 0x36, 0x63, 0x63, 0x7f, 0x63, 0x63, 0x00, /* 65 A */
|
||||||
0xfc,0x3f,0x3c,0xf0,0x3c,0xf0,0xfc,0x3f,0x3c,0xf0,0x3c,0xf0,0xfc,0x3f,0x00,0x00, /* 66 B */
|
0x7e, 0x63, 0x63, 0x7e, 0x63, 0x63, 0x7e, 0x00, /* 66 B */
|
||||||
0xf0,0x3f,0x3c,0xf0,0x3c,0x00,0x3c,0x00,0x3c,0x00,0x3c,0xf0,0xf0,0x3f,0x00,0x00, /* 67 C */
|
0x3e, 0x63, 0x60, 0x60, 0x60, 0x63, 0x3e, 0x00, /* 67 C */
|
||||||
0xfc,0x0f,0x3c,0x3c,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0x3c,0xfc,0x0f,0x00,0x00, /* 68 D */
|
0x7c, 0x66, 0x63, 0x63, 0x63, 0x66, 0x7c, 0x00, /* 68 D */
|
||||||
0xfc,0x3f,0x3c,0x00,0x3c,0x00,0xfc,0x0f,0x3c,0x00,0x3c,0x00,0xfc,0x3f,0x00,0x00, /* 69 E */
|
0x7e, 0x60, 0x60, 0x7c, 0x60, 0x60, 0x7e, 0x00, /* 69 E */
|
||||||
0xfc,0x3f,0x3c,0x00,0x3c,0x00,0xfc,0x0f,0x3c,0x00,0x3c,0x00,0x3c,0x00,0x00,0x00, /* 70 F */
|
0x7e, 0x60, 0x60, 0x7c, 0x60, 0x60, 0x60, 0x00, /* 70 F */
|
||||||
0xf0,0x3f,0x3c,0xf0,0x3c,0x00,0x3c,0xfc,0x3c,0xf0,0x3c,0xf0,0xf0,0x3f,0x00,0x00, /* 71 G */
|
0x3e, 0x63, 0x60, 0x67, 0x63, 0x63, 0x3e, 0x00, /* 71 G */
|
||||||
0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0xfc,0xff,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x00,0x00, /* 72 H */
|
0x63, 0x63, 0x63, 0x7f, 0x63, 0x63, 0x63, 0x00, /* 72 H */
|
||||||
0xf0,0x0f,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xf0,0x0f,0x00,0x00, /* 73 I */
|
0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, /* 73 I */
|
||||||
0x00,0xff,0x00,0xf0,0x00,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0xf0,0x3f,0x00,0x00, /* 74 J */
|
0x0f, 0x03, 0x03, 0x63, 0x63, 0x63, 0x3e, 0x00, /* 74 J */
|
||||||
0x3c,0xf0,0x3c,0x3c,0x3c,0x0f,0xfc,0x03,0x3c,0x0f,0x3c,0x3c,0x3c,0xf0,0x00,0x00, /* 75 K */
|
0x63, 0x66, 0x6c, 0x78, 0x6c, 0x66, 0x63, 0x00, /* 75 K */
|
||||||
0x3c,0x00,0x3c,0x00,0x3c,0x00,0x3c,0x00,0x3c,0x00,0x3c,0x00,0xfc,0xff,0x00,0x00, /* 76 L */
|
0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7f, 0x00, /* 76 L */
|
||||||
0x3c,0xf0,0xfc,0xfc,0xfc,0xff,0x3c,0xf3,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x00,0x00, /* 77 M */
|
0x63, 0x77, 0x7f, 0x6b, 0x63, 0x63, 0x63, 0x00, /* 77 M */
|
||||||
0x3c,0xf0,0xfc,0xf0,0xfc,0xf3,0x3c,0xff,0x3c,0xfc,0x3c,0xf0,0x3c,0xf0,0x00,0x00, /* 78 N */
|
0x63, 0x73, 0x7b, 0x6f, 0x67, 0x63, 0x63, 0x00, /* 78 N */
|
||||||
0xf0,0x3f,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0xf0,0x3f,0x00,0x00, /* 79 O */
|
0x3e, 0x63, 0x63, 0x63, 0x63, 0x63, 0x3e, 0x00, /* 79 O */
|
||||||
0xfc,0x3f,0x3c,0xf0,0x3c,0xf0,0xfc,0x3f,0x3c,0x00,0x3c,0x00,0x3c,0x00,0x00,0x00, /* 80 P */
|
0x7e, 0x63, 0x63, 0x7e, 0x60, 0x60, 0x60, 0x00, /* 80 P */
|
||||||
0xf0,0x3f,0x3c,0xf0,0x3c,0xf0,0x3c,0xf3,0x3c,0xff,0x3c,0xfc,0xf0,0x3f,0x00,0x00, /* 81 Q */
|
0x3e, 0x63, 0x63, 0x6b, 0x6f, 0x67, 0x3e, 0x00, /* 81 Q */
|
||||||
0xfc,0x3f,0x3c,0xf0,0x3c,0xf0,0xfc,0x3f,0x3c,0x0f,0x3c,0x3c,0x3c,0xf0,0x00,0x00, /* 82 R */
|
0x7e, 0x63, 0x63, 0x7e, 0x6c, 0x66, 0x63, 0x00, /* 82 R */
|
||||||
0xf0,0x3f,0x3c,0xf0,0x3c,0x00,0xf0,0x3f,0x00,0xf0,0x3c,0xf0,0xf0,0x3f,0x00,0x00, /* 83 S */
|
0x3e, 0x63, 0x60, 0x3e, 0x03, 0x63, 0x3e, 0x00, /* 83 S */
|
||||||
0xfc,0x3f,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x00, /* 84 T */
|
0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, /* 84 T */
|
||||||
0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0xf0,0x3f,0x00,0x00, /* 85 U */
|
0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x3e, 0x00, /* 85 U */
|
||||||
0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0xf0,0x3c,0xf0,0x3c,0xc0,0x0f,0x00,0x03,0x00,0x00, /* 86 V */
|
0x63, 0x63, 0x63, 0x36, 0x36, 0x1c, 0x08, 0x00, /* 86 V */
|
||||||
0x3c,0xf0,0x3c,0xf3,0x3c,0xf3,0x3c,0xf3,0xfc,0xff,0xf0,0x3c,0x30,0x30,0x00,0x00, /* 87 W */
|
0x63, 0x6b, 0x6b, 0x6b, 0x7f, 0x36, 0x22, 0x00, /* 87 W */
|
||||||
0x3c,0xf0,0x3c,0xf0,0xf0,0x3c,0xc0,0x0f,0xf0,0x3c,0x3c,0xf0,0x3c,0xf0,0x00,0x00, /* 88 X */
|
0x63, 0x63, 0x36, 0x1c, 0x36, 0x63, 0x63, 0x00, /* 88 X */
|
||||||
0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0xf0,0x0f,0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x00, /* 89 Y */
|
0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x00, /* 89 Y */
|
||||||
0xfc,0xff,0x00,0xf0,0x00,0x3c,0x00,0x0f,0xc0,0x03,0xf0,0x00,0xfc,0xff,0x00,0x00, /* 90 Z */
|
0x7f, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x7f, 0x00, /* 90 Z */
|
||||||
0xc0,0x0f,0xc0,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x0f,0x00,0x00, /* 91 [ */
|
0x1c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1c, 0x00, /* 91 [ */
|
||||||
0x0c,0x00,0x30,0x00,0xc0,0x00,0x00,0x03,0x00,0x0c,0x00,0x30,0x00,0xc0,0x00,0x00, /* 92 \ */
|
0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, /* 92 \ */
|
||||||
0xc0,0x0f,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c,0xc0,0x0f,0x00,0x00, /* 93 ] */
|
0x1c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1c, 0x00, /* 93 ] */
|
||||||
0x00,0x03,0xc0,0x0f,0xf0,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 94 ^ */
|
0x08, 0x1c, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, /* 94 ^ */
|
||||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0x00,0x00, /* 95 _ */
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, /* 95 _ */
|
||||||
0xc0,0x03,0xc0,0x03,0x00,0x03,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 96 ` */
|
0x18, 0x18, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, /* 96 ` */
|
||||||
0x00,0x00,0x00,0x00,0xf0,0x3f,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0xf0,0xff,0x00,0x00, /* 97 a */
|
0x00, 0x00, 0x3e, 0x66, 0x66, 0x66, 0x3f, 0x00, /* 97 a */
|
||||||
0x3c,0x00,0x3c,0x00,0xfc,0x0f,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0xfc,0x0f,0x00,0x00, /* 98 b */
|
0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x7c, 0x00, /* 98 b */
|
||||||
0x00,0x00,0x00,0x00,0xf0,0x0f,0x3c,0x3c,0x3c,0x00,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 99 c */
|
0x00, 0x00, 0x3c, 0x66, 0x60, 0x66, 0x3c, 0x00, /* 99 c */
|
||||||
0x00,0x3c,0x00,0x3c,0xf0,0x3f,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0xf0,0x3f,0x00,0x00, /* 100 d */
|
0x06, 0x06, 0x3e, 0x66, 0x66, 0x66, 0x3e, 0x00, /* 100 d */
|
||||||
0x00,0x00,0x00,0x00,0xf0,0x0f,0x3c,0x3c,0xfc,0x3f,0x3c,0x00,0xf0,0x0f,0x00,0x00, /* 101 e */
|
0x00, 0x00, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, /* 101 e */
|
||||||
0xc0,0x0f,0xf0,0x30,0xf0,0x00,0xfc,0x0f,0xf0,0x00,0xf0,0x00,0xf0,0x00,0x00,0x00, /* 102 f */
|
0x1c, 0x32, 0x30, 0x7c, 0x30, 0x30, 0x30, 0x00, /* 102 f */
|
||||||
0x00,0x00,0x00,0x00,0xf0,0x3f,0x3c,0x3c,0x3c,0x3c,0xc0,0x3f,0x3c,0x3c,0xf0,0x0f, /* 103 g */
|
0x00, 0x00, 0x3e, 0x66, 0x66, 0x1e, 0x66, 0x3c, /* 103 g */
|
||||||
0x3c,0x00,0x3c,0x00,0xfc,0x0f,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x00,0x00, /* 104 h */
|
0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x00, /* 104 h */
|
||||||
0xc0,0x03,0x00,0x00,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x00, /* 105 i */
|
0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, /* 105 i */
|
||||||
0x00,0x3c,0x00,0x00,0x00,0x3c,0x00,0x3c,0x00,0x3c,0x00,0x3c,0x3c,0x3c,0xf0,0x0f, /* 106 j */
|
0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x66, 0x3c, /* 106 j */
|
||||||
0x3c,0x00,0x3c,0x00,0x3c,0x3c,0x3c,0x0f,0xfc,0x00,0x3c,0x0f,0x3c,0x3c,0x00,0x00, /* 107 k */
|
0x60, 0x60, 0x66, 0x6c, 0x70, 0x6c, 0x66, 0x00, /* 107 k */
|
||||||
0xf0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xf0,0x0f,0x00,0x00, /* 108 l */
|
0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, /* 108 l */
|
||||||
0x00,0x00,0x00,0x00,0xfc,0x3c,0x3c,0xf3,0x3c,0xf3,0x3c,0xf3,0x3c,0xf3,0x00,0x00, /* 109 m */
|
0x00, 0x00, 0x76, 0x6b, 0x6b, 0x6b, 0x6b, 0x00, /* 109 m */
|
||||||
0x00,0x00,0x00,0x00,0xfc,0x0f,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x00,0x00, /* 110 n */
|
0x00, 0x00, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x00, /* 110 n */
|
||||||
0x00,0x00,0x00,0x00,0xf0,0x0f,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 111 o */
|
0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x00, /* 111 o */
|
||||||
0x00,0x00,0x00,0x00,0xfc,0x0f,0x3c,0x3c,0x3c,0x3c,0xfc,0x0f,0x3c,0x00,0x3c,0x00, /* 112 p */
|
0x00, 0x00, 0x7c, 0x66, 0x66, 0x7c, 0x60, 0x60, /* 112 p */
|
||||||
0x00,0x00,0x00,0x00,0xf0,0x3f,0x3c,0x3c,0x3c,0x3c,0xc0,0x3f,0x00,0x3c,0x00,0x3c, /* 113 q */
|
0x00, 0x00, 0x3e, 0x66, 0x66, 0x1e, 0x06, 0x06, /* 113 q */
|
||||||
0x00,0x00,0x00,0x00,0x3c,0x3f,0xfc,0x00,0x3c,0x00,0x3c,0x00,0x3c,0x00,0x00,0x00, /* 114 r */
|
0x00, 0x00, 0x6e, 0x70, 0x60, 0x60, 0x60, 0x00, /* 114 r */
|
||||||
0x00,0x00,0x00,0x00,0xf0,0x3f,0xfc,0x00,0xf0,0x0f,0x00,0x3f,0xfc,0x0f,0x00,0x00, /* 115 s */
|
0x00, 0x00, 0x3e, 0x70, 0x3c, 0x0e, 0x7c, 0x00, /* 115 s */
|
||||||
0xc0,0x03,0xc0,0x03,0xf0,0x3f,0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x3f,0x00,0x00, /* 116 t */
|
0x18, 0x18, 0x3e, 0x18, 0x18, 0x18, 0x0e, 0x00, /* 116 t */
|
||||||
0x00,0x00,0x00,0x00,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0xf0,0xff,0x00,0x00, /* 117 u */
|
0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3f, 0x00, /* 117 u */
|
||||||
0x00,0x00,0x00,0x00,0x3c,0x3c,0x3c,0x3c,0x30,0x0c,0xf0,0x0f,0xc0,0x03,0x00,0x00, /* 118 v */
|
0x00, 0x00, 0x66, 0x66, 0x24, 0x3c, 0x18, 0x00, /* 118 v */
|
||||||
0x00,0x00,0x00,0x00,0x3c,0xf0,0x3c,0xf3,0x30,0x33,0xf0,0x3f,0xc0,0x0c,0x00,0x00, /* 119 w */
|
0x00, 0x00, 0x63, 0x6b, 0x2a, 0x3e, 0x14, 0x00, /* 119 w */
|
||||||
0x00,0x00,0x00,0x00,0x3c,0x3c,0xf0,0x0f,0xc0,0x03,0xf0,0x0f,0x3c,0x3c,0x00,0x00, /* 120 x */
|
0x00, 0x00, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0x00, /* 120 x */
|
||||||
0x00,0x00,0x00,0x00,0x3c,0x3c,0x3c,0x3c,0xf0,0x0f,0xc0,0x03,0xf0,0x00,0x3c,0x00, /* 121 y */
|
0x00, 0x00, 0x66, 0x66, 0x3c, 0x18, 0x30, 0x60, /* 121 y */
|
||||||
0x00,0x00,0x00,0x00,0xfc,0x3f,0x00,0x0f,0xc0,0x03,0xf0,0x00,0xfc,0x3f,0x00,0x00, /* 122 z */
|
0x00, 0x00, 0x7e, 0x0c, 0x18, 0x30, 0x7e, 0x00, /* 122 z */
|
||||||
0x00,0x0f,0xc0,0x03,0xc0,0x03,0xf0,0x00,0xc0,0x03,0xc0,0x03,0x00,0x0f,0x00,0x00, /* 123 { */
|
0x0c, 0x18, 0x18, 0x30, 0x18, 0x18, 0x0c, 0x00, /* 123 { */
|
||||||
0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x00,0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x00, /* 124 | */
|
0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, /* 124 | */
|
||||||
0xc0,0x03,0x00,0x0f,0x00,0x0f,0x00,0x3c,0x00,0x0f,0x00,0x0f,0xc0,0x03,0x00,0x00, /* 125 } */
|
0x18, 0x0c, 0x0c, 0x06, 0x0c, 0x0c, 0x18, 0x00, /* 125 } */
|
||||||
0xf0,0x30,0xf0,0x0f,0x0c,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 126 ~ */
|
0x32, 0x3c, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, /* 126 ~ */
|
||||||
0x00,0x03,0x00,0x03,0xc0,0x0c,0xc0,0x0c,0x30,0x30,0x30,0x30,0xf0,0x3f,0x00,0x00 /* 127 <20><> */
|
0x08, 0x08, 0x14, 0x14, 0x22, 0x22, 0x3e, 0x00 /* 127 <20><> */
|
||||||
};
|
};
|
||||||
|
|||||||
11
WWTextP.h
11
WWTextP.h
@@ -21,6 +21,17 @@ typedef struct _WWText {
|
|||||||
int base; /* <20><><EFBFBD>Ѥ<EFBFBD><D1A4>륭<EFBFBD><EBA5AD><EFBFBD>饯<EFBFBD><E9A5AF><EFBFBD>Υ١<CEA5><D9A1><EFBFBD> */
|
int base; /* <20><><EFBFBD>Ѥ<EFBFBD><D1A4>륭<EFBFBD><EBA5AD><EFBFBD>饯<EFBFBD><E9A5AF><EFBFBD>Υ١<CEA5><D9A1><EFBFBD> */
|
||||||
|
|
||||||
WWPalette palette;
|
WWPalette palette;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* <20>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>ȥե<C8A5><D5A5><EFBFBD><EFBFBD>Ȥ<EFBFBD>
|
||||||
|
* f = WWDisplay_GetForegroundColor(ww_display);
|
||||||
|
* b = WWDisplay_GetBackgroundColor(ww_display);
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><E8A4B9>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD>뤿<EFBFBD>ᡤ<EFBFBD><E1A1A4><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4>Ӥ˥ӥåȥޥåפԡ<F2A5B3A5><D4A1><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD>롥
|
||||||
|
* <20>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC><EFBFBD>κݤˡ<DDA4><CBA1><EFBFBD><EFBFBD>Τ褦<CEA4>˽<EFBFBD><CBBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
* <20><><EFBFBD>äơ<C3A4><C6A1>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>Ȥν<C8A4><CEBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWCharacter <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>
|
||||||
|
* ̵<><CCB5><EFBFBD>ʤä<CAA4><C3A4>Τǡ<CEA4>WWCharacter <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤳<EFBFBD>ȡ<EFBFBD>
|
||||||
|
* (WWText_PutCharacter() <20><><EFBFBD><EFBFBD>)
|
||||||
|
*/
|
||||||
WWCharacter font[128]; /* <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD> */
|
WWCharacter font[128]; /* <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
|
||||||
} _WWText;
|
} _WWText;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WWTimerP.h"
|
#include "WWTimerP.h"
|
||||||
#include "etc.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
@@ -100,6 +100,8 @@ WWTimer WWTimer_Destroy(WWTimer ww_timer)
|
|||||||
if (ww_timer == NULL)
|
if (ww_timer == NULL)
|
||||||
WonX_Error("WWTimer_Destroy", "Object is not created.");
|
WonX_Error("WWTimer_Destroy", "Object is not created.");
|
||||||
|
|
||||||
|
WWTimer_OFF(ww_timer);
|
||||||
|
|
||||||
free(ww_timer);
|
free(ww_timer);
|
||||||
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|||||||
14
WWTimer.h
14
WWTimer.h
@@ -5,17 +5,21 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "wonx_include/timer.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WWTimer * WWTimer;
|
typedef struct _WWTimer * WWTimer;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "wonx/timer.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
106
WonX.c
106
WonX.c
@@ -1,14 +1,9 @@
|
|||||||
#include "WonXP.h"
|
#include "WonXP.h"
|
||||||
#include "etc.h"
|
#include "etc.h"
|
||||||
|
|
||||||
#include "wonx_include/disp.h"
|
#include "wonx/disp.h"
|
||||||
#include "wonx_include/text.h"
|
#include "wonx/system.h"
|
||||||
#include "wonx_include/system.h"
|
#include "wonx/comm.h"
|
||||||
#include "wonx_include/comm.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/* <20>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD>ץ쥤<D7A5>γ<EFBFBD><CEB3><EFBFBD> */
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
static WonX wonx = NULL;
|
static WonX wonx = NULL;
|
||||||
|
|
||||||
@@ -19,29 +14,78 @@ int WonX_IsCreated(void)
|
|||||||
|
|
||||||
void WonX_Create(void)
|
void WonX_Create(void)
|
||||||
{
|
{
|
||||||
WWScreen screen;
|
if (WonX_IsCreated())
|
||||||
WWPalette palette;
|
WonX_Error("WonX_Create", "WonX has been already created.");
|
||||||
|
|
||||||
wonx = (WonX)malloc(sizeof(_WonX));
|
wonx = (WonX)malloc(sizeof(_WonX));
|
||||||
if (wonx == NULL) WonX_Error("WonX_Create", "Cannot allocate memory.");
|
if (wonx == NULL) WonX_Error("WonX_Create", "Cannot allocate memory.");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WonX <20>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>ϥǥ<CFA5><C7A5><EFBFBD><EFBFBD>ץ쥤<D7A5>Υ<EFBFBD><CEA5>ե<EFBFBD><D5A5>å<EFBFBD><C3A5><EFBFBD><EFBFBD>ʤɤδؿ<CEB4><D8BF><EFBFBD><EFBFBD>ƤӽФ<D3BD><D0A4><EFBFBD><EFBFBD>ᡤ
|
||||||
|
* WonXSystem_Create() <20>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD>ޤ<DEA4><F2A5B9A5><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WonXDisplay_Create() <20><>
|
||||||
|
* WonXDisplay <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD>롥<EFBFBD><EBA1A5><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD>
|
||||||
|
* WonXDisplay_Create() <20><> WonXSystem_Create() <20>θ<EFBFBD><CEB8>˻<EFBFBD><CBBB>äƤ<C3A4><C6A4>äƤϤ<C6A4><CFA4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD>
|
||||||
|
*/
|
||||||
wonx->wonx_display =
|
wonx->wonx_display =
|
||||||
WonXDisplay_Create(LCD_PIXEL_WIDTH * 2, LCD_PIXEL_HEIGHT * 2,
|
WonXDisplay_Create(LCD_PIXEL_WIDTH * 2, LCD_PIXEL_HEIGHT * 2,
|
||||||
LCD_PIXEL_WIDTH, LCD_PIXEL_HEIGHT,
|
LCD_PIXEL_WIDTH, LCD_PIXEL_HEIGHT,
|
||||||
SCREEN_CHAR_WIDTH, SCREEN_CHAR_HEIGHT);
|
SCREEN_CHAR_WIDTH, SCREEN_CHAR_HEIGHT);
|
||||||
screen =
|
|
||||||
WWDisplay_GetScreen(WonXDisplay_GetWWDisplay(wonx->wonx_display), SCREEN2);
|
|
||||||
/* <20>ǥե<C7A5><D5A5><EFBFBD><EFBFBD>ȤΥƥ<CEA5><C6A5><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD>ѥѥ<D1A5><D1A5>åȤ<C3A5>0 */
|
|
||||||
palette =
|
|
||||||
WWDisplay_GetPalette(WonXDisplay_GetWWDisplay(wonx->wonx_display), 0);
|
|
||||||
|
|
||||||
wonx->wonx_text =
|
/*
|
||||||
WonXText_Create(screen, 0, 0, TEXT_SCREEN_WIDTH, TEXT_SCREEN_HEIGHT,
|
* WonXDisplay <20><>Ʊ<EFBFBD>ͤΤ<CDA4><CEA4>Ȥ<EFBFBD> WonXSerialPort <20>Ǥ⾭<C7A4><E2BEAD>Ū<EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD>
|
||||||
palette);
|
* <20><><EFBFBD>뤫<EFBFBD>⤷<EFBFBD><E2A4B7><EFBFBD>ʤ<EFBFBD><CAA4>Τǡ<CEA4> WonXSerialPort_Create() <20>⤤<EFBFBD><E2A4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
* WonXSystem_Create() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
wonx->wonx_serial_port = WonXSerialPort_Create();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WonXSystem_Create() <20>Ǥϥ<C7A4><CFA5><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤬<EFBFBD><EBA4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ƤФ<C6A4><D0A4><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤿<EFBFBD>ᡤ<EFBFBD><E1A1A4><EFBFBD><EFBFBD><EFBFBD>ޤκ<DEA4><CEBA><EFBFBD><EFBFBD>ϰ<EFBFBD><CFB0>ֺǸ<D6BA><C7B8>˹Ԥ<CBB9>
|
||||||
|
* <20>٤<EFBFBD><D9A4>Ǥ<EFBFBD><C7A4>롥<EFBFBD><EBA1A5><EFBFBD>Τ<EFBFBD><CEA4>ᡤWonXSystem_Create() <20>ϰ<EFBFBD><CFB0>ֺǸ<D6BA><C7B8>˹Ԥ<CBB9><D4A4><EFBFBD>
|
||||||
|
* (¾<>Υ<EFBFBD><CEA5>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˥<EFBFBD><CBA5><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD>硤<EFBFBD><E7A1A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>Ȥ<EFBFBD>
|
||||||
|
* <20>ʤäƤ<C3A4><C6A4>ޤ<EFBFBD>)
|
||||||
|
*/
|
||||||
wonx->wonx_system = WonXSystem_Create();
|
wonx->wonx_system = WonXSystem_Create();
|
||||||
|
|
||||||
wonx->wonx_serial_port = WonXSerialPort_Create();
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WonX_Destroy(void)
|
||||||
|
{
|
||||||
|
if (!WonX_IsCreated())
|
||||||
|
WonX_Error("WonX_Destroy", "WonX has not been created yet.");
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WonXSystem <20>ϥ<EFBFBD><CFA5><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʥ<EFBFBD><CAA5>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD>
|
||||||
|
* <20>ƤФ<C6A4><D0A4><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤿<EFBFBD>ᡤ<EFBFBD><E1A1A4><EFBFBD>ֺǽ<D6BA><C7BD>˥<EFBFBD><CBA5><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD>롥
|
||||||
|
* <20><><EFBFBD>Τ<EFBFBD><CEA4>ᡤWonXSystem_Destroy() <20>ϰ<EFBFBD><CFB0>ֺǽ<D6BA><C7BD>˹Ԥ<CBB9><D4A4><EFBFBD>
|
||||||
|
* (¾<>Υ<EFBFBD><CEA5>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˥<EFBFBD><CBA5><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD>硤<EFBFBD><E7A1A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>Ȥ<EFBFBD>
|
||||||
|
* <20>ʤäƤ<C3A4><C6A4>ޤ<EFBFBD>)
|
||||||
|
*/
|
||||||
|
if (wonx->wonx_system)
|
||||||
|
wonx->wonx_system = WonXSystem_Destroy(wonx->wonx_system);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WonXDisplay <20><>Ʊ<EFBFBD>ͤΤ<CDA4><CEA4>Ȥ<EFBFBD> WonXSerialPort <20>Ǥ⾭<C7A4><E2BEAD>Ū<EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD>
|
||||||
|
* <20><><EFBFBD>뤫<EFBFBD>⤷<EFBFBD><E2A4B7><EFBFBD>ʤ<EFBFBD><CAA4>Τǡ<CEA4> WonXSerialPort_Destroy() <20>⤤<EFBFBD><E2A4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
* WonXSystem_Destroy() <20>θ<EFBFBD><CEB8><EFBFBD><EFBFBD>֤<EFBFBD><D6A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
if (wonx->wonx_serial_port)
|
||||||
|
wonx->wonx_serial_port = WonXSerialPort_Destroy(wonx->wonx_serial_port);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* WonX <20>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>ϥǥ<CFA5><C7A5><EFBFBD><EFBFBD>ץ쥤<D7A5>Υ<EFBFBD><CEA5>ե<EFBFBD><D5A5>å<EFBFBD><C3A5><EFBFBD><EFBFBD>ʤɤδؿ<CEB4><D8BF><EFBFBD><EFBFBD>ƤӽФ<D3BD><D0A4><EFBFBD><EFBFBD>ᡤ
|
||||||
|
* WonXDisplay <20><><EFBFBD>õ<C3B5><EEA4B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WonXSystem <20><><EFBFBD>õ<C3B5>ơ<EFBFBD><C6A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD>
|
||||||
|
* ɬ<>פ<EFBFBD><D7A4><EFBFBD><EFBFBD>롥(<28>Ǥʤ<C7A4><CAA4><EFBFBD> WonXDisplay_Destroy() <20>μ¹<CEBC><C2B9><EFBFBD><EFBFBD>˥<EFBFBD><CBA5><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD>
|
||||||
|
* <20>Ȥ<EFBFBD><C8A4>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>Ȥˤʤ<CBA4>)
|
||||||
|
* <20><><EFBFBD>Τ<EFBFBD><CEA4>ᡤWonXDisplay_Destroy() <20><> WonXSystem_Destroy() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
* <20><><EFBFBD>äƤ<C3A4><C6A4>äƤϤ<C6A4><CFA4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD>
|
||||||
|
*/
|
||||||
|
if (wonx->wonx_display)
|
||||||
|
wonx->wonx_display = WonXDisplay_Destroy(wonx->wonx_display);
|
||||||
|
|
||||||
|
free(wonx);
|
||||||
|
wonx = NULL;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -51,11 +95,6 @@ WonXDisplay WonX_GetWonXDisplay(void)
|
|||||||
return (wonx->wonx_display);
|
return (wonx->wonx_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
WonXText WonX_GetWonXText(void)
|
|
||||||
{
|
|
||||||
return (wonx->wonx_text);
|
|
||||||
}
|
|
||||||
|
|
||||||
WonXSystem WonX_GetWonXSystem(void)
|
WonXSystem WonX_GetWonXSystem(void)
|
||||||
{
|
{
|
||||||
return (wonx->wonx_system);
|
return (wonx->wonx_system);
|
||||||
@@ -66,3 +105,22 @@ WonXSerialPort WonX_GetWonXSerialPort(void)
|
|||||||
return (wonx->wonx_serial_port);
|
return (wonx->wonx_serial_port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* <20><><EFBFBD>顼<EFBFBD><E9A1BC><EFBFBD><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
int WonX_Error(char * funcname, char * message)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "error : %s(): %s\n", funcname, message);
|
||||||
|
exit (1);
|
||||||
|
}
|
||||||
|
|
||||||
|
int WonX_Warning(char * funcname, char * message)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "warning : %s(): %s\n", funcname, message);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* End of File. */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|||||||
18
WonX.h
18
WonX.h
@@ -2,19 +2,25 @@
|
|||||||
#define _wonx_h_INCLUDED_
|
#define _wonx_h_INCLUDED_
|
||||||
|
|
||||||
#include "WonXDisplay.h"
|
#include "WonXDisplay.h"
|
||||||
#include "WonXText.h"
|
|
||||||
#include "WonXSystem.h"
|
#include "WonXSystem.h"
|
||||||
#include "WonXSerialPort.h"
|
#include "WonXSerialPort.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/* <20>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD>ץ쥤<D7A5>γ<EFBFBD><CEB3><EFBFBD> */
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
int WonX_IsCreated(void);
|
int WonX_IsCreated(void);
|
||||||
void WonX_Create(void);
|
void WonX_Create(void);
|
||||||
|
void WonX_Destroy(void);
|
||||||
WonXDisplay WonX_GetWonXDisplay(void);
|
WonXDisplay WonX_GetWonXDisplay(void);
|
||||||
WonXText WonX_GetWonXText(void);
|
|
||||||
WonXSystem WonX_GetWonXSystem(void);
|
WonXSystem WonX_GetWonXSystem(void);
|
||||||
WonXSerialPort WonX_GetWonXSerialPort(void);
|
WonXSerialPort WonX_GetWonXSerialPort(void);
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* <20><><EFBFBD>顼<EFBFBD><E9A1BC><EFBFBD><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
int WonX_Error(char * funcname, char * message);
|
||||||
|
int WonX_Warning(char * funcname, char * message);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* End of File. */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WonXDisplayP.h"
|
#include "WonXDisplayP.h"
|
||||||
#include "etc.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
@@ -45,7 +45,28 @@ WonXDisplay WonXDisplay_Create(int x_width, int x_height,
|
|||||||
return (wonx_display);
|
return (wonx_display);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WonXDisplay_Sync(WonXDisplay wonx_display)
|
WonXDisplay WonXDisplay_Destroy(WonXDisplay wonx_display)
|
||||||
|
{
|
||||||
|
XDisplay x_display;
|
||||||
|
WWDisplay ww_display;
|
||||||
|
|
||||||
|
if (wonx_display == NULL)
|
||||||
|
WonX_Error("WonXDisplay_Destroy", "Object is not created.");
|
||||||
|
|
||||||
|
x_display = WonXDisplay_GetXDisplay(wonx_display);
|
||||||
|
if (x_display)
|
||||||
|
WonXDisplay_SetXDisplay(wonx_display, XDisplay_Destroy(x_display));
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(wonx_display);
|
||||||
|
if (ww_display)
|
||||||
|
WonXDisplay_SetWWDisplay(wonx_display, WWDisplay_Destroy(ww_display));
|
||||||
|
|
||||||
|
free(wonx_display);
|
||||||
|
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
int WonXDisplay_PrintData(WonXDisplay wonx_display)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
XDisplay x_display;
|
XDisplay x_display;
|
||||||
@@ -56,19 +77,24 @@ int WonXDisplay_Sync(WonXDisplay wonx_display)
|
|||||||
|
|
||||||
if (XDisplay_GetColorMapPrint(x_display)) {
|
if (XDisplay_GetColorMapPrint(x_display)) {
|
||||||
WWColorMap_PrintData(WWDisplay_GetColorMap(ww_display), stdout);
|
WWColorMap_PrintData(WWDisplay_GetColorMap(ww_display), stdout);
|
||||||
|
fflush(stdout);
|
||||||
XDisplay_SetColorMapPrint(x_display, 0);
|
XDisplay_SetColorMapPrint(x_display, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XDisplay_GetPalettePrint(x_display)) {
|
if (XDisplay_GetPalettePrint(x_display)) {
|
||||||
for (i = 0; i < 16; i++) {
|
for (i = 0; i < 16; i++) {
|
||||||
WWPalette_PrintData(WWDisplay_GetPalette(ww_display, i), stdout);
|
WWPalette_PrintData(WWDisplay_GetPalette(ww_display, i),
|
||||||
|
ww_display, stdout);
|
||||||
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
XDisplay_SetPalettePrint(x_display, 0);
|
XDisplay_SetPalettePrint(x_display, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (XDisplay_GetCharacterPrint(x_display)) {
|
if (XDisplay_GetCharacterPrint(x_display)) {
|
||||||
for (i = 0; i < 512; i++) {
|
for (i = 0; i < 512; i++) {
|
||||||
WWCharacter_PrintData(WWDisplay_GetCharacter(ww_display, i), stdout);
|
WWCharacter_PrintData(WWDisplay_GetCharacter(ww_display, i),
|
||||||
|
ww_display, stdout);
|
||||||
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
XDisplay_SetCharacterPrint(x_display, 0);
|
XDisplay_SetCharacterPrint(x_display, 0);
|
||||||
}
|
}
|
||||||
@@ -76,16 +102,15 @@ int WonXDisplay_Sync(WonXDisplay wonx_display)
|
|||||||
if (XDisplay_GetSpritePrint(x_display)) {
|
if (XDisplay_GetSpritePrint(x_display)) {
|
||||||
for (i = 0; i < 128; i++) {
|
for (i = 0; i < 128; i++) {
|
||||||
WWSprite_PrintData(WWDisplay_GetSprite(ww_display, i), stdout);
|
WWSprite_PrintData(WWDisplay_GetSprite(ww_display, i), stdout);
|
||||||
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
XDisplay_SetSpritePrint(x_display, 0);
|
XDisplay_SetSpritePrint(x_display, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
XDisplay_Sync(x_display);
|
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WonXDisplay_Flush(WonXDisplay wonx_display)
|
int WonXDisplay_DrawLCDWindow(WonXDisplay wonx_display)
|
||||||
{
|
{
|
||||||
XDisplay x_display;
|
XDisplay x_display;
|
||||||
WWDisplay ww_display;
|
WWDisplay ww_display;
|
||||||
@@ -94,12 +119,30 @@ int WonXDisplay_Flush(WonXDisplay wonx_display)
|
|||||||
x_display = WonXDisplay_GetXDisplay(wonx_display);
|
x_display = WonXDisplay_GetXDisplay(wonx_display);
|
||||||
ww_display = WonXDisplay_GetWWDisplay(wonx_display);
|
ww_display = WonXDisplay_GetWWDisplay(wonx_display);
|
||||||
|
|
||||||
if (XDisplay_GetLCDDraw(x_display)) {
|
/* ɽ<><C9BD><EFBFBD><EFBFBD><EFBFBD>٥뤬1<EBA4AC>ʾ<EFBFBD><CABE>ΤȤ<CEA4><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><E8A4B9> */
|
||||||
|
if (XDisplay_GetLCDDrawLevel(x_display) > 0) {
|
||||||
WWDisplay_DrawLCDPanel(ww_display);
|
WWDisplay_DrawLCDPanel(ww_display);
|
||||||
ww_lcd_panel = WWDisplay_GetLCDPanel(ww_display);
|
ww_lcd_panel = WWDisplay_GetLCDPanel(ww_display);
|
||||||
XDisplay_DrawLCDWindow(x_display, ww_lcd_panel);
|
XDisplay_DrawLCDWindow(x_display, ww_display, ww_lcd_panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int WonXDisplay_Sync(WonXDisplay wonx_display)
|
||||||
|
{
|
||||||
|
XDisplay x_display;
|
||||||
|
|
||||||
|
WonXDisplay_PrintData(wonx_display);
|
||||||
|
x_display = WonXDisplay_GetXDisplay(wonx_display);
|
||||||
|
XDisplay_Flush(x_display);
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int WonXDisplay_Flush(WonXDisplay wonx_display)
|
||||||
|
{
|
||||||
|
WonXDisplay_DrawLCDWindow(wonx_display);
|
||||||
WonXDisplay_Sync(wonx_display);
|
WonXDisplay_Sync(wonx_display);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
|
|||||||
@@ -5,20 +5,31 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "XDisplay.h"
|
|
||||||
#include "WWDisplay.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WonXDisplay * WonXDisplay;
|
typedef struct _WonXDisplay * WonXDisplay;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include "XDisplay.h"
|
||||||
|
#include "WWDisplay.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
XDisplay WonXDisplay_GetXDisplay(WonXDisplay wonx_display);
|
XDisplay WonXDisplay_GetXDisplay(WonXDisplay wonx_display);
|
||||||
WWDisplay WonXDisplay_GetWWDisplay(WonXDisplay wonx_display);
|
WWDisplay WonXDisplay_GetWWDisplay(WonXDisplay wonx_display);
|
||||||
WonXDisplay WonXDisplay_Create(int x_width, int x_height,
|
WonXDisplay WonXDisplay_Create(int x_width, int x_height,
|
||||||
int ww_lcd_panel_width, int ww_lcd_panel_height,
|
int ww_lcd_panel_width, int ww_lcd_panel_height,
|
||||||
int ww_screen_width, int ww_screen_height);
|
int ww_screen_width, int ww_screen_height);
|
||||||
|
WonXDisplay WonXDisplay_Destroy(WonXDisplay wonx_display);
|
||||||
|
int WonXDisplay_PrintData(WonXDisplay wonx_display);
|
||||||
|
int WonXDisplay_DrawLCDWindow(WonXDisplay wonx_display);
|
||||||
int WonXDisplay_Sync(WonXDisplay wonx_display);
|
int WonXDisplay_Sync(WonXDisplay wonx_display);
|
||||||
int WonXDisplay_Flush(WonXDisplay wonx_display);
|
int WonXDisplay_Flush(WonXDisplay wonx_display);
|
||||||
|
|
||||||
|
|||||||
1
WonXP.h
1
WonXP.h
@@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
typedef struct _WonX {
|
typedef struct _WonX {
|
||||||
WonXDisplay wonx_display;
|
WonXDisplay wonx_display;
|
||||||
WonXText wonx_text;
|
|
||||||
WonXSystem wonx_system;
|
WonXSystem wonx_system;
|
||||||
WonXSerialPort wonx_serial_port;
|
WonXSerialPort wonx_serial_port;
|
||||||
} _WonX;
|
} _WonX;
|
||||||
|
|||||||
@@ -3,22 +3,29 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WonXSerialPortP.h"
|
#include "WonXSerialPortP.h"
|
||||||
#include "etc.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
WWSerialPort WonXSerialPort_GetWWSerialPort(WonXSerialPort wonx_serial_port)
|
WWSerialPort WonXSerialPort_GetWWSerialPort(WonXSerialPort wonx_sp)
|
||||||
{ return (wonx_serial_port->ww_serial_port); }
|
{ return (wonx_sp->ww_serial_port); }
|
||||||
WWSerialPort WonXSerialPort_SetWWSerialPort(WonXSerialPort wonx_serial_port,
|
WWSerialPort WonXSerialPort_SetWWSerialPort(WonXSerialPort wonx_sp,
|
||||||
WWSerialPort ww_serial_port)
|
WWSerialPort ww_sp)
|
||||||
{ return (wonx_serial_port->ww_serial_port = ww_serial_port); }
|
{ return (wonx_sp->ww_serial_port = ww_sp); }
|
||||||
|
|
||||||
|
UNIXSerialPort WonXSerialPort_GetUNIXSerialPort(WonXSerialPort wonx_sp)
|
||||||
|
{ return (wonx_sp->unix_serial_port); }
|
||||||
|
UNIXSerialPort WonXSerialPort_SetUNIXSerialPort(WonXSerialPort wonx_sp,
|
||||||
|
UNIXSerialPort unix_sp)
|
||||||
|
{ return (wonx_sp->unix_serial_port = unix_sp); }
|
||||||
|
|
||||||
WonXSerialPort WonXSerialPort_Create()
|
WonXSerialPort WonXSerialPort_Create()
|
||||||
{
|
{
|
||||||
WonXSerialPort wonx_serial_port;
|
WonXSerialPort wonx_serial_port;
|
||||||
WWSerialPort ww_serial_port;
|
WWSerialPort ww_serial_port;
|
||||||
|
UNIXSerialPort unix_serial_port;
|
||||||
|
|
||||||
wonx_serial_port = (WonXSerialPort)malloc(sizeof(_WonXSerialPort));
|
wonx_serial_port = (WonXSerialPort)malloc(sizeof(_WonXSerialPort));
|
||||||
if (wonx_serial_port == NULL)
|
if (wonx_serial_port == NULL)
|
||||||
@@ -30,12 +37,19 @@ WonXSerialPort WonXSerialPort_Create()
|
|||||||
"Cannot create WonderWitch serial port.");
|
"Cannot create WonderWitch serial port.");
|
||||||
WonXSerialPort_SetWWSerialPort(wonx_serial_port, ww_serial_port);
|
WonXSerialPort_SetWWSerialPort(wonx_serial_port, ww_serial_port);
|
||||||
|
|
||||||
|
unix_serial_port = UNIXSerialPort_Create();
|
||||||
|
if (unix_serial_port == NULL)
|
||||||
|
WonX_Error("WonXSerialPort_Create",
|
||||||
|
"Cannot create UNIX serial port.");
|
||||||
|
WonXSerialPort_SetUNIXSerialPort(wonx_serial_port, unix_serial_port);
|
||||||
|
|
||||||
return (wonx_serial_port);
|
return (wonx_serial_port);
|
||||||
}
|
}
|
||||||
|
|
||||||
WonXSerialPort WonXSerialPort_Destroy(WonXSerialPort wonx_serial_port)
|
WonXSerialPort WonXSerialPort_Destroy(WonXSerialPort wonx_serial_port)
|
||||||
{
|
{
|
||||||
WWSerialPort ww_serial_port;
|
WWSerialPort ww_serial_port;
|
||||||
|
UNIXSerialPort unix_serial_port;
|
||||||
|
|
||||||
if (wonx_serial_port == NULL)
|
if (wonx_serial_port == NULL)
|
||||||
WonX_Error("WonXSerialPort_Destroy", "Object is not created.");
|
WonX_Error("WonXSerialPort_Destroy", "Object is not created.");
|
||||||
@@ -45,6 +59,11 @@ WonXSerialPort WonXSerialPort_Destroy(WonXSerialPort wonx_serial_port)
|
|||||||
WonXSerialPort_SetWWSerialPort(wonx_serial_port,
|
WonXSerialPort_SetWWSerialPort(wonx_serial_port,
|
||||||
WWSerialPort_Destroy(ww_serial_port));
|
WWSerialPort_Destroy(ww_serial_port));
|
||||||
|
|
||||||
|
unix_serial_port = WonXSerialPort_GetUNIXSerialPort(wonx_serial_port);
|
||||||
|
if (unix_serial_port)
|
||||||
|
WonXSerialPort_SetUNIXSerialPort(wonx_serial_port,
|
||||||
|
UNIXSerialPort_Destroy(unix_serial_port));
|
||||||
|
|
||||||
free(wonx_serial_port);
|
free(wonx_serial_port);
|
||||||
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
|
|||||||
@@ -5,21 +5,30 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WWSerialPort.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WonXSerialPort * WonXSerialPort;
|
typedef struct _WonXSerialPort * WonXSerialPort;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include "WWSerialPort.h"
|
||||||
|
#include "UNIXSerialPort.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
WWSerialPort WonXSerialPort_GetWWSerialPort(WonXSerialPort wonx_serial_port);
|
WWSerialPort WonXSerialPort_GetWWSerialPort(WonXSerialPort wonx_sp);
|
||||||
WWSerialPort WonXSerialPort_SetWWSerialPort(WonXSerialPort wonx_serial_port,
|
WWSerialPort WonXSerialPort_SetWWSerialPort(WonXSerialPort wonx_sp,
|
||||||
WWSerialPort ww_serial_port);
|
WWSerialPort ww_sp);
|
||||||
|
|
||||||
|
UNIXSerialPort WonXSerialPort_GetUNIXSerialPort(WonXSerialPort wonx_sp);
|
||||||
|
UNIXSerialPort WonXSerialPort_SetUNIXSerialPort(WonXSerialPort wonx_sp,
|
||||||
|
UNIXSerialPort unix_sp);
|
||||||
|
|
||||||
WonXSerialPort WonXSerialPort_Create();
|
WonXSerialPort WonXSerialPort_Create();
|
||||||
WonXSerialPort WonXSerialPort_Destroy(WonXSerialPort wonx_serial_port);
|
WonXSerialPort WonXSerialPort_Destroy(WonXSerialPort wonx_serial_port);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
|
|
||||||
typedef struct _WonXSerialPort {
|
typedef struct _WonXSerialPort {
|
||||||
WWSerialPort ww_serial_port;
|
WWSerialPort ww_serial_port;
|
||||||
|
UNIXSerialPort unix_serial_port;
|
||||||
} _WonXSerialPort;
|
} _WonXSerialPort;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
52
WonXSystem.c
52
WonXSystem.c
@@ -5,7 +5,7 @@
|
|||||||
#include "wonx_configure.h"
|
#include "wonx_configure.h"
|
||||||
|
|
||||||
#include "WonXSystemP.h"
|
#include "WonXSystemP.h"
|
||||||
#include "etc.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
@@ -47,9 +47,24 @@ static int WonXTimer_Callback(WonXSystem wonx_system)
|
|||||||
{
|
{
|
||||||
WWTimer ww_timer;
|
WWTimer ww_timer;
|
||||||
WWInterrupt ww_interrupt;
|
WWInterrupt ww_interrupt;
|
||||||
|
WonXDisplay wonx_display;
|
||||||
|
XDisplay x_display;
|
||||||
|
WonXSerialPort wonx_serial_port;
|
||||||
|
WWSerialPort ww_serial_port;
|
||||||
|
UNIXSerialPort unix_serial_port;
|
||||||
|
|
||||||
|
unsigned int old_key;
|
||||||
|
unsigned int new_key;
|
||||||
|
|
||||||
ww_interrupt = WonXSystem_GetWWInterrupt(wonx_system);
|
ww_interrupt = WonXSystem_GetWWInterrupt(wonx_system);
|
||||||
|
|
||||||
|
wonx_display = WonX_GetWonXDisplay();
|
||||||
|
x_display = WonXDisplay_GetXDisplay(wonx_display);
|
||||||
|
|
||||||
|
wonx_serial_port = WonX_GetWonXSerialPort();
|
||||||
|
ww_serial_port = WonXSerialPort_GetWWSerialPort(wonx_serial_port);
|
||||||
|
unix_serial_port = WonXSerialPort_GetUNIXSerialPort(wonx_serial_port);
|
||||||
|
|
||||||
ww_timer = WonXSystem_GetWWVBlankTimer(wonx_system);
|
ww_timer = WonXSystem_GetWWVBlankTimer(wonx_system);
|
||||||
if (WWTimer_IsON(ww_timer)) {
|
if (WWTimer_IsON(ww_timer)) {
|
||||||
if (WWTimer_Count(ww_timer))
|
if (WWTimer_Count(ww_timer))
|
||||||
@@ -68,6 +83,41 @@ static int WonXTimer_Callback(WonXSystem wonx_system)
|
|||||||
WWInterrupt_ExecuteHBlankCountUpCallback(ww_interrupt);
|
WWInterrupt_ExecuteHBlankCountUpCallback(ww_interrupt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϳ<EFBFBD><CFB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*
|
||||||
|
* XDisplay_Flush() <20><>¾<EFBFBD>ΤȤ<CEA4><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƤФ줿<D0A4><ECA4BF><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4>Ȥ<EFBFBD>
|
||||||
|
* <20><><EFBFBD>ܤ<EFBFBD><DCA4>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4>Τǡ<CEA4>XDisplay <20><><EFBFBD>饹<EFBFBD>Τۤ<CEA4><DBA4>dz<EFBFBD><C7B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤν<DFA4><CEBD><EFBFBD><EFBFBD>뤫<F2A4B9A4><EBA4AB>
|
||||||
|
* <20>ե饰<D5A5><E9A5B0>Ω<EFBFBD>Ƥ<EFBFBD><C6A4>褦<EFBFBD>˲<EFBFBD><CBB2>ɤ<EFBFBD><C9A4><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>ͭ<EFBFBD>뤫<EFBFBD>⡥
|
||||||
|
* (<28>̤ξ<CCA4><CEBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD> XDisplay_Flush() <20><><EFBFBD>ƤФ<C6A4><D0A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD>
|
||||||
|
* ȯ<><C8AF><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>ʤäƤ<C3A4><C6A4>ޤ<EFBFBD>)
|
||||||
|
* <20>Ȥꤢ<C8A4><EAA4A2><EFBFBD><EFBFBD><EFBFBD>ϴʰ<CFB4>Ū<EFBFBD>ˤ<EFBFBD><CBA4>Τ褦<CEA4>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>ˤ<EFBFBD><CBA4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
old_key = XDisplay_GetKeyPress(x_display);
|
||||||
|
XDisplay_Flush(x_display);
|
||||||
|
new_key = XDisplay_GetKeyPress(x_display);
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>줿<EFBFBD><ECA4BF><EFBFBD><EFBFBD> */
|
||||||
|
/*
|
||||||
|
* WonderWitch <20>Ǽ¸<C7BC><C2B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤϳ<CBA4><CFB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD>
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>褦<EFBFBD><E8A4A6><EFBFBD>ä<EFBFBD><C3A4>Τǡ<CEA4><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>줿<EFBFBD>Ȥ<EFBFBD><C8A4>Τߥ<CEA4><DFA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>ƤӽФ<D3BD><D0A4><EFBFBD>
|
||||||
|
*/
|
||||||
|
if (new_key & (~old_key)) {
|
||||||
|
WWInterrupt_ExecuteKeyCallback(ww_interrupt);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>ꥢ<EFBFBD><EAA5A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*
|
||||||
|
* <20><><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>ͳ<EFBFBD>dz<EFBFBD><C7B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4>Ȥꤳ<C8A4>ܤ<EFBFBD><DCA4><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD>ͭ<EFBFBD><CDAD><EFBFBD>Τǡ<CEA4>UNIXSerialPort <20><>
|
||||||
|
* <20>ۤ<EFBFBD><DBA4>dz<EFBFBD><C7B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤν<DFA4><CEBD><EFBFBD><EFBFBD>뤫<F2A4B9A4><EBA4AB><EFBFBD>ե饰<D5A5><E9A5B0>Ω<EFBFBD>Ƥ<EFBFBD><C6A4>褦<EFBFBD>˲<EFBFBD><CBB2>ɤ<EFBFBD><C9A4><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>ͭ<EFBFBD>뤫<EFBFBD>⡥
|
||||||
|
* <20>Ȥꤢ<C8A4><EAA4A2><EFBFBD><EFBFBD><EFBFBD>ϴʰ<CFB4>Ū<EFBFBD>ˤ<EFBFBD><CBA4>Τ褦<CEA4>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>ˤ<EFBFBD><CBA4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
if (WWSerialPort_IsOpened(ww_serial_port) &&
|
||||||
|
UNIXSerialPort_IsOpened(unix_serial_port)) {
|
||||||
|
if (UNIXSerialPort_IsDataExisting(unix_serial_port, 0))
|
||||||
|
WWInterrupt_ExecuteReceiveReadyCallback(ww_interrupt);
|
||||||
|
}
|
||||||
|
|
||||||
|
WonXDisplay_PrintData(wonx_display);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
WonXSystem.h
12
WonXSystem.h
@@ -5,16 +5,20 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "WWInterrupt.h"
|
|
||||||
#include "WWTimer.h"
|
|
||||||
#include "UNIXTimer.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
typedef struct _WonXSystem * WonXSystem;
|
typedef struct _WonXSystem * WonXSystem;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include "WWInterrupt.h"
|
||||||
|
#include "WWTimer.h"
|
||||||
|
#include "UNIXTimer.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
55
WonXText.c
55
WonXText.c
@@ -1,55 +0,0 @@
|
|||||||
/*****************************************************************************/
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
#include "WonXTextP.h"
|
|
||||||
#include "etc.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
WWText WonXText_GetWWText(WonXText wonx_text)
|
|
||||||
{ return (wonx_text->ww_text); }
|
|
||||||
WWText WonXText_SetWWText(WonXText wonx_text, WWText ww_text)
|
|
||||||
{ return (wonx_text->ww_text = ww_text); }
|
|
||||||
|
|
||||||
WonXText WonXText_Create(WWScreen screen, int x, int y, int width, int height,
|
|
||||||
WWPalette palette)
|
|
||||||
{
|
|
||||||
WonXText wonx_text;
|
|
||||||
WWText ww_text;
|
|
||||||
|
|
||||||
wonx_text = (WonXText)malloc(sizeof(_WonXText));
|
|
||||||
if (wonx_text == NULL)
|
|
||||||
WonX_Error("WonXText_Create", "Cannot allocate memory.");
|
|
||||||
|
|
||||||
ww_text = WWText_Create(screen, x, y, width, height, palette);
|
|
||||||
if (ww_text == NULL)
|
|
||||||
WonX_Error("WonXText_Create", "Cannot create WonderWitch text.");
|
|
||||||
WonXText_SetWWText(wonx_text, ww_text);
|
|
||||||
|
|
||||||
return (wonx_text);
|
|
||||||
}
|
|
||||||
|
|
||||||
WonXText WonXText_Destroy(WonXText wonx_text)
|
|
||||||
{
|
|
||||||
if (wonx_text == NULL)
|
|
||||||
WonX_Error("WonXText_Destroy", "Object is not created.");
|
|
||||||
|
|
||||||
if (WonXText_GetWWText(wonx_text))
|
|
||||||
WonXText_SetWWText(wonx_text,
|
|
||||||
WWText_Destroy(WonXText_GetWWText(wonx_text)));
|
|
||||||
|
|
||||||
free(wonx_text);
|
|
||||||
|
|
||||||
return (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
|
||||||
/*****************************************************************************/
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
/* End of File. */
|
|
||||||
/*****************************************************************************/
|
|
||||||
17
Wonx2WonX.pl
17
Wonx2WonX.pl
@@ -1,17 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
|
|
||||||
while ($filename = shift(@ARGV)) {
|
|
||||||
open(RFILE, "< $filename");
|
|
||||||
open(WFILE, "> $filename.tmp");
|
|
||||||
while (<RFILE>) {
|
|
||||||
if (/Wonx/) {
|
|
||||||
print $_;
|
|
||||||
s/Wonx/WonX/g;
|
|
||||||
print $_;
|
|
||||||
}
|
|
||||||
print WFILE $_;
|
|
||||||
}
|
|
||||||
close(RFILE);
|
|
||||||
close(WFILE);
|
|
||||||
system("mv $filename.tmp $filename");
|
|
||||||
}
|
|
||||||
743
XColorGC.c
Normal file
743
XColorGC.c
Normal file
@@ -0,0 +1,743 @@
|
|||||||
|
/*****************************************************************************/
|
||||||
|
/* XColorGC GC<47>ȿ<EFBFBD><C8BF>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䤤<EFBFBD><E4A4A4><EFBFBD>碌<EFBFBD>ѤΥ饤<CEA5>֥<EFBFBD><D6A5><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include "XColorGCP.h"
|
||||||
|
|
||||||
|
#include "WonX.h"
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* XColorGCInstance <20><>Ϣ */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static XColorGCInstance XColorGCInstance_Create(XDisplay x_display,
|
||||||
|
XColor color)
|
||||||
|
{
|
||||||
|
XColorGCInstance instance;
|
||||||
|
|
||||||
|
instance = (XColorGCInstance)malloc(sizeof(_XColorGCInstance));
|
||||||
|
if (instance == NULL)
|
||||||
|
WonX_Error("XColorGCInstance_Create", "Cannot allocate memory");
|
||||||
|
|
||||||
|
instance->x_display = x_display;
|
||||||
|
instance->color = color;
|
||||||
|
|
||||||
|
XAllocColor(XDisplay_GetDisplay(instance->x_display),
|
||||||
|
XDisplay_GetColormap(instance->x_display),
|
||||||
|
&(instance->color));
|
||||||
|
|
||||||
|
/* XAllocColor <20><> instance->color.red <20>ʤɤ<CAA4><C9A4><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>Ѥ<EFBFBD><D1A4>äƤ<C3A4><C6A4>ޤ<EFBFBD><DEA4>Τǡ<CEA4> */
|
||||||
|
/* <20><><EFBFBD>Ȥ<EFBFBD><C8A4>᤹<EFBFBD><E1A4B9><EFBFBD>Ǥʤ<C7A4><CAA4>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>Ȥ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RGB<47>ͤǸ<CDA4><C7B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ⡤<C6A4><E2A1A4><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD> */
|
||||||
|
/* <20><><EFBFBD>ᤵ<EFBFBD><E1A4B5><EFBFBD>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><C7A4>ʤ<EFBFBD><CAA4>Τǡ<CEA4><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD><C2B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̣<EFBFBD><CCA3>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4> */
|
||||||
|
/* <20><><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||||
|
instance->color.red = color.red;
|
||||||
|
instance->color.green = color.green;
|
||||||
|
instance->color.blue = color.blue;
|
||||||
|
|
||||||
|
instance->gc = XDisplay_CreateGC(instance->x_display);
|
||||||
|
|
||||||
|
XSetForeground(XDisplay_GetDisplay(instance->x_display), instance->gc,
|
||||||
|
instance->color.pixel);
|
||||||
|
XSetBackground(XDisplay_GetDisplay(instance->x_display), instance->gc,
|
||||||
|
instance->color.pixel);
|
||||||
|
|
||||||
|
return (instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static XColorGCInstance XColorGCInstance_Destroy(XColorGCInstance instance)
|
||||||
|
{
|
||||||
|
unsigned long pixel;
|
||||||
|
|
||||||
|
if (instance == NULL) return (NULL);
|
||||||
|
if (instance->gc) XDisplay_DestroyGC(instance->x_display, instance->gc);
|
||||||
|
pixel = instance->color.pixel;
|
||||||
|
XFreeColors(XDisplay_GetDisplay(instance->x_display),
|
||||||
|
XDisplay_GetColormap(instance->x_display),
|
||||||
|
&pixel, 1, 0);
|
||||||
|
free(instance);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* XColorGCList <20><>Ϣ */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static XColorGCList XColorGCList_Create(XDisplay x_display, int studying_flag)
|
||||||
|
{
|
||||||
|
XColorGCList list;
|
||||||
|
|
||||||
|
list = (XColorGCList)malloc(sizeof(_XColorGCList));
|
||||||
|
if (list == NULL) WonX_Error("XColorGCList_Create", "Cannot allocate memory");
|
||||||
|
|
||||||
|
list->x_display = x_display;
|
||||||
|
list->studying_flag = studying_flag;
|
||||||
|
list->list = ObjList_Create();
|
||||||
|
|
||||||
|
return (list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static XColorGCList XColorGCList_Destroy(XColorGCList list)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
|
||||||
|
if (list->list) ObjList_Destroy(list->list);
|
||||||
|
|
||||||
|
free(list);
|
||||||
|
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* XColorGCList <20><><EFBFBD>Ǥ<EFBFBD> XColorGCInstance <20>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD>Ӵؿ<D3B4> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static int XColorGCInstance_CmpToColor(XColorGCInstance gci, XColor color)
|
||||||
|
{
|
||||||
|
if (gci->color.red > color.red ) return ( 1);
|
||||||
|
if (gci->color.red < color.red ) return (-1);
|
||||||
|
if (gci->color.green > color.green) return ( 1);
|
||||||
|
if (gci->color.green < color.green) return (-1);
|
||||||
|
if (gci->color.blue > color.blue ) return ( 1);
|
||||||
|
if (gci->color.blue < color.blue ) return (-1);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20>ꥹ<EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD> XColorGCInstance <20><><EFBFBD><EFBFBD><EFBFBD>롥 */
|
||||||
|
/* GC <20>μ<EFBFBD><CEBC><EFBFBD><EFBFBD><EFBFBD><D7B5><EFBFBD><EFBFBD>Ф<EFBFBD><D0A4>ơ<EFBFBD>GC <20>Υꥹ<CEA5>Ȥ<C8A4><F2B8A1BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD> */
|
||||||
|
/* ¸<>ߤ<EFBFBD><DFA4>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤϡ<CBA4><CFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥꥹ<C6A5>Ȥ<EFBFBD><C8A4>ɲä<C9B2><C3A4>롥 */
|
||||||
|
/* (<28><><EFBFBD><EFBFBD> RGB <20>ͤǥ<CDA4><C7A5><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>줿<EFBFBD><ECA4BF><EFBFBD>֤<EFBFBD><D6A4>ɲä<C9B2><C3A4><EFBFBD>) */
|
||||||
|
/* <20><><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ʤΤǡ<CEA4>O(n^2)<29><><EFBFBD>٤<EFBFBD><D9A4>ʤ롥 */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static XColorGCInstance XColorGCList_GetXColorGCInstance(XColorGCList list,
|
||||||
|
XColor color)
|
||||||
|
{
|
||||||
|
XColorGCInstance instance;
|
||||||
|
ObjListData current;
|
||||||
|
int cmp;
|
||||||
|
|
||||||
|
for (current = ObjList_GetStart(list->list);
|
||||||
|
!ObjList_IsEndEdge(list->list, current);
|
||||||
|
current = ObjListData_GetNext(current)) {
|
||||||
|
|
||||||
|
instance = (XColorGCInstance)ObjListData_GetObj(current);
|
||||||
|
cmp = XColorGCInstance_CmpToColor(instance, color);
|
||||||
|
|
||||||
|
if (cmp == 0) { /* <20><><EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD> */
|
||||||
|
#ifdef HIT_LIST
|
||||||
|
fprintf(stderr, "S");
|
||||||
|
#endif
|
||||||
|
if (list->studying_flag) ObjList_MoveObjToStart(list->list, current);
|
||||||
|
return (instance);
|
||||||
|
} else if (cmp > 0) {
|
||||||
|
if (!list->studying_flag) break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥꥹ<C6A5>Ȥ<EFBFBD><C8A4>ɲä<C9B2><C3A4><EFBFBD> */
|
||||||
|
instance = XColorGCInstance_Create(list->x_display, color);
|
||||||
|
|
||||||
|
if (list->studying_flag)
|
||||||
|
ObjList_InsertObjToStart(list->list, instance,
|
||||||
|
(ObjDestructor)XColorGCInstance_Destroy);
|
||||||
|
else
|
||||||
|
ObjList_InsertObjToPrev(list->list, current, instance,
|
||||||
|
(ObjDestructor)XColorGCInstance_Destroy);
|
||||||
|
|
||||||
|
#ifdef HIT_LIST
|
||||||
|
fprintf(stderr, "A");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return (instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* XColorGCCache <20><>Ϣ */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD>ѥХåե<C3A5> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static XColorGCCacheBuffer XColorGCCacheBuffer_Create(XColorGCInstance instance)
|
||||||
|
{
|
||||||
|
XColorGCCacheBuffer buffer;
|
||||||
|
buffer = (XColorGCCacheBuffer)malloc(sizeof(_XColorGCCacheBuffer));
|
||||||
|
if (buffer == NULL) WonX_Error("XColorGCCacheBuffer_Create",
|
||||||
|
"Cannot allocate memory.");
|
||||||
|
buffer->instance = instance;
|
||||||
|
return (buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
static XColorGCCacheBuffer XColorGCCacheBuffer_Destroy(XColorGCCacheBuffer buffer)
|
||||||
|
{
|
||||||
|
if (buffer == NULL) return (NULL);
|
||||||
|
free(buffer);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static XColorGCCache XColorGCCache_Create(XColorGCList color_gc_list, int size)
|
||||||
|
{
|
||||||
|
XColorGCCache cache;
|
||||||
|
|
||||||
|
cache = (XColorGCCache)malloc(sizeof(_XColorGCCache));
|
||||||
|
if (cache == NULL) WonX_Error("XColorGCCache_Create",
|
||||||
|
"Cannot allocate memory.");
|
||||||
|
|
||||||
|
cache->size = size;
|
||||||
|
cache->color_gc_list = color_gc_list;
|
||||||
|
cache->buffer_list = ObjList_Create();
|
||||||
|
|
||||||
|
return (cache);
|
||||||
|
}
|
||||||
|
|
||||||
|
static XColorGCCache XColorGCCache_Destroy(XColorGCCache cache)
|
||||||
|
{
|
||||||
|
if (cache == NULL) return (NULL);
|
||||||
|
|
||||||
|
if (cache->buffer_list) ObjList_Destroy(cache->buffer_list);
|
||||||
|
free(cache);
|
||||||
|
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5>夫<EFBFBD><E5A4AB> XColorGCInstance <20><><EFBFBD><EFBFBD><EFBFBD>롥 */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static XColorGCInstance XColorGCCache_GetXColorGCInstance(XColorGCCache cache,
|
||||||
|
XColor color)
|
||||||
|
{
|
||||||
|
ObjListData current;
|
||||||
|
XColorGCCacheBuffer buffer;
|
||||||
|
XColorGCInstance instance;
|
||||||
|
int cmp;
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
for (current = ObjList_GetStart(cache->buffer_list);
|
||||||
|
!ObjList_IsEndEdge(cache->buffer_list, current);
|
||||||
|
current = ObjListData_GetNext(current)) {
|
||||||
|
|
||||||
|
buffer = (XColorGCCacheBuffer)ObjListData_GetObj(current);
|
||||||
|
cmp = XColorGCInstance_CmpToColor(buffer->instance, color);
|
||||||
|
|
||||||
|
if (cmp == 0) { /* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD><CBB8>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
#ifdef HIT_CACHE
|
||||||
|
fprintf(stderr, "H"); /* Hit! */
|
||||||
|
#endif
|
||||||
|
ObjList_MoveObjToStart(cache->buffer_list, current);
|
||||||
|
return (buffer->instance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD><CBB8>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
|
||||||
|
/* <20>ꥹ<EFBFBD>Ȥ<EFBFBD><C8A4>鸡<EFBFBD><E9B8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
instance = XColorGCList_GetXColorGCInstance(cache->color_gc_list, color);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲä<C9B2><C3A4><EFBFBD> */
|
||||||
|
if (ObjList_GetLength(cache->buffer_list) < cache->size) {
|
||||||
|
buffer = XColorGCCacheBuffer_Create(instance);
|
||||||
|
ObjList_InsertObjToStart(cache->buffer_list, buffer,
|
||||||
|
(ObjDestructor)XColorGCCacheBuffer_Destroy);
|
||||||
|
} else {
|
||||||
|
current = ObjList_GetEnd(cache->buffer_list);
|
||||||
|
buffer = (XColorGCCacheBuffer)ObjListData_GetObj(current);
|
||||||
|
buffer->instance = instance;
|
||||||
|
ObjList_MoveObjToStart(cache->buffer_list, current);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HIT_CACHE
|
||||||
|
fprintf(stderr, "F"); /* False! */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return (instance);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* XColorGCHash <20><>Ϣ */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
static XColorGCHash XColorGCHash_Create(XDisplay x_display,
|
||||||
|
int studying_flag,
|
||||||
|
int cache_flag,
|
||||||
|
int cache_size,
|
||||||
|
int hash_number)
|
||||||
|
{
|
||||||
|
XColorGCHash hash;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
hash = (XColorGCHash)malloc(sizeof(_XColorGCHash));
|
||||||
|
if (hash == NULL)
|
||||||
|
WonX_Error("XColorGCHash_Create", "Cannot allocate memory.");
|
||||||
|
|
||||||
|
hash->number = hash_number;
|
||||||
|
hash->cache_flag = cache_flag;
|
||||||
|
|
||||||
|
if (cache_flag) {
|
||||||
|
hash->color_gc_cache =
|
||||||
|
(XColorGCCache *)malloc(sizeof(XColorGCCache) * hash->number);
|
||||||
|
if (hash->color_gc_cache == NULL)
|
||||||
|
WonX_Error("XColorGCHash_Create", "Cannot allocate memory.");
|
||||||
|
} else {
|
||||||
|
hash->color_gc_cache = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
hash->color_gc_list =
|
||||||
|
(XColorGCList *)malloc(sizeof(XColorGCList) * hash->number);
|
||||||
|
if (hash->color_gc_list == NULL)
|
||||||
|
WonX_Error("XColorGCHash_Create", "Cannot allocate memory.");
|
||||||
|
|
||||||
|
for (i = 0; i < hash->number; i++) {
|
||||||
|
hash->color_gc_list[i] = XColorGCList_Create(x_display, studying_flag);
|
||||||
|
if (cache_flag) {
|
||||||
|
hash->color_gc_cache[i] = XColorGCCache_Create(hash->color_gc_list[i],
|
||||||
|
cache_size);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
static XColorGCHash XColorGCHash_Destroy(XColorGCHash hash)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (hash == NULL) return (NULL);
|
||||||
|
|
||||||
|
if (hash->color_gc_cache) {
|
||||||
|
for (i = 0; i < hash->number; i++) {
|
||||||
|
if (hash->color_gc_cache[i])
|
||||||
|
XColorGCCache_Destroy(hash->color_gc_cache[i]);
|
||||||
|
}
|
||||||
|
free(hash->color_gc_cache);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hash->color_gc_list) {
|
||||||
|
for (i = 0; i < hash->number; i++) {
|
||||||
|
if (hash->color_gc_list[i])
|
||||||
|
XColorGCList_Destroy(hash->color_gc_list[i]);
|
||||||
|
}
|
||||||
|
free(hash->color_gc_list);
|
||||||
|
}
|
||||||
|
|
||||||
|
free(hash);
|
||||||
|
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void XColorGCHash_OutputHashStatus(XColorGCHash hash)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
printf ("\nHash :");
|
||||||
|
for (i = 0; i < hash->number; i++) {
|
||||||
|
printf("%d ", ObjList_GetLength(hash->color_gc_list[i]->list));
|
||||||
|
}
|
||||||
|
printf ("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20>ϥå<CFA5><C3A5><EFBFBD><EFBFBD>ؿ<EFBFBD> */
|
||||||
|
/* <20><><EFBFBD><EFBFBD><F2B8BABF><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>硤<EFBFBD><E7A1A4><EFBFBD><EFBFBD><EFBFBD>ΰ<EFBFBD><CEB0>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤ˻<CBA4><CBBB>Ѥ<EFBFBD><D1A4>줿<EFBFBD>ꤷ<EFBFBD>ʤ<EFBFBD><CAA4>褦<EFBFBD><E8A4A6><EFBFBD><EFBFBD><EFBFBD>ա<EFBFBD> */
|
||||||
|
/* (<28><><EFBFBD>Ȥ<EFBFBD><C8A4>С<EFBFBD> */
|
||||||
|
/* ((int)color.red*3 + (int)color.green*2 + (int)color.blue) % hash->number */
|
||||||
|
/* <20>Τ褦<CEA4>ʥϥå<CFA5><C3A5><EFBFBD><EFBFBD>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>ȡ<EFBFBD>16<31><36>Ĵ<EFBFBD>˸<EFBFBD><CBB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ˡ<EFBFBD>4096 <20><><EFBFBD>ܿ<EFBFBD><DCBF>ΰ<EFBFBD><CEB0>֤<EFBFBD><D6A4><EFBFBD> */
|
||||||
|
/* <20><><EFBFBD>ˤ˻<CBA4><CBBB>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static int HashFunction(XColorGCHash hash, XColor color)
|
||||||
|
{
|
||||||
|
return ((
|
||||||
|
(((int)color.red) / 3000) * 11 +
|
||||||
|
(((int)color.green) % 3000) / 7 +
|
||||||
|
(((int)color.blue) % 1000) / 3
|
||||||
|
) % hash->number);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20>ϥå<CFA5><C3A5>夫<EFBFBD><E5A4AB> XColorGCInstance <20><><EFBFBD><EFBFBD><EFBFBD>롥 */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static XColorGCInstance XColorGCHash_GetXColorGCInstance(XColorGCHash hash,
|
||||||
|
XColor color)
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
|
||||||
|
n = HashFunction(hash, color);
|
||||||
|
|
||||||
|
if (hash->cache_flag)
|
||||||
|
return (XColorGCCache_GetXColorGCInstance(hash->color_gc_cache[n], color));
|
||||||
|
else
|
||||||
|
return (XColorGCList_GetXColorGCInstance(hash->color_gc_list[n], color));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* ColorName <20><>Ϣ */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static ColorName ColorName_Create(XDisplay x_display, char * name)
|
||||||
|
{
|
||||||
|
ColorName color_name;
|
||||||
|
|
||||||
|
color_name = (ColorName)malloc(sizeof(_ColorName));
|
||||||
|
if (color_name == NULL)
|
||||||
|
WonX_Error("ColorName_Create", "Cannot allocate memory");
|
||||||
|
|
||||||
|
color_name->name = malloc(sizeof(char) * (strlen(name) + 1));
|
||||||
|
if (color_name->name == NULL)
|
||||||
|
WonX_Error("ColorName_Create", "Cannot allocate memory");
|
||||||
|
|
||||||
|
strcpy(color_name->name, name);
|
||||||
|
|
||||||
|
XParseColor(XDisplay_GetDisplay(x_display),
|
||||||
|
XDisplay_GetColormap(x_display),
|
||||||
|
color_name->name, &(color_name->color));
|
||||||
|
|
||||||
|
return (color_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static ColorName ColorName_Destroy(ColorName color_name)
|
||||||
|
{
|
||||||
|
if (color_name == NULL) return (NULL);
|
||||||
|
if (color_name->name) free(color_name->name);
|
||||||
|
free(color_name);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static ColorNameList ColorNameList_Create(XDisplay x_display)
|
||||||
|
{
|
||||||
|
ColorNameList list;
|
||||||
|
|
||||||
|
list = (ColorNameList)malloc(sizeof(_ColorNameList));
|
||||||
|
if (list == NULL)
|
||||||
|
WonX_Error("ColorNameList_Create", "Cannot allocate memory");
|
||||||
|
|
||||||
|
list->x_display = x_display;
|
||||||
|
list->list = ObjList_Create();
|
||||||
|
|
||||||
|
return (list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static ColorNameList ColorNameList_Destroy(ColorNameList list)
|
||||||
|
{
|
||||||
|
if (list == NULL) return (NULL);
|
||||||
|
if (list->list) ObjList_Destroy(list->list);
|
||||||
|
free(list);
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϳ<EFBFBD><CDBF><EFBFBD><EFBFBD><EFBFBD>줿<EFBFBD><ECA4BF>̾<EFBFBD><CCBE><EFBFBD>顤RGB<47>ͤ<CDA4><F2B8A1BA><EFBFBD><EFBFBD>롥 */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static XColor ColorNameList_GetColor(ColorNameList list, char * name)
|
||||||
|
{
|
||||||
|
ObjListData current;
|
||||||
|
ColorName color_name;
|
||||||
|
|
||||||
|
for (current = ObjList_GetStart(list->list);
|
||||||
|
!ObjList_IsEndEdge(list->list, current);
|
||||||
|
current = ObjListData_GetNext(current)) {
|
||||||
|
color_name = (ColorName)ObjListData_GetObj(current);
|
||||||
|
if (!strcmp(color_name->name, name)) {
|
||||||
|
ObjList_MoveObjToStart(list->list, current);
|
||||||
|
return (color_name->color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
color_name = ColorName_Create(list->x_display, name);
|
||||||
|
if (color_name == NULL)
|
||||||
|
WonX_Error("ColorNameList_GetColor", "Cannot create ColorName");
|
||||||
|
|
||||||
|
ObjList_InsertObjToStart(list->list, color_name,
|
||||||
|
(ObjDestructor)ColorName_Destroy);
|
||||||
|
|
||||||
|
return (color_name->color);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* XColorGC <20><>Ϣ */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
XColorGC XColorGC_Create(XColorGCDatabase database, XColor color)
|
||||||
|
{
|
||||||
|
XColorGC color_gc;
|
||||||
|
|
||||||
|
color_gc = (XColorGC)malloc(sizeof(_XColorGC));
|
||||||
|
|
||||||
|
/* <20>ϥå<CFA5><C3A5>夫<EFBFBD>鿧<EFBFBD><E9BFA7>GC<47><EFBFBD> */
|
||||||
|
color_gc->instance = XColorGCHash_GetXColorGCInstance(database->hash, color);
|
||||||
|
|
||||||
|
return (color_gc);
|
||||||
|
}
|
||||||
|
|
||||||
|
XColorGC XColorGC_CreateFromXColorGC(XColorGCDatabase database, XColorGC c)
|
||||||
|
{
|
||||||
|
XColorGC color_gc;
|
||||||
|
|
||||||
|
color_gc = (XColorGC)malloc(sizeof(_XColorGC));
|
||||||
|
|
||||||
|
color_gc->instance = c->instance;
|
||||||
|
|
||||||
|
return (color_gc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* RGB <20>ͤ<EFBFBD><CDA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롥 */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
XColorGC XColorGC_CreateFromRGB(XColorGCDatabase database,
|
||||||
|
int red, int green, int blue)
|
||||||
|
{
|
||||||
|
XColor color;
|
||||||
|
|
||||||
|
color.red = red;
|
||||||
|
color.green = green;
|
||||||
|
color.blue = blue;
|
||||||
|
color.flags = DoRed | DoGreen | DoBlue;
|
||||||
|
|
||||||
|
return (XColorGC_Create(database, color));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
XColorGC XColorGC_Destroy(XColorGC color_gc)
|
||||||
|
{
|
||||||
|
if (!color_gc) return (NULL);
|
||||||
|
|
||||||
|
free(color_gc);
|
||||||
|
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD>ɤ߹<C9A4><DFB9><EFBFBD><EFBFBD>Ѵؿ<D1B4> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>Ρ<EFBFBD><CEA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥδؿ<CEB4><D8BF><EFBFBD> */
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ζ<EFBFBD>ͭ<EFBFBD><CDAD><EFBFBD><EFBFBD><EFBFBD>ʤߡ<CAA4><DFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5>θ<F3A5B0A4><CEB8>̤<EFBFBD><CCA4>礭<EFBFBD><E7A4AD><EFBFBD>ʤ롥 */
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ɸ<EFBFBD><C9B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͭ<EFBFBD>Ǥ<EFBFBD><C7A4>ʤ<EFBFBD><CAA4>Τǡ<CEA4>̵<EFBFBD>̤<EFBFBD>¿<EFBFBD><C2BF><EFBFBD>ʤ롥 */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static XColor DecreaseColor(XColor color, int gradation)
|
||||||
|
{
|
||||||
|
int div = RGB_MAX_VALUE / gradation + 1;
|
||||||
|
|
||||||
|
color.red /= div;
|
||||||
|
if (color.red >= gradation - 1) color.red = RGB_MAX_VALUE;
|
||||||
|
else color.red *= div;
|
||||||
|
|
||||||
|
color.green /= div;
|
||||||
|
if (color.green >= gradation - 1) color.green = RGB_MAX_VALUE;
|
||||||
|
else color.green *= div;
|
||||||
|
|
||||||
|
color.blue /= div;
|
||||||
|
if (color.blue >= gradation - 1) color.blue = RGB_MAX_VALUE;
|
||||||
|
else color.blue *= div;
|
||||||
|
|
||||||
|
return (color);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD>GC<47>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> name <20><>Ϳ<EFBFBD><CDBF><EFBFBD><EFBFBD><EFBFBD>줿̾<ECA4BF><CCBE><EFBFBD>ο<EFBFBD><CEBF><EFBFBD><F2B8A1BA><EFBFBD><EFBFBD>롥 */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
XColorGC XColorGC_CreateFromCharacters(XColorGCDatabase database, char * name)
|
||||||
|
{
|
||||||
|
XColor color;
|
||||||
|
|
||||||
|
if (!strcmp(name, "none") ||
|
||||||
|
!strcmp(name, "None") ||
|
||||||
|
!strcmp(name, "NONE") ||
|
||||||
|
!strcmp(name, "back") ||
|
||||||
|
!strcmp(name, "Back") ||
|
||||||
|
!strcmp(name, "BACK") ||
|
||||||
|
!strcmp(name, "background") ||
|
||||||
|
!strcmp(name, "Background") ||
|
||||||
|
!strcmp(name, "BACKGROUND")) {
|
||||||
|
if (database->background_color_gc)
|
||||||
|
return (XColorGC_CreateFromXColorGC(database,
|
||||||
|
database->background_color_gc));
|
||||||
|
else
|
||||||
|
#if 1
|
||||||
|
name = "none";
|
||||||
|
#else
|
||||||
|
name = "black";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
color = ColorNameList_GetColor(database->color_name_list, name);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4>ᡤ<EFBFBD><E1A1A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
color = DecreaseColor(color, database->gradation);
|
||||||
|
|
||||||
|
return (XColorGC_Create(database, color));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* XColor <20><>¤<EFBFBD>Τμ<CEA4><CEBC><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
XColor XColorGC_GetColor(XColorGC color_gc)
|
||||||
|
{
|
||||||
|
return (color_gc->instance->color);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤμ<CDA4><CEBC><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
unsigned long XColorGC_GetPixel(XColorGC color_gc)
|
||||||
|
{
|
||||||
|
return (color_gc->instance->color.pixel);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* GC <20>μ<EFBFBD><CEBC><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
GC XColorGC_GetGC(XColorGC color_gc)
|
||||||
|
{
|
||||||
|
return (color_gc->instance->gc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤵<EFBFBD>μ<EFBFBD><CEBC><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
int GetBrightness(XColor color)
|
||||||
|
{
|
||||||
|
long int br;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
br = color.red > color.green ? color.red : color.green;
|
||||||
|
br = br > color.blue ? br : color.blue;
|
||||||
|
br = br * 100 / RGB_MAX_VALUE;
|
||||||
|
#else
|
||||||
|
br = color.red + color.green + color.blue;
|
||||||
|
br = br * 100 / RGB_MAX_VALUE;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (br > 100) br = 100;
|
||||||
|
|
||||||
|
return ((int)br);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* GC <20>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
XColorGCDatabase XColorGCDatabase_Create(XDisplay x_display,
|
||||||
|
int studying_flag,
|
||||||
|
int cache_flag,
|
||||||
|
int cache_size,
|
||||||
|
int hash_number,
|
||||||
|
char * background,
|
||||||
|
int gradation)
|
||||||
|
{
|
||||||
|
XColorGCDatabase database;
|
||||||
|
|
||||||
|
database = (XColorGCDatabase)malloc(sizeof(_XColorGCDatabase));
|
||||||
|
if (database == NULL)
|
||||||
|
WonX_Error("XColorGCDatabase_Create", "Cannot allocate memory.");
|
||||||
|
|
||||||
|
database->x_display = x_display;
|
||||||
|
database->gradation = gradation;
|
||||||
|
|
||||||
|
database->hash = XColorGCHash_Create(database->x_display,
|
||||||
|
studying_flag,
|
||||||
|
cache_flag,
|
||||||
|
cache_size,
|
||||||
|
hash_number);
|
||||||
|
database->color_name_list = ColorNameList_Create(database->x_display);
|
||||||
|
|
||||||
|
/* background <20><> "none" <20>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD><EFBFBD>ư<EFBFBD><EFBFBD><EEA4B9><EFBFBD>褦<EFBFBD>ˡ<EFBFBD> */
|
||||||
|
/* XColorGC_CreateFromCharacters()<29><><EFBFBD>ƤӽФ<D3BD><D0A4><EFBFBD><EFBFBD>ˡ<EFBFBD>NULL <20>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롥 */
|
||||||
|
database->background_color_gc = NULL;
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> database <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƸƤӽФ<D3BD><D0A4>Τǡ<CEA4>ɬ<EFBFBD><C9AC><EFBFBD>Ǹ<EFBFBD><C7B8><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
database->background_color_gc =
|
||||||
|
XColorGC_CreateFromCharacters(database, background);
|
||||||
|
/* <20><><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD> return() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ˤ<EFBFBD><CBA4>뤳<EFBFBD><EBA4B3> */
|
||||||
|
|
||||||
|
return (database);
|
||||||
|
}
|
||||||
|
|
||||||
|
XColorGCDatabase XColorGCDatabase_Destroy(XColorGCDatabase database)
|
||||||
|
{
|
||||||
|
if (database == NULL) return (NULL);
|
||||||
|
|
||||||
|
if (database->background_color_gc)
|
||||||
|
XColorGC_Destroy(database->background_color_gc);
|
||||||
|
|
||||||
|
if (database->color_name_list)
|
||||||
|
ColorNameList_Destroy(database->color_name_list);
|
||||||
|
if (database->hash) XColorGCHash_Destroy(database->hash);
|
||||||
|
free(database);
|
||||||
|
|
||||||
|
return (NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
XColorGC XColorGCDatabase_GetBackgroundXColorGC(XColorGCDatabase database)
|
||||||
|
{
|
||||||
|
return (database->background_color_gc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>塼<EFBFBD>˥<EFBFBD><CBA5><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
void XColorGCDatabase_OutputHashStatus(XColorGCDatabase database)
|
||||||
|
{
|
||||||
|
XColorGCHash_OutputHashStatus(database->hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* End of File */
|
||||||
|
/*****************************************************************************/
|
||||||
98
XColorGC.h
Normal file
98
XColorGC.h
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
/*****************************************************************************/
|
||||||
|
/* XColorGC GC<47>ȿ<EFBFBD><C8BF>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䤤<EFBFBD><E4A4A4><EFBFBD>碌<EFBFBD>ѤΥ饤<CEA5>֥<EFBFBD><D6A5><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef _XColorGC_h_INCLUDED_
|
||||||
|
#define _XColorGC_h_INCLUDED_
|
||||||
|
|
||||||
|
typedef struct _XColorGCDatabase * XColorGCDatabase;
|
||||||
|
typedef struct _XColorGC * XColorGC;
|
||||||
|
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
|
#include "XDisplay.h"
|
||||||
|
#include "Obj.h"
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* XColorGC <20><>Ϣ */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
XColorGC XColorGC_Create(XColorGCDatabase database, XColor color);
|
||||||
|
XColorGC XColorGC_CreateFromXColorGC(XColorGCDatabase database, XColorGC c);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* RGB <20>ͤ<EFBFBD><CDA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롥 */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
XColorGC XColorGC_CreateFromRGB(XColorGCDatabase database,
|
||||||
|
int red, int green, int blue);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
XColorGC XColorGC_Destroy(XColorGC color_gc);
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD>ɤ߹<C9A4><DFB9><EFBFBD><EFBFBD>Ѵؿ<D1B4> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD>GC<47>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> name <20><>Ϳ<EFBFBD><CDBF><EFBFBD><EFBFBD><EFBFBD>줿̾<ECA4BF><CCBE><EFBFBD>ο<EFBFBD><CEBF><EFBFBD><F2B8A1BA><EFBFBD><EFBFBD>롥 */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
XColorGC XColorGC_CreateFromCharacters(XColorGCDatabase database, char * name);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* XColor <20><>¤<EFBFBD>Τμ<CEA4><CEBC><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
XColor XColorGC_GetColor(XColorGC color_gc);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤμ<CDA4><CEBC><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
unsigned long XColorGC_GetPixel(XColorGC color_gc);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* GC <20>μ<EFBFBD><CEBC><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
GC XColorGC_GetGC(XColorGC color_gc);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤵<EFBFBD>μ<EFBFBD><CEBC><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
int GetBrightness(XColor color);
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* GC <20>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
XColorGCDatabase XColorGCDatabase_Create(XDisplay x_display,
|
||||||
|
int studying_flag,
|
||||||
|
int cache_flag,
|
||||||
|
int cache_size,
|
||||||
|
int hash_number,
|
||||||
|
char * background,
|
||||||
|
int gradation);
|
||||||
|
XColorGCDatabase XColorGCDatabase_Destroy(XColorGCDatabase database);
|
||||||
|
XColorGC XColorGCDatabase_GetBackgroundXColorGC(XColorGCDatabase database);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD>塼<EFBFBD>˥<EFBFBD><CBA5><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
void XColorGCDatabase_OutputHashStatus(XColorGCDatabase database);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* End of File */
|
||||||
|
/*****************************************************************************/
|
||||||
148
XColorGCP.h
Normal file
148
XColorGCP.h
Normal file
@@ -0,0 +1,148 @@
|
|||||||
|
/*****************************************************************************/
|
||||||
|
/* XColorGC GC<47>ȿ<EFBFBD><C8BF>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䤤<EFBFBD><E4A4A4><EFBFBD>碌<EFBFBD>ѤΥ饤<CEA5>֥<EFBFBD><D6A5><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#ifndef _XColorGCP_h_INCLUDED_
|
||||||
|
#define _XColorGCP_h_INCLUDED_
|
||||||
|
|
||||||
|
#include "XColorGC.h"
|
||||||
|
|
||||||
|
#define RGB_MAX_VALUE 65535
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* XFireworks <20>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ι<EFBFBD>®<EFBFBD><C2AE><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פʿ<D7A4><CABF><EFBFBD> GC <20>ϡ<EFBFBD><CFA1><EFBFBD>ư<EFBFBD><C6B0><EFBFBD><EFBFBD> */
|
||||||
|
/* <20><><EFBFBD>٤Ƴ<D9A4><C6B3>ݤ<EFBFBD><DDA4><EFBFBD><EFBFBD>ΤǤ<CEA4><C7A4><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD>̤<EFBFBD> X <20><><EFBFBD><EFBFBD><EFBFBD>ФؤΥꥯ<CEA5><EAA5AF><EFBFBD><EFBFBD><EFBFBD>Ȥȥ<C8A4><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD> */
|
||||||
|
/* <20><><EFBFBD>餹<EFBFBD><E9A4B9><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݤ<EFBFBD><DDA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> GC <20>ϥǡ<CFA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/* Ʊ<><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פˤʤä<CAA4><C3A4>Ȥ<EFBFBD><C8A4>ˤϡ<CBA4><CFA1><EFBFBD>ͭ<EFBFBD><CDAD><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ˤ<EFBFBD><CBA4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||||
|
/* (XColorGCDatabase <20>Ϥ<EFBFBD><CFA4>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>饹<EFBFBD>Ǥ<EFBFBD>) */
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD><CBA4>ꡤXAllocColor() <20>ˤ<EFBFBD><CBA4>뿧<EFBFBD><EBBFA7><EFBFBD>䤤<EFBFBD><E4A4A4><EFBFBD>碌<EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤿<EFBFBD>ᡤ */
|
||||||
|
/* <20><>ư<EFBFBD><C6B0><EFBFBD><EFBFBD><EFBFBD>ʤ˹<CAA4>®<EFBFBD>ˤʤ<CBA4><CAA4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||||
|
/* <20>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD><EFBFBD>θ<EFBFBD><CEB8><EFBFBD><EFBFBD>ˤϡ<CBA4><CFA1>ϥå<CFA5><C3A5>塤<EFBFBD><E5A1A4><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5>塤<EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4>뤳<EFBFBD>Ȥ<EFBFBD> */
|
||||||
|
/* <20>Ǥ<EFBFBD><C7A4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20>ʲ<EFBFBD><CAB2><EFBFBD>ͭ<EFBFBD><CDAD><EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD>ȡ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GC<47><43><EFBFBD>ɤ줯<C9A4>餤<EFBFBD><E9A4A4>ͭ<EFBFBD><CDAD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>뤫Ĵ<EBA4AB>٤뤳<D9A4>Ȥ<EFBFBD> */
|
||||||
|
/* <20>Ǥ<EFBFBD><C7A4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* #define HIT_LIST */
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20>ʲ<EFBFBD><CAB2><EFBFBD>ͭ<EFBFBD><CDAD><EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD>Υҥå<D2A5>Ψ<EFBFBD><CEA8>Ĵ<EFBFBD>٤뤳<D9A4>Ȥ<EFBFBD><C8A4>Ǥ<EFBFBD><C7A4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
/* #define HIT_CACHE */
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* GC <20>μ<EFBFBD><CEBC>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>륯<EFBFBD>饹 */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
typedef struct _XColorGCInstance * XColorGCInstance;
|
||||||
|
|
||||||
|
typedef struct _XColorGCInstance {
|
||||||
|
XDisplay x_display;
|
||||||
|
GC gc;
|
||||||
|
XColor color;
|
||||||
|
} _XColorGCInstance;
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* GC <20>μ<EFBFBD><CEBC>ΤΥꥹ<CEA5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>륯<EFBFBD>饹 */
|
||||||
|
/* Ʊ<><C6B1><EFBFBD>ο<EFBFBD><CEBF><EFBFBD>GC<47>϶<EFBFBD>ͭ<EFBFBD><CDAD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᡤGC<47>μ<EFBFBD><CEBC>Τ<EFBFBD><CEA4>ꥹ<EFBFBD>ȤǴ<C8A4><C7B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GC<47>μ<EFBFBD><CEBC><EFBFBD><EFBFBD><EFBFBD><D7B5><EFBFBD> */
|
||||||
|
/* <20>Ф<EFBFBD><D0A4>ơ<EFBFBD>Ŭ<EFBFBD>ڤ<EFBFBD> XColorGCInstance <20><><EFBFBD>֤<EFBFBD><D6A4><EFBFBD> */
|
||||||
|
/* (<28><><EFBFBD>Ǥ<EFBFBD>¸<EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD>Τʤ餽<CAA4><E9A4BD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Create <20><><EFBFBD><EFBFBD>) */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
typedef struct _XColorGCList * XColorGCList;
|
||||||
|
|
||||||
|
typedef struct _XColorGCList { /* GC <20>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
XDisplay x_display;
|
||||||
|
int studying_flag; /* <20>ؽ<EFBFBD><D8BD><EFBFBD>ǽ<EFBFBD><C7BD>ON/OFF<46>Υե饰 */
|
||||||
|
ObjList list; /* XColorGCInstance <20>Υꥹ<CEA5><EAA5B9> */
|
||||||
|
} _XColorGCList;
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
typedef struct _XColorGCCacheBuffer * XColorGCCacheBuffer;
|
||||||
|
typedef struct _XColorGCCache * XColorGCCache;
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD>ѥХåե<C3A5> */
|
||||||
|
typedef struct _XColorGCCacheBuffer {
|
||||||
|
XColorGCInstance instance;
|
||||||
|
} _XColorGCCacheBuffer;
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD> */
|
||||||
|
typedef struct _XColorGCCache {
|
||||||
|
int size; /* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5>奵<EFBFBD><E5A5B5><EFBFBD><EFBFBD> */
|
||||||
|
|
||||||
|
XColorGCList color_gc_list;
|
||||||
|
ObjList buffer_list;
|
||||||
|
} _XColorGCCache;
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* <20>ϥå<CFA5><C3A5><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
typedef struct _XColorGCHash * XColorGCHash;
|
||||||
|
|
||||||
|
typedef struct _XColorGCHash {
|
||||||
|
int number; /* <20>ϥå<CFA5><C3A5><EFBFBD><EFBFBD>θĿ<CEB8> */
|
||||||
|
int cache_flag; /* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>ѡ<EFBFBD>̤<EFBFBD><CCA4><EFBFBD>ѤΥե饰 */
|
||||||
|
XColorGCCache * color_gc_cache;
|
||||||
|
XColorGCList * color_gc_list;
|
||||||
|
} _XColorGCHash;
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD>̾<EFBFBD><CCBE><EFBFBD><EFBFBD>RGB<47>ͤ<EFBFBD><CDA4>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤿<EFBFBD><EBA4BF><EFBFBD>Υ<EFBFBD><CEA5>饹 */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
typedef struct _ColorName * ColorName;
|
||||||
|
typedef struct _ColorNameList * ColorNameList;
|
||||||
|
|
||||||
|
typedef struct _ColorName {
|
||||||
|
char * name;
|
||||||
|
XColor color;
|
||||||
|
} _ColorName;
|
||||||
|
|
||||||
|
typedef struct _ColorNameList {
|
||||||
|
XDisplay x_display;
|
||||||
|
ObjList list; /* ColorName <20>Υꥹ<CEA5><EAA5B9> */
|
||||||
|
} _ColorNameList;
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD> GC <20>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD> */
|
||||||
|
/* GC <20>θ<EFBFBD><CEB8><EFBFBD><EFBFBD>ˤϡ<CBA4><CFA1>ϥå<CFA5><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4>롥 */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
typedef struct _XColorGCDatabase { /* GC <20>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
XDisplay x_display;
|
||||||
|
XColorGCHash hash; /* <20>ϥå<CFA5><C3A5><EFBFBD> */
|
||||||
|
|
||||||
|
ColorNameList color_name_list; /* <20><>̾ <20><> RGB<47>ͤ<EFBFBD><CDA4>Ѵ<EFBFBD><D1B4><EFBFBD> */
|
||||||
|
|
||||||
|
/* <20>طʿ<D8B7><CABF><EFBFBD><EFBFBD><EFBFBD>̾<EFBFBD><CCBE>"none"<22><><EFBFBD><EFBFBD><EFBFBD>ꤹ<EFBFBD><EAA4B9><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ο<EFBFBD><CEBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD>롥 */
|
||||||
|
XColorGC background_color_gc;
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>16<31><36>Ĵ<EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ˤ<EFBFBD>16<31><36><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/* 10<31><30>Ĵ<EFBFBD><C4B4>20<32><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ */
|
||||||
|
int gradation;
|
||||||
|
|
||||||
|
} _XColorGCDatabase;
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* GC <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>륯<EFBFBD>饹 */
|
||||||
|
/* Ʊ<><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> GC <20><><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD>ʤ<EFBFBD><CAA4>Ѥˡ<D1A4>XColorGCList <20><> GC <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD> */
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7B5><EFBFBD><EFBFBD>ˤϡ<CBA4>XColorGCList <20><><EFBFBD><EFBFBD> GC <20><><EFBFBD><EFBFBD><EFBFBD>餦<EFBFBD>褦<EFBFBD>ˤ<EFBFBD><CBA4>롥 */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
typedef struct _XColorGC {
|
||||||
|
XColorGCInstance instance;
|
||||||
|
} _XColorGC;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* End of File */
|
||||||
|
/*****************************************************************************/
|
||||||
482
XDisplay.c
482
XDisplay.c
@@ -9,14 +9,32 @@
|
|||||||
|
|
||||||
#include "XDisplayP.h"
|
#include "XDisplayP.h"
|
||||||
#include "WonX.h"
|
#include "WonX.h"
|
||||||
|
#include "WonXDisplay.h"
|
||||||
#include "etc.h"
|
#include "etc.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
Display * XDisplay_GetDisplay(XDisplay d) { return (d->display); }
|
||||||
|
Colormap XDisplay_GetColormap(XDisplay d) { return (d->colormap); }
|
||||||
|
|
||||||
|
XColorGCDatabase XDisplay_GetColorGCDatabase(XDisplay x_display)
|
||||||
|
{ return (x_display->color_gc_database); }
|
||||||
|
|
||||||
unsigned int XDisplay_GetKeyPress(XDisplay d) { return (d->key_press); }
|
unsigned int XDisplay_GetKeyPress(XDisplay d) { return (d->key_press); }
|
||||||
int XDisplay_GetLCDDraw(XDisplay d) { return (d->lcd_draw); }
|
|
||||||
|
int XDisplay_GetLCDDrawLevel(XDisplay d) { return (d->lcd_draw_level); }
|
||||||
|
int XDisplay_SetLCDDrawLevel(XDisplay d, int level)
|
||||||
|
{
|
||||||
|
d->lcd_draw_level = level;
|
||||||
|
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||||
|
return (d->lcd_draw_level);
|
||||||
|
}
|
||||||
|
int XDisplay_LCDDrawLevelDown(XDisplay d)
|
||||||
|
{ return (XDisplay_SetLCDDrawLevel(d, d->lcd_draw_level - 1)); }
|
||||||
|
int XDisplay_LCDDrawLevelUp( XDisplay d)
|
||||||
|
{ return (XDisplay_SetLCDDrawLevel(d, d->lcd_draw_level + 1)); }
|
||||||
|
|
||||||
int XDisplay_GetColorMapPrint(XDisplay d) {return (d->color_map_print); }
|
int XDisplay_GetColorMapPrint(XDisplay d) {return (d->color_map_print); }
|
||||||
int XDisplay_GetPalettePrint(XDisplay d) {return (d->palette_print); }
|
int XDisplay_GetPalettePrint(XDisplay d) {return (d->palette_print); }
|
||||||
@@ -68,16 +86,16 @@ static void iconify(Widget w, XEvent * event, String * params, Cardinal * num)
|
|||||||
XIconifyWindow(XtDisplay(w), XtWindow(w), DefaultScreen(XtDisplay(w)));
|
XIconifyWindow(XtDisplay(w), XtWindow(w), DefaultScreen(XtDisplay(w)));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sleep_3(Widget w, XEvent * event, String * params, Cardinal * num)
|
static void sleep_10(Widget w, XEvent * event, String * params, Cardinal * num)
|
||||||
{
|
{
|
||||||
time_t old_t;
|
time_t old_t;
|
||||||
time_t t;
|
time_t t;
|
||||||
int i;
|
int i;
|
||||||
/* UNIXTimer.c <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SIGALRM <20><><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>Τǡ<CEA4>sleep() <20>ϻ<EFBFBD><CFBB>ѤǤ<D1A4><C7A4>ʤ<EFBFBD> */
|
/* UNIXTimer.c <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SIGALRM <20><><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>Τǡ<CEA4>sleep() <20>ϻ<EFBFBD><CFBB>ѤǤ<D1A4><C7A4>ʤ<EFBFBD> */
|
||||||
#if 0
|
#if 0
|
||||||
sleep(3);
|
sleep(10);
|
||||||
#else
|
#else
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 10; i++) {
|
||||||
time(&t);
|
time(&t);
|
||||||
old_t = t;
|
old_t = t;
|
||||||
while (t == old_t)
|
while (t == old_t)
|
||||||
@@ -90,20 +108,22 @@ static XtActionsRec actions[] = {
|
|||||||
{"quit", quit},
|
{"quit", quit},
|
||||||
{"wm_protocols_proc", wm_protocols_proc},
|
{"wm_protocols_proc", wm_protocols_proc},
|
||||||
{"iconify", iconify},
|
{"iconify", iconify},
|
||||||
{"pause", sleep_3}
|
{"pause", sleep_10}
|
||||||
};
|
};
|
||||||
|
|
||||||
static char * translations =
|
static char * translations =
|
||||||
"<Message>WM_PROTOCOLS: wm_protocols_proc()\n"
|
"<Message>WM_PROTOCOLS: wm_protocols_proc()\n"
|
||||||
"None<Key>p: pause()\n"
|
"None<Key>F11: pause()\n"
|
||||||
"Ctrl<Key>i: iconify()\n"
|
"Ctrl<Key>i: iconify()\n"
|
||||||
"Ctrl<Key>c: quit()\n"
|
"Ctrl<Key>c: quit()\n"
|
||||||
|
"None<Key>F12: quit()\n"
|
||||||
"None<Key>q: quit()";
|
"None<Key>q: quit()";
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* <20><>̾<EFBFBD><CCBE><EFBFBD><EFBFBD><EFBFBD>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD><CDA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><>̾<EFBFBD><CCBE><EFBFBD><EFBFBD><EFBFBD>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD><CDA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
#ifdef USE_X_FONT
|
||||||
static unsigned long XDisplay_GetPixelFromColorName(XDisplay x_display,
|
static unsigned long XDisplay_GetPixelFromColorName(XDisplay x_display,
|
||||||
char * color_name)
|
char * color_name)
|
||||||
{
|
{
|
||||||
@@ -112,11 +132,27 @@ static unsigned long XDisplay_GetPixelFromColorName(XDisplay x_display,
|
|||||||
&c0, &c1);
|
&c0, &c1);
|
||||||
return (c0.pixel);
|
return (c0.pixel);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* <20><><EFBFBD>٥<EFBFBD><D9A5>ȥϥ<C8A5><CFA5>ɥ<EFBFBD> */
|
/* <20><><EFBFBD>٥<EFBFBD><D9A5>ȥϥ<C8A5><CFA5>ɥ<EFBFBD> */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD><DDA1><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
static void ExposeHandler(Widget w, XtPointer p, XEvent * event,
|
||||||
|
Boolean * dispatch)
|
||||||
|
{
|
||||||
|
XDisplay x_display = (XDisplay)p;
|
||||||
|
|
||||||
|
XCopyArea(x_display->display, x_display->lcd_pixmap,
|
||||||
|
x_display->lcd_window, x_display->copy_gc,
|
||||||
|
0, 0, x_display->width, x_display->height, 0, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>β<EFBFBD><CEB2><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>β<EFBFBD><CEB2><EFBFBD> */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
@@ -135,64 +171,107 @@ static void KeyHandler(Widget w, XtPointer p, XEvent * event,
|
|||||||
switch (key_sym) {
|
switch (key_sym) {
|
||||||
|
|
||||||
/* WonderSwan<61><6E> */
|
/* WonderSwan<61><6E> */
|
||||||
case XK_Up : press = KEY_UP1; break;
|
case XK_Up : press = KEY_UP1; printf("key : Up1 " ); break;
|
||||||
case XK_Right : press = KEY_RIGHT1; break;
|
case XK_Right : press = KEY_RIGHT1; printf("key : Right1 "); break;
|
||||||
case XK_Down : press = KEY_DOWN1; break;
|
case XK_Down : press = KEY_DOWN1; printf("key : Down1 " ); break;
|
||||||
case XK_Left : press = KEY_LEFT1; break;
|
case XK_Left : press = KEY_LEFT1; printf("key : Left1 " ); break;
|
||||||
case XK_i : press = KEY_UP2; break;
|
case XK_i : press = KEY_UP2; printf("key : Up2 " ); break;
|
||||||
case XK_l : press = KEY_RIGHT2; break;
|
case XK_l : press = KEY_RIGHT2; printf("key : Right2 "); break;
|
||||||
case XK_k : press = KEY_DOWN2; break;
|
case XK_k : press = KEY_DOWN2; printf("key : Down2 " ); break;
|
||||||
case XK_j : press = KEY_LEFT2; break;
|
case XK_j : press = KEY_LEFT2; printf("key : Left2 " ); break;
|
||||||
case XK_s : press = KEY_START; break;
|
case XK_s : press = KEY_START; printf("key : Start " ); break;
|
||||||
case XK_space : press = KEY_A; break;
|
case XK_space : press = KEY_A; printf("key : A " ); break;
|
||||||
case XK_Shift_L : press = KEY_B; break;
|
case XK_Shift_L : press = KEY_B; printf("key : B " ); break;
|
||||||
default : press = 0; break;
|
default : press = 0; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (press) {
|
||||||
|
if (event->type == KeyPress) {
|
||||||
|
x_display->key_press |= press;
|
||||||
|
printf("Pressed\n");
|
||||||
|
} else {
|
||||||
|
x_display->key_press &= ~press;
|
||||||
|
printf("Released\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* WonX <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* WonX <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
if (event->type == KeyPress) {
|
if (event->type == KeyPress) {
|
||||||
|
|
||||||
switch (key_sym) {
|
switch (key_sym) {
|
||||||
|
|
||||||
/* ɽ<><C9BD><EFBFBD>⡼<EFBFBD><E2A1BC><EFBFBD>ѹ<EFBFBD> */
|
/* ɽ<><C9BD><EFBFBD>⡼<EFBFBD><E2A1BC><EFBFBD>ѹ<EFBFBD> */
|
||||||
case XK_p :
|
case XK_F9 :
|
||||||
x_display->lcd_draw = !(x_display->lcd_draw);
|
case XK_F10 :
|
||||||
if (x_display->lcd_draw)
|
|
||||||
|
if (key_sym == XK_F9) {
|
||||||
|
printf("key : F9 Pressed\n");
|
||||||
|
printf("lcd_draw_level : down (%d", x_display->lcd_draw_level);
|
||||||
|
(x_display->lcd_draw_level)--;
|
||||||
|
printf(" -> %d)\n", x_display->lcd_draw_level);
|
||||||
|
} else {
|
||||||
|
printf("key : F10 Pressed\n");
|
||||||
|
printf("lcd_draw_level : up (%d", x_display->lcd_draw_level);
|
||||||
|
(x_display->lcd_draw_level)++;
|
||||||
|
printf(" -> %d)\n", x_display->lcd_draw_level);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x_display->lcd_draw_level > 0) {
|
||||||
|
#if 1
|
||||||
|
/*
|
||||||
|
* WonXDisplay_Flush() <20><><EFBFBD>¹Ԥ<C2B9><D4A4><EFBFBD><EFBFBD>ȡ<EFBFBD>XDisplay_Flush() <20><><EFBFBD>ƤФ<C6A4><D0A4><EFBFBD>
|
||||||
|
* <20><><EFBFBD>٥<EFBFBD><D9A5>ȤΥǥ<CEA5><C7A5><EFBFBD><EFBFBD>ѥå<D1A5><C3A5><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>ᡤ<EFBFBD><E1A1A4><EFBFBD>٥<EFBFBD><D9A5>Ȥν<C8A4><CEBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
* <20>̤Υ<CCA4><CEA5>٥<EFBFBD><D9A5>ȤΥǥ<CEA5><C7A5><EFBFBD><EFBFBD>ѥå<D1A5><C3A5><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>ȤˤʤäƤ<C3A4><C6A4>ޤ<EFBFBD><DEA4><EFBFBD>
|
||||||
|
* X <20><><EFBFBD><EFBFBD><EFBFBD>Ф<EFBFBD><D0A4><EFBFBD>XtDispatchEvent() <20>ˤ<EFBFBD><CBA4>륤<EFBFBD>٥<EFBFBD><D9A5>ȤΥǥ<CEA5><C7A5><EFBFBD><EFBFBD>ѥå<D1A5><C3A5><EFBFBD><EFBFBD>ˡ<EFBFBD>
|
||||||
|
* <20><><EFBFBD>٥<EFBFBD><D9A5>ȥ<EFBFBD><C8A5>塼<EFBFBD><E5A1BC><EFBFBD>饤<EFBFBD>٥<EFBFBD><D9A5>Ȥ<EFBFBD><C8A4>Ф<EFBFBD><D0A4>Ƥ<EFBFBD><C6A4>饤<EFBFBD>٥<EFBFBD><D9A5>Ȥν<C8A4><CEBD><EFBFBD><EFBFBD><EFBFBD><F2A4B9A4>褦<EFBFBD><E8A4A6>
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD>ˤʤäƤ<C3A4><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>٥<EFBFBD><D9A5>Ȥν<C8A4><CEBD><EFBFBD><EFBFBD><EFBFBD><F2A4B7A4><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
* <20><><EFBFBD>塼<EFBFBD><E5A1BC><EFBFBD>饤<EFBFBD>٥<EFBFBD><D9A5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>ˤʤäƤ<C3A4><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤϡ<CBA4>
|
||||||
|
* XtDispatchEvent() <20>ˤ<EFBFBD><CBA4>륤<EFBFBD>٥<EFBFBD><D9A5>ȤΥǥ<CEA5><C7A5><EFBFBD><EFBFBD>ѥå<D1A5><C3A5><EFBFBD><EFBFBD>˺Ƥ<CBBA>
|
||||||
|
* XtDispatchEvent() <20><><EFBFBD>ƤФ줿<D0A4>Ȥ<EFBFBD><C8A4>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD>٥<EFBFBD><D9A5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>塼<EFBFBD><E5A1BC><EFBFBD><EFBFBD>
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤳<EFBFBD>Ȥ<EFBFBD><C8A4>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>٥<EFBFBD><D9A5>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD>¥롼<C2A5>פ˴٤äƤ<C3A4><C6A4>ޤ<EFBFBD>
|
||||||
|
* <20><>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤫<EFBFBD>⤷<EFBFBD><E2A4B7><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD>
|
||||||
|
* (<28><><EFBFBD>ʤߤ<CAA4> XFree86 <20>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>פʤ褦<CAA4>Ǥ<EFBFBD><C7A4>뤬<EFBFBD><EBA4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||||
|
* <20><><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD> WonXDisplay_Flush() <20>ϸƤӽФ<D3BD><D0A4><EFBFBD><EFBFBD>ˡ<EFBFBD>
|
||||||
|
* WonXDisplay_DrawLCDWindow() <20>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τߤ<CEA4><DFA4>Ԥ<EFBFBD><D4A4>褦<EFBFBD><E8A4A6>
|
||||||
|
* WonX-2.2 <20>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
WonXDisplay_DrawLCDWindow(WonX_GetWonXDisplay());
|
||||||
|
#elif 1
|
||||||
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||||
|
#else
|
||||||
|
ExposeHandler(w, p, event, dispatch);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* <20>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
case XK_F1 : x_display->color_map_print = 1; break;
|
case XK_F1 :
|
||||||
case XK_F2 : x_display->palette_print = 1; break;
|
printf("key : F1 Pressed\n");
|
||||||
case XK_F3 : x_display->character_print = 1; break;
|
x_display->color_map_print = 1;
|
||||||
case XK_F4 : x_display->sprite_print = 1; break;
|
printf("dump : color_map\n");
|
||||||
|
break;
|
||||||
|
case XK_F2 :
|
||||||
|
printf("key : F2 Pressed\n");
|
||||||
|
x_display->palette_print = 1;
|
||||||
|
printf("dump : palette\n");
|
||||||
|
break;
|
||||||
|
case XK_F3 :
|
||||||
|
printf("key : F3 Pressed\n");
|
||||||
|
x_display->character_print = 1;
|
||||||
|
printf("dump : character\n");
|
||||||
|
break;
|
||||||
|
case XK_F4 :
|
||||||
|
printf("key : F4 Pressed\n");
|
||||||
|
x_display->sprite_print = 1;
|
||||||
|
printf("dump : sprite\n");
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (press) {
|
|
||||||
if (event->type == KeyPress) x_display->key_press |= press;
|
|
||||||
else x_display->key_press &= ~press;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD><DDA1><EFBFBD> */
|
|
||||||
/*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
static void ExposeHandler(Widget w, XtPointer p, XEvent * event,
|
|
||||||
Boolean * dispatch)
|
|
||||||
{
|
|
||||||
XDisplay x_display = (XDisplay)p;
|
|
||||||
|
|
||||||
XCopyArea(x_display->display, x_display->lcd_pixmap,
|
|
||||||
x_display->lcd_window, x_display->copy_gc,
|
|
||||||
0, 0, x_display->width, x_display->height, 0, 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/* <20>ޥ<EFBFBD><DEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD>Υ<EFBFBD>줿<EFBFBD>顤<EFBFBD><E9A1A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20>ޥ<EFBFBD><DEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD>Υ<EFBFBD>줿<EFBFBD>顤<EFBFBD><E9A1A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
@@ -246,7 +325,7 @@ XDisplay XDisplay_Create(int width, int height)
|
|||||||
XtVaSetValues(x_display->toplevel, XtNmaxHeight, x_display->height, NULL);
|
XtVaSetValues(x_display->toplevel, XtNmaxHeight, x_display->height, NULL);
|
||||||
|
|
||||||
x_display->key_press = 0;
|
x_display->key_press = 0;
|
||||||
x_display->lcd_draw = 1;
|
x_display->lcd_draw_level = 1;
|
||||||
|
|
||||||
XtRealizeWidget(x_display->toplevel);
|
XtRealizeWidget(x_display->toplevel);
|
||||||
while (!XtIsRealized(x_display->toplevel)) { /* None */ }
|
while (!XtIsRealized(x_display->toplevel)) { /* None */ }
|
||||||
@@ -280,6 +359,7 @@ XDisplay XDisplay_Create(int width, int height)
|
|||||||
XSetFunction(x_display->display, x_display->color_gc[i], GXcopy);
|
XSetFunction(x_display->display, x_display->color_gc[i], GXcopy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_X_FONT
|
||||||
/* <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD>Ȥγ<C8A4><CEB3><EFBFBD> */
|
/* <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD>Ȥγ<C8A4><CEB3><EFBFBD> */
|
||||||
x_display->font = XLoadFont(x_display->display, "8x16");
|
x_display->font = XLoadFont(x_display->display, "8x16");
|
||||||
x_display->font_gc = XCreateGC(x_display->display,
|
x_display->font_gc = XCreateGC(x_display->display,
|
||||||
@@ -290,6 +370,24 @@ XDisplay XDisplay_Create(int width, int height)
|
|||||||
XDisplay_GetPixelFromColorName(x_display, "white"));
|
XDisplay_GetPixelFromColorName(x_display, "white"));
|
||||||
XSetBackground(x_display->display, x_display->font_gc,
|
XSetBackground(x_display->display, x_display->font_gc,
|
||||||
XDisplay_GetPixelFromColorName(x_display, "black"));
|
XDisplay_GetPixelFromColorName(x_display, "black"));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* GC<47>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*
|
||||||
|
* XColorGCDatabase_Create() <20>θ<EFBFBD><CEB8><EFBFBD> XCreateGC() <20><>¾<EFBFBD><C2BE> GC <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4>ȡ<EFBFBD>
|
||||||
|
* <20>ʤ<EFBFBD><CAA4><EFBFBD> XFreeGC() <20><><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD> Segmentation Fault <20><EFBFBD><F2B5AFA4><EFBFBD>
|
||||||
|
* (FreeBSD <20>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>á<EFBFBD><C3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¾<EFBFBD><C2BE> OS (<28>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τˤ<CEA4>X<EFBFBD>饤<EFBFBD>֥<EFBFBD><D6A5><EFBFBD>)
|
||||||
|
* <20>Ǥϻ<CFBB>Ƥʤ<C6A4>)<29>Τǡ<CEA4>XColorGCDatabase_Create() <20>Ϥ<EFBFBD><CFA4>٤Ƥ<D9A4> GC <20><>
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˹Ԥ<CBB9>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD>롥
|
||||||
|
*/
|
||||||
|
x_display->color_gc_database =
|
||||||
|
XColorGCDatabase_Create(x_display,
|
||||||
|
0, /* studying_flag */
|
||||||
|
1, /* cache_flag */
|
||||||
|
3, /* cache_size */
|
||||||
|
256, /* hash_number */
|
||||||
|
"black", /* background_color */
|
||||||
|
16 /* gradation */);
|
||||||
|
|
||||||
XFillRectangle(x_display->display, x_display->lcd_window,
|
XFillRectangle(x_display->display, x_display->lcd_window,
|
||||||
x_display->color_gc[0],
|
x_display->color_gc[0],
|
||||||
@@ -339,17 +437,87 @@ XDisplay XDisplay_Destroy(XDisplay x_display)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (x_display == NULL) return (NULL);
|
if (x_display == NULL)
|
||||||
|
WonX_Error("XDisplay_Destroy", "Object is not created.");
|
||||||
|
|
||||||
/* <20><><EFBFBD>Ȥǥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>β<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲä<EFBFBD><EFBFBD>뤳<EFBFBD><EFBFBD> */
|
/* X<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ф<EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD> */
|
||||||
if (x_display->color_gc != NULL) {
|
/* True <20><><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>٥<EFBFBD><D9A5>ȥ<EFBFBD><C8A5>塼<EFBFBD><E5A1BC><EFBFBD>Υ<EFBFBD><CEA5>٥<EFBFBD><D9A5>Ȥ<EFBFBD><C8A4>Ѵ<EFBFBD><D1B4><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
for (i = 0; i < 16; i++) {
|
XSync(x_display->display, True);
|
||||||
if (x_display->color_gc[i])
|
|
||||||
XFreeGC(x_display->display, x_display->color_gc[i]);
|
/* <20>ȥ<EFBFBD><C8A5>졼<F3A5B9A5><ECA1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>ȡ<F3A5B9A5><C8A1><EFBFBD> */
|
||||||
|
XtUninstallTranslations(x_display->toplevel);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><CEBA><EFBFBD> */
|
||||||
|
#if 0
|
||||||
|
/*
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤳<EFBFBD>ȤϤǤ<CFA4><C7A4>ʤ<EFBFBD><CAA4><EFBFBD>
|
||||||
|
* (Ʊ<><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̾<EFBFBD>ǿ<EFBFBD><C7BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD><CFBF><EFBFBD>ơ<EFBFBD><C6A1><EFBFBD><EFBFBD><EFBFBD><F1A4ADA4>뤳<EFBFBD>ȤϤǤ<CFA4><C7A4><EFBFBD>)
|
||||||
|
*/
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><CEBA><EFBFBD> */
|
||||||
|
#if 0
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><CEBA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פʾ<D7A4><CABE><EFBFBD><EFBFBD>ˤϤ<CBA4><CFA4><EFBFBD><EFBFBD>˽<CBBD><F1A4AFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD>ɬ<EFBFBD><C9AC>̵<EFBFBD><CCB5> */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>٥<EFBFBD><D9A5>ȥϥ<C8A5><CFA5>ɥ<EFBFBD><C9A5>κ<EFBFBD><CEBA><EFBFBD> */
|
||||||
|
XtRemoveEventHandler(x_display->toplevel, KeyPressMask | KeyReleaseMask,
|
||||||
|
False, KeyHandler, x_display);
|
||||||
|
XtRemoveEventHandler(x_display->toplevel, ExposureMask,
|
||||||
|
False, ExposeHandler, x_display);
|
||||||
|
XtRemoveEventHandler(x_display->toplevel, LeaveWindowMask | FocusChangeMask,
|
||||||
|
False, LeaveWindowHandler, x_display);
|
||||||
|
|
||||||
|
/* GC<47>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD> */
|
||||||
|
if (x_display->color_gc_database) {
|
||||||
|
x_display->color_gc_database =
|
||||||
|
XColorGCDatabase_Destroy(x_display->color_gc_database);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef USE_X_FONT
|
||||||
|
/* <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD>Ȥβ<C8A4><CEB2><EFBFBD> */
|
||||||
|
if (x_display->font_gc) {
|
||||||
|
XFreeGC(x_display->display, x_display->font_gc);
|
||||||
|
x_display->font_gc = 0;
|
||||||
|
}
|
||||||
|
if (x_display->font) {
|
||||||
|
XUnloadFont(x_display->display, x_display->font);
|
||||||
|
x_display->font = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for (i = 0; i < 16; i++) {
|
||||||
|
if (x_display->color_gc[i]) {
|
||||||
|
XFreeGC(x_display->display, x_display->color_gc[i]);
|
||||||
x_display->color_gc[i] = 0;
|
x_display->color_gc[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (x_display->copy_gc) {
|
||||||
|
XFreeGC(x_display->display, x_display->copy_gc);
|
||||||
|
x_display->copy_gc = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (x_display->lcd_pixmap) {
|
||||||
|
XFreePixmap(x_display->display, x_display->lcd_pixmap);
|
||||||
|
x_display->lcd_pixmap = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
x_display->key_press = 0;
|
||||||
|
x_display->lcd_draw_level = 0;
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
if (x_display->app_context) {
|
||||||
|
XtDestroyApplicationContext(x_display->app_context);
|
||||||
|
x_display->app_context = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (x_display->toplevel) {
|
||||||
|
XtDestroyWidget(x_display->toplevel);
|
||||||
|
x_display->toplevel = 0;
|
||||||
|
}
|
||||||
|
|
||||||
free(x_display);
|
free(x_display);
|
||||||
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
@@ -361,14 +529,21 @@ XDisplay XDisplay_Destroy(XDisplay x_display)
|
|||||||
|
|
||||||
int XDisplay_Sync(XDisplay x_display)
|
int XDisplay_Sync(XDisplay x_display)
|
||||||
{
|
{
|
||||||
XEvent event;
|
|
||||||
|
|
||||||
XFlush(x_display->display);
|
XFlush(x_display->display);
|
||||||
|
|
||||||
/* X<><58><EFBFBD><EFBFBD><EFBFBD>Ф<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD> */
|
/* X<><58><EFBFBD><EFBFBD><EFBFBD>Ф<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD> */
|
||||||
/* False <20><><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>٥<EFBFBD><D9A5>ȥ<EFBFBD><C8A5>塼<EFBFBD><E5A1BC><EFBFBD>Υ<EFBFBD><CEA5>٥<EFBFBD><D9A5>Ȥ<EFBFBD><C8A4>Ѵ<EFBFBD><D1B4><EFBFBD><EFBFBD>ʤ<EFBFBD> */
|
/* False <20><><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>٥<EFBFBD><D9A5>ȥ<EFBFBD><C8A5>塼<EFBFBD><E5A1BC><EFBFBD>Υ<EFBFBD><CEA5>٥<EFBFBD><D9A5>Ȥ<EFBFBD><C8A4>Ѵ<EFBFBD><D1B4><EFBFBD><EFBFBD>ʤ<EFBFBD> */
|
||||||
XSync(x_display->display, False);
|
XSync(x_display->display, False);
|
||||||
|
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int XDisplay_Flush(XDisplay x_display)
|
||||||
|
{
|
||||||
|
XEvent event;
|
||||||
|
|
||||||
|
XDisplay_Sync(x_display);
|
||||||
|
|
||||||
/* <20><><EFBFBD>٥<EFBFBD><D9A5>Ȥν<C8A4><CEBD><EFBFBD> */
|
/* <20><><EFBFBD>٥<EFBFBD><D9A5>Ȥν<C8A4><CEBD><EFBFBD> */
|
||||||
while (XtAppPending(x_display->app_context)) {
|
while (XtAppPending(x_display->app_context)) {
|
||||||
XtAppNextEvent(x_display->app_context, &event);
|
XtAppNextEvent(x_display->app_context, &event);
|
||||||
@@ -382,89 +557,182 @@ int XDisplay_Sync(XDisplay x_display)
|
|||||||
/* <20><><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD> */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
int XDisplay_DrawLCDWindow(XDisplay x_display, WWLCDPanel ww_lcd_panel)
|
int XDisplay_DrawLCDWindow(XDisplay x_display, WWDisplay ww_display,
|
||||||
|
WWLCDPanel ww_lcd_panel)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
int px, py, ph;
|
int px, py, ph;
|
||||||
int num;
|
int num;
|
||||||
int n[16];
|
int n[16];
|
||||||
|
XRectangle rectangle;
|
||||||
XRectangle * rectangles[16];
|
XRectangle * rectangles[16];
|
||||||
int pixel;
|
unsigned short int pixel;
|
||||||
int ww_lcd_width, ww_lcd_height;
|
int ww_lcd_width, ww_lcd_height;
|
||||||
|
int red, green, blue;
|
||||||
/* <20><><EFBFBD>ܤ<EFBFBD><DCA4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϤޤȤ<DEA4><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><E8A4B9><EFBFBD>Τǡ<CEA4><C7A1>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><CEBA><EFBFBD><EFBFBD>ͤ<EFBFBD> */
|
XColorGCDatabase database;
|
||||||
/* <20>ǰ<EFBFBD><C7B0>ξ<EFBFBD><CEBE><EFBFBD>(<28>ʡ<EFBFBD><CAA1><EFBFBD><EFBFBD>ͤΤȤ<CEA4>)<29>ǡ<EFBFBD>width * height / 2 <20>ˤʤ롥 */
|
XColorGC x_color_gc;
|
||||||
num =
|
GC gc;
|
||||||
WWLCDPanel_GetHeight(ww_lcd_panel) * WWLCDPanel_GetWidth(ww_lcd_panel) / 2;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* <20><><EFBFBD><EFBFBD> malloc() <20>ϡ<EFBFBD><CFA1>ºݤˤϥ<CBA4><CFA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϤۤȤ<DBA4><C8A4>ɻ<EFBFBD><C9BB>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ʤ<EFBFBD><CAA4>Τǡ<CEA4>
|
|
||||||
* <20><><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
*/
|
|
||||||
for (pixel = 0; pixel < 16; pixel++) {
|
|
||||||
n[pixel] = 0;
|
|
||||||
rectangles[pixel] = (XRectangle *)malloc(sizeof(XRectangle) * num);
|
|
||||||
}
|
|
||||||
if (rectangles == NULL)
|
|
||||||
WonX_Error("XDisplay_DrawLCDWindow", "Cannot allocate memory.");
|
|
||||||
|
|
||||||
ww_lcd_width = WWLCDPanel_GetWidth( ww_lcd_panel);
|
ww_lcd_width = WWLCDPanel_GetWidth( ww_lcd_panel);
|
||||||
ww_lcd_height = WWLCDPanel_GetHeight(ww_lcd_panel);
|
ww_lcd_height = WWLCDPanel_GetHeight(ww_lcd_panel);
|
||||||
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD>ϥۥåȥ<C3A5><C8A5>ݥåȤˤʤ<CBA4><CAA4>Τǡ<CEA4><C7A1>Τ<EFBFBD><CEA4>Τ<EFBFBD><CEA4>˥<EFBFBD><CBA5>塼<EFBFBD>˥<CBA5><F3A5B0A4>뤳<EFBFBD><EBA4B3> */
|
switch (WWDisplay_GetColorMode(ww_display)) {
|
||||||
|
|
||||||
for (y = 0; y < ww_lcd_height; y++) {
|
case COLOR_MODE_GRAYSCALE:
|
||||||
py = (y * x_display->height) / ww_lcd_height;
|
|
||||||
ph = (y+1) * x_display->height / ww_lcd_height- py;
|
|
||||||
for (x = 0; x < ww_lcd_width; x++) {
|
|
||||||
if (!WWLCDPanel_IsPixelChanged(ww_lcd_panel, x, y)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
pixel = WWLCDPanel_GetPixel(ww_lcd_panel, x, y);
|
|
||||||
px = (x * x_display->width ) / ww_lcd_width;
|
|
||||||
rectangles[pixel][n[pixel]].x = px;
|
|
||||||
rectangles[pixel][n[pixel]].y = py;
|
|
||||||
rectangles[pixel][n[pixel]].width =
|
|
||||||
(x+1) * x_display->width / ww_lcd_width - px;
|
|
||||||
rectangles[pixel][n[pixel]].height = ph;
|
|
||||||
|
|
||||||
/* <20><><EFBFBD>ܤ<EFBFBD><DCA4>Ƥ<EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD>Υԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><EFBFBD>ä<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>ܤ<EFBFBD><DCA4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϤޤȤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><EFBFBD><EFBFBD>Τǡ<EFBFBD><EFBFBD>ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD> */
|
||||||
x++;
|
/* <20>ǰ<EFBFBD><C7B0>ξ<EFBFBD><CEBE><EFBFBD>(<28>ʡ<EFBFBD><CAA1><EFBFBD><EFBFBD>ͤΤȤ<CEA4>)<29>ǡ<EFBFBD>width * height / 2 <20>ˤʤ롥 */
|
||||||
while ( (x < ww_lcd_width) &&
|
num =
|
||||||
(pixel == WWLCDPanel_GetPixel(ww_lcd_panel, x, y)) &&
|
WWLCDPanel_GetHeight(ww_lcd_panel) *
|
||||||
(WWLCDPanel_IsPixelChanged(ww_lcd_panel, x, y)) ) {
|
WWLCDPanel_GetWidth(ww_lcd_panel) / 2;
|
||||||
rectangles[pixel][n[pixel]].width =
|
|
||||||
(x+1) * x_display->width / ww_lcd_width - px;
|
/*
|
||||||
|
* <20><><EFBFBD><EFBFBD> malloc() <20>ϡ<EFBFBD><CFA1>ºݤˤϥ<CBA4><CFA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϤۤȤ<DBA4><C8A4>ɻ<EFBFBD><C9BB>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ʤ<EFBFBD><CAA4>Τǡ<CEA4>
|
||||||
|
* <20><><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
for (pixel = 0; pixel < 16; pixel++) {
|
||||||
|
n[pixel] = 0;
|
||||||
|
rectangles[pixel] = (XRectangle *)malloc(sizeof(XRectangle) * num);
|
||||||
|
}
|
||||||
|
if (rectangles == NULL)
|
||||||
|
WonX_Error("XDisplay_DrawLCDWindow", "Cannot allocate memory.");
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD>ϥۥåȥ<C3A5><C8A5>ݥåȤˤʤ<CBA4><CAA4>Τǡ<CEA4><C7A1>Τ<EFBFBD><CEA4>Τ<EFBFBD><CEA4>˥<EFBFBD><CBA5>塼<EFBFBD>˥<CBA5><F3A5B0A4>뤳<EFBFBD><EBA4B3> */
|
||||||
|
|
||||||
|
for (y = 0; y < ww_lcd_height; y++) {
|
||||||
|
py = (y * x_display->height) / ww_lcd_height;
|
||||||
|
ph = (y+1) * x_display->height / ww_lcd_height- py;
|
||||||
|
for (x = 0; x < ww_lcd_width; x++) {
|
||||||
|
if (!WWLCDPanel_IsPixelChanged(ww_lcd_panel, x, y)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
pixel = WWLCDPanel_GetPixel(ww_lcd_panel, x, y);
|
||||||
|
px = (x * x_display->width ) / ww_lcd_width;
|
||||||
|
rectangles[pixel][n[pixel]].x = px;
|
||||||
|
rectangles[pixel][n[pixel]].y = py;
|
||||||
|
rectangles[pixel][n[pixel]].width =
|
||||||
|
(x+1) * x_display->width / ww_lcd_width - px;
|
||||||
|
rectangles[pixel][n[pixel]].height = ph;
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>ܤ<EFBFBD><DCA4>Ƥ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>Υԥ<CEA5><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><E8A4B9> */
|
||||||
x++;
|
x++;
|
||||||
|
while ( (x < ww_lcd_width) &&
|
||||||
|
(pixel == WWLCDPanel_GetPixel(ww_lcd_panel, x, y)) &&
|
||||||
|
(WWLCDPanel_IsPixelChanged(ww_lcd_panel, x, y)) ) {
|
||||||
|
rectangles[pixel][n[pixel]].width =
|
||||||
|
(x+1) * x_display->width / ww_lcd_width - px;
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
x--;
|
||||||
|
|
||||||
|
n[pixel]++;
|
||||||
}
|
}
|
||||||
x--;
|
|
||||||
|
|
||||||
n[pixel]++;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
for (pixel = 0; pixel < 16; pixel++) {
|
for (pixel = 0; pixel < 16; pixel++) {
|
||||||
if (n[pixel] > 0) {
|
if (n[pixel] > 0) {
|
||||||
XFillRectangles(x_display->display,
|
XFillRectangles(x_display->display,
|
||||||
x_display->lcd_pixmap,
|
x_display->lcd_pixmap,
|
||||||
x_display->color_gc[pixel],
|
x_display->color_gc[pixel],
|
||||||
rectangles[pixel], n[pixel]);
|
rectangles[pixel], n[pixel]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (pixel = 0; pixel < 16; pixel++) {
|
||||||
|
free(rectangles[pixel]);
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case COLOR_MODE_4COLOR:
|
||||||
|
case COLOR_MODE_16COLOR:
|
||||||
|
case COLOR_MODE_16PACKED:
|
||||||
|
|
||||||
|
database = XDisplay_GetColorGCDatabase(x_display);
|
||||||
|
|
||||||
|
for (y = 0; y < ww_lcd_height; y++) {
|
||||||
|
py = (y * x_display->height) / ww_lcd_height;
|
||||||
|
ph = (y+1) * x_display->height / ww_lcd_height- py;
|
||||||
|
for (x = 0; x < ww_lcd_width; x++) {
|
||||||
|
if (!WWLCDPanel_IsPixelChanged(ww_lcd_panel, x, y)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
pixel = WWLCDPanel_GetPixel(ww_lcd_panel, x, y);
|
||||||
|
px = (x * x_display->width ) / ww_lcd_width;
|
||||||
|
rectangle.x = px;
|
||||||
|
rectangle.y = py;
|
||||||
|
rectangle.width = (x+1) * x_display->width / ww_lcd_width - px;
|
||||||
|
rectangle.height = ph;
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>ܤ<EFBFBD><DCA4>Ƥ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>Υԥ<CEA5><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><E8A4B9> */
|
||||||
|
x++;
|
||||||
|
while ( (x < ww_lcd_width) &&
|
||||||
|
(pixel == WWLCDPanel_GetPixel(ww_lcd_panel, x, y)) &&
|
||||||
|
(WWLCDPanel_IsPixelChanged(ww_lcd_panel, x, y)) ) {
|
||||||
|
rectangle.width =
|
||||||
|
(x+1) * x_display->width / ww_lcd_width - px;
|
||||||
|
x++;
|
||||||
|
}
|
||||||
|
x--;
|
||||||
|
|
||||||
|
red = (pixel >> 8) & 0xf;
|
||||||
|
green = (pixel >> 4) & 0xf;
|
||||||
|
blue = (pixel >> 0) & 0xf;
|
||||||
|
|
||||||
|
red = (red == 15) ? 65535 : red * 4096;
|
||||||
|
green = (green == 15) ? 65535 : green * 4096;
|
||||||
|
blue = (blue == 15) ? 65535 : blue * 4096;
|
||||||
|
|
||||||
|
x_color_gc = XColorGC_CreateFromRGB(database, red, green, blue);
|
||||||
|
gc = XColorGC_GetGC(x_color_gc);
|
||||||
|
|
||||||
|
XFillRectangle(x_display->display,
|
||||||
|
x_display->lcd_pixmap,
|
||||||
|
gc,
|
||||||
|
rectangle.x,
|
||||||
|
rectangle.y,
|
||||||
|
rectangle.width,
|
||||||
|
rectangle.height);
|
||||||
|
XColorGC_Destroy(x_color_gc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
WonX_Error("XDisplay_DrawLCDWindow", "Unknown color mode.");
|
||||||
}
|
}
|
||||||
|
|
||||||
XCopyArea(x_display->display, x_display->lcd_pixmap,
|
XCopyArea(x_display->display, x_display->lcd_pixmap,
|
||||||
x_display->lcd_window, x_display->copy_gc,
|
x_display->lcd_window, x_display->copy_gc,
|
||||||
0, 0, x_display->width, x_display->height, 0, 0);
|
0, 0, x_display->width, x_display->height, 0, 0);
|
||||||
|
|
||||||
WWLCDPanel_ResetAllDraw(ww_lcd_panel);
|
WWLCDPanel_ResetAllDraw(ww_lcd_panel);
|
||||||
WWLCDPanel_ReverseCurrent(ww_lcd_panel);
|
WWLCDPanel_ReverseCurrent(ww_lcd_panel);
|
||||||
|
|
||||||
XDisplay_Sync(x_display);
|
XDisplay_Sync(x_display);
|
||||||
|
|
||||||
for (pixel = 0; pixel < 16; pixel++) {
|
return (0);
|
||||||
free(rectangles[pixel]);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* GC <20>κ<EFBFBD><CEBA><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
GC XDisplay_CreateGC(XDisplay x_display)
|
||||||
|
{
|
||||||
|
GC gc;
|
||||||
|
gc = XCreateGC(x_display->display, x_display->lcd_window, 0, 0);
|
||||||
|
return (gc);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* GC <20>β<EFBFBD><CEB2><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
int XDisplay_DestroyGC(XDisplay x_display, GC gc)
|
||||||
|
{
|
||||||
|
XFreeGC(x_display->display, gc);
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
45
XDisplay.h
45
XDisplay.h
@@ -5,10 +5,6 @@
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include "wonx_include/key.h"
|
|
||||||
|
|
||||||
#include "WWLCDPanel.h"
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -16,11 +12,32 @@
|
|||||||
typedef struct _XDisplay * XDisplay;
|
typedef struct _XDisplay * XDisplay;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20>إå<EFBFBD><EFBFBD>ե<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD>롼<EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
|
#include "wonx/key.h"
|
||||||
|
|
||||||
|
#include "WWDisplay.h"
|
||||||
|
#include "WWLCDPanel.h"
|
||||||
|
#include "XColorGC.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
Display * XDisplay_GetDisplay(XDisplay x_display);
|
||||||
|
Colormap XDisplay_GetColormap(XDisplay x_display);
|
||||||
|
|
||||||
|
XColorGCDatabase XDisplay_GetColorGCDatabase(XDisplay x_display);
|
||||||
|
|
||||||
unsigned int XDisplay_GetKeyPress(XDisplay x_display);
|
unsigned int XDisplay_GetKeyPress(XDisplay x_display);
|
||||||
int XDisplay_GetLCDDraw(XDisplay x_display);
|
|
||||||
|
int XDisplay_GetLCDDrawLevel(XDisplay d);
|
||||||
|
int XDisplay_SetLCDDrawLevel(XDisplay d, int level);
|
||||||
|
int XDisplay_LCDDrawLevelDown(XDisplay d);
|
||||||
|
int XDisplay_LCDDrawLevelUp( XDisplay d);
|
||||||
|
|
||||||
int XDisplay_GetColorMapPrint(XDisplay d);
|
int XDisplay_GetColorMapPrint(XDisplay d);
|
||||||
int XDisplay_GetPalettePrint(XDisplay d);
|
int XDisplay_GetPalettePrint(XDisplay d);
|
||||||
@@ -53,12 +70,26 @@ XDisplay XDisplay_Destroy(XDisplay x_display);
|
|||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
int XDisplay_Sync(XDisplay x_display);
|
int XDisplay_Sync(XDisplay x_display);
|
||||||
|
int XDisplay_Flush(XDisplay x_display);
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
/* <20><><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD> */
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
int XDisplay_DrawLCDWindow(XDisplay x_display, WWLCDPanel ww_lcd_panel);
|
int XDisplay_DrawLCDWindow(XDisplay x_display, WWDisplay ww_display,
|
||||||
|
WWLCDPanel ww_lcd_panel);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* GC <20>κ<EFBFBD><CEBA><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
GC XDisplay_CreateGC(XDisplay x_display);
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
/* GC <20>β<EFBFBD><CEB2><EFBFBD> */
|
||||||
|
/*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
int XDisplay_DestroyGC(XDisplay x_display, GC gc);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||||
|
|||||||
17
XDisplayP.h
17
XDisplayP.h
@@ -9,13 +9,17 @@
|
|||||||
|
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
|
||||||
#include <X11/Intrinsic.h>
|
#include <X11/Intrinsic.h>
|
||||||
#include <X11/StringDefs.h>
|
#include <X11/StringDefs.h>
|
||||||
#include <X11/Shell.h>
|
#include <X11/Shell.h>
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* X <20>Υե<CEA5><D5A5><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4>롥
|
||||||
|
*/
|
||||||
|
#define USE_X_FONT
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -37,17 +41,22 @@ typedef struct _XDisplay {
|
|||||||
Pixmap lcd_pixmap;
|
Pixmap lcd_pixmap;
|
||||||
|
|
||||||
GC copy_gc;
|
GC copy_gc;
|
||||||
GC color_gc[16];
|
GC color_gc[16]; /* <20><><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD>Ѥ<EFBFBD>GC */
|
||||||
|
|
||||||
|
/* 4096<39><36>ɽ<EFBFBD><C9BD><EFBFBD>Ѥ<EFBFBD>GC<47>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD>(XFireworks <20><><EFBFBD><EFBFBD>ή<EFBFBD><CEAE>) */
|
||||||
|
XColorGCDatabase color_gc_database;
|
||||||
|
|
||||||
|
#ifdef USE_X_FONT
|
||||||
/* <20>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EAA1BC><EFBFBD>ؤ<EFBFBD>ʸ<EFBFBD><CAB8>ɽ<EFBFBD><C9BD><EFBFBD>ѤΥե<CEA5><D5A5><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EAA1BC><EFBFBD>ؤ<EFBFBD>ʸ<EFBFBD><CAB8>ɽ<EFBFBD><C9BD><EFBFBD>ѤΥե<CEA5><D5A5><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
Font font;
|
Font font;
|
||||||
GC font_gc;
|
GC font_gc;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD> */
|
||||||
unsigned int key_press;
|
unsigned int key_press;
|
||||||
|
|
||||||
/* LCD<43><44><EFBFBD><EFBFBD><EFBFBD>Υե饰 */
|
/* LCD<43><44><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD>٥<EFBFBD> */
|
||||||
int lcd_draw;
|
int lcd_draw_level;
|
||||||
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7BD>ϤΥե饰 */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7BD>ϤΥե饰 */
|
||||||
int color_map_print;
|
int color_map_print;
|
||||||
|
|||||||
2
bank.c
2
bank.c
@@ -5,7 +5,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "wonx_include/bank.h"
|
#include "wonx/bank.h"
|
||||||
|
|
||||||
#include "WonX.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
|
|||||||
7
challsrc.sh
Normal file
7
challsrc.sh
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ -x ./filters.pl ] ; then
|
||||||
|
./filters.pl "qkc -e -u" ./sys2wonx.pl ./int2sint.pl -f $*
|
||||||
|
else
|
||||||
|
filters.pl "qkc -e -u" sys2wonx.pl int2sint.pl -f $*
|
||||||
|
fi
|
||||||
184
comm.c
184
comm.c
@@ -10,10 +10,13 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
#include "wonx_include/comm.h"
|
#include "wonx/comm.h"
|
||||||
|
|
||||||
#include "wonx_configure.h"
|
#include "wonx_configure.h"
|
||||||
#include "WonX.h"
|
#include "WonX.h"
|
||||||
|
#include "WonXSerialPort.h"
|
||||||
|
#include "WWSerialPort.h"
|
||||||
|
#include "UNIXSerialPort.h"
|
||||||
#include "etc.h"
|
#include "etc.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -38,7 +41,9 @@
|
|||||||
|
|
||||||
void comm_open(void)
|
void comm_open(void)
|
||||||
{
|
{
|
||||||
|
WonXSerialPort wonx_serial_port;
|
||||||
WWSerialPort ww_serial_port;
|
WWSerialPort ww_serial_port;
|
||||||
|
UNIXSerialPort unix_serial_port;
|
||||||
|
|
||||||
if (!WonX_IsCreated()) WonX_Create();
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
@@ -48,12 +53,17 @@ void comm_open(void)
|
|||||||
printf("call : comm_open() : \n");
|
printf("call : comm_open() : \n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
ww_serial_port = WonXSerialPort_GetWWSerialPort(WonX_GetWonXSerialPort());
|
wonx_serial_port = WonX_GetWonXSerialPort();
|
||||||
|
ww_serial_port = WonXSerialPort_GetWWSerialPort(wonx_serial_port);
|
||||||
|
unix_serial_port = WonXSerialPort_GetUNIXSerialPort(wonx_serial_port);
|
||||||
|
|
||||||
if (WWSerialPort_IsON(ww_serial_port))
|
if (WWSerialPort_IsOpened(ww_serial_port))
|
||||||
WonX_Error("comm_open", "Serial port has already opened.");
|
WonX_Warning("comm_open", "WW serial port has already opened.");
|
||||||
|
WWSerialPort_Open(ww_serial_port);
|
||||||
|
|
||||||
WWSerialPort_ON(ww_serial_port);
|
if (UNIXSerialPort_IsOpened(unix_serial_port))
|
||||||
|
WonX_Warning("comm_open", "UNIX serial port has already opened.");
|
||||||
|
UNIXSerialPort_Open(unix_serial_port);
|
||||||
|
|
||||||
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
@@ -68,7 +78,9 @@ void comm_open(void)
|
|||||||
|
|
||||||
void comm_close(void)
|
void comm_close(void)
|
||||||
{
|
{
|
||||||
|
WonXSerialPort wonx_serial_port;
|
||||||
WWSerialPort ww_serial_port;
|
WWSerialPort ww_serial_port;
|
||||||
|
UNIXSerialPort unix_serial_port;
|
||||||
|
|
||||||
if (!WonX_IsCreated()) WonX_Create();
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
@@ -78,12 +90,17 @@ void comm_close(void)
|
|||||||
printf("call : comm_close() : \n");
|
printf("call : comm_close() : \n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
ww_serial_port = WonXSerialPort_GetWWSerialPort(WonX_GetWonXSerialPort());
|
wonx_serial_port = WonX_GetWonXSerialPort();
|
||||||
|
ww_serial_port = WonXSerialPort_GetWWSerialPort(wonx_serial_port);
|
||||||
|
unix_serial_port = WonXSerialPort_GetUNIXSerialPort(wonx_serial_port);
|
||||||
|
|
||||||
if (!WWSerialPort_IsON(ww_serial_port))
|
if (!WWSerialPort_IsClosed(ww_serial_port))
|
||||||
WonX_Error("comm_close", "Serial port is not opened.");
|
WonX_Warning("comm_close", "WW serial port is not opened.");
|
||||||
|
WWSerialPort_Close(ww_serial_port);
|
||||||
|
|
||||||
WWSerialPort_OFF(ww_serial_port);
|
if (!UNIXSerialPort_IsClosed(unix_serial_port))
|
||||||
|
WonX_Warning("comm_close", "UNIX serial port is not opened.");
|
||||||
|
UNIXSerialPort_Close(unix_serial_port);
|
||||||
|
|
||||||
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
@@ -98,79 +115,59 @@ void comm_close(void)
|
|||||||
|
|
||||||
static void comm_output(unsigned char c)
|
static void comm_output(unsigned char c)
|
||||||
{
|
{
|
||||||
if (c == '\n') printf("\\n");
|
WonXSerialPort wonx_serial_port;
|
||||||
else if (c == '\r') printf("\\r");
|
UNIXSerialPort unix_serial_port;
|
||||||
else if (c == '\t') printf("\\t");
|
|
||||||
else if (isprint(c)) fputc(c, stdout);
|
wonx_serial_port = WonX_GetWonXSerialPort();
|
||||||
else printf("^%02x", (int)c);
|
unix_serial_port = WonXSerialPort_GetUNIXSerialPort(wonx_serial_port);
|
||||||
fflush(stdout);
|
UNIXSerialPort_SendCharacter(unix_serial_port, c);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int comm_input(int timeout)
|
static int comm_input(int timeout)
|
||||||
{
|
{
|
||||||
int tmp;
|
WonXSerialPort wonx_serial_port;
|
||||||
|
UNIXSerialPort unix_serial_port;
|
||||||
int c;
|
int c;
|
||||||
fd_set bitmap;
|
|
||||||
struct timeval t;
|
|
||||||
struct timeval * t_p;
|
|
||||||
|
|
||||||
/*
|
wonx_serial_port = WonX_GetWonXSerialPort();
|
||||||
* 0 <20>ΤȤ<CEA4><C8A4>ϡ<EFBFBD>¨<EFBFBD><C2A8>
|
unix_serial_port = WonXSerialPort_GetUNIXSerialPort(wonx_serial_port);
|
||||||
* -1 <20>ΤȤ<CEA4><C8A4>ϡ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD>
|
c = UNIXSerialPort_ReceiveCharacter(unix_serial_port,
|
||||||
*/
|
WONX_SERIAL_PORT_TIMETICKS * timeout);
|
||||||
if (timeout == -1) {
|
|
||||||
t_p = NULL;
|
|
||||||
} else {
|
|
||||||
tmp = WONX_SERIAL_PORT_TIMETICKS * timeout;
|
|
||||||
t.tv_sec = tmp / 1000;
|
|
||||||
t.tv_usec = (tmp % 1000) * 1000;
|
|
||||||
t_p = &t;
|
|
||||||
}
|
|
||||||
|
|
||||||
FD_ZERO(&bitmap);
|
|
||||||
FD_SET(fileno(stdin), &bitmap);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* FreeBSD3.4 <20>Ǽ¸<C7BC><C2B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
* <20><><EFBFBD>顼<EFBFBD>ॷ<EFBFBD><E0A5B7><EFBFBD>ʥ<EFBFBD><CAA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>硤select()<29>ǤΥ֥<CEA5><D6A5>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
* <20><><EFBFBD>顼<EFBFBD>ॷ<EFBFBD><E0A5B7><EFBFBD>ʥ뤬ȯ<EBA4AC><C8AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD>select()<29>⥿<EFBFBD><E2A5BF><EFBFBD>ॢ<EFBFBD><E0A5A2><EFBFBD><EFBFBD>
|
|
||||||
* <20><><EFBFBD>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4>Τǡ<CEA4><C7A1><EFBFBD><EFBFBD>ա<EFBFBD>
|
|
||||||
* (select() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ॢ<EFBFBD><E0A5A2><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˥<EFBFBD><CBA5>顼<EFBFBD>ॷ<EFBFBD><E0A5B7><EFBFBD>ʥ뤬ȯ<EBA4AC><C8AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD>
|
|
||||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ư<EFBFBD><EFBFBD><EEA4B7>)
|
|
||||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̵꤬<EAA4AC><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>ԤäƤ<C3A4><C6A4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݤ<EFBFBD>
|
|
||||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롥
|
|
||||||
*/
|
|
||||||
select(fileno(stdin) + 1, &bitmap, NULL, NULL, t_p);
|
|
||||||
|
|
||||||
c = FD_ISSET(fileno(stdin), &bitmap) ? fgetc(stdin) : -1;
|
|
||||||
c = (c == '\n') ? '\r' : c;
|
|
||||||
|
|
||||||
return (c);
|
return (c);
|
||||||
}
|
}
|
||||||
|
|
||||||
int comm_send_char(unsigned char c)
|
int comm_send_char(unsigned char c)
|
||||||
{
|
{
|
||||||
int ret;
|
WonXSerialPort wonx_serial_port;
|
||||||
|
|
||||||
WWSerialPort ww_serial_port;
|
WWSerialPort ww_serial_port;
|
||||||
|
UNIXSerialPort unix_serial_port;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (!WonX_IsCreated()) WonX_Create();
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
printf("call : comm_send_char() : character = 0x%02x\n", (int)c);
|
printf("call : comm_send_char() : character = \'");
|
||||||
|
wonx_print_character(stdout, c);
|
||||||
|
printf("\'\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
ww_serial_port = WonXSerialPort_GetWWSerialPort(WonX_GetWonXSerialPort());
|
wonx_serial_port = WonX_GetWonXSerialPort();
|
||||||
|
ww_serial_port = WonXSerialPort_GetWWSerialPort(wonx_serial_port);
|
||||||
|
unix_serial_port = WonXSerialPort_GetUNIXSerialPort(wonx_serial_port);
|
||||||
|
|
||||||
if (!WWSerialPort_IsON(ww_serial_port))
|
if (!WWSerialPort_IsOpened(ww_serial_port))
|
||||||
WonX_Error("comm_send_char", "Serial port is not opened.");
|
WonX_Error("comm_send_char", "WW serial port is not opened.");
|
||||||
|
if (!UNIXSerialPort_IsOpened(unix_serial_port))
|
||||||
|
WonX_Error("comm_send_char", "UNIX serial port is not opened.");
|
||||||
|
|
||||||
printf("output to serial port : ");
|
printf("output to serial port : \"");
|
||||||
comm_output(c);
|
comm_output(c);
|
||||||
printf("\n");
|
printf("\"\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@@ -187,7 +184,9 @@ int comm_send_char(unsigned char c)
|
|||||||
|
|
||||||
int comm_receive_char(void)
|
int comm_receive_char(void)
|
||||||
{
|
{
|
||||||
|
WonXSerialPort wonx_serial_port;
|
||||||
WWSerialPort ww_serial_port;
|
WWSerialPort ww_serial_port;
|
||||||
|
UNIXSerialPort unix_serial_port;
|
||||||
int c;
|
int c;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -199,10 +198,14 @@ int comm_receive_char(void)
|
|||||||
printf("call : comm_receive_char() : \n");
|
printf("call : comm_receive_char() : \n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
ww_serial_port = WonXSerialPort_GetWWSerialPort(WonX_GetWonXSerialPort());
|
wonx_serial_port = WonX_GetWonXSerialPort();
|
||||||
|
ww_serial_port = WonXSerialPort_GetWWSerialPort(wonx_serial_port);
|
||||||
|
unix_serial_port = WonXSerialPort_GetUNIXSerialPort(wonx_serial_port);
|
||||||
|
|
||||||
if (!WWSerialPort_IsON(ww_serial_port))
|
if (!WWSerialPort_IsOpened(ww_serial_port))
|
||||||
WonX_Error("comm_receive_char", "Serial port is not opened.");
|
WonX_Error("comm_receive_char", "WW serial port is not opened.");
|
||||||
|
if (!UNIXSerialPort_IsOpened(unix_serial_port))
|
||||||
|
WonX_Error("comm_receive_char", "UNIX serial port is not opened.");
|
||||||
|
|
||||||
c = comm_input(WWSerialPort_GetReceiveTimeout(ww_serial_port));
|
c = comm_input(WWSerialPort_GetReceiveTimeout(ww_serial_port));
|
||||||
|
|
||||||
@@ -222,7 +225,9 @@ int comm_receive_char(void)
|
|||||||
|
|
||||||
int comm_receive_with_timeout(int timeout)
|
int comm_receive_with_timeout(int timeout)
|
||||||
{
|
{
|
||||||
|
WonXSerialPort wonx_serial_port;
|
||||||
WWSerialPort ww_serial_port;
|
WWSerialPort ww_serial_port;
|
||||||
|
UNIXSerialPort unix_serial_port;
|
||||||
int c;
|
int c;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -234,10 +239,14 @@ int comm_receive_with_timeout(int timeout)
|
|||||||
printf("call : comm_receive_with_timeout() : timeout = %d\n", timeout);
|
printf("call : comm_receive_with_timeout() : timeout = %d\n", timeout);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
ww_serial_port = WonXSerialPort_GetWWSerialPort(WonX_GetWonXSerialPort());
|
wonx_serial_port = WonX_GetWonXSerialPort();
|
||||||
|
ww_serial_port = WonXSerialPort_GetWWSerialPort(wonx_serial_port);
|
||||||
|
unix_serial_port = WonXSerialPort_GetUNIXSerialPort(wonx_serial_port);
|
||||||
|
|
||||||
if (!WWSerialPort_IsON(ww_serial_port))
|
if (!WWSerialPort_IsOpened(ww_serial_port))
|
||||||
WonX_Error("comm_receive_with_timeout", "Serial port is not opened.");
|
WonX_Error("comm_receive_with_timeout", "WW serial port is not opened.");
|
||||||
|
if (!UNIXSerialPort_IsOpened(unix_serial_port))
|
||||||
|
WonX_Error("comm_receive_with_timeout", "UNIX serial port is not opened.");
|
||||||
|
|
||||||
c = comm_input(timeout);
|
c = comm_input(timeout);
|
||||||
|
|
||||||
@@ -257,8 +266,11 @@ int comm_receive_with_timeout(int timeout)
|
|||||||
|
|
||||||
int comm_send_string(char * string)
|
int comm_send_string(char * string)
|
||||||
{
|
{
|
||||||
|
WonXSerialPort wonx_serial_port;
|
||||||
WWSerialPort ww_serial_port;
|
WWSerialPort ww_serial_port;
|
||||||
|
UNIXSerialPort unix_serial_port;
|
||||||
int ret;
|
int ret;
|
||||||
|
char * p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!WonX_IsCreated()) WonX_Create();
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
@@ -266,19 +278,25 @@ int comm_send_string(char * string)
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
printf("call : comm_send_string() : string = %s\n", string);
|
printf("call : comm_send_string() : string = \"");
|
||||||
|
for (p = string; *p != '\0'; p++) wonx_print_character(stdout, *p);
|
||||||
|
printf("\"\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
ww_serial_port = WonXSerialPort_GetWWSerialPort(WonX_GetWonXSerialPort());
|
wonx_serial_port = WonX_GetWonXSerialPort();
|
||||||
|
ww_serial_port = WonXSerialPort_GetWWSerialPort(wonx_serial_port);
|
||||||
|
unix_serial_port = WonXSerialPort_GetUNIXSerialPort(wonx_serial_port);
|
||||||
|
|
||||||
if (!WWSerialPort_IsON(ww_serial_port))
|
if (!WWSerialPort_IsOpened(ww_serial_port))
|
||||||
WonX_Error("comm_send_string", "Serial port is not opened.");
|
WonX_Error("comm_send_string", "WW serial port is not opened.");
|
||||||
|
if (!UNIXSerialPort_IsOpened(unix_serial_port))
|
||||||
|
WonX_Error("comm_send_string", "UNIX serial port is not opened.");
|
||||||
|
|
||||||
printf("output to serial port : ");
|
printf("output to serial port : \"");
|
||||||
for (i = 0; string[i]; i++) {
|
for (i = 0; string[i]; i++) {
|
||||||
comm_output(string[i]);
|
comm_output(string[i]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\"\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@@ -295,7 +313,9 @@ int comm_send_string(char * string)
|
|||||||
|
|
||||||
int comm_send_block(void * buffer, int size)
|
int comm_send_block(void * buffer, int size)
|
||||||
{
|
{
|
||||||
|
WonXSerialPort wonx_serial_port;
|
||||||
WWSerialPort ww_serial_port;
|
WWSerialPort ww_serial_port;
|
||||||
|
UNIXSerialPort unix_serial_port;
|
||||||
int ret;
|
int ret;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -307,16 +327,20 @@ int comm_send_block(void * buffer, int size)
|
|||||||
printf("call : comm_send_block() : buffer = %p, size = %d\n", buffer, size);
|
printf("call : comm_send_block() : buffer = %p, size = %d\n", buffer, size);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
ww_serial_port = WonXSerialPort_GetWWSerialPort(WonX_GetWonXSerialPort());
|
wonx_serial_port = WonX_GetWonXSerialPort();
|
||||||
|
ww_serial_port = WonXSerialPort_GetWWSerialPort(wonx_serial_port);
|
||||||
|
unix_serial_port = WonXSerialPort_GetUNIXSerialPort(wonx_serial_port);
|
||||||
|
|
||||||
if (!WWSerialPort_IsON(ww_serial_port))
|
if (!WWSerialPort_IsOpened(ww_serial_port))
|
||||||
WonX_Error("comm_send_block", "Serial port is not opened.");
|
WonX_Error("comm_send_block", "WW serial port is not opened.");
|
||||||
|
if (!UNIXSerialPort_IsOpened(unix_serial_port))
|
||||||
|
WonX_Error("comm_send_block", "UNIX serial port is not opened.");
|
||||||
|
|
||||||
printf("output to serial port : ");
|
printf("output to serial port : \"");
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
comm_output(((char *)buffer)[i]);
|
comm_output(((char *)buffer)[i]);
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\"\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@@ -333,7 +357,9 @@ int comm_send_block(void * buffer, int size)
|
|||||||
|
|
||||||
int comm_receive_block(void * buffer, int size)
|
int comm_receive_block(void * buffer, int size)
|
||||||
{
|
{
|
||||||
|
WonXSerialPort wonx_serial_port;
|
||||||
WWSerialPort ww_serial_port;
|
WWSerialPort ww_serial_port;
|
||||||
|
UNIXSerialPort unix_serial_port;
|
||||||
int ret;
|
int ret;
|
||||||
int c;
|
int c;
|
||||||
int i;
|
int i;
|
||||||
@@ -347,10 +373,14 @@ int comm_receive_block(void * buffer, int size)
|
|||||||
buffer, size);
|
buffer, size);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
ww_serial_port = WonXSerialPort_GetWWSerialPort(WonX_GetWonXSerialPort());
|
wonx_serial_port = WonX_GetWonXSerialPort();
|
||||||
|
ww_serial_port = WonXSerialPort_GetWWSerialPort(wonx_serial_port);
|
||||||
|
unix_serial_port = WonXSerialPort_GetUNIXSerialPort(wonx_serial_port);
|
||||||
|
|
||||||
if (!WWSerialPort_IsON(ww_serial_port))
|
if (!WWSerialPort_IsOpened(ww_serial_port))
|
||||||
WonX_Error("comm_receive_block", "Serial port is not opened.");
|
WonX_Error("comm_receive_block", "WW serial port is not opened.");
|
||||||
|
if (!UNIXSerialPort_IsOpened(unix_serial_port))
|
||||||
|
WonX_Error("comm_receive_block", "UNIX serial port is not opened.");
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
|
|||||||
123
disp.c
123
disp.c
@@ -5,7 +5,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "wonx_include/disp.h"
|
#include "wonx/disp.h"
|
||||||
|
|
||||||
#include "WonX.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
@@ -65,7 +65,14 @@ void display_control(unsigned int flags)
|
|||||||
WWScreen_SetMode(WWDisplay_GetScreen(ww_display, SCREEN2),
|
WWScreen_SetMode(WWDisplay_GetScreen(ww_display, SCREEN2),
|
||||||
WW_SCREEN_OUTSIDE_ONLY);
|
WW_SCREEN_OUTSIDE_ONLY);
|
||||||
|
|
||||||
WWDisplay_SetBorder(ww_display, (flags & DCM_BORDER_COLOR) >> 7);
|
WWDisplay_SetBorderPalette(ww_display,
|
||||||
|
WWDisplay_GetPalette(ww_display,
|
||||||
|
(flags & 0xf000) >> 12));
|
||||||
|
#if 0
|
||||||
|
WWDisplay_SetBorderColor(ww_display, (flags & DCM_BORDER_COLOR) >> 8);
|
||||||
|
#else /* <20><><EFBFBD>顼<EFBFBD>б<EFBFBD><D0B1>ǡ<EFBFBD><C7A1>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>ϣ<EFBFBD><CFA3>ӥåȤ<C3A5><C8A4>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>줿 */
|
||||||
|
WWDisplay_SetBorderColor(ww_display, (flags & 0x0f00) >> 8);
|
||||||
|
#endif
|
||||||
|
|
||||||
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
@@ -115,7 +122,8 @@ unsigned int display_status(void)
|
|||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
ret |= WWDisplay_GetBorder(ww_display) << 7;
|
ret |= (unsigned short int)WWPalette_GetNumber(WWDisplay_GetBorderPalette(ww_display)) << 12;
|
||||||
|
ret |= (unsigned short int)WWDisplay_GetBorderColor(ww_display) << 8;
|
||||||
|
|
||||||
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
@@ -129,16 +137,17 @@ unsigned int display_status(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* void * data <20><><EFBFBD>ȡ<EFBFBD><C8A1>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>ä<EFBFBD> int * <20>ǥǡ<C7A5><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ꤹ<EFBFBD><EAA4B9><EFBFBD>褦<EFBFBD>ʥХ<EFBFBD><EFBFBD><EFBFBD>
|
* data <20><> char <20><> 8 <20><> 8 <20>Х<EFBFBD><EFBFBD>ȡ<EFBFBD>
|
||||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>unsigned char * data <20>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
*/
|
*/
|
||||||
void font_set_monodata(unsigned int number, unsigned int count,
|
void font_set_monodata(unsigned int number, unsigned int count,
|
||||||
unsigned char * data)
|
unsigned char * data)
|
||||||
{
|
{
|
||||||
WWCharacter c;
|
WWCharacter ww_character;
|
||||||
int i, x, y, n, p;
|
|
||||||
int f, b;
|
|
||||||
WWDisplay ww_display;
|
WWDisplay ww_display;
|
||||||
|
int i, j, k, n;
|
||||||
|
int f, b;
|
||||||
|
unsigned short int pixel;
|
||||||
|
unsigned short int bitmap;
|
||||||
|
|
||||||
if (!WonX_IsCreated()) WonX_Create();
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
@@ -146,7 +155,8 @@ void font_set_monodata(unsigned int number, unsigned int count,
|
|||||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
printf("call : font_set_monodata() : number = %u, count = %u, data = %p\n",
|
printf("call : font_set_monodata() : number = %u, count = %u, data = %p\n",
|
||||||
(int)number, (int)count, (void *)data); fflush(stdout);
|
(int)number, (int)count, (void *)data);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
@@ -155,12 +165,15 @@ void font_set_monodata(unsigned int number, unsigned int count,
|
|||||||
|
|
||||||
n = 0;
|
n = 0;
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
c = WWDisplay_GetCharacter(ww_display, number + i);
|
ww_character = WWDisplay_GetCharacter(ww_display, number + i);
|
||||||
for (y = 0; y < 8; y++) {
|
for (j = 0; j < 8; j++) {
|
||||||
for (x = 0; x < 8; x++) {
|
bitmap = 0;
|
||||||
p = (data[n] & (1 << (7 - x))) ? f : b; /*<2A><><EFBFBD><EFBFBD><EFBFBD>Ǥ褤<C7A4>Τ<EFBFBD><CEA4><EFBFBD>*/
|
for (k = 0; k < 8; k++) {
|
||||||
WWCharacter_SetPixel(c, x, y, p);
|
pixel = (data[n] & (1 << k)) ? f : b;
|
||||||
|
bitmap |= ( pixel & 1) << k;
|
||||||
|
bitmap |= ((pixel >> 1) & 1) << (k + 8);
|
||||||
}
|
}
|
||||||
|
WWCharacter_SetBitmapAsShortInt(ww_character, j, bitmap);
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -177,14 +190,14 @@ void font_set_monodata(unsigned int number, unsigned int count,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* void * data <20><><EFBFBD>ȡ<EFBFBD><C8A1>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>ä<EFBFBD> int * <20>ǥǡ<C7A5><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ꤹ<EFBFBD><EAA4B9><EFBFBD>褦<EFBFBD>ʥХ<EFBFBD><EFBFBD><EFBFBD>
|
* data <20><> short int <20><> 8 <20><> 16 <20>Х<EFBFBD><EFBFBD>ȡ<EFBFBD>
|
||||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>unsigned char * data <20>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
*/
|
*/
|
||||||
void font_set_colordata(unsigned int number, unsigned int count,
|
void font_set_colordata(unsigned int number, unsigned int count,
|
||||||
unsigned char * data)
|
unsigned short int * data)
|
||||||
{
|
{
|
||||||
WWCharacter c;
|
WWCharacter ww_character;
|
||||||
int i, x, y, n, p;
|
WWDisplay ww_display;
|
||||||
|
int i, j, n;
|
||||||
|
|
||||||
if (!WonX_IsCreated()) WonX_Create();
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
@@ -192,23 +205,16 @@ void font_set_colordata(unsigned int number, unsigned int count,
|
|||||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
printf("call : font_set_colordata() : number = %u, count = %u, data = %p\n",
|
printf("call : font_set_colordata() : number = %u, count = %u, data = %p\n",
|
||||||
(int)number, (int)count, (void *)data); fflush(stdout);
|
(int)number, (int)count, (void *)data);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
n = 0;
|
n = 0;
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
c = WWDisplay_GetCharacter(WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay()),
|
ww_character = WWDisplay_GetCharacter(ww_display, number + i);
|
||||||
number + i);
|
for (j = 0; j < 8; j++) {
|
||||||
for (y = 0; y < 8; y++) {
|
WWCharacter_SetBitmapAsShortInt(ww_character, j, data[n]);
|
||||||
for (x = 0; x < 8; x++) {
|
|
||||||
|
|
||||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>Ǥ褤<C7A4>Τ<EFBFBD><CEA4><EFBFBD>*/
|
|
||||||
p = ((data[n] & (1 << (7-x))) ? 2 : 0)
|
|
||||||
+ ((data[n + 1] & (1 << (7-x))) ? 1 : 0);
|
|
||||||
|
|
||||||
WWCharacter_SetPixel(c, x, y, p);
|
|
||||||
}
|
|
||||||
n++;
|
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -225,15 +231,15 @@ void font_set_colordata(unsigned int number, unsigned int count,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* void * data <20><><EFBFBD>ȡ<EFBFBD><C8A1>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>ä<EFBFBD> int * <20>ǥǡ<C7A5><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ꤹ<EFBFBD><EAA4B9><EFBFBD>褦<EFBFBD>ʥХ<EFBFBD><EFBFBD><EFBFBD>
|
* data <20><> short int <20><> 8 <20><> 16 <20>Х<EFBFBD><EFBFBD>ȡ<EFBFBD>
|
||||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>unsigned char * data <20>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD><EFBFBD>
|
|
||||||
*/
|
*/
|
||||||
void font_get_data(unsigned int number, unsigned int count,
|
void font_get_data(unsigned int number, unsigned int count,
|
||||||
unsigned char * data)
|
unsigned short int * data)
|
||||||
{
|
{
|
||||||
/* <20>ؿ<EFBFBD><D8BF>λ<EFBFBD><CEBB>ͤ<EFBFBD><CDA4>狼<EFBFBD><EFA4AB><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD>Ŭ<EFBFBD><C5AC><EFBFBD>˽<CBBD> */
|
/* <20>ؿ<EFBFBD><D8BF>λ<EFBFBD><CEBB>ͤ<EFBFBD><CDA4>狼<EFBFBD><EFA4AB><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD>Ŭ<EFBFBD><C5AC><EFBFBD>˽<CBBD> */
|
||||||
WWCharacter c;
|
WWCharacter ww_character;
|
||||||
int i, x, y, n, p;
|
WWDisplay ww_display;
|
||||||
|
int i, j, n;
|
||||||
|
|
||||||
if (!WonX_IsCreated()) WonX_Create();
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
@@ -241,23 +247,16 @@ void font_get_data(unsigned int number, unsigned int count,
|
|||||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
printf("call : font_get_data() : number = %u, count = %u, data = %p\n",
|
printf("call : font_get_data() : number = %u, count = %u, data = %p\n",
|
||||||
(int)number, (int)count, (void *)data); fflush(stdout);
|
(int)number, (int)count, (void *)data);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
n = 0;
|
n = 0;
|
||||||
|
|
||||||
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
||||||
c = WWDisplay_GetCharacter(WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay()),
|
ww_character = WWDisplay_GetCharacter(ww_display, number + i);
|
||||||
number + i);
|
for (j = 0; j < 8; j++) {
|
||||||
for (y = 0; y < 8; y++) {
|
data[n] = WWCharacter_GetBitmapAsShortInt(ww_character, j);
|
||||||
data[n ] = 0;
|
|
||||||
data[n+1] = 0;
|
|
||||||
for (x = 0; x < 8; x++) {
|
|
||||||
p = WWCharacter_GetPixel(c, x, y);
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>Ǥ褤<C7A4>Τ<EFBFBD><CEA4><EFBFBD> */
|
|
||||||
data[n ] |= (((unsigned char)p & 0x02) ? 1 : 0) << (7-x);
|
|
||||||
data[n+1] |= (((unsigned char)p & 0x01) ? 1 : 0) << (7-x);
|
|
||||||
}
|
|
||||||
n++;
|
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1094,17 +1093,25 @@ unsigned int palette_get_color(unsigned int palette_num)
|
|||||||
palette =
|
palette =
|
||||||
WWDisplay_GetPalette(WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay()),
|
WWDisplay_GetPalette(WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay()),
|
||||||
palette_num);
|
palette_num);
|
||||||
|
|
||||||
|
/* WonX-2.0 <20><><EFBFBD><EFBFBD><EFBFBD>Ǥϡ<C7A4>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -1 <20><><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>դ<EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4>ä<EFBFBD> */
|
||||||
WWPalette_GetMappedColors(palette, mapped_colors);
|
WWPalette_GetMappedColors(palette, mapped_colors);
|
||||||
|
|
||||||
|
#if 0 /* WonX-2.0 <20><><EFBFBD><EFBFBD><EFBFBD>Ǥϡ<C7A4>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD> */
|
||||||
|
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -1 <20><>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>0<EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD> */
|
||||||
|
for (i = 0; i < 4; i++)
|
||||||
|
if (mapped_colors[i] == -1) mapped_colors[i] = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
ret |= mapped_colors[0] & 0x07;
|
ret |= mapped_colors[0] & 0x07;
|
||||||
ret |= (mapped_colors[1] & 0x07) << 4;
|
ret |= (mapped_colors[1] & 0x07) << 4;
|
||||||
ret |= (mapped_colors[2] & 0x07) << 8;
|
ret |= (mapped_colors[2] & 0x07) << 8;
|
||||||
ret |= (mapped_colors[3] & 0x07) << 12;
|
ret |= (mapped_colors[3] & 0x07) << 12;
|
||||||
|
|
||||||
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
printf("call : palette_get_color() : return value = %u\n", (int)ret);
|
printf("call : palette_get_color() : return value = 0x%04x\n", (int)ret);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
@@ -1172,10 +1179,10 @@ unsigned long int lcd_get_color(void)
|
|||||||
ret |= ((unsigned long int)lcd_colors[1] & 0x0f) << 4;
|
ret |= ((unsigned long int)lcd_colors[1] & 0x0f) << 4;
|
||||||
ret |= ((unsigned long int)lcd_colors[2] & 0x0f) << 8;
|
ret |= ((unsigned long int)lcd_colors[2] & 0x0f) << 8;
|
||||||
ret |= ((unsigned long int)lcd_colors[3] & 0x0f) << 12;
|
ret |= ((unsigned long int)lcd_colors[3] & 0x0f) << 12;
|
||||||
ret |= (unsigned long int)lcd_colors[0] & 0x0f;
|
ret |= ((unsigned long int)lcd_colors[4] & 0x0f) << 16;
|
||||||
ret |= ((unsigned long int)lcd_colors[1] & 0x0f) << 4;
|
ret |= ((unsigned long int)lcd_colors[5] & 0x0f) << 20;
|
||||||
ret |= ((unsigned long int)lcd_colors[2] & 0x0f) << 8;
|
ret |= ((unsigned long int)lcd_colors[6] & 0x0f) << 24;
|
||||||
ret |= ((unsigned long int)lcd_colors[3] & 0x0f) << 12;
|
ret |= ((unsigned long int)lcd_colors[7] & 0x0f) << 28;
|
||||||
|
|
||||||
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
|||||||
44
etc.c
44
etc.c
@@ -1,26 +1,44 @@
|
|||||||
#include "etc.h"
|
#include "etc.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
/*===========================================================================*/
|
|
||||||
/* <20><><EFBFBD>顼<EFBFBD><E9A1BC><EFBFBD><EFBFBD> */
|
|
||||||
/*===========================================================================*/
|
|
||||||
|
|
||||||
int WonX_Error(char * funcname, char * message)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "%s(): %s\n", funcname, message);
|
|
||||||
exit (1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* "true", "false" <20><>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD> */
|
/* "true", "false" <20><>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD> */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
char * true_false(int b)
|
char * wonx_true_false(int b)
|
||||||
{
|
{
|
||||||
char * s[] = {"false", "true"};
|
char * s[] = {"false", "true"};
|
||||||
b = b ? 1 : 0;
|
b = b ? 1 : 0;
|
||||||
return (s[b]);
|
return (s[b]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* ʸ<><CAB8><EFBFBD>ν<EFBFBD><CEBD><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
int wonx_print_character(FILE * fp, unsigned char c)
|
||||||
|
{
|
||||||
|
if (c == '\n') fprintf(fp, "\\n");
|
||||||
|
else if (c == '\r') fprintf(fp, "\\r");
|
||||||
|
else if (c == '\t') fprintf(fp, "\\t");
|
||||||
|
else if (c == '\"') fprintf(fp, "\\\"");
|
||||||
|
else if (c == '\'') fprintf(fp, "\\\'");
|
||||||
|
else if (c == '\\') fprintf(fp, "\\\\");
|
||||||
|
else if (c == ' ' ) fprintf(fp, "\\s");
|
||||||
|
else if (isprint(c)) fputc(c, fp);
|
||||||
|
else fprintf(fp, "^%02x", (int)c);
|
||||||
|
fflush(fp);
|
||||||
|
return (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* 10<31>ʢ<EFBFBD>16<31><36>ʸ<EFBFBD><CAB8><EFBFBD>ؤ<EFBFBD><D8A4>Ѵ<EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
char wonx_dec_to_hex(int dec)
|
||||||
|
{
|
||||||
|
static char * dec2hex = "0123456789abcdef";
|
||||||
|
return (dec2hex[dec]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
22
etc.h
22
etc.h
@@ -1,17 +1,25 @@
|
|||||||
#ifndef _etc_h_INCLUDED_
|
#ifndef _etc_h_INCLUDED_
|
||||||
#define _etc_h_INCLUDED_
|
#define _etc_h_INCLUDED_
|
||||||
|
|
||||||
/*===========================================================================*/
|
#include <stdio.h>
|
||||||
/* <20><><EFBFBD>顼<EFBFBD><E9A1BC><EFBFBD><EFBFBD> */
|
#include <stdlib.h>
|
||||||
/*===========================================================================*/
|
|
||||||
|
|
||||||
int WonX_Error(char * funcname, char * message);
|
|
||||||
|
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
/* "true", "false" <20><>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD> */
|
/* "true", "false" <20><>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD> */
|
||||||
/*===========================================================================*/
|
/*===========================================================================*/
|
||||||
|
|
||||||
char * true_false(int b);
|
char * wonx_true_false(int b);
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* ʸ<><CAB8><EFBFBD>ν<EFBFBD><CEBD><EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
int wonx_print_character(FILE * fp, unsigned char c);
|
||||||
|
|
||||||
|
/*===========================================================================*/
|
||||||
|
/* 10<31>ʢ<EFBFBD>16<31><36>ʸ<EFBFBD><CAB8><EFBFBD>ؤ<EFBFBD><D8A4>Ѵ<EFBFBD> */
|
||||||
|
/*===========================================================================*/
|
||||||
|
|
||||||
|
char wonx_dec_to_hex(int dec);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
105
fcntl.c
Normal file
105
fcntl.c
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "wonx_configure.h"
|
||||||
|
|
||||||
|
#include "wonx/fcntl.h"
|
||||||
|
|
||||||
|
#include "WonX.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* void * <20>ǥǡ<C7A5><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4>ؿ<EFBFBD><D8BF>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ְ㤨<D6B0><E3A4A8><EFBFBD>Х<EFBFBD><D0A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* void * <20><>Ŭ<EFBFBD>ڤʷ<DAA4><CAB7><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>롥
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* X<><58><EFBFBD><EFBFBD><EFBFBD>ФȤ<D0A4>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ʤ<EFBFBD><CAA4>ʤ<EFBFBD><CAA4>ʤɤ<CAA4><C9A4><EFBFBD><EFBFBD>꤬<EFBFBD>ͤ<EFBFBD><CDA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> UNIXTimer_Pause(), UNIXTimer_Unpause() <20>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>ꡤ
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>unpause <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4>ˡ<EFBFBD>
|
||||||
|
* <20><><EFBFBD>ʤ餺 sync <20><><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ˤ<EFBFBD><CBA4>롥
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD>ޤΰ<DEA4><CEB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤΣ<DFA4><CEA3>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>꤬<EFBFBD>ФƤ<D0A4><C6A4><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ǤϤ<C7A4><CFA4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD>
|
||||||
|
* (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤϥͥ<CFA5><CDA5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>뤬<EFBFBD><EBA4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><F2A4B9A4>ؿ<EFBFBD><D8BF>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD>ϡ<EFBFBD>ɬ<EFBFBD><C9AC> static <20><><EFBFBD>̴ؿ<CCB4><D8BF>˽<EFBFBD><CBBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤȤᡤ
|
||||||
|
* <20><><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD>ƤӽФ<D3BD><D0A4>褦<EFBFBD>ˤ<EFBFBD><CBA4>뤳<EFBFBD>ȡ<EFBFBD>
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⤢<EFBFBD>뤷<EFBFBD>͡<EFBFBD>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* mmap() <20><> UNIX ɸ<><C9B8><EFBFBD>Τ<EFBFBD><CEA4>Τ<EFBFBD> WonderWitch <20>Τ<EFBFBD><CEA4>Τǥ<CEA4><C7A5><EFBFBD><EFBFBD>եꥯ<D5A5>Ȥ<EFBFBD><C8A4>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD>
|
||||||
|
* <20>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ū<EFBFBD><C5AA><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD>ͳ<EFBFBD><CDB3> README <20>Ȥ<F2BBB2BE><C8A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
#if 0
|
||||||
|
void * wonx_mmap(char * filename);
|
||||||
|
void * mmap = wonx_mmap;
|
||||||
|
#endif
|
||||||
|
#if 0
|
||||||
|
#ifdef wonx_mmap
|
||||||
|
#undef wonx_mmap
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void * wonx_mmap(char * filename)
|
||||||
|
{
|
||||||
|
int size = 10;
|
||||||
|
FILE * fp;
|
||||||
|
int i, c;
|
||||||
|
char * p;
|
||||||
|
void * ret;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : mmap() : filename = %s\n", filename);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
p = (char *)malloc(size);
|
||||||
|
if (p == NULL) WonX_Error("mmap", "cannot allocate memory.");
|
||||||
|
|
||||||
|
fp = fopen(filename, "rb");
|
||||||
|
if (fp == NULL) WonX_Error("mmap", "cannot open file.");
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
while ((c = fgetc(fp)) != EOF) {
|
||||||
|
if (i > size - 1) {
|
||||||
|
p = (char *)realloc(p, size);
|
||||||
|
if (p == NULL) WonX_Error("mmap", "cannot reallocate memory.");
|
||||||
|
}
|
||||||
|
p[i] = c;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
ret = p;
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : mmap() : return value = 0x%p\n", ret);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* End of File. */
|
||||||
|
/*****************************************************************************/
|
||||||
20
filters.perl
Normal file
20
filters.perl
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#!PATH_TO_PERL
|
||||||
|
|
||||||
|
while ($_ = shift(@ARGV)) {
|
||||||
|
if ($_ eq "-f" ) { last; }
|
||||||
|
if ($_ eq "-file") { last; }
|
||||||
|
$filters = "$filters | $_";
|
||||||
|
}
|
||||||
|
|
||||||
|
while ($filename = shift(@ARGV)) {
|
||||||
|
$command = "cat $filename$filters > $filename.tmp";
|
||||||
|
print STDERR "$command\n";
|
||||||
|
$ret = system($command);
|
||||||
|
if ($ret != 0) { die "Command not found. Install perl scripts.\n"; }
|
||||||
|
$command = "mv $filename.tmp $filename";
|
||||||
|
print STDERR "$command\n";
|
||||||
|
$ret = system($command);
|
||||||
|
if ($ret != 0) { die "Command not found.\n"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
exit (0);
|
||||||
26
findperl.sh
Normal file
26
findperl.sh
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
arg=${1}
|
||||||
|
|
||||||
|
if [ -n "${arg}" -a -x "${arg}" ]; then
|
||||||
|
whereperl="${1}"
|
||||||
|
elif [ -x /usr/local/bin/perl ]; then
|
||||||
|
whereperl="/usr/local/bin/perl"
|
||||||
|
elif [ -x /usr/pkg/bin/perl ]; then
|
||||||
|
whereperl="/usr/pkg/bin/perl"
|
||||||
|
elif [ -x /usr/bin/perl ]; then
|
||||||
|
whereperl="/usr/bin/perl"
|
||||||
|
elif which -s perl; then
|
||||||
|
whereperl=`which perl`
|
||||||
|
else
|
||||||
|
echo "Cannot find perl." 1>&2
|
||||||
|
echo -n "Input path to perl as full path (Ex. /usr/bin/perl): " 1>&2
|
||||||
|
read whereperl
|
||||||
|
if [ ! -x $whereperl ]; then
|
||||||
|
echo "Error: cannot find perl." 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "#!$whereperl"
|
||||||
|
exit 0
|
||||||
21
int2sint.perl
Normal file
21
int2sint.perl
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#!PATH_TO_PERL
|
||||||
|
|
||||||
|
while (<STDIN>) {
|
||||||
|
s/([\s;\}\/])uint(\s)/$1unsigned int$2/g;
|
||||||
|
s/^uint(\s)/unsigned int$1/g;
|
||||||
|
|
||||||
|
s/([\s;\}\/\(\)])long(\s+)int([\s\)\+\-\*\/])/$1_WONX_LONG_$2_WONX_INT_$3/g;
|
||||||
|
s/([\s;\}\/\(\)])short(\s+)int([\s\)\+\-\*\/])/$1_WONX_SHORT_$2_WONX_INT_$3/g;
|
||||||
|
s/^long(\s+)int([\s\)\+\-\*\/])/_WONX_LONG_$1_WONX_INT_$2/g;
|
||||||
|
s/^short(\s+)int([\s\)\+\-\*\/])/_WONX_SHORT_$1_WONX_INT_$2/g;
|
||||||
|
|
||||||
|
s/([\s;\}\/\(\)])int([\s\)\+\-\*\/])/$1_WONX_SHORT_ _WONX_INT_$2/g;
|
||||||
|
s/^int([\s\)\+\-\*\/])/_WONX_SHORT_ _WONX_INT_$1/g;
|
||||||
|
|
||||||
|
s/_WONX_LONG_/long/g;
|
||||||
|
s/_WONX_SHORT_/short/g;
|
||||||
|
s/_WONX_INT_/int/g;
|
||||||
|
print $_;
|
||||||
|
}
|
||||||
|
|
||||||
|
exit (0);
|
||||||
38
key.c
38
key.c
@@ -5,7 +5,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "wonx_include/key.h"
|
#include "wonx/key.h"
|
||||||
|
|
||||||
#include "WonX.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
@@ -39,10 +39,10 @@ int key_press_check(void)
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
printf("call : key_press_check() : "); fflush(stdout);
|
printf("call : key_press_check() : \n"); fflush(stdout);
|
||||||
|
|
||||||
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
||||||
XDisplay_Sync(x_display);
|
XDisplay_Flush(x_display);
|
||||||
|
|
||||||
ret = XDisplay_GetKeyPress(x_display);
|
ret = XDisplay_GetKeyPress(x_display);
|
||||||
|
|
||||||
@@ -67,10 +67,10 @@ int key_hit_check(void)
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
printf("call : key_hit_check() : "); fflush(stdout);
|
printf("call : key_hit_check() : \n"); fflush(stdout);
|
||||||
|
|
||||||
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
||||||
XDisplay_Sync(x_display);
|
XDisplay_Flush(x_display);
|
||||||
|
|
||||||
ret = XDisplay_GetKeyPress(x_display);
|
ret = XDisplay_GetKeyPress(x_display);
|
||||||
|
|
||||||
@@ -88,26 +88,38 @@ int key_hit_check(void)
|
|||||||
int key_wait(void)
|
int key_wait(void)
|
||||||
{
|
{
|
||||||
XDisplay x_display;
|
XDisplay x_display;
|
||||||
int ret;
|
volatile int ret;
|
||||||
|
|
||||||
if (!WonX_IsCreated()) WonX_Create();
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
printf("call : key_wait() : "); fflush(stdout);
|
printf("call : key_wait() : \n"); fflush(stdout);
|
||||||
|
|
||||||
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* <20>ʲ<EFBFBD><CAB2>ϥۥåȥ<C3A5><C8A5>ݥåȤˤʤ<CBA4><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD><EFBFBD>!
|
* <20>ʲ<EFBFBD><CAB2>ϥۥåȥ<C3A5><C8A5>ݥåȤˤʤ<CBA4><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD><EFBFBD>!
|
||||||
|
* key_wait() <20><><EFBFBD>˳<EFBFBD><CBB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>դ<EFBFBD><D5A4>뤿<EFBFBD><EBA4BF><EFBFBD>˰<EFBFBD><CBB0><EFBFBD>Ū<EFBFBD>˥<EFBFBD><CBA5><EFBFBD><EFBFBD>ޤ<EFBFBD> Unpause <20><><EFBFBD>롥
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤΥ<DFA4><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥγ<CFA4><CEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>߽<EFBFBD><DFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>뤿<EFBFBD>ᡤ
|
||||||
|
* do<64><6F>while <20>롼<EFBFBD><EBA1BC><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD> XDisplay_Flush() <20><>ɬ<EFBFBD><C9AC>̵<EFBFBD><CCB5><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
/*
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤˤ<DFA4><CBA4>륭<EFBFBD><EBA5AD><EFBFBD><EFBFBD><EFBFBD>Ͻ<EFBFBD><CFBD><EFBFBD><EFBFBD>˴<EFBFBD><CBB4>Ԥ<EFBFBD><D4A4>Ƥ<EFBFBD><C6A4>ä<EFBFBD><C3A4><EFBFBD> Unpause <20><><EFBFBD>뤿<EFBFBD>ᡤ
|
||||||
|
* <20>Ƥ<EFBFBD> Pause <20><><EFBFBD><EFBFBD><EFBFBD>ޤǤ<DEA4> XDisplay <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>δؿ<CEB4><D8BF>ʤɤ<CAA4><C9A4>ƤӽФ<D3BD><D0A4>Ƥ<EFBFBD>
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>ա<EFBFBD>
|
||||||
|
* (XDisplay_GetKeyPress() <20><>ñ<EFBFBD><C3B1><EFBFBD>ѿ<EFBFBD><D1BF><EFBFBD><EFBFBD>ͤ<EFBFBD><CDA4>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤΤ<CAA4><CEA4><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD><CCB5>)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
do {
|
do {
|
||||||
XDisplay_Sync(x_display);
|
#if 0 /* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> Unpause <20><><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD>ɬ<EFBFBD><C9AC> */
|
||||||
|
XDisplay_Flush(x_display);
|
||||||
|
#endif
|
||||||
ret = XDisplay_GetKeyPress(x_display);
|
ret = XDisplay_GetKeyPress(x_display);
|
||||||
} while (ret == 0);
|
} while (ret == 0);
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
@@ -127,7 +139,7 @@ void key_set_repeat(int rate, int delay)
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
printf("call : key_set_repeat() : rate = %d, delay = %d, ", rate, delay);
|
printf("call : key_set_repeat() : rate = %d, delay = %d\n", rate, delay);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
@@ -149,7 +161,7 @@ int key_get_repeat(void)
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
printf("call : key_get_repeat() : "); fflush(stdout);
|
printf("call : key_get_repeat() : \n"); fflush(stdout);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
@@ -174,10 +186,10 @@ int key_hit_check_with_repeat(void)
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
printf("call : key_hit_check_with_repeat() : "); fflush(stdout);
|
printf("call : key_hit_check_with_repeat() : \n"); fflush(stdout);
|
||||||
|
|
||||||
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
||||||
XDisplay_Sync(x_display);
|
XDisplay_Flush(x_display);
|
||||||
|
|
||||||
ret = XDisplay_GetKeyPress(x_display);
|
ret = XDisplay_GetKeyPress(x_display);
|
||||||
|
|
||||||
|
|||||||
327
libwwc.c
Normal file
327
libwwc.c
Normal file
@@ -0,0 +1,327 @@
|
|||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "wonx_configure.h"
|
||||||
|
|
||||||
|
#include "wonx/libwwc.h"
|
||||||
|
|
||||||
|
#include "WonX.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* void * <20>ǥǡ<C7A5><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4>ؿ<EFBFBD><D8BF>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ְ㤨<D6B0><E3A4A8><EFBFBD>Х<EFBFBD><D0A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* void * <20><>Ŭ<EFBFBD>ڤʷ<DAA4><CAB7><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>롥
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* X<><58><EFBFBD><EFBFBD><EFBFBD>ФȤ<D0A4>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ʤ<EFBFBD><CAA4>ʤ<EFBFBD><CAA4>ʤɤ<CAA4><C9A4><EFBFBD><EFBFBD>꤬<EFBFBD>ͤ<EFBFBD><CDA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> UNIXTimer_Pause(), UNIXTimer_Unpause() <20>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>ꡤ
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>unpause <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4>ˡ<EFBFBD>
|
||||||
|
* <20><><EFBFBD>ʤ餺 sync <20><><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ˤ<EFBFBD><CBA4>롥
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD>ޤΰ<DEA4><CEB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤΣ<DFA4><CEA3>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>꤬<EFBFBD>ФƤ<D0A4><C6A4><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ǤϤ<C7A4><CFA4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD>
|
||||||
|
* (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤϥͥ<CFA5><CDA5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>뤬<EFBFBD><EBA4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><F2A4B9A4>ؿ<EFBFBD><D8BF>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD>ϡ<EFBFBD>ɬ<EFBFBD><C9AC> static <20><><EFBFBD>̴ؿ<CCB4><D8BF>˽<EFBFBD><CBBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤȤᡤ
|
||||||
|
* <20><><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD>ƤӽФ<D3BD><D0A4>褦<EFBFBD>ˤ<EFBFBD><CBA4>뤳<EFBFBD>ȡ<EFBFBD>
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⤢<EFBFBD>뤷<EFBFBD>͡<EFBFBD>
|
||||||
|
*/
|
||||||
|
|
||||||
|
unsigned int wwc_set_color_mode(unsigned int mode)
|
||||||
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
|
unsigned int ret;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wwc_set_color_mode() : mode = 0x%04x\n", (int)mode);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
switch (mode) {
|
||||||
|
case COLOR_MODE_GRAYSCALE :
|
||||||
|
case COLOR_MODE_4COLOR :
|
||||||
|
case COLOR_MODE_16COLOR :
|
||||||
|
case COLOR_MODE_16PACKED :
|
||||||
|
break;
|
||||||
|
default :
|
||||||
|
WonX_Error("wwc_set_color_mode", "unknown color mode.");
|
||||||
|
}
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
ret = WWDisplay_SetColorMode(ww_display, mode);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤϡ<CBA4><CFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><E8A4B9> */
|
||||||
|
WWLCDPanel_SetAllDraw(WWDisplay_GetLCDPanel(ww_display));
|
||||||
|
|
||||||
|
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wwc_set_color_mode() : return value = 0x%04x\n", (int)ret);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int wwc_get_color_mode(void)
|
||||||
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
|
unsigned int ret;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wwc_get_color_mode() : \n"); fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
ret = WWDisplay_GetColorMode(ww_display);
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wwc_get_color_mode() : return value = 0x%04x\n", (int)ret);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wwc_palette_set_color(unsigned int palette_num, unsigned int color_num, unsigned int rgb)
|
||||||
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
|
WWPalette ww_palette;
|
||||||
|
unsigned short int red, green, blue;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wwc_palette_set_color() : palette_num = %u, color_num = %u, rgb = 0x%04x\n",
|
||||||
|
(int)palette_num, (int)color_num, (int)rgb);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_palette = WWDisplay_GetPalette(ww_display, palette_num);
|
||||||
|
red = (rgb >> 8) & 0x0f;
|
||||||
|
green = (rgb >> 4) & 0x0f;
|
||||||
|
blue = (rgb >> 0) & 0x0f;
|
||||||
|
WWPalette_SetRed( ww_palette, color_num, red );
|
||||||
|
WWPalette_SetGreen(ww_palette, color_num, green);
|
||||||
|
WWPalette_SetBlue( ww_palette, color_num, blue );
|
||||||
|
|
||||||
|
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wwc_palette_set_color() : return value = none\n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int wwc_palette_get_color(unsigned int palette_num, unsigned int color_num)
|
||||||
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
|
WWPalette ww_palette;
|
||||||
|
unsigned short int red, green, blue;
|
||||||
|
unsigned short int ret;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wwc_palette_get_color() : palette_num = %u, color_num = %u\n",
|
||||||
|
(int)palette_num, (int)color_num);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_palette = WWDisplay_GetPalette(ww_display, palette_num);
|
||||||
|
|
||||||
|
red = WWPalette_GetRed( ww_palette, color_num);
|
||||||
|
green = WWPalette_GetGreen(ww_palette, color_num);
|
||||||
|
blue = WWPalette_GetBlue( ww_palette, color_num);
|
||||||
|
|
||||||
|
ret = (red << 8) | (green << 4) | (blue << 0);
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wwc_palette_get_color() : return value = 0x%04x\n", (int)ret);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* data <20><> long int <20><> 8 <20><> 32 <20>Х<EFBFBD><D0A5>ȡ<EFBFBD>
|
||||||
|
*/
|
||||||
|
|
||||||
|
void wwc_font_set_colordata(unsigned int number, unsigned int count,
|
||||||
|
unsigned long int * data)
|
||||||
|
{
|
||||||
|
WWCharacter ww_character;
|
||||||
|
WWDisplay ww_display;
|
||||||
|
int i, j, n;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wwc_font_set_colordata() : number = %u, count = %u, data = %p\n",
|
||||||
|
(int)number, (int)count, (void *)data);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
n = 0;
|
||||||
|
for (i = 0; i < count; i++) {
|
||||||
|
ww_character = WWDisplay_GetCharacter(ww_display, number + i);
|
||||||
|
for (j = 0; j < 8; j++) {
|
||||||
|
WWCharacter_SetBitmapAsLongInt(ww_character, j, data[n]);
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wwc_font_set_colordata() : return value = none\n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* data <20><> long int <20><> 8 <20><> 32 <20>Х<EFBFBD><D0A5>ȡ<EFBFBD>
|
||||||
|
*/
|
||||||
|
|
||||||
|
void wwc_font_get_colordata(unsigned int number, unsigned int count,
|
||||||
|
unsigned long int * data)
|
||||||
|
{
|
||||||
|
WWCharacter ww_character;
|
||||||
|
WWDisplay ww_display;
|
||||||
|
int i, j, n;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wwc_font_get_colordata() : number = %u, count = %u, data = %p\n",
|
||||||
|
(int)number, (int)count, (void *)data);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
n = 0;
|
||||||
|
for (i = 0; i < count; i++) {
|
||||||
|
ww_character = WWDisplay_GetCharacter(ww_display, number + i);
|
||||||
|
for (j = 0; j < 8; j++) {
|
||||||
|
data[n] = WWCharacter_GetBitmapAsLongInt(ww_character, j);
|
||||||
|
n++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wwc_font_get_colordata() : return value = none\n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned int wwc_get_hardarch(void)
|
||||||
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
|
unsigned int ret;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wwc_get_hardarch() : \n"); fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
ret = WONX_DEFAULT_ARCH;
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wwc_get_hardarch() : return value = %u\n", (int)ret);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
void wwc_clear_font(void)
|
||||||
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
|
WWCharacter ww_character;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wwc_clear_font() : \n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
for (i = 0; i < 512; i++) {
|
||||||
|
ww_character = WWDisplay_GetCharacter(ww_display, i);
|
||||||
|
WWCharacter_ClearAllPixels(ww_character);
|
||||||
|
}
|
||||||
|
|
||||||
|
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wwc_clear_font() : return value = none\n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* End of File. */
|
||||||
|
/*****************************************************************************/
|
||||||
36
makefile_for_wwterm
Normal file
36
makefile_for_wwterm
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
VERSION = WWTerm-b05
|
||||||
|
PKGNAME = wwterm-b05
|
||||||
|
|
||||||
|
#OBJS = terminal.obj termlib.obj lib.obj keyboard.obj keymap.obj com.obj screen.obj escape.obj esclib.obj
|
||||||
|
#OBJS_FULL = D:\\terminal.obj D:\\termlib.obj D:\\lib.obj D:\\keyboard.obj D:\\keymap.obj D:\\com.obj D:\\screen.obj D:\\escape.obj D:\\esclib.obj
|
||||||
|
OBJS = terminal.o termlib.o lib.o keyboard.o keymap.o com.o screen.o escape.o esclib.o
|
||||||
|
|
||||||
|
#.SUFFIXES: .c .obj
|
||||||
|
.SUFFIXES: .c .o
|
||||||
|
|
||||||
|
#terminal.fx : terminal.bin
|
||||||
|
# doscmd mkfent16 D:\\terminal.cf
|
||||||
|
|
||||||
|
#terminal.bin : $(OBJS)
|
||||||
|
# echo $(OBJS_FULL) > objs
|
||||||
|
# doscmd lcc86 -O -o D:\\terminal.bin @D:\\objs
|
||||||
|
|
||||||
|
terminal : $(OBJS)
|
||||||
|
$(CC) -O -o terminal $(OBJS) -L. -L/usr/X11R6/lib -lwonx -lX11 -lXt
|
||||||
|
|
||||||
|
#.c.obj : $*.c
|
||||||
|
# doscmd lcc86 -c D:\\$*.c -O -I.
|
||||||
|
|
||||||
|
.c.o : $*.c
|
||||||
|
$(CC) -c $*.c -O -I.
|
||||||
|
|
||||||
|
clean :
|
||||||
|
# rm -f terminal.fx terminal.bin *.obj $(PKGNAME).zip
|
||||||
|
rm -f terminal *.o $(PKGNAME).zip
|
||||||
|
|
||||||
|
package : terminal.bin terminal.fx
|
||||||
|
mkdir -p $(PKGNAME)
|
||||||
|
rm -fR $(PKGNAME)/*
|
||||||
|
cp COPYING COPYRIGHT OMAKE.jpn makefile \
|
||||||
|
*.h *.c *.bin *.cf *.fx $(PKGNAME)
|
||||||
|
zip -r $(PKGNAME) $(PKGNAME)
|
||||||
16
readline.pl
16
readline.pl
@@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
|
|
||||||
use FileHandle;
|
|
||||||
|
|
||||||
$file = @ARGV[0];
|
|
||||||
|
|
||||||
open(FILE, "$file");
|
|
||||||
FILE->autoflush();
|
|
||||||
|
|
||||||
while (<FILE>) {
|
|
||||||
print "$_";
|
|
||||||
STDOUT->autoflush();
|
|
||||||
FILE->autoflush();
|
|
||||||
}
|
|
||||||
|
|
||||||
# End of program
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "wonx_include/text.h"
|
#include "wonx/text.h"
|
||||||
#include "wonx_include/key.h"
|
#include "wonx/key.h"
|
||||||
|
|
||||||
main()
|
main()
|
||||||
{
|
{
|
||||||
@@ -12,7 +12,7 @@ main()
|
|||||||
text_put_string(0, 8, " linked to program for ");
|
text_put_string(0, 8, " linked to program for ");
|
||||||
text_put_string(0, 9, " WonderWitch and behave as ");
|
text_put_string(0, 9, " WonderWitch and behave as ");
|
||||||
text_put_string(0, 10, " WonderWitch. ");
|
text_put_string(0, 10, " WonderWitch. ");
|
||||||
text_put_string(0, 12, " WonX Copyright (c) 2000 ");
|
text_put_string(0, 12, "WonX Copyright (c) 2000-2002");
|
||||||
text_put_string(0, 13, " Sakai Hiroaki. ");
|
text_put_string(0, 13, " Sakai Hiroaki. ");
|
||||||
text_put_string(0, 14, " All Rights Reserved. ");
|
text_put_string(0, 14, " All Rights Reserved. ");
|
||||||
text_put_string(0, 16, " Hit space key to exit. ");
|
text_put_string(0, 16, " Hit space key to exit. ");
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "wonx_include/disp.h"
|
#include "wonx/disp.h"
|
||||||
#include "wonx_include/key.h"
|
#include "wonx/key.h"
|
||||||
|
|
||||||
static unsigned char clear[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
static unsigned char clear[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
static unsigned char block[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
static unsigned char block[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||||
|
|||||||
35
sample3.c
Normal file
35
sample3.c
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
#include "wonx/text.h"
|
||||||
|
#include "wonx/fcntl.h"
|
||||||
|
#include "wonx/key.h"
|
||||||
|
|
||||||
|
#ifdef _WONX_
|
||||||
|
#include "wonx/wonx.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
main()
|
||||||
|
{
|
||||||
|
char * p;
|
||||||
|
int x, y, i;
|
||||||
|
|
||||||
|
text_screen_init();
|
||||||
|
p = mmap("COPYING");
|
||||||
|
|
||||||
|
#ifdef _WONX_
|
||||||
|
wonx_lcddraw_level_down();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
i = 0;
|
||||||
|
for (y = 0; y < TEXT_SCREEN_HEIGHT; y++) {
|
||||||
|
for (x = 0; x < TEXT_SCREEN_WIDTH; x++) {
|
||||||
|
text_put_char(x, y, p[i++]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _WONX_
|
||||||
|
wonx_lcddraw_level_up();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
key_wait();
|
||||||
|
|
||||||
|
bios_exit();
|
||||||
|
}
|
||||||
53
service.c
Normal file
53
service.c
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include "wonx/service.h"
|
||||||
|
|
||||||
|
#include "WonX.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD>ߡ<EFBFBD><DFA1>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
int _asm_inline(char * code) { return (0); }
|
||||||
|
int _asm_int(char * code, int ax) { return (0); }
|
||||||
|
int _asm_intb(char * code, int ax, unsigned char bl) { return (0); }
|
||||||
|
int _asm_intbb(char * code, int ax, unsigned char bl, unsigned char cl) { return (0); }
|
||||||
|
int _asm_intw(char * code, int ax, int bx) { return (0); }
|
||||||
|
int _asm_intww(char * code, int ax, int bx, int cx) { return (0); }
|
||||||
|
int _asm_intwww(char * code, int ax, int bx, int cx, int dx) { return (0); }
|
||||||
|
int _asm_intwwww(char * code, int ax, int bx, int cx, int dx, int si) { return (0); }
|
||||||
|
int _asm_intwp(char * code, int ax, int bx, int (*dummy)(void), void * dx) { return (0); }
|
||||||
|
int _asm_intwwp(char * code, int ax, int bx, int cx, void * dx) { return (0); }
|
||||||
|
int _asm_intwwwp(char * code, int ax, int bx, int cx, int dx, void * si) { return (0); }
|
||||||
|
int _asm_intwfp(char * code, int ax, int bx, void * dsdx) { return (0); }
|
||||||
|
int _asm_intfp(char * code, int ax, void * bxdx) { return (0); }
|
||||||
|
|
||||||
|
long int _asm_intl(char * code, int ax) { return (0); }
|
||||||
|
long int _asm_intlw(char * code, int ax, int bx) { return (0); }
|
||||||
|
long int _asm_intlww(char * code, int ax, int bx, int cx) { return (0); }
|
||||||
|
long int _asm_intlwww(char * code, int ax, int bx, int cx, int dx) { return (0); }
|
||||||
|
long int _asm_intlwwww(char * code, int ax, int bx, int cx, int dx, int si) { return (0); }
|
||||||
|
long int _asm_intlwp(char * code, int ax, int bx, int (*dummy)(void), void * dx) { return (0); }
|
||||||
|
long int _asm_intlwwp(char * code, int ax, int bx, int cx, void * dx) { return (0); }
|
||||||
|
long int _asm_intlwwwp(char * code, int ax, int bx, int cx, int dx, void * si) { return (0); }
|
||||||
|
long int _asm_intlwfp(char * code, int ax, int bx, void * dsdx) { return (0); }
|
||||||
|
|
||||||
|
void bios_exit()
|
||||||
|
{
|
||||||
|
printf("call : bios_exit() : \n");
|
||||||
|
fflush(stdout);
|
||||||
|
if (WonX_IsCreated()) WonX_Destroy();
|
||||||
|
exit (0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* End of File. */
|
||||||
|
/*****************************************************************************/
|
||||||
2
sound.c
2
sound.c
@@ -5,7 +5,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "wonx_include/sound.h"
|
#include "wonx/sound.h"
|
||||||
|
|
||||||
#include "WonX.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
|
|||||||
20
sout2str.perl
Normal file
20
sout2str.perl
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#!PATH_TO_PERL
|
||||||
|
|
||||||
|
use FileHandle;
|
||||||
|
|
||||||
|
while (<STDIN>) {
|
||||||
|
if (/output to serial port : /) {
|
||||||
|
($string) = /output to serial port : \"(.*)\"\n$/;
|
||||||
|
$string =~ s/\\n/\n/g;
|
||||||
|
$string =~ s/\\r/\n/g;
|
||||||
|
$string =~ s/\\t/\t/g;
|
||||||
|
$string =~ s/\\\"/\"/g;
|
||||||
|
$string =~ s/\\\'/\'/g;
|
||||||
|
$string =~ s/\\\\/\\/g;
|
||||||
|
$string =~ s/\\s/ /g;
|
||||||
|
print "$string";
|
||||||
|
STDOUT->autoflush();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
exit (0);
|
||||||
16
sout2str.pl
16
sout2str.pl
@@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
|
|
||||||
use FileHandle;
|
|
||||||
|
|
||||||
while (<STDIN>) {
|
|
||||||
if (/output to serial port : /) {
|
|
||||||
($string) = /output to serial port : (.*)/;
|
|
||||||
$string =~ s/\\n/\n/;
|
|
||||||
$string =~ s/\\r/\n/;
|
|
||||||
$string =~ s/\\t/\t/;
|
|
||||||
print "$string";
|
|
||||||
STDOUT->autoflush();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# End of program
|
|
||||||
8
sys2wonx.perl
Normal file
8
sys2wonx.perl
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!PATH_TO_PERL
|
||||||
|
|
||||||
|
while (<STDIN>) {
|
||||||
|
s/^(\s*\#\s*include\s*)[\<\"]sys\/(.+\.h)[\>\"]/$1\"wonx\/$2\"/i;
|
||||||
|
print $_;
|
||||||
|
}
|
||||||
|
|
||||||
|
exit (0);
|
||||||
14
sys2wonx.pl
14
sys2wonx.pl
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/perl
|
|
||||||
|
|
||||||
while ($FILENAME = shift(@ARGV)) {
|
|
||||||
open (RFILE, "< $FILENAME");
|
|
||||||
open (WFILE, "> $FILENAME.tmp");
|
|
||||||
while (<RFILE>) {
|
|
||||||
s/^(\s*\#\s*include\s*)[\<\"]sys\/(.+\.h)[\>\"]/$1\"wonx_include\/$2\"/i;
|
|
||||||
print WFILE $_;
|
|
||||||
}
|
|
||||||
close (RFILE);
|
|
||||||
close (WFILE);
|
|
||||||
|
|
||||||
system("mv $FILENAME.tmp $FILENAME");
|
|
||||||
}
|
|
||||||
9
system.c
9
system.c
@@ -5,7 +5,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "wonx_include/system.h"
|
#include "wonx/system.h"
|
||||||
|
|
||||||
#include "WonX.h"
|
#include "WonX.h"
|
||||||
|
|
||||||
@@ -177,13 +177,6 @@ unsigned int sys_get_resume(void)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void bios_exit()
|
|
||||||
{
|
|
||||||
printf("call : bios_exit() : \n");
|
|
||||||
fflush(stdout);
|
|
||||||
exit (0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|||||||
246
text.c
246
text.c
@@ -6,10 +6,13 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "wonx_include/text.h"
|
#include "wonx/text.h"
|
||||||
|
|
||||||
#include "WonX.h"
|
#include "WonX.h"
|
||||||
#include "WWText.h"
|
#include "WWText.h"
|
||||||
|
#include "WWDisplay.h"
|
||||||
|
#include "WWCursor.h"
|
||||||
|
#include "etc.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
/* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
@@ -33,11 +36,11 @@
|
|||||||
|
|
||||||
static void _text_window_init(int x, int y, int w, int h, unsigned int base)
|
static void _text_window_init(int x, int y, int w, int h, unsigned int base)
|
||||||
{
|
{
|
||||||
WWText ww_text;
|
|
||||||
WWDisplay ww_display;
|
WWDisplay ww_display;
|
||||||
|
WWText ww_text;
|
||||||
|
|
||||||
ww_text = WonXText_GetWWText(WonX_GetWonXText());
|
|
||||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_text = WWDisplay_GetText(ww_display);
|
||||||
|
|
||||||
WWText_SetTextWindow(ww_text, x, y, w, h, base, ww_display);
|
WWText_SetTextWindow(ww_text, x, y, w, h, base, ww_display);
|
||||||
|
|
||||||
@@ -112,11 +115,11 @@ int text_get_mode(void)
|
|||||||
|
|
||||||
static void _text_put_char(int x, int y, unsigned int c)
|
static void _text_put_char(int x, int y, unsigned int c)
|
||||||
{
|
{
|
||||||
WWText ww_text;
|
|
||||||
WWDisplay ww_display;
|
WWDisplay ww_display;
|
||||||
|
WWText ww_text;
|
||||||
|
|
||||||
ww_text = WonXText_GetWWText(WonX_GetWonXText());
|
|
||||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_text = WWDisplay_GetText(ww_display);
|
||||||
|
|
||||||
WWText_PutCharacter(ww_text, x, y, c, ww_display);
|
WWText_PutCharacter(ww_text, x, y, c, ww_display);
|
||||||
|
|
||||||
@@ -130,7 +133,9 @@ void text_put_char(int x, int y, unsigned int c)
|
|||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
printf("call : text_put_char() : x = %d, y = %d, character = %u\n", x, y, (int)c);
|
printf("call : text_put_char() : x = %d, y = %d, character = \'", x, y);
|
||||||
|
wonx_print_character(stdout, c);
|
||||||
|
printf("\'\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
_text_put_char(x, y, c);
|
_text_put_char(x, y, c);
|
||||||
@@ -148,11 +153,11 @@ void text_put_char(int x, int y, unsigned int c)
|
|||||||
static int _text_put_string(int x, int y, char * string)
|
static int _text_put_string(int x, int y, char * string)
|
||||||
{
|
{
|
||||||
int i, len, ret;
|
int i, len, ret;
|
||||||
WWText ww_text;
|
|
||||||
WWDisplay ww_display;
|
WWDisplay ww_display;
|
||||||
|
WWText ww_text;
|
||||||
|
|
||||||
ww_text = WonXText_GetWWText(WonX_GetWonXText());
|
|
||||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_text = WWDisplay_GetText(ww_display);
|
||||||
|
|
||||||
len = strlen(string);
|
len = strlen(string);
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@@ -167,13 +172,16 @@ static int _text_put_string(int x, int y, char * string)
|
|||||||
int text_put_string(int x, int y, char * string)
|
int text_put_string(int x, int y, char * string)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
char * p;
|
||||||
|
|
||||||
if (!WonX_IsCreated()) WonX_Create();
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
printf("call : text_put_string() : x = %d, y = %d, string = %s\n", x, y, string);
|
printf("call : text_put_string() : x = %d, y = %d, string = \"", x, y);
|
||||||
|
for (p = string; *p != '\0'; p++) wonx_print_character(stdout, *p);
|
||||||
|
printf("\"\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
ret = _text_put_string(x, y, string);
|
ret = _text_put_string(x, y, string);
|
||||||
@@ -192,19 +200,21 @@ int text_put_string(int x, int y, char * string)
|
|||||||
int text_put_substring(int x, int y, char * s, int length)
|
int text_put_substring(int x, int y, char * s, int length)
|
||||||
{
|
{
|
||||||
int i, ret;
|
int i, ret;
|
||||||
WWText ww_text;
|
|
||||||
WWDisplay ww_display;
|
WWDisplay ww_display;
|
||||||
|
WWText ww_text;
|
||||||
|
|
||||||
if (!WonX_IsCreated()) WonX_Create();
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
printf("call : text_put_substring() : x = %d, y = %d, string = %s, length = %d\n", x, y, s, length);
|
printf("call : text_put_substring() : x = %d, y = %d, length = %d, string = \"", x, y, length);
|
||||||
|
for (i = 0; i < length; i++) wonx_print_character(stdout, s[i]);
|
||||||
|
printf("\"\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
ww_text = WonXText_GetWWText(WonX_GetWonXText());
|
|
||||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_text = WWDisplay_GetText(ww_display);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
for (i = 0; i < length; i++) {
|
for (i = 0; i < length; i++) {
|
||||||
@@ -292,8 +302,8 @@ void text_fill_char(int x, int y, int length, int c)
|
|||||||
|
|
||||||
void text_set_palette(int palette_num)
|
void text_set_palette(int palette_num)
|
||||||
{
|
{
|
||||||
WWText ww_text;
|
|
||||||
WWDisplay ww_display;
|
WWDisplay ww_display;
|
||||||
|
WWText ww_text;
|
||||||
|
|
||||||
if (!WonX_IsCreated()) WonX_Create();
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
@@ -303,8 +313,8 @@ void text_set_palette(int palette_num)
|
|||||||
printf("call : text_set_palette() : palette = %d\n", palette_num);
|
printf("call : text_set_palette() : palette = %d\n", palette_num);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
ww_text = WonXText_GetWWText(WonX_GetWonXText());
|
|
||||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_text = WWDisplay_GetText(ww_display);
|
||||||
|
|
||||||
WWText_SetPalette(ww_text, WWDisplay_GetPalette(ww_display, palette_num));
|
WWText_SetPalette(ww_text, WWDisplay_GetPalette(ww_display, palette_num));
|
||||||
|
|
||||||
@@ -321,6 +331,7 @@ void text_set_palette(int palette_num)
|
|||||||
|
|
||||||
int text_get_palette(void)
|
int text_get_palette(void)
|
||||||
{
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
WWText ww_text;
|
WWText ww_text;
|
||||||
int num;
|
int num;
|
||||||
|
|
||||||
@@ -332,7 +343,8 @@ int text_get_palette(void)
|
|||||||
printf("call : text_get_palette() : \n");
|
printf("call : text_get_palette() : \n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
ww_text = WonXText_GetWWText(WonX_GetWonXText());
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_text = WWDisplay_GetText(ww_display);
|
||||||
|
|
||||||
num = WWPalette_GetNumber(WWText_GetPalette(ww_text));
|
num = WWPalette_GetNumber(WWText_GetPalette(ww_text));
|
||||||
|
|
||||||
@@ -361,8 +373,8 @@ void text_get_fontdata(int c, void * buffer)
|
|||||||
|
|
||||||
void text_set_screen(int screen)
|
void text_set_screen(int screen)
|
||||||
{
|
{
|
||||||
WWText ww_text;
|
|
||||||
WWDisplay ww_display;
|
WWDisplay ww_display;
|
||||||
|
WWText ww_text;
|
||||||
|
|
||||||
if (!WonX_IsCreated()) WonX_Create();
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
@@ -372,8 +384,8 @@ void text_set_screen(int screen)
|
|||||||
printf("call : text_set_screen() : screen = %d\n", screen);
|
printf("call : text_set_screen() : screen = %d\n", screen);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
ww_text = WonXText_GetWWText(WonX_GetWonXText());
|
|
||||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_text = WWDisplay_GetText(ww_display);
|
||||||
|
|
||||||
WWText_SetScreen(ww_text, WWDisplay_GetScreen(ww_display, screen));
|
WWText_SetScreen(ww_text, WWDisplay_GetScreen(ww_display, screen));
|
||||||
|
|
||||||
@@ -390,6 +402,7 @@ void text_set_screen(int screen)
|
|||||||
|
|
||||||
int text_get_screen(void)
|
int text_get_screen(void)
|
||||||
{
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
WWText ww_text;
|
WWText ww_text;
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
@@ -401,7 +414,8 @@ int text_get_screen(void)
|
|||||||
printf("call : text_get_screen() : \n");
|
printf("call : text_get_screen() : \n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
|
||||||
ww_text = WonXText_GetWWText(WonX_GetWonXText());
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_text = WWDisplay_GetText(ww_display);
|
||||||
|
|
||||||
n = WWScreen_GetNumber(WWText_GetScreen(ww_text));
|
n = WWScreen_GetNumber(WWText_GetScreen(ww_text));
|
||||||
|
|
||||||
@@ -418,29 +432,219 @@ int text_get_screen(void)
|
|||||||
|
|
||||||
void cursor_display(int flag)
|
void cursor_display(int flag)
|
||||||
{
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
|
WWCursor ww_cursor;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : cursor_display() : flag = %d\n", flag);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_cursor = WWDisplay_GetCursor(ww_display);
|
||||||
|
|
||||||
|
switch (flag) {
|
||||||
|
case 0: WWCursor_OFF(ww_cursor); break;
|
||||||
|
case 1: WWCursor_ON( ww_cursor); break;
|
||||||
|
default:
|
||||||
|
WonX_Warning("cursor_display", "Cursor flag is 0 or 1.");
|
||||||
|
WWCursor_ON(ww_cursor); /* <20><><EFBFBD><EFBFBD> ON <20>ˤ<EFBFBD><CBA4>Ȥ<EFBFBD> */
|
||||||
|
}
|
||||||
|
|
||||||
|
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : cursor_display() : return value = none\n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cursor_status(void)
|
int cursor_status(void)
|
||||||
{
|
{
|
||||||
return (0);
|
WWDisplay ww_display;
|
||||||
|
WWCursor ww_cursor;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : cursor_status() : \n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_cursor = WWDisplay_GetCursor(ww_display);
|
||||||
|
|
||||||
|
ret = WWCursor_IsON(ww_cursor) ? 1 : 0;
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : cursor_status() : return value = %d\n", ret);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cursor_set_location(int x, int y, int w, int h)
|
void cursor_set_location(int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
|
WWCursor ww_cursor;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : cursor_set_location() : x = %d, y = %d, w = %d, h = %d\n",
|
||||||
|
x, y, w, h);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_cursor = WWDisplay_GetCursor(ww_display);
|
||||||
|
|
||||||
|
if (x < 0)
|
||||||
|
WonX_Warning("cursor_set_location", "Value of x is too small.");
|
||||||
|
if (x > TEXT_SCREEN_WIDTH - 1)
|
||||||
|
WonX_Warning("cursor_set_location", "Value of x is too large.");
|
||||||
|
if (y < 0)
|
||||||
|
WonX_Warning("cursor_set_location", "Value of y is too small.");
|
||||||
|
if (y > TEXT_SCREEN_HEIGHT - 1)
|
||||||
|
WonX_Warning("cursor_set_location", "Value of y is too large.");
|
||||||
|
if (w <= 0)
|
||||||
|
WonX_Warning("cursor_set_location", "Value of w is too small.");
|
||||||
|
if (h <= 0)
|
||||||
|
WonX_Warning("cursor_set_location", "Value of h is too small.");
|
||||||
|
|
||||||
|
WWCursor_SetX(ww_cursor, x);
|
||||||
|
WWCursor_SetY(ww_cursor, y);
|
||||||
|
WWCursor_SetWidth( ww_cursor, w);
|
||||||
|
WWCursor_SetHeight(ww_cursor, h);
|
||||||
|
|
||||||
|
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : cursor_set_location() : return value = none\n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long int cursor_get_location(void)
|
unsigned long int cursor_get_location(void)
|
||||||
{
|
{
|
||||||
return (0);
|
WWDisplay ww_display;
|
||||||
|
WWCursor ww_cursor;
|
||||||
|
unsigned long int ret;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : cursor_get_location() : \n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_cursor = WWDisplay_GetCursor(ww_display);
|
||||||
|
|
||||||
|
ret = 0;
|
||||||
|
ret |= (((unsigned long int)WWCursor_GetX( ww_cursor) & 0xff) << 0);
|
||||||
|
ret |= (((unsigned long int)WWCursor_GetY( ww_cursor) & 0xff) << 8);
|
||||||
|
ret |= (((unsigned long int)WWCursor_GetWidth( ww_cursor) & 0xff) << 16);
|
||||||
|
ret |= (((unsigned long int)WWCursor_GetHeight(ww_cursor) & 0xff) << 24);
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : cursor_get_location() : return value = 0x%08x\n", (int)ret);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
void cursor_set_type(int palette_num, int interval)
|
void cursor_set_type(int palette_num, int interval)
|
||||||
{
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
|
WWCursor ww_cursor;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : cursor_set_type() : palette = %d, interval = %d\n",
|
||||||
|
palette_num, interval);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_cursor = WWDisplay_GetCursor(ww_display);
|
||||||
|
|
||||||
|
if (palette_num < 0)
|
||||||
|
WonX_Error("cursor_set_type", "Palette number is too small.");
|
||||||
|
if (palette_num > 15)
|
||||||
|
WonX_Error("cursor_set_type", "Palette number is too large.");
|
||||||
|
if (interval < 0)
|
||||||
|
WonX_Warning("cursor_set_type", "Value of interval is too small.");
|
||||||
|
if (interval > 255)
|
||||||
|
WonX_Warning("cursor_set_type", "Value of interval is too small.");
|
||||||
|
|
||||||
|
WWCursor_SetPalette(ww_cursor,
|
||||||
|
WWDisplay_GetPalette(ww_display, palette_num));
|
||||||
|
WWCursor_SetInterval(ww_cursor, interval);
|
||||||
|
|
||||||
|
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : cursor_set_type() : return value = none\n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long int cursor_get_type(void)
|
unsigned long int cursor_get_type(void)
|
||||||
{
|
{
|
||||||
return (0);
|
WWDisplay ww_display;
|
||||||
|
WWCursor ww_cursor;
|
||||||
|
unsigned long int ret;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : cursor_get_type() : \n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_cursor = WWDisplay_GetCursor(ww_display);
|
||||||
|
|
||||||
|
ret = WWPalette_GetNumber(WWCursor_GetPalette(ww_cursor));
|
||||||
|
ret |= (((unsigned long int)WWCursor_GetInterval(ww_cursor) & 0xff) << 8);
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : cursor_get_type() : return value = 0x%08x\n", (int)ret);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return (ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
int text_printf(int x, int y, const char *format, ...)
|
int text_printf(int x, int y, const char *format, ...)
|
||||||
|
|||||||
2
timer.c
2
timer.c
@@ -6,7 +6,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#include "wonx_include/timer.h"
|
#include "wonx/timer.h"
|
||||||
|
|
||||||
#include "wonx_configure.h"
|
#include "wonx_configure.h"
|
||||||
#include "WonX.h"
|
#include "WonX.h"
|
||||||
|
|||||||
366
wonx.c
Normal file
366
wonx.c
Normal file
@@ -0,0 +1,366 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "wonx/wonx.h"
|
||||||
|
|
||||||
|
#include "WonX.h"
|
||||||
|
#include "WonXDisplay.h"
|
||||||
|
#include "WWDisplay.h"
|
||||||
|
#include "XDisplay.h"
|
||||||
|
|
||||||
|
#include "WWColorMap.h"
|
||||||
|
#include "WWPalette.h"
|
||||||
|
#include "WWCharacter.h"
|
||||||
|
#include "WWSprite.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD><CBB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WonX <20>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>ӥ<EFBFBD><D3A5>ؿ<EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* X<><58><EFBFBD><EFBFBD><EFBFBD>ФȤ<D0A4>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ʤ<EFBFBD><CAA4>ʤ<EFBFBD><CAA4>ʤɤ<CAA4><C9A4><EFBFBD><EFBFBD>꤬<EFBFBD>ͤ<EFBFBD><CDA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> UNIXTimer_Pause(), UNIXTimer_Unpause() <20>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>ꡤ
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>unpause <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4>ˡ<EFBFBD>
|
||||||
|
* <20><><EFBFBD>ʤ餺 sync <20><><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ˤ<EFBFBD><CBA4>롥
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD>ޤΰ<DEA4><CEB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤΣ<DFA4><CEA3>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>꤬<EFBFBD>ФƤ<D0A4><C6A4><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ǤϤ<C7A4><CFA4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD>
|
||||||
|
* (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤϥͥ<CFA5><CDA5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>뤬<EFBFBD><EBA4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><F2A4B9A4>ؿ<EFBFBD><D8BF>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD>ϡ<EFBFBD>ɬ<EFBFBD><C9AC> static <20><><EFBFBD>̴ؿ<CCB4><D8BF>˽<EFBFBD><CBBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤȤᡤ
|
||||||
|
* <20><><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD>ƤӽФ<D3BD><D0A4>褦<EFBFBD>ˤ<EFBFBD><CBA4>뤳<EFBFBD>ȡ<EFBFBD>
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⤢<EFBFBD>뤷<EFBFBD>͡<EFBFBD>
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>顼<EFBFBD>ޥå<C3A5><D7BE><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD> */
|
||||||
|
void wonx_print_colormap_data(void)
|
||||||
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wonx_print_colormap_data() : \n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
WWColorMap_PrintData(WWDisplay_GetColorMap(ww_display), stdout);
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wonx_print_colormap_data() : return value = none\n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20>ѥ<EFBFBD><D1A5>åȾ<C3A5><C8BE><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؿ<EFBFBD> */
|
||||||
|
static void _print_palette_data(int n)
|
||||||
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
|
WWPalette ww_palette;
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_palette = WWDisplay_GetPalette(ww_display, n);
|
||||||
|
WWPalette_PrintData(ww_palette, ww_display, stdout);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20>ѥ<EFBFBD><D1A5>åȾ<C3A5><C8BE><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD> */
|
||||||
|
void wonx_print_palette_data(int n)
|
||||||
|
{
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wonx_print_palette_data() : number = %d\n", n);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
if ((n < 0) || (n > 16 - 1))
|
||||||
|
WonX_Error("wonx_print_palette_data", "number is out of range.");
|
||||||
|
_print_palette_data(n);
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wonx_print_palette_data() : return value = none\n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>٤ƤΥѥ<CEA5><D1A5>åȾ<C3A5><C8BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
void wonx_print_all_palette_data(void)
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wonx_print_all_palette_data() : \n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
for (n = 0; n < 16; n++) _print_palette_data(n);
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wonx_print_all_palette_data() : return value = none\n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>饯<EFBFBD><E9A5AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؿ<EFBFBD> */
|
||||||
|
static void _print_character_data(int n)
|
||||||
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
|
WWCharacter ww_character;
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_character = WWDisplay_GetCharacter(ww_display, n);
|
||||||
|
WWCharacter_PrintData(ww_character, ww_display, stdout);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>饯<EFBFBD><E9A5AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD> */
|
||||||
|
void wonx_print_character_data(int n)
|
||||||
|
{
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wonx_print_character_data() : number = %d\n", n);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
if ((n < 0) || (n > 512 - 1))
|
||||||
|
WonX_Error("wonx_print_character_data", "number is out of range.");
|
||||||
|
_print_character_data(n);
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wonx_print_character_data() : return value = none\n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>٤ƤΥ<C6A4><CEA5><EFBFBD><EFBFBD>饯<EFBFBD><E9A5AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
void wonx_print_all_character_data(void)
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wonx_print_all_character_data() : \n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
for (n = 0; n < 512; n++) _print_character_data(n);
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wonx_print_all_character_data() : return value = none\n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>ץ饤<D7A5>Ⱦ<EFBFBD><C8BE><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؿ<EFBFBD> */
|
||||||
|
static void _print_sprite_data(int n)
|
||||||
|
{
|
||||||
|
WWDisplay ww_display;
|
||||||
|
WWSprite ww_sprite;
|
||||||
|
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||||
|
ww_sprite = WWDisplay_GetSprite(ww_display, n);
|
||||||
|
WWSprite_PrintData(ww_sprite, stdout);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>ץ饤<D7A5>Ⱦ<EFBFBD><C8BE><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD> */
|
||||||
|
void wonx_print_sprite_data(int n)
|
||||||
|
{
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wonx_print_sprite_data() : number = %d\n", n);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
if ((n < 0) || (n > 128 - 1))
|
||||||
|
WonX_Error("wonx_print_sprite_data", "number is out of range.");
|
||||||
|
_print_sprite_data(n);
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wonx_print_sprite_data() : return value = none\n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>٤ƤΥ<C6A4><CEA5>ץ饤<D7A5>Ⱦ<EFBFBD><C8BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
void wonx_print_all_sprite_data(void)
|
||||||
|
{
|
||||||
|
int n;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wonx_print_all_sprite_data() : \n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
for (n = 0; n < 128; n++) _print_sprite_data(n);
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wonx_print_all_sprite_data() : return value = none\n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>ߤ<EFBFBD>ɽ<EFBFBD><C9BD>/<2F><>ɽ<EFBFBD><C9BD><EFBFBD>Υ<EFBFBD><CEA5>٥<EFBFBD><D9A5>μ<EFBFBD><CEBC><EFBFBD><EFBFBD><EFBFBD>(1<>ʾ<EFBFBD><CABE><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD>0<EFBFBD>ʲ<EFBFBD><CAB2><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD>) */
|
||||||
|
int wonx_get_lcddraw_level(void)
|
||||||
|
{
|
||||||
|
XDisplay x_display;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wonx_get_lcddraw_level() : \n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
||||||
|
ret = XDisplay_GetLCDDrawLevel(x_display);
|
||||||
|
|
||||||
|
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wonx_get_lcddraw_level() : return value = %d\n", ret);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* <20><><EFBFBD>ߤ<EFBFBD>ɽ<EFBFBD><C9BD>/<2F><>ɽ<EFBFBD><C9BD><EFBFBD>Υ<EFBFBD><CEA5>٥<EFBFBD><D9A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
int wonx_set_lcddraw_level(int level)
|
||||||
|
{
|
||||||
|
XDisplay x_display;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wonx_set_lcddraw_level() : level = %d\n", level);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
||||||
|
ret = XDisplay_SetLCDDrawLevel(x_display, level);
|
||||||
|
|
||||||
|
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wonx_set_lcddraw_level() : return value = %d\n", ret);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ɽ<><C9BD><EFBFBD><EFBFBD><EFBFBD>٥<EFBFBD><D9A5><EFBFBD><F2B2BCA4><EFBFBD> */
|
||||||
|
int wonx_lcddraw_level_down(void)
|
||||||
|
{
|
||||||
|
XDisplay x_display;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wonx_lcddraw_level_down() : \n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
||||||
|
ret = XDisplay_LCDDrawLevelDown(x_display);
|
||||||
|
|
||||||
|
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wonx_lcddraw_level_down() : return value = %d\n", ret);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ɽ<><C9BD><EFBFBD><EFBFBD><EFBFBD>٥<EFBFBD><D9A5><EFBFBD><EFBFBD>夲<EFBFBD><E5A4B2> */
|
||||||
|
int wonx_lcddraw_level_up(void)
|
||||||
|
{
|
||||||
|
XDisplay x_display;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (!WonX_IsCreated()) WonX_Create();
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||||
|
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
printf("call : wonx_lcddraw_level_up() : \n");
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
||||||
|
ret = XDisplay_LCDDrawLevelUp(x_display);
|
||||||
|
|
||||||
|
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||||
|
|
||||||
|
printf("call : wonx_lcddraw_level_up() : return value = %d\n", ret);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||||
|
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||||
|
|
||||||
|
return (ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* End of File. */
|
||||||
|
/*****************************************************************************/
|
||||||
@@ -68,9 +68,9 @@ unsigned int display_status(void);
|
|||||||
void font_set_monodata(unsigned int number, unsigned int count,
|
void font_set_monodata(unsigned int number, unsigned int count,
|
||||||
unsigned char * data);
|
unsigned char * data);
|
||||||
void font_set_colordata(unsigned int number, unsigned int count,
|
void font_set_colordata(unsigned int number, unsigned int count,
|
||||||
unsigned char * data);
|
unsigned short int * data);
|
||||||
void font_get_data(unsigned int number, unsigned int count,
|
void font_get_data(unsigned int number, unsigned int count,
|
||||||
unsigned char * data);
|
unsigned short int * data);
|
||||||
void font_set_color(unsigned int colors);
|
void font_set_color(unsigned int colors);
|
||||||
unsigned int font_get_color(void);
|
unsigned int font_get_color(void);
|
||||||
void screen_set_char(int screen, int x, int y, int w, int h,
|
void screen_set_char(int screen, int x, int y, int w, int h,
|
||||||
42
wonx/fcntl.h
Normal file
42
wonx/fcntl.h
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
#ifndef _WONX_SYS_FCNTL_H_
|
||||||
|
#define _WONX_SYS_FCNTL_H_
|
||||||
|
|
||||||
|
#include "filesys.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* fcntl.h <20><> /usr/include/fcntl.h <20><><EFBFBD>ɤ߹<C9A4><DFB9><EFBFBD><EFBFBD>Ф褤<D0A4>Τǡ<CEA4>
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4>Υե<CEA5><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥϡ<C7A4>
|
||||||
|
* #include <fcntl.h>
|
||||||
|
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -Iwonx <20>Τ褦<CEA4>ˤ<EFBFBD><CBA4>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>ѥ<EFBFBD><D1A5><EFBFBD>
|
||||||
|
* <20><><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD><CBA1><EFBFBD>ʬ<EFBFBD><CAAC><EFBFBD>Ȥ<EFBFBD><C8A4>ɤ߹<C9A4><DFB9><EFBFBD><EFBFBD>Ǥ<EFBFBD><C7A4>ޤ<EFBFBD><DEA4><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||||
|
* #include </usr/include/fcntl.h>
|
||||||
|
* <20>Ȥ<EFBFBD><C8A4>ơ<EFBFBD><C6A1><EFBFBD>ʬ<EFBFBD><CAAC><EFBFBD>Ȥ<EFBFBD><C8A4>ɤ߹<C9A4><DFB9>ޤʤ<DEA4><CAA4>褦<EFBFBD>ˡ<EFBFBD>/usr/include <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>롥
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NetBSD <20><> FreeBSD <20>Ǥϡ<C7A4>/usr/include/fcntl.h <20><>
|
||||||
|
* /usr/include/sys/fcntl.h <20>Ϥޤä<DEA4><C3A4><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>Ǥ<EFBFBD><C7A4>롥
|
||||||
|
*
|
||||||
|
* Solaris <20>Ǥϡ<C7A4>/usr/include/fcntl.h <20><> /usr/include/sys/fcntl.h <20><>
|
||||||
|
* <20><><EFBFBD>롼<F3A5AFA5>ɤ<EFBFBD><C9A4>Ƥ<EFBFBD><C6A4>롥
|
||||||
|
*
|
||||||
|
* Linux <20>Ǥϡ<C7A4>/usr/include/fcntl.h <20><><EFBFBD><EFBFBD><EFBFBD>ΤˤʤäƤ<C3A4><C6A4>ơ<EFBFBD>
|
||||||
|
* /usr/include/sys/fcntl.h <20><> /usr/include/fcntl.h <20>롼<F3A5AFA5>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
* <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤʤäƤ<C3A4><C6A4>롥
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* <20><><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD>Ȥ<EFBFBD> include <20><><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD> */
|
||||||
|
#include </usr/include/fcntl.h>
|
||||||
|
#include </usr/include/sys/fcntl.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* mmap() <20><> UNIX ɸ<><C9B8><EFBFBD>Τ<EFBFBD><CEA4>Τ<EFBFBD> WonderWitch <20>Τ<EFBFBD><CEA4>Τǥ<CEA4><C7A5><EFBFBD><EFBFBD>եꥯ<D5A5>Ȥ<EFBFBD><C8A4>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD>
|
||||||
|
* <20>к<EFBFBD><D0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ū<EFBFBD><C5AA><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD>ͳ<EFBFBD><CDB3> README <20>Ȥ<F2BBB2BE><C8A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||||
|
*/
|
||||||
|
#include </usr/include/stdio.h>
|
||||||
|
/* void * mmap(char * filename); */
|
||||||
|
void * wonx_mmap(char * filename);
|
||||||
|
/* #define wonx_mmap mmap */
|
||||||
|
#define mmap wonx_mmap
|
||||||
|
|
||||||
|
#endif
|
||||||
8
wonx/filesys.h
Normal file
8
wonx/filesys.h
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#ifndef _WONX_SYS_FILESYS_H_
|
||||||
|
#define _WONX_SYS_FILESYS_H_
|
||||||
|
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#endif
|
||||||
9
wonx/indirect.h
Normal file
9
wonx/indirect.h
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#ifndef _WONX_SYS_INDIRECT_H_
|
||||||
|
#define _WONX_SYS_INDIRECT_H_
|
||||||
|
|
||||||
|
#include "service.h"
|
||||||
|
#include "filesys.h"
|
||||||
|
|
||||||
|
#warning indirect function is not supported.
|
||||||
|
|
||||||
|
#endif
|
||||||
33
wonx/libwwc.h
Normal file
33
wonx/libwwc.h
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#ifndef _WONX_SYS_LIBWWC_H_
|
||||||
|
#define _WONX_SYS_LIBWWC_H_
|
||||||
|
|
||||||
|
#include "service.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#define COLOR_MODE_GRAYSCALE 0x00
|
||||||
|
#define COLOR_MODE_4COLOR 0x80
|
||||||
|
#define COLOR_MODE_16COLOR 0xC0
|
||||||
|
#define COLOR_MODE_16PACKED 0xE0
|
||||||
|
|
||||||
|
#define HARDARCH_WS 0
|
||||||
|
#define HARDARCH_WSC 1
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
unsigned int wwc_set_color_mode(unsigned int mode);
|
||||||
|
unsigned int wwc_get_color_mode(void);
|
||||||
|
void wwc_palette_set_color(unsigned int palette_num, unsigned int color_num, unsigned int rgb);
|
||||||
|
unsigned int wwc_palette_get_color(unsigned int palette_num, unsigned int color_num);
|
||||||
|
void wwc_font_set_colordata(unsigned int number, unsigned int count,
|
||||||
|
unsigned long int * data);
|
||||||
|
void wwc_font_get_colordata(unsigned int number, unsigned int count,
|
||||||
|
unsigned long int * data);
|
||||||
|
unsigned int wwc_get_hardarch(void);
|
||||||
|
void wwc_clear_font(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user