Compare commits
3 Commits
v0.0.2-alp
...
v0.0.5-alp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0cc1bd45ae | ||
|
|
aa38e7adab | ||
|
|
9c414a9117 |
59
HISTORY
59
HISTORY
@@ -1,3 +1,62 @@
|
||||
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>
|
||||
|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><CCB5><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><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɡ<EFBFBD>
|
||||
|
||||
|
||||
|
||||
|
||||
2000/9/27(<28><>)
|
||||
|
||||
Wonx-a02 <20><><EFBFBD><EFBFBD>
|
||||
|
||||
4
Makefile
4
Makefile
@@ -2,8 +2,8 @@ XINCLUDEDIR = /usr/X11R6/include
|
||||
INCLUDEDIR = .
|
||||
XLIBDIR = /usr/X11R6/lib
|
||||
|
||||
VERSION = Wonx-a02
|
||||
PKGNAME = wonx-a02
|
||||
VERSION = Wonx-a05
|
||||
PKGNAME = wonx-a05
|
||||
|
||||
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
|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FBD>⡼<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>ˤʤ<EFBFBD><EFBFBD>ޤ<EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
for (y = 0; y < 32; y++)
|
||||
for (x = 0; x < 32; x++) {
|
||||
screen_fill_char(0, x, y, 1, 1, 0x0000); /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褵<EFBFBD><E8A4B5><EFBFBD><EFBFBD> */
|
||||
}
|
||||
}
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD>Τ褦<EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD>p <20><EFBFBD><F2B2A1A4><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD>⡼<EFBFBD>ɤˤ<C9A4><CBA4>ơ<EFBFBD><C6A1>롼<EFBFBD><EFBFBD><D7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD>
|
||||
<EFBFBD>Ƥ<EFBFBD> p <20><EFBFBD><F2B2A1A4><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD>⡼<EFBFBD>ɤ<EFBFBD><C9A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EFBFBD><CCA4>С<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>å<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ФƤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<EFBFBD>grep <20>ޤ<F2A4A6A4><DEA4>Ȥ<EFBFBD><C8A4>褦<EFBFBD>ˤ<EFBFBD><CBA4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD>⤷<EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD>
|
||||
|
||||
> smac | grep call > function_call.log
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
@@ -63,8 +63,6 @@ int WWCharacter_SetBitmap(WWCharacter character, unsigned char * bitmap)
|
||||
return (0);
|
||||
}
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int WWCharacter_GetPixel(WWCharacter character, int x, int y)
|
||||
{
|
||||
if (character == NULL)
|
||||
@@ -105,6 +103,30 @@ int WWCharacter_SetPixel(WWCharacter character, int x, int y, int pixel)
|
||||
return (pixel);
|
||||
}
|
||||
|
||||
int WWCharacter_PrintData(WWCharacter character, FILE * f)
|
||||
{
|
||||
int x, y, n;
|
||||
|
||||
n = WWCharacter_GetNumber(character);
|
||||
|
||||
fprintf(f, "\n");
|
||||
|
||||
fprintf(f, "character[%d] :\tnumber = %d\n",
|
||||
n, WWCharacter_GetNumber(character));
|
||||
|
||||
for (y = 0; y < 8; y++) {
|
||||
fprintf(f, "character[%d] :\tbitmap : ", n);
|
||||
for (x = 0; x < 8; x++) {
|
||||
fprintf(f, "%d", WWCharacter_GetPixel(character, x, y));
|
||||
}
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
|
||||
fflush(f);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -24,6 +25,7 @@ WWCharacter WWCharacter_Destroy(WWCharacter character);
|
||||
int WWCharacter_SetBitmap(WWCharacter character, unsigned char * bitmap);
|
||||
int WWCharacter_GetPixel(WWCharacter character, int x, int y);
|
||||
int WWCharacter_SetPixel(WWCharacter character, int x, int y, int pixel);
|
||||
int WWCharacter_PrintData(WWCharacter character, FILE * f);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
|
||||
16
WWColorMap.c
16
WWColorMap.c
@@ -63,6 +63,22 @@ int WWColorMap_SetLCDColor(WWColorMap color_map, int color, int lcd_color)
|
||||
return (color_map->lcd_color[color] = lcd_color);
|
||||
}
|
||||
|
||||
int WWColorMap_PrintData(WWColorMap c, FILE * f)
|
||||
{
|
||||
int i, n;
|
||||
|
||||
fprintf(f, "\n");
|
||||
|
||||
for (i = 0; i < 8; i++) {
|
||||
fprintf(f, "colormap :\tcolor[%d] = %d\n",
|
||||
i, WWColorMap_GetLCDColor(c, i));
|
||||
}
|
||||
|
||||
fflush(f);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -23,6 +24,7 @@ int * WWColorMap_GetLCDColors(WWColorMap color_map, int * lcd_colors);
|
||||
int WWColorMap_SetLCDColors(WWColorMap color_map, int * lcd_colors);
|
||||
int WWColorMap_GetLCDColor(WWColorMap color_map, int color);
|
||||
int WWColorMap_SetLCDColor(WWColorMap color_map, int color, int lcd_color);
|
||||
int WWColorMap_PrintData(WWColorMap c, FILE * f);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
|
||||
130
WWDisplay.c
130
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);
|
||||
@@ -193,8 +216,25 @@ static int WWDisplay_DrawScreen(WWDisplay display, WWScreen screen)
|
||||
(WWScreen_GetMode(screen) == WWSCREEN_OUTSIDE_ONLY) ) {
|
||||
sx = WWScreen_GetDrawX(screen);
|
||||
sy = WWScreen_GetDrawX(screen);
|
||||
|
||||
/*
|
||||
* <20>ޥ˥奢<CBA5><E5A5A2><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>
|
||||
* <20>Ƥ<F1A4A4A4><C6A4>뤬<EFBFBD><EBA4AC><EFBFBD>ºݤˤϡ<CBA4>ɽ<EFBFBD><C9BD><EFBFBD>ΰ<EFBFBD><CEB0>β<EFBFBD><CEB2><EFBFBD>+1<>Ƚ<EFBFBD><C8BD><EFBFBD>+1<>פ<EFBFBD>ư<EFBFBD><EFBFBD><EEA4B9>
|
||||
* <20>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD><EFBFBD>(̤<><CCA4>ǧ)<29>ʤΤǡ<CEA4>-1 <20><><EFBFBD>ʤ<EFBFBD><CAA4>Ƥ褤<C6A4><E8A4A4>
|
||||
* <20>⤷<EFBFBD><E2A4B7><EFBFBD>ϡ<EFBFBD>WonderWitch <20>Ǥμºݤ<C2BA>ư<EFBFBD><C6B0><EFBFBD>ϡ<EFBFBD>
|
||||
* ex = sx + WWScreen_GetDrawWidth( screen);
|
||||
* <20>Ǥʤ<C7A4>
|
||||
* ex = WWScreen_GetDrawWidth( screen);
|
||||
* <20>ʤΤ<CAA4><CEA4>⤷<EFBFBD><E2A4B7><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD>
|
||||
*/
|
||||
|
||||
#if 0
|
||||
ex = sx + WWScreen_GetDrawWidth( screen) - 1;
|
||||
ey = sy + WWScreen_GetDrawHeight(screen) - 1;
|
||||
#else
|
||||
ex = sx + WWScreen_GetDrawWidth( screen);
|
||||
ey = sy + WWScreen_GetDrawHeight(screen);
|
||||
#endif
|
||||
}
|
||||
|
||||
mode = WWScreen_GetMode(screen);
|
||||
@@ -203,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) {
|
||||
@@ -221,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> */
|
||||
@@ -236,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++) {
|
||||
@@ -246,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,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);
|
||||
@@ -286,11 +356,14 @@ int WWDisplay_DrawLCDPanel(WWDisplay display)
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -298,22 +371,17 @@ int WWDisplay_DrawLCDPanel(WWDisplay display)
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
for (x = 0; x < lcd_panel_width; x++) {
|
||||
for (y = 0; y < lcd_panel_height; y++) {
|
||||
printf("%d", WWLCDPanel_GetPixel(lcd_panel, x, y));
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
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> */
|
||||
|
||||
|
||||
14
WWLCDPanel.c
14
WWLCDPanel.c
@@ -24,8 +24,7 @@ int WWLCDPanel_GetPixel(WWLCDPanel lcd_panel, int x, int y)
|
||||
(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[y * WWLCDPanel_GetWidth(lcd_panel) + x];
|
||||
pixel &= 0x0f;
|
||||
return ((int)pixel);
|
||||
}
|
||||
@@ -39,14 +38,9 @@ int WWLCDPanel_SetPixel(WWLCDPanel lcd_panel, int x, int y, int pixel)
|
||||
(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[n] = p;
|
||||
|
||||
return (pixel);
|
||||
}
|
||||
@@ -63,7 +57,7 @@ WWLCDPanel WWLCDPanel_Create(int width, int height)
|
||||
WWLCDPanel_SetHeight(lcd_panel, height);
|
||||
lcd_panel->pixel =
|
||||
(unsigned char *)malloc(sizeof(unsigned char) *
|
||||
(WWLCDPanel_GetWidth(lcd_panel) / 2) *
|
||||
WWLCDPanel_GetWidth(lcd_panel) *
|
||||
WWLCDPanel_GetHeight(lcd_panel));
|
||||
|
||||
for (y = 0; y < lcd_panel->height; y++) {
|
||||
|
||||
22
WWPalette.c
22
WWPalette.c
@@ -79,6 +79,28 @@ int WWPalette_SetMappedColor(WWPalette palette, int color, int mapped_color)
|
||||
return (palette->mapped_color[color] = mapped_color);
|
||||
}
|
||||
|
||||
int WWPalette_PrintData(WWPalette p, FILE * f)
|
||||
{
|
||||
int i, n;
|
||||
|
||||
n = WWPalette_GetNumber(p);
|
||||
|
||||
fprintf(f, "\n");
|
||||
|
||||
fprintf(f, "palette[%d] :\tnumber = %d\n", n, WWPalette_GetNumber(p));
|
||||
fprintf(f, "palette[%d] :\ttransparent = %s\n",
|
||||
n, true_false(WWPalette_GetTransparent(p)));
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
fprintf(f, "palette[%d] :\tcolor[%d] = %d\n",
|
||||
n, i, WWPalette_GetMappedColor(p, i));
|
||||
}
|
||||
|
||||
fflush(f);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -27,6 +28,7 @@ int * WWPalette_GetMappedColors(WWPalette palette, int * mapped_colors);
|
||||
int WWPalette_SetMappedColors(WWPalette palette, int * mapped_colors);
|
||||
int WWPalette_GetMappedColor(WWPalette palette, int color);
|
||||
int WWPalette_SetMappedColor(WWPalette palette, int color, int mapped_color);
|
||||
int WWPalette_PrintData(WWPalette p, FILE * f);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
|
||||
29
WWSprite.c
29
WWSprite.c
@@ -84,6 +84,35 @@ WWSprite WWSprite_Destroy(WWSprite sprite)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
int WWSprite_PrintData(WWSprite s, FILE * f)
|
||||
{
|
||||
int n;
|
||||
|
||||
n = WWSprite_GetNumber(s);
|
||||
|
||||
fprintf(f, "\n");
|
||||
|
||||
fprintf(f, "sprite[%d] :\tnumber = %d\n", n, WWSprite_GetNumber(s));
|
||||
fprintf(f, "sprite[%d] :\thorizontal = %s\n",
|
||||
n, true_false(WWSprite_GetHorizontal(s)));
|
||||
fprintf(f, "sprite[%d] :\tvertical = %s\n",
|
||||
n, true_false(WWSprite_GetVertical( s)));
|
||||
fprintf(f, "sprite[%d] :\tpriority = %s\n",
|
||||
n, true_false(WWSprite_GetPriority( s)));
|
||||
fprintf(f, "sprite[%d] :\tclipping = %s\n",
|
||||
n, true_false(WWSprite_GetClipping( s)));
|
||||
fprintf(f, "sprite[%d] :\tpalette number = %d\n",
|
||||
n, WWPalette_GetNumber(WWSprite_GetPalette(s)));
|
||||
fprintf(f, "sprite[%d] :\tcharacter number = %d\n",
|
||||
n, WWCharacter_GetNumber(WWSprite_GetCharacter(s)));
|
||||
fprintf(f, "sprite[%d] :\tx = %d\n", n, WWSprite_GetX(s));
|
||||
fprintf(f, "sprite[%d] :\ty = %d\n", n, WWSprite_GetY(s));
|
||||
|
||||
fflush(f);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -45,6 +45,7 @@ WWSprite WWSprite_Create(int number, int x, int y,
|
||||
int priority, int clipping,
|
||||
WWPalette palette, WWCharacter character);
|
||||
WWSprite WWSprite_Destroy(WWSprite sprite);
|
||||
int WWSprite_PrintData(WWSprite s, FILE * f);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
|
||||
@@ -44,6 +44,46 @@ WonxDisplay WonxDisplay_Create(int x_width, int x_height,
|
||||
return (wonx_display);
|
||||
}
|
||||
|
||||
int WonxDisplay_Sync(WonxDisplay wonx_display)
|
||||
{
|
||||
int i;
|
||||
XDisplay x_display;
|
||||
WWDisplay ww_display;
|
||||
|
||||
x_display = WonxDisplay_GetXDisplay(wonx_display);
|
||||
ww_display = WonxDisplay_GetWWDisplay(wonx_display);
|
||||
|
||||
if (XDisplay_GetColorMapPrint(x_display)) {
|
||||
WWColorMap_PrintData(WWDisplay_GetColorMap(ww_display), stdout);
|
||||
XDisplay_SetColorMapPrint(x_display, 0);
|
||||
}
|
||||
|
||||
if (XDisplay_GetPalettePrint(x_display)) {
|
||||
for (i = 0; i < 16; i++) {
|
||||
WWPalette_PrintData(WWDisplay_GetPalette(ww_display, i), stdout);
|
||||
}
|
||||
XDisplay_SetPalettePrint(x_display, 0);
|
||||
}
|
||||
|
||||
if (XDisplay_GetCharacterPrint(x_display)) {
|
||||
for (i = 0; i < 512; i++) {
|
||||
WWCharacter_PrintData(WWDisplay_GetCharacter(ww_display, i), stdout);
|
||||
}
|
||||
XDisplay_SetCharacterPrint(x_display, 0);
|
||||
}
|
||||
|
||||
if (XDisplay_GetSpritePrint(x_display)) {
|
||||
for (i = 0; i < 128; i++) {
|
||||
WWSprite_PrintData(WWDisplay_GetSprite(ww_display, i), stdout);
|
||||
}
|
||||
XDisplay_SetSpritePrint(x_display, 0);
|
||||
}
|
||||
|
||||
XDisplay_Sync(x_display);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int WonxDisplay_Flush(WonxDisplay wonx_display)
|
||||
{
|
||||
XDisplay x_display;
|
||||
@@ -59,6 +99,8 @@ int WonxDisplay_Flush(WonxDisplay wonx_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);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
108
XDisplay.c
108
XDisplay.c
@@ -10,10 +10,22 @@
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
unsigned int XDisplay_GetKeyPress(XDisplay x_display)
|
||||
{ return (x_display->key_press); }
|
||||
int XDisplay_GetLCDDraw(XDisplay x_display)
|
||||
{ return (x_display->lcd_draw); }
|
||||
unsigned int XDisplay_GetKeyPress(XDisplay d) { return (d->key_press); }
|
||||
int XDisplay_GetLCDDraw(XDisplay d) { return (d->lcd_draw); }
|
||||
|
||||
int XDisplay_GetColorMapPrint(XDisplay d) {return (d->color_map_print); }
|
||||
int XDisplay_GetPalettePrint(XDisplay d) {return (d->palette_print); }
|
||||
int XDisplay_GetCharacterPrint(XDisplay d) {return (d->character_print); }
|
||||
int XDisplay_GetSpritePrint(XDisplay d) {return (d->sprite_print); }
|
||||
|
||||
int XDisplay_SetColorMapPrint(XDisplay d, int f)
|
||||
{ return (d->color_map_print = f); }
|
||||
int XDisplay_SetPalettePrint(XDisplay d, int f)
|
||||
{ return (d->palette_print = f); }
|
||||
int XDisplay_SetCharacterPrint(XDisplay d, int f)
|
||||
{ return(d->character_print = f); }
|
||||
int XDisplay_SetSpritePrint(XDisplay d, int f)
|
||||
{ return (d->sprite_print = f); }
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ǻ<EFBFBD><C7BB>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD>ؿ<EFBFBD><D8BF>ʤɤ<CAA4><C9A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
@@ -113,17 +125,23 @@ static void KeyHandler(Widget w, XtPointer p, XEvent * event,
|
||||
case XK_s : press = KEY_START; break;
|
||||
case XK_space : press = KEY_A; break;
|
||||
case XK_Shift_L : press = KEY_B; break;
|
||||
default : press = 0; break;
|
||||
}
|
||||
|
||||
/* Wonx <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/* Wonx <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
if (event->type == KeyPress) {
|
||||
|
||||
/* ɽ<><C9BD><EFBFBD>⡼<EFBFBD><E2A1BC><EFBFBD>ѹ<EFBFBD> */
|
||||
case XK_p :
|
||||
press = 0;
|
||||
if (event->type == KeyPress)
|
||||
x_display->lcd_draw = !(x_display->lcd_draw);
|
||||
break;
|
||||
switch (key_sym) {
|
||||
|
||||
default : press = 0; break;
|
||||
/* ɽ<><C9BD><EFBFBD>⡼<EFBFBD><E2A1BC><EFBFBD>ѹ<EFBFBD> */
|
||||
case XK_p : x_display->lcd_draw = !(x_display->lcd_draw); break;
|
||||
|
||||
/* <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_F2 : x_display->palette_print = 1; break;
|
||||
case XK_F3 : x_display->character_print = 1; break;
|
||||
case XK_F4 : x_display->sprite_print = 1; break;
|
||||
}
|
||||
}
|
||||
|
||||
if (press) {
|
||||
@@ -340,16 +358,23 @@ 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;
|
||||
|
||||
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.");
|
||||
|
||||
@@ -358,27 +383,38 @@ 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++) {
|
||||
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)) ) {
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -388,7 +424,9 @@ int XDisplay_DrawLCDWindow(XDisplay x_display, WWLCDPanel ww_lcd_panel)
|
||||
|
||||
XDisplay_Sync(x_display);
|
||||
|
||||
free(rectangles);
|
||||
for (pixel = 0; pixel < 16; pixel++) {
|
||||
free(rectangles[pixel]);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
10
XDisplay.h
10
XDisplay.h
@@ -22,6 +22,16 @@ typedef struct _XDisplay * XDisplay;
|
||||
unsigned int XDisplay_GetKeyPress(XDisplay x_display);
|
||||
int XDisplay_GetLCDDraw(XDisplay x_display);
|
||||
|
||||
int XDisplay_GetColorMapPrint(XDisplay d);
|
||||
int XDisplay_GetPalettePrint(XDisplay d);
|
||||
int XDisplay_GetCharacterPrint(XDisplay d);
|
||||
int XDisplay_GetSpritePrint(XDisplay d);
|
||||
|
||||
int XDisplay_SetColorMapPrint(XDisplay d, int f);
|
||||
int XDisplay_SetPalettePrint(XDisplay d, int f);
|
||||
int XDisplay_SetCharacterPrint(XDisplay d, int f);
|
||||
int XDisplay_SetSpritePrint(XDisplay d, int f);
|
||||
|
||||
/*===========================================================================*/
|
||||
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ⱦõ<C8BE> */
|
||||
/*===========================================================================*/
|
||||
|
||||
@@ -49,6 +49,12 @@ typedef struct _XDisplay {
|
||||
/* LCD<43><44><EFBFBD><EFBFBD><EFBFBD>Υե饰 */
|
||||
int lcd_draw;
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7BD>ϤΥե饰 */
|
||||
int color_map_print;
|
||||
int palette_print;
|
||||
int character_print;
|
||||
int sprite_print;
|
||||
|
||||
} _XDisplay;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
311
disp.c
311
disp.c
@@ -19,7 +19,8 @@ void display_control(unsigned int flags)
|
||||
{
|
||||
WWDisplay ww_display;
|
||||
|
||||
printf("display_control(): flags = %ud, ", flags); fflush(stdout);
|
||||
printf("call : display_control() : flags = 0x%04x\n", (int)flags);
|
||||
fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -46,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;
|
||||
}
|
||||
@@ -56,7 +57,7 @@ unsigned int display_status()
|
||||
WWDisplay ww_display;
|
||||
unsigned short int ret;
|
||||
|
||||
printf("display_status(): "); fflush(stdout);
|
||||
printf("call : display_status() : \n"); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -88,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 = %ul\n", (unsigned int)ret); fflush(stdout);
|
||||
printf("call : display_status() : return value = %u\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -102,8 +104,8 @@ void font_set_monodata(unsigned int number, unsigned int count, void * data)
|
||||
int f, b;
|
||||
unsigned char * d;
|
||||
|
||||
printf("font_set_monodata(): number = %ud, count = %ud, data = %p, ",
|
||||
number, count, data); fflush(stdout);
|
||||
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();
|
||||
|
||||
@@ -126,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;
|
||||
}
|
||||
@@ -139,8 +142,8 @@ void font_set_colordata(unsigned int number,
|
||||
int f, b;
|
||||
unsigned char * d;
|
||||
|
||||
printf("font_set_colordata(): number = %ud, count = %ud, data = %p, ",
|
||||
number, count, data); fflush(stdout);
|
||||
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();
|
||||
|
||||
@@ -165,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;
|
||||
}
|
||||
@@ -179,8 +183,8 @@ void font_get_data(unsigned int number,
|
||||
int f, b;
|
||||
unsigned char * d;
|
||||
|
||||
printf("font_get_data(): number = %ud, count = %ud, data = %p, ",
|
||||
number, count, data); fflush(stdout);
|
||||
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();
|
||||
|
||||
@@ -204,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;
|
||||
}
|
||||
@@ -215,7 +219,8 @@ void font_set_color(unsigned int colors)
|
||||
{
|
||||
WWDisplay dis;
|
||||
|
||||
printf("font_set_color(): colors = %ud, ", colors); fflush(stdout);
|
||||
printf("call : font_set_color() : colors = 0x%04x\n", (int)colors);
|
||||
fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -225,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;
|
||||
}
|
||||
@@ -235,7 +240,7 @@ unsigned int font_get_color(void)
|
||||
unsigned short int ret;
|
||||
WWDisplay dis;
|
||||
|
||||
printf("font_get_color(): "); fflush(stdout);
|
||||
printf("call : font_get_color() : \n"); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -244,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 = %ud\n", ret); fflush(stdout);
|
||||
printf("call : font_get_color() : return value = 0x%04x\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -263,7 +269,7 @@ void screen_set_char(int screen, int x, int y, int w, int h, void * data)
|
||||
WWPalette p;
|
||||
WWCharacter c;
|
||||
|
||||
printf("font_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();
|
||||
@@ -292,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;
|
||||
}
|
||||
@@ -309,7 +315,7 @@ void screen_get_char(int screen, int x, int y, int w, int h, void * data)
|
||||
WWPalette p;
|
||||
WWCharacter c;
|
||||
|
||||
printf("font_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();
|
||||
@@ -335,27 +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("screen_get_char1(): screen = %d, x = %d, y = %d, ",
|
||||
screen, x, y); fflush(stdout);
|
||||
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 = %ud\n", 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);
|
||||
}
|
||||
@@ -372,8 +400,8 @@ void screen_fill_char(int screen, int x, int y, int w, int h,
|
||||
WWPalette p;
|
||||
WWCharacter c;
|
||||
|
||||
printf("screen_fill_char(): screen = %d, x = %d, y = %d, w = %d, h = %d, data = %ud",
|
||||
screen, x, y, w, h, data); fflush(stdout);
|
||||
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();
|
||||
|
||||
@@ -400,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;
|
||||
}
|
||||
@@ -411,8 +439,8 @@ void screen_fill_attr(int screen, int x, int y, int w, int h,
|
||||
int i, j;
|
||||
unsigned short int c;
|
||||
|
||||
printf("screen_fill_attr(): screen = %d, x = %d, y = %d, w = %d, h = %d, data = %ud, mask = %ud, ",
|
||||
screen, x, y, w, h, data, mask); fflush(stdout);
|
||||
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();
|
||||
|
||||
@@ -427,15 +455,15 @@ 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("sprite_set_range(): start = %ud, count = %ud, ",
|
||||
sprite_start, sprite_count); fflush(stdout);
|
||||
printf("call : sprite_set_range() : start = %u, count = %u\n",
|
||||
(int)sprite_start, (int)sprite_count); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -446,20 +474,19 @@ 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("sprite_set_char(): number = %ud, data = %ud, ",
|
||||
sprite_num, data); fflush(stdout);
|
||||
printf("call : sprite_set_char() : number = %u, data = 0x%04x\n",
|
||||
(int)sprite_num, (int)data); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -472,14 +499,15 @@ void sprite_set_char(unsigned int sprite_num,
|
||||
|
||||
p = WWDisplay_GetPalette(WonxDisplay_GetWWDisplay(wonx_display),
|
||||
(data >> 9) & 0x07);
|
||||
c = WWDisplay_GetCharacter(WonxDisplay_GetWWDisplay(wonx_display), data & 0x1ff);
|
||||
c = WWDisplay_GetCharacter(WonxDisplay_GetWWDisplay(wonx_display),
|
||||
data & 0x1ff);
|
||||
|
||||
WWSprite_SetPalette(s, p);
|
||||
WWSprite_SetCharacter(s, c);
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : sprite_set_char() : return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -491,7 +519,8 @@ unsigned int sprite_get_char(unsigned int sprite_num)
|
||||
WWCharacter c;
|
||||
unsigned short int ret;
|
||||
|
||||
printf("sprite_get_char(): number = %ud, ", sprite_num); fflush(stdout);
|
||||
printf("call : sprite_get_char() : number = %u\n", (int)sprite_num);
|
||||
fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -511,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 = %ud\n", ret); fflush(stdout);
|
||||
printf("call : sprite_get_char() : return value = 0x%04x\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -522,8 +552,8 @@ void sprite_set_location(unsigned int sprite_num, int x, int y)
|
||||
{
|
||||
WWSprite s;
|
||||
|
||||
printf("sprite_set_location(): number = %ud, x = %d, y = %d, ",
|
||||
sprite_num, x, y); fflush(stdout);
|
||||
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();
|
||||
|
||||
@@ -532,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;
|
||||
}
|
||||
@@ -542,20 +573,19 @@ unsigned int sprite_get_location(unsigned int sprite_num)
|
||||
WWSprite s;
|
||||
unsigned short int ret;
|
||||
|
||||
printf("sprite_get_location(): number = %ud, ", sprite_num); fflush(stdout);
|
||||
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 = %ud\n", ret); fflush(stdout);
|
||||
printf("call : sprite_get_location() : return value = 0x%04x\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -565,15 +595,16 @@ void sprite_set_char_location(unsigned int sprite_num,
|
||||
{
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
printf("sprite_set_char_location(): number = %ud, data = %ud, x = %d, y = %d, ",
|
||||
sprite_num, data, x, y); fflush(stdout);
|
||||
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);
|
||||
sprite_set_location(sprite_num, x, y);
|
||||
|
||||
WonxDisplay_Flush(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
printf("call : sprite_set_char_location() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -582,31 +613,32 @@ unsigned long int sprite_get_char_location(unsigned int sprite_num)
|
||||
{
|
||||
unsigned long int ret;
|
||||
|
||||
printf("sprite_get_char_location(): number = %ud, ",
|
||||
sprite_num); fflush(stdout);
|
||||
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 = %ul\n", ret); fflush(stdout);
|
||||
printf("call : sprite_get_char_location() : return value = 0x%08x\n",
|
||||
(int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
void sprite_set_data(unsigned sprite_num, unsigned int count, void * data)
|
||||
void sprite_set_data(unsigned int sprite_num, unsigned int count, void * data)
|
||||
{
|
||||
int i;
|
||||
char * d;
|
||||
unsigned long int * n;
|
||||
|
||||
printf("sprite_set_data(): number = %ud, count = %ud, data = %p",
|
||||
sprite_num, count, data); fflush(stdout);
|
||||
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();
|
||||
|
||||
@@ -620,7 +652,7 @@ void sprite_set_data(unsigned 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;
|
||||
}
|
||||
@@ -629,7 +661,7 @@ void screen_set_scroll(int screen, int x, int y)
|
||||
{
|
||||
WWScreen s;
|
||||
|
||||
printf("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();
|
||||
@@ -640,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;
|
||||
}
|
||||
@@ -650,7 +682,7 @@ unsigned int screen_get_scroll(int screen)
|
||||
unsigned short int ret;
|
||||
WWScreen s;
|
||||
|
||||
printf("screen_get_scroll(): scsreen = %d, ", screen); fflush(stdout);
|
||||
printf("call : screen_get_scroll() : screen = %d\n", screen); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -660,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 = %ud\n", ret); fflush(stdout);
|
||||
printf("call : screen_get_scroll() : return value = %u\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -671,7 +704,7 @@ void screen2_set_window(int x, int y, int w, int h)
|
||||
{
|
||||
WWScreen s;
|
||||
|
||||
printf("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();
|
||||
@@ -684,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;
|
||||
}
|
||||
@@ -698,39 +732,79 @@ unsigned long int screen2_get_window(void)
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
printf("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 = %ul\n", 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,
|
||||
@@ -739,8 +813,8 @@ void palette_set_color(unsigned int palette_num,
|
||||
int mapped_colors[4];
|
||||
WWPalette palette;
|
||||
|
||||
printf("palette_set_color(): number = %ud, colors = %ud", palette_num,
|
||||
colors); fflush(stdout);
|
||||
printf("call : palette_set_color() : number = %u, colors = 0x%04x\n",
|
||||
(int)palette_num, (int)colors); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -755,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;
|
||||
}
|
||||
@@ -766,11 +840,13 @@ unsigned int palette_get_color(unsigned int palette_num)
|
||||
WWPalette palette;
|
||||
unsigned short int ret;
|
||||
|
||||
printf("palette_get_color(): number = %ud, ", palette_num); fflush(stdout);
|
||||
printf("call : palette_get_color() : number = %u\n", (int)palette_num);
|
||||
fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
palette = WWDisplay_GetPalette(WonxDisplay_GetWWDisplay(wonx_display), palette_num);
|
||||
palette = WWDisplay_GetPalette(WonxDisplay_GetWWDisplay(wonx_display),
|
||||
palette_num);
|
||||
WWPalette_GetMappedColors(palette, mapped_colors);
|
||||
|
||||
ret = 0;
|
||||
@@ -779,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 = %ud\n", ret); fflush(stdout);
|
||||
printf("call : palette_get_color() : return value = %u\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -791,7 +868,8 @@ void lcd_set_color(unsigned int colors0, unsigned int colors1)
|
||||
WWColorMap color_map;
|
||||
int lcd_colors[8];
|
||||
|
||||
printf("lcd_set_color(): colors0 = %ud, colors1 = %ud, ", colors0, colors1); fflush(stdout);
|
||||
printf("call : lcd_set_color() : colors0 = 0x%04x, colors1 = 0x%04x\n",
|
||||
(int)colors0, (int)colors1); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -809,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;
|
||||
}
|
||||
@@ -820,7 +898,7 @@ unsigned long int lcd_get_color(void)
|
||||
int lcd_colors[8];
|
||||
unsigned long int ret;
|
||||
|
||||
printf("lcd_get_color(): "); fflush(stdout);
|
||||
printf("call : lcd_get_color() : \n"); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -828,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 = %ul\n", ret); fflush(stdout);
|
||||
printf("call : lcd_get_color() : return value = 0x%08x\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -857,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)
|
||||
@@ -865,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)
|
||||
@@ -873,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);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
12
etc.c
12
etc.c
@@ -12,3 +12,15 @@ int 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> */
|
||||
/*===========================================================================*/
|
||||
|
||||
char * true_false(int b)
|
||||
{
|
||||
char * s[] = {"false", "true"};
|
||||
b = b ? 1 : 0;
|
||||
return (s[b]);
|
||||
}
|
||||
|
||||
|
||||
6
etc.h
6
etc.h
@@ -7,5 +7,11 @@
|
||||
|
||||
int Error(char * funcname, char * message);
|
||||
|
||||
/*===========================================================================*/
|
||||
/* "true", "false" <20><>ʸ<EFBFBD><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD> */
|
||||
/*===========================================================================*/
|
||||
|
||||
char * true_false(int b);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
36
key.c
36
key.c
@@ -12,7 +12,7 @@ int key_press_check(void)
|
||||
XDisplay x_display;
|
||||
int ret;
|
||||
|
||||
printf("key_press_check(): "); fflush(stdout);
|
||||
printf("call : key_press_check() : "); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -21,7 +21,9 @@ int key_press_check(void)
|
||||
|
||||
ret = XDisplay_GetKeyPress(x_display);
|
||||
|
||||
printf("return value = %d\n", ret); fflush(stdout);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%04x\n", (int)ret); fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -31,7 +33,7 @@ int key_hit_check(void)
|
||||
XDisplay x_display;
|
||||
int ret;
|
||||
|
||||
printf("key_hit_check(): "); fflush(stdout);
|
||||
printf("call : key_hit_check() : "); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -40,7 +42,9 @@ int key_hit_check(void)
|
||||
|
||||
ret = XDisplay_GetKeyPress(x_display);
|
||||
|
||||
printf("return value = %d\n", ret); fflush(stdout);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%04x\n", (int)ret); fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -50,7 +54,7 @@ int key_wait(void)
|
||||
XDisplay x_display;
|
||||
int ret;
|
||||
|
||||
printf("key_wait(): "); fflush(stdout);
|
||||
printf("call : key_wait() : "); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -62,32 +66,40 @@ int key_wait(void)
|
||||
ret = XDisplay_GetKeyPress(x_display);
|
||||
} while (ret == 0);
|
||||
|
||||
printf("return value = %d\n", ret); fflush(stdout);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%04x\n", (int)ret); fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
void key_set_repeat(int rate, int delay)
|
||||
{
|
||||
printf("key_set_repeat(): rate = %d, delay = %d, ", rate, delay);
|
||||
printf("call : key_set_repeat() : rate = %d, delay = %d, ", rate, delay);
|
||||
fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = none\n"); fflush(stdout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int key_get_repeat(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
printf("key_get_repeat(): "); fflush(stdout);
|
||||
printf("call : key_get_repeat() : "); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
ret = 0;
|
||||
|
||||
printf("return value = %d\n", ret); fflush(stdout);
|
||||
WonxDisplay_Sync(wonx_display);
|
||||
|
||||
printf("return value = 0x%04x\n", (int)ret); fflush(stdout);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
@@ -97,7 +109,7 @@ int key_hit_check_with_repeat(void)
|
||||
XDisplay x_display;
|
||||
int ret;
|
||||
|
||||
printf("key_hit_check_with_repeat(): "); fflush(stdout);
|
||||
printf("call : key_hit_check_with_repeat() : "); fflush(stdout);
|
||||
|
||||
if (wonx_display == NULL) Wonx_Create();
|
||||
|
||||
@@ -106,7 +118,9 @@ int key_hit_check_with_repeat(void)
|
||||
|
||||
ret = XDisplay_GetKeyPress(x_display);
|
||||
|
||||
printf("return value = %d\n", ret); fflush(stdout);
|
||||
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