(UNIXTimer, WWInterrupt, WWTimer, WonxSystem addition) According to interrupt support, compatibility functions are replaced with UNIXTimer_Pause (), UNIXTimer_Unpause () It hung around. UNIXTimer, WWTimer, WonxSystem's callback functions, It is necessary to check finely whether there are bugs peculiar to interrupts. (The setting of the interrupt in the callback function may change, or from the callback function It is necessary to check whether the callback function is called or not) Version 0.2 beta - from wonx-b02.tar.gz
61 lines
1.4 KiB
C
61 lines
1.4 KiB
C
#include "WonxP.h"
|
|
#include "etc.h"
|
|
|
|
#include "sys/disp.h"
|
|
#include "sys/text.h"
|
|
#include "sys/system.h"
|
|
|
|
/*****************************************************************************/
|
|
/* ディスプレイの確保 */
|
|
/*****************************************************************************/
|
|
|
|
static Wonx wonx = NULL;
|
|
|
|
int Wonx_IsCreated(void)
|
|
{
|
|
return (wonx != NULL);
|
|
}
|
|
|
|
void Wonx_Create(void)
|
|
{
|
|
WWScreen screen;
|
|
WWPalette palette;
|
|
|
|
wonx = (Wonx)malloc(sizeof(_Wonx));
|
|
if (wonx == NULL) Error("Wonx_Create", "Cannot allocate memory.");
|
|
|
|
wonx->wonx_display =
|
|
WonxDisplay_Create(LCD_PIXEL_WIDTH * 2, LCD_PIXEL_HEIGHT * 2,
|
|
LCD_PIXEL_WIDTH, LCD_PIXEL_HEIGHT,
|
|
SCREEN_CHAR_WIDTH, SCREEN_CHAR_HEIGHT);
|
|
screen =
|
|
WWDisplay_GetScreen(WonxDisplay_GetWWDisplay(wonx->wonx_display), SCREEN2);
|
|
/* デフォルトのテキスト表示用パレットは0 */
|
|
palette =
|
|
WWDisplay_GetPalette(WonxDisplay_GetWWDisplay(wonx->wonx_display), 0);
|
|
|
|
wonx->wonx_text =
|
|
WonxText_Create(screen, 0, 0, TEXT_SCREEN_WIDTH, TEXT_SCREEN_HEIGHT,
|
|
palette);
|
|
|
|
wonx->wonx_system = WonxSystem_Create();
|
|
|
|
return;
|
|
}
|
|
|
|
WonxDisplay Wonx_GetWonxDisplay(void)
|
|
{
|
|
return (wonx->wonx_display);
|
|
}
|
|
|
|
WonxText Wonx_GetWonxText(void)
|
|
{
|
|
return (wonx->wonx_text);
|
|
}
|
|
|
|
WonxSystem Wonx_GetWonxSystem(void)
|
|
{
|
|
return (wonx->wonx_system);
|
|
}
|
|
|