Since there is a possibility that the Error () function will collide with libwonx.a when linking, It changed to Wonx_Error (). Added bios_exit (). sprite_set_char, sprite_get_char, palette number minus 8 Fixed bug that was not specified. font_set_monodata (), font_set_colordata (), font_get_data (), disp.c, The arguments of screen_set_char (), screen_get_char (), sprite_set_data () Changed from void * to appropriate type. Sample program and attached SpeedMac. I added a document. Version 0.3 beta - from wonx-b03.tar.gz
61 lines
1.4 KiB
C
61 lines
1.4 KiB
C
#include "WonxP.h"
|
|
#include "etc.h"
|
|
|
|
#include "wonx_include/disp.h"
|
|
#include "wonx_include/text.h"
|
|
#include "wonx_include/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) Wonx_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);
|
|
}
|
|
|