Compare commits
4 Commits
v0.0.3-alp
...
v0.0.7-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95d1135996 | ||
|
|
3547ae13a1 | ||
|
|
0cc1bd45ae | ||
|
|
aa38e7adab |
66
HISTORY
66
HISTORY
@@ -1,5 +1,71 @@
|
||||
2000/10/5(<28><>)
|
||||
|
||||
wonx-a07 <20><><EFBFBD><EFBFBD>
|
||||
|
||||
WWLCDPanel <20>˥ӥåȥޥåץǡ<D7A5><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褷<EFBFBD><E8A4B7><EFBFBD>ӥåȥޥåפ<C3A5>
|
||||
<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><EFBFBD>
|
||||
(WWLCDPanel<65><6C>Ϣ<EFBFBD>ȡ<EFBFBD>XDisplay.c <20><> XDisplay_DrawLCDWindow() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
(XDisplay.c <20><> XDisplay_DrawLCDWindow() <20>ˤϡ<CBA4>̵<EFBFBD>̤<EFBFBD> malloc() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||
<20><><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD>ɬ<EFBFBD><C9AC>)
|
||||
|
||||
wonx-a05 <20><> wonx-a06 <20><> WWDisplay.c (WWDisplay_DrawScreen()) <20><>
|
||||
ξ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̡<EFBFBD>wonx-a05 <20>Τۤ<CEA4><DBA4><EFBFBD><EFBFBD><EFBFBD>®<EFBFBD><C2AE><EFBFBD>ä<EFBFBD><C3A4>Τǡ<CEA4>wonx-a05 <20>Τۤ<CEA4><DBA4><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><EFBFBD>뤳<EFBFBD>Ȥˤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
|
||||
|
||||
2000/10/4(<28><>)
|
||||
|
||||
wonx-a06 <20><><EFBFBD><EFBFBD>
|
||||
|
||||
WWDisplay_DrawScreen() <20>Υ<EFBFBD><CEA5>르<EFBFBD>ꥺ<EFBFBD><EAA5BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˽<EFBFBD><CBBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƹ<EFBFBD>®<EFBFBD>ˤʤ<EFBFBD><EFBFBD>ʤ<EFBFBD><EFBFBD>ä<EFBFBD><EFBFBD><EFBFBD>X <20><><EFBFBD><EFBFBD><EFBFBD>Ф<EFBFBD><D0A4><EFBFBD><EFBFBD>褬<EFBFBD>ۥåȥ<C3A5><C8A5>ݥåȤˤʤäƤ<C3A4><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD>פ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̤餹<EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD>ɬ<EFBFBD>ס<EFBFBD>
|
||||
|
||||
|
||||
|
||||
|
||||
2000/10/3(<28><>)
|
||||
|
||||
wonx-a05 <20><><EFBFBD><EFBFBD>
|
||||
|
||||
XDisplay_DrawLCDWindow() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD>̤ʷ<CAB7><D7BB><EFBFBD><EFBFBD>롼<EFBFBD>׳<EFBFBD><D7B3>˽Ф<CBBD><D0A4><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
WWDisplay_DrawScreen() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD>̤ʷ<CAB7><D7BB><EFBFBD><EFBFBD>롼<EFBFBD>׳<EFBFBD><D7B3>˽Ф<CBBD><D0A4><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
<EFBFBD>ۥåȥ<EFBFBD><EFBFBD>ݥåȤ<EFBFBD>Ĵ<EFBFBD>٤<EFBFBD><EFBFBD>顤X<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʬ(XDisplay.c <20><> XDisplay_DrawLCDWindow()<29><>
|
||||
<EFBFBD>롼<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʬ)<29><><EFBFBD>ۥåȥ<C3A5><C8A5>ݥåȤˤʤäƤ<C3A4><C6A4><EFBFBD><EFBFBD>Τǡ<CEA4><C7A1>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD>뤴<EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD>äơ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>®<EFBFBD>٤<EFBFBD><EFBFBD>夲<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
|
||||
|
||||
2000/9/30(<28><>)
|
||||
|
||||
wonx-a04 <20><><EFBFBD><EFBFBD>
|
||||
|
||||
XDisplay.c <20><><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD>롼<EFBFBD><EBA1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¿<EFBFBD><C2BF><EFBFBD><EFBFBD>®<EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
WWLCDPanel <20>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>γ<EFBFBD>Ǽ<EFBFBD><C7BC>ˡ<EFBFBD><CBA1><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
(<28><><EFBFBD>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><C7A3>Х<EFBFBD><D0A5>Ȥ<EFBFBD><C8A4>ä<EFBFBD><C3A4>Τ<CEA4><F2A1A4A3>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǣ<EFBFBD><C7A3>Х<EFBFBD><D0A5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>褦<EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD>)
|
||||
(<28><>®<EFBFBD><C2AE><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>顼<EFBFBD>б<EFBFBD>(241<34><31><EFBFBD><EFBFBD>)<29>Τ<EFBFBD><CEA4>Ȥ<EFBFBD><C8A4>ͤ<EFBFBD><CDA4><EFBFBD>)
|
||||
|
||||
WonxDisplay_Sync() <20><><EFBFBD>ɲá<C9B2>get <20>Ϥδؿ<CEB4><D8BF><EFBFBD><EFBFBD>Ǥ<EFBFBD>̵<EFBFBD>̤<EFBFBD><CCA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>餷<F2B8BAA4><E9A4B7><EFBFBD><EFBFBD>
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD>ץ饤<EFBFBD>ȥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(̤<>ƥ<EFBFBD><C6A5><EFBFBD>)
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ<EFBFBD>δؿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(timer.c)
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD>ץ饤<EFBFBD>Ȥ<EFBFBD>ͥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̤<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD>ֹ椬<D6B9>㤤<EFBFBD><E3A4A4><EFBFBD>ΤΤۤ<CEA4><DBA4><EFBFBD>ͥ<EFBFBD><CDA5><EFBFBD>פ˽<D7A4><CBBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
|
||||
|
||||
|
||||
|
||||
2000/9/28(<28><>)
|
||||
|
||||
wonx-a03 <20><><EFBFBD><EFBFBD>
|
||||
|
||||
screen2_set_window()<29><>ɽ<EFBFBD><C9BD><EFBFBD>ϰϤ<CFB0><CFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD>ޥ˥奢<EFBFBD><EFBFBD><EFBFBD><EFBFBD> screen2_set_window() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤϡ<CBA4>ɽ<EFBFBD><C9BD><EFBFBD>ΰ<EFBFBD><CEB0>β<EFBFBD><CEB2><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD>פ<EFBFBD>
|
||||
<EFBFBD>Ƥ<EFBFBD><EFBFBD>뤬<EFBFBD><EFBFBD><EFBFBD>ºݤˤϡ<EFBFBD>ɽ<EFBFBD><EFBFBD><EFBFBD>ΰ<EFBFBD><EFBFBD>β<EFBFBD><EFBFBD><EFBFBD>+1<>Ƚ<EFBFBD><C8BD><EFBFBD>+1<>פ<EFBFBD>ư<EFBFBD><EFBFBD><EEA4B9>
|
||||
|
||||
4
Makefile
4
Makefile
@@ -2,8 +2,8 @@ XINCLUDEDIR = /usr/X11R6/include
|
||||
INCLUDEDIR = .
|
||||
XLIBDIR = /usr/X11R6/lib
|
||||
|
||||
VERSION = Wonx-a03
|
||||
PKGNAME = wonx-a03
|
||||
VERSION = Wonx-a07
|
||||
PKGNAME = wonx-a07
|
||||
|
||||
OBJS = WWCharacter.o WWColorMap.o WWDisplay.o WWLCDPanel.o WWPalette.o WWScreen.o WWSprite.o WonxDisplay.o XDisplay.o bank.o comm.o disp.o text.o key.o sound.o system.o timer.o etc.o wonx.o
|
||||
|
||||
|
||||
111
WWDisplay.c
111
WWDisplay.c
@@ -24,6 +24,15 @@ int WWDisplay_GetSpriteEnable(WWDisplay d) { return (d->sprite_enable); }
|
||||
int WWDisplay_GetSpriteWindowEnable(WWDisplay d)
|
||||
{ return (d->sprite_window_enable); }
|
||||
|
||||
int WWDisplay_GetSpriteWindowX(WWDisplay d)
|
||||
{ return (d->sprite_window_x); }
|
||||
int WWDisplay_GetSpriteWindowY(WWDisplay d)
|
||||
{ return (d->sprite_window_y); }
|
||||
int WWDisplay_GetSpriteWindowWidth(WWDisplay d)
|
||||
{ return (d->sprite_window_width); }
|
||||
int WWDisplay_GetSpriteWindowHeight(WWDisplay d)
|
||||
{ return (d->sprite_window_height); }
|
||||
|
||||
int WWDisplay_GetBorder(WWDisplay d) { return (d->border); }
|
||||
|
||||
int WWDisplay_GetForegroundColor(WWDisplay d) { return (d->foreground_color); }
|
||||
@@ -54,6 +63,15 @@ int WWDisplay_SetSpriteEnable(WWDisplay d, int f)
|
||||
int WWDisplay_SetSpriteWindowEnable(WWDisplay d, int f)
|
||||
{ return (d->sprite_window_enable = f); }
|
||||
|
||||
int WWDisplay_SetSpriteWindowX(WWDisplay d, int n)
|
||||
{ return (d->sprite_window_x = n); }
|
||||
int WWDisplay_SetSpriteWindowY(WWDisplay d, int n)
|
||||
{ return (d->sprite_window_y = n); }
|
||||
int WWDisplay_SetSpriteWindowWidth(WWDisplay d, int n)
|
||||
{ return (d->sprite_window_width = n); }
|
||||
int WWDisplay_SetSpriteWindowHeight(WWDisplay d, int n)
|
||||
{ return (d->sprite_window_height = n); }
|
||||
|
||||
int WWDisplay_SetBorder(WWDisplay d, int b) { return (d->border = b); }
|
||||
|
||||
int WWDisplay_SetForegroundColor(WWDisplay d, int c)
|
||||
@@ -112,6 +130,11 @@ WWDisplay WWDisplay_Create(int lcd_panel_width, int lcd_panel_height,
|
||||
WWDisplay_SetSpriteEnable(display, 0);
|
||||
WWDisplay_SetSpriteWindowEnable(display, 0);
|
||||
|
||||
WWDisplay_SetSpriteWindowX( display, 0);
|
||||
WWDisplay_SetSpriteWindowY( display, 0);
|
||||
WWDisplay_SetSpriteWindowWidth( display, lcd_panel_width);
|
||||
WWDisplay_SetSpriteWindowHeight(display, lcd_panel_height);
|
||||
|
||||
WWDisplay_SetBorder(display, 0);
|
||||
|
||||
WWDisplay_SetForegroundColor(display, 3);
|
||||
@@ -220,15 +243,17 @@ static int WWDisplay_DrawScreen(WWDisplay display, WWScreen screen)
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ۤ<EFBFBD><DBA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
|
||||
for (y = 0; y < lcd_panel_height; y++) {
|
||||
|
||||
if (mode == WWSCREEN_INSIDE_ONLY) {
|
||||
if (y > ey) { break; }
|
||||
if (y < sy) { y = sy - 1; continue; }
|
||||
}
|
||||
|
||||
py = y + WWScreen_GetRollY(screen);
|
||||
|
||||
for (x = 0; x < lcd_panel_width; x++) {
|
||||
px = x + WWScreen_GetRollX(screen);
|
||||
py = y + WWScreen_GetRollY(screen);
|
||||
|
||||
if (mode == WWSCREEN_INSIDE_ONLY) {
|
||||
if (y > ey) {
|
||||
x = lcd_panel_width - 1; y = lcd_panel_height - 1; continue;
|
||||
}
|
||||
if (y < sy) { x = lcd_panel_width - 1; y = sy - 1; continue; }
|
||||
if (x > ex) { x = lcd_panel_width - 1; continue; }
|
||||
if (x < sx) { x = sx - 1; continue; }
|
||||
} else if (mode == WWSCREEN_OUTSIDE_ONLY) {
|
||||
@@ -238,6 +263,8 @@ static int WWDisplay_DrawScreen(WWDisplay display, WWScreen screen)
|
||||
}
|
||||
}
|
||||
|
||||
px = x + WWScreen_GetRollX(screen);
|
||||
|
||||
pixel = WWScreen_GetPixel(screen, px, py);
|
||||
|
||||
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD> */
|
||||
@@ -253,8 +280,21 @@ static int WWDisplay_DrawScreen(WWDisplay display, WWScreen screen)
|
||||
|
||||
static int WWDisplay_DrawSprite(WWDisplay display, WWSprite sprite)
|
||||
{
|
||||
int x, y;
|
||||
int pixel;
|
||||
int x, y, lcd_x, lcd_y;
|
||||
int sx, sy, ex, ey;
|
||||
int pixel, outside;
|
||||
|
||||
sx = WWDisplay_GetSpriteWindowX(display) - 1;
|
||||
sy = WWDisplay_GetSpriteWindowY(display) - 1;
|
||||
|
||||
/* <20>ʲ<EFBFBD><CAB2><EFBFBD> WWDisplay_DrawScreen() <20>˹<EFBFBD><CBB9>碌<EFBFBD><EFA4BB> */
|
||||
#if 0
|
||||
ex = sx + WWDisplay_GetSpriteWindowWidth(display) - 1;
|
||||
ey = sy + WWDisplay_GetSpriteWindowHeight(display) - 1;
|
||||
#else
|
||||
ex = sx + WWDisplay_GetSpriteWindowWidth(display);
|
||||
ey = sy + WWDisplay_GetSpriteWindowHeight(display);
|
||||
#endif
|
||||
|
||||
for (y = 0; y < 8; y++) {
|
||||
for (x = 0; x < 8; x++) {
|
||||
@@ -263,11 +303,24 @@ static int WWDisplay_DrawSprite(WWDisplay display, WWSprite sprite)
|
||||
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD> */
|
||||
if (pixel == -1) continue;
|
||||
|
||||
lcd_x = WWSprite_GetX(sprite) + x;
|
||||
lcd_y = WWSprite_GetY(sprite) + y;
|
||||
|
||||
if (WWDisplay_GetSpriteWindowEnable(display)) {
|
||||
if ( (lcd_x < sx) || (lcd_y < sy) || (lcd_x > ex) || (lcd_y > ey) )
|
||||
outside = 1;
|
||||
else
|
||||
outside = 0;
|
||||
|
||||
if (WWSprite_GetClipping(sprite)) { /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5>γ<EFBFBD>¦<EFBFBD><C2A6>ʬ<EFBFBD><CAAC>ɽ<EFBFBD><C9BD> */
|
||||
if (!outside) continue;
|
||||
} else { /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD><EFBFBD><EFBFBD>¦<EFBFBD><C2A6>ʬ<EFBFBD><CAAC>ɽ<EFBFBD><C9BD> */
|
||||
if (outside) continue;
|
||||
}
|
||||
}
|
||||
|
||||
pixel = WWColorMap_GetLCDColor(WWDisplay_GetColorMap(display), pixel);
|
||||
WWLCDPanel_SetPixel(WWDisplay_GetLCDPanel(display),
|
||||
WWSprite_GetX(sprite) + x,
|
||||
WWSprite_GetY(sprite) + y,
|
||||
pixel);
|
||||
WWLCDPanel_SetPixel(WWDisplay_GetLCDPanel(display), lcd_x, lcd_y, pixel);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,7 +339,7 @@ int WWDisplay_DrawLCDPanel(WWDisplay display)
|
||||
WWSprite sprite;
|
||||
|
||||
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);
|
||||
color_map = WWDisplay_GetColorMap(display);
|
||||
border = WWDisplay_GetBorder(display);
|
||||
@@ -300,28 +353,32 @@ int WWDisplay_DrawLCDPanel(WWDisplay display)
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EAA1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
if (WWDisplay_GetSpriteEnable(display))
|
||||
WWDisplay_DrawScreen(display, WWDisplay_GetScreen(display, 0));
|
||||
WWDisplay_DrawScreen(display, WWDisplay_GetScreen(display, 0));
|
||||
|
||||
/* <20><><EFBFBD>ץ饤<D7A5><E9A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3A3B2A4><EFBFBD>ͥ<EFBFBD><CDA5><EFBFBD>Ǥʤ<C7A4><CAA4><EFBFBD><EFBFBD><EFBFBD>) */
|
||||
for (i = 0; i < WWDisplay_GetSpriteCount(display); i++) {
|
||||
sprite = WWDisplay_GetSprite(display,
|
||||
i + WWDisplay_GetSpriteStart(display));
|
||||
if (!WWSprite_GetPriority(sprite)) {
|
||||
WWDisplay_DrawSprite(display, sprite);
|
||||
/* <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> */
|
||||
if (WWDisplay_GetSpriteEnable(display)) {
|
||||
for (i = WWDisplay_GetSpriteCount(display) - 1; i >= 0; i--) {
|
||||
sprite = WWDisplay_GetSprite(display,
|
||||
i + WWDisplay_GetSpriteStart(display));
|
||||
if (!WWSprite_GetPriority(sprite)) {
|
||||
WWDisplay_DrawSprite(display, sprite);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EAA1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
if (WWDisplay_GetSpriteEnable(display))
|
||||
WWDisplay_DrawScreen(display, WWDisplay_GetScreen(display, 1));
|
||||
WWDisplay_DrawScreen(display, WWDisplay_GetScreen(display, 1));
|
||||
|
||||
/* <20><><EFBFBD>ץ饤<D7A5><E9A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F3A3B2A4><EFBFBD>ͥ<EFBFBD><CDA5><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD>) */
|
||||
for (i = 0; i < WWDisplay_GetSpriteCount(display); i++) {
|
||||
sprite = WWDisplay_GetSprite(display,
|
||||
i + WWDisplay_GetSpriteStart(display));
|
||||
if (WWSprite_GetPriority(sprite)) {
|
||||
WWDisplay_DrawSprite(display, sprite);
|
||||
/* <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> */
|
||||
if (WWDisplay_GetSpriteEnable(display)) {
|
||||
for (i = WWDisplay_GetSpriteCount(display) - 1; i >= 0; i--) {
|
||||
sprite = WWDisplay_GetSprite(display,
|
||||
i + WWDisplay_GetSpriteStart(display));
|
||||
if (WWSprite_GetPriority(sprite)) {
|
||||
WWDisplay_DrawSprite(display, sprite);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
10
WWDisplay.h
10
WWDisplay.h
@@ -35,6 +35,11 @@ WWLCDPanel WWDisplay_GetLCDPanel(WWDisplay d);
|
||||
int WWDisplay_GetSpriteEnable(WWDisplay d);
|
||||
int WWDisplay_GetSpriteWindowEnable(WWDisplay d);
|
||||
|
||||
int WWDisplay_GetSpriteWindowX(WWDisplay d);
|
||||
int WWDisplay_GetSpriteWindowY(WWDisplay d);
|
||||
int WWDisplay_GetSpriteWindowWidth(WWDisplay d);
|
||||
int WWDisplay_GetSpriteWindowHeight(WWDisplay d);
|
||||
|
||||
int WWDisplay_GetBorder(WWDisplay d);
|
||||
|
||||
int WWDisplay_GetForegroundColor(WWDisplay d);
|
||||
@@ -57,6 +62,11 @@ WWLCDPanel WWDisplay_SetLCDPanel(WWDisplay d, WWLCDPanel p);
|
||||
int WWDisplay_SetSpriteEnable(WWDisplay d, int f);
|
||||
int WWDisplay_SetSpriteWindowEnable(WWDisplay d, int f);
|
||||
|
||||
int WWDisplay_SetSpriteWindowX(WWDisplay d, int n);
|
||||
int WWDisplay_SetSpriteWindowY(WWDisplay d, int n);
|
||||
int WWDisplay_SetSpriteWindowWidth(WWDisplay d, int n);
|
||||
int WWDisplay_SetSpriteWindowHeight(WWDisplay d, int n);
|
||||
|
||||
int WWDisplay_SetBorder(WWDisplay d, int b);
|
||||
|
||||
int WWDisplay_SetForegroundColor(WWDisplay d, int c);
|
||||
|
||||
@@ -21,8 +21,12 @@ typedef struct _WWDisplay {
|
||||
WWLCDPanel lcd_panel;
|
||||
|
||||
/* <20>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD>ץ쥤<D7A5><ECA5A4>°<EFBFBD><C2B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
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_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_x; /* <20><><EFBFBD>ץ饤<D7A5>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD> */
|
||||
int sprite_window_y; /* <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 border; /* <20>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC>0<EFBFBD><30>7<EFBFBD>Υ<EFBFBD><CEA5>顼<EFBFBD>ޥå<DEA5><C3A5>ֹ<EFBFBD> */
|
||||
|
||||
|
||||
81
WWLCDPanel.c
81
WWLCDPanel.c
@@ -13,58 +13,95 @@ int WWLCDPanel_GetHeight(WWLCDPanel p) { return (p->height); }
|
||||
int WWLCDPanel_SetWidth( WWLCDPanel p, int n) { return (p->width = n); }
|
||||
int WWLCDPanel_SetHeight(WWLCDPanel p, int n) { return (p->height = n); }
|
||||
|
||||
unsigned char * WWLCDPanel_GetPixelMap(WWLCDPanel p) { return (p->pixel); }
|
||||
int WWLCDPanel_ResetCurrent(WWLCDPanel p)
|
||||
{
|
||||
return (p->current = 0);
|
||||
}
|
||||
|
||||
int WWLCDPanel_ReverseCurrent(WWLCDPanel p)
|
||||
{
|
||||
return (p->current = 1 - p->current);
|
||||
}
|
||||
|
||||
int WWLCDPanel_ResetAllDraw(WWLCDPanel p) { return (p->all_draw = 0); }
|
||||
int WWLCDPanel_SetAllDraw(WWLCDPanel p) { return (p->all_draw = 1); }
|
||||
int WWLCDPanel_IsAllDraw(WWLCDPanel p) { return (p->all_draw); }
|
||||
|
||||
unsigned char * WWLCDPanel_GetPixelMap(WWLCDPanel p)
|
||||
{
|
||||
return (p->pixel[p->current]);
|
||||
}
|
||||
|
||||
/* LCD<43>ϣ<EFBFBD><CFA3>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD>16<31><36>(<28><><EFBFBD>ӥå<D3A5>ɬ<EFBFBD><C9AC>) */
|
||||
int WWLCDPanel_GetPixel(WWLCDPanel lcd_panel, int x, int y)
|
||||
static int WWLCDPanel_GetPixelByCurrent(WWLCDPanel lcd_panel, int current,
|
||||
int x, int y)
|
||||
{
|
||||
unsigned char 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) )
|
||||
return (-1);
|
||||
|
||||
pixel = lcd_panel->pixel[y * (WWLCDPanel_GetWidth(lcd_panel) / 2) + x / 2];
|
||||
if (x % 2) pixel = pixel >> 4;
|
||||
pixel = lcd_panel->pixel[current][y * WWLCDPanel_GetWidth(lcd_panel) + x];
|
||||
pixel &= 0x0f;
|
||||
return ((int)pixel);
|
||||
}
|
||||
|
||||
static int WWLCDPanel_GetOldPixel(WWLCDPanel lcd_panel, int x, int y)
|
||||
{
|
||||
return (WWLCDPanel_GetPixelByCurrent(lcd_panel, 1 - lcd_panel->current, x, y));
|
||||
}
|
||||
|
||||
int WWLCDPanel_GetPixel(WWLCDPanel lcd_panel, int x, int y)
|
||||
{
|
||||
return (WWLCDPanel_GetPixelByCurrent(lcd_panel, lcd_panel->current, x, y));
|
||||
}
|
||||
|
||||
int WWLCDPanel_SetPixel(WWLCDPanel lcd_panel, int x, int y, int pixel)
|
||||
{
|
||||
unsigned char p;
|
||||
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) )
|
||||
return (-1);
|
||||
|
||||
p = 0x0f;
|
||||
if (x % 2) p = p << 4;
|
||||
n = y * (WWLCDPanel_GetWidth(lcd_panel) / 2) + x / 2;
|
||||
lcd_panel->pixel[n] &= ~p;
|
||||
|
||||
p = ((unsigned char)pixel) & 0x0f;
|
||||
if (x % 2) p = p << 4;
|
||||
lcd_panel->pixel[n] |= p;
|
||||
n = y * WWLCDPanel_GetWidth(lcd_panel) + x;
|
||||
lcd_panel->pixel[lcd_panel->current][n] = p;
|
||||
|
||||
return (pixel);
|
||||
}
|
||||
|
||||
int WWLCDPanel_IsPixelChanged(WWLCDPanel lcd_panel, int x, int y)
|
||||
{
|
||||
int old_pixel;
|
||||
int current_pixel;
|
||||
|
||||
if (WWLCDPanel_IsAllDraw(lcd_panel)) return (1);
|
||||
old_pixel = WWLCDPanel_GetOldPixel(lcd_panel, x, y);
|
||||
current_pixel = WWLCDPanel_GetPixel(lcd_panel, x, y);
|
||||
|
||||
return (!(old_pixel == current_pixel));
|
||||
}
|
||||
|
||||
WWLCDPanel WWLCDPanel_Create(int width, int height)
|
||||
{
|
||||
WWLCDPanel lcd_panel;
|
||||
int x, y;
|
||||
int x, y, i;
|
||||
|
||||
lcd_panel = (WWLCDPanel)malloc(sizeof(_WWLCDPanel));
|
||||
if (lcd_panel == NULL) Error("WWLCDPanel_Create", "Cannot allocate memory.");
|
||||
|
||||
WWLCDPanel_SetWidth( lcd_panel, width);
|
||||
WWLCDPanel_SetHeight(lcd_panel, height);
|
||||
lcd_panel->pixel =
|
||||
(unsigned char *)malloc(sizeof(unsigned char) *
|
||||
(WWLCDPanel_GetWidth(lcd_panel) / 2) *
|
||||
WWLCDPanel_GetHeight(lcd_panel));
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
lcd_panel->pixel[i] =
|
||||
(unsigned char *)malloc(sizeof(unsigned char) *
|
||||
WWLCDPanel_GetWidth(lcd_panel) *
|
||||
WWLCDPanel_GetHeight(lcd_panel));
|
||||
}
|
||||
|
||||
for (y = 0; y < lcd_panel->height; y++) {
|
||||
for (x = 0; x < lcd_panel->width / 2; x++) {
|
||||
@@ -72,13 +109,19 @@ WWLCDPanel WWLCDPanel_Create(int width, int height)
|
||||
}
|
||||
}
|
||||
|
||||
WWLCDPanel_ResetCurrent(lcd_panel);
|
||||
WWLCDPanel_SetAllDraw(lcd_panel); /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̤<EFBFBD><CCA4><EFBFBD><EFBFBD>褹<EFBFBD><E8A4B9> */
|
||||
|
||||
return (lcd_panel);
|
||||
}
|
||||
|
||||
WWLCDPanel WWLCDPanel_Destroy(WWLCDPanel lcd_panel)
|
||||
{
|
||||
int i;
|
||||
if (lcd_panel == NULL) return (NULL);
|
||||
if (lcd_panel->pixel) free(lcd_panel->pixel);
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (lcd_panel->pixel[i]) free(lcd_panel->pixel[i]);
|
||||
}
|
||||
free(lcd_panel);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
@@ -21,9 +21,17 @@ int WWLCDPanel_GetWidth( WWLCDPanel p);
|
||||
int WWLCDPanel_GetHeight(WWLCDPanel p);
|
||||
int WWLCDPanel_SetWidth( WWLCDPanel p, int n);
|
||||
int WWLCDPanel_SetHeight(WWLCDPanel p, int n);
|
||||
|
||||
int WWLCDPanel_ResetCurrent(WWLCDPanel p);
|
||||
int WWLCDPanel_ReverseCurrent(WWLCDPanel p);
|
||||
int WWLCDPanel_ResetAllDraw(WWLCDPanel p);
|
||||
int WWLCDPanel_SetAllDraw(WWLCDPanel p);
|
||||
int WWLCDPanel_IsAllDraw(WWLCDPanel p);
|
||||
|
||||
unsigned char * WWLCDPanel_GetPixelMap(WWLCDPanel p);
|
||||
int WWLCDPanel_GetPixel(WWLCDPanel lcd_panel, int x, int y);
|
||||
int WWLCDPanel_SetPixel(WWLCDPanel lcd_panel, int x, int y, int pixel);
|
||||
int WWLCDPanel_IsPixelChanged(WWLCDPanel lcd_panel, int x, int y);
|
||||
WWLCDPanel WWLCDPanel_Create(int width, int height);
|
||||
WWLCDPanel WWLCDPanel_Destroy(WWLCDPanel lcd_panel);
|
||||
|
||||
|
||||
@@ -14,8 +14,19 @@
|
||||
typedef struct _WWLCDPanel {
|
||||
int width;
|
||||
int height;
|
||||
/* 16<31><36><EFBFBD>Υ<EFBFBD><CEA5>顼<EFBFBD><E9A1BC><EFBFBD><EFBFBD><F3A1A5A3>Х<EFBFBD><D0A5>Ȥǣ<C8A4><C7A3>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD>ʬ<EFBFBD>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
unsigned char * pixel;
|
||||
|
||||
/* 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>롥 */
|
||||
/* pixel[current] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υӥåȥޥåפˤʤ롥 */
|
||||
/* pixel[1 - current] <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υӥåȥޥåפˤʤ롥 */
|
||||
int current;
|
||||
|
||||
/* 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> */
|
||||
int all_draw;
|
||||
|
||||
/* 16<31><36><EFBFBD>Υ<EFBFBD><CEA5>顼<EFBFBD><E9A1BC><EFBFBD><EFBFBD><F3A1A5A3>Х<EFBFBD><D0A5>Ȥǣ<C8A4><C7A3>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD>ʬ<EFBFBD>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
unsigned char * pixel[2];
|
||||
} _WWLCDPanel;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -44,22 +44,15 @@ WonxDisplay WonxDisplay_Create(int x_width, int x_height,
|
||||
return (wonx_display);
|
||||
}
|
||||
|
||||
int WonxDisplay_Flush(WonxDisplay wonx_display)
|
||||
int WonxDisplay_Sync(WonxDisplay wonx_display)
|
||||
{
|
||||
int i;
|
||||
XDisplay x_display;
|
||||
WWDisplay ww_display;
|
||||
WWLCDPanel ww_lcd_panel;
|
||||
|
||||
x_display = WonxDisplay_GetXDisplay(wonx_display);
|
||||
ww_display = WonxDisplay_GetWWDisplay(wonx_display);
|
||||
|
||||
if (XDisplay_GetLCDDraw(x_display)) {
|
||||
WWDisplay_DrawLCDPanel(ww_display);
|
||||
ww_lcd_panel = WWDisplay_GetLCDPanel(ww_display);
|
||||
XDisplay_DrawLCDWindow(x_display, ww_lcd_panel);
|
||||
}
|
||||
|
||||
if (XDisplay_GetColorMapPrint(x_display)) {
|
||||
WWColorMap_PrintData(WWDisplay_GetColorMap(ww_display), stdout);
|
||||
XDisplay_SetColorMapPrint(x_display, 0);
|
||||
@@ -86,6 +79,28 @@ int WonxDisplay_Flush(WonxDisplay wonx_display)
|
||||
XDisplay_SetSpritePrint(x_display, 0);
|
||||
}
|
||||
|
||||
XDisplay_Sync(x_display);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int WonxDisplay_Flush(WonxDisplay wonx_display)
|
||||
{
|
||||
XDisplay x_display;
|
||||
WWDisplay ww_display;
|
||||
WWLCDPanel ww_lcd_panel;
|
||||
|
||||
x_display = WonxDisplay_GetXDisplay(wonx_display);
|
||||
ww_display = WonxDisplay_GetWWDisplay(wonx_display);
|
||||
|
||||
if (XDisplay_GetLCDDraw(x_display)) {
|
||||
WWDisplay_DrawLCDPanel(ww_display);
|
||||
ww_lcd_panel = WWDisplay_GetLCDPanel(ww_display);
|
||||
XDisplay_DrawLCDWindow(x_display, ww_lcd_panel);
|
||||
}
|
||||
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ WWDisplay WonxDisplay_GetWWDisplay(WonxDisplay wonx_display);
|
||||
WonxDisplay WonxDisplay_Create(int x_width, int x_height,
|
||||
int ww_lcd_panel_width, int ww_lcd_panel_height,
|
||||
int ww_screen_width, int ww_screen_height);
|
||||
int WonxDisplay_Sync(WonxDisplay wonx_display);
|
||||
int WonxDisplay_Flush(WonxDisplay wonx_display);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
75
XDisplay.c
75
XDisplay.c
@@ -358,16 +358,27 @@ int XDisplay_Sync(XDisplay x_display)
|
||||
|
||||
int XDisplay_DrawLCDWindow(XDisplay x_display, WWLCDPanel ww_lcd_panel)
|
||||
{
|
||||
int x, y, n;
|
||||
int px, py;
|
||||
int x, y;
|
||||
int px, py, ph;
|
||||
int num;
|
||||
XRectangle * rectangles;
|
||||
int n[16];
|
||||
XRectangle * rectangles[16];
|
||||
int pixel;
|
||||
int ww_lcd_width, ww_lcd_height;
|
||||
|
||||
/* <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> */
|
||||
/* <20>ǰ<EFBFBD><C7B0>ξ<EFBFBD><CEBE><EFBFBD>(<28>ʡ<EFBFBD><CAA1><EFBFBD><EFBFBD>ͤΤȤ<CEA4>)<29>ǡ<EFBFBD>width * height / 2 <20>ˤʤ롥 */
|
||||
num =
|
||||
WWLCDPanel_GetHeight(ww_lcd_panel) * WWLCDPanel_GetWidth(ww_lcd_panel);
|
||||
rectangles = (XRectangle *)malloc(sizeof(XRectangle) * num);
|
||||
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)
|
||||
Error("XDisplay_DrawLCDWindow", "Cannot allocate memory.");
|
||||
|
||||
@@ -376,27 +387,42 @@ int XDisplay_DrawLCDWindow(XDisplay x_display, WWLCDPanel 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> */
|
||||
|
||||
for (pixel = 0; pixel < 16; pixel++) {
|
||||
n = 0;
|
||||
for (y = 0; y < ww_lcd_height; y++) {
|
||||
for (x = 0; x < ww_lcd_width; x++) {
|
||||
if (pixel == WWLCDPanel_GetPixel(ww_lcd_panel, x, y)) {
|
||||
px = (x * x_display->width ) / ww_lcd_width;
|
||||
py = (y * x_display->height) / ww_lcd_height;
|
||||
rectangles[n].x = px;
|
||||
rectangles[n].y = py;
|
||||
rectangles[n].width = (x+1) * x_display->width / ww_lcd_width - px;
|
||||
rectangles[n].height = (y+1) * x_display->height / ww_lcd_height- py;
|
||||
n++;
|
||||
}
|
||||
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;
|
||||
|
||||
if (n > 0) {
|
||||
/* <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)) ) {
|
||||
rectangles[pixel][n[pixel]].width =
|
||||
(x+1) * x_display->width / ww_lcd_width - px;
|
||||
x++;
|
||||
}
|
||||
x--;
|
||||
|
||||
n[pixel]++;
|
||||
}
|
||||
}
|
||||
|
||||
for (pixel = 0; pixel < 16; pixel++) {
|
||||
if (n[pixel] > 0) {
|
||||
XFillRectangles(x_display->display,
|
||||
x_display->lcd_pixmap,
|
||||
x_display->color_gc[pixel],
|
||||
rectangles, n);
|
||||
rectangles[pixel], n[pixel]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,9 +430,14 @@ int XDisplay_DrawLCDWindow(XDisplay x_display, WWLCDPanel ww_lcd_panel)
|
||||
x_display->lcd_window, x_display->copy_gc,
|
||||
0, 0, x_display->width, x_display->height, 0, 0);
|
||||
|
||||
WWLCDPanel_ResetAllDraw(ww_lcd_panel);
|
||||
WWLCDPanel_ReverseCurrent(ww_lcd_panel);
|
||||
|
||||
XDisplay_Sync(x_display);
|
||||
|
||||
free(rectangles);
|
||||
for (pixel = 0; pixel < 16; pixel++) {
|
||||
free(rectangles[pixel]);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
270
disp.c
270
disp.c
@@ -19,7 +19,7 @@ void display_control(unsigned int flags)
|
||||
{
|
||||
WWDisplay ww_display;
|
||||
|
||||
printf("call : display_control() : flags = 0x%04x, ", (int)flags);
|
||||
printf("call : display_control() : flags = 0x%04x\n", (int)flags);
|
||||
fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -47,7 +47,7 @@ void display_control(unsigned int flags)
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : display_control() : return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -57,7 +57,7 @@ unsigned int display_status()
|
||||
WWDisplay ww_display;
|
||||
unsigned short int ret;
|
||||
|
||||
printf("call : display_status() : "); fflush(stdout);
|
||||
printf("call : display_status() : \n"); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -89,9 +89,10 @@ unsigned int display_status()
|
||||
|
||||
ret |= WWDisplay_GetBorder(WonxDisplay_GetWWDisplay(wonx_display)) << 7;
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = %u\n", (int)ret); fflush(stdout);
|
||||
printf("call : display_status() : return value = %u\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -103,7 +104,7 @@ void font_set_monodata(unsigned int number, unsigned int count, void * data)
|
||||
int f, b;
|
||||
unsigned char * d;
|
||||
|
||||
printf("call : font_set_monodata() : number = %u, count = %u, data = %p, ",
|
||||
printf("call : font_set_monodata() : number = %u, count = %u, data = %p\n",
|
||||
(int)number, (int)count, data); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -127,7 +128,8 @@ void font_set_monodata(unsigned int number, unsigned int count, void * data)
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : font_set_monodata() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -140,7 +142,7 @@ void font_set_colordata(unsigned int number,
|
||||
int f, b;
|
||||
unsigned char * d;
|
||||
|
||||
printf("call : font_set_colordata() : number = %u, count = %u, data = %p, ",
|
||||
printf("call : font_set_colordata() : number = %u, count = %u, data = %p\n",
|
||||
(int)number, (int)count, data); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -166,7 +168,8 @@ void font_set_colordata(unsigned int number,
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : font_set_colordata() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -180,7 +183,7 @@ void font_get_data(unsigned int number,
|
||||
int f, b;
|
||||
unsigned char * d;
|
||||
|
||||
printf("call : font_get_data() : number = %u, count = %u, data = %p, ",
|
||||
printf("call : font_get_data() : number = %u, count = %u, data = %p\n",
|
||||
(int)number, (int)count, data); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -205,9 +208,9 @@ void font_get_data(unsigned int number,
|
||||
}
|
||||
}
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : font_get_data() : return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -216,7 +219,7 @@ void font_set_color(unsigned int colors)
|
||||
{
|
||||
WWDisplay dis;
|
||||
|
||||
printf("call : font_set_color() : colors = 0x%04x, ", (int)colors);
|
||||
printf("call : font_set_color() : colors = 0x%04x\n", (int)colors);
|
||||
fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -227,7 +230,7 @@ void font_set_color(unsigned int colors)
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : font_set_color() : return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -237,7 +240,7 @@ unsigned int font_get_color(void)
|
||||
unsigned short int ret;
|
||||
WWDisplay dis;
|
||||
|
||||
printf("call : font_get_color() : "); fflush(stdout);
|
||||
printf("call : font_get_color() : \n"); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -246,9 +249,10 @@ unsigned int font_get_color(void)
|
||||
ret |= WWDisplay_GetForegroundColor(dis);
|
||||
ret |= WWDisplay_GetBackgroundColor(dis) << 2;
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%04x\n", (int)ret); fflush(stdout);
|
||||
printf("call : font_get_color() : return value = 0x%04x\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -265,7 +269,7 @@ void screen_set_char(int screen, int x, int y, int w, int h, void * data)
|
||||
WWPalette p;
|
||||
WWCharacter c;
|
||||
|
||||
printf("call : screen_set_char() : screen = %d, x = %d, y = %d, w = %d, h = %d, data = %p",
|
||||
printf("call : screen_set_char() : screen = %d, x = %d, y = %d, w = %d, h = %d, data = %p\n",
|
||||
screen, x, y, w, h, data); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -294,7 +298,7 @@ void screen_set_char(int screen, int x, int y, int w, int h, void * data)
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : screen_set_char() : return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -311,7 +315,7 @@ void screen_get_char(int screen, int x, int y, int w, int h, void * data)
|
||||
WWPalette p;
|
||||
WWCharacter c;
|
||||
|
||||
printf("call : screen_get_char() : screen = %d, x = %d, y = %d, w = %d, h = %d, data = %p",
|
||||
printf("call : screen_get_char() : screen = %d, x = %d, y = %d, w = %d, h = %d, data = %p\n",
|
||||
screen, x, y, w, h, data); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -337,28 +341,49 @@ void screen_get_char(int screen, int x, int y, int w, int h, void * data)
|
||||
}
|
||||
}
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : screen_get_char() : return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int screen_get_char1(int screen, int x, int y)
|
||||
{
|
||||
int horizontal; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȿž<C8BF>ե饰 */
|
||||
int vertical; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȿž<C8BF>ե饰 */
|
||||
int palette_num; /* <20>ѥ<EFBFBD><D1A5>å<EFBFBD><C3A5>ֹ<EFBFBD> */
|
||||
int character_num; /* ɽ<><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>饯<EFBFBD><E9A5AF> */
|
||||
WWScreen s;
|
||||
WWPalette p;
|
||||
WWCharacter c;
|
||||
unsigned short int ret;
|
||||
|
||||
printf("call : screen_get_char1() : screen = %d, x = %d, y = %d, ",
|
||||
printf("call : screen_get_char1() : screen = %d, x = %d, y = %d\n",
|
||||
screen, x, y);
|
||||
fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
screen_get_char(screen, x, y, 1, 1, &ret);
|
||||
s = WWDisplay_GetScreen(WonxDisplay_GetWWDisplay(wonx_display), screen);
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
horizontal = WWScreen_GetHorizontal(s, x, y);
|
||||
vertical = WWScreen_GetVertical( s, x, y);
|
||||
p = WWScreen_GetPalette( s, x, y);
|
||||
c = WWScreen_GetCharacter( s, x, y);
|
||||
palette_num = WWPalette_GetNumber(p);
|
||||
character_num = WWCharacter_GetNumber(c);
|
||||
|
||||
printf("return value = 0x%04x\n", (int)ret); fflush(stdout);
|
||||
ret = 0;
|
||||
ret |= horizontal << 15;
|
||||
ret |= vertical << 14;
|
||||
ret |= palette_num << 9;
|
||||
ret |= character_num;
|
||||
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("call : screen_get_char1() : return value = 0x%04x\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -375,7 +400,7 @@ void screen_fill_char(int screen, int x, int y, int w, int h,
|
||||
WWPalette p;
|
||||
WWCharacter c;
|
||||
|
||||
printf("call : screen_fill_char() : screen = %d, x = %d, y = %d, w = %d, h = %d, data = 0x%04x, ",
|
||||
printf("call : screen_fill_char() : screen = %d, x = %d, y = %d, w = %d, h = %d, data = 0x%04x\n",
|
||||
screen, x, y, w, h, (int)data); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -403,7 +428,7 @@ void screen_fill_char(int screen, int x, int y, int w, int h,
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : screen_fill_char() : return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -414,7 +439,7 @@ void screen_fill_attr(int screen, int x, int y, int w, int h,
|
||||
int i, j;
|
||||
unsigned short int c;
|
||||
|
||||
printf("call : screen_fill_attr() : screen = %d, x = %d, y = %d, w = %d, h = %d, data = 0x%04x, mask = 0x%04x, ",
|
||||
printf("call : screen_fill_attr() : screen = %d, x = %d, y = %d, w = %d, h = %d, data = 0x%04x, mask = 0x%04x\n",
|
||||
screen, x, y, w, h, (int)data, (int)mask); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -430,14 +455,14 @@ void screen_fill_attr(int screen, int x, int y, int w, int h,
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : screen_fill_attr() : return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void sprite_set_range(unsigned int sprite_start, unsigned int sprite_count)
|
||||
{
|
||||
printf("call : sprite_set_range() : start = %u, count = %u, ",
|
||||
printf("call : sprite_set_range() : start = %u, count = %u\n",
|
||||
(int)sprite_start, (int)sprite_count); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -449,19 +474,18 @@ void sprite_set_range(unsigned int sprite_start, unsigned int sprite_count)
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : sprite_set_range() : return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void sprite_set_char(unsigned int sprite_num,
|
||||
unsigned int data)
|
||||
void sprite_set_char(unsigned int sprite_num, unsigned int data)
|
||||
{
|
||||
WWSprite s;
|
||||
WWPalette p;
|
||||
WWCharacter c;
|
||||
|
||||
printf("call : sprite_set_char() : number = %u, data = 0x%04x, ",
|
||||
printf("call : sprite_set_char() : number = %u, data = 0x%04x\n",
|
||||
(int)sprite_num, (int)data); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -483,7 +507,7 @@ void sprite_set_char(unsigned int sprite_num,
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : sprite_set_char() : return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -495,7 +519,7 @@ unsigned int sprite_get_char(unsigned int sprite_num)
|
||||
WWCharacter c;
|
||||
unsigned short int ret;
|
||||
|
||||
printf("call : sprite_get_char() : number = %u, ", (int)sprite_num);
|
||||
printf("call : sprite_get_char() : number = %u\n", (int)sprite_num);
|
||||
fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -516,9 +540,10 @@ unsigned int sprite_get_char(unsigned int sprite_num)
|
||||
c = WWSprite_GetCharacter(s);
|
||||
ret |= WWCharacter_GetNumber(c);
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%04x\n", (int)ret); fflush(stdout);
|
||||
printf("call : sprite_get_char() : return value = 0x%04x\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -527,7 +552,7 @@ void sprite_set_location(unsigned int sprite_num, int x, int y)
|
||||
{
|
||||
WWSprite s;
|
||||
|
||||
printf("call : sprite_set_location() : number = %u, x = %d, y = %d, ",
|
||||
printf("call : sprite_set_location() : number = %u, x = %d, y = %d\n",
|
||||
(int)sprite_num, x, y); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -537,7 +562,8 @@ void sprite_set_location(unsigned int sprite_num, int x, int y)
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : sprite_set_location() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -547,21 +573,19 @@ unsigned int sprite_get_location(unsigned int sprite_num)
|
||||
WWSprite s;
|
||||
unsigned short int ret;
|
||||
|
||||
printf("call : sprite_get_location() : number = %u, ", (int)sprite_num);
|
||||
printf("call : sprite_get_location() : number = %u\n", (int)sprite_num);
|
||||
fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
s = WWDisplay_GetSprite(WonxDisplay_GetWWDisplay(wonx_display), sprite_num);
|
||||
ret = 0;
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>դǤϡ<C7A4> */
|
||||
ret |= WWSprite_GetX(s) << 8;
|
||||
ret |= WWSprite_GetY(s);
|
||||
ret = (WWSprite_GetY(s) << 8) | WWSprite_GetX(s);
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%04x\n", (int)ret); fflush(stdout);
|
||||
printf("call : sprite_get_location() : return value = 0x%04x\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -571,7 +595,7 @@ void sprite_set_char_location(unsigned int sprite_num,
|
||||
{
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
printf("call : sprite_set_char_location() : number = %u, data = 0x%04x, x = %d, y = %d, ",
|
||||
printf("call : sprite_set_char_location() : number = %u, data = 0x%04x, x = %d, y = %d\n",
|
||||
(int)sprite_num, (int)data, x, y); fflush(stdout);
|
||||
|
||||
sprite_set_char(sprite_num, data);
|
||||
@@ -579,7 +603,8 @@ void sprite_set_char_location(unsigned int sprite_num,
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : sprite_set_char_location() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -588,19 +613,20 @@ unsigned long int sprite_get_char_location(unsigned int sprite_num)
|
||||
{
|
||||
unsigned long int ret;
|
||||
|
||||
printf("call : sprite_get_char_location() : number = %u, ", (int)sprite_num);
|
||||
printf("call : sprite_get_char_location() : number = %u\n", (int)sprite_num);
|
||||
fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
ret = 0;
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>դǤϡ<C7A4> */
|
||||
ret |= sprite_get_char(sprite_num) << 16;
|
||||
ret |= sprite_get_location(sprite_num);
|
||||
ret |= ((unsigned long int)sprite_get_char(sprite_num));
|
||||
ret |= (unsigned long int)sprite_get_location(sprite_num) << 16;
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%08x\n", (int)ret); fflush(stdout);
|
||||
printf("call : sprite_get_char_location() : return value = 0x%08x\n",
|
||||
(int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -611,7 +637,7 @@ void sprite_set_data(unsigned int sprite_num, unsigned int count, void * data)
|
||||
char * d;
|
||||
unsigned long int * n;
|
||||
|
||||
printf("call : sprite_set_data() : number = %u, count = %u, data = %p",
|
||||
printf("call : sprite_set_data() : number = %u, count = %u, data = %p\n",
|
||||
(int)sprite_num, (int)count, data); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -626,7 +652,7 @@ void sprite_set_data(unsigned int sprite_num, unsigned int count, void * data)
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : sprite_set_data() : return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -635,7 +661,7 @@ void screen_set_scroll(int screen, int x, int y)
|
||||
{
|
||||
WWScreen s;
|
||||
|
||||
printf("call : screen_set_scroll() : scsreen = %d, x = %d, y = %d, ",
|
||||
printf("call : screen_set_scroll() : screen = %d, x = %d, y = %d\n",
|
||||
screen, x, y); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -646,7 +672,7 @@ void screen_set_scroll(int screen, int x, int y)
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : screen_set_scroll() : return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -656,7 +682,7 @@ unsigned int screen_get_scroll(int screen)
|
||||
unsigned short int ret;
|
||||
WWScreen s;
|
||||
|
||||
printf("call : screen_get_scroll() : screen = %d, ", screen); fflush(stdout);
|
||||
printf("call : screen_get_scroll() : screen = %d\n", screen); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -666,9 +692,10 @@ unsigned int screen_get_scroll(int screen)
|
||||
ret |= WWScreen_GetRollX(s);
|
||||
ret |= WWScreen_GetRollY(s) << 8;
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = %u\n", (int)ret); fflush(stdout);
|
||||
printf("call : screen_get_scroll() : return value = %u\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -677,7 +704,7 @@ void screen2_set_window(int x, int y, int w, int h)
|
||||
{
|
||||
WWScreen s;
|
||||
|
||||
printf("call : screen2_set_window() : x = %d, y = %d, width = %d, height = %d, ",
|
||||
printf("call : screen2_set_window() : x = %d, y = %d, width = %d, height = %d\n",
|
||||
x, y, w, h); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -690,7 +717,8 @@ void screen2_set_window(int x, int y, int w, int h)
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : screen2_set_window() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -704,39 +732,79 @@ unsigned long int screen2_get_window(void)
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
printf("call : screen2_get_window() : "); fflush(stdout);
|
||||
printf("call : screen2_get_window() : \n"); fflush(stdout);
|
||||
|
||||
s = WWDisplay_GetScreen(WonxDisplay_GetWWDisplay(wonx_display), SCREEN2);
|
||||
|
||||
|
||||
xy =
|
||||
((WWScreen_GetDrawY(s) << 8) & 0xff00) |
|
||||
(WWScreen_GetDrawX(s) & 0x00ff);
|
||||
(((unsigned short int)WWScreen_GetDrawY(s) << 8) & 0xff00) |
|
||||
((unsigned short int)WWScreen_GetDrawX(s) & 0x00ff);
|
||||
wh =
|
||||
((WWScreen_GetDrawHeight(s) << 8) & 0xff00) |
|
||||
(WWScreen_GetDrawWidth(s) & 0x00ff);
|
||||
(((unsigned short int)WWScreen_GetDrawHeight(s) << 8) & 0xff00) |
|
||||
((unsigned short int)WWScreen_GetDrawWidth(s) & 0x00ff);
|
||||
ret = ((unsigned long int)wh) << 16 | xy;
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%08x\n", (int)ret); fflush(stdout);
|
||||
printf("call : screen2_get_window() : return value = 0x%08x\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
void sprite_set_window(int x, int y, int w, int h)
|
||||
{
|
||||
WWDisplay d;
|
||||
|
||||
printf("call : sprite_set_window() : x = %d, y = %d, w = %d, h = %d\n",
|
||||
x, y, w, h);
|
||||
fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
/* <20><><EFBFBD>Ȥǽ<C7BD><F1A4AFA4><EFBFBD> */
|
||||
|
||||
d = WonxDisplay_GetWWDisplay(wonx_display);
|
||||
|
||||
WWDisplay_SetSpriteWindowX(d, x);
|
||||
WWDisplay_SetSpriteWindowY(d, y);
|
||||
WWDisplay_SetSpriteWindowWidth(d, w);
|
||||
WWDisplay_SetSpriteWindowHeight(d, h);
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("call : sprite_set_window() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned long int sprite_get_window(void)
|
||||
{
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
/* <20><><EFBFBD>Ȥǽ<C7BD><F1A4AFA4><EFBFBD> */
|
||||
WWDisplay d;
|
||||
unsigned short int xy;
|
||||
unsigned short int wh;
|
||||
unsigned long int ret;
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
printf("call : sprite_get_window() : \n");
|
||||
fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
d = WonxDisplay_GetWWDisplay(wonx_display);
|
||||
|
||||
xy =
|
||||
(((unsigned short int)WWDisplay_GetSpriteWindowY(d) << 8) & 0xff00) |
|
||||
((unsigned short int)WWDisplay_GetSpriteWindowX(d) & 0x00ff);
|
||||
wh =
|
||||
(((unsigned short int)WWDisplay_GetSpriteWindowHeight(d) << 8) & 0xff00) |
|
||||
((unsigned short int)WWDisplay_GetSpriteWindowWidth(d) & 0x00ff);
|
||||
ret = ((unsigned long int)wh) << 16 | xy;
|
||||
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("call : sprite_get_window() : return value = 0x%08x\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
void palette_set_color(unsigned int palette_num,
|
||||
@@ -745,7 +813,7 @@ void palette_set_color(unsigned int palette_num,
|
||||
int mapped_colors[4];
|
||||
WWPalette palette;
|
||||
|
||||
printf("call : palette_set_color() : number = %u, colors = 0x%04x, ",
|
||||
printf("call : palette_set_color() : number = %u, colors = 0x%04x\n",
|
||||
(int)palette_num, (int)colors); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -761,7 +829,7 @@ void palette_set_color(unsigned int palette_num,
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : palette_set_color() : return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -772,7 +840,7 @@ unsigned int palette_get_color(unsigned int palette_num)
|
||||
WWPalette palette;
|
||||
unsigned short int ret;
|
||||
|
||||
printf("call : palette_get_color() : number = %u, ", (int)palette_num);
|
||||
printf("call : palette_get_color() : number = %u\n", (int)palette_num);
|
||||
fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -787,9 +855,10 @@ unsigned int palette_get_color(unsigned int palette_num)
|
||||
ret |= (mapped_colors[2] & 0x07) << 8;
|
||||
ret |= (mapped_colors[3] & 0x07) << 12;
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = %u\n", (int)ret); fflush(stdout);
|
||||
printf("call : palette_get_color() : return value = %u\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -799,7 +868,7 @@ void lcd_set_color(unsigned int colors0, unsigned int colors1)
|
||||
WWColorMap color_map;
|
||||
int lcd_colors[8];
|
||||
|
||||
printf("call : lcd_set_color() : colors0 = 0x%04x, colors1 = 0x%04x, ",
|
||||
printf("call : lcd_set_color() : colors0 = 0x%04x, colors1 = 0x%04x\n",
|
||||
(int)colors0, (int)colors1); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
@@ -818,7 +887,7 @@ void lcd_set_color(unsigned int colors0, unsigned int colors1)
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : lcd_set_color() : return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -829,7 +898,7 @@ unsigned long int lcd_get_color(void)
|
||||
int lcd_colors[8];
|
||||
unsigned long int ret;
|
||||
|
||||
printf("call : lcd_get_color() : "); fflush(stdout);
|
||||
printf("call : lcd_get_color() : \n"); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -837,18 +906,19 @@ unsigned long int lcd_get_color(void)
|
||||
WWColorMap_GetLCDColors(color_map, lcd_colors);
|
||||
|
||||
ret = 0;
|
||||
ret |= lcd_colors[0] & 0x0f;
|
||||
ret |= (lcd_colors[1] & 0x0f) << 4;
|
||||
ret |= (lcd_colors[2] & 0x0f) << 8;
|
||||
ret |= (lcd_colors[3] & 0x0f) << 12;
|
||||
ret |= lcd_colors[0] & 0x0f;
|
||||
ret |= (lcd_colors[1] & 0x0f) << 4;
|
||||
ret |= (lcd_colors[2] & 0x0f) << 8;
|
||||
ret |= (lcd_colors[3] & 0x0f) << 12;
|
||||
ret |= (unsigned long int)lcd_colors[0] & 0x0f;
|
||||
ret |= ((unsigned long int)lcd_colors[1] & 0x0f) << 4;
|
||||
ret |= ((unsigned long int)lcd_colors[2] & 0x0f) << 8;
|
||||
ret |= ((unsigned long int)lcd_colors[3] & 0x0f) << 12;
|
||||
ret |= (unsigned long int)lcd_colors[0] & 0x0f;
|
||||
ret |= ((unsigned long int)lcd_colors[1] & 0x0f) << 4;
|
||||
ret |= ((unsigned long int)lcd_colors[2] & 0x0f) << 8;
|
||||
ret |= ((unsigned long int)lcd_colors[3] & 0x0f) << 12;
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%08x\n", (int)ret); fflush(stdout);
|
||||
printf("call : lcd_get_color() : return value = 0x%08x\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -866,7 +936,7 @@ unsigned lcd_get_segments(void)
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD>̤<EFBFBD><CCA4><EFBFBD>ݡ<EFBFBD><DDA1>Ȥ<EFBFBD><C8A4><EFBFBD> */
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
}
|
||||
|
||||
void lcd_set_sleep(unsigned sleep)
|
||||
@@ -874,7 +944,7 @@ void lcd_set_sleep(unsigned sleep)
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
/* ? */
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
}
|
||||
|
||||
unsigned lcd_get_sleep(void)
|
||||
@@ -882,21 +952,21 @@ unsigned lcd_get_sleep(void)
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
/* ? */
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
}
|
||||
|
||||
void screen_set_vram(int screen, int locationID)
|
||||
{
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
}
|
||||
|
||||
void sprite_set_vram(int locationID)
|
||||
{
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
14
key.c
14
key.c
@@ -21,6 +21,8 @@ int key_press_check(void)
|
||||
|
||||
ret = XDisplay_GetKeyPress(x_display);
|
||||
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%04x\n", (int)ret); fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
@@ -40,6 +42,8 @@ int key_hit_check(void)
|
||||
|
||||
ret = XDisplay_GetKeyPress(x_display);
|
||||
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%04x\n", (int)ret); fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
@@ -62,6 +66,8 @@ int key_wait(void)
|
||||
ret = XDisplay_GetKeyPress(x_display);
|
||||
} while (ret == 0);
|
||||
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%04x\n", (int)ret); fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
@@ -74,7 +80,11 @@ void key_set_repeat(int rate, int delay)
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int key_get_repeat(void)
|
||||
@@ -87,6 +97,8 @@ int key_get_repeat(void)
|
||||
|
||||
ret = 0;
|
||||
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%04x\n", (int)ret); fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
@@ -106,6 +118,8 @@ int key_hit_check_with_repeat(void)
|
||||
|
||||
ret = XDisplay_GetKeyPress(x_display);
|
||||
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%04x\n", (int)ret); fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
|
||||
184
timer.c
184
timer.c
@@ -1,4 +1,5 @@
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <sys/timer.h>
|
||||
|
||||
@@ -6,28 +7,185 @@
|
||||
|
||||
#include "WonxDisplay.h"
|
||||
|
||||
typedef struct {
|
||||
unsigned char year;
|
||||
unsigned char month;
|
||||
unsigned char date;
|
||||
unsigned char day_of_week;
|
||||
unsigned char hour;
|
||||
unsigned char minute;
|
||||
unsigned char second;
|
||||
} datetime_t;
|
||||
|
||||
/* int tm_year; year - 1900 */
|
||||
static int get_year(struct tm * tblock) { return (tblock->tm_year - 100); }
|
||||
/* int tm_mon; month of year (0-11) */
|
||||
static int get_month(struct tm * tblock) { return (tblock->tm_mon + 1); }
|
||||
/* int tm_mday; day of month (1-31) */
|
||||
static int get_day(struct tm * tblock) { return (tblock->tm_mday); }
|
||||
/* int tm_wday; day of week (Sunday = 0) */
|
||||
static int get_week(struct tm * tblock) { return (tblock->tm_wday); }
|
||||
/* int tm_hour; hours (0 - 23) */
|
||||
static int get_hour(struct tm * tblock) { return (tblock->tm_hour); }
|
||||
/* int tm_min; minutes (0 - 59) */
|
||||
static int get_minute(struct tm * tblock) { return (tblock->tm_min); }
|
||||
/* int tm_sec; seconds (0 - 60) */
|
||||
static int get_second(struct tm * tblock) { return (tblock->tm_sec); }
|
||||
|
||||
void rtc_set_datetime(int field, unsigned int value)
|
||||
{
|
||||
printf("call : rtc_set_datetime() : field = %d, value = %d\n",
|
||||
field, (int)value);
|
||||
fflush(stdout);
|
||||
|
||||
/* ̤<><CCA4><EFBFBD>ݡ<EFBFBD><DDA1><EFBFBD> */
|
||||
printf("call : rtc_set_datetime() : not supported\n");
|
||||
|
||||
printf("call : rtc_set_datetime() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int rtc_get_datetime(int field)
|
||||
{
|
||||
unsigned int t;
|
||||
t = (unsigned int)time(NULL); /* <20><><EFBFBD><EFBFBD><EFBFBD>ϤƤ<CFA4><C6A4>Ȥ<EFBFBD><C8A4>ʤΤǡ<CEA4><C7A1><EFBFBD><EFBFBD>Ȥǽ<C8A4><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤳<EFBFBD><EBA4B3> */
|
||||
return (t);
|
||||
unsigned int ret;
|
||||
time_t timer;
|
||||
struct tm * tblock;
|
||||
|
||||
printf("call : rtc_get_datetime() : field = %d\n", field);
|
||||
fflush(stdout);
|
||||
|
||||
time(&timer);
|
||||
tblock = localtime(&timer);
|
||||
|
||||
switch (field) {
|
||||
case RTC_YEAR : ret = get_year( tblock); break;
|
||||
case RTC_MONTH : ret = get_month( tblock); break;
|
||||
case RTC_DATE : ret = get_day( tblock); break;
|
||||
case RTC_DAY_OF_WEEK : ret = get_week( tblock); break;
|
||||
case RTC_HOUR : ret = get_hour( tblock); break;
|
||||
case RTC_MIN : ret = get_minute(tblock); break;
|
||||
case RTC_SEC : ret = get_second(tblock); break;
|
||||
}
|
||||
|
||||
printf("call : rtc_get_datetime() : return value = %d\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
void rtc_set_datetime_struct(void * buffer)
|
||||
{
|
||||
printf("call : rtc_set_datetime_struct() : buffer = %p\n", buffer);
|
||||
fflush(stdout);
|
||||
|
||||
/* ̤<><CCA4><EFBFBD>ݡ<EFBFBD><DDA1><EFBFBD> */
|
||||
printf("call : rtc_set_datetime_struct() : not supported\n");
|
||||
|
||||
printf("call : rtc_set_datetime_struct() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void rtc_get_datetime_struct(void * buffer)
|
||||
{
|
||||
time_t timer;
|
||||
struct tm * tblock;
|
||||
datetime_t * p;
|
||||
|
||||
printf("call : rtc_get_datetime_struct() : buffer = %p\n", buffer);
|
||||
fflush(stdout);
|
||||
|
||||
time(&timer);
|
||||
tblock = localtime(&timer);
|
||||
|
||||
p = (datetime_t *)buffer;
|
||||
|
||||
p->year = get_year(tblock);
|
||||
p->month = get_month(tblock);
|
||||
p->date = get_day(tblock);
|
||||
p->day_of_week = get_week(tblock);
|
||||
p->hour = get_hour(tblock);
|
||||
p->minute = get_minute(tblock);
|
||||
p->second = get_second(tblock);
|
||||
|
||||
printf("call : rtc_get_datetime_struct() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void rtc_enable_alarm(int hour, int minute)
|
||||
{
|
||||
printf("call : rtc_enable_alarm() : hour = %d, minute = %d\n", hour, minute);
|
||||
fflush(stdout);
|
||||
|
||||
/* ̤<><CCA4><EFBFBD>ݡ<EFBFBD><DDA1><EFBFBD> */
|
||||
printf("call : rtc_enable_alarm() : not supported\n");
|
||||
|
||||
printf("call : rtc_enable_alarm() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void rtc_set_datetime_struct(void * buf)
|
||||
{}
|
||||
void rtc_get_datetime_struct(void * buf)
|
||||
{}
|
||||
void rtc_enable_alarm(int hour, int min)
|
||||
{}
|
||||
void rtc_disable_alarm(void)
|
||||
{}
|
||||
{
|
||||
printf("call : rtc_disable_alarm() : \n");
|
||||
fflush(stdout);
|
||||
|
||||
/* ̤<><CCA4><EFBFBD>ݡ<EFBFBD><DDA1><EFBFBD> */
|
||||
printf("call : rtc_disable_alarm() : not supported\n");
|
||||
|
||||
printf("call : rtc_disable_alarm() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void timer_enable(int type, unsigned int auto_preset, unsigned int preset)
|
||||
{}
|
||||
{
|
||||
printf("call : timer_enable() : type = %d, auto_preset = %u, preset = %u\n",
|
||||
type, (int)auto_preset, (int)preset);
|
||||
fflush(stdout);
|
||||
|
||||
/* ̤<><CCA4><EFBFBD>ݡ<EFBFBD><DDA1><EFBFBD> */
|
||||
printf("call : timer_enable() : not supported\n");
|
||||
|
||||
printf("call : timer_enable() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void timer_disable(int type)
|
||||
{}
|
||||
{
|
||||
printf("call : timer_disable() : type = %d\n", type);
|
||||
fflush(stdout);
|
||||
|
||||
/* ̤<><CCA4><EFBFBD>ݡ<EFBFBD><DDA1><EFBFBD> */
|
||||
printf("call : timer_disable() : not supported\n");
|
||||
|
||||
printf("call : timer_disable() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int timer_get_count(int type)
|
||||
{}
|
||||
{
|
||||
unsigned int ret = 0;
|
||||
|
||||
printf("call : timer_get_count() : type = %d\n", type);
|
||||
fflush(stdout);
|
||||
|
||||
/* ̤<><CCA4><EFBFBD>ݡ<EFBFBD><DDA1><EFBFBD> */
|
||||
printf("call : timer_get_count() : not supported\n");
|
||||
|
||||
printf("call : timer_get_count() : return value = %u\n", ret);
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user