Added service function. (A service function dumping information for debugging, Added service function for screen drawing ON / OFF control) Specifically, see README. Make the object's destructor called from bios_exit () Add appropriate Destroy function to each object. Delete objects properly We have checked the termination process as a whole, as done. Fix to accept interrupts even during key_wait (). (Previously, only key input was accepted) Some timer interrupts are improved. (UNIXTimer.c) Change the wonx_include directory to wonx. Changed to search the full path to perl automatically and insert it at the beginning of perl script. Makefile review, improvement. Changed ON / OFF of screen drawing to switch according to display level. (See README for details.) Also change to display level lowered by F9 and display level raised by F10. In accordance with that, we have reviewed a part of ON / OFF part of drawing and key input event processing. Fixed to display message when pressing key. Obj ObjListData_GetPrev (ObjListData data) Obj ObjListData_GetNext (ObjListData data) To ObjListData ObjListData_GetPrev (ObjListData data) ObjListData ObjListData_GetNext (ObjListData data) Fixed to. Added install, uninstall target to Makefile. Fixed challsrc.sh. Version 2.2 - from wonx-2.2.tar.gz
158 lines
4.8 KiB
C
158 lines
4.8 KiB
C
/*****************************************************************************/
|
|
/* ここから */
|
|
/*****************************************************************************/
|
|
|
|
#include "WonXDisplayP.h"
|
|
#include "WonX.h"
|
|
|
|
/*****************************************************************************/
|
|
/* メンバ関数の定義 */
|
|
/*****************************************************************************/
|
|
|
|
XDisplay WonXDisplay_GetXDisplay(WonXDisplay wonx_display)
|
|
{ return (wonx_display->x_display); }
|
|
WWDisplay WonXDisplay_GetWWDisplay(WonXDisplay wonx_display)
|
|
{ return (wonx_display->ww_display); }
|
|
|
|
static XDisplay WonXDisplay_SetXDisplay(WonXDisplay wonx_d, XDisplay xd)
|
|
{ return (wonx_d->x_display = xd); }
|
|
static WWDisplay WonXDisplay_SetWWDisplay(WonXDisplay wonx_d, WWDisplay wd)
|
|
{ return (wonx_d->ww_display = wd); }
|
|
|
|
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)
|
|
{
|
|
WonXDisplay wonx_display;
|
|
WWDisplay ww_display;
|
|
XDisplay x_display;
|
|
|
|
wonx_display = (WonXDisplay)malloc(sizeof(_WonXDisplay));
|
|
if (wonx_display == NULL)
|
|
WonX_Error("WonXDisplay_Create", "Cannot allocate memory.");
|
|
|
|
ww_display = WWDisplay_Create(ww_lcd_panel_width, ww_lcd_panel_height,
|
|
ww_screen_width, ww_screen_height);
|
|
if (ww_display == NULL)
|
|
WonX_Error("WonXDisplay_Create", "Cannot create WonderWitch display.");
|
|
WonXDisplay_SetWWDisplay(wonx_display, ww_display);
|
|
|
|
x_display = XDisplay_Create(x_width, x_height);
|
|
if (x_display == NULL)
|
|
WonX_Error("WonXDisplay_Create", "Cannot create X display.");
|
|
WonXDisplay_SetXDisplay(wonx_display, x_display);
|
|
|
|
return (wonx_display);
|
|
}
|
|
|
|
WonXDisplay WonXDisplay_Destroy(WonXDisplay wonx_display)
|
|
{
|
|
XDisplay x_display;
|
|
WWDisplay ww_display;
|
|
|
|
if (wonx_display == NULL)
|
|
WonX_Error("WonXDisplay_Destroy", "Object is not created.");
|
|
|
|
x_display = WonXDisplay_GetXDisplay(wonx_display);
|
|
if (x_display)
|
|
WonXDisplay_SetXDisplay(wonx_display, XDisplay_Destroy(x_display));
|
|
|
|
ww_display = WonXDisplay_GetWWDisplay(wonx_display);
|
|
if (ww_display)
|
|
WonXDisplay_SetWWDisplay(wonx_display, WWDisplay_Destroy(ww_display));
|
|
|
|
free(wonx_display);
|
|
|
|
return (NULL);
|
|
}
|
|
|
|
int WonXDisplay_PrintData(WonXDisplay wonx_display)
|
|
{
|
|
int i;
|
|
XDisplay x_display;
|
|
WWDisplay ww_display;
|
|
|
|
x_display = WonXDisplay_GetXDisplay(wonx_display);
|
|
ww_display = WonXDisplay_GetWWDisplay(wonx_display);
|
|
|
|
if (XDisplay_GetColorMapPrint(x_display)) {
|
|
WWColorMap_PrintData(WWDisplay_GetColorMap(ww_display), stdout);
|
|
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),
|
|
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),
|
|
ww_display, stdout);
|
|
fflush(stdout);
|
|
}
|
|
XDisplay_SetCharacterPrint(x_display, 0);
|
|
}
|
|
|
|
if (XDisplay_GetSpritePrint(x_display)) {
|
|
for (i = 0; i < 128; i++) {
|
|
WWSprite_PrintData(WWDisplay_GetSprite(ww_display, i), stdout);
|
|
fflush(stdout);
|
|
}
|
|
XDisplay_SetSpritePrint(x_display, 0);
|
|
}
|
|
|
|
return (0);
|
|
}
|
|
|
|
int WonXDisplay_DrawLCDWindow(WonXDisplay wonx_display)
|
|
{
|
|
XDisplay x_display;
|
|
WWDisplay ww_display;
|
|
WWLCDPanel ww_lcd_panel;
|
|
|
|
x_display = WonXDisplay_GetXDisplay(wonx_display);
|
|
ww_display = WonXDisplay_GetWWDisplay(wonx_display);
|
|
|
|
/* 表示レベルが1以上のときだけ描画する */
|
|
if (XDisplay_GetLCDDrawLevel(x_display) > 0) {
|
|
WWDisplay_DrawLCDPanel(ww_display);
|
|
ww_lcd_panel = WWDisplay_GetLCDPanel(ww_display);
|
|
XDisplay_DrawLCDWindow(x_display, ww_display, ww_lcd_panel);
|
|
}
|
|
|
|
return (0);
|
|
}
|
|
|
|
int WonXDisplay_Sync(WonXDisplay wonx_display)
|
|
{
|
|
XDisplay x_display;
|
|
|
|
WonXDisplay_PrintData(wonx_display);
|
|
x_display = WonXDisplay_GetXDisplay(wonx_display);
|
|
XDisplay_Flush(x_display);
|
|
|
|
return (0);
|
|
}
|
|
|
|
int WonXDisplay_Flush(WonXDisplay wonx_display)
|
|
{
|
|
WonXDisplay_DrawLCDWindow(wonx_display);
|
|
WonXDisplay_Sync(wonx_display);
|
|
|
|
return (0);
|
|
}
|
|
|
|
/*****************************************************************************/
|
|
/* ここまで */
|
|
/*****************************************************************************/
|
|
|
|
/*****************************************************************************/
|
|
/* End of File. */
|
|
/*****************************************************************************/
|