/* execcmd化ではおなじみのVPマクロ */ #define VP(x) (void *) (x) #define VPS(a, b, c, d) (void *) (a | b << 8 | c << 16 | d << 24)
lib_init_nm(&lib_work);
lib_openwindow_nm(&window, 0x200, 19 * 8, 4 * 16);
lib_opentextbox_nm(0x1000, &wintitle.tbox, 0, 7, 1, 0, 0, &window, 0x00c0, 0);
↓
static void *cmd0[] = {
VP(LIB_FN_INIT), VP(&lib_work),
VP(LIB_FN_OPENWINDOW), VP(&window), VP(0x200), VP(19 * 8), VP(4 * 16),
VP(LIB_FN_OPENTEXTBOX), VP(0x1000), VP(&wintitle), VP(0), VP(7), VP(1),
VP(0), VP(0), VP(&window), VP(0x00c0), VP(0),
VP(0x0000) /* 最後にこれを忘れずにね */
};#define _ (void *)
#define __(a, b, c, d) (void *) (a | b << 8 | c << 16 | d << 24)
static void *cmd0[] = {
_ LIB_FN_INIT, _ &lib_work,
_ LIB_FN_OPENWINDOW, _ &window, _ 0x200, _ (19 * 8), _ (4 * 16),
_ LIB_FN_OPENTEXTBOX, _ 0x1000, _ &wintitle, _ 0, _ 7, _ 1, _ 0, _ 0, _ &window, _ 0x00c0, _ 0,
_ 0x0000 /* 最後にこれを忘れずにね */
}; static struct LIB_WORK lib_work;
/* これで lib_init_nm(&lib_work); とできるようになる。 */ static struct LIB_WINDOW window;
/* これで lib_openwindow_nm(&window, 0x200, 19 * 8, 4 * 16); とできるようになる。 */ static struct {
struct LIB_TEXTBOX tbox;
int data[7 * 1 * 8 / 4];
} wintitle;
/* これで VP(&wintitle) とすることでこのtextboxを表せる */
/* dataの中の式の意味は、 xsize * ysize * 8 / 4 という意味 */ static struct {
struct LIB_GRAPHBOX gbox;
int data[160 * 100];
} pic;
/* これで VP(&pic) とすることでこのgraphboxを表せる */
/* dataの中の式の意味は、 xsize * ysize という意味 */
/* 表示上のサイズとバッファの大きさが違う場合は、 */
/* 表示上の大きさではなくバッファの大きさ */
/* 8bitグラフィックボックスならintではなくchar */
/* 16bitグラフィックボックスならintではなくshort */ static int signalbox0[256 / 4], *sig_ptr = signalbox0;
/* これで lib_opensignalbox_nm(256, signalbox0, 0, REWIND_CODE); */
/* だけでinit_signalbox(); の代わりになる */struct LIB_TEXTBOX *ptbox = VP(&textbox);
| lib_init | LIB_FN_INIT | non-malloc型 |
| lib_close | LIB_FN_CLOSE | |
| lib_waitsignal | LIB_FN_WAITSIGNAL | |
| lib_waitsignaltime | LIB_FN_WAITSIGNALTIME | |
| lib_openwindow | LIB_FN_OPENWINDOW | non-malloc型 |
| lib_closewindow | LIB_FN_CLOSEWINDOW | |
| lib_opentextbox | LIB_FN_OPENTEXTBOX | non-malloc型 |
| lib_closetextbox | LIB_FN_CLOSETEXTBOX | |
| lib_opnegraphbox | LIB_FN_OPENGRAPHBOX | non-malloc型 |
| lib_opnegraphbox2 | LIB_FN_OPENGRAPHBOX2 | non-malloc型 |
| lib_controlwindow | LIB_FN_CONTROLWINDOW | |
| lib_drawline | LIB_FN_DRAWLINE | |
| lib_drawline0 | LIB_FN_DRAWLINE0 | |
| lib_opensignalbox | LIB_FN_OPENSIGNALBOX | non-malloc型 |
| lib_opentimer | LIB_FN_OPENTIMER | |
| lib_closetimer | LIB_FN_CLOSETIMER | |
| lib_settimer | LIB_FN_SETTIMER | |
| lib_settimertime | LIB_FN_SETTIMERTIME | |
| lib_opensoundtrack | LIB_FN_OPENSOUNDTRAK | |
| lib_controlfreq | LIB_FN_CONTROLFREQ | |
| lib_loadfontset0 | LIB_FN_LOADFONTSET0 | |
| lib_makecharset | LIB_FN_MAKECHARSET | |
lib_putstring1(0x1000, 0, 0, VP(&wintitle), 0, 0, 0, 7, "test060");
VP(LIB_FN_PUTSTRING), VP(0x1000 + 0x4000), VP(0), VP(0), VP(&wintitle),
VP(0), VP(0), VP(0), VP(7), VP("test060"), VP(0x000c),VP(LIB_FN_PUTSTRING), VP(0x1000), VP(0), VP(0), VP(&wintitle), VP(0), VP(0),
VP(0), VP(7), VPS('t', 'e', 's', 't'), VPS('0', '6', '0', 0),(This host) = http://osask.net