OSDN Git Service

svn rev.329より移動。
[chnosproject/CHNOSProject.git] / CHNOSProject / chnos / tolset_chn_000 / z_tools / guigui00 / guigui00.h
diff --git a/CHNOSProject/chnos/tolset_chn_000/z_tools/guigui00/guigui00.h b/CHNOSProject/chnos/tolset_chn_000/z_tools/guigui00/guigui00.h
new file mode 100644 (file)
index 0000000..1df36f4
--- /dev/null
@@ -0,0 +1,586 @@
+#ifndef __GUIGUI00_H\r
+#define __GUIGUI00_H\r
+\r
+/* gg00lib+ ver.0.8 */\r
+/* gg00lib9\82ð\83x\81[\83X\82É\82µ\82Ä\82¢\82é */\r
+\r
+struct LIB_WORK {\r
+       int data[256 / 4];\r
+};\r
+\r
+struct LIB_WINDOW {\r
+       int data[128 / 4];\r
+};\r
+\r
+struct LIB_TEXTBOX {\r
+       int data[64 / 4];\r
+};\r
+\r
+struct LIB_SIGHNDLREG {\r
+       int ES, DS, FS, GS;\r
+       int EDI, ESI, EBP, ESP;\r
+       int EBX, EDX, ECX, EAX;\r
+       int EIP, CS, EFLAGS;\r
+};\r
+\r
+struct LIB_GRAPHBOX {\r
+       int reserve[64 / 4];\r
+};\r
+\r
+struct LIB_LINES1 {\r
+       int x0, y0, dx, dy, length, color;\r
+};\r
+\r
+struct LIB_LINES0 {\r
+       int x0, y0, x1, y1, dummy, color;\r
+};\r
+\r
+struct LIB_POINTS {\r
+       int x, y, color;\r
+};\r
+\r
+//void lib_execcmd(void *EBX);\r
+\r
+extern __inline__ void lib_execcmd(void *EBX)\r
+{\r
+       __asm__ (" .byte 154 \n\t"\r
+                        " .byte 0   \n\t"\r
+                        " .byte 0   \n\t"\r
+                        " .byte 0   \n\t"\r
+                        " .byte 0   \n\t"\r
+                        " .byte 199 \n\t"\r
+                        " .byte 0   \n\t"\r
+                        : : "b" (EBX) );\r
+}\r
+\r
+void lib_execcmd0(int cmd, ...);\r
+#if 0\r
+extern __inline__ void lib_execcmd0(int cmd, ...)\r
+{\r
+       __asm__ (" movl %%esp,%%ebx \n\t"\r
+                        " .byte 154 \n\t"\r
+                        " .byte 0   \n\t"\r
+                        " .byte 0   \n\t"\r
+                        " .byte 0   \n\t"\r
+                        " .byte 0   \n\t"\r
+                        " .byte 199 \n\t"\r
+                        " .byte 0   \n\t"\r
+                        : : : "%ebx");\r
+}\r
+#endif\r
+\r
+int lib_execcmd1(int ret, int cmd, ...);\r
+int lib_execcmd2(int ret, int cmd, ...);\r
+\r
+void *malloc(const unsigned int nbytes);\r
+\r
+#if 0\r
+       /* \88È\89º\82Ì\8aÖ\90\94\82Í\83}\83N\83\8d\82Å\8eÀ\8c»\82³\82ê\82Ä\82¢\82é(\8d\82\91¬\89»\82Æ\83R\83\93\83p\83N\83g\89»\82Ì\82½\82ß) */\r
+       /* \88ø\90\94\82Ì\8c^\82È\82Ç\82ª\95ª\82©\82è\82â\82·\82¢\82æ\82¤\82É\81A\8aÖ\90\94\8c^\90é\8c¾\82ð\92\90\8eß\82Æ\82µ\82Ä\8ec\82µ\82Ä\82 \82é */\r
+\r
+struct LIB_WORK *lib_init(struct LIB_WORK *work);\r
+void lib_init_nm(struct LIB_WORK *work);\r
+struct LIB_WORK *lib_init_am(struct LIB_WORK *work);\r
+void lib_waitsignal(int opt, int signaldw, int nest);\r
+struct LIB_WINDOW *lib_openwindow(struct LIB_WINDOW *window, int slot, int x_size, int y_size);\r
+void lib_openwindow_nm(struct LIB_WINDOW *window, int slot, int x_size, int y_size);\r
+void lib_openwindow_am(struct LIB_WINDOW *window, int slot, int x_size, int y_size);\r
+struct LIB_TEXTBOX *lib_opentextbox(int opt, struct LIB_TEXTBOX *textbox, int backcolor,\r
+       int x_size, int y_size, int x_pos, int y_pos, struct LIB_WINDOW *window, int charset,\r
+       int init_char);\r
+void lib_opentextbox_nm(int opt, struct LIB_TEXTBOX *textbox, int backcolor, int x_size,\r
+       int y_size, int x_pos, int y_pos, struct LIB_WINDOW *window, int charset, int init_char);\r
+void lib_opentextbox_am(int opt, struct LIB_TEXTBOX *textbox, int backcolor, int x_size,\r
+       int y_size, int x_pos, int y_pos, struct LIB_WINDOW *window, int charset, int init_char);\r
+void lib_waitsignaltime(int opt, int signaldw, int nest, unsigned int time0, unsigned int time1,\r
+       unsigned int time2);\r
+int *lib_opensignalbox(int bytes, int *signalbox, int eos, int rewind);\r
+void lib_opensignalbox_nm(int bytes, int *signalbox, int eos, int rewind);\r
+int *lib_opensignalbox_am(int bytes, int *signalbox, int eos, int rewind);\r
+void lib_definesignal0p0(int opt, int default_assign0, int default_assign1, int default_assign2);\r
+void lib_definesignal1p0(int opt, int default_assign0, int default_assign1,\r
+       struct LIB_WINDOW *default_assign2, int signal);\r
+void lib_opentimer(int slot);\r
+void lib_closetimer(int slot);\r
+void lib_settimertime(int opt, int slot, unsigned int time0, unsigned int time1,\r
+       unsigned int time2);\r
+void lib_settimer(int opt, int slot);\r
+void lib_opensoundtrack(int slot);\r
+void lib_controlfreq(int slot, int freq);\r
+struct LIB_WINDOW *lib_openwindow1(struct LIB_WINDOW *window, int slot, int x_size, int y_size,\r
+       int flags, int base);\r
+void lib_openwindow1_nm(struct LIB_WINDOW *window, int slot, int x_size, int y_size, int flags,\r
+       int base);\r
+void lib_openwindow1_am(struct LIB_WINDOW *window, int slot, int x_size, int y_size, int flags,\r
+       int base);\r
+void lib_closewindow(int opt, struct LIB_WINDOW *window);\r
+void lib_controlwindow(int opt, struct LIB_WINDOW *window);\r
+void lib_close(int opt);\r
+void lib_loadfontset(int opt, int slot, int len, void *font);\r
+void lib_loadfontset0(int opt, int slot);\r
+void lib_makecharset(int opt, int charset, int fontset, int len, int from, int base);\r
+void lib_drawline(int opt, struct LIB_WINDOW *window, int color, int x0, int y0, int x1, int y1);\r
+void lib_closetextbox(int opt, struct LIB_TEXTBOX *textbox);\r
+void lib_mapmodule(int opt, int slot, int attr, int size, void *addr, int ofs);\r
+void lib_unmapmodule(int opt, int size, void *addr);\r
+void lib_initmodulehandle(int opt, int slot);\r
+void lib_putblock1(struct LIB_WINDOW *win, int x, int y, int sx, int sy, int skip, void *p);\r
+struct LIB_GRAPHBOX *lib_opengraphbox(int opt, struct LIB_GRAPHBOX *gbox, int mode, int mode_opt,\r
+       int x_size, int y_size, int x_pos, int y_pos, struct LIB_WINDOW *window);\r
+void lib_opengraphbox_nm(int opt, struct LIB_GRAPHBOX *gbox, int mode, int mode_opt,\r
+       int x_size, int y_size, int x_pos, int y_pos, struct LIB_WINDOW *window);\r
+struct LIB_GRAPHBOX *lib_opengraphbox_am(int opt, struct LIB_GRAPHBOX *gbox, int mode, int mode_opt,\r
+       int x_size, int y_size, int x_pos, int y_pos, struct LIB_WINDOW *window);\r
+void lib_flushgraphbox(int opt, struct LIB_WINDOW *win, int x, int y, int sx, int sy, int skip,\r
+       void *p);\r
+void lib_drawline0(int opt, struct LIB_GRAPHBOX *gbox, int color, int x0, int y0, int x1, int y1);\r
+void lib_drawlines0(int opt, struct LIB_GRAPHBOX *gbox, int x0, int y0, int xsize, int ysize,\r
+       int lines, const struct LIB_LINES1 *ofs);\r
+void lib_convlines(int opt, int lines, struct LIB_LINES0 *src, struct LIB_LINES1 *dest);\r
+void lib_initmodulehandle0(int opt, int slot);\r
+void lib_putblock02001(struct LIB_GRAPHBOX *gbox, void *buf, int vx0, int vy0);\r
+struct LIB_GRAPHBOX *lib_opengraphbox2(int opt, struct LIB_GRAPHBOX *gbox, int mode, int mode_opt,\r
+       int x_bsize, int y_bsize, int x_vsize, int y_vsize, int x_pos, int y_pos,\r
+       struct LIB_WINDOW *window);\r
+void lib_opengraphbox2_nm(int opt, struct LIB_GRAPHBOX *gbox, int mode, int mode_opt,\r
+       int x_bsize, int y_bsize, int x_vsize, int y_vsize, int x_pos, int y_pos,\r
+       struct LIB_WINDOW *window);\r
+struct LIB_GRAPHBOX *lib_opengraphbox2_am(int opt, struct LIB_GRAPHBOX *gbox, int mode, int mode_opt,\r
+       int x_bsize, int y_bsize, int x_vsize, int y_vsize, int x_pos, int y_pos,\r
+       struct LIB_WINDOW *window);\r
+void lib_putblock03001(struct LIB_GRAPHBOX *gbox, void *buf, int vx0, int vy0, void *tbuf,\r
+       int tbuf_skip, int tcol0);\r
+void lib_drawpoints0(int opt, struct LIB_GRAPHBOX *gbox, int x0, int y0, int xsize, int ysize,\r
+       int points, const struct LIB_POINTS *ofs);\r
+void lib_wsjis2gg00jpn0(int len, const char *sjis, int *gg00jpn, int ankbase, int jpnbase);\r
+void lib_loadfontset1(int opt, int slot, int sig);\r
+void lib_drawlines1(int opt, struct LIB_WINDOW *win, int x0, int y0, int xsize, int ysize,\r
+       int lines, const struct LIB_LINES1 *ofs);\r
+void lib_drawpoints1(int opt, struct LIB_WINDOW *win, int x0, int y0, int xsize, int ysize,\r
+       int points, const struct LIB_POINTS *ofs);\r
+void lib_seuc2gg00(int len, const char *seuc, int *gg00, int ankbase, int rightbase);\r
+void lib_resizemodule(int opt, int slot, int newsize, int sig);\r
+void lib_drawpoint0(int opt, struct LIB_GRAPHBOX *gbox, int color, int x, int y);\r
+const int lib_getrandseed();\r
+void lib_putstring0(int opt, int x_pos, int y_pos, struct LIB_TEXTBOX *textbox,\r
+       int color, int bcolor, int len, const int *str);\r
+void lib_putstring1(int opt, int x_pos, int y_pos, struct LIB_TEXTBOX *tbox,\r
+       int col, int bcol, int base, int len, const int *str);\r
+\r
+#endif\r
+\r
+void lib_putstring_ASCII(int opt, int x_pos, int y_pos, struct LIB_TEXTBOX *textbox, int color,\r
+       int backcolor, const char *str);\r
+void lib_definesignalhandler(void (*lib_signalhandler)(struct LIB_SIGHNDLREG *));\r
+int lib_readCSb(int offset);\r
+int lib_readCSd(int offset);\r
+int lib_readmodulesize(int slot);\r
+void lib_initmodulehandle1(int slot, int num, int sig);\r
+void lib_steppath0(int opt, int slot, const char *name, int sig);\r
+int lib_decodel2d3(int size, int src_ofs, int src_sel, int dest_ofs, int dest_sel);\r
+void lib_putstring_SJIS0(int opt, int x_pos, int y_pos, struct LIB_TEXTBOX *textbox,\r
+       int color, int backcolor, const char *str);\r
+int lib_decodetek0(int size, int src_ofs, int src_sel, int dest_ofs, int dest_sel);\r
+void lib_settimertime2(int opt, int slot0, int slot1, unsigned int *time);\r
+\r
+#define        lib_init(work) \\r
+       (struct LIB_WORK *) lib_execcmd2(1 * 4 + 4, 0x0004, \\r
+       (work) ? (void *) (work) : malloc(sizeof (struct LIB_WORK)), 0x0000)\r
+\r
+#define        lib_init_nm(work) \\r
+       lib_execcmd0(0x0004, (void *) (work), 0x0000)\r
+\r
+#define        lib_init_am(work) \\r
+       (struct LIB_WORK *) lib_execcmd2(1 * 4 + 4, 0x0004, \\r
+       malloc(sizeof (struct LIB_WORK)), 0x0000)\r
+\r
+#define        lib_waitsignal(opt, signaldw, nest) \\r
+       lib_execcmd0(0x0018, (int) (opt), (int) (signaldw), (int) (nest), 0x0000)\r
+\r
+#define        lib_openwindow(window, slot, x_size, y_size) \\r
+       (struct LIB_WINDOW *) lib_execcmd2(1 * 4 + 4, 0x0020, \\r
+       (window) ? (void *) (window) : malloc(sizeof (struct LIB_WINDOW)), \\r
+       (int) (slot), (int) (x_size), (int) (y_size), 0x0000)\r
+\r
+#define        lib_openwindow_nm(window, slot, x_size, y_size) \\r
+       lib_execcmd0(0x0020, (void *) (window), (int) (slot), (int) (x_size), \\r
+       (int) (y_size), 0x0000)\r
+\r
+#define        lib_openwindow_am(window, slot, x_size, y_size) \\r
+       (struct LIB_WINDOW *) lib_execcmd2(1 * 4 + 4, 0x0020, \\r
+       malloc(sizeof (struct LIB_WINDOW)), \\r
+       (int) (slot), (int) (x_size), (int) (y_size), 0x0000)\r
+\r
+#define        lib_opentextbox(opt, textbox, backcolor, x_size, y_size, x_pos, y_pos, window, charset, init_char) \\r
+       (struct LIB_TEXTBOX *) lib_execcmd2(2 * 4 + 4, 0x0028, (int) (opt), \\r
+       (textbox) ? (void *) (textbox) : malloc(sizeof (struct LIB_TEXTBOX) + 8 * (x_size) * (y_size)), \\r
+       (int) (backcolor), (int) (x_size), (int) (y_size), (int) (x_pos), \\r
+       (int) (y_pos), (void *) (window), (int) (charset), (int) (init_char), \\r
+       0x0000)\r
+\r
+#define        lib_opentextbox_nm(opt, textbox, backcolor, x_size, y_size, x_pos, y_pos, window, charset, init_char) \\r
+       lib_execcmd0(0x0028, (int) (opt), (void *) (textbox), (int) (backcolor), \\r
+       (int) (x_size), (int) (y_size), (int) (x_pos), (int) (y_pos), \\r
+       (void *) (window), (int) (charset), (int) (init_char), 0x0000)\r
+\r
+#define        lib_opentextbox_am(opt, textbox, backcolor, x_size, y_size, x_pos, y_pos, window, charset, init_char) \\r
+       (struct LIB_TEXTBOX *) lib_execcmd2(2 * 4 + 4, 0x0028, (int) (opt), \\r
+       malloc(sizeof (struct LIB_TEXTBOX) + 8 * (x_size) * (y_size)), \\r
+       (int) (backcolor), (int) (x_size), (int) (y_size), (int) (x_pos), \\r
+       (int) (y_pos), (void *) (window), (int) (charset), (int) (init_char), \\r
+       0x0000)\r
+\r
+#define        lib_waitsignaltime(opt, signaldw, nest, time0, time1, time2) \\r
+       lib_execcmd0(0x0018, (int) (opt), (int) (signaldw), (int) (nest), \\r
+       (int) (time0), (int) (time1), (int) (time2), 0x0000)\r
+\r
+#define        lib_opensignalbox(bytes, signalbox, eos, rewind) \\r
+       (int *) lib_execcmd2(2 * 4 + 4, 0x0060, (int) (bytes), \\r
+       (signalbox) ? (void *) (signalbox) : malloc(bytes), (int) (eos), \\r
+       (int) (rewind), 0x0000)\r
+\r
+#define        lib_opensignalbox_nm(bytes, signalbox, eos, rewind) \\r
+       lib_execcmd0(0x0060, (int) (bytes), (void *) (signalbox), (int) (eos), \\r
+       (int) (rewind), 0x0000)\r
+\r
+#define        lib_opensignalbox_am(bytes, signalbox, eos, rewind) \\r
+       (int *) lib_execcmd2(2 * 4 + 4, 0x0060, (int) (bytes), \\r
+       malloc(bytes), (int) (eos), (int) (rewind), 0x0000)\r
+\r
+#define        lib_definesignal0p0(opt, default_assign0, default_assign1, default_assign2) \\r
+       lib_execcmd0(0x0068, (int) (opt), (int) (default_assign0), \\r
+       (int) (default_assign1), (int) (default_assign2), 0, 0, 0x0000)\r
+\r
+#define        lib_definesignal1p0(opt, default_assign0, default_assign1, default_assign2, signal) \\r
+       lib_execcmd0(0x0068, (int) (opt), (int) (default_assign0), \\r
+       (int) (default_assign1), (int) (default_assign2), 1, (int) (signal), \\r
+       0, 0x0000)\r
+\r
+#define        lib_opentimer(slot) \\r
+       lib_execcmd0(0x0070, (int) (slot), 0x0000)\r
+\r
+#define        lib_closetimer(slot) \\r
+       lib_execcmd0(0x0074, (int) (slot), 0x0000)\r
+\r
+#define        lib_settimertime(opt, slot, time0, time1, time2) \\r
+       lib_execcmd0(0x0078, (int) (opt), (int) (slot), (int) (time0), \\r
+       (int) (time1), (int) (time2), 0x0000)\r
+\r
+#define        lib_settimer(opt, slot) \\r
+       lib_execcmd0(0x0078, (int) (opt), (int) (slot), 0x0000)\r
+\r
+#define        lib_opensoundtrack(slot) \\r
+       lib_execcmd0(0x0080, (int) (slot), 0, 0x0000)\r
+\r
+#define        lib_controlfreq(slot, freq) \\r
+       lib_execcmd0(0x008c, (int) (slot), (int) (freq), 0x0000)\r
+\r
+#define        lib_openwindow1(window, slot, x_size, y_size, flags, base) \\r
+       (struct LIB_WINDOW *) lib_execcmd2(1 * 4 + 4, 0x0020, \\r
+       (window) ? (void *) (window) : malloc(sizeof (struct LIB_WINDOW)), \\r
+       (int) (slot) | 0x01, (int) (x_size), (int) (y_size), \\r
+       0x01 | (int) (flags) << 8, (int) (base), 0x0000)\r
+\r
+#define        lib_openwindow1_nm(window, slot, x_size, y_size, flags, base) \\r
+       lib_execcmd0(0x0020, (void *) (window), (int) (slot) | 0x01, \\r
+       (int) (x_size), (int) (y_size), 0x01 | (int) (flags) << 8, (int) (base), \\r
+       0x0000)\r
+\r
+#define        lib_openwindow1_am(window, slot, x_size, y_size, flags, base) \\r
+       (struct LIB_WINDOW *) lib_execcmd2(1 * 4 + 4, 0x0020, \\r
+       malloc(sizeof (struct LIB_WINDOW)), \\r
+       (int) (slot) | 0x01, (int) (x_size), (int) (y_size), \\r
+       0x01 | (int) (flags) << 8, (int) (base), 0x0000)\r
+\r
+#define        lib_closewindow(opt, window) \\r
+       lib_execcmd0(0x0024, (int) (opt), (void *) (window), 0x0000)\r
+\r
+#define        lib_controlwindow(opt, window) \\r
+       lib_execcmd0(0x003c, (int) (opt), (void *) (window), 0x0000)\r
+\r
+#define        lib_close(opt) \\r
+       lib_execcmd0(0x0008, (int) (opt), 0x0000)\r
+\r
+#define        lib_loadfontset(opt, slot, len, font) \\r
+       lib_execcmd0(0x00e0, (int) (opt), (int) (slot), (int) (len), (int) (font), \\r
+       0x000c, 0x0000)\r
+\r
+#define        lib_loadfontset0(opt, slot) \\r
+       lib_execcmd0(0x00e0, (int) (opt), (int) (slot), 0x0000)\r
+\r
+#define        lib_loadfontset1(opt, slot, sig) \\r
+       lib_execcmd0(0x00e0, (int) (opt), (int) (slot), 1, (int) (sig), 0x0000)\r
+\r
+#define        lib_makecharset(opt, charset, fontset, len, from, base) \\r
+       lib_execcmd0(0x00e8, (int) (opt), (int) (charset), (int) (fontset), \\r
+       (int) (len), (int) (from), (int) (base), 0x0000)\r
+\r
+#define        lib_drawline(opt, window, color, x0, y0, x1, y1) \\r
+       lib_execcmd0(0x0044, (int) (opt), (void *) (window), (int) (color), \\r
+       (int) (x0), (int) (y0), (int) (x1), (int) (y1), 0x0000)\r
+\r
+#define        lib_closetextbox(opt, textbox) \\r
+       lib_execcmd0(0x002c, (int) (opt), (int) (textbox), 0x0000)\r
+\r
+#define        lib_mapmodule(opt, slot, attr, size, addr, ofs) \\r
+       lib_execcmd0(0x00c0, (int) (opt), (int) (slot), (int) (size), \\r
+       (void *) (addr), 0x000c, (int) ((ofs) | (attr)), 0x0000)\r
+\r
+#define        lib_unmapmodule(opt, size, addr) \\r
+       lib_execcmd0(0x00c4, (int) (opt), (int) (size), (void *) (addr), 0x000c, \\r
+       0x0000)\r
+\r
+#define        lib_initmodulehandle(opt, slot) \\r
+       lib_execcmd0(0x00a0, (int) (opt), (int) (slot), 0x0000)\r
+\r
+#define        lib_putblock1(win, x, y, sx, sy, skip, p) \\r
+       lib_execcmd0(0x004c, 1, (void *) (win), (int) (x), (int) (y), (int) (sx), \\r
+       (int) (sy), (int) (skip), (void *) (p), 0x000c, 0x0000)\r
+\r
+#define        lib_opengraphbox(opt, graphbox, mode, mode_opt, x_size, y_size, x_pos, y_pos, window) \\r
+       (struct LIB_GRAPHBOX *) lib_execcmd2(2 * 4 + 4, 0x0030, (int) (opt), \\r
+       (graphbox) ? (void *) (graphbox) : malloc(sizeof (struct LIB_GRAPHBOX) + (x_size) * (y_size) * ((mode) & 0xf)), \\r
+       (int) (mode), (int) (mode_opt), (int) (x_size), (int) (y_size), \\r
+       (int) (x_pos), (int) (y_pos), (void *) (window), 0x0000)\r
+\r
+#define        lib_opengraphbox_nm(opt, graphbox, mode, mode_opt, x_size, y_size, x_pos, y_pos, window) \\r
+       lib_execcmd0(0x0030, (int) (opt), (void *) (graphbox), \\r
+       (int) (mode), (int) (mode_opt), (int) (x_size), (int) (y_size), \\r
+       (int) (x_pos), (int) (y_pos), (void *) (window), 0x0000)\r
+\r
+#define        lib_opengraphbox_am(opt, graphbox, mode, mode_opt, x_size, y_size, x_pos, y_pos, window) \\r
+       (struct LIB_GRAPHBOX *) lib_execcmd2(2 * 4 + 4, 0x0030, (int) (opt), \\r
+       malloc(sizeof (struct LIB_GRAPHBOX) + (x_size) * (y_size) * ((mode) & 0xf)), \\r
+       (int) (mode), (int) (mode_opt), (int) (x_size), (int) (y_size), \\r
+       (int) (x_pos), (int) (y_pos), (void *) (window), 0x0000)\r
+\r
+#define        lib_flushgraphbox(opt, win, x, y, sx, sy, skip, p) \\r
+       lib_execcmd0(0x004c, opt, (void *) (win), (int) (x), (int) (y), (int) (sx), \\r
+       (int) (sy), (int) (skip), (void *) (p), 0x000c, 0x0000)\r
+\r
+#define        lib_drawline0(opt, gbox, color, x0, y0, x1, y1) \\r
+       lib_execcmd0(0x0054, (int) (opt), (void *) (gbox), (int) (color), \\r
+       (int) (x0), (int) (y0), (int) (x1), (int) (y1), 0x0000)\r
+\r
+#define lib_drawlines0(opt, gbox, x0, y0, xsize, ysize, lines, ofs) \\r
+       lib_execcmd0(0x0108, (int) (opt), (void *) (gbox), (int) (x0), \\r
+       (int) (y0), (int) (xsize), (int) (ysize), (int) (lines), (void *) (ofs), \\r
+       0x000c, 0x0000)\r
+\r
+#define        lib_convlines(opt, lines, src, dest) \\r
+       lib_execcmd0(0x010c, (int) (opt), (int) (lines), \\r
+       (struct LIB_LINES0 *) (src), 0x000c, (struct LIB_LINES1 *) (dest), \\r
+       0x000c, 0x0000)\r
+\r
+#define        lib_initmodulehandle0(opt, slot) \\r
+       lib_execcmd0(0x00a0, (int) (opt), (int) (slot), 0x0000)\r
+\r
+#define lib_putblock02001(gbox, buf, vx0, vy0) \\r
+       lib_execcmd0(0x0058, 0x2001, (void *) (gbox), (void *) (buf), \\r
+       (int) (vx0), (int) (vy0), 0x0000)\r
+\r
+#define        lib_opengraphbox2(opt, graphbox, mode, mode_opt, x_bsize, y_bsize, \\r
+       x_vsize, y_vsize, x_pos, y_pos, window) \\r
+       (struct LIB_GRAPHBOX *) lib_execcmd2(2 * 4 + 4, 0x0030, (int) (opt), \\r
+       (graphbox) ? (void *) (graphbox) : malloc(sizeof (struct LIB_GRAPHBOX) + (x_bsize) * (y_bsize) * ((mode) & 0xf)), \\r
+       (int) (mode), (int) (mode_opt), (int) (x_bsize), (int) (y_bsize), \\r
+       (int) (x_vsize), (int) (y_vsize), (int) (x_pos), (int) (y_pos), \\r
+       (void *) (window), 0x0000)\r
+\r
+#define        lib_opengraphbox2_nm(opt, graphbox, mode, mode_opt, x_bsize, y_bsize, \\r
+       x_vsize, y_vsize, x_pos, y_pos, window) \\r
+       lib_execcmd0(0x0030, (int) (opt), (void *) (graphbox), \\r
+       (int) (mode), (int) (mode_opt), (int) (x_bsize), (int) (y_bsize), \\r
+       (int) (x_vsize), (int) (y_vsize), (int) (x_pos), (int) (y_pos), \\r
+       (void *) (window), 0x0000)\r
+\r
+#define        lib_opengraphbox2_am(opt, graphbox, mode, mode_opt, x_bsize, y_bsize, \\r
+       x_vsize, y_vsize, x_pos, y_pos, window) \\r
+       (struct LIB_GRAPHBOX *) lib_execcmd2(2 * 4 + 4, 0x0030, (int) (opt), \\r
+       malloc(sizeof (struct LIB_GRAPHBOX) + (x_bsize) * (y_bsize) * ((mode) & 0xf)), \\r
+       (int) (mode), (int) (mode_opt), (int) (x_bsize), (int) (y_bsize), \\r
+       (int) (x_vsize), (int) (y_vsize), (int) (x_pos), (int) (y_pos), \\r
+       (void *) (window), 0x0000)\r
+\r
+#define lib_putblock03001(gbox, buf, vx0, vy0, tbuf, tbuf_skip, tcol0) \\r
+       lib_execcmd0(0x0058, 0x3001, (void *) (gbox), (void *) (buf), \\r
+       (int) (vx0), (int) (vy0), (void *) (tbuf), (int) (tbuf_skip), \\r
+       (int) (tcol0), 0x0000)\r
+\r
+#define lib_drawpoints0(opt, gbox, x0, y0, xsize, ysize, points, ofs) \\r
+       lib_execcmd0(0x005c, (int) (opt), (void *) (gbox), (int) (x0), \\r
+       (int) (y0), (int) (xsize), (int) (ysize), (int) (points), (void *) (ofs), \\r
+       0x000c, 0x0000)\r
+\r
+#define        lib_wsjis2gg00jpn0(len, sjis, gg00jpn, ankbase, jpnbase) \\r
+       lib_execcmd0(0x00ec, 0x0001, (int) (len), (void *) (sjis), 0x000c, \\r
+       (int *) (gg00jpn), 0x000c, (int) (ankbase), (int) (jpnbase), 0x0000)\r
+\r
+#define lib_drawlines1(opt, win, x0, y0, xsize, ysize, lines, ofs) \\r
+       lib_execcmd0(0x0110, (int) (opt), (void *) (win), (int) (x0), \\r
+       (int) (y0), (int) (xsize), (int) (ysize), (int) (lines), (void *) (ofs), \\r
+       0x000c, 0x0000)\r
+\r
+#define lib_drawpoints1(opt, win, x0, y0, xsize, ysize, points, ofs) \\r
+       lib_execcmd0(0x0050, (int) (opt), (void *) (win), (int) (x0), \\r
+       (int) (y0), (int) (xsize), (int) (ysize), (int) (points), (void *) (ofs), \\r
+       0x000c, 0x0000)\r
+\r
+#define        lib_seuc2gg00(len, seuc, gg00, ankbase, rightbase) \\r
+       lib_execcmd0(0x00ec, 0x0002, (int) (len), (void *) (seuc), 0x000c, \\r
+       (int *) (gg00), 0x000c, (int) (ankbase), (int) (rightbase), 0x0000)\r
+\r
+#define        lib_resizemodule(opt, slot, newsize, sig) \\r
+       lib_execcmd0(0x0120, 0x0000, (int) (slot), (int) (newsize), 1, \\r
+       (int) (sig), 0x0000)\r
+\r
+#define        lib_drawpoint0(opt, gbox, color, x, y) \\r
+       lib_execcmd0(0x0054, (int) (opt), (void *) (gbox), (int) (color), \\r
+       (int) (x), (int) (y), (int) (x), (int) (y), 0x0000)\r
+\r
+#define        lib_getrandseed() \\r
+       lib_execcmd2(2 * 4 + 4, 0x0118, (int) 0, (int) 0, (int) 0x0000)\r
+\r
+#define        lib_putstring0(opt, x_pos, y_pos, textbox, color, bcolor, len, str) \\r
+       lib_execcmd0(0x0040, (int) (opt) | 0x4000, (int) (x_pos),  (int) (y_pos), \\r
+       (void *) (textbox), (int) (color), (int) (bcolor), (int) (len), \\r
+       (void *) (str), (int) 0x000c, 0x0000)\r
+\r
+#define        lib_putstring1(opt, x_pos, y_pos, tbox, col, bcol, base, len, str) \\r
+       lib_execcmd0(0x0040, (int) (opt) | 0x4000, (int) (x_pos),  (int) (y_pos), \\r
+       (void *) (tbox), (int) (col), (int) (bcol), (int) (base), (int) (len), \\r
+       (void *) (str), (int) 0x000c, 0x0000)\r
+\r
+/* <guigui00.h>\89ü\97Ç\8cv\89æ\82Ì\82½\82ß\82Ì\92Ç\8bL */\r
+\r
+//void lib_initsignalbox0_256(int rewind);\r
+//void lib_initsignalbox0_4k(int rewind);\r
+//void lib_initsignalbox0_64k(int rewind);\r
+extern int lib_work256[256 / 4];\r
+extern int lib_sigrwd_256, *lib_sigptr_256, lib_sigbox_256[256 / 4];\r
+extern int lib_sigrwd_4k,  *lib_sigptr_4k,  lib_sigbox_4k[4096 / 4];\r
+extern int lib_sigrwd_64k, *lib_sigptr_64k, lib_sigbox_64k[65536 / 4];\r
+int lib_getsig0w(int *sigbox);\r
+int lib_getsig0(int *sigbox);\r
+int lib_getsig1w(int *sigbox);\r
+int lib_getsig1(int *sigbox);\r
+\r
+extern int lib_initsignalbox0_256d[1];\r
+extern __inline__ void lib_initsignalbox0_256(int rewind)\r
+{\r
+       __asm__ (" movl $_lib_initsignalbox0_256d,%%ebx\n\t"    \\r
+                        " movl %0,24(%%ebx)                   \n\t"    \\r
+                        " .byte 154                           \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        " .byte 199                           \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        : : "r" (rewind) : "%ebx" );\r
+}\r
+\r
+extern int lib_initsignalbox0_4kd[1];\r
+extern __inline__ void lib_initsignalbox0_4k(int rewind)\r
+{\r
+       __asm__ (" movl $_lib_initsignalbox0_4kd,%%ebx \n\t"    \\r
+                        " movl %0,24(%%ebx)                   \n\t"    \\r
+                        " .byte 154                           \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        " .byte 199                           \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        : : "r" (rewind) : "%ebx" );\r
+}\r
+\r
+extern int lib_initsignalbox0_64kd[1];\r
+extern __inline__ void lib_initsignalbox0_64k(int rewind)\r
+{\r
+       __asm__ (" movl $_lib_initsignalbox0_64kd,%%ebx\n\t"    \\r
+                        " movl %0,24(%%ebx)                   \n\t"    \\r
+                        " .byte 154                           \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        " .byte 199                           \n\t"    \\r
+                        " .byte 0                             \n\t"    \\r
+                        : : "r" (rewind) : "%ebx" );\r
+}\r
+\r
+#if (!defined(LIB_FN_INIT))\r
+/* function-number */\r
+#define LIB_FN_INIT                            0x0004  /* non-malloc\8c^ */\r
+#define LIB_FN_CLOSE                   0x0008\r
+#define LIB_FN_WAITSIGNAL              0x0018\r
+#define LIB_FN_WAITSIGNALTIME  0x0018\r
+#define LIB_FN_OPENWINDOW              0x0020  /* non-malloc\8c^ */\r
+#define LIB_FN_OPENWINDOW1             0x0020  /* non-malloc\8c^ */\r
+       /* \81ªslot\82Ì\82Æ\82±\82ë\82É1\82ð\91«\82·\81Aflags\82Ì\82Æ\82±\82ë\82Í256\94{\82µ\82Ä\82³\82ç\82É1\82ð\91«\82· */\r
+#define LIB_FN_CLOSEWINDOW             0x0024\r
+#define LIB_FN_OPENTEXTBOX             0x0028  /* non-malloc\8c^ */\r
+#define LIB_FN_CLOSETEXTBOX            0x002c\r
+#define LIB_FN_OPENGRAPHBOX            0x0030  /* non-malloc\8c^ */\r
+#define LIB_FN_OPENGRAPHBOX2   0x0030  /* non-malloc\8c^ */\r
+#define LIB_FN_CONTROLWINDOW   0x003c\r
+#define LIB_FN_PUTSTRING               0x0040\r
+       /* \81ª\95\81\92Ê\82É\8eg\82¤\82È\82çopt\82É0x4000\82ð\91«\82· */\r
+       /* \81ª\83e\83L\83X\83g\96\84\82ß\8d\9e\82Ý\82ð\82â\82é\82È\82ç0x4000\82Í\91«\82³\82È\82¢ */\r
+#define LIB_FN_DRAWLINE                        0x0044\r
+#define LIB_FN_FLUSHGRAPHBOX   0x004c  /* \82¨\82µ\82è\82É0x000c\82ð\92Ç\89Á */\r
+#define LIB_FN_PUTBLOCK1               0x004c  /* \90æ\93ª\82Éopt\82Æ\82µ\82Ä1\82ð\92Ç\89Á\81A\82³\82ç\82É\82¨\82µ\82è\82É0x000c\82ð\92Ç\89Á */\r
+#define LIB_FN_DRAWPOINTS1             0x0050  /* \82¨\82µ\82è\82É0x000c\82ð\92Ç\89Á */\r
+#define LIB_FN_DRAWLINE0               0x0054\r
+#define LIB_FN_DRAWPOINT0              0x0054\r
+       /* \81ªx\82Æy\82Ì\82 \82Æ\82É\81A\82Ü\82½x\82Æy\82ð\92Ç\89Á\81F\8eÀ\82ÍDRAWLINE0\82Å\82²\82Ü\82©\82µ\82Ä\82¢\82é\82½\82ß */\r
+#define LIB_FN_PUTBLOCK02001   0x0058  /* \90æ\93ª\82Éopt\82Æ\82µ\82Ä0x2001\82ð\92Ç\89Á */\r
+#define LIB_FN_PUTBLOCK03001   0x0058  /* \90æ\93ª\82Éopt\82Æ\82µ\82Ä0x3001\82ð\92Ç\89Á */\r
+#define LIB_FN_DRAWPOINTS0             0x005c  /* \82¨\82µ\82è\82É0x000c\82ð\92Ç\89Á */\r
+#define LIB_FN_OPENSIGNALBOX   0x0060  /* non-malloc\8c^ */\r
+#define LIB_FN_DEFINESIGNAL            0x0068\r
+       /* \81ª0p0\82Ì\8fê\8d\87\82Í\81A\82¨\82µ\82è\82É0\82ð2\82Â\92Ç\89Á */\r
+       /* \81ª1p0\82Ì\8fê\8d\87\82Í\81Asignal\82Ì\91O\82É1\82ð\92Ç\89Á\81Asignal\82Ì\8cã\82ë\82É0\82ð\92Ç\89Á */\r
+#define LIB_FN_OPENTIMER               0x0070\r
+#define LIB_FN_CLOSETIMER              0x0074\r
+#define LIB_FN_SETTIMER                        0x0078\r
+#define LIB_FN_SETTIMERTIME            0x0078\r
+#define LIB_FN_OPENSOUNDTRAK   0x0080\r
+#define LIB_FN_CONTROLFREQ             0x008c\r
+#define LIB_FN_MAPMODULE               0x00c0  /* addr\82Ì\8cã\82ë\82É0x000c\82ð\92Ç\89Á\81Aofs\82Æattr\82Í\91«\82µ\8eZ\82µ\82Ä\88ê\82Â\82É */\r
+#define LIB_FN_UNMAPMODULE             0x00c4  /* addr\82Ì\8cã\82ë\82É0x000c\82ð\92Ç\89Á */\r
+#define LIB_FN_LOADFONTSET             0x00e0  /* \82¨\82µ\82è\82É0x000c\82ð\92Ç\89Á */\r
+#define LIB_FN_LOADFONTSET0            0x00e0\r
+#define LIB_FN_MAKECHARSET             0x00e8\r
+#define LIB_FN_WSJIS2GG00JPN0  0x00ec\r
+       /* \81ª\90æ\93ª\82Éopt\82Æ\82µ\82Ä1\82ð\92Ç\89Á\81Asjis\82Ægg00jpn\82Ì\82¤\82µ\82ë\82É\82»\82ê\82¼\82ê0x000c\82ð\92Ç\89Á */\r
+#define LIB_FN_SEUC2GG00               0x00ec\r
+       /* \81ª\90æ\93ª\82Éopt\82Æ\82µ\82Ä2\82ð\92Ç\89Á\81Aseuc\82Ægg00\82Ì\82¤\82µ\82ë\82É\82»\82ê\82¼\82ê0x000c\82ð\92Ç\89Á */\r
+#define LIB_FN_DRAWLINES0              0x0108  /* \82¨\82µ\82è\82É0x000c\82ð\92Ç\89Á */\r
+#define LIB_FN_CONVLINES               0x010c  /* \82¨\82µ\82è\82É0x000c\82ð\92Ç\89Á */\r
+#define LIB_FN_DRAWLINES1              0x0110  /* \82¨\82µ\82è\82É0x000c\82ð\92Ç\89Á */\r
+#define LIB_FN_RESIZEMODULE            0x0120  /* sig\82Ì\91O\82É1\82ð\92Ç\89Á */\r
+#endif\r
+\r
+#define lib_openwintitle(size, window) \\r
+    lib_opentextbox(0x1000, 0, 0, size, 1, 0, 0, window, 0x00c0, 0)\r
+\r
+#define lib_settimertime_interval(slot, time0, time1) \\r
+    lib_settimertime(0x12, slot, time0, time1, 0)\r
+\r
+#define lib_settimertime_fromnow(slot, time0, time1) \\r
+    lib_settimertime(0x32, slot, time0, time1, 0)\r
+\r
+#define lib_wait_interval(time0, time1) \\r
+    lib_waitsignaltime(0x0007, 0, 0, time0, time1, 0)\r
+\r
+#define lib_wait_fromnow(time0, time1) \\r
+    lib_waitsignaltime(0x000f, 0, 0, time0, time1, 0)\r
+\r
+int lib_imul(signed int a, signed int b, int *h);\r
+int lib_idiv(signed int a, signed int b, int *r);\r
+int lib_imuldiv(signed int a, signed int b, signed int c, int *r);\r
+int lib_imod(signed int a, signed int b, int *q);\r
+\r
+#endif\r