Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3f3c6903d |
@@ -1,7 +1,7 @@
|
||||
/*****************************************************************************/
|
||||
/* WonX - WonderWitch on X. */
|
||||
/* */
|
||||
/* WonX Copyright (c) 2000 Sakai Hiroaki. */
|
||||
/* WonX Copyright (c) 2000-2001 Sakai Hiroaki. */
|
||||
/* All Rights Reserved. */
|
||||
/*===========================================================================*/
|
||||
/* This program is free software; you can redistribute it and/or modify */
|
||||
|
||||
39
HISTORY
39
HISTORY
@@ -1,3 +1,42 @@
|
||||
2001/1/3(<28><>)
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>GC<EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥˡ<EFBFBD>XColorGC <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD>ɲá<C9B2>(XFireworks <20><><EFBFBD><EFBFBD>ή<EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD>)
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD>transparent(Ʃ<>ῧ)<29><>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWPalette <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD>
|
||||
WWDisplay <20><><EFBFBD>饹<EFBFBD>˰<EFBFBD>ư<EFBFBD><C6B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
WWLCDPanel <20><> pixel <20><><EFBFBD><EFBFBD>unsigned short int * <20><><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD>(<28><><EFBFBD>顼<EFBFBD>б<EFBFBD>)
|
||||
|
||||
<EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȥե<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥγ<EFBFBD>Ǽ<EFBFBD>ե<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޥåȤ<EFBFBD><EFBFBD>ѹ<EFBFBD><EFBFBD><EFBFBD>(WWTextFonts.c)
|
||||
|
||||
<EFBFBD>ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><EFBFBD><EFBFBD>ǡ<EFBFBD>ɽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWDisplay_GetForegroundColor(),
|
||||
WWDisplay_GetBackgroundColor() <20>ƥ<F2B8ABA4><C6A5>ԡ<EFBFBD><D4A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>˽<EFBFBD><CBBD><EFBFBD><EFBFBD><EFBFBD>(WWText.c)
|
||||
(WWText <20><><EFBFBD>饹<EFBFBD><E9A5B9><EFBFBD><EFBFBD> WWCharacter <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݤ<EFBFBD><DDA4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>פˤʤä<CAA4><C3A4>Τǡ<CEA4>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤳<EFBFBD><EBA4B3>)
|
||||
|
||||
WWDisplay <20><><EFBFBD>饹<EFBFBD>˥ܡ<CBA5><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>Υѥ<CEA5><D1A5>å<EFBFBD><C3A5>ɲá<C9B2>
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¾<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
(<28><><EFBFBD><EFBFBD><EFBFBD>饯<EFBFBD><E9A5AF><EFBFBD>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>γ<EFBFBD>Ǽ<EFBFBD><C7BC>ˡ<EFBFBD><CBA1><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD>ʤ<EFBFBD>)
|
||||
|
||||
display_control(), display_status() <20>ǡ<EFBFBD><C7A1>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>Υӥåȥ<C3A5><C8A5>եȤ<D5A5>
|
||||
7 <20>ˤʤäƤ<C3A4><C6A4><EFBFBD><EFBFBD>Х<EFBFBD><D0A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(8 <20>˽<EFBFBD><CBBD><EFBFBD>)
|
||||
|
||||
while(1){/*none*/} <20>Ǥγ<C7A4><CEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4>롼<EFBFBD><EBA1BC><EFBFBD><EFBFBD><EFBFBD>ˤ⡤F1 <20>ʤɤΥ<C9A4><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>դ<EFBFBD><D5A4><EFBFBD>
|
||||
<EFBFBD>褦<EFBFBD>˽<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(WonXSystem.c <20>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD><EFBFBD><DEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤΥ<DFA4><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Хå<D0A5><C3A5>ؿ<EFBFBD>
|
||||
WonXTimer_Callback() <20>ˡ<EFBFBD>WonXDisplay_PrintData() <20><><EFBFBD>ɲ<EFBFBD>)
|
||||
|
||||
fcntl_attention.h, filesys.h, indirect.h, oswork.h, process.h <20><><EFBFBD>ɲá<C9B2>
|
||||
(<28><><EFBFBD>Ȥϥ<C8A4><CFA5>顤<EFBFBD>⤷<EFBFBD><E2A4B7><EFBFBD><EFBFBD>Ŭ<EFBFBD><C5AC><EFBFBD>ʥե<CAA5><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롼<F3A5AFA5>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
|
||||
wonx_configure.h <20>ǡ<EFBFBD>
|
||||
#ifndef _WONX_winx_configure_h_INCLUDED_
|
||||
#define _WONX_wonx_configure_h_INCLUDED_
|
||||
<EFBFBD>ˤʤäƤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Х<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
|
||||
|
||||
|
||||
2000/12/28(<28><>)
|
||||
|
||||
wonx-1.1 <20><><EFBFBD><EFBFBD>
|
||||
|
||||
7
Makefile
7
Makefile
@@ -2,13 +2,13 @@ XINCLUDEDIR = /usr/X11R6/include
|
||||
INCLUDEDIR = .
|
||||
XLIBDIR = /usr/X11R6/lib
|
||||
|
||||
VERSION = WonX-1.1
|
||||
PKGNAME = wonx-1.1
|
||||
VERSION = WonX-2.0
|
||||
PKGNAME = wonx-2.0
|
||||
|
||||
SMAC = smac-b02
|
||||
WWTERM = wwterm-b05
|
||||
|
||||
OBJS = WWCharacter.o WWColorMap.o WWDisplay.o WWLCDPanel.o WWPalette.o WWScreen.o WWSprite.o WWCursor.o WWText.o WWInterrupt.o WWTimer.o WWSerialPort.o WonX.o WonXDisplay.o WonXSystem.o WonXSerialPort.o XDisplay.o UNIXTimer.o UNIXSerialPort.o bank.o comm.o disp.o text.o key.o sound.o system.o timer.o service.o etc.o
|
||||
OBJS = WWCharacter.o WWColorMap.o WWDisplay.o WWLCDPanel.o WWPalette.o WWScreen.o WWSprite.o WWCursor.o WWText.o WWInterrupt.o WWTimer.o WWSerialPort.o WonX.o WonXDisplay.o WonXSystem.o WonXSerialPort.o XDisplay.o XColorGC.o UNIXTimer.o UNIXSerialPort.o Obj.o bank.o comm.o disp.o text.o key.o sound.o system.o timer.o libwwc.o service.o etc.o
|
||||
|
||||
CC = gcc
|
||||
|
||||
@@ -25,6 +25,7 @@ libwonx.a : $(OBJS)
|
||||
|
||||
clean :
|
||||
rm -f libwonx.a sample1 sample2 *.o
|
||||
rm -fR $(SMAC) $(WWTERM)
|
||||
|
||||
sample1 : libwonx.a sample1.o
|
||||
$(CC) sample1.o -o sample1 \
|
||||
|
||||
396
Obj.c
Normal file
396
Obj.c
Normal file
@@ -0,0 +1,396 @@
|
||||
/*****************************************************************************/
|
||||
/* Obj.c - A library for object list. */
|
||||
/* */
|
||||
/* Obj.c Copyright (c) 2000 Sakai Hiroaki. */
|
||||
/* All Rights Reserved. */
|
||||
/*****************************************************************************/
|
||||
|
||||
#include "ObjP.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/* ObjListData <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
static ObjListData ObjListData_Create(Obj obj, Obj (*destructor)())
|
||||
{
|
||||
ObjListData list_data;
|
||||
|
||||
list_data = (ObjListData)malloc(sizeof(_ObjListData));
|
||||
|
||||
list_data->obj = obj;
|
||||
list_data->destructor = destructor;
|
||||
|
||||
return (list_data);
|
||||
}
|
||||
|
||||
static ObjListData ObjListData_Destroy(ObjListData list_data)
|
||||
{
|
||||
if (list_data == NULL) return (NULL);
|
||||
|
||||
/* <20>ǥ<EFBFBD><C7A5>ȥ饯<C8A5><E9A5AF><EFBFBD>μ¹<CEBC> */
|
||||
if (list_data->destructor)
|
||||
(*(list_data->destructor))(list_data->obj);
|
||||
|
||||
free(list_data);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* ObjList <20><><EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
Obj ObjListData_GetObj(ObjListData data)
|
||||
{
|
||||
if (data == NULL) return (NULL);
|
||||
return (data->obj);
|
||||
}
|
||||
|
||||
Obj ObjListData_GetPrev(ObjListData data)
|
||||
{
|
||||
if (data == NULL) return (NULL);
|
||||
return (data->prev);
|
||||
}
|
||||
|
||||
Obj ObjListData_GetNext(ObjListData data)
|
||||
{
|
||||
if (data == NULL) return (NULL);
|
||||
return (data->next);
|
||||
}
|
||||
|
||||
int ObjList_GetLength(ObjList list)
|
||||
{
|
||||
if (list == NULL) return (-1);
|
||||
return (list->length);
|
||||
}
|
||||
|
||||
ObjListData ObjList_GetStartEdge(ObjList list)
|
||||
{
|
||||
if (list == NULL) return (NULL);
|
||||
return (list->start_edge);
|
||||
}
|
||||
|
||||
ObjListData ObjList_GetEndEdge(ObjList list)
|
||||
{
|
||||
if (list == NULL) return (NULL);
|
||||
return (list->end_edge);
|
||||
}
|
||||
|
||||
ObjListData ObjList_GetStart(ObjList list)
|
||||
{
|
||||
if (list == NULL) return (NULL);
|
||||
return (list->start_edge->next);
|
||||
}
|
||||
|
||||
ObjListData ObjList_GetEnd(ObjList list)
|
||||
{
|
||||
if (list == NULL) return (NULL);
|
||||
return (list->end_edge->prev);
|
||||
}
|
||||
|
||||
int ObjList_IsEmpty(ObjList list)
|
||||
{
|
||||
if (list == NULL) return (1);
|
||||
return (list->start_edge->next == list->end_edge);
|
||||
}
|
||||
|
||||
int ObjList_IsStartEdge(ObjList list, ObjListData data)
|
||||
{
|
||||
if (list == NULL) return (0);
|
||||
return (data == list->start_edge);
|
||||
}
|
||||
|
||||
int ObjList_IsEndEdge(ObjList list, ObjListData data)
|
||||
{
|
||||
if (list == NULL) return (0);
|
||||
return (data == list->end_edge);
|
||||
}
|
||||
|
||||
int ObjList_IsStart(ObjList list, ObjListData data)
|
||||
{
|
||||
if (list == NULL) return (0);
|
||||
return (data == list->start_edge->next);
|
||||
}
|
||||
|
||||
int ObjList_IsEnd(ObjList list, ObjListData data)
|
||||
{
|
||||
if (list == NULL) return (0);
|
||||
return (data == list->end_edge->prev);
|
||||
}
|
||||
|
||||
ObjListData ObjList_InsertObjToPrev(ObjList list, ObjListData current,
|
||||
Obj obj, Obj (*destructor)())
|
||||
{
|
||||
ObjListData data;
|
||||
|
||||
if (list == NULL) return (NULL);
|
||||
if (ObjList_IsStartEdge(list, current)) return (NULL);
|
||||
|
||||
data = ObjListData_Create(obj, destructor);
|
||||
if (data == NULL) return (NULL);
|
||||
|
||||
data->prev = current->prev;
|
||||
data->next = current;
|
||||
current->prev->next = data;
|
||||
current->prev = data;
|
||||
(list->length)++;
|
||||
|
||||
return (data);
|
||||
}
|
||||
|
||||
ObjListData ObjList_InsertObjToNext(ObjList list, ObjListData current,
|
||||
Obj obj, Obj (*destructor)())
|
||||
{
|
||||
ObjListData data;
|
||||
|
||||
if (list == NULL) return (NULL);
|
||||
if (ObjList_IsEndEdge(list, current)) return (NULL);
|
||||
|
||||
data = ObjListData_Create(obj, destructor);
|
||||
if (data == NULL) return (NULL);
|
||||
|
||||
data->next = current->next;
|
||||
data->prev = current;
|
||||
current->next->prev = data;
|
||||
current->next = data;
|
||||
(list->length)++;
|
||||
|
||||
return (data);
|
||||
}
|
||||
|
||||
ObjListData ObjList_InsertObjToStart(ObjList list, Obj obj,
|
||||
Obj (*destructor)())
|
||||
{
|
||||
ObjListData current;
|
||||
current = ObjList_GetStart(list);
|
||||
return (ObjList_InsertObjToPrev(list, current, obj, destructor));
|
||||
}
|
||||
|
||||
ObjListData ObjList_InsertObjToEnd(ObjList list, Obj obj,
|
||||
Obj (*destructor)())
|
||||
{
|
||||
ObjListData current;
|
||||
current = ObjList_GetEnd(list);
|
||||
return (ObjList_InsertObjToNext(list, current, obj, destructor));
|
||||
}
|
||||
|
||||
ObjListData ObjList_DeleteObjToPrev(ObjList list, ObjListData current)
|
||||
{
|
||||
ObjListData ret;
|
||||
|
||||
if (list == NULL) return (NULL);
|
||||
if (ObjList_IsStartEdge(list, current) || ObjList_IsEndEdge(list, current))
|
||||
return (NULL);
|
||||
|
||||
current->prev->next = current->next;
|
||||
current->next->prev = current->prev;
|
||||
|
||||
ret = current->prev;
|
||||
ObjListData_Destroy(current);
|
||||
(list->length)--;
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
ObjListData ObjList_DeleteObjToNext(ObjList list, ObjListData current)
|
||||
{
|
||||
ObjListData ret;
|
||||
|
||||
if (list == NULL) return (NULL);
|
||||
if (ObjList_IsStartEdge(list, current) || ObjList_IsEndEdge(list, current))
|
||||
return (NULL);
|
||||
|
||||
current->prev->next = current->next;
|
||||
current->next->prev = current->prev;
|
||||
|
||||
ret = current->next;
|
||||
ObjListData_Destroy(current);
|
||||
(list->length)--;
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
ObjListData ObjList_DeleteObjFromStart(ObjList list)
|
||||
{
|
||||
ObjListData current;
|
||||
if (list == NULL) return (NULL);
|
||||
current = ObjList_GetStart(list);
|
||||
return (ObjList_DeleteObjToNext(list, current));
|
||||
}
|
||||
|
||||
ObjListData ObjList_DeleteObjFromEnd(ObjList list)
|
||||
{
|
||||
ObjListData current;
|
||||
if (list == NULL) return (NULL);
|
||||
current = ObjList_GetEnd(list);
|
||||
return (ObjList_DeleteObjToPrev(list, current));
|
||||
}
|
||||
|
||||
ObjListData ObjList_MoveObjToPrev(ObjList list,
|
||||
ObjListData current,
|
||||
ObjListData to)
|
||||
{
|
||||
if (list == NULL) return (NULL);
|
||||
return (ObjList_MoveObjToPrevOfOtherList(list, current, list, to));
|
||||
}
|
||||
|
||||
ObjListData ObjList_MoveObjToNext(ObjList list,
|
||||
ObjListData current,
|
||||
ObjListData to)
|
||||
{
|
||||
if (list == NULL) return (NULL);
|
||||
return (ObjList_MoveObjToNextOfOtherList(list, current, list, to));
|
||||
}
|
||||
|
||||
ObjListData ObjList_MoveObjToStart(ObjList list, ObjListData current)
|
||||
{
|
||||
if (list == NULL) return (NULL);
|
||||
return (ObjList_MoveObjToStartOfOtherList(list, current, list));
|
||||
}
|
||||
|
||||
ObjListData ObjList_MoveObjToEnd(ObjList list, ObjListData current)
|
||||
{
|
||||
if (list == NULL) return (NULL);
|
||||
return (ObjList_MoveObjToEndOfOtherList(list, current, list));
|
||||
}
|
||||
|
||||
ObjList ObjList_Create() /* ObjList <20><><EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
{
|
||||
ObjList list;
|
||||
|
||||
list = (ObjList)malloc(sizeof(_ObjList));
|
||||
if (list == NULL) return (NULL);
|
||||
|
||||
list->start_edge = ObjListData_Create(NULL, NULL);
|
||||
list->end_edge = ObjListData_Create(NULL, NULL);
|
||||
list->length = 0; /* <20><><EFBFBD><EFBFBD>¸<EFBFBD>ߤ<EFBFBD><DFA4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>ο<EFBFBD> */
|
||||
|
||||
list->start_edge->prev = NULL;
|
||||
list->start_edge->next = list->end_edge;
|
||||
list->end_edge->prev = list->start_edge;
|
||||
list->end_edge->next = NULL;
|
||||
|
||||
return (list);
|
||||
}
|
||||
|
||||
ObjList ObjList_Destroy(ObjList list) /* */
|
||||
{
|
||||
if (list == NULL) return (NULL);
|
||||
|
||||
while (!ObjList_IsEmpty(list))
|
||||
ObjList_DeleteObjFromStart(list);
|
||||
|
||||
if (list->start_edge)
|
||||
list->start_edge = ObjListData_Destroy(list->start_edge);
|
||||
if (list->end_edge)
|
||||
list->end_edge = ObjListData_Destroy(list->end_edge);
|
||||
|
||||
free(list);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*===========================================================================*/
|
||||
/* ʣ<><CAA3><EFBFBD>Υꥹ<CEA5>ȴ֤Ǥ<D6A4><C7A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*===========================================================================*/
|
||||
|
||||
ObjListData ObjList_MoveObjToPrevOfOtherList(ObjList list, ObjListData current,
|
||||
ObjList to_list, ObjListData to)
|
||||
{
|
||||
if (list == NULL) return (NULL);
|
||||
if (to_list == NULL) return (NULL);
|
||||
if (ObjList_IsStartEdge(list, current) || ObjList_IsEndEdge(list, current))
|
||||
return (NULL);
|
||||
|
||||
if (ObjList_IsStartEdge(to_list, to)) return (NULL);
|
||||
if ((list == to_list) && (current == to)) return (current);
|
||||
|
||||
current->prev->next = current->next;
|
||||
current->next->prev = current->prev;
|
||||
|
||||
current->prev = to->prev;
|
||||
current->next = to;
|
||||
to->prev->next = current;
|
||||
to->prev = current;
|
||||
|
||||
(list->length)--;
|
||||
(to_list->length)++;
|
||||
|
||||
return (current);
|
||||
}
|
||||
|
||||
ObjListData ObjList_MoveObjToNextOfOtherList(ObjList list, ObjListData current,
|
||||
ObjList to_list, ObjListData to)
|
||||
{
|
||||
if (list == NULL) return (NULL);
|
||||
if (ObjList_IsStartEdge(list, current) || ObjList_IsEndEdge(list, current))
|
||||
return (NULL);
|
||||
|
||||
if (ObjList_IsEndEdge(to_list, to)) return (NULL);
|
||||
if ((list == to_list) && (current == to)) return (current);
|
||||
|
||||
current->prev->next = current->next;
|
||||
current->next->prev = current->prev;
|
||||
|
||||
current->next = to->next;
|
||||
current->prev = to;
|
||||
to->next->prev = current;
|
||||
to->next = current;
|
||||
|
||||
(list->length)--;
|
||||
(to_list->length)++;
|
||||
|
||||
return (current);
|
||||
}
|
||||
|
||||
ObjListData ObjList_MoveObjToStartOfOtherList(ObjList list,
|
||||
ObjListData current,
|
||||
ObjList to_list)
|
||||
{
|
||||
ObjListData to;
|
||||
if (list == NULL) return (NULL);
|
||||
if (to_list == NULL) return (NULL);
|
||||
to = ObjList_GetStart(to_list);
|
||||
return (ObjList_MoveObjToPrevOfOtherList(list, current, to_list, to));
|
||||
}
|
||||
|
||||
ObjListData ObjList_MoveObjToEndOfOtherList(ObjList list,
|
||||
ObjListData current,
|
||||
ObjList to_list)
|
||||
{
|
||||
ObjListData to;
|
||||
if (list == NULL) return (NULL);
|
||||
if (to_list == NULL) return (NULL);
|
||||
to = ObjList_GetEnd(to_list);
|
||||
return (ObjList_MoveObjToNextOfOtherList(list, current, to_list, to));
|
||||
}
|
||||
|
||||
ObjList ObjList_Concatenate(ObjList list1, ObjList list2)
|
||||
{
|
||||
ObjListData tmp;
|
||||
|
||||
if (list1 == NULL) {
|
||||
list1 = list2;
|
||||
return (list1);
|
||||
}
|
||||
if (list2 == NULL) return (list1);
|
||||
|
||||
list1->end_edge->prev->next = list2->start_edge->next;
|
||||
list2->start_edge->next->prev = list1->end_edge->prev;
|
||||
|
||||
tmp = list1->end_edge;
|
||||
list1->end_edge = list2->end_edge;
|
||||
list2->end_edge = tmp;
|
||||
|
||||
list2->start_edge->next = list2->end_edge;
|
||||
list2->end_edge->prev = list2->start_edge;
|
||||
|
||||
list1->length += list2->length;
|
||||
list2->length = 0;
|
||||
|
||||
ObjList_Destroy(list2);
|
||||
|
||||
return (list1);
|
||||
}
|
||||
|
||||
/* End of File. */
|
||||
76
Obj.h
Normal file
76
Obj.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/*****************************************************************************/
|
||||
/* Obj.h - A library for object list. */
|
||||
/* */
|
||||
/* Obj.h Copyright (c) 2000 Sakai Hiroaki. */
|
||||
/* All Rights Reserved. */
|
||||
/*****************************************************************************/
|
||||
|
||||
#ifndef _SAKAILIB_OBJ_H_INCLUDED_
|
||||
#define _SAKAILIB_OBJ_H_INCLUDED_
|
||||
|
||||
typedef void * Obj;
|
||||
typedef struct _ObjListData * ObjListData;
|
||||
typedef struct _ObjList * ObjList;
|
||||
typedef Obj (*ObjDestructor)(Obj);
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*****************************************************************************/
|
||||
/* ObjList <20><><EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
Obj ObjListData_GetObj(ObjListData data);
|
||||
Obj ObjListData_GetPrev(ObjListData data);
|
||||
Obj ObjListData_GetNext(ObjListData data);
|
||||
int ObjList_GetLength(ObjList list);
|
||||
ObjListData ObjList_GetStartEdge(ObjList list);
|
||||
ObjListData ObjList_GetEndEdge(ObjList list);
|
||||
ObjListData ObjList_GetStart(ObjList list);
|
||||
ObjListData ObjList_GetEnd(ObjList list);
|
||||
int ObjList_IsEmpty(ObjList list);
|
||||
int ObjList_IsStartEdge(ObjList list, ObjListData data);
|
||||
int ObjList_IsEndEdge(ObjList list, ObjListData data);
|
||||
int ObjList_IsStart(ObjList list, ObjListData data);
|
||||
int ObjList_IsEnd(ObjList list, ObjListData data);
|
||||
ObjListData ObjList_InsertObjToPrev(ObjList list, ObjListData current,
|
||||
Obj obj, Obj (*destructor)());
|
||||
ObjListData ObjList_InsertObjToNext(ObjList list, ObjListData current,
|
||||
Obj obj, Obj (*destructor)());
|
||||
ObjListData ObjList_InsertObjToStart(ObjList list, Obj obj,
|
||||
Obj (*destructor)());
|
||||
ObjListData ObjList_InsertObjToEnd(ObjList list, Obj obj,
|
||||
Obj (*destructor)());
|
||||
ObjListData ObjList_DeleteObjToPrev(ObjList list, ObjListData current);
|
||||
ObjListData ObjList_DeleteObjToNext(ObjList list, ObjListData current);
|
||||
ObjListData ObjList_DeleteObjFromStart(ObjList list);
|
||||
ObjListData ObjList_DeleteObjFromEnd(ObjList list);
|
||||
ObjListData ObjList_MoveObjToPrev(ObjList list,
|
||||
ObjListData current,
|
||||
ObjListData to);
|
||||
ObjListData ObjList_MoveObjToNext(ObjList list,
|
||||
ObjListData current,
|
||||
ObjListData to);
|
||||
ObjListData ObjList_MoveObjToStart(ObjList list, ObjListData current);
|
||||
ObjListData ObjList_MoveObjToEnd(ObjList list, ObjListData current);
|
||||
ObjList ObjList_Create(); /* ObjList <20><><EFBFBD><EFBFBD><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
ObjList ObjList_Destroy(ObjList list); /* */
|
||||
|
||||
/*===========================================================================*/
|
||||
/* ʣ<><CAA3><EFBFBD>Υꥹ<CEA5>ȴ֤Ǥ<D6A4><C7A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*===========================================================================*/
|
||||
|
||||
ObjListData ObjList_MoveObjToPrevOfOtherList(ObjList list, ObjListData current,
|
||||
ObjList to_list, ObjListData to);
|
||||
ObjListData ObjList_MoveObjToNextOfOtherList(ObjList list, ObjListData current,
|
||||
ObjList to_list, ObjListData to);
|
||||
ObjListData ObjList_MoveObjToStartOfOtherList(ObjList list,
|
||||
ObjListData current,
|
||||
ObjList to_list);
|
||||
ObjListData ObjList_MoveObjToEndOfOtherList(ObjList list,
|
||||
ObjListData current,
|
||||
ObjList to_list);
|
||||
ObjList ObjList_Concatenate(ObjList list1, ObjList list2);
|
||||
|
||||
#endif
|
||||
|
||||
28
ObjP.h
Normal file
28
ObjP.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*****************************************************************************/
|
||||
/* ObjP.h - A library for object list. */
|
||||
/* */
|
||||
/* ObjP.h Copyright (c) 2000 Sakai Hiroaki. */
|
||||
/* All Rights Reserved. */
|
||||
/*****************************************************************************/
|
||||
|
||||
#ifndef _SAKAILIB_OBJP_H_INCLUDED_
|
||||
#define _SAKAILIB_OBJP_H_INCLUDED_
|
||||
|
||||
#include "Obj.h"
|
||||
|
||||
/* <20>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD><EFBFBD>Ǽ<EFBFBD>ѹ<EFBFBD>¤<EFBFBD><C2A4> */
|
||||
typedef struct _ObjListData {
|
||||
struct _ObjListData * prev; /* <20><><EFBFBD>Υǡ<CEA5><C7A1><EFBFBD> */
|
||||
struct _ObjListData * next; /* <20><><EFBFBD>Υǡ<CEA5><C7A1><EFBFBD> */
|
||||
Obj obj; /* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
Obj (*destructor)(Obj); /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸ƤФ<C6A4><D0A4><EFBFBD><EFBFBD>ǥ<EFBFBD><C7A5>ȥ饯<C8A5><E9A5AF> */
|
||||
} _ObjListData;
|
||||
|
||||
/* <20>ꥹ<EFBFBD>ȹ<EFBFBD>¤<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
typedef struct _ObjList {
|
||||
struct _ObjListData * start_edge;
|
||||
struct _ObjListData * end_edge;
|
||||
int length;
|
||||
} _ObjList;
|
||||
|
||||
#endif
|
||||
166
WWCharacter.c
166
WWCharacter.c
@@ -2,6 +2,8 @@
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "WWCharacterP.h"
|
||||
#include "WonX.h"
|
||||
|
||||
@@ -11,20 +13,42 @@
|
||||
|
||||
int WWCharacter_GetNumber(WWCharacter c)
|
||||
{
|
||||
if (c == NULL) WonX_Error("WWCharacter_GetNumber()", "WWCharacter is NULL.");
|
||||
if (c == NULL) WonX_Error("WWCharacter_GetNumber", "WWCharacter is NULL.");
|
||||
|
||||
return (c->number);
|
||||
}
|
||||
|
||||
int WWCharacter_SetNumber(WWCharacter c, int n)
|
||||
{
|
||||
if ((n < 0) || (n >= 512))
|
||||
WonX_Error("WWCharacter_SetNumber()", "Invalid range.");
|
||||
if (c == NULL) WonX_Error("WWCharacter_SetNumber", "WWCharacter is NULL.");
|
||||
|
||||
if ((n < 0) || (n > 512 - 1))
|
||||
WonX_Error("WWCharacter_SetNumber", "Invalid range.");
|
||||
|
||||
return (c->number = n);
|
||||
}
|
||||
|
||||
WWCharacter WWCharacter_Create(int number, unsigned char * bitmap)
|
||||
unsigned char WWCharacter_GetBitmap(WWCharacter c, int n)
|
||||
{
|
||||
if (c == NULL) WonX_Error("WWCharacter_GetBitmap", "WWCharacter is NULL.");
|
||||
|
||||
if ((n < 0) || (n > 32 - 1))
|
||||
WonX_Error("WWCharacter_GetBitmap", "Invalid range.");
|
||||
|
||||
return (c->bitmap[n]);
|
||||
}
|
||||
|
||||
unsigned char WWCharacter_SetBitmap(WWCharacter c, int n, unsigned char bitmap)
|
||||
{
|
||||
if (c == NULL) WonX_Error("WWCharacter_SetBitmap", "WWCharacter is NULL.");
|
||||
|
||||
if ((n < 0) || (n > 32 - 1))
|
||||
WonX_Error("WWCharacter_SetBitmap", "Invalid range.");
|
||||
|
||||
return (c->bitmap[n] = bitmap);
|
||||
}
|
||||
|
||||
WWCharacter WWCharacter_Create(int number)
|
||||
{
|
||||
WWCharacter character;
|
||||
|
||||
@@ -33,7 +57,7 @@ WWCharacter WWCharacter_Create(int number, unsigned char * bitmap)
|
||||
WonX_Error("WWCharacter_Create", "Cannot allocate memory.");
|
||||
|
||||
WWCharacter_SetNumber(character, number);
|
||||
WWCharacter_SetBitmap(character, bitmap);
|
||||
WWCharacter_ClearAllPixels(character);
|
||||
|
||||
return (character);
|
||||
}
|
||||
@@ -41,82 +65,77 @@ WWCharacter WWCharacter_Create(int number, unsigned char * bitmap)
|
||||
WWCharacter WWCharacter_Destroy(WWCharacter character)
|
||||
{
|
||||
if (character == NULL)
|
||||
WonX_Error("WWCharacter_Destroy()", "WWCharacter is NULL.");
|
||||
WonX_Error("WWCharacter_Destroy", "WWCharacter is NULL.");
|
||||
free(character);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
unsigned char * WWCharacter_GetBitmap(WWCharacter character)
|
||||
int WWCharacter_GetPixel(WWCharacter character, int x, int y,
|
||||
WWDisplay display)
|
||||
{
|
||||
return (character->bitmap);
|
||||
}
|
||||
|
||||
int WWCharacter_SetBitmap(WWCharacter character, unsigned char * bitmap)
|
||||
{
|
||||
int i;
|
||||
unsigned short int pixel;
|
||||
|
||||
if (character == NULL)
|
||||
WonX_Error("WWCharacter_SetBitmap()", "WWCharacter is NULL.");
|
||||
WonX_Error("WWCharacter_GetPixel", "WWCharacter is NULL.");
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
if (bitmap == NULL) {
|
||||
character->bitmap[i] = 0x00;
|
||||
} else {
|
||||
character->bitmap[i] = bitmap[i];
|
||||
}
|
||||
if ((x < 0) || (x > 7))
|
||||
WonX_Error("WWCharacter_GetPixel", "x is out of range.");
|
||||
if ((y < 0) || (y > 7))
|
||||
WonX_Error("WWCharacter_GetPixel", "y is out of range.");
|
||||
|
||||
/* <20>ѥ<EFBFBD><D1A5>åȿ<C3A5><C8BF><EFBFBD><EFBFBD>֤<EFBFBD> */
|
||||
pixel = 0;
|
||||
switch (WWDisplay_GetColorMode(display)) {
|
||||
case COLOR_MODE_GRAYSCALE:
|
||||
case COLOR_MODE_4COLOR:
|
||||
pixel = ((character->bitmap[y * 2 + 0] >> (7-x)) & 1) << 0;
|
||||
pixel |= ((character->bitmap[y * 2 + 1] >> (7-x)) & 1) << 1;
|
||||
break;
|
||||
case COLOR_MODE_16COLOR:
|
||||
pixel = ((character->bitmap[y * 4 + 0] >> (7-x)) & 1) << 0;
|
||||
pixel |= ((character->bitmap[y * 4 + 1] >> (7-x)) & 1) << 1;
|
||||
pixel |= ((character->bitmap[y * 4 + 2] >> (7-x)) & 1) << 2;
|
||||
pixel |= ((character->bitmap[y * 4 + 3] >> (7-x)) & 1) << 3;
|
||||
break;
|
||||
case COLOR_MODE_16PACKED:
|
||||
pixel = character->bitmap[y * 4 + (7-x) / 2] >> (((7-x) % 2) * 4);
|
||||
pixel &= 0x0f;
|
||||
break;
|
||||
default:
|
||||
WonX_Error("WWCharacter_GetPixel", "Unknown color mode.");
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int WWCharacter_GetPixel(WWCharacter character, int x, int y)
|
||||
{
|
||||
if (character == NULL)
|
||||
WonX_Error("WWCharacter_GetPixel()", "WWCharacter is NULL.");
|
||||
|
||||
if ((x < 0) || (x > 7))
|
||||
WonX_Error("WWCharacter_GetPixel()", "x is invalid value.");
|
||||
if ((y < 0) || (y > 7))
|
||||
WonX_Error("WWCharacter_GetPixel()", "y is invalid value.");
|
||||
|
||||
/* <20>ӥåȥޥåפ<C3A5>2<EFBFBD>ӥåȤǤԤȤĤΥԥ<CEA5><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>롥 */
|
||||
/* 2<>ӥåȤ<C3A5><C8A4>ͤ<EFBFBD><CDA4><EFBFBD>palette <20>ο<EFBFBD><CEBF><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>롥 */
|
||||
/* bitmap <20><> unsigned char bitmap[16]; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>롥 */
|
||||
|
||||
/* <20>ѥ<EFBFBD><D1A5>åȿ<C3A5>(0<><30>3)<29><><EFBFBD>֤<EFBFBD> */
|
||||
return ( (character->bitmap[y * 2 + x / 4] >> ((x % 4) * 2)) & 0x03 );
|
||||
}
|
||||
|
||||
int WWCharacter_SetPixel(WWCharacter character, int x, int y, int pixel)
|
||||
{
|
||||
unsigned char p;
|
||||
if (character == NULL)
|
||||
WonX_Error("WWCharacter_SetPixel()", "WWCharacter is NULL.");
|
||||
|
||||
if ((x < 0) || (x > 7))
|
||||
WonX_Error("WWCharacter_SetPixel()", "x is invalid value.");
|
||||
if ((y < 0) || (y > 7))
|
||||
WonX_Error("WWCharacter_SetPixel()", "y is invalid value.");
|
||||
if ((pixel < 0) || (pixel > 3))
|
||||
WonX_Error("WWCharacter_SetPixel()", "Invalid pixel.");
|
||||
|
||||
p = ((unsigned char)pixel) & 0x03;
|
||||
p = p << ((x % 4) * 2);
|
||||
|
||||
character->bitmap[y * 2 + x / 4] &= ~(0x03 << ((x % 4) * 2));
|
||||
character->bitmap[y * 2 + x / 4] |= p;
|
||||
|
||||
return (pixel);
|
||||
}
|
||||
|
||||
int WWCharacter_CopyBitmap(WWCharacter dst, WWCharacter src)
|
||||
int WWCharacter_ClearAllPixels(WWCharacter character)
|
||||
{
|
||||
return (WWCharacter_SetBitmap(dst, src->bitmap));
|
||||
if (character == NULL)
|
||||
WonX_Error("WWCharacter_ClearAllPixels", "WWCharacter is NULL.");
|
||||
|
||||
memset(character->bitmap, 0, 32);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int WWCharacter_PrintData(WWCharacter character, FILE * f)
|
||||
int WWCharacter_CopyAllPixels(WWCharacter dst, WWCharacter src)
|
||||
{
|
||||
int x, y, i, n;
|
||||
if (dst == NULL)
|
||||
WonX_Error("WWCharacter_CopyAllPixel", "dst is NULL.");
|
||||
if (src == NULL)
|
||||
WonX_Error("WWCharacter_CopyAllPixel", "src is NULL.");
|
||||
|
||||
memcpy(dst->bitmap, src->bitmap, 32);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int WWCharacter_PrintData(WWCharacter character, WWDisplay display, FILE * f)
|
||||
{
|
||||
int i, x, y, n;
|
||||
|
||||
if (character == NULL)
|
||||
WonX_Error("WWCharacter_PrintData", "WWCharacter is NULL.");
|
||||
|
||||
n = WWCharacter_GetNumber(character);
|
||||
|
||||
@@ -125,15 +144,24 @@ int WWCharacter_PrintData(WWCharacter character, FILE * f)
|
||||
fprintf(f, "character[%d] :\tnumber = %d\n",
|
||||
n, WWCharacter_GetNumber(character));
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
fprintf(f, "character[%d] :\tbitmap[%d] = 0x%02x\n",
|
||||
n, i, (int)(WWCharacter_GetBitmap(character)[i]));
|
||||
for (i = 0; i < 32; i += 8) {
|
||||
fprintf(f, "character[%d] :\tbitmap[%d] =", n, i);
|
||||
fprintf(f, " %02x", (int)WWCharacter_GetBitmap(character, i ));
|
||||
fprintf(f, " %02x", (int)WWCharacter_GetBitmap(character, i+1));
|
||||
fprintf(f, " %02x", (int)WWCharacter_GetBitmap(character, i+2));
|
||||
fprintf(f, " %02x", (int)WWCharacter_GetBitmap(character, i+3));
|
||||
fprintf(f, " %02x", (int)WWCharacter_GetBitmap(character, i+4));
|
||||
fprintf(f, " %02x", (int)WWCharacter_GetBitmap(character, i+5));
|
||||
fprintf(f, " %02x", (int)WWCharacter_GetBitmap(character, i+6));
|
||||
fprintf(f, " %02x", (int)WWCharacter_GetBitmap(character, i+7));
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
|
||||
fprintf(f, "character[%d] :\tpixels : 01234567\n", n);
|
||||
for (y = 0; y < 8; y++) {
|
||||
fprintf(f, "character[%d] :\tbitmap : ", n);
|
||||
fprintf(f, "character[%d] :\tpixels : %d ", n, y);
|
||||
for (x = 0; x < 8; x++) {
|
||||
fprintf(f, "%d", WWCharacter_GetPixel(character, x, y));
|
||||
fprintf(f, "%d", WWCharacter_GetPixel(character, x, y, display));
|
||||
}
|
||||
fprintf(f, "\n");
|
||||
}
|
||||
|
||||
@@ -18,20 +18,27 @@ typedef struct _WWCharacter * WWCharacter;
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "WWDisplay.h"
|
||||
#include "wonx_include/libwwc.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
int WWCharacter_GetNumber(WWCharacter c);
|
||||
int WWCharacter_SetNumber(WWCharacter c, int n);
|
||||
WWCharacter WWCharacter_Create(int number, unsigned char * bitmap);
|
||||
unsigned char WWCharacter_GetBitmap(WWCharacter c, int n);
|
||||
unsigned char WWCharacter_SetBitmap(WWCharacter c, int n, unsigned char bitmap);
|
||||
|
||||
WWCharacter WWCharacter_Create(int number);
|
||||
WWCharacter WWCharacter_Destroy(WWCharacter character);
|
||||
unsigned char * WWCharacter_GetBitmap(WWCharacter character);
|
||||
int WWCharacter_SetBitmap(WWCharacter character, unsigned char * bitmap);
|
||||
int WWCharacter_GetPixel(WWCharacter character, int x, int y);
|
||||
int WWCharacter_SetPixel(WWCharacter character, int x, int y, int pixel);
|
||||
int WWCharacter_CopyBitmap(WWCharacter dst, WWCharacter src);
|
||||
int WWCharacter_PrintData(WWCharacter character, FILE * f);
|
||||
|
||||
int WWCharacter_GetPixel(WWCharacter character, int x, int y,
|
||||
WWDisplay display);
|
||||
|
||||
int WWCharacter_ClearAllPixels(WWCharacter character);
|
||||
int WWCharacter_CopyAllPixels(WWCharacter dst, WWCharacter src);
|
||||
int WWCharacter_PrintData(WWCharacter character, WWDisplay display, FILE * f);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
|
||||
@@ -14,9 +14,8 @@
|
||||
typedef struct _WWCharacter {
|
||||
int number;
|
||||
|
||||
/* <20>ӥåȥޥåפ<EFBFBD>2<EFBFBD>ӥåȤǤԤȤĤΥԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><EFBFBD><EFBFBD><EFBFBD>롥 */
|
||||
/* 2<>ӥåȤ<C3A5><C8A4>ͤ<EFBFBD><CDA4><EFBFBD>palette <20>ο<EFBFBD><CEBF><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD>롥 */
|
||||
unsigned char bitmap[16];
|
||||
/* <20><EFBFBD><EFBFBD><EFBFBD><EFBFBD>饯<EFBFBD><EFBFBD><EFBFBD>Υӥåȥޥå<EFBFBD> */
|
||||
unsigned char bitmap[32];
|
||||
} _WWCharacter;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
135
WWDisplay.c
135
WWDisplay.c
@@ -4,6 +4,7 @@
|
||||
|
||||
#include "wonx_include/disp.h"
|
||||
#include "wonx_include/text.h"
|
||||
#include "wonx_include/libwwc.h"
|
||||
|
||||
#include "WWDisplayP.h"
|
||||
#include "WonX.h"
|
||||
@@ -26,6 +27,8 @@ WWLCDPanel WWDisplay_GetLCDPanel(WWDisplay d) { return (d->lcd_panel); }
|
||||
WWText WWDisplay_GetText(WWDisplay d) { return (d->text); }
|
||||
WWCursor WWDisplay_GetCursor(WWDisplay d) { return (d->cursor); }
|
||||
|
||||
unsigned int WWDisplay_GetColorMode(WWDisplay d) { return (d->color_mode); }
|
||||
|
||||
int WWDisplay_GetSpriteEnable(WWDisplay d) { return (d->sprite_enable); }
|
||||
int WWDisplay_GetSpriteWindowEnable(WWDisplay d)
|
||||
{ return (d->sprite_window_enable); }
|
||||
@@ -39,7 +42,10 @@ int WWDisplay_GetSpriteWindowWidth(WWDisplay d)
|
||||
int WWDisplay_GetSpriteWindowHeight(WWDisplay d)
|
||||
{ return (d->sprite_window_height); }
|
||||
|
||||
int WWDisplay_GetBorder(WWDisplay d) { return (d->border); }
|
||||
WWPalette WWDisplay_GetBorderPalette(WWDisplay d)
|
||||
{ return (d->border_palette); }
|
||||
int WWDisplay_GetBorderColor(WWDisplay d)
|
||||
{ return (d->border_color); }
|
||||
|
||||
int WWDisplay_GetForegroundColor(WWDisplay d) { return (d->foreground_color); }
|
||||
int WWDisplay_GetBackgroundColor(WWDisplay d) { return (d->background_color); }
|
||||
@@ -68,6 +74,9 @@ WWText WWDisplay_SetText(WWDisplay d, WWText p)
|
||||
WWCursor WWDisplay_SetCursor(WWDisplay d, WWCursor p)
|
||||
{ return (d->cursor = p); }
|
||||
|
||||
unsigned int WWDisplay_SetColorMode(WWDisplay d, unsigned int mode)
|
||||
{ return (d->color_mode = mode); }
|
||||
|
||||
int WWDisplay_SetSpriteEnable(WWDisplay d, int f)
|
||||
{ return (d->sprite_enable = f); }
|
||||
int WWDisplay_SetSpriteWindowEnable(WWDisplay d, int f)
|
||||
@@ -82,7 +91,10 @@ int WWDisplay_SetSpriteWindowWidth(WWDisplay d, int 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); }
|
||||
WWPalette WWDisplay_SetBorderPalette(WWDisplay d, WWPalette p)
|
||||
{ return (d->border_palette = p); }
|
||||
int WWDisplay_SetBorderColor(WWDisplay d, int b)
|
||||
{ return (d->border_color = b); }
|
||||
|
||||
int WWDisplay_SetForegroundColor(WWDisplay d, int c)
|
||||
{ return (d->foreground_color = c); }
|
||||
@@ -122,14 +134,23 @@ WWDisplay WWDisplay_Create(int lcd_panel_width, int lcd_panel_height,
|
||||
WWDisplay_SetColorMap(display, WWColorMap_Create(default_lcd_colors));
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
/*
|
||||
* WonX-2.0 <20>ʹߤǤϡ<C7A4>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWPalette <20><><EFBFBD>饹<EFBFBD>Ǥϴ<C7A4><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>褦<EFBFBD><E8A4A6>
|
||||
* <20>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD><C9AC>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD>
|
||||
*/
|
||||
#if 1
|
||||
WWDisplay_SetPalette(display, i,
|
||||
WWPalette_Create(i,default_palette_colors[i].colors));
|
||||
#else /* WonX-2.0 <20><><EFBFBD><EFBFBD><EFBFBD>Ǥϡ<C7A4>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>꤬ɬ<EAA4AC>פ<EFBFBD><D7A4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD> */
|
||||
WWDisplay_SetPalette(display, i,
|
||||
WWPalette_Create(i,
|
||||
default_palette_colors[i].colors,
|
||||
((i / 4) % 2) ? 1 : 0));
|
||||
#endif
|
||||
}
|
||||
|
||||
for (i = 0; i < 512; i++) {
|
||||
WWDisplay_SetCharacter(display, i, WWCharacter_Create(i, NULL));
|
||||
WWDisplay_SetCharacter(display, i, WWCharacter_Create(i));
|
||||
}
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
@@ -151,8 +172,6 @@ WWDisplay WWDisplay_Create(int lcd_panel_width, int lcd_panel_height,
|
||||
WWDisplay_SetLCDPanel(display, WWLCDPanel_Create(lcd_panel_width,
|
||||
lcd_panel_height));
|
||||
|
||||
|
||||
|
||||
/* <20>ǥե<C7A5><D5A5><EFBFBD><EFBFBD>ȤΥƥ<CEA5><C6A5><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD>ѥѥ<D1A5><D1A5>åȤ<C3A5>0 */
|
||||
WWDisplay_SetText(display,
|
||||
WWText_Create(WWDisplay_GetScreen(display, SCREEN2),
|
||||
@@ -168,6 +187,9 @@ WWDisplay WWDisplay_Create(int lcd_panel_width, int lcd_panel_height,
|
||||
WWDisplay_SetCursor(display,
|
||||
WWCursor_Create(WWDisplay_GetPalette(display, 1)));
|
||||
|
||||
/* <20>ǥե<C7A5><D5A5><EFBFBD><EFBFBD>ȤΥ<C8A4><CEA5>顼<EFBFBD>⡼<EFBFBD>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⡼<EFBFBD><E2A1BC> */
|
||||
WWDisplay_SetColorMode(display, COLOR_MODE_GRAYSCALE);
|
||||
|
||||
WWDisplay_SetSpriteEnable(display, 0);
|
||||
WWDisplay_SetSpriteWindowEnable(display, 0);
|
||||
|
||||
@@ -176,7 +198,8 @@ WWDisplay WWDisplay_Create(int lcd_panel_width, int lcd_panel_height,
|
||||
WWDisplay_SetSpriteWindowWidth( display, lcd_panel_width);
|
||||
WWDisplay_SetSpriteWindowHeight(display, lcd_panel_height);
|
||||
|
||||
WWDisplay_SetBorder(display, 0);
|
||||
WWDisplay_SetBorderPalette(display, WWDisplay_GetPalette(display, 0));
|
||||
WWDisplay_SetBorderColor(display, 0);
|
||||
|
||||
WWDisplay_SetForegroundColor(display, 3);
|
||||
WWDisplay_SetBackgroundColor(display, 0);
|
||||
@@ -316,12 +339,24 @@ static int WWDisplay_DrawScreen(WWDisplay display, WWScreen screen,
|
||||
px = x + WWScreen_GetRollX(screen);
|
||||
|
||||
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD>ˤϡ<CBA4>-1<><31><EFBFBD>֤äƤ<C3A4><C6A4><EFBFBD> */
|
||||
pixel = WWScreen_GetPixel(screen, px, py, cursor);
|
||||
pixel = WWScreen_GetPixel(screen, px, py, display, cursor);
|
||||
|
||||
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD> */
|
||||
if (pixel == -1) continue;
|
||||
|
||||
pixel = WWColorMap_GetLCDColor(WWDisplay_GetColorMap(display), pixel);
|
||||
/* <20><><EFBFBD>顼<EFBFBD>б<EFBFBD> */
|
||||
switch (WWDisplay_GetColorMode(display)) {
|
||||
case COLOR_MODE_GRAYSCALE:
|
||||
pixel = WWColorMap_GetLCDColor(WWDisplay_GetColorMap(display), pixel);
|
||||
break;
|
||||
case COLOR_MODE_4COLOR:
|
||||
case COLOR_MODE_16COLOR:
|
||||
case COLOR_MODE_16PACKED:
|
||||
break;
|
||||
default:
|
||||
WonX_Error("WWDisplay_DrawSprite", "Unknown color mode.");
|
||||
}
|
||||
|
||||
WWLCDPanel_SetPixel(lcd_panel, x, y, pixel);
|
||||
}
|
||||
}
|
||||
@@ -349,7 +384,9 @@ static int WWDisplay_DrawSprite(WWDisplay display, WWSprite sprite)
|
||||
|
||||
for (y = 0; y < 8; y++) {
|
||||
for (x = 0; x < 8; x++) {
|
||||
pixel = WWSprite_GetPixel(sprite, x, y); /* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1<><31><EFBFBD>֤äƤ<C3A4><C6A4><EFBFBD> */
|
||||
|
||||
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1<><31><EFBFBD>֤äƤ<C3A4><C6A4><EFBFBD> */
|
||||
pixel = WWSprite_GetPixel(sprite, x, y, display);
|
||||
|
||||
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD> */
|
||||
if (pixel == -1) continue;
|
||||
@@ -370,7 +407,19 @@ static int WWDisplay_DrawSprite(WWDisplay display, WWSprite sprite)
|
||||
}
|
||||
}
|
||||
|
||||
pixel = WWColorMap_GetLCDColor(WWDisplay_GetColorMap(display), pixel);
|
||||
/* <20><><EFBFBD>顼<EFBFBD>б<EFBFBD> */
|
||||
switch (WWDisplay_GetColorMode(display)) {
|
||||
case COLOR_MODE_GRAYSCALE:
|
||||
pixel = WWColorMap_GetLCDColor(WWDisplay_GetColorMap(display), pixel);
|
||||
break;
|
||||
case COLOR_MODE_4COLOR:
|
||||
case COLOR_MODE_16COLOR:
|
||||
case COLOR_MODE_16PACKED:
|
||||
break;
|
||||
default:
|
||||
WonX_Error("WWDisplay_DrawSprite", "Unknown color mode.");
|
||||
}
|
||||
|
||||
WWLCDPanel_SetPixel(WWDisplay_GetLCDPanel(display), lcd_x, lcd_y, pixel);
|
||||
}
|
||||
}
|
||||
@@ -385,7 +434,8 @@ int WWDisplay_DrawLCDPanel(WWDisplay display)
|
||||
int lcd_panel_width;
|
||||
int lcd_panel_height;
|
||||
WWColorMap color_map;
|
||||
int border;
|
||||
WWPalette border_palette;
|
||||
int border_color;
|
||||
WWScreen screen;
|
||||
WWSprite sprite;
|
||||
WWCursor cursor;
|
||||
@@ -394,13 +444,38 @@ int WWDisplay_DrawLCDPanel(WWDisplay display)
|
||||
lcd_panel_width = WWLCDPanel_GetWidth( lcd_panel);
|
||||
lcd_panel_height = WWLCDPanel_GetHeight(lcd_panel);
|
||||
color_map = WWDisplay_GetColorMap(display);
|
||||
border = WWDisplay_GetBorder(display);
|
||||
border_palette = WWDisplay_GetBorderPalette(display);
|
||||
border_color = WWDisplay_GetBorderColor(display);
|
||||
|
||||
/* <20><><EFBFBD>顼<EFBFBD>б<EFBFBD> */
|
||||
switch (WWDisplay_GetColorMode(display)) {
|
||||
case COLOR_MODE_GRAYSCALE:
|
||||
border_color &= (DCM_BORDER_COLOR >> 8);
|
||||
border_color = WWColorMap_GetLCDColor(color_map, border_color);
|
||||
break;
|
||||
case COLOR_MODE_4COLOR:
|
||||
border_color &= 0x03;
|
||||
border_color =
|
||||
((unsigned short int)WWPalette_GetRed( border_palette,border_color)<<8)|
|
||||
((unsigned short int)WWPalette_GetGreen(border_palette,border_color)<<4)|
|
||||
((unsigned short int)WWPalette_GetBlue( border_palette,border_color)<<0);
|
||||
break;
|
||||
case COLOR_MODE_16COLOR:
|
||||
case COLOR_MODE_16PACKED:
|
||||
border_color &= 0x0f;
|
||||
border_color =
|
||||
((unsigned short int)WWPalette_GetRed( border_palette,border_color)<<8)|
|
||||
((unsigned short int)WWPalette_GetGreen(border_palette,border_color)<<4)|
|
||||
((unsigned short int)WWPalette_GetBlue( border_palette,border_color)<<0);
|
||||
break;
|
||||
default:
|
||||
WonX_Error("WWDisplay_DrawLCDPanel", "Unknown color mode.");
|
||||
}
|
||||
|
||||
/* <20>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
for (x = 0; x < lcd_panel_width; x++) {
|
||||
for (y = 0; y < lcd_panel_height; y++) {
|
||||
WWLCDPanel_SetPixel(lcd_panel, x, y,
|
||||
WWColorMap_GetLCDColor(color_map, border));
|
||||
WWLCDPanel_SetPixel(lcd_panel, x, y, border_color);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -447,6 +522,38 @@ int WWDisplay_DrawLCDPanel(WWDisplay display)
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4><EFBFBD>Ĵ<EFBFBD>٤<EFBFBD> */
|
||||
/*===========================================================================*/
|
||||
|
||||
int WWDisplay_IsTransparent(WWDisplay display, WWPalette palette, int color)
|
||||
{
|
||||
int mode;
|
||||
int palette_num;
|
||||
int ret;
|
||||
|
||||
if (color != 0) return (0);
|
||||
|
||||
mode = WWDisplay_GetColorMode(display);
|
||||
palette_num = WWPalette_GetNumber(palette);
|
||||
|
||||
ret = 0;
|
||||
switch (mode) {
|
||||
case COLOR_MODE_GRAYSCALE :
|
||||
case COLOR_MODE_4COLOR :
|
||||
ret = ((palette_num / 4) % 2) ? 1 : 0;
|
||||
break;
|
||||
case COLOR_MODE_16COLOR :
|
||||
case COLOR_MODE_16PACKED :
|
||||
ret = 1;
|
||||
break;
|
||||
default :
|
||||
WonX_Error("WWDisplay_IsTransparent", "Unknown color mode.");
|
||||
}
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
16
WWDisplay.h
16
WWDisplay.h
@@ -41,6 +41,8 @@ WWLCDPanel WWDisplay_GetLCDPanel(WWDisplay d);
|
||||
WWText WWDisplay_GetText(WWDisplay d);
|
||||
WWCursor WWDisplay_GetCursor(WWDisplay d);
|
||||
|
||||
unsigned int WWDisplay_GetColorMode(WWDisplay d);
|
||||
|
||||
int WWDisplay_GetSpriteEnable(WWDisplay d);
|
||||
int WWDisplay_GetSpriteWindowEnable(WWDisplay d);
|
||||
|
||||
@@ -49,7 +51,8 @@ int WWDisplay_GetSpriteWindowY(WWDisplay d);
|
||||
int WWDisplay_GetSpriteWindowWidth(WWDisplay d);
|
||||
int WWDisplay_GetSpriteWindowHeight(WWDisplay d);
|
||||
|
||||
int WWDisplay_GetBorder(WWDisplay d);
|
||||
WWPalette WWDisplay_GetBorderPalette(WWDisplay d);
|
||||
int WWDisplay_GetBorderColor(WWDisplay d);
|
||||
|
||||
int WWDisplay_GetForegroundColor(WWDisplay d);
|
||||
int WWDisplay_GetBackgroundColor(WWDisplay d);
|
||||
@@ -70,6 +73,8 @@ WWLCDPanel WWDisplay_SetLCDPanel(WWDisplay d, WWLCDPanel p);
|
||||
WWText WWDisplay_SetText(WWDisplay d, WWText p);
|
||||
WWCursor WWDisplay_SetCursor(WWDisplay d, WWCursor p);
|
||||
|
||||
unsigned int WWDisplay_SetColorMode(WWDisplay d, unsigned int mode);
|
||||
|
||||
int WWDisplay_SetSpriteEnable(WWDisplay d, int f);
|
||||
int WWDisplay_SetSpriteWindowEnable(WWDisplay d, int f);
|
||||
|
||||
@@ -78,7 +83,8 @@ 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);
|
||||
WWPalette WWDisplay_SetBorderPalette(WWDisplay d, WWPalette p);
|
||||
int WWDisplay_SetBorderColor(WWDisplay d, int b);
|
||||
|
||||
int WWDisplay_SetForegroundColor(WWDisplay d, int c);
|
||||
int WWDisplay_SetBackgroundColor(WWDisplay d, int c);
|
||||
@@ -100,6 +106,12 @@ WWDisplay WWDisplay_Destroy(WWDisplay display);
|
||||
|
||||
int WWDisplay_DrawLCDPanel(WWDisplay display);
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4><EFBFBD>Ĵ<EFBFBD>٤<EFBFBD> */
|
||||
/*===========================================================================*/
|
||||
|
||||
int WWDisplay_IsTransparent(WWDisplay display, WWPalette palette, int color);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
@@ -23,6 +23,8 @@ typedef struct _WWDisplay {
|
||||
WWCursor cursor;
|
||||
|
||||
/* <20>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD>ץ쥤<D7A5><ECA5A4>°<EFBFBD><C2B0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
unsigned int color_mode; /* <20><><EFBFBD>顼<EFBFBD>⡼<EFBFBD><E2A1BC> */
|
||||
|
||||
int sprite_enable; /* <20><><EFBFBD>ץ饤<D7A5><E9A5A4>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD>͡<EFBFBD><CDA1>֥<EFBFBD><D6A5>ե饰 */
|
||||
int sprite_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> */
|
||||
@@ -30,14 +32,16 @@ typedef struct _WWDisplay {
|
||||
int sprite_window_width; /* <20><><EFBFBD>ץ饤<D7A5>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD> */
|
||||
int sprite_window_height; /* <20><><EFBFBD>ץ饤<D7A5>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɥ<EFBFBD><C9A5><EFBFBD> */
|
||||
|
||||
int border; /* <20>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC>0<EFBFBD><30>7<EFBFBD>Υ<EFBFBD><CEA5>顼<EFBFBD>ޥå<DEA5><C3A5>ֹ<EFBFBD> */
|
||||
/* <20>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>Υѥ<CEA5><D1A5>åȡ<C3A5><C8A1><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC>ɬ<EFBFBD><EFBFBD> */
|
||||
WWPalette border_palette;
|
||||
/* <20>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD>ˤϡ<CBA4>0<EFBFBD><30>7<EFBFBD>Υ<EFBFBD><CEA5>顼<EFBFBD>ޥå<DEA5><C3A5>ֹ<EFBFBD> */
|
||||
int border_color;
|
||||
|
||||
int foreground_color; /* <20><><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD><EFBFBD>ο<EFBFBD> */
|
||||
int background_color; /* <20><><EFBFBD>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD>Ÿ<EFBFBD><C5B8><EFBFBD><EFBFBD><EFBFBD>ο<EFBFBD> */
|
||||
|
||||
int sprite_start; /* <20><><EFBFBD>ץ饤<D7A5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD> */
|
||||
int sprite_count; /* <20><><EFBFBD>ץ饤<D7A5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD> */
|
||||
|
||||
} _WWDisplay;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
45
WWLCDPanel.c
45
WWLCDPanel.c
@@ -28,56 +28,59 @@ int WWLCDPanel_ResetAllDraw(WWLCDPanel p) { return (p->all_draw = 0); }
|
||||
int WWLCDPanel_SetAllDraw(WWLCDPanel p) { return (p->all_draw = 1); }
|
||||
int WWLCDPanel_IsAllDraw(WWLCDPanel p) { return (p->all_draw); }
|
||||
|
||||
unsigned char * WWLCDPanel_GetPixelMap(WWLCDPanel p)
|
||||
unsigned short int * WWLCDPanel_GetPixelMap(WWLCDPanel p)
|
||||
{
|
||||
return (p->pixel[p->current]);
|
||||
}
|
||||
|
||||
/* LCD<43>ϣ<EFBFBD><CFA3>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD>16<EFBFBD><EFBFBD>(<EFBFBD><EFBFBD><EFBFBD>ӥå<EFBFBD>ɬ<EFBFBD><EFBFBD>) */
|
||||
static int WWLCDPanel_GetPixelByCurrent(WWLCDPanel lcd_panel, int current,
|
||||
int x, int y)
|
||||
/* LCD<43>ϣ<EFBFBD><CFA3>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD>4096<EFBFBD><EFBFBD>(12<EFBFBD>ӥå<EFBFBD>ɬ<EFBFBD><EFBFBD>) */
|
||||
static unsigned short int WWLCDPanel_GetPixelByCurrent(WWLCDPanel lcd_panel,
|
||||
int current,
|
||||
int x, int y)
|
||||
{
|
||||
unsigned char pixel;
|
||||
unsigned short int pixel;
|
||||
|
||||
if ( (x < 0) || (x > WWLCDPanel_GetWidth( lcd_panel) - 1) ||
|
||||
(y < 0) || (y > WWLCDPanel_GetHeight(lcd_panel) - 1) )
|
||||
return (-1);
|
||||
|
||||
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)
|
||||
static unsigned short int WWLCDPanel_GetOldPixel(WWLCDPanel lcd_panel,
|
||||
int x, int y)
|
||||
{
|
||||
return (WWLCDPanel_GetPixelByCurrent(lcd_panel, 1 - lcd_panel->current, x, y));
|
||||
return (WWLCDPanel_GetPixelByCurrent(lcd_panel,
|
||||
1 - lcd_panel->current, x, y));
|
||||
}
|
||||
|
||||
int WWLCDPanel_GetPixel(WWLCDPanel lcd_panel, int x, int y)
|
||||
unsigned short int WWLCDPanel_GetPixel(WWLCDPanel lcd_panel, int x, int y)
|
||||
{
|
||||
return (WWLCDPanel_GetPixelByCurrent(lcd_panel, lcd_panel->current, x, y));
|
||||
}
|
||||
|
||||
int WWLCDPanel_SetPixel(WWLCDPanel lcd_panel, int x, int y, int pixel)
|
||||
unsigned short int WWLCDPanel_SetPixel(WWLCDPanel lcd_panel, int x, int y,
|
||||
unsigned short int pixel)
|
||||
{
|
||||
unsigned char p;
|
||||
unsigned short int p;
|
||||
int n;
|
||||
|
||||
if ( (x < 0) || (x > WWLCDPanel_GetWidth( lcd_panel) - 1) ||
|
||||
(y < 0) || (y > WWLCDPanel_GetHeight(lcd_panel) - 1) )
|
||||
return (-1);
|
||||
|
||||
p = ((unsigned char)pixel) & 0x0f;
|
||||
p = pixel & 0x0fff;
|
||||
n = y * WWLCDPanel_GetWidth(lcd_panel) + x;
|
||||
lcd_panel->pixel[lcd_panel->current][n] = p;
|
||||
|
||||
return (pixel);
|
||||
return (p);
|
||||
}
|
||||
|
||||
int WWLCDPanel_IsPixelChanged(WWLCDPanel lcd_panel, int x, int y)
|
||||
{
|
||||
int old_pixel;
|
||||
int current_pixel;
|
||||
unsigned short int old_pixel;
|
||||
unsigned short int current_pixel;
|
||||
|
||||
if (WWLCDPanel_IsAllDraw(lcd_panel)) return (1);
|
||||
old_pixel = WWLCDPanel_GetOldPixel(lcd_panel, x, y);
|
||||
@@ -90,6 +93,7 @@ WWLCDPanel WWLCDPanel_Create(int width, int height)
|
||||
{
|
||||
WWLCDPanel lcd_panel;
|
||||
int x, y, i;
|
||||
unsigned short int * p;
|
||||
|
||||
lcd_panel = (WWLCDPanel)malloc(sizeof(_WWLCDPanel));
|
||||
if (lcd_panel == NULL)
|
||||
@@ -99,15 +103,16 @@ WWLCDPanel WWLCDPanel_Create(int width, int height)
|
||||
WWLCDPanel_SetHeight(lcd_panel, height);
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
lcd_panel->pixel[i] =
|
||||
(unsigned char *)malloc(sizeof(unsigned char) *
|
||||
WWLCDPanel_GetWidth(lcd_panel) *
|
||||
WWLCDPanel_GetHeight(lcd_panel));
|
||||
p = (unsigned short int *)malloc(sizeof(unsigned short int) *
|
||||
WWLCDPanel_GetWidth(lcd_panel) *
|
||||
WWLCDPanel_GetHeight(lcd_panel));
|
||||
if (p == NULL) WonX_Error("WWLCDPanel_Create", "Cannot allocate memory.");
|
||||
lcd_panel->pixel[i] = p;
|
||||
}
|
||||
|
||||
for (y = 0; y < lcd_panel->height; y++) {
|
||||
for (x = 0; x < lcd_panel->width / 2; x++) {
|
||||
WWLCDPanel_SetPixel(lcd_panel, x, y, 0x00);
|
||||
WWLCDPanel_SetPixel(lcd_panel, x, y, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,9 +32,10 @@ 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);
|
||||
unsigned short int * WWLCDPanel_GetPixelMap(WWLCDPanel p);
|
||||
unsigned short int WWLCDPanel_GetPixel(WWLCDPanel lcd_panel, int x, int y);
|
||||
unsigned short int WWLCDPanel_SetPixel(WWLCDPanel lcd_panel, int x, int y,
|
||||
unsigned short int pixel);
|
||||
int WWLCDPanel_IsPixelChanged(WWLCDPanel lcd_panel, int x, int y);
|
||||
WWLCDPanel WWLCDPanel_Create(int width, int height);
|
||||
WWLCDPanel WWLCDPanel_Destroy(WWLCDPanel lcd_panel);
|
||||
|
||||
@@ -15,18 +15,20 @@ typedef struct _WWLCDPanel {
|
||||
int width;
|
||||
int height;
|
||||
|
||||
/* X<><58><EFBFBD><EFBFBD><EFBFBD>Ф<EFBFBD><D0A4><EFBFBD><EFBFBD>٤餹<F2B8BAA4><E9A4B9><EFBFBD>ᡤ<EFBFBD>ӥåȥޥåפ<C3A5><D7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/* <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>Υӥåȥޥåפˤʤ롥 */
|
||||
/* 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> */
|
||||
/* 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<EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD>顼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Х<EFBFBD><EFBFBD>Ȥǣ<EFBFBD><EFBFBD>ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʬ<EFBFBD>ξ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
unsigned char * pixel[2];
|
||||
/* 4096<EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><EFBFBD>顼<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Х<EFBFBD><EFBFBD>Ȥǣ<EFBFBD><EFBFBD>ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʬ<EFBFBD>ξ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/* X<><58><EFBFBD><EFBFBD><EFBFBD>Ф<EFBFBD><D0A4><EFBFBD><EFBFBD>٤餹<F2B8BAA4><E9A4B9><EFBFBD>ᡤ<EFBFBD>ӥåȥޥåפ<C3A5><D7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>ʬ<EFBFBD>Ͻ<CFBD><F1A4ADB4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>褦<EFBFBD>ˤ<EFBFBD><CBA4>롥 */
|
||||
unsigned short int * pixel[2];
|
||||
} _WWLCDPanel;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
69
WWPalette.c
69
WWPalette.c
@@ -13,20 +13,57 @@
|
||||
int WWPalette_GetNumber(WWPalette p) { return (p->number); }
|
||||
int WWPalette_SetNumber(WWPalette p, int n) { return (p->number = n); }
|
||||
|
||||
/*
|
||||
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
#if 0
|
||||
int WWPalette_GetTransparent(WWPalette p) { return (p->transparent); }
|
||||
int WWPalette_SetTransparent(WWPalette p, int f)
|
||||
{ return (p->transparent = f); }
|
||||
#endif
|
||||
|
||||
WWPalette WWPalette_Create(int number, int * mapped_colors, int transparent)
|
||||
int WWPalette_GetRed( WWPalette p, int n) { return (p->red[ n]); }
|
||||
int WWPalette_GetGreen(WWPalette p, int n) { return (p->green[n]); }
|
||||
int WWPalette_GetBlue( WWPalette p, int n) { return (p->blue[ n]); }
|
||||
int WWPalette_SetRed( WWPalette p, int n, int value)
|
||||
{ return (p->red[ n] = value); }
|
||||
int WWPalette_SetGreen(WWPalette p, int n, int value)
|
||||
{ return (p->green[n] = value); }
|
||||
int WWPalette_SetBlue( WWPalette p, int n, int value)
|
||||
{ return (p->blue[ n] = value); }
|
||||
|
||||
/*
|
||||
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD>
|
||||
* <20><><EFBFBD>Ȥ<EFBFBD><C8A4>Ȥϡ<C8A4>
|
||||
* WWPalette WWPalette_Create(int number, int * mapped_colors, int transparent)
|
||||
* <20>Τ褦<CEA4>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD> transparent <20><><EFBFBD><EFBFBD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD>
|
||||
*/
|
||||
WWPalette WWPalette_Create(int number, int * mapped_colors)
|
||||
{
|
||||
WWPalette palette;
|
||||
int i;
|
||||
|
||||
palette = (WWPalette)malloc(sizeof(_WWPalette));
|
||||
if (palette == NULL)
|
||||
WonX_Error("WWPalette_Create", "Cannot allocate memory");
|
||||
|
||||
WWPalette_SetNumber(palette, number);
|
||||
|
||||
/*
|
||||
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
#if 0
|
||||
WWPalette_SetTransparent(palette, transparent);
|
||||
#endif
|
||||
|
||||
for (i = 0; i < 16; i++) {
|
||||
WWPalette_SetRed( palette, i, 0);
|
||||
WWPalette_SetGreen(palette, i, 0);
|
||||
WWPalette_SetBlue( palette, i, 0);
|
||||
}
|
||||
WWPalette_SetMappedColors(palette, mapped_colors);
|
||||
|
||||
return (palette);
|
||||
@@ -70,29 +107,55 @@ int WWPalette_GetMappedColor(WWPalette palette, int color)
|
||||
int pixel;
|
||||
|
||||
pixel = palette->mapped_color[color];
|
||||
|
||||
/*
|
||||
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
#if 0
|
||||
if (WWPalette_GetTransparent(palette) && (pixel == 0)) {
|
||||
pixel = -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
return (pixel);
|
||||
}
|
||||
|
||||
int WWPalette_SetMappedColor(WWPalette palette, int color, int mapped_color)
|
||||
{
|
||||
/*
|
||||
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
#if 0
|
||||
if (mapped_color == -1) mapped_color = 0;
|
||||
#endif
|
||||
return (palette->mapped_color[color] = mapped_color);
|
||||
}
|
||||
|
||||
int WWPalette_PrintData(WWPalette p, FILE * f)
|
||||
int WWPalette_PrintData(WWPalette p, WWDisplay display, FILE * f)
|
||||
{
|
||||
int i, n;
|
||||
int transparent;
|
||||
|
||||
n = WWPalette_GetNumber(p);
|
||||
|
||||
fprintf(f, "\n");
|
||||
|
||||
fprintf(f, "palette[%d] :\tnumber = %d\n", n, WWPalette_GetNumber(p));
|
||||
|
||||
/*
|
||||
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
#if 1
|
||||
transparent = WWDisplay_IsTransparent(display, p, 0);
|
||||
fprintf(f, "palette[%d] :\ttransparent = %s\n",
|
||||
n, wonx_true_false(WWPalette_GetTransparent(p)));
|
||||
n, wonx_true_false(transparent));
|
||||
#else
|
||||
fprintf(f, "palette[%d] :\ttransparent = %s\n",
|
||||
n, wonx_true_false(WWPalette_GetTransparent(p)));
|
||||
#endif
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
fprintf(f, "palette[%d] :\tcolor[%d] = %d\n",
|
||||
|
||||
27
WWPalette.h
27
WWPalette.h
@@ -18,21 +18,46 @@ typedef struct _WWPalette * WWPalette;
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "WWDisplay.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
int WWPalette_GetNumber(WWPalette p);
|
||||
int WWPalette_SetNumber(WWPalette p, int n);
|
||||
|
||||
/*
|
||||
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
#if 0
|
||||
int WWPalette_GetTransparent(WWPalette palette);
|
||||
int WWPalette_SetTransparent(WWPalette palette, int f);
|
||||
#endif
|
||||
|
||||
int WWPalette_GetRed( WWPalette p, int n);
|
||||
int WWPalette_GetGreen(WWPalette p, int n);
|
||||
int WWPalette_GetBlue( WWPalette p, int n);
|
||||
int WWPalette_SetRed( WWPalette p, int n, int value);
|
||||
int WWPalette_SetGreen(WWPalette p, int n, int value);
|
||||
int WWPalette_SetBlue( WWPalette p, int n, int value);
|
||||
|
||||
/*
|
||||
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
#if 1
|
||||
WWPalette WWPalette_Create(int number, int * mapped_colors);
|
||||
#else
|
||||
WWPalette WWPalette_Create(int number, int * mapped_colors, int transparent);
|
||||
#endif
|
||||
WWPalette WWPalette_Destroy(WWPalette palette);
|
||||
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);
|
||||
int WWPalette_PrintData(WWPalette p, WWDisplay display, FILE * f);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
|
||||
20
WWPaletteP.h
20
WWPaletteP.h
@@ -12,12 +12,28 @@
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct _WWPalette {
|
||||
|
||||
int number;
|
||||
|
||||
/*
|
||||
* WonX-2.0 <20>ʹߤ<CAB9><DFA4>顤Ʃ<E9A1A4><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƚ<EFBFBD><C8BD><EFBFBD><EFBFBD> WWDisplay <20>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6><EFBFBD>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||
* WWPalette <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
#if 0
|
||||
int transparent; /* 0 <20><>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD>ˤʤ뤫<CAA4>ɤ<EFBFBD><C9A4><EFBFBD><EFBFBD>Υե饰 */
|
||||
#endif
|
||||
|
||||
/* <20><><EFBFBD>顼<EFBFBD>ޥåפ<C3A5>8<EFBFBD><38><EFBFBD>椫<EFBFBD><E6A4AB>4<EFBFBD><34><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
int mapped_color[4]; /* <20><><EFBFBD>顼<EFBFBD>ޥåפ<C3A5><D7A4>ֹ<EFBFBD>(0<><30>7)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>⡼<EFBFBD>ɤξ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤϡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>ޥåפ<EFBFBD>8<EFBFBD><EFBFBD><EFBFBD>椫<EFBFBD><EFBFBD>4<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
int mapped_color[4]; /* <20><><EFBFBD><EFBFBD><EFBFBD>⡼<EFBFBD>ɤǤϡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>ޥåפ<EFBFBD><EFBFBD>ֹ<EFBFBD>(0<><30>7)<29><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
|
||||
/*
|
||||
* 4<><34><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC>16<31><36><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>⡼<EFBFBD>ɤξ<C9A4><CEBE><EFBFBD><EFBFBD>ˤϡ<CBA4>rgb <20>ο<EFBFBD><CEBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4>롥
|
||||
* 4<><34><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>⡼<EFBFBD>ɤξ<C9A4><CEBE><EFBFBD><EFBFBD>ˤϡ<CBA4>0<EFBFBD><30>3<EFBFBD>ޤǤ<DEA4><C7A4><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4>롥
|
||||
* 16<31><36><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>⡼<EFBFBD>ɤξ<C9A4><CEBE><EFBFBD><EFBFBD>ˤϡ<CBA4>0<EFBFBD><30>15<31>ޤǤ<DEA4><C7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4>롥
|
||||
*/
|
||||
int red[16];
|
||||
int green[16];
|
||||
int blue[16];
|
||||
|
||||
} _WWPalette;
|
||||
|
||||
|
||||
31
WWScreen.c
31
WWScreen.c
@@ -159,7 +159,8 @@ int WWScreen_SetDrawWidth( WWScreen s, int n) { return (s->draw_width = n); }
|
||||
int WWScreen_SetDrawHeight(WWScreen s, int n) { return (s->draw_height = n); }
|
||||
|
||||
/* <20><><EFBFBD>顼<EFBFBD>ޥåפο<D7A4>(0<><30>7)<29><><EFBFBD>֤<EFBFBD>(Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1<><31><EFBFBD>֤<EFBFBD>) */
|
||||
int WWScreen_GetPixel(WWScreen screen, int x, int y, WWCursor cursor)
|
||||
int WWScreen_GetPixel(WWScreen screen, int x, int y,
|
||||
WWDisplay display, WWCursor cursor)
|
||||
{
|
||||
int cx, cy, px, py;
|
||||
int pixel;
|
||||
@@ -193,8 +194,32 @@ int WWScreen_GetPixel(WWScreen screen, int x, int y, WWCursor cursor)
|
||||
}
|
||||
}
|
||||
|
||||
pixel = WWCharacter_GetPixel(character, px, py);
|
||||
pixel = WWPalette_GetMappedColor(palette, pixel); /*Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1<><31><EFBFBD>֤äƤ<C3A4><C6A4><EFBFBD>*/
|
||||
pixel = WWCharacter_GetPixel(character, px, py, display);
|
||||
|
||||
/* <20><><EFBFBD>顼<EFBFBD>б<EFBFBD> */
|
||||
switch (WWDisplay_GetColorMode(display)) {
|
||||
case COLOR_MODE_GRAYSCALE:
|
||||
/*
|
||||
* WonX-2.0 <20>ʹߤǤϡ<C7A4>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD><EFBFBD> WWDisplay <20><><EFBFBD>饹<EFBFBD>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6>
|
||||
* <20>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>WWPalette_GetMappedColor() <20><> -1 <20><><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>Ȥ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD>
|
||||
*/
|
||||
pixel = WWPalette_GetMappedColor(palette, pixel);
|
||||
break;
|
||||
case COLOR_MODE_4COLOR:
|
||||
case COLOR_MODE_16COLOR:
|
||||
case COLOR_MODE_16PACKED:
|
||||
pixel =
|
||||
((unsigned short int)WWPalette_GetRed( palette, pixel) << 8) |
|
||||
((unsigned short int)WWPalette_GetGreen(palette, pixel) << 4) |
|
||||
((unsigned short int)WWPalette_GetBlue( palette, pixel) << 0);
|
||||
break;
|
||||
default:
|
||||
WonX_Error("WWScreen_GetPixel", "Unknown color mode.");
|
||||
}
|
||||
|
||||
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD>ˤ<EFBFBD> -1 <20><><EFBFBD>֤<EFBFBD> */
|
||||
if (WWDisplay_IsTransparent(display, palette, pixel))
|
||||
pixel = -1;
|
||||
|
||||
return (pixel);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ typedef struct _WWScreen * WWScreen;
|
||||
#include "WWPalette.h"
|
||||
#include "WWCharacter.h"
|
||||
#include "WWCursor.h"
|
||||
#include "WWDisplay.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
@@ -71,7 +72,8 @@ int WWScreen_SetDrawY( WWScreen s, int n);
|
||||
int WWScreen_SetDrawWidth( WWScreen s, int n);
|
||||
int WWScreen_SetDrawHeight(WWScreen s, int n);
|
||||
|
||||
int WWScreen_GetPixel(WWScreen screen, int x, int y, WWCursor cursor);
|
||||
int WWScreen_GetPixel(WWScreen screen, int x, int y,
|
||||
WWDisplay display, WWCursor cursor);
|
||||
|
||||
WWScreen WWScreen_Create(int number,
|
||||
int width, int height,
|
||||
|
||||
38
WWSprite.c
38
WWSprite.c
@@ -39,20 +39,44 @@ int WWSprite_SetPosition(WWSprite sprite, int x, int y)
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD>ץ饤<D7A5>ȤΥԥ<CEA5><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD><CDA4>֤<EFBFBD><D6A4><EFBFBD>(Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-1<><31><EFBFBD>֤<EFBFBD>) */
|
||||
int WWSprite_GetPixel(WWSprite sprite, int x, int y)
|
||||
int WWSprite_GetPixel(WWSprite sprite, int x, int y, WWDisplay display)
|
||||
{
|
||||
WWPalette p;
|
||||
WWCharacter c;
|
||||
WWPalette palette;
|
||||
WWCharacter character;
|
||||
int pixel;
|
||||
|
||||
p = WWSprite_GetPalette(sprite);
|
||||
c = WWSprite_GetCharacter(sprite);
|
||||
palette = WWSprite_GetPalette(sprite);
|
||||
character = WWSprite_GetCharacter(sprite);
|
||||
|
||||
if (WWSprite_GetHorizontal(sprite)) x = 7 - x;
|
||||
if (WWSprite_GetVertical( sprite)) y = 7 - y;
|
||||
|
||||
pixel = WWCharacter_GetPixel(c, x, y);
|
||||
pixel = WWPalette_GetMappedColor(p, pixel); /* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -1 <20><><EFBFBD>֤<EFBFBD> */
|
||||
pixel = WWCharacter_GetPixel(character, x, y, display);
|
||||
|
||||
/* <20><><EFBFBD>顼<EFBFBD>б<EFBFBD> */
|
||||
switch (WWDisplay_GetColorMode(display)) {
|
||||
case COLOR_MODE_GRAYSCALE:
|
||||
/*
|
||||
* WonX-2.0 <20>ʹߤǤϡ<C7A4>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD><EFBFBD> WWDisplay <20><><EFBFBD>饹<EFBFBD>ǹԤ<C7B9><D4A4>褦<EFBFBD><E8A4A6>
|
||||
* <20>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>WWPalette_GetMappedColor() <20><> -1 <20><><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>Ȥ<EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD>
|
||||
*/
|
||||
pixel = WWPalette_GetMappedColor(palette, pixel);
|
||||
break;
|
||||
case COLOR_MODE_4COLOR:
|
||||
case COLOR_MODE_16COLOR:
|
||||
case COLOR_MODE_16PACKED:
|
||||
pixel =
|
||||
((unsigned short int)WWPalette_GetRed( palette, pixel) << 8) |
|
||||
((unsigned short int)WWPalette_GetGreen(palette, pixel) << 4) |
|
||||
((unsigned short int)WWPalette_GetBlue( palette, pixel) << 0);
|
||||
break;
|
||||
default:
|
||||
WonX_Error("WWSprite_GetPixel", "Unknown color mode.");
|
||||
}
|
||||
|
||||
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD>ˤ<EFBFBD> -1 <20><><EFBFBD>֤<EFBFBD> */
|
||||
if (WWDisplay_IsTransparent(display, palette, pixel))
|
||||
pixel = -1;
|
||||
|
||||
return (pixel);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ typedef struct _WWSprite * WWSprite;
|
||||
|
||||
#include "WWPalette.h"
|
||||
#include "WWCharacter.h"
|
||||
#include "WWDisplay.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
@@ -43,7 +44,7 @@ WWCharacter WWSprite_SetCharacter(WWSprite s, WWCharacter c);
|
||||
int WWSprite_GetX(WWSprite sprite);
|
||||
int WWSprite_GetY(WWSprite sprite);
|
||||
int WWSprite_SetPosition(WWSprite sprite, int x, int y);
|
||||
int WWSprite_GetPixel(WWSprite sprite, int x, int y);
|
||||
int WWSprite_GetPixel(WWSprite sprite, int x, int y, WWDisplay display);
|
||||
|
||||
WWSprite WWSprite_Create(int number, int x, int y,
|
||||
int horizontal, int vertical,
|
||||
|
||||
73
WWText.c
73
WWText.c
@@ -57,7 +57,7 @@ int WWText_SetTextWindow(WWText ww_text, int x, int y,
|
||||
for (tx = 0; tx < WWText_GetWidth(ww_text); tx++) {
|
||||
if (c >= 512) WonX_Error("WWText_SetTextWindow", "Over character.");
|
||||
ww_character = WWDisplay_GetCharacter(ww_display, c);
|
||||
WWCharacter_SetBitmap(ww_character, NULL);
|
||||
WWCharacter_ClearAllPixels(ww_character);
|
||||
WWScreen_SetCharacter(WWText_GetScreen(ww_text),
|
||||
WWText_GetX(ww_text) + tx,
|
||||
WWText_GetY(ww_text) + ty,
|
||||
@@ -72,10 +72,13 @@ int WWText_PutCharacter(WWText ww_text, int x, int y, int character,
|
||||
WWDisplay ww_display)
|
||||
{
|
||||
WWCharacter ww_character;
|
||||
int j, k, n;
|
||||
unsigned char pixel;
|
||||
int f, b;
|
||||
unsigned char bitmap[2];
|
||||
|
||||
if ((character < 0) || (character > 127)) {
|
||||
WonX_Warning("WWText_PutCharacter", "Character number is out of range.");
|
||||
fflush(stdout);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -87,7 +90,6 @@ int WWText_PutCharacter(WWText ww_text, int x, int y, int character,
|
||||
if ( (x < 0) || (x > WWText_GetWidth( ww_text) - 1) ||
|
||||
(y < 0) || (y > WWText_GetHeight(ww_text) - 1) ) {
|
||||
WonX_Warning("WWText_PutCharacter", "Position is out of range.");
|
||||
fflush(stdout);
|
||||
return (-1);
|
||||
}
|
||||
|
||||
@@ -102,7 +104,36 @@ int WWText_PutCharacter(WWText ww_text, int x, int y, int character,
|
||||
WWText_GetY(ww_text) + y);
|
||||
#endif
|
||||
|
||||
WWCharacter_CopyBitmap(ww_character, WWText_GetFont(ww_text, character));
|
||||
/*
|
||||
* <20>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>ȥե<C8A5><D5A5><EFBFBD><EFBFBD>Ȥ<EFBFBD>
|
||||
* f = WWDisplay_GetForegroundColor(ww_display);
|
||||
* b = WWDisplay_GetBackgroundColor(ww_display);
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><E8A4B9>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD>뤿<EFBFBD>ᡤ<EFBFBD><E1A1A4><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4>Ӥ˥ӥåȥޥåפԡ<F2A5B3A5><D4A1><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD>롥
|
||||
* <20>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC><EFBFBD>κݤˡ<DDA4><CBA1><EFBFBD><EFBFBD>Τ褦<CEA4>˽<EFBFBD><CBBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* <20><><EFBFBD>äơ<C3A4><C6A1>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>Ȥν<C8A4><CEBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWCharacter <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>
|
||||
* ̵<><CCB5><EFBFBD>ʤä<CAA4><C3A4>Τǡ<CEA4>WWCharacter <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤳<EFBFBD>ȡ<EFBFBD>
|
||||
*/
|
||||
|
||||
#if 0
|
||||
WWCharacter_CopyAllPixels(ww_character, WWText_GetFont(ww_text, character));
|
||||
#else
|
||||
f = WWDisplay_GetForegroundColor(ww_display);
|
||||
b = WWDisplay_GetBackgroundColor(ww_display);
|
||||
|
||||
n = character * 8;
|
||||
for (j = 0; j < 8; j++) {
|
||||
bitmap[0] = 0;
|
||||
bitmap[1] = 0;
|
||||
for (k = 0; k < 8; k++) {
|
||||
pixel = (fonts[n] & (1 << k)) ? f : b;
|
||||
bitmap[0] |= ( pixel & 1) << k;
|
||||
bitmap[1] |= ((pixel >> 1) & 1) << k;
|
||||
}
|
||||
WWCharacter_SetBitmap(ww_character, j*2 , bitmap[0]);
|
||||
WWCharacter_SetBitmap(ww_character, j*2+1, bitmap[1]);
|
||||
n++;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* ɽ<><C9BD><EFBFBD><EFBFBD><EFBFBD>˥ѥ<CBA5><D1A5>åȤ<C3A5><C8A4><EFBFBD><EFBFBD>ꤹ<EFBFBD><EAA4B9><EFBFBD>ΤǤ<CEA4><C7A4><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD> <20><><EFBFBD><EFBFBD> */
|
||||
WWScreen_SetPalette(WWText_GetScreen(ww_text),
|
||||
@@ -122,20 +153,46 @@ WWText WWText_Create(WWScreen screen,
|
||||
WWPalette palette)
|
||||
{
|
||||
WWText ww_text;
|
||||
int i;
|
||||
WWCharacter ww_character;
|
||||
int i, j, k, n;
|
||||
unsigned char pixel;
|
||||
int f, b;
|
||||
unsigned char bitmap[2];
|
||||
|
||||
ww_text = (WWText)malloc(sizeof(_WWText));
|
||||
if (ww_text == NULL) WonX_Error("WWText_Create", "Cannot allocate memory.");
|
||||
|
||||
WWText_SetScreen(ww_text, screen);
|
||||
WWText_SetX(ww_text, 0);
|
||||
WWText_SetY(ww_text, 0);
|
||||
WWText_SetX(ww_text, x);
|
||||
WWText_SetY(ww_text, y);
|
||||
WWText_SetWidth( ww_text, width );
|
||||
WWText_SetHeight(ww_text, height);
|
||||
WWText_SetPalette(ww_text, palette);
|
||||
|
||||
/* <20>ʲ<EFBFBD><CAB2>ϡ<EFBFBD>
|
||||
f = WWDisplay_GetForegroundColor(ww_display);
|
||||
b = WWDisplay_GetBackgroundColor(ww_display);
|
||||
<20>Ǽ<EFBFBD><C7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>٤<EFBFBD><D9A4><EFBFBD><EFBFBD>⤷<EFBFBD><E2A4B7><EFBFBD>ʤ<EFBFBD>
|
||||
*/
|
||||
f = 3;
|
||||
b = 0;
|
||||
|
||||
n = 0;
|
||||
for (i = 0; i < 128; i++) {
|
||||
WWText_SetFont(ww_text, i, WWCharacter_Create(i, &(fonts[i * 16])));
|
||||
ww_character = WWCharacter_Create(i);
|
||||
for (j = 0; j < 8; j++) {
|
||||
bitmap[0] = 0;
|
||||
bitmap[1] = 0;
|
||||
for (k = 0; k < 8; k++) {
|
||||
pixel = (fonts[n] & (1 << k)) ? f : b;
|
||||
bitmap[0] |= ( pixel & 1) << k;
|
||||
bitmap[1] |= ((pixel >> 1) & 1) << k;
|
||||
}
|
||||
WWCharacter_SetBitmap(ww_character, j*2 , bitmap[0]);
|
||||
WWCharacter_SetBitmap(ww_character, j*2+1, bitmap[1]);
|
||||
n++;
|
||||
}
|
||||
WWText_SetFont(ww_text, i, ww_character);
|
||||
}
|
||||
|
||||
return (ww_text);
|
||||
|
||||
15
WWText.h
15
WWText.h
@@ -57,21 +57,6 @@ WWText WWText_Create(WWScreen screen, int x, int y, int width, int height,
|
||||
WWPalette palette);
|
||||
WWText WWText_Destroy(WWText text);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/* End of File. */
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
256
WWTextFonts.c
256
WWTextFonts.c
@@ -1,130 +1,130 @@
|
||||
static unsigned char fonts[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 0 <20><><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8> */
|
||||
0x00,0x00,0x00,0x00,0xc0,0x0c,0x00,0x00,0x30,0x30,0xc0,0x0f,0x00,0x00,0x00,0x00, /* 1 <20>д<EFBFBD> */
|
||||
0x00,0x00,0xf0,0x3f,0x3c,0xf3,0xfc,0xff,0xcc,0xcf,0x3c,0xf0,0xf0,0x3f,0x00,0x00, /* 2 <20>д<EFBFBD> */
|
||||
0x30,0x30,0xfc,0xfc,0xfc,0xff,0xfc,0xff,0xf0,0x3f,0xc0,0x0f,0x00,0x03,0x00,0x00, /* 3 <20>ϡ<EFBFBD><CFA1><EFBFBD> */
|
||||
0x00,0x03,0xc0,0x0f,0xf0,0x3f,0xfc,0xff,0xf0,0x3f,0xc0,0x0f,0x00,0x03,0x00,0x00, /* 4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x00,0x03,0xc0,0x0f,0xc0,0x0f,0xfc,0xfc,0xfc,0xfc,0x00,0x03,0xc0,0x0f,0x00,0x00, /* 5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD> */
|
||||
0x00,0x03,0xc0,0x0f,0xf0,0x3f,0xfc,0xff,0xf0,0x3f,0x00,0x03,0xc0,0x0f,0x00,0x00, /* 6 <20><><EFBFBD>ڡ<EFBFBD><DAA1><EFBFBD> */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x03,0xc0,0x03,0x00,0x00,0x00,0x00,0x00,0x00, /* 7 <20><> */
|
||||
0x00,0x00,0x00,0x00,0xf0,0x0f,0x30,0x0c,0x30,0x0c,0xf0,0x0f,0x00,0x00,0x00,0x00, /* 8 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x00,0x00,0x00,0x00,0xc0,0x03,0x30,0x0c,0x30,0x0c,0xc0,0x03,0x00,0x00,0x00,0x00, /* 9 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x00,0x00,0xfc,0x3f,0x0c,0x30,0xcc,0x33,0xcc,0x33,0x0c,0x30,0xfc,0x3f,0x00,0x00, /* 10 <20><><EFBFBD>Żͳ<C5BB> */
|
||||
0x00,0xff,0x00,0xf0,0x00,0xcc,0xf0,0xc3,0x0c,0x03,0x0c,0x03,0xf0,0x00,0x00,0x00, /* 11 <20><> */
|
||||
0xc0,0x0f,0x30,0x30,0x30,0x30,0xc0,0x0f,0x00,0x03,0xf0,0x3f,0x00,0x03,0x00,0x00, /* 12 <20><> */
|
||||
0xc0,0x03,0xc0,0x0f,0xc0,0x3c,0xc0,0x30,0xc0,0x30,0xfc,0x00,0x3c,0x00,0x00,0x00, /* 13 <20><> */
|
||||
0xc0,0x03,0xc0,0x3f,0xc0,0x3c,0xc0,0x30,0x3c,0x30,0x3c,0x3f,0x00,0x0f,0x00,0x00, /* 14 <20><><EFBFBD><EFBFBD> */
|
||||
0x00,0x03,0x30,0x33,0xc0,0x0f,0xfc,0xfc,0xc0,0x0f,0x30,0x33,0x00,0x03,0x00,0x00, /* 15 <20><>ȯ<EFBFBD><C8AF> */
|
||||
0xc0,0x00,0xc0,0x03,0xc0,0x0f,0xc0,0x3f,0xc0,0x0f,0xc0,0x03,0xc0,0x00,0x00,0x00, /* 16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x00,0x0c,0x00,0x0f,0xc0,0x0f,0xf0,0x0f,0xc0,0x0f,0x00,0x0f,0x00,0x0c,0x00,0x00, /* 17 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x00,0x03,0xc0,0x0f,0xf0,0x3f,0x00,0x03,0xf0,0x3f,0xc0,0x0f,0x00,0x03,0x00,0x00, /* 18 <20>岼<EFBFBD><E5B2BC><EFBFBD><EFBFBD> */
|
||||
0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0x00,0x00,0xf0,0x3c,0x00,0x00, /* 19 !! */
|
||||
0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x3c,0x30,0x0f,0xf0,0x03,0xc0,0x00,0x00,0x00, /* 20 <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD> */
|
||||
0x00,0x00,0x00,0x00,0xc0,0x03,0xf0,0x0f,0xf0,0x0f,0xc0,0x03,0x00,0x00,0x00,0x00, /* 21 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x3c,0x3c,0x3c,0x00,0x00,0x00,0x00,0x00,0x00, /* 22 <20><><EFBFBD><EFBFBD> */
|
||||
0x00,0x03,0xc0,0x0f,0xf0,0x3f,0x00,0x03,0xf0,0x3f,0xc0,0x0f,0xf0,0x3f,0x00,0x00, /* 23 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x00,0x03,0xc0,0x0f,0xf0,0x3f,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x00, /* 24 <20><> */
|
||||
0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x03,0xf0,0x3f,0xc0,0x0f,0x00,0x03,0x00,0x00, /* 25 <20><> */
|
||||
0x00,0x00,0x00,0x0c,0x00,0x3c,0xfc,0xff,0x00,0x3c,0x00,0x0c,0x00,0x00,0x00,0x00, /* 26 <20><> */
|
||||
0x00,0x00,0xc0,0x00,0xf0,0x00,0xfc,0xff,0xf0,0x00,0xc0,0x00,0x00,0x00,0x00,0x00, /* 27 <20><> */
|
||||
0xf0,0x0f,0x0c,0x30,0xc3,0xcf,0x33,0xc0,0x33,0xc0,0xc3,0xcf,0x0c,0x30,0xf0,0x0f, /* 28 (C) */
|
||||
0x00,0x00,0xc0,0x0c,0xf0,0x3c,0xfc,0xff,0xf0,0x3c,0xc0,0x0c,0x00,0x00,0x00,0x00, /* 29 <20><><EFBFBD><EFBFBD> */
|
||||
0x00,0x00,0x00,0x03,0xc0,0x0f,0xf0,0x3f,0xfc,0xff,0x00,0x00,0x00,0x00,0x00,0x00, /* 30 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x00,0x00,0x00,0x00,0xfc,0xff,0xf0,0x3f,0xc0,0x0f,0x00,0x03,0x00,0x00,0x00,0x00, /* 31 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 32 <20><><EFBFBD><EFBFBD> */
|
||||
0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x00,0xc0,0x03,0x00,0x00, /* 33 ! */
|
||||
0xf0,0x3c,0xf0,0x3c,0xc0,0x30,0x30,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 34 " */
|
||||
0xc0,0x0c,0xc0,0x0c,0xfc,0xff,0xc0,0x0c,0xfc,0xff,0xc0,0x0c,0xc0,0x0c,0x00,0x00, /* 35 # */
|
||||
0x00,0x03,0xf0,0x3f,0x3c,0x03,0xf0,0x3f,0x00,0xf3,0xf0,0x3f,0x00,0x03,0x00,0x00, /* 36 $ */
|
||||
0x30,0xc0,0xcc,0x30,0x30,0x0c,0x00,0x03,0xc0,0x30,0x30,0xcc,0x0c,0x30,0x00,0x00, /* 37 % */
|
||||
0xc0,0x03,0x30,0x0c,0x30,0x0c,0xf0,0xc3,0x0c,0x3f,0x0c,0x0c,0xf0,0xf3,0x00,0x00, /* 38 & */
|
||||
0x00,0x0f,0x00,0x0f,0x00,0x0c,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 39 ' */
|
||||
0x00,0x0c,0x00,0x03,0xc0,0x00,0xc0,0x00,0xc0,0x00,0x00,0x03,0x00,0x0c,0x00,0x00, /* 40 ( */
|
||||
0xc0,0x00,0x00,0x03,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x03,0xc0,0x00,0x00,0x00, /* 41 ) */
|
||||
0x00,0x00,0x00,0x03,0x30,0x33,0xc0,0x0f,0x30,0x33,0x00,0x03,0x00,0x00,0x00,0x00, /* 42 * */
|
||||
0x00,0x03,0x00,0x03,0x00,0x03,0xfc,0xff,0x00,0x03,0x00,0x03,0x00,0x03,0x00,0x00, /* 43 + */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x3c,0x00,0x30,0x00,0x0c,0x00, /* 44 , */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 45 - */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x3c,0x00,0x00,0x00, /* 46 . */
|
||||
0x00,0xc0,0x00,0x30,0x00,0x0c,0x00,0x03,0xc0,0x00,0x30,0x00,0x0c,0x00,0x00,0x00, /* 47 / */
|
||||
0xf0,0x0f,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 48 0 */
|
||||
0x00,0x0f,0xf0,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x0f,0x00,0x00, /* 49 1 */
|
||||
0xf0,0x0f,0x3c,0x3c,0x00,0x3c,0x00,0x0f,0xc0,0x03,0xf0,0x00,0xfc,0x3f,0x00,0x00, /* 50 2 */
|
||||
0xf0,0x0f,0x3c,0x3c,0x00,0x3c,0xf0,0x0f,0x00,0x3c,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 51 3 */
|
||||
0x00,0x3f,0xc0,0x3f,0xf0,0x3c,0x3c,0x3c,0x3c,0x3c,0xfc,0xff,0x00,0x3c,0x00,0x00, /* 52 4 */
|
||||
0xfc,0x3f,0x3c,0x00,0x3c,0x00,0xfc,0x0f,0x00,0x3c,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 53 5 */
|
||||
0xf0,0x0f,0x3c,0x3c,0x3c,0x00,0xfc,0x0f,0x3c,0x3c,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 54 6 */
|
||||
0xfc,0x3f,0x3c,0x3c,0x00,0x3c,0x00,0x0f,0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x00, /* 55 7 */
|
||||
0xf0,0x0f,0x3c,0x3c,0x3c,0x3c,0xf0,0x0f,0x3c,0x3c,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 56 8 */
|
||||
0xf0,0x0f,0x3c,0x3c,0x3c,0x3c,0xf0,0x3f,0x00,0x3c,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 57 9 */
|
||||
0x00,0x00,0xc0,0x03,0xc0,0x03,0x00,0x00,0xc0,0x03,0xc0,0x03,0x00,0x00,0x00,0x00, /* 58 : */
|
||||
0x00,0x00,0xc0,0x03,0xc0,0x03,0x00,0x00,0xc0,0x03,0xc0,0x03,0x00,0x03,0xc0,0x00, /* 59 ; */
|
||||
0x00,0x0c,0x00,0x03,0xc0,0x00,0x30,0x00,0xc0,0x00,0x00,0x03,0x00,0x0c,0x00,0x00, /* 60 < */
|
||||
0x00,0x00,0x00,0x00,0xfc,0xff,0x00,0x00,0xfc,0xff,0x00,0x00,0x00,0x00,0x00,0x00, /* 61 = */
|
||||
0xc0,0x00,0x00,0x03,0x00,0x0c,0x00,0x30,0x00,0x0c,0x00,0x03,0xc0,0x00,0x00,0x00, /* 62 > */
|
||||
0xf0,0x0f,0x3c,0x3c,0x3c,0x3c,0x00,0x0f,0xc0,0x03,0x00,0x00,0xc0,0x03,0x00,0x00, /* 63 ? */
|
||||
0xf0,0x3f,0x0c,0xcc,0xcc,0xcf,0xcc,0xcc,0xcc,0xff,0x0c,0x00,0xf0,0x3f,0x00,0x00, /* 64 @ */
|
||||
0xc0,0x0f,0xf0,0x3c,0x3c,0xf0,0x3c,0xf0,0xfc,0xff,0x3c,0xf0,0x3c,0xf0,0x00,0x00, /* 65 A */
|
||||
0xfc,0x3f,0x3c,0xf0,0x3c,0xf0,0xfc,0x3f,0x3c,0xf0,0x3c,0xf0,0xfc,0x3f,0x00,0x00, /* 66 B */
|
||||
0xf0,0x3f,0x3c,0xf0,0x3c,0x00,0x3c,0x00,0x3c,0x00,0x3c,0xf0,0xf0,0x3f,0x00,0x00, /* 67 C */
|
||||
0xfc,0x0f,0x3c,0x3c,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0x3c,0xfc,0x0f,0x00,0x00, /* 68 D */
|
||||
0xfc,0x3f,0x3c,0x00,0x3c,0x00,0xfc,0x0f,0x3c,0x00,0x3c,0x00,0xfc,0x3f,0x00,0x00, /* 69 E */
|
||||
0xfc,0x3f,0x3c,0x00,0x3c,0x00,0xfc,0x0f,0x3c,0x00,0x3c,0x00,0x3c,0x00,0x00,0x00, /* 70 F */
|
||||
0xf0,0x3f,0x3c,0xf0,0x3c,0x00,0x3c,0xfc,0x3c,0xf0,0x3c,0xf0,0xf0,0x3f,0x00,0x00, /* 71 G */
|
||||
0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0xfc,0xff,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x00,0x00, /* 72 H */
|
||||
0xf0,0x0f,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xf0,0x0f,0x00,0x00, /* 73 I */
|
||||
0x00,0xff,0x00,0xf0,0x00,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0xf0,0x3f,0x00,0x00, /* 74 J */
|
||||
0x3c,0xf0,0x3c,0x3c,0x3c,0x0f,0xfc,0x03,0x3c,0x0f,0x3c,0x3c,0x3c,0xf0,0x00,0x00, /* 75 K */
|
||||
0x3c,0x00,0x3c,0x00,0x3c,0x00,0x3c,0x00,0x3c,0x00,0x3c,0x00,0xfc,0xff,0x00,0x00, /* 76 L */
|
||||
0x3c,0xf0,0xfc,0xfc,0xfc,0xff,0x3c,0xf3,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x00,0x00, /* 77 M */
|
||||
0x3c,0xf0,0xfc,0xf0,0xfc,0xf3,0x3c,0xff,0x3c,0xfc,0x3c,0xf0,0x3c,0xf0,0x00,0x00, /* 78 N */
|
||||
0xf0,0x3f,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0xf0,0x3f,0x00,0x00, /* 79 O */
|
||||
0xfc,0x3f,0x3c,0xf0,0x3c,0xf0,0xfc,0x3f,0x3c,0x00,0x3c,0x00,0x3c,0x00,0x00,0x00, /* 80 P */
|
||||
0xf0,0x3f,0x3c,0xf0,0x3c,0xf0,0x3c,0xf3,0x3c,0xff,0x3c,0xfc,0xf0,0x3f,0x00,0x00, /* 81 Q */
|
||||
0xfc,0x3f,0x3c,0xf0,0x3c,0xf0,0xfc,0x3f,0x3c,0x0f,0x3c,0x3c,0x3c,0xf0,0x00,0x00, /* 82 R */
|
||||
0xf0,0x3f,0x3c,0xf0,0x3c,0x00,0xf0,0x3f,0x00,0xf0,0x3c,0xf0,0xf0,0x3f,0x00,0x00, /* 83 S */
|
||||
0xfc,0x3f,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x00, /* 84 T */
|
||||
0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0xf0,0x3f,0x00,0x00, /* 85 U */
|
||||
0x3c,0xf0,0x3c,0xf0,0x3c,0xf0,0xf0,0x3c,0xf0,0x3c,0xc0,0x0f,0x00,0x03,0x00,0x00, /* 86 V */
|
||||
0x3c,0xf0,0x3c,0xf3,0x3c,0xf3,0x3c,0xf3,0xfc,0xff,0xf0,0x3c,0x30,0x30,0x00,0x00, /* 87 W */
|
||||
0x3c,0xf0,0x3c,0xf0,0xf0,0x3c,0xc0,0x0f,0xf0,0x3c,0x3c,0xf0,0x3c,0xf0,0x00,0x00, /* 88 X */
|
||||
0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0xf0,0x0f,0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x00, /* 89 Y */
|
||||
0xfc,0xff,0x00,0xf0,0x00,0x3c,0x00,0x0f,0xc0,0x03,0xf0,0x00,0xfc,0xff,0x00,0x00, /* 90 Z */
|
||||
0xc0,0x0f,0xc0,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x00,0xc0,0x0f,0x00,0x00, /* 91 [ */
|
||||
0x0c,0x00,0x30,0x00,0xc0,0x00,0x00,0x03,0x00,0x0c,0x00,0x30,0x00,0xc0,0x00,0x00, /* 92 \ */
|
||||
0xc0,0x0f,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c,0x00,0x0c,0xc0,0x0f,0x00,0x00, /* 93 ] */
|
||||
0x00,0x03,0xc0,0x0f,0xf0,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 94 ^ */
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0x00,0x00, /* 95 _ */
|
||||
0xc0,0x03,0xc0,0x03,0x00,0x03,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 96 ` */
|
||||
0x00,0x00,0x00,0x00,0xf0,0x3f,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0xf0,0xff,0x00,0x00, /* 97 a */
|
||||
0x3c,0x00,0x3c,0x00,0xfc,0x0f,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0xfc,0x0f,0x00,0x00, /* 98 b */
|
||||
0x00,0x00,0x00,0x00,0xf0,0x0f,0x3c,0x3c,0x3c,0x00,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 99 c */
|
||||
0x00,0x3c,0x00,0x3c,0xf0,0x3f,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0xf0,0x3f,0x00,0x00, /* 100 d */
|
||||
0x00,0x00,0x00,0x00,0xf0,0x0f,0x3c,0x3c,0xfc,0x3f,0x3c,0x00,0xf0,0x0f,0x00,0x00, /* 101 e */
|
||||
0xc0,0x0f,0xf0,0x30,0xf0,0x00,0xfc,0x0f,0xf0,0x00,0xf0,0x00,0xf0,0x00,0x00,0x00, /* 102 f */
|
||||
0x00,0x00,0x00,0x00,0xf0,0x3f,0x3c,0x3c,0x3c,0x3c,0xc0,0x3f,0x3c,0x3c,0xf0,0x0f, /* 103 g */
|
||||
0x3c,0x00,0x3c,0x00,0xfc,0x0f,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x00,0x00, /* 104 h */
|
||||
0xc0,0x03,0x00,0x00,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x00, /* 105 i */
|
||||
0x00,0x3c,0x00,0x00,0x00,0x3c,0x00,0x3c,0x00,0x3c,0x00,0x3c,0x3c,0x3c,0xf0,0x0f, /* 106 j */
|
||||
0x3c,0x00,0x3c,0x00,0x3c,0x3c,0x3c,0x0f,0xfc,0x00,0x3c,0x0f,0x3c,0x3c,0x00,0x00, /* 107 k */
|
||||
0xf0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xc0,0x03,0xf0,0x0f,0x00,0x00, /* 108 l */
|
||||
0x00,0x00,0x00,0x00,0xfc,0x3c,0x3c,0xf3,0x3c,0xf3,0x3c,0xf3,0x3c,0xf3,0x00,0x00, /* 109 m */
|
||||
0x00,0x00,0x00,0x00,0xfc,0x0f,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x00,0x00, /* 110 n */
|
||||
0x00,0x00,0x00,0x00,0xf0,0x0f,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0xf0,0x0f,0x00,0x00, /* 111 o */
|
||||
0x00,0x00,0x00,0x00,0xfc,0x0f,0x3c,0x3c,0x3c,0x3c,0xfc,0x0f,0x3c,0x00,0x3c,0x00, /* 112 p */
|
||||
0x00,0x00,0x00,0x00,0xf0,0x3f,0x3c,0x3c,0x3c,0x3c,0xc0,0x3f,0x00,0x3c,0x00,0x3c, /* 113 q */
|
||||
0x00,0x00,0x00,0x00,0x3c,0x3f,0xfc,0x00,0x3c,0x00,0x3c,0x00,0x3c,0x00,0x00,0x00, /* 114 r */
|
||||
0x00,0x00,0x00,0x00,0xf0,0x3f,0xfc,0x00,0xf0,0x0f,0x00,0x3f,0xfc,0x0f,0x00,0x00, /* 115 s */
|
||||
0xc0,0x03,0xc0,0x03,0xf0,0x3f,0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x3f,0x00,0x00, /* 116 t */
|
||||
0x00,0x00,0x00,0x00,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0x3c,0xf0,0xff,0x00,0x00, /* 117 u */
|
||||
0x00,0x00,0x00,0x00,0x3c,0x3c,0x3c,0x3c,0x30,0x0c,0xf0,0x0f,0xc0,0x03,0x00,0x00, /* 118 v */
|
||||
0x00,0x00,0x00,0x00,0x3c,0xf0,0x3c,0xf3,0x30,0x33,0xf0,0x3f,0xc0,0x0c,0x00,0x00, /* 119 w */
|
||||
0x00,0x00,0x00,0x00,0x3c,0x3c,0xf0,0x0f,0xc0,0x03,0xf0,0x0f,0x3c,0x3c,0x00,0x00, /* 120 x */
|
||||
0x00,0x00,0x00,0x00,0x3c,0x3c,0x3c,0x3c,0xf0,0x0f,0xc0,0x03,0xf0,0x00,0x3c,0x00, /* 121 y */
|
||||
0x00,0x00,0x00,0x00,0xfc,0x3f,0x00,0x0f,0xc0,0x03,0xf0,0x00,0xfc,0x3f,0x00,0x00, /* 122 z */
|
||||
0x00,0x0f,0xc0,0x03,0xc0,0x03,0xf0,0x00,0xc0,0x03,0xc0,0x03,0x00,0x0f,0x00,0x00, /* 123 { */
|
||||
0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x00,0xc0,0x03,0xc0,0x03,0xc0,0x03,0x00,0x00, /* 124 | */
|
||||
0xc0,0x03,0x00,0x0f,0x00,0x0f,0x00,0x3c,0x00,0x0f,0x00,0x0f,0xc0,0x03,0x00,0x00, /* 125 } */
|
||||
0xf0,0x30,0xf0,0x0f,0x0c,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 126 ~ */
|
||||
0x00,0x03,0x00,0x03,0xc0,0x0c,0xc0,0x0c,0x30,0x30,0x30,0x30,0xf0,0x3f,0x00,0x00 /* 127 <20><> */
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0 <20><><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8> */
|
||||
0x00, 0x00, 0x14, 0x00, 0x22, 0x1c, 0x00, 0x00, /* 1 <20>д<EFBFBD> */
|
||||
0x00, 0x3e, 0x6b, 0x7f, 0x5d, 0x63, 0x3e, 0x00, /* 2 <20>д<EFBFBD> */
|
||||
0x22, 0x77, 0x7f, 0x7f, 0x3e, 0x1c, 0x08, 0x00, /* 3 <20>ϡ<EFBFBD><CFA1><EFBFBD> */
|
||||
0x08, 0x1c, 0x3e, 0x7f, 0x3e, 0x1c, 0x08, 0x00, /* 4 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x08, 0x1c, 0x1c, 0x77, 0x77, 0x08, 0x1c, 0x00, /* 5 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD> */
|
||||
0x08, 0x1c, 0x3e, 0x7f, 0x3e, 0x08, 0x1c, 0x00, /* 6 <20><><EFBFBD>ڡ<EFBFBD><DAA1><EFBFBD> */
|
||||
0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, /* 7 <20><> */
|
||||
0x00, 0x00, 0x3c, 0x24, 0x24, 0x3c, 0x00, 0x00, /* 8 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x00, 0x00, 0x18, 0x24, 0x24, 0x18, 0x00, 0x00, /* 9 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x00, 0x7e, 0x42, 0x5a, 0x5a, 0x42, 0x7e, 0x00, /* 10 <20><><EFBFBD>Żͳ<C5BB> */
|
||||
0x0f, 0x03, 0x05, 0x39, 0x48, 0x48, 0x30, 0x00, /* 11 <20><> */
|
||||
0x1c, 0x22, 0x22, 0x1c, 0x08, 0x3e, 0x08, 0x00, /* 12 <20><> */
|
||||
0x18, 0x1c, 0x16, 0x12, 0x12, 0x70, 0x60, 0x00, /* 13 <20><> */
|
||||
0x18, 0x1e, 0x16, 0x12, 0x62, 0x6e, 0x0c, 0x00, /* 14 <20><><EFBFBD><EFBFBD> */
|
||||
0x08, 0x2a, 0x1c, 0x77, 0x1c, 0x2a, 0x08, 0x00, /* 15 <20><>ȯ<EFBFBD><C8AF> */
|
||||
0x10, 0x18, 0x1c, 0x1e, 0x1c, 0x18, 0x10, 0x00, /* 16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x04, 0x0c, 0x1c, 0x3c, 0x1c, 0x0c, 0x04, 0x00, /* 17 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x08, 0x1c, 0x3e, 0x08, 0x3e, 0x1c, 0x08, 0x00, /* 18 <20>岼<EFBFBD><E5B2BC><EFBFBD><EFBFBD> */
|
||||
0x36, 0x36, 0x36, 0x36, 0x36, 0x00, 0x36, 0x00, /* 19 !! */
|
||||
0x00, 0x00, 0x02, 0x06, 0x2c, 0x38, 0x10, 0x00, /* 20 <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD> */
|
||||
0x00, 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00, 0x00, /* 21 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x00, 0x00, 0x00, 0x66, 0x66, 0x00, 0x00, 0x00, /* 22 <20><><EFBFBD><EFBFBD> */
|
||||
0x08, 0x1c, 0x3e, 0x08, 0x3e, 0x1c, 0x3e, 0x00, /* 23 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x08, 0x1c, 0x3e, 0x08, 0x08, 0x08, 0x08, 0x00, /* 24 <20><> */
|
||||
0x08, 0x08, 0x08, 0x08, 0x3e, 0x1c, 0x08, 0x00, /* 25 <20><> */
|
||||
0x00, 0x04, 0x06, 0x7f, 0x06, 0x04, 0x00, 0x00, /* 26 <20><> */
|
||||
0x00, 0x10, 0x30, 0x7f, 0x30, 0x10, 0x00, 0x00, /* 27 <20><> */
|
||||
0x3c, 0x42, 0x9d, 0xa1, 0xa1, 0x9d, 0x42, 0x3c, /* 28 (C) */
|
||||
0x00, 0x14, 0x36, 0x7f, 0x36, 0x14, 0x00, 0x00, /* 29 <20><><EFBFBD><EFBFBD> */
|
||||
0x00, 0x08, 0x1c, 0x3e, 0x7f, 0x00, 0x00, 0x00, /* 30 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x00, 0x00, 0x7f, 0x3e, 0x1c, 0x08, 0x00, 0x00, /* 31 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 32 <20><><EFBFBD><EFBFBD> */
|
||||
0x18, 0x18, 0x18, 0x18, 0x18, 0x00, 0x18, 0x00, /* 33 ! */
|
||||
0x36, 0x36, 0x12, 0x24, 0x00, 0x00, 0x00, 0x00, /* 34 " */
|
||||
0x14, 0x14, 0x7f, 0x14, 0x7f, 0x14, 0x14, 0x00, /* 35 # */
|
||||
0x08, 0x3e, 0x68, 0x3e, 0x0b, 0x3e, 0x08, 0x00, /* 36 $ */
|
||||
0x21, 0x52, 0x24, 0x08, 0x12, 0x25, 0x42, 0x00, /* 37 % */
|
||||
0x18, 0x24, 0x24, 0x39, 0x4e, 0x44, 0x3b, 0x00, /* 38 & */
|
||||
0x0c, 0x0c, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00, /* 39 ' */
|
||||
0x04, 0x08, 0x10, 0x10, 0x10, 0x08, 0x04, 0x00, /* 40 ( */
|
||||
0x10, 0x08, 0x04, 0x04, 0x04, 0x08, 0x10, 0x00, /* 41 ) */
|
||||
0x00, 0x08, 0x2a, 0x1c, 0x2a, 0x08, 0x00, 0x00, /* 42 * */
|
||||
0x08, 0x08, 0x08, 0x7f, 0x08, 0x08, 0x08, 0x00, /* 43 + */
|
||||
0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x20, 0x40, /* 44 , */
|
||||
0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, /* 45 - */
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, /* 46 . */
|
||||
0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, /* 47 / */
|
||||
0x3c, 0x66, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x00, /* 48 0 */
|
||||
0x0c, 0x3c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x00, /* 49 1 */
|
||||
0x3c, 0x66, 0x06, 0x0c, 0x18, 0x30, 0x7e, 0x00, /* 50 2 */
|
||||
0x3c, 0x66, 0x06, 0x3c, 0x06, 0x66, 0x3c, 0x00, /* 51 3 */
|
||||
0x0e, 0x1e, 0x36, 0x66, 0x66, 0x7f, 0x06, 0x00, /* 52 4 */
|
||||
0x7e, 0x60, 0x60, 0x7c, 0x06, 0x66, 0x3c, 0x00, /* 53 5 */
|
||||
0x3c, 0x66, 0x60, 0x7c, 0x66, 0x66, 0x3c, 0x00, /* 54 6 */
|
||||
0x7e, 0x66, 0x06, 0x0c, 0x18, 0x18, 0x18, 0x00, /* 55 7 */
|
||||
0x3c, 0x66, 0x66, 0x3c, 0x66, 0x66, 0x3c, 0x00, /* 56 8 */
|
||||
0x3c, 0x66, 0x66, 0x3e, 0x06, 0x66, 0x3c, 0x00, /* 57 9 */
|
||||
0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x00, 0x00, /* 58 : */
|
||||
0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x08, 0x10, /* 59 ; */
|
||||
0x04, 0x08, 0x10, 0x20, 0x10, 0x08, 0x04, 0x00, /* 60 < */
|
||||
0x00, 0x00, 0x7f, 0x00, 0x7f, 0x00, 0x00, 0x00, /* 61 = */
|
||||
0x10, 0x08, 0x04, 0x02, 0x04, 0x08, 0x10, 0x00, /* 62 > */
|
||||
0x3c, 0x66, 0x66, 0x0c, 0x18, 0x00, 0x18, 0x00, /* 63 ? */
|
||||
0x3e, 0x45, 0x5d, 0x55, 0x5f, 0x40, 0x3e, 0x00, /* 64 @ */
|
||||
0x1c, 0x36, 0x63, 0x63, 0x7f, 0x63, 0x63, 0x00, /* 65 A */
|
||||
0x7e, 0x63, 0x63, 0x7e, 0x63, 0x63, 0x7e, 0x00, /* 66 B */
|
||||
0x3e, 0x63, 0x60, 0x60, 0x60, 0x63, 0x3e, 0x00, /* 67 C */
|
||||
0x7c, 0x66, 0x63, 0x63, 0x63, 0x66, 0x7c, 0x00, /* 68 D */
|
||||
0x7e, 0x60, 0x60, 0x7c, 0x60, 0x60, 0x7e, 0x00, /* 69 E */
|
||||
0x7e, 0x60, 0x60, 0x7c, 0x60, 0x60, 0x60, 0x00, /* 70 F */
|
||||
0x3e, 0x63, 0x60, 0x67, 0x63, 0x63, 0x3e, 0x00, /* 71 G */
|
||||
0x63, 0x63, 0x63, 0x7f, 0x63, 0x63, 0x63, 0x00, /* 72 H */
|
||||
0x3c, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, /* 73 I */
|
||||
0x0f, 0x03, 0x03, 0x63, 0x63, 0x63, 0x3e, 0x00, /* 74 J */
|
||||
0x63, 0x66, 0x6c, 0x78, 0x6c, 0x66, 0x63, 0x00, /* 75 K */
|
||||
0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7f, 0x00, /* 76 L */
|
||||
0x63, 0x77, 0x7f, 0x6b, 0x63, 0x63, 0x63, 0x00, /* 77 M */
|
||||
0x63, 0x73, 0x7b, 0x6f, 0x67, 0x63, 0x63, 0x00, /* 78 N */
|
||||
0x3e, 0x63, 0x63, 0x63, 0x63, 0x63, 0x3e, 0x00, /* 79 O */
|
||||
0x7e, 0x63, 0x63, 0x7e, 0x60, 0x60, 0x60, 0x00, /* 80 P */
|
||||
0x3e, 0x63, 0x63, 0x6b, 0x6f, 0x67, 0x3e, 0x00, /* 81 Q */
|
||||
0x7e, 0x63, 0x63, 0x7e, 0x6c, 0x66, 0x63, 0x00, /* 82 R */
|
||||
0x3e, 0x63, 0x60, 0x3e, 0x03, 0x63, 0x3e, 0x00, /* 83 S */
|
||||
0x7e, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, /* 84 T */
|
||||
0x63, 0x63, 0x63, 0x63, 0x63, 0x63, 0x3e, 0x00, /* 85 U */
|
||||
0x63, 0x63, 0x63, 0x36, 0x36, 0x1c, 0x08, 0x00, /* 86 V */
|
||||
0x63, 0x6b, 0x6b, 0x6b, 0x7f, 0x36, 0x22, 0x00, /* 87 W */
|
||||
0x63, 0x63, 0x36, 0x1c, 0x36, 0x63, 0x63, 0x00, /* 88 X */
|
||||
0x66, 0x66, 0x66, 0x3c, 0x18, 0x18, 0x18, 0x00, /* 89 Y */
|
||||
0x7f, 0x03, 0x06, 0x0c, 0x18, 0x30, 0x7f, 0x00, /* 90 Z */
|
||||
0x1c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x1c, 0x00, /* 91 [ */
|
||||
0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01, 0x00, /* 92 \ */
|
||||
0x1c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x1c, 0x00, /* 93 ] */
|
||||
0x08, 0x1c, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, /* 94 ^ */
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, /* 95 _ */
|
||||
0x18, 0x18, 0x08, 0x04, 0x00, 0x00, 0x00, 0x00, /* 96 ` */
|
||||
0x00, 0x00, 0x3e, 0x66, 0x66, 0x66, 0x3f, 0x00, /* 97 a */
|
||||
0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x7c, 0x00, /* 98 b */
|
||||
0x00, 0x00, 0x3c, 0x66, 0x60, 0x66, 0x3c, 0x00, /* 99 c */
|
||||
0x06, 0x06, 0x3e, 0x66, 0x66, 0x66, 0x3e, 0x00, /* 100 d */
|
||||
0x00, 0x00, 0x3c, 0x66, 0x7e, 0x60, 0x3c, 0x00, /* 101 e */
|
||||
0x1c, 0x32, 0x30, 0x7c, 0x30, 0x30, 0x30, 0x00, /* 102 f */
|
||||
0x00, 0x00, 0x3e, 0x66, 0x66, 0x1e, 0x66, 0x3c, /* 103 g */
|
||||
0x60, 0x60, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x00, /* 104 h */
|
||||
0x18, 0x00, 0x18, 0x18, 0x18, 0x18, 0x18, 0x00, /* 105 i */
|
||||
0x06, 0x00, 0x06, 0x06, 0x06, 0x06, 0x66, 0x3c, /* 106 j */
|
||||
0x60, 0x60, 0x66, 0x6c, 0x70, 0x6c, 0x66, 0x00, /* 107 k */
|
||||
0x38, 0x18, 0x18, 0x18, 0x18, 0x18, 0x3c, 0x00, /* 108 l */
|
||||
0x00, 0x00, 0x76, 0x6b, 0x6b, 0x6b, 0x6b, 0x00, /* 109 m */
|
||||
0x00, 0x00, 0x7c, 0x66, 0x66, 0x66, 0x66, 0x00, /* 110 n */
|
||||
0x00, 0x00, 0x3c, 0x66, 0x66, 0x66, 0x3c, 0x00, /* 111 o */
|
||||
0x00, 0x00, 0x7c, 0x66, 0x66, 0x7c, 0x60, 0x60, /* 112 p */
|
||||
0x00, 0x00, 0x3e, 0x66, 0x66, 0x1e, 0x06, 0x06, /* 113 q */
|
||||
0x00, 0x00, 0x6e, 0x70, 0x60, 0x60, 0x60, 0x00, /* 114 r */
|
||||
0x00, 0x00, 0x3e, 0x70, 0x3c, 0x0e, 0x7c, 0x00, /* 115 s */
|
||||
0x18, 0x18, 0x3e, 0x18, 0x18, 0x18, 0x0e, 0x00, /* 116 t */
|
||||
0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3f, 0x00, /* 117 u */
|
||||
0x00, 0x00, 0x66, 0x66, 0x24, 0x3c, 0x18, 0x00, /* 118 v */
|
||||
0x00, 0x00, 0x63, 0x6b, 0x2a, 0x3e, 0x14, 0x00, /* 119 w */
|
||||
0x00, 0x00, 0x66, 0x3c, 0x18, 0x3c, 0x66, 0x00, /* 120 x */
|
||||
0x00, 0x00, 0x66, 0x66, 0x3c, 0x18, 0x30, 0x60, /* 121 y */
|
||||
0x00, 0x00, 0x7e, 0x0c, 0x18, 0x30, 0x7e, 0x00, /* 122 z */
|
||||
0x0c, 0x18, 0x18, 0x30, 0x18, 0x18, 0x0c, 0x00, /* 123 { */
|
||||
0x18, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18, 0x00, /* 124 | */
|
||||
0x18, 0x0c, 0x0c, 0x06, 0x0c, 0x0c, 0x18, 0x00, /* 125 } */
|
||||
0x32, 0x3c, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, /* 126 ~ */
|
||||
0x08, 0x08, 0x14, 0x14, 0x22, 0x22, 0x3e, 0x00 /* 127 <20><> */
|
||||
};
|
||||
|
||||
11
WWTextP.h
11
WWTextP.h
@@ -21,6 +21,17 @@ typedef struct _WWText {
|
||||
int base; /* <20><><EFBFBD>Ѥ<EFBFBD><D1A4>륭<EFBFBD><EBA5AD><EFBFBD>饯<EFBFBD><E9A5AF><EFBFBD>Υ١<CEA5><D9A1><EFBFBD> */
|
||||
|
||||
WWPalette palette;
|
||||
|
||||
/*
|
||||
* <20>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>ȥե<C8A5><D5A5><EFBFBD><EFBFBD>Ȥ<EFBFBD>
|
||||
* f = WWDisplay_GetForegroundColor(ww_display);
|
||||
* b = WWDisplay_GetBackgroundColor(ww_display);
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><E8A4B9>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD>뤿<EFBFBD>ᡤ<EFBFBD><E1A1A4><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4>Ӥ˥ӥåȥޥåפԡ<F2A5B3A5><D4A1><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD>롥
|
||||
* <20>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>顼<EFBFBD><E9A1BC><EFBFBD>κݤˡ<DDA4><CBA1><EFBFBD><EFBFBD>Τ褦<CEA4>˽<EFBFBD><CBBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
* <20><><EFBFBD>äơ<C3A4><C6A1>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>Ȥν<C8A4><CEBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> WWCharacter <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD>
|
||||
* ̵<><CCB5><EFBFBD>ʤä<CAA4><C3A4>Τǡ<CEA4>WWCharacter <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤳<EFBFBD>ȡ<EFBFBD>
|
||||
* (WWText_PutCharacter() <20><><EFBFBD><EFBFBD>)
|
||||
*/
|
||||
WWCharacter font[128]; /* <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD> */
|
||||
|
||||
} _WWText;
|
||||
|
||||
@@ -45,7 +45,7 @@ WonXDisplay WonXDisplay_Create(int x_width, int x_height,
|
||||
return (wonx_display);
|
||||
}
|
||||
|
||||
int WonXDisplay_Sync(WonXDisplay wonx_display)
|
||||
int WonXDisplay_PrintData(WonXDisplay wonx_display)
|
||||
{
|
||||
int i;
|
||||
XDisplay x_display;
|
||||
@@ -56,19 +56,24 @@ int WonXDisplay_Sync(WonXDisplay wonx_display)
|
||||
|
||||
if (XDisplay_GetColorMapPrint(x_display)) {
|
||||
WWColorMap_PrintData(WWDisplay_GetColorMap(ww_display), stdout);
|
||||
fflush(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);
|
||||
WWPalette_PrintData(WWDisplay_GetPalette(ww_display, i),
|
||||
ww_display, stdout);
|
||||
fflush(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);
|
||||
WWCharacter_PrintData(WWDisplay_GetCharacter(ww_display, i),
|
||||
ww_display, stdout);
|
||||
fflush(stdout);
|
||||
}
|
||||
XDisplay_SetCharacterPrint(x_display, 0);
|
||||
}
|
||||
@@ -76,10 +81,22 @@ int WonXDisplay_Sync(WonXDisplay wonx_display)
|
||||
if (XDisplay_GetSpritePrint(x_display)) {
|
||||
for (i = 0; i < 128; i++) {
|
||||
WWSprite_PrintData(WWDisplay_GetSprite(ww_display, i), stdout);
|
||||
fflush(stdout);
|
||||
}
|
||||
XDisplay_SetSpritePrint(x_display, 0);
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int WonXDisplay_Sync(WonXDisplay wonx_display)
|
||||
{
|
||||
XDisplay x_display;
|
||||
|
||||
WonXDisplay_PrintData(wonx_display);
|
||||
|
||||
x_display = WonXDisplay_GetXDisplay(wonx_display);
|
||||
|
||||
XDisplay_Sync(x_display);
|
||||
|
||||
return (0);
|
||||
@@ -97,7 +114,7 @@ int WonXDisplay_Flush(WonXDisplay 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);
|
||||
XDisplay_DrawLCDWindow(x_display, ww_display, ww_lcd_panel);
|
||||
}
|
||||
|
||||
WonXDisplay_Sync(wonx_display);
|
||||
|
||||
@@ -27,6 +27,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_PrintData(WonXDisplay wonx_display);
|
||||
int WonXDisplay_Sync(WonXDisplay wonx_display);
|
||||
int WonXDisplay_Flush(WonXDisplay wonx_display);
|
||||
|
||||
|
||||
@@ -116,6 +116,8 @@ static int WonXTimer_Callback(WonXSystem wonx_system)
|
||||
WWInterrupt_ExecuteReceiveReadyCallback(ww_interrupt);
|
||||
}
|
||||
|
||||
WonXDisplay_PrintData(wonx_display);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
743
XColorGC.c
Normal file
743
XColorGC.c
Normal file
@@ -0,0 +1,743 @@
|
||||
/*****************************************************************************/
|
||||
/* XColorGC GC<47>ȿ<EFBFBD><C8BF>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䤤<EFBFBD><E4A4A4><EFBFBD>碌<EFBFBD>ѤΥ饤<CEA5>֥<EFBFBD><D6A5><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
#include "XColorGCP.h"
|
||||
|
||||
#include "WonX.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/*===========================================================================*/
|
||||
/* XColorGCInstance <20><>Ϣ */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static XColorGCInstance XColorGCInstance_Create(XDisplay x_display,
|
||||
XColor color)
|
||||
{
|
||||
XColorGCInstance instance;
|
||||
|
||||
instance = (XColorGCInstance)malloc(sizeof(_XColorGCInstance));
|
||||
if (instance == NULL)
|
||||
WonX_Error("XColorGCInstance_Create", "Cannot allocate memory");
|
||||
|
||||
instance->x_display = x_display;
|
||||
instance->color = color;
|
||||
|
||||
XAllocColor(XDisplay_GetDisplay(instance->x_display),
|
||||
XDisplay_GetColormap(instance->x_display),
|
||||
&(instance->color));
|
||||
|
||||
/* XAllocColor <20><> instance->color.red <20>ʤɤ<CAA4><C9A4><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>Ѥ<EFBFBD><D1A4>äƤ<C3A4><C6A4>ޤ<EFBFBD><DEA4>Τǡ<CEA4> */
|
||||
/* <20><><EFBFBD>Ȥ<EFBFBD><C8A4>᤹<EFBFBD><E1A4B9><EFBFBD>Ǥʤ<C7A4><CAA4>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>Ȥ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>RGB<47>ͤǸ<CDA4><C7B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ⡤<C6A4><E2A1A4><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD> */
|
||||
/* <20><><EFBFBD>ᤵ<EFBFBD><E1A4B5><EFBFBD>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><C7A4>ʤ<EFBFBD><CAA4>Τǡ<CEA4><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¸<EFBFBD><C2B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̣<EFBFBD><CCA3>̵<EFBFBD><CCB5><EFBFBD>ʤä<CAA4> */
|
||||
/* <20><><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||
instance->color.red = color.red;
|
||||
instance->color.green = color.green;
|
||||
instance->color.blue = color.blue;
|
||||
|
||||
instance->gc = XDisplay_CreateGC(instance->x_display);
|
||||
|
||||
XSetForeground(XDisplay_GetDisplay(instance->x_display), instance->gc,
|
||||
instance->color.pixel);
|
||||
XSetBackground(XDisplay_GetDisplay(instance->x_display), instance->gc,
|
||||
instance->color.pixel);
|
||||
|
||||
return (instance);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static XColorGCInstance XColorGCInstance_Destroy(XColorGCInstance instance)
|
||||
{
|
||||
unsigned long pixel;
|
||||
|
||||
if (instance == NULL) return (NULL);
|
||||
if (instance->gc) XDisplay_DestroyGC(instance->x_display, instance->gc);
|
||||
pixel = instance->color.pixel;
|
||||
XFreeColors(XDisplay_GetDisplay(instance->x_display),
|
||||
XDisplay_GetColormap(instance->x_display),
|
||||
&pixel, 1, 0);
|
||||
free(instance);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*===========================================================================*/
|
||||
/* XColorGCList <20><>Ϣ */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static XColorGCList XColorGCList_Create(XDisplay x_display, int studying_flag)
|
||||
{
|
||||
XColorGCList list;
|
||||
|
||||
list = (XColorGCList)malloc(sizeof(_XColorGCList));
|
||||
if (list == NULL) WonX_Error("XColorGCList_Create", "Cannot allocate memory");
|
||||
|
||||
list->x_display = x_display;
|
||||
list->studying_flag = studying_flag;
|
||||
list->list = ObjList_Create();
|
||||
|
||||
return (list);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static XColorGCList XColorGCList_Destroy(XColorGCList list)
|
||||
{
|
||||
if (list == NULL) return (NULL);
|
||||
|
||||
if (list->list) ObjList_Destroy(list->list);
|
||||
|
||||
free(list);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* XColorGCList <20><><EFBFBD>Ǥ<EFBFBD> XColorGCInstance <20>Υ<EFBFBD><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD>Ӵؿ<D3B4> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static int XColorGCInstance_CmpToColor(XColorGCInstance gci, XColor color)
|
||||
{
|
||||
if (gci->color.red > color.red ) return ( 1);
|
||||
if (gci->color.red < color.red ) return (-1);
|
||||
if (gci->color.green > color.green) return ( 1);
|
||||
if (gci->color.green < color.green) return (-1);
|
||||
if (gci->color.blue > color.blue ) return ( 1);
|
||||
if (gci->color.blue < color.blue ) return (-1);
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20>ꥹ<EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD> XColorGCInstance <20><><EFBFBD><EFBFBD><EFBFBD>롥 */
|
||||
/* GC <20>μ<EFBFBD><CEBC><EFBFBD><EFBFBD><EFBFBD><D7B5><EFBFBD><EFBFBD>Ф<EFBFBD><D0A4>ơ<EFBFBD>GC <20>Υꥹ<CEA5>Ȥ<C8A4><F2B8A1BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD> */
|
||||
/* ¸<>ߤ<EFBFBD><DFA4>ʤ<EFBFBD><CAA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤϡ<CBA4><CFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥꥹ<C6A5>Ȥ<EFBFBD><C8A4>ɲä<C9B2><C3A4>롥 */
|
||||
/* (<28><><EFBFBD><EFBFBD> RGB <20>ͤǥ<CDA4><C7A5><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>줿<EFBFBD><ECA4BF><EFBFBD>֤<EFBFBD><D6A4>ɲä<C9B2><C3A4><EFBFBD>) */
|
||||
/* <20><><EFBFBD><EFBFBD>õ<EFBFBD><C3B5><EFBFBD>ʤΤǡ<CEA4>O(n^2)<29><><EFBFBD>٤<EFBFBD><D9A4>ʤ롥 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static XColorGCInstance XColorGCList_GetXColorGCInstance(XColorGCList list,
|
||||
XColor color)
|
||||
{
|
||||
XColorGCInstance instance;
|
||||
ObjListData current;
|
||||
int cmp;
|
||||
|
||||
for (current = ObjList_GetStart(list->list);
|
||||
!ObjList_IsEndEdge(list->list, current);
|
||||
current = ObjListData_GetNext(current)) {
|
||||
|
||||
instance = (XColorGCInstance)ObjListData_GetObj(current);
|
||||
cmp = XColorGCInstance_CmpToColor(instance, color);
|
||||
|
||||
if (cmp == 0) { /* <20><><EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD> */
|
||||
#ifdef HIT_LIST
|
||||
fprintf(stderr, "S");
|
||||
#endif
|
||||
if (list->studying_flag) ObjList_MoveObjToStart(list->list, current);
|
||||
return (instance);
|
||||
} else if (cmp > 0) {
|
||||
if (!list->studying_flag) break;
|
||||
}
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥꥹ<C6A5>Ȥ<EFBFBD><C8A4>ɲä<C9B2><C3A4><EFBFBD> */
|
||||
instance = XColorGCInstance_Create(list->x_display, color);
|
||||
|
||||
if (list->studying_flag)
|
||||
ObjList_InsertObjToStart(list->list, instance,
|
||||
(ObjDestructor)XColorGCInstance_Destroy);
|
||||
else
|
||||
ObjList_InsertObjToPrev(list->list, current, instance,
|
||||
(ObjDestructor)XColorGCInstance_Destroy);
|
||||
|
||||
#ifdef HIT_LIST
|
||||
fprintf(stderr, "A");
|
||||
#endif
|
||||
|
||||
return (instance);
|
||||
}
|
||||
|
||||
/*===========================================================================*/
|
||||
/* XColorGCCache <20><>Ϣ */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD>ѥХåե<C3A5> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static XColorGCCacheBuffer XColorGCCacheBuffer_Create(XColorGCInstance instance)
|
||||
{
|
||||
XColorGCCacheBuffer buffer;
|
||||
buffer = (XColorGCCacheBuffer)malloc(sizeof(_XColorGCCacheBuffer));
|
||||
if (buffer == NULL) WonX_Error("XColorGCCacheBuffer_Create",
|
||||
"Cannot allocate memory.");
|
||||
buffer->instance = instance;
|
||||
return (buffer);
|
||||
}
|
||||
|
||||
static XColorGCCacheBuffer XColorGCCacheBuffer_Destroy(XColorGCCacheBuffer buffer)
|
||||
{
|
||||
if (buffer == NULL) return (NULL);
|
||||
free(buffer);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static XColorGCCache XColorGCCache_Create(XColorGCList color_gc_list, int size)
|
||||
{
|
||||
XColorGCCache cache;
|
||||
|
||||
cache = (XColorGCCache)malloc(sizeof(_XColorGCCache));
|
||||
if (cache == NULL) WonX_Error("XColorGCCache_Create",
|
||||
"Cannot allocate memory.");
|
||||
|
||||
cache->size = size;
|
||||
cache->color_gc_list = color_gc_list;
|
||||
cache->buffer_list = ObjList_Create();
|
||||
|
||||
return (cache);
|
||||
}
|
||||
|
||||
static XColorGCCache XColorGCCache_Destroy(XColorGCCache cache)
|
||||
{
|
||||
if (cache == NULL) return (NULL);
|
||||
|
||||
if (cache->buffer_list) ObjList_Destroy(cache->buffer_list);
|
||||
free(cache);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5>夫<EFBFBD><E5A4AB> XColorGCInstance <20><><EFBFBD><EFBFBD><EFBFBD>롥 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static XColorGCInstance XColorGCCache_GetXColorGCInstance(XColorGCCache cache,
|
||||
XColor color)
|
||||
{
|
||||
ObjListData current;
|
||||
XColorGCCacheBuffer buffer;
|
||||
XColorGCInstance instance;
|
||||
int cmp;
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
for (current = ObjList_GetStart(cache->buffer_list);
|
||||
!ObjList_IsEndEdge(cache->buffer_list, current);
|
||||
current = ObjListData_GetNext(current)) {
|
||||
|
||||
buffer = (XColorGCCacheBuffer)ObjListData_GetObj(current);
|
||||
cmp = XColorGCInstance_CmpToColor(buffer->instance, color);
|
||||
|
||||
if (cmp == 0) { /* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD><CBB8>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
#ifdef HIT_CACHE
|
||||
fprintf(stderr, "H"); /* Hit! */
|
||||
#endif
|
||||
ObjList_MoveObjToStart(cache->buffer_list, current);
|
||||
return (buffer->instance);
|
||||
}
|
||||
}
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD><CBB8>Ĥ<EFBFBD><C4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
|
||||
/* <20>ꥹ<EFBFBD>Ȥ<EFBFBD><C8A4>鸡<EFBFBD><E9B8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
instance = XColorGCList_GetXColorGCInstance(cache->color_gc_list, color);
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲä<C9B2><C3A4><EFBFBD> */
|
||||
if (ObjList_GetLength(cache->buffer_list) < cache->size) {
|
||||
buffer = XColorGCCacheBuffer_Create(instance);
|
||||
ObjList_InsertObjToStart(cache->buffer_list, buffer,
|
||||
(ObjDestructor)XColorGCCacheBuffer_Destroy);
|
||||
} else {
|
||||
current = ObjList_GetEnd(cache->buffer_list);
|
||||
buffer = (XColorGCCacheBuffer)ObjListData_GetObj(current);
|
||||
buffer->instance = instance;
|
||||
ObjList_MoveObjToStart(cache->buffer_list, current);
|
||||
}
|
||||
|
||||
#ifdef HIT_CACHE
|
||||
fprintf(stderr, "F"); /* False! */
|
||||
#endif
|
||||
|
||||
return (instance);
|
||||
}
|
||||
|
||||
/*===========================================================================*/
|
||||
/* XColorGCHash <20><>Ϣ */
|
||||
/*===========================================================================*/
|
||||
|
||||
static XColorGCHash XColorGCHash_Create(XDisplay x_display,
|
||||
int studying_flag,
|
||||
int cache_flag,
|
||||
int cache_size,
|
||||
int hash_number)
|
||||
{
|
||||
XColorGCHash hash;
|
||||
int i;
|
||||
|
||||
hash = (XColorGCHash)malloc(sizeof(_XColorGCHash));
|
||||
if (hash == NULL)
|
||||
WonX_Error("XColorGCHash_Create", "Cannot allocate memory.");
|
||||
|
||||
hash->number = hash_number;
|
||||
hash->cache_flag = cache_flag;
|
||||
|
||||
if (cache_flag) {
|
||||
hash->color_gc_cache =
|
||||
(XColorGCCache *)malloc(sizeof(XColorGCCache) * hash->number);
|
||||
if (hash->color_gc_cache == NULL)
|
||||
WonX_Error("XColorGCHash_Create", "Cannot allocate memory.");
|
||||
} else {
|
||||
hash->color_gc_cache = NULL;
|
||||
}
|
||||
|
||||
hash->color_gc_list =
|
||||
(XColorGCList *)malloc(sizeof(XColorGCList) * hash->number);
|
||||
if (hash->color_gc_list == NULL)
|
||||
WonX_Error("XColorGCHash_Create", "Cannot allocate memory.");
|
||||
|
||||
for (i = 0; i < hash->number; i++) {
|
||||
hash->color_gc_list[i] = XColorGCList_Create(x_display, studying_flag);
|
||||
if (cache_flag) {
|
||||
hash->color_gc_cache[i] = XColorGCCache_Create(hash->color_gc_list[i],
|
||||
cache_size);
|
||||
}
|
||||
}
|
||||
|
||||
return (hash);
|
||||
}
|
||||
|
||||
static XColorGCHash XColorGCHash_Destroy(XColorGCHash hash)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (hash == NULL) return (NULL);
|
||||
|
||||
if (hash->color_gc_cache) {
|
||||
for (i = 0; i < hash->number; i++) {
|
||||
if (hash->color_gc_cache[i])
|
||||
XColorGCCache_Destroy(hash->color_gc_cache[i]);
|
||||
}
|
||||
free(hash->color_gc_cache);
|
||||
}
|
||||
|
||||
if (hash->color_gc_list) {
|
||||
for (i = 0; i < hash->number; i++) {
|
||||
if (hash->color_gc_list[i])
|
||||
XColorGCList_Destroy(hash->color_gc_list[i]);
|
||||
}
|
||||
free(hash->color_gc_list);
|
||||
}
|
||||
|
||||
free(hash);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static void XColorGCHash_OutputHashStatus(XColorGCHash hash)
|
||||
{
|
||||
int i;
|
||||
printf ("\nHash :");
|
||||
for (i = 0; i < hash->number; i++) {
|
||||
printf("%d ", ObjList_GetLength(hash->color_gc_list[i]->list));
|
||||
}
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20>ϥå<CFA5><C3A5><EFBFBD><EFBFBD>ؿ<EFBFBD> */
|
||||
/* <20><><EFBFBD><EFBFBD><F2B8BABF><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>硤<EFBFBD><E7A1A4><EFBFBD><EFBFBD><EFBFBD>ΰ<EFBFBD><CEB0>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤ˻<CBA4><CBBB>Ѥ<EFBFBD><D1A4>줿<EFBFBD>ꤷ<EFBFBD>ʤ<EFBFBD><CAA4>褦<EFBFBD><E8A4A6><EFBFBD><EFBFBD><EFBFBD>ա<EFBFBD> */
|
||||
/* (<28><><EFBFBD>Ȥ<EFBFBD><C8A4>С<EFBFBD> */
|
||||
/* ((int)color.red*3 + (int)color.green*2 + (int)color.blue) % hash->number */
|
||||
/* <20>Τ褦<CEA4>ʥϥå<CFA5><C3A5><EFBFBD><EFBFBD>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>ȡ<EFBFBD>16<31><36>Ĵ<EFBFBD>˸<EFBFBD><CBB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ˡ<EFBFBD>4096 <20><><EFBFBD>ܿ<EFBFBD><DCBF>ΰ<EFBFBD><CEB0>֤<EFBFBD><D6A4><EFBFBD> */
|
||||
/* <20><><EFBFBD>ˤ˻<CBA4><CBBB>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static int HashFunction(XColorGCHash hash, XColor color)
|
||||
{
|
||||
return ((
|
||||
(((int)color.red) / 3000) * 11 +
|
||||
(((int)color.green) % 3000) / 7 +
|
||||
(((int)color.blue) % 1000) / 3
|
||||
) % hash->number);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20>ϥå<CFA5><C3A5>夫<EFBFBD><E5A4AB> XColorGCInstance <20><><EFBFBD><EFBFBD><EFBFBD>롥 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static XColorGCInstance XColorGCHash_GetXColorGCInstance(XColorGCHash hash,
|
||||
XColor color)
|
||||
{
|
||||
int n;
|
||||
|
||||
n = HashFunction(hash, color);
|
||||
|
||||
if (hash->cache_flag)
|
||||
return (XColorGCCache_GetXColorGCInstance(hash->color_gc_cache[n], color));
|
||||
else
|
||||
return (XColorGCList_GetXColorGCInstance(hash->color_gc_list[n], color));
|
||||
}
|
||||
|
||||
/*===========================================================================*/
|
||||
/* ColorName <20><>Ϣ */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static ColorName ColorName_Create(XDisplay x_display, char * name)
|
||||
{
|
||||
ColorName color_name;
|
||||
|
||||
color_name = (ColorName)malloc(sizeof(_ColorName));
|
||||
if (color_name == NULL)
|
||||
WonX_Error("ColorName_Create", "Cannot allocate memory");
|
||||
|
||||
color_name->name = malloc(sizeof(char) * (strlen(name) + 1));
|
||||
if (color_name->name == NULL)
|
||||
WonX_Error("ColorName_Create", "Cannot allocate memory");
|
||||
|
||||
strcpy(color_name->name, name);
|
||||
|
||||
XParseColor(XDisplay_GetDisplay(x_display),
|
||||
XDisplay_GetColormap(x_display),
|
||||
color_name->name, &(color_name->color));
|
||||
|
||||
return (color_name);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static ColorName ColorName_Destroy(ColorName color_name)
|
||||
{
|
||||
if (color_name == NULL) return (NULL);
|
||||
if (color_name->name) free(color_name->name);
|
||||
free(color_name);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static ColorNameList ColorNameList_Create(XDisplay x_display)
|
||||
{
|
||||
ColorNameList list;
|
||||
|
||||
list = (ColorNameList)malloc(sizeof(_ColorNameList));
|
||||
if (list == NULL)
|
||||
WonX_Error("ColorNameList_Create", "Cannot allocate memory");
|
||||
|
||||
list->x_display = x_display;
|
||||
list->list = ObjList_Create();
|
||||
|
||||
return (list);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static ColorNameList ColorNameList_Destroy(ColorNameList list)
|
||||
{
|
||||
if (list == NULL) return (NULL);
|
||||
if (list->list) ObjList_Destroy(list->list);
|
||||
free(list);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϳ<EFBFBD><CDBF><EFBFBD><EFBFBD><EFBFBD>줿<EFBFBD><ECA4BF>̾<EFBFBD><CCBE><EFBFBD>顤RGB<47>ͤ<CDA4><F2B8A1BA><EFBFBD><EFBFBD>롥 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static XColor ColorNameList_GetColor(ColorNameList list, char * name)
|
||||
{
|
||||
ObjListData current;
|
||||
ColorName color_name;
|
||||
|
||||
for (current = ObjList_GetStart(list->list);
|
||||
!ObjList_IsEndEdge(list->list, current);
|
||||
current = ObjListData_GetNext(current)) {
|
||||
color_name = (ColorName)ObjListData_GetObj(current);
|
||||
if (!strcmp(color_name->name, name)) {
|
||||
ObjList_MoveObjToStart(list->list, current);
|
||||
return (color_name->color);
|
||||
}
|
||||
}
|
||||
|
||||
color_name = ColorName_Create(list->x_display, name);
|
||||
if (color_name == NULL)
|
||||
WonX_Error("ColorNameList_GetColor", "Cannot create ColorName");
|
||||
|
||||
ObjList_InsertObjToStart(list->list, color_name,
|
||||
(ObjDestructor)ColorName_Destroy);
|
||||
|
||||
return (color_name->color);
|
||||
}
|
||||
|
||||
/*===========================================================================*/
|
||||
/* XColorGC <20><>Ϣ */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
XColorGC XColorGC_Create(XColorGCDatabase database, XColor color)
|
||||
{
|
||||
XColorGC color_gc;
|
||||
|
||||
color_gc = (XColorGC)malloc(sizeof(_XColorGC));
|
||||
|
||||
/* <20>ϥå<CFA5><C3A5>夫<EFBFBD>鿧<EFBFBD><E9BFA7>GC<47><EFBFBD> */
|
||||
color_gc->instance = XColorGCHash_GetXColorGCInstance(database->hash, color);
|
||||
|
||||
return (color_gc);
|
||||
}
|
||||
|
||||
XColorGC XColorGC_CreateFromXColorGC(XColorGCDatabase database, XColorGC c)
|
||||
{
|
||||
XColorGC color_gc;
|
||||
|
||||
color_gc = (XColorGC)malloc(sizeof(_XColorGC));
|
||||
|
||||
color_gc->instance = c->instance;
|
||||
|
||||
return (color_gc);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RGB <20>ͤ<EFBFBD><CDA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롥 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
XColorGC XColorGC_CreateFromRGB(XColorGCDatabase database,
|
||||
int red, int green, int blue)
|
||||
{
|
||||
XColor color;
|
||||
|
||||
color.red = red;
|
||||
color.green = green;
|
||||
color.blue = blue;
|
||||
color.flags = DoRed | DoGreen | DoBlue;
|
||||
|
||||
return (XColorGC_Create(database, color));
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
XColorGC XColorGC_Destroy(XColorGC color_gc)
|
||||
{
|
||||
if (!color_gc) return (NULL);
|
||||
|
||||
free(color_gc);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
/*===========================================================================*/
|
||||
/* ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD>ɤ߹<C9A4><DFB9><EFBFBD><EFBFBD>Ѵؿ<D1B4> */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>Ρ<EFBFBD><CEA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥδؿ<CEB4><D8BF><EFBFBD> */
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ζ<EFBFBD>ͭ<EFBFBD><CDAD><EFBFBD><EFBFBD><EFBFBD>ʤߡ<CAA4><DFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5>θ<F3A5B0A4><CEB8>̤<EFBFBD><CCA4>礭<EFBFBD><E7A4AD><EFBFBD>ʤ롥 */
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ɸ<EFBFBD><C9B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͭ<EFBFBD>Ǥ<EFBFBD><C7A4>ʤ<EFBFBD><CAA4>Τǡ<CEA4>̵<EFBFBD>̤<EFBFBD>¿<EFBFBD><C2BF><EFBFBD>ʤ롥 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
static XColor DecreaseColor(XColor color, int gradation)
|
||||
{
|
||||
int div = RGB_MAX_VALUE / gradation + 1;
|
||||
|
||||
color.red /= div;
|
||||
if (color.red >= gradation - 1) color.red = RGB_MAX_VALUE;
|
||||
else color.red *= div;
|
||||
|
||||
color.green /= div;
|
||||
if (color.green >= gradation - 1) color.green = RGB_MAX_VALUE;
|
||||
else color.green *= div;
|
||||
|
||||
color.blue /= div;
|
||||
if (color.blue >= gradation - 1) color.blue = RGB_MAX_VALUE;
|
||||
else color.blue *= div;
|
||||
|
||||
return (color);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD><EFBFBD>GC<47>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> name <20><>Ϳ<EFBFBD><CDBF><EFBFBD><EFBFBD><EFBFBD>줿̾<ECA4BF><CCBE><EFBFBD>ο<EFBFBD><CEBF><EFBFBD><F2B8A1BA><EFBFBD><EFBFBD>롥 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
XColorGC XColorGC_CreateFromCharacters(XColorGCDatabase database, char * name)
|
||||
{
|
||||
XColor color;
|
||||
|
||||
if (!strcmp(name, "none") ||
|
||||
!strcmp(name, "None") ||
|
||||
!strcmp(name, "NONE") ||
|
||||
!strcmp(name, "back") ||
|
||||
!strcmp(name, "Back") ||
|
||||
!strcmp(name, "BACK") ||
|
||||
!strcmp(name, "background") ||
|
||||
!strcmp(name, "Background") ||
|
||||
!strcmp(name, "BACKGROUND")) {
|
||||
if (database->background_color_gc)
|
||||
return (XColorGC_CreateFromXColorGC(database,
|
||||
database->background_color_gc));
|
||||
else
|
||||
#if 1
|
||||
name = "none";
|
||||
#else
|
||||
name = "black";
|
||||
#endif
|
||||
}
|
||||
|
||||
color = ColorNameList_GetColor(database->color_name_list, name);
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4>ᡤ<EFBFBD><E1A1A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
color = DecreaseColor(color, database->gradation);
|
||||
|
||||
return (XColorGC_Create(database, color));
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* XColor <20><>¤<EFBFBD>Τμ<CEA4><CEBC><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
XColor XColorGC_GetColor(XColorGC color_gc)
|
||||
{
|
||||
return (color_gc->instance->color);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤμ<CDA4><CEBC><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
unsigned long XColorGC_GetPixel(XColorGC color_gc)
|
||||
{
|
||||
return (color_gc->instance->color.pixel);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* GC <20>μ<EFBFBD><CEBC><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
GC XColorGC_GetGC(XColorGC color_gc)
|
||||
{
|
||||
return (color_gc->instance->gc);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤵<EFBFBD>μ<EFBFBD><CEBC><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
int GetBrightness(XColor color)
|
||||
{
|
||||
long int br;
|
||||
|
||||
#if 0
|
||||
br = color.red > color.green ? color.red : color.green;
|
||||
br = br > color.blue ? br : color.blue;
|
||||
br = br * 100 / RGB_MAX_VALUE;
|
||||
#else
|
||||
br = color.red + color.green + color.blue;
|
||||
br = br * 100 / RGB_MAX_VALUE;
|
||||
#endif
|
||||
|
||||
if (br > 100) br = 100;
|
||||
|
||||
return ((int)br);
|
||||
}
|
||||
|
||||
/*===========================================================================*/
|
||||
/* GC <20>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD> */
|
||||
/*===========================================================================*/
|
||||
|
||||
XColorGCDatabase XColorGCDatabase_Create(XDisplay x_display,
|
||||
int studying_flag,
|
||||
int cache_flag,
|
||||
int cache_size,
|
||||
int hash_number,
|
||||
char * background,
|
||||
int gradation)
|
||||
{
|
||||
XColorGCDatabase database;
|
||||
|
||||
database = (XColorGCDatabase)malloc(sizeof(_XColorGCDatabase));
|
||||
if (database == NULL)
|
||||
WonX_Error("XColorGCDatabase_Create", "Cannot allocate memory.");
|
||||
|
||||
database->x_display = x_display;
|
||||
database->gradation = gradation;
|
||||
|
||||
database->hash = XColorGCHash_Create(database->x_display,
|
||||
studying_flag,
|
||||
cache_flag,
|
||||
cache_size,
|
||||
hash_number);
|
||||
database->color_name_list = ColorNameList_Create(database->x_display);
|
||||
|
||||
/* background <20><> "none" <20>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD><EFBFBD>ư<EFBFBD><EFBFBD><EEA4B9><EFBFBD>褦<EFBFBD>ˡ<EFBFBD> */
|
||||
/* XColorGC_CreateFromCharacters()<29><><EFBFBD>ƤӽФ<D3BD><D0A4><EFBFBD><EFBFBD>ˡ<EFBFBD>NULL <20>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롥 */
|
||||
database->background_color_gc = NULL;
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> database <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƸƤӽФ<D3BD><D0A4>Τǡ<CEA4>ɬ<EFBFBD><C9AC><EFBFBD>Ǹ<EFBFBD><C7B8><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
database->background_color_gc =
|
||||
XColorGC_CreateFromCharacters(database, background);
|
||||
/* <20><><EFBFBD><EFBFBD>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD> return() <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ˤ<EFBFBD><CBA4>뤳<EFBFBD><EBA4B3> */
|
||||
|
||||
return (database);
|
||||
}
|
||||
|
||||
XColorGCDatabase XColorGCDatabase_Destroy(XColorGCDatabase database)
|
||||
{
|
||||
if (database == NULL) return (NULL);
|
||||
|
||||
if (database->background_color_gc)
|
||||
XColorGC_Destroy(database->background_color_gc);
|
||||
|
||||
if (database->color_name_list)
|
||||
ColorNameList_Destroy(database->color_name_list);
|
||||
if (database->hash) XColorGCHash_Destroy(database->hash);
|
||||
free(database);
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
XColorGC XColorGCDatabase_GetBackgroundXColorGC(XColorGCDatabase database)
|
||||
{
|
||||
return (database->background_color_gc);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD>塼<EFBFBD>˥<EFBFBD><CBA5><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
void XColorGCDatabase_OutputHashStatus(XColorGCDatabase database)
|
||||
{
|
||||
XColorGCHash_OutputHashStatus(database->hash);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* End of File */
|
||||
/*****************************************************************************/
|
||||
98
XColorGC.h
Normal file
98
XColorGC.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/*****************************************************************************/
|
||||
/* XColorGC GC<47>ȿ<EFBFBD><C8BF>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䤤<EFBFBD><E4A4A4><EFBFBD>碌<EFBFBD>ѤΥ饤<CEA5>֥<EFBFBD><D6A5><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
#ifndef _XColorGC_h_INCLUDED_
|
||||
#define _XColorGC_h_INCLUDED_
|
||||
|
||||
typedef struct _XColorGCDatabase * XColorGCDatabase;
|
||||
typedef struct _XColorGC * XColorGC;
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
#include "XDisplay.h"
|
||||
#include "Obj.h"
|
||||
|
||||
/*===========================================================================*/
|
||||
/* XColorGC <20><>Ϣ */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
XColorGC XColorGC_Create(XColorGCDatabase database, XColor color);
|
||||
XColorGC XColorGC_CreateFromXColorGC(XColorGCDatabase database, XColorGC c);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* RGB <20>ͤ<EFBFBD><CDA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>롥 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
XColorGC XColorGC_CreateFromRGB(XColorGCDatabase database,
|
||||
int red, int green, int blue);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD>֥<EFBFBD><D6A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥκ<C8A4><CEBA><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
XColorGC XColorGC_Destroy(XColorGC color_gc);
|
||||
|
||||
/*===========================================================================*/
|
||||
/* ʸ<><CAB8><EFBFBD><EFBFBD><EFBFBD>ɤ߹<C9A4><DFB9><EFBFBD><EFBFBD>Ѵؿ<D1B4> */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD><EFBFBD>GC<47>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> name <20><>Ϳ<EFBFBD><CDBF><EFBFBD><EFBFBD><EFBFBD>줿̾<ECA4BF><CCBE><EFBFBD>ο<EFBFBD><CEBF><EFBFBD><F2B8A1BA><EFBFBD><EFBFBD>롥 */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
XColorGC XColorGC_CreateFromCharacters(XColorGCDatabase database, char * name);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* XColor <20><>¤<EFBFBD>Τμ<CEA4><CEBC><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
XColor XColorGC_GetColor(XColorGC color_gc);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤμ<CDA4><CEBC><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
unsigned long XColorGC_GetPixel(XColorGC color_gc);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* GC <20>μ<EFBFBD><CEBC><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
GC XColorGC_GetGC(XColorGC color_gc);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤵<EFBFBD>μ<EFBFBD><CEBC><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
int GetBrightness(XColor color);
|
||||
|
||||
/*===========================================================================*/
|
||||
/* GC <20>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD> */
|
||||
/*===========================================================================*/
|
||||
|
||||
XColorGCDatabase XColorGCDatabase_Create(XDisplay x_display,
|
||||
int studying_flag,
|
||||
int cache_flag,
|
||||
int cache_size,
|
||||
int hash_number,
|
||||
char * background,
|
||||
int gradation);
|
||||
XColorGCDatabase XColorGCDatabase_Destroy(XColorGCDatabase database);
|
||||
XColorGC XColorGCDatabase_GetBackgroundXColorGC(XColorGCDatabase database);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20><><EFBFBD>塼<EFBFBD>˥<EFBFBD><CBA5><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
void XColorGCDatabase_OutputHashStatus(XColorGCDatabase database);
|
||||
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
/* End of File */
|
||||
/*****************************************************************************/
|
||||
148
XColorGCP.h
Normal file
148
XColorGCP.h
Normal file
@@ -0,0 +1,148 @@
|
||||
/*****************************************************************************/
|
||||
/* XColorGC GC<47>ȿ<EFBFBD><C8BF>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䤤<EFBFBD><E4A4A4><EFBFBD>碌<EFBFBD>ѤΥ饤<CEA5>֥<EFBFBD><D6A5><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
#ifndef _XColorGCP_h_INCLUDED_
|
||||
#define _XColorGCP_h_INCLUDED_
|
||||
|
||||
#include "XColorGC.h"
|
||||
|
||||
#define RGB_MAX_VALUE 65535
|
||||
|
||||
/*===========================================================================*/
|
||||
/* XFireworks <20>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ι<EFBFBD>®<EFBFBD><C2AE><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פʿ<D7A4><CABF><EFBFBD> GC <20>ϡ<EFBFBD><CFA1><EFBFBD>ư<EFBFBD><C6B0><EFBFBD><EFBFBD> */
|
||||
/* <20><><EFBFBD>٤Ƴ<D9A4><C6B3>ݤ<EFBFBD><DDA4><EFBFBD><EFBFBD>ΤǤ<CEA4><C7A4><EFBFBD><EFBFBD><EFBFBD>̵<EFBFBD>̤<EFBFBD> X <20><><EFBFBD><EFBFBD><EFBFBD>ФؤΥꥯ<CEA5><EAA5AF><EFBFBD><EFBFBD><EFBFBD>Ȥȥ<C8A4><C8A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϲ<EFBFBD><CFB2><EFBFBD><EFBFBD> */
|
||||
/* <20><><EFBFBD>餹<EFBFBD><E9A4B9><EFBFBD><EFBFBD><EFBFBD>ˡ<EFBFBD><CBA1><EFBFBD><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݤ<EFBFBD><DDA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> GC <20>ϥǡ<CFA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/* Ʊ<><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פˤʤä<CAA4><C3A4>Ȥ<EFBFBD><C8A4>ˤϡ<CBA4><CFA1><EFBFBD>ͭ<EFBFBD><CDAD><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ˤ<EFBFBD><CBA4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||
/* (XColorGCDatabase <20>Ϥ<EFBFBD><CFA4>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>饹<EFBFBD>Ǥ<EFBFBD>) */
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD><CBA4>ꡤXAllocColor() <20>ˤ<EFBFBD><CBA4>뿧<EFBFBD><EBBFA7><EFBFBD>䤤<EFBFBD><E4A4A4><EFBFBD>碌<EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤿<EFBFBD>ᡤ */
|
||||
/* <20><>ư<EFBFBD><C6B0><EFBFBD><EFBFBD><EFBFBD>ʤ˹<CAA4>®<EFBFBD>ˤʤ<CBA4><CAA4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||
/* <20>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD><EFBFBD>θ<EFBFBD><CEB8><EFBFBD><EFBFBD>ˤϡ<CBA4><CFA1>ϥå<CFA5><C3A5>塤<EFBFBD><E5A1A4><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5>塤<EFBFBD>ؽ<EFBFBD><D8BD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4>뤳<EFBFBD>Ȥ<EFBFBD> */
|
||||
/* <20>Ǥ<EFBFBD><C7A4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||
/*===========================================================================*/
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20>ʲ<EFBFBD><CAB2><EFBFBD>ͭ<EFBFBD><CDAD><EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD>ȡ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GC<47><43><EFBFBD>ɤ줯<C9A4>餤<EFBFBD><E9A4A4>ͭ<EFBFBD><CDAD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>뤫Ĵ<EBA4AB>٤뤳<D9A4>Ȥ<EFBFBD> */
|
||||
/* <20>Ǥ<EFBFBD><C7A4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/* #define HIT_LIST */
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* <20>ʲ<EFBFBD><CAB2><EFBFBD>ͭ<EFBFBD><CDAD><EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD>Υҥå<D2A5>Ψ<EFBFBD><CEA8>Ĵ<EFBFBD>٤뤳<D9A4>Ȥ<EFBFBD><C8A4>Ǥ<EFBFBD><C7A4>ޤ<EFBFBD><DEA4><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
/* #define HIT_CACHE */
|
||||
|
||||
/*===========================================================================*/
|
||||
/* GC <20>μ<EFBFBD><CEBC>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>륯<EFBFBD>饹 */
|
||||
/*===========================================================================*/
|
||||
|
||||
typedef struct _XColorGCInstance * XColorGCInstance;
|
||||
|
||||
typedef struct _XColorGCInstance {
|
||||
XDisplay x_display;
|
||||
GC gc;
|
||||
XColor color;
|
||||
} _XColorGCInstance;
|
||||
|
||||
/*===========================================================================*/
|
||||
/* GC <20>μ<EFBFBD><CEBC>ΤΥꥹ<CEA5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>륯<EFBFBD>饹 */
|
||||
/* Ʊ<><C6B1><EFBFBD>ο<EFBFBD><CEBF><EFBFBD>GC<47>϶<EFBFBD>ͭ<EFBFBD><CDAD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᡤGC<47>μ<EFBFBD><CEBC>Τ<EFBFBD><CEA4>ꥹ<EFBFBD>ȤǴ<C8A4><C7B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>GC<47>μ<EFBFBD><CEBC><EFBFBD><EFBFBD><EFBFBD><D7B5><EFBFBD> */
|
||||
/* <20>Ф<EFBFBD><D0A4>ơ<EFBFBD>Ŭ<EFBFBD>ڤ<EFBFBD> XColorGCInstance <20><><EFBFBD>֤<EFBFBD><D6A4><EFBFBD> */
|
||||
/* (<28><><EFBFBD>Ǥ<EFBFBD>¸<EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD>Τʤ餽<CAA4><E9A4BD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD>̵<EFBFBD><CCB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Create <20><><EFBFBD><EFBFBD>) */
|
||||
/*===========================================================================*/
|
||||
|
||||
typedef struct _XColorGCList * XColorGCList;
|
||||
|
||||
typedef struct _XColorGCList { /* GC <20>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
XDisplay x_display;
|
||||
int studying_flag; /* <20>ؽ<EFBFBD><D8BD><EFBFBD>ǽ<EFBFBD><C7BD>ON/OFF<46>Υե饰 */
|
||||
ObjList list; /* XColorGCInstance <20>Υꥹ<CEA5><EAA5B9> */
|
||||
} _XColorGCList;
|
||||
|
||||
/*===========================================================================*/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD> */
|
||||
/*===========================================================================*/
|
||||
|
||||
typedef struct _XColorGCCacheBuffer * XColorGCCacheBuffer;
|
||||
typedef struct _XColorGCCache * XColorGCCache;
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD>ѥХåե<C3A5> */
|
||||
typedef struct _XColorGCCacheBuffer {
|
||||
XColorGCInstance instance;
|
||||
} _XColorGCCacheBuffer;
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD> */
|
||||
typedef struct _XColorGCCache {
|
||||
int size; /* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5>奵<EFBFBD><E5A5B5><EFBFBD><EFBFBD> */
|
||||
|
||||
XColorGCList color_gc_list;
|
||||
ObjList buffer_list;
|
||||
} _XColorGCCache;
|
||||
|
||||
/*===========================================================================*/
|
||||
/* <20>ϥå<CFA5><C3A5><EFBFBD> */
|
||||
/*===========================================================================*/
|
||||
|
||||
typedef struct _XColorGCHash * XColorGCHash;
|
||||
|
||||
typedef struct _XColorGCHash {
|
||||
int number; /* <20>ϥå<CFA5><C3A5><EFBFBD><EFBFBD>θĿ<CEB8> */
|
||||
int cache_flag; /* <20><><EFBFBD><EFBFBD><EFBFBD>å<EFBFBD><C3A5><EFBFBD><EFBFBD>λ<EFBFBD><CEBB>ѡ<EFBFBD>̤<EFBFBD><CCA4><EFBFBD>ѤΥե饰 */
|
||||
XColorGCCache * color_gc_cache;
|
||||
XColorGCList * color_gc_list;
|
||||
} _XColorGCHash;
|
||||
|
||||
/*===========================================================================*/
|
||||
/* <20><><EFBFBD><EFBFBD>̾<EFBFBD><CCBE><EFBFBD><EFBFBD>RGB<47>ͤ<EFBFBD><CDA4>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뤿<EFBFBD><EBA4BF><EFBFBD>Υ<EFBFBD><CEA5>饹 */
|
||||
/*===========================================================================*/
|
||||
|
||||
typedef struct _ColorName * ColorName;
|
||||
typedef struct _ColorNameList * ColorNameList;
|
||||
|
||||
typedef struct _ColorName {
|
||||
char * name;
|
||||
XColor color;
|
||||
} _ColorName;
|
||||
|
||||
typedef struct _ColorNameList {
|
||||
XDisplay x_display;
|
||||
ObjList list; /* ColorName <20>Υꥹ<CEA5><EAA5B9> */
|
||||
} _ColorNameList;
|
||||
|
||||
/*===========================================================================*/
|
||||
/* <20><><EFBFBD><EFBFBD> GC <20>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD> */
|
||||
/* GC <20>θ<EFBFBD><CEB8><EFBFBD><EFBFBD>ˤϡ<CBA4><CFA1>ϥå<CFA5><C3A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4>롥 */
|
||||
/*===========================================================================*/
|
||||
|
||||
typedef struct _XColorGCDatabase { /* GC <20>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD> */
|
||||
XDisplay x_display;
|
||||
XColorGCHash hash; /* <20>ϥå<CFA5><C3A5><EFBFBD> */
|
||||
|
||||
ColorNameList color_name_list; /* <20><>̾ <20><> RGB<47>ͤ<EFBFBD><CDA4>Ѵ<EFBFBD><D1B4><EFBFBD> */
|
||||
|
||||
/* <20>طʿ<D8B7><CABF><EFBFBD><EFBFBD><EFBFBD>̾<EFBFBD><CCBE>"none"<22><><EFBFBD><EFBFBD><EFBFBD>ꤹ<EFBFBD><EAA4B9><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>ο<EFBFBD><CEBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD>롥 */
|
||||
XColorGC background_color_gc;
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>16<31><36>Ĵ<EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ˤ<EFBFBD>16<31><36><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/* 10<31><30>Ĵ<EFBFBD><C4B4>20<32><30>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ */
|
||||
int gradation;
|
||||
|
||||
} _XColorGCDatabase;
|
||||
|
||||
/*===========================================================================*/
|
||||
/* GC <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>륯<EFBFBD>饹 */
|
||||
/* Ʊ<><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD> GC <20><><EFBFBD><EFBFBD>ʣ<EFBFBD><CAA3><EFBFBD>ʤ<EFBFBD><CAA4>Ѥˡ<D1A4>XColorGCList <20><> GC <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ơ<EFBFBD> */
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><D7B5><EFBFBD><EFBFBD>ˤϡ<CBA4>XColorGCList <20><><EFBFBD><EFBFBD> GC <20><><EFBFBD><EFBFBD><EFBFBD>餦<EFBFBD>褦<EFBFBD>ˤ<EFBFBD><CBA4>롥 */
|
||||
/*===========================================================================*/
|
||||
|
||||
typedef struct _XColorGC {
|
||||
XColorGCInstance instance;
|
||||
} _XColorGC;
|
||||
|
||||
#endif
|
||||
|
||||
/*****************************************************************************/
|
||||
/* End of File */
|
||||
/*****************************************************************************/
|
||||
214
XDisplay.c
214
XDisplay.c
@@ -15,6 +15,12 @@
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
Display * XDisplay_GetDisplay(XDisplay d) { return (d->display); }
|
||||
Colormap XDisplay_GetColormap(XDisplay d) { return (d->colormap); }
|
||||
|
||||
XColorGCDatabase XDisplay_GetColorGCDatabase(XDisplay x_display)
|
||||
{ return (x_display->color_gc_database); }
|
||||
|
||||
unsigned int XDisplay_GetKeyPress(XDisplay d) { return (d->key_press); }
|
||||
int XDisplay_GetLCDDraw(XDisplay d) { return (d->lcd_draw); }
|
||||
|
||||
@@ -280,6 +286,16 @@ XDisplay XDisplay_Create(int width, int height)
|
||||
XSetFunction(x_display->display, x_display->color_gc[i], GXcopy);
|
||||
}
|
||||
|
||||
/* GC<47>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
x_display->color_gc_database =
|
||||
XColorGCDatabase_Create(x_display,
|
||||
0, /* studying_flag */
|
||||
1, /* cache_flag */
|
||||
3, /* cache_size */
|
||||
256, /* hash_number */
|
||||
"black", /* background_color */
|
||||
16 /* gradation */);
|
||||
|
||||
/* <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD>Ȥγ<C8A4><CEB3><EFBFBD> */
|
||||
x_display->font = XLoadFont(x_display->display, "8x16");
|
||||
x_display->font_gc = XCreateGC(x_display->display,
|
||||
@@ -382,89 +398,181 @@ int XDisplay_Sync(XDisplay x_display)
|
||||
/* <20><><EFBFBD><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
int XDisplay_DrawLCDWindow(XDisplay x_display, WWLCDPanel ww_lcd_panel)
|
||||
int XDisplay_DrawLCDWindow(XDisplay x_display, WWDisplay ww_display,
|
||||
WWLCDPanel ww_lcd_panel)
|
||||
{
|
||||
int x, y;
|
||||
int px, py, ph;
|
||||
int num;
|
||||
int n[16];
|
||||
XRectangle rectangle;
|
||||
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) / 2;
|
||||
|
||||
/*
|
||||
* <20><><EFBFBD><EFBFBD> malloc() <20>ϡ<EFBFBD><CFA1>ºݤˤϥ<CBA4><CFA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϤۤȤ<DBA4><C8A4>ɻ<EFBFBD><C9BB>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ʤ<EFBFBD><CAA4>Τǡ<CEA4>
|
||||
* <20><><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
for (pixel = 0; pixel < 16; pixel++) {
|
||||
n[pixel] = 0;
|
||||
rectangles[pixel] = (XRectangle *)malloc(sizeof(XRectangle) * num);
|
||||
}
|
||||
if (rectangles == NULL)
|
||||
WonX_Error("XDisplay_DrawLCDWindow", "Cannot allocate memory.");
|
||||
int red, green, blue;
|
||||
XColorGCDatabase database;
|
||||
XColorGC x_color_gc;
|
||||
GC gc;
|
||||
|
||||
ww_lcd_width = WWLCDPanel_GetWidth( ww_lcd_panel);
|
||||
ww_lcd_height = WWLCDPanel_GetHeight(ww_lcd_panel);
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD>ϥۥåȥ<C3A5><C8A5>ݥåȤˤʤ<CBA4><CAA4>Τǡ<CEA4><C7A1>Τ<EFBFBD><CEA4>Τ<EFBFBD><CEA4>˥<EFBFBD><CBA5>塼<EFBFBD>˥<CBA5><F3A5B0A4>뤳<EFBFBD><EBA4B3> */
|
||||
switch (WWDisplay_GetColorMode(ww_display)) {
|
||||
|
||||
for (y = 0; y < ww_lcd_height; y++) {
|
||||
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;
|
||||
case COLOR_MODE_GRAYSCALE:
|
||||
|
||||
/* <20><><EFBFBD>ܤ<EFBFBD><DCA4>Ƥ<EFBFBD>Ʊ<EFBFBD><EFBFBD><EFBFBD>Υԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><EFBFBD>ä<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><EFBFBD> */
|
||||
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;
|
||||
/* <20><><EFBFBD>ܤ<EFBFBD><DCA4>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>ԥ<EFBFBD><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϤޤȤ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><EFBFBD><EFBFBD>Τǡ<EFBFBD><EFBFBD>ԥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͤ<EFBFBD> */
|
||||
/* <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) / 2;
|
||||
|
||||
/*
|
||||
* <20><><EFBFBD><EFBFBD> malloc() <20>ϡ<EFBFBD><CFA1>ºݤˤϥ<CBA4><CFA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϤۤȤ<DBA4><C8A4>ɻ<EFBFBD><C9BB>Ѥ<EFBFBD><D1A4><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ʤ<EFBFBD><CAA4>Τǡ<CEA4>
|
||||
* <20><><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD><EFBFBD>
|
||||
*/
|
||||
for (pixel = 0; pixel < 16; pixel++) {
|
||||
n[pixel] = 0;
|
||||
rectangles[pixel] = (XRectangle *)malloc(sizeof(XRectangle) * num);
|
||||
}
|
||||
if (rectangles == NULL)
|
||||
WonX_Error("XDisplay_DrawLCDWindow", "Cannot allocate memory.");
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD>ϥۥåȥ<C3A5><C8A5>ݥåȤˤʤ<CBA4><CAA4>Τǡ<CEA4><C7A1>Τ<EFBFBD><CEA4>Τ<EFBFBD><CEA4>˥<EFBFBD><CBA5>塼<EFBFBD>˥<CBA5><F3A5B0A4>뤳<EFBFBD><EBA4B3> */
|
||||
|
||||
for (y = 0; y < ww_lcd_height; y++) {
|
||||
py = (y * x_display->height) / ww_lcd_height;
|
||||
ph = (y+1) * x_display->height / ww_lcd_height- py;
|
||||
for (x = 0; x < ww_lcd_width; x++) {
|
||||
if (!WWLCDPanel_IsPixelChanged(ww_lcd_panel, x, y)) {
|
||||
continue;
|
||||
}
|
||||
pixel = WWLCDPanel_GetPixel(ww_lcd_panel, x, y);
|
||||
px = (x * x_display->width ) / ww_lcd_width;
|
||||
rectangles[pixel][n[pixel]].x = px;
|
||||
rectangles[pixel][n[pixel]].y = py;
|
||||
rectangles[pixel][n[pixel]].width =
|
||||
(x+1) * x_display->width / ww_lcd_width - px;
|
||||
rectangles[pixel][n[pixel]].height = ph;
|
||||
|
||||
/* <20><><EFBFBD>ܤ<EFBFBD><DCA4>Ƥ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>Υԥ<CEA5><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><E8A4B9> */
|
||||
x++;
|
||||
while ( (x < ww_lcd_width) &&
|
||||
(pixel == WWLCDPanel_GetPixel(ww_lcd_panel, x, y)) &&
|
||||
(WWLCDPanel_IsPixelChanged(ww_lcd_panel, x, y)) ) {
|
||||
rectangles[pixel][n[pixel]].width =
|
||||
(x+1) * x_display->width / ww_lcd_width - px;
|
||||
x++;
|
||||
}
|
||||
x--;
|
||||
|
||||
n[pixel]++;
|
||||
}
|
||||
x--;
|
||||
|
||||
n[pixel]++;
|
||||
}
|
||||
}
|
||||
|
||||
for (pixel = 0; pixel < 16; pixel++) {
|
||||
if (n[pixel] > 0) {
|
||||
XFillRectangles(x_display->display,
|
||||
x_display->lcd_pixmap,
|
||||
x_display->color_gc[pixel],
|
||||
rectangles[pixel], 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[pixel], n[pixel]);
|
||||
}
|
||||
}
|
||||
|
||||
for (pixel = 0; pixel < 16; pixel++) {
|
||||
free(rectangles[pixel]);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case COLOR_MODE_4COLOR:
|
||||
case COLOR_MODE_16COLOR:
|
||||
case COLOR_MODE_16PACKED:
|
||||
|
||||
database = XDisplay_GetColorGCDatabase(x_display);
|
||||
|
||||
for (y = 0; y < ww_lcd_height; y++) {
|
||||
py = (y * x_display->height) / ww_lcd_height;
|
||||
ph = (y+1) * x_display->height / ww_lcd_height- py;
|
||||
for (x = 0; x < ww_lcd_width; x++) {
|
||||
if (!WWLCDPanel_IsPixelChanged(ww_lcd_panel, x, y)) {
|
||||
continue;
|
||||
}
|
||||
pixel = WWLCDPanel_GetPixel(ww_lcd_panel, x, y);
|
||||
px = (x * x_display->width ) / ww_lcd_width;
|
||||
rectangle.x = px;
|
||||
rectangle.y = py;
|
||||
rectangle.width = (x+1) * x_display->width / ww_lcd_width - px;
|
||||
rectangle.height = ph;
|
||||
|
||||
/* <20><><EFBFBD>ܤ<EFBFBD><DCA4>Ƥ<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD>Υԥ<CEA5><D4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><E8A4B9> */
|
||||
x++;
|
||||
while ( (x < ww_lcd_width) &&
|
||||
(pixel == WWLCDPanel_GetPixel(ww_lcd_panel, x, y)) &&
|
||||
(WWLCDPanel_IsPixelChanged(ww_lcd_panel, x, y)) ) {
|
||||
rectangle.width =
|
||||
(x+1) * x_display->width / ww_lcd_width - px;
|
||||
x++;
|
||||
}
|
||||
x--;
|
||||
|
||||
red = (pixel >> 8) & 0xf;
|
||||
green = (pixel >> 4) & 0xf;
|
||||
blue = (pixel >> 0) & 0xf;
|
||||
|
||||
red = (red == 15) ? 65535 : red * 4096;
|
||||
green = (green == 15) ? 65535 : green * 4096;
|
||||
blue = (blue == 15) ? 65535 : blue * 4096;
|
||||
|
||||
x_color_gc = XColorGC_CreateFromRGB(database, red, green, blue);
|
||||
gc = XColorGC_GetGC(x_color_gc);
|
||||
|
||||
XFillRectangle(x_display->display,
|
||||
x_display->lcd_pixmap,
|
||||
gc,
|
||||
rectangle.x,
|
||||
rectangle.y,
|
||||
rectangle.width,
|
||||
rectangle.height);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
WonX_Error("XDisplay_DrawLCDWindow", "Unknown color mode.");
|
||||
}
|
||||
|
||||
XCopyArea(x_display->display, x_display->lcd_pixmap,
|
||||
x_display->lcd_window, x_display->copy_gc,
|
||||
0, 0, x_display->width, x_display->height, 0, 0);
|
||||
0, 0, x_display->width, x_display->height, 0, 0);
|
||||
|
||||
WWLCDPanel_ResetAllDraw(ww_lcd_panel);
|
||||
WWLCDPanel_ReverseCurrent(ww_lcd_panel);
|
||||
|
||||
XDisplay_Sync(x_display);
|
||||
|
||||
for (pixel = 0; pixel < 16; pixel++) {
|
||||
free(rectangles[pixel]);
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* GC <20>κ<EFBFBD><CEBA><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
GC XDisplay_CreateGC(XDisplay x_display)
|
||||
{
|
||||
GC gc;
|
||||
gc = XCreateGC(x_display->display, x_display->root_window, 0, 0);
|
||||
return (gc);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* GC <20>β<EFBFBD><CEB2><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
int XDisplay_DestroyGC(XDisplay x_display, GC gc)
|
||||
{
|
||||
XFreeGC(x_display->display, gc);
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
24
XDisplay.h
24
XDisplay.h
@@ -15,14 +15,23 @@ typedef struct _XDisplay * XDisplay;
|
||||
/* <20>إå<D8A5><C3A5>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Υ<EFBFBD><CEA5>롼<F3A5AFA5><EBA1BC> */
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
#include "wonx_include/key.h"
|
||||
|
||||
#include "WWDisplay.h"
|
||||
#include "WWLCDPanel.h"
|
||||
#include "XColorGC.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>дؿ<D0B4><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
Display * XDisplay_GetDisplay(XDisplay x_display);
|
||||
Colormap XDisplay_GetColormap(XDisplay x_display);
|
||||
|
||||
XColorGCDatabase XDisplay_GetColorGCDatabase(XDisplay x_display);
|
||||
|
||||
unsigned int XDisplay_GetKeyPress(XDisplay x_display);
|
||||
int XDisplay_GetLCDDraw(XDisplay x_display);
|
||||
|
||||
@@ -62,7 +71,20 @@ int XDisplay_Sync(XDisplay x_display);
|
||||
/* <20><><EFBFBD><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
int XDisplay_DrawLCDWindow(XDisplay x_display, WWLCDPanel ww_lcd_panel);
|
||||
int XDisplay_DrawLCDWindow(XDisplay x_display, WWDisplay ww_display,
|
||||
WWLCDPanel ww_lcd_panel);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* GC <20>κ<EFBFBD><CEBA><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
GC XDisplay_CreateGC(XDisplay x_display);
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* GC <20>β<EFBFBD><CEB2><EFBFBD> */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
int XDisplay_DestroyGC(XDisplay x_display, GC gc);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <X11/StringDefs.h>
|
||||
#include <X11/Shell.h>
|
||||
@@ -37,7 +36,10 @@ typedef struct _XDisplay {
|
||||
Pixmap lcd_pixmap;
|
||||
|
||||
GC copy_gc;
|
||||
GC color_gc[16];
|
||||
GC color_gc[16]; /* <20><><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD>Ѥ<EFBFBD>GC */
|
||||
|
||||
/* 4096<39><36>ɽ<EFBFBD><C9BD><EFBFBD>Ѥ<EFBFBD>GC<47>Υǡ<CEA5><C7A1><EFBFBD><EFBFBD>١<EFBFBD><D9A1><EFBFBD>(XFireworks <20><><EFBFBD><EFBFBD>ή<EFBFBD><CEAE>) */
|
||||
XColorGCDatabase color_gc_database;
|
||||
|
||||
/* <20>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD>ȥ<EFBFBD><C8A5><EFBFBD><EFBFBD><EFBFBD><EAA1BC><EFBFBD>ؤ<EFBFBD>ʸ<EFBFBD><CAB8>ɽ<EFBFBD><C9BD><EFBFBD>ѤΥե<CEA5><D5A5><EFBFBD><EFBFBD><EFBFBD> */
|
||||
Font font;
|
||||
|
||||
96
disp.c
96
disp.c
@@ -65,7 +65,14 @@ void display_control(unsigned int flags)
|
||||
WWScreen_SetMode(WWDisplay_GetScreen(ww_display, SCREEN2),
|
||||
WW_SCREEN_OUTSIDE_ONLY);
|
||||
|
||||
WWDisplay_SetBorder(ww_display, (flags & DCM_BORDER_COLOR) >> 7);
|
||||
WWDisplay_SetBorderPalette(ww_display,
|
||||
WWDisplay_GetPalette(ww_display,
|
||||
(flags & 0xf000) >> 12));
|
||||
#if 0
|
||||
WWDisplay_SetBorderColor(ww_display, (flags & DCM_BORDER_COLOR) >> 8);
|
||||
#else /* <20><><EFBFBD>顼<EFBFBD>б<EFBFBD><D0B1>ǡ<EFBFBD><C7A1>ܡ<EFBFBD><DCA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>顼<EFBFBD>ϣ<EFBFBD><CFA3>ӥåȤ<C3A5><C8A4>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>줿 */
|
||||
WWDisplay_SetBorderColor(ww_display, (flags & 0x0f00) >> 8);
|
||||
#endif
|
||||
|
||||
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||
|
||||
@@ -115,7 +122,8 @@ unsigned int display_status(void)
|
||||
default:
|
||||
}
|
||||
|
||||
ret |= WWDisplay_GetBorder(ww_display) << 7;
|
||||
ret |= (unsigned short int)WWPalette_GetNumber(WWDisplay_GetBorderPalette(ww_display)) << 12;
|
||||
ret |= (unsigned short int)WWDisplay_GetBorderColor(ww_display) << 8;
|
||||
|
||||
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||
|
||||
@@ -135,10 +143,12 @@ unsigned int display_status(void)
|
||||
void font_set_monodata(unsigned int number, unsigned int count,
|
||||
unsigned char * data)
|
||||
{
|
||||
WWCharacter c;
|
||||
int i, x, y, n, p;
|
||||
int f, b;
|
||||
WWCharacter ww_character;
|
||||
WWDisplay ww_display;
|
||||
int i, j, k, n;
|
||||
unsigned char pixel;
|
||||
int f, b;
|
||||
unsigned char bitmap[2];
|
||||
|
||||
if (!WonX_IsCreated()) WonX_Create();
|
||||
|
||||
@@ -146,7 +156,8 @@ void font_set_monodata(unsigned int number, unsigned int count,
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : font_set_monodata() : number = %u, count = %u, data = %p\n",
|
||||
(int)number, (int)count, (void *)data); fflush(stdout);
|
||||
(int)number, (int)count, (void *)data);
|
||||
fflush(stdout);
|
||||
|
||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||
|
||||
@@ -155,12 +166,17 @@ void font_set_monodata(unsigned int number, unsigned int count,
|
||||
|
||||
n = 0;
|
||||
for (i = 0; i < count; i++) {
|
||||
c = WWDisplay_GetCharacter(ww_display, number + i);
|
||||
for (y = 0; y < 8; y++) {
|
||||
for (x = 0; x < 8; x++) {
|
||||
p = (data[n] & (1 << (7 - x))) ? f : b; /*<2A><><EFBFBD><EFBFBD><EFBFBD>Ǥ褤<C7A4>Τ<EFBFBD><CEA4><EFBFBD>*/
|
||||
WWCharacter_SetPixel(c, x, y, p);
|
||||
ww_character = WWDisplay_GetCharacter(ww_display, number + i);
|
||||
for (j = 0; j < 8; j++) {
|
||||
bitmap[0] = 0;
|
||||
bitmap[1] = 0;
|
||||
for (k = 0; k < 8; k++) {
|
||||
pixel = (data[n] & (1 << k)) ? f : b;
|
||||
bitmap[0] |= ( pixel & 1) << k;
|
||||
bitmap[1] |= ((pixel >> 1) & 1) << k;
|
||||
}
|
||||
WWCharacter_SetBitmap(ww_character, j*2 , bitmap[0]);
|
||||
WWCharacter_SetBitmap(ww_character, j*2+1, bitmap[1]);
|
||||
n++;
|
||||
}
|
||||
}
|
||||
@@ -183,8 +199,9 @@ void font_set_monodata(unsigned int number, unsigned int count,
|
||||
void font_set_colordata(unsigned int number, unsigned int count,
|
||||
unsigned char * data)
|
||||
{
|
||||
WWCharacter c;
|
||||
int i, x, y, n, p;
|
||||
WWCharacter ww_character;
|
||||
WWDisplay ww_display;
|
||||
int i, j, n;
|
||||
|
||||
if (!WonX_IsCreated()) WonX_Create();
|
||||
|
||||
@@ -192,23 +209,16 @@ void font_set_colordata(unsigned int number, unsigned int count,
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : font_set_colordata() : number = %u, count = %u, data = %p\n",
|
||||
(int)number, (int)count, (void *)data); fflush(stdout);
|
||||
(int)number, (int)count, (void *)data);
|
||||
fflush(stdout);
|
||||
|
||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||
|
||||
n = 0;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
c = WWDisplay_GetCharacter(WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay()),
|
||||
number + i);
|
||||
for (y = 0; y < 8; y++) {
|
||||
for (x = 0; x < 8; x++) {
|
||||
|
||||
/*<2A><><EFBFBD><EFBFBD><EFBFBD>Ǥ褤<C7A4>Τ<EFBFBD><CEA4><EFBFBD>*/
|
||||
p = ((data[n] & (1 << (7-x))) ? 2 : 0)
|
||||
+ ((data[n + 1] & (1 << (7-x))) ? 1 : 0);
|
||||
|
||||
WWCharacter_SetPixel(c, x, y, p);
|
||||
}
|
||||
n++;
|
||||
ww_character = WWDisplay_GetCharacter(ww_display, number + i);
|
||||
for (j = 0; j < 16; j++) {
|
||||
WWCharacter_SetBitmap(ww_character, j, data[n]);
|
||||
n++;
|
||||
}
|
||||
}
|
||||
@@ -232,8 +242,9 @@ void font_get_data(unsigned int number, unsigned int count,
|
||||
unsigned char * data)
|
||||
{
|
||||
/* <20>ؿ<EFBFBD><D8BF>λ<EFBFBD><CEBB>ͤ<EFBFBD><CDA4>狼<EFBFBD><EFA4AB><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD>Ŭ<EFBFBD><C5AC><EFBFBD>˽<CBBD> */
|
||||
WWCharacter c;
|
||||
int i, x, y, n, p;
|
||||
WWCharacter ww_character;
|
||||
WWDisplay ww_display;
|
||||
int i, j, n;
|
||||
|
||||
if (!WonX_IsCreated()) WonX_Create();
|
||||
|
||||
@@ -241,23 +252,16 @@ void font_get_data(unsigned int number, unsigned int count,
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : font_get_data() : number = %u, count = %u, data = %p\n",
|
||||
(int)number, (int)count, (void *)data); fflush(stdout);
|
||||
(int)number, (int)count, (void *)data);
|
||||
fflush(stdout);
|
||||
|
||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||
|
||||
n = 0;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
c = WWDisplay_GetCharacter(WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay()),
|
||||
number + i);
|
||||
for (y = 0; y < 8; y++) {
|
||||
data[n ] = 0;
|
||||
data[n+1] = 0;
|
||||
for (x = 0; x < 8; x++) {
|
||||
p = WWCharacter_GetPixel(c, x, y);
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>Ǥ褤<C7A4>Τ<EFBFBD><CEA4><EFBFBD> */
|
||||
data[n ] |= (((unsigned char)p & 0x02) ? 1 : 0) << (7-x);
|
||||
data[n+1] |= (((unsigned char)p & 0x01) ? 1 : 0) << (7-x);
|
||||
}
|
||||
n++;
|
||||
ww_character = WWDisplay_GetCharacter(ww_display, number + i);
|
||||
for (j = 0; j < 16; j++) {
|
||||
data[n] = WWCharacter_GetBitmap(ww_character, j);
|
||||
n++;
|
||||
}
|
||||
}
|
||||
@@ -1082,7 +1086,6 @@ unsigned int palette_get_color(unsigned int palette_num)
|
||||
int mapped_colors[4];
|
||||
WWPalette palette;
|
||||
unsigned short int ret;
|
||||
int i;
|
||||
|
||||
if (!WonX_IsCreated()) WonX_Create();
|
||||
|
||||
@@ -1095,12 +1098,15 @@ unsigned int palette_get_color(unsigned int palette_num)
|
||||
palette =
|
||||
WWDisplay_GetPalette(WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay()),
|
||||
palette_num);
|
||||
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -1 <20><><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>դ<EFBFBD><D5A4>뤳<EFBFBD><EBA4B3> */
|
||||
|
||||
/* WonX-2.0 <20><><EFBFBD><EFBFBD><EFBFBD>Ǥϡ<C7A4>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -1 <20><><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4><EFBFBD><EFBFBD>Τ<EFBFBD><CEA4><EFBFBD><EFBFBD>դ<EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4>ä<EFBFBD> */
|
||||
WWPalette_GetMappedColors(palette, mapped_colors);
|
||||
|
||||
#if 0 /* WonX-2.0 <20><><EFBFBD><EFBFBD><EFBFBD>Ǥϡ<C7A4>Ʃ<EFBFBD><C6A9><EFBFBD><EFBFBD><EFBFBD>ν<EFBFBD><CEBD><EFBFBD><EFBFBD><EFBFBD>ɬ<EFBFBD>פ<EFBFBD><D7A4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɤ<EFBFBD><C9A4>Ĥ<EFBFBD><C4A4>Ƥ<EFBFBD><C6A4><EFBFBD> */
|
||||
/* Ʃ<><C6A9><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -1 <20><>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>0<EFBFBD>ˤ<EFBFBD><CBA4><EFBFBD> */
|
||||
for (i = 0; i < 4; i++)
|
||||
if (mapped_colors[i] == -1) mapped_colors[i] = 0;
|
||||
#endif
|
||||
|
||||
ret = 0;
|
||||
ret |= mapped_colors[0] & 0x07;
|
||||
|
||||
12
key.c
12
key.c
@@ -39,7 +39,7 @@ int key_press_check(void)
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : key_press_check() : "); fflush(stdout);
|
||||
printf("call : key_press_check() : \n"); fflush(stdout);
|
||||
|
||||
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
||||
XDisplay_Sync(x_display);
|
||||
@@ -67,7 +67,7 @@ int key_hit_check(void)
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : key_hit_check() : "); fflush(stdout);
|
||||
printf("call : key_hit_check() : \n"); fflush(stdout);
|
||||
|
||||
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
||||
XDisplay_Sync(x_display);
|
||||
@@ -95,7 +95,7 @@ int key_wait(void)
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : key_wait() : "); fflush(stdout);
|
||||
printf("call : key_wait() : \n"); fflush(stdout);
|
||||
|
||||
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
||||
|
||||
@@ -127,7 +127,7 @@ void key_set_repeat(int rate, int delay)
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : key_set_repeat() : rate = %d, delay = %d, ", rate, delay);
|
||||
printf("call : key_set_repeat() : rate = %d, delay = %d\n", rate, delay);
|
||||
fflush(stdout);
|
||||
|
||||
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||
@@ -149,7 +149,7 @@ int key_get_repeat(void)
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : key_get_repeat() : "); fflush(stdout);
|
||||
printf("call : key_get_repeat() : \n"); fflush(stdout);
|
||||
|
||||
ret = 0;
|
||||
|
||||
@@ -174,7 +174,7 @@ int key_hit_check_with_repeat(void)
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : key_hit_check_with_repeat() : "); fflush(stdout);
|
||||
printf("call : key_hit_check_with_repeat() : \n"); fflush(stdout);
|
||||
|
||||
x_display = WonXDisplay_GetXDisplay(WonX_GetWonXDisplay());
|
||||
XDisplay_Sync(x_display);
|
||||
|
||||
317
libwwc.c
Normal file
317
libwwc.c
Normal file
@@ -0,0 +1,317 @@
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "wonx_configure.h"
|
||||
|
||||
#include "wonx_include/libwwc.h"
|
||||
|
||||
#include "WonX.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* void * <20>ǥǡ<C7A5><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϥ<EFBFBD><CFA4>ؿ<EFBFBD><D8BF>ϡ<EFBFBD><CFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ְ㤨<D6B0><E3A4A8><EFBFBD>Х<EFBFBD><D0A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||
* void * <20><>Ŭ<EFBFBD>ڤʷ<DAA4><CAB7><EFBFBD><EFBFBD>֤<EFBFBD><D6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>롥
|
||||
*/
|
||||
|
||||
/*
|
||||
* X<><58><EFBFBD><EFBFBD><EFBFBD>ФȤ<D0A4>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>ʤ<EFBFBD><CAA4>ʤ<EFBFBD><CAA4>ʤɤ<CAA4><C9A4><EFBFBD><EFBFBD>꤬<EFBFBD>ͤ<EFBFBD><CDA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||
* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> UNIXTimer_Pause(), UNIXTimer_Unpause() <20>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD>ꡤ
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4>ƽ<EFBFBD><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԥ<EFBFBD><D4A4><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>unpause <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4>ˡ<EFBFBD>
|
||||
* <20><><EFBFBD>ʤ餺 sync <20><><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ˤ<EFBFBD><CBA4>롥
|
||||
*/
|
||||
|
||||
/*
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD>ޤΰ<DEA4><CEB0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤΣ<DFA4><CEA3>Ų<EFBFBD><C5B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>꤬<EFBFBD>ФƤ<D0A4><C6A4><EFBFBD><EFBFBD>Τǡ<CEA4>
|
||||
* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ǤϤ<C7A4><CFA4><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4><EFBFBD>
|
||||
* (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤϥͥ<CFA5><CDA5>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>뤬<EFBFBD><EBA4AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD>褦<EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD><EFBFBD><F2A4B9A4>ؿ<EFBFBD><D8BF>ξ<EFBFBD><CEBE><EFBFBD><EFBFBD>ϡ<EFBFBD>ɬ<EFBFBD><C9AC> static <20><><EFBFBD>̴ؿ<CCB4><D8BF>˽<EFBFBD><CBBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤȤᡤ
|
||||
* <20><><EFBFBD>ä<EFBFBD><C3A4><EFBFBD><EFBFBD>ƤӽФ<D3BD><D0A4>褦<EFBFBD>ˤ<EFBFBD><CBA4>뤳<EFBFBD>ȡ<EFBFBD>
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⤢<EFBFBD>뤷<EFBFBD>͡<EFBFBD>
|
||||
*/
|
||||
|
||||
unsigned int wwc_set_color_mode(unsigned int mode)
|
||||
{
|
||||
WWDisplay ww_display;
|
||||
unsigned int ret;
|
||||
|
||||
if (!WonX_IsCreated()) WonX_Create();
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : wwc_set_color_mode() : mode = 0x%04x\n", (int)mode);
|
||||
fflush(stdout);
|
||||
|
||||
switch (mode) {
|
||||
case COLOR_MODE_GRAYSCALE :
|
||||
case COLOR_MODE_4COLOR :
|
||||
case COLOR_MODE_16COLOR :
|
||||
case COLOR_MODE_16PACKED :
|
||||
break;
|
||||
default :
|
||||
WonX_Error("wwc_set_color_mode", "unknown color mode.");
|
||||
}
|
||||
|
||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||
|
||||
ret = WWDisplay_SetColorMode(ww_display, mode);
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤϡ<CBA4><CFA1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>褹<EFBFBD><E8A4B9> */
|
||||
WWLCDPanel_SetAllDraw(WWDisplay_GetLCDPanel(ww_display));
|
||||
|
||||
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||
|
||||
printf("call : wwc_set_color_mode() : return value = 0x%04x\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
unsigned int wwc_get_color_mode(void)
|
||||
{
|
||||
WWDisplay ww_display;
|
||||
unsigned int ret;
|
||||
|
||||
if (!WonX_IsCreated()) WonX_Create();
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : wwc_get_color_mode() : \n"); fflush(stdout);
|
||||
|
||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||
|
||||
ret = WWDisplay_GetColorMode(ww_display);
|
||||
|
||||
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||
|
||||
printf("call : wwc_get_color_mode() : return value = 0x%04x\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
void wwc_palette_set_color(unsigned int palette_num, unsigned int color_num, unsigned int rgb)
|
||||
{
|
||||
WWDisplay ww_display;
|
||||
WWPalette ww_palette;
|
||||
unsigned short int red, green, blue;
|
||||
|
||||
if (!WonX_IsCreated()) WonX_Create();
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : wwc_palette_set_color() : palette_num = %u, color_num = %u, rgb = 0x%04x\n",
|
||||
(int)palette_num, (int)color_num, (int)rgb);
|
||||
fflush(stdout);
|
||||
|
||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||
ww_palette = WWDisplay_GetPalette(ww_display, palette_num);
|
||||
red = (rgb >> 8) & 0x0f;
|
||||
green = (rgb >> 4) & 0x0f;
|
||||
blue = (rgb >> 0) & 0x0f;
|
||||
WWPalette_SetRed( ww_palette, color_num, red );
|
||||
WWPalette_SetGreen(ww_palette, color_num, green);
|
||||
WWPalette_SetBlue( ww_palette, color_num, blue );
|
||||
|
||||
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||
|
||||
printf("call : wwc_palette_set_color() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int wwc_palette_get_color(unsigned int palette_num, unsigned int color_num)
|
||||
{
|
||||
WWDisplay ww_display;
|
||||
WWPalette ww_palette;
|
||||
unsigned short int red, green, blue;
|
||||
unsigned short int ret;
|
||||
|
||||
if (!WonX_IsCreated()) WonX_Create();
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : wwc_palette_get_color() : palette_num = %u, color_num = %u\n",
|
||||
(int)palette_num, (int)color_num);
|
||||
fflush(stdout);
|
||||
|
||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||
ww_palette = WWDisplay_GetPalette(ww_display, palette_num);
|
||||
|
||||
red = WWPalette_GetRed( ww_palette, color_num);
|
||||
green = WWPalette_GetGreen(ww_palette, color_num);
|
||||
blue = WWPalette_GetBlue( ww_palette, color_num);
|
||||
|
||||
ret = (red << 8) | (green << 4) | (blue << 0);
|
||||
|
||||
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||
|
||||
printf("call : wwc_palette_get_color() : return value = 0x%04x\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
void wwc_font_set_colordata(unsigned int number, unsigned int count, unsigned char * data)
|
||||
{
|
||||
WWCharacter ww_character;
|
||||
WWDisplay ww_display;
|
||||
int i, j, n;
|
||||
|
||||
if (!WonX_IsCreated()) WonX_Create();
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : wwc_font_set_colordata() : number = %u, count = %u, data = %p\n",
|
||||
(int)number, (int)count, (void *)data);
|
||||
fflush(stdout);
|
||||
|
||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||
|
||||
n = 0;
|
||||
for (i = 0; i < count; i++) {
|
||||
ww_character = WWDisplay_GetCharacter(ww_display, number + i);
|
||||
for (j = 0; j < 32; j++) {
|
||||
WWCharacter_SetBitmap(ww_character, j, data[n]);
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||
|
||||
printf("call : wwc_font_set_colordata() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void wwc_font_get_colordata(unsigned int number, unsigned int count, unsigned char * data)
|
||||
{
|
||||
WWCharacter ww_character;
|
||||
WWDisplay ww_display;
|
||||
int i, j, n;
|
||||
|
||||
if (!WonX_IsCreated()) WonX_Create();
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : wwc_font_get_colordata() : number = %u, count = %u, data = %p\n",
|
||||
(int)number, (int)count, (void *)data);
|
||||
fflush(stdout);
|
||||
|
||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||
|
||||
n = 0;
|
||||
for (i = 0; i < count; i++) {
|
||||
ww_character = WWDisplay_GetCharacter(ww_display, number + i);
|
||||
for (j = 0; j < 32; j++) {
|
||||
data[n] = WWCharacter_GetBitmap(ww_character, j);
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||
|
||||
printf("call : wwc_font_get_colordata() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int wwc_get_hardarch(void)
|
||||
{
|
||||
WWDisplay ww_display;
|
||||
unsigned int ret;
|
||||
|
||||
if (!WonX_IsCreated()) WonX_Create();
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : wwc_get_hardarch() : \n"); fflush(stdout);
|
||||
|
||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||
|
||||
ret = WONX_DEFAULT_ARCH;
|
||||
|
||||
WonXDisplay_Sync(WonX_GetWonXDisplay());
|
||||
|
||||
printf("call : wwc_get_hardarch() : return value = %u\n", (int)ret);
|
||||
fflush(stdout);
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
void wwc_clear_font(void)
|
||||
{
|
||||
WWDisplay ww_display;
|
||||
WWCharacter ww_character;
|
||||
int i;
|
||||
|
||||
if (!WonX_IsCreated()) WonX_Create();
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : wwc_clear_font() : \n");
|
||||
fflush(stdout);
|
||||
|
||||
ww_display = WonXDisplay_GetWWDisplay(WonX_GetWonXDisplay());
|
||||
|
||||
for (i = 0; i < 512; i++) {
|
||||
ww_character = WWDisplay_GetCharacter(ww_display, i);
|
||||
WWCharacter_ClearAllPixels(ww_character);
|
||||
}
|
||||
|
||||
WonXDisplay_Flush(WonX_GetWonXDisplay());
|
||||
|
||||
printf("call : wwc_clear_font() : return value = none\n");
|
||||
fflush(stdout);
|
||||
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4>᤹ */
|
||||
UNIXTimer_Unpause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/* End of File. */
|
||||
/*****************************************************************************/
|
||||
@@ -12,7 +12,7 @@ main()
|
||||
text_put_string(0, 8, " linked to program for ");
|
||||
text_put_string(0, 9, " WonderWitch and behave as ");
|
||||
text_put_string(0, 10, " WonderWitch. ");
|
||||
text_put_string(0, 12, " WonX Copyright (c) 2000 ");
|
||||
text_put_string(0, 12, "WonX Copyright (c) 2000-2001");
|
||||
text_put_string(0, 13, " Sakai Hiroaki. ");
|
||||
text_put_string(0, 14, " All Rights Reserved. ");
|
||||
text_put_string(0, 16, " Hit space key to exit. ");
|
||||
|
||||
4
text.c
4
text.c
@@ -505,7 +505,7 @@ void cursor_set_location(int x, int y, int w, int h)
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : cursor_set_location() : x = %d, y = %d, w = %d, h = %d",
|
||||
printf("call : cursor_set_location() : x = %d, y = %d, w = %d, h = %d\n",
|
||||
x, y, w, h);
|
||||
fflush(stdout);
|
||||
|
||||
@@ -585,7 +585,7 @@ void cursor_set_type(int palette_num, int interval)
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤ<EFBFBD><DFA4><EFBFBD> */
|
||||
UNIXTimer_Pause(WonXSystem_GetUNIXTimer(WonX_GetWonXSystem()));
|
||||
|
||||
printf("call : cursor_set_type() : palette = %d, interval = %d",
|
||||
printf("call : cursor_set_type() : palette = %d, interval = %d\n",
|
||||
palette_num, interval);
|
||||
fflush(stdout);
|
||||
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
/* configure.h for configuration of wonx */
|
||||
|
||||
#ifndef _WONX_winx_configure_h_INCLUDED_
|
||||
#ifndef _WONX_wonx_configure_h_INCLUDED_
|
||||
#define _WONX_wonx_configure_h_INCLUDED_
|
||||
|
||||
#include "wonx_include/libwwc.h"
|
||||
|
||||
/* <20>ǥե<C7A5><D5A5><EFBFBD><EFBFBD>ȤΥ<C8A4><CEA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><C6A5><EFBFBD><EFBFBD><EFBFBD> */
|
||||
#define WONX_DEFAULT_ARCH HARDARCH_WSC
|
||||
|
||||
/* WonX <20>ǤΥ<C7A4><CEA5><EFBFBD><EFBFBD><EFBFBD><DEB3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ߤμ<DFA4><CEBC><EFBFBD>(ñ<>̤ϥߥ<CFA5><DFA5><EFBFBD>) */
|
||||
#define WONX_TIMER_INTERVAL 100 /* 0.1 <20><> */
|
||||
|
||||
|
||||
16
wonx_include/fcntl_attention.h
Normal file
16
wonx_include/fcntl_attention.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#ifndef _WONX_SYS_FCNTL_H_
|
||||
#define _WONX_SYS_FCNTL_H_
|
||||
|
||||
/*
|
||||
* fcntl.h <20><> /usr/include/fcntl.h <20><><EFBFBD>ɤ߹<C9A4><DFB9><EFBFBD><EFBFBD>Ф褤<D0A4>Τǡ<CEA4>
|
||||
* wonx_include/fcntl.h <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʤ<EFBFBD><CAA4>ۤ<EFBFBD><DBA4><EFBFBD><EFBFBD>褤<EFBFBD><E8A4A4>(wonx_include/fcntl.h <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD>
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ˤ<EFBFBD><CBA4>äƤϤ<C6A4><CFA4>ä<EFBFBD><C3A4><EFBFBD><EFBFBD>ɤ߹<C9A4><DFB9>ޤ<EFBFBD><DEA4>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>⤷<EFBFBD><E2A4B7><EFBFBD>ʤ<EFBFBD><CAA4>Τ<EFBFBD>)
|
||||
* <20>⤷<EFBFBD><E2A4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD>Υե<CEA5><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Τ褦<CEA4>ʤΤ<CAA4><CEA4><EFBFBD><EFBFBD>뤫<EFBFBD><EBA4AB>
|
||||
*/
|
||||
|
||||
#include "filesys.h"
|
||||
|
||||
/* <20><>ʬ<EFBFBD><CAAC><EFBFBD>Ȥ<EFBFBD><C8A4>ɤ߹<C9A4><DFB9>ޤʤ<DEA4><CAA4>褦<EFBFBD>ˡ<EFBFBD>/usr/include <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
#include </usr/include/fcntl.h>
|
||||
|
||||
#endif
|
||||
8
wonx_include/filesys.h
Normal file
8
wonx_include/filesys.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef _WONX_SYS_FILESYS_H_
|
||||
#define _WONX_SYS_FILESYS_H_
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#endif
|
||||
9
wonx_include/indirect.h
Normal file
9
wonx_include/indirect.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef _WONX_SYS_INDIRECT_H_
|
||||
#define _WONX_SYS_INDIRECT_H_
|
||||
|
||||
#include "service.h"
|
||||
#include "filesys.h"
|
||||
|
||||
#warning indirect function is not supported.
|
||||
|
||||
#endif
|
||||
31
wonx_include/libwwc.h
Normal file
31
wonx_include/libwwc.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef _WONX_SYS_LIBWWC_H_
|
||||
#define _WONX_SYS_LIBWWC_H_
|
||||
|
||||
#include "service.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
#define COLOR_MODE_GRAYSCALE 0x00
|
||||
#define COLOR_MODE_4COLOR 0x80
|
||||
#define COLOR_MODE_16COLOR 0xC0
|
||||
#define COLOR_MODE_16PACKED 0xE0
|
||||
|
||||
#define HARDARCH_WS 0
|
||||
#define HARDARCH_WSC 1
|
||||
|
||||
/*****************************************************************************/
|
||||
/* <20>ߴ<EFBFBD><DFB4>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
||||
/*****************************************************************************/
|
||||
|
||||
unsigned int wwc_set_color_mode(unsigned int mode);
|
||||
unsigned int wwc_get_color_mode(void);
|
||||
void wwc_palette_set_color(unsigned int palette_num, unsigned int color_num, unsigned int rgb);
|
||||
unsigned int wwc_palette_get_color(unsigned int palette_num, unsigned int color_num);
|
||||
void wwc_font_set_colordata(unsigned int number, unsigned int count, unsigned char * data);
|
||||
void wwc_font_get_colordata(unsigned int number, unsigned int count, unsigned char * data);
|
||||
unsigned int wwc_get_hardarch(void);
|
||||
void wwc_clear_font(void);
|
||||
|
||||
#endif
|
||||
9
wonx_include/oswork.h
Normal file
9
wonx_include/oswork.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#ifndef _WONX_SYS_OSWORK_H_
|
||||
#define _WONX_SYS_OSWORK_H_
|
||||
|
||||
#include "process.h"
|
||||
#include "fcntl.h"
|
||||
|
||||
#warning oswork function is not supported.
|
||||
|
||||
#endif
|
||||
10
wonx_include/process.h
Normal file
10
wonx_include/process.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef _WONX_SYS_PROCESS_H_
|
||||
#define _WONX_SYS_PROCESS_H_
|
||||
|
||||
#include "bank.h"
|
||||
#include "filesys.h"
|
||||
#include "indirect.h"
|
||||
|
||||
#warning process function is not supported.
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user