Add tools set

This commit is contained in:
Yourtion
2014-09-04 15:36:35 +08:00
commit 9b5e6f0ced
107 changed files with 2646 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
setvesa 3 0x114
mouseaccel 1 1

BIN
tolset/z_tools/aksa.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/aska.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/bim2bin.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/bim2hrb.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/bin2obj.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/cc1.exe Normal file

Binary file not shown.

View File

@@ -0,0 +1,89 @@
TOOLPATH = ../z_tools/
RULEFILE = ../z_tools/guigui00/guigui00.rul
MAKE = $(TOOLPATH)make.exe -r
SJISCONV = $(TOOLPATH)sjisconv.exe -s
CC1 = $(TOOLPATH)cc1.exe -I$(INCPATH) $(CC1OPT) -Os -Wall -quiet
GAS2NASK = $(TOOLPATH)gas2nask.exe -a
NASK = $(TOOLPATH)nask.exe
OBJ2BIM = $(TOOLPATH)obj2bim.exe
BIM2BIN = $(TOOLPATH)bim2bin.exe
CPP0 = $(TOOLPATH)cpp0.exe -P -I$(INCPATH)
ASKA = $(TOOLPATH)aska.exe
NASKCNV = $(TOOLPATH)naskcnv0.exe -l -s -w
GOLIB = $(TOOLPATH)golib00.exe
LINK = $(TOOLPATH)ld.exe -s -Bdynamic --stack $(STACKSIZE)
EDIMG = $(TOOLPATH)edimg.exe
SARTOL = $(TOOLPATH)sartol.exe
DELE = del
COPY = copy
LIBPATH = $(INCPATH)
LIBS = $(LIBPATH)w32clibc.lib $(LIBPATH)golibc.lib $(LIBPATH)libmingw.lib
# 以上の項目はあなたのディレクトリ構成にあわせて書き換える
ALL:
$(MAKE) $(TARGET).$(MODE)
%.ca : %.c Makefile
$(SJISCONV) $*.c $*.ca
%.gas : %.ca Makefile
$(CC1) -o $*.gas $*.ca
%.nas : %.gas Makefile
$(GAS2NASK) $*.gas $*.nas
%.obj : %.nas Makefile
$(NASK) $*.nas $*.obj
%.ias : %.ask Makefile
$(CPP0) -o $*.ias $*.ask
%.3as : %.ias Makefile
$(ASKA) $*.ias $*.3as
%.nas : %.3as Makefile
$(NASKCNV) $*.3as $*.nas
%.lst : %.nas Makefile
$(NASK) $*.nas $*.obj $*.lst
$(TARGET).bim : $(OBJS) Makefile
$(OBJ2BIM) @$(RULEFILE) out:$(TARGET).bim stack:$(STACKSIZE) map:$(TARGET).map $(OBJS)
%.bin : %.bim Makefile
$(BIM2BIN) in:$*.bim out:$*.org malloc:$(MALLOCSIZE) mmarea:$(MMAREA) $(BIMOPT0)
$(BIM2BIN) -osacmp in:$*.org out:$*.bin $(BIMOPT1)
$(TARGET).lib : $(OBJS) Makefile
$(GOLIB) out:$@ $(OBJS)
$(TARGET).dll : $(TARGET).bim Makefile
$(OBJ2BIM) @$(RULEFILE) out:$(TARGET).bim map:$(TARGET).map $(OBJS)
$(BIM2BIN) -osacmp -tek1 in:$(TARGET).bim out:$(TARGET).dll
$(TARGET).exe : $(OBJS) Makefile
$(LINK) -o $(TARGET).exe -Map $(TARGET).map $(OBJS) $(LIBS)
clean :
-$(DELE) *.obj
-$(DELE) $(TARGET).bim
-$(DELE) $(TARGET).map
-$(DELE) $(TARGET).org
run :
$(MAKE) $(TARGET).$(MODE)
$(COPY) $(TARGET).$(MODE) ..\z_tools\!built.bin
$(MAKE) -C $(TOOLPATH)osa_qemu
$(EDIMG) @$(TOOLPATH)edimgopt.txt $(EDIMGOPT) imgout:../z_tools/qemu/fdimage0.bin
$(MAKE) -C $(TOOLPATH)qemu
arc :
$(MAKE) $(TARGET).$(MODE)
$(SARTOL) e $(ARCORG) . @-4k ARCINFO0.TXT $(ARCFLIES)
$(BIM2BIN) -osacmp in:$(ARCORG) out:$(ARCTEK) $(BIMOPT2)
src_only :
$(MAKE) clean
-$(DELE) $(TARGET).$(MODE)

BIN
tolset/z_tools/comcom.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/cpp0.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/doscmd.exe Normal file

Binary file not shown.

23
tolset/z_tools/dsar.bat Normal file
View File

@@ -0,0 +1,23 @@
@echo off
set dsar_sartol=sartol.exe
set dsar_bpath="%USERPROFILE%/デスクトップ/"
set dsar_autorun="%SystemRoot%\explorer.exe"
rem -例-
rem set dsar_bpath="%USERPROFILE%/デスクトップ/"
rem set dsar_bpath="%USERPROFILE%/デスクトップ"
rem set dsar_bpath=..@arcpath/
rem set dsar_bpath=..@arcpath
rem -例-
rem set dsar_autorun="%SystemRoot%\explorer.exe"
rem set dsar_autorun=
rem 注意dsar_bpathではパスの区切りに\を使うこと
:loop
if %1.==. goto end
%dsar_sartol% d %1 %dsar_bpath% %dsar_autorun%
shift
goto loop
:end

BIN
tolset/z_tools/edimg.exe Normal file

Binary file not shown.

View File

@@ -0,0 +1,5 @@
opt imgin:../z_tools/osa_qemu/osaimgqe.bin
copy from:../z_tools/OSASK0.PSF to:@:
copy from:../z_tools/!built.bin to:@:
opt imgout:../z_tools/qemu/fdimage0.bin

19
tolset/z_tools/esart5.bat Normal file
View File

@@ -0,0 +1,19 @@
@echo off
set esar_sartol=sartol.exe
set esar_bim2bin=bim2bin.exe
set esar_wce=wce.exe
if exist %1.sar goto end
if %2.==. goto all
%esar_wce% %esar_sartol% e %1.sar %1 !1 #b=%1 %2 %3 %4 %5 %6 %7 %8 %9
goto tek5
:all
%esar_wce% %esar_sartol% e %1.sar %1 !1 #b=%1 *
:tek5
%esar_wce% %esar_bim2bin% -osacmp -tek5 in:%1.sar out:%1.sar
:end

BIN
tolset/z_tools/fdimg0at.tek Normal file

Binary file not shown.

BIN
tolset/z_tools/fdimg0tw.tek Normal file

Binary file not shown.

BIN
tolset/z_tools/gas2nask.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/golib00.exe Normal file

Binary file not shown.

View File

@@ -0,0 +1,20 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(ERRNO_H))
#define ERRNO_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
extern int errno;
#define ENOENT 2 /* No such file or directory */
#define ERANGE 34 /* Result too large (or too small) */
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,26 @@
/* copyright(C) 2002 H.Kawai (under KL-01). */
#if (!defined(FLOAT_H))
#define FLOAT_H 1
#define FLT_RADIX 2
#define FLT_ROUNDS 1 /* nearest */
#define FLT_DIG 6
#define FLT_EPSILON 1.19209290e-07F
#define FLT_MANT_DIG 24
#define FLT_MAX 3.40282347e+38F
#define FLT_MAX_EXP (+128)
#define FLT_MIN 1.17549435e-38F
#define FLT_MIN_EXP (-125)
#define DBL_DIG 15
#define DBL_EPSILON 2.2204460492503131e-16
#define DBL_MANT_DIG 53
#define DBL_MAX 1.7976931348623157e+308
#define DBL_MAX_EXP 1024
#define DBL_MIN 2.2250738585072014e-308
#define DBL_MIN_EXP (-1021)
#endif

Binary file not shown.

View File

@@ -0,0 +1,20 @@
format:
/* このセクションでリンクの方針を記述 */
code(align:1, logic:0x48, file:0x48);
data(align:4, logic:stack_end, file:code_end);
file:
/* このセクションでコマンドラインに書ききれなかった
.objファイル、.libファイルを記載 */
/* なお、このセクションはフルパスで書いてもよい。 */
/* 例: c:/osask/gg00libc.lib; */
../z_tools/guigui00/gg00libc.lib;
../z_tools/guigui00/golibc.lib;
label:
/* 必ずリンクしなければいけないラベルを指定 */
/* エントリポイントを指定すればいいと思ってください */
_main;
/* 上記3セクションの順序は入れ替えてはいけません! */

Binary file not shown.

View File

@@ -0,0 +1,586 @@
#ifndef __GUIGUI00_H
#define __GUIGUI00_H
/* gg00lib+ ver.0.8 */
/* gg00lib9をベースにしている */
struct LIB_WORK {
int data[256 / 4];
};
struct LIB_WINDOW {
int data[128 / 4];
};
struct LIB_TEXTBOX {
int data[64 / 4];
};
struct LIB_SIGHNDLREG {
int ES, DS, FS, GS;
int EDI, ESI, EBP, ESP;
int EBX, EDX, ECX, EAX;
int EIP, CS, EFLAGS;
};
struct LIB_GRAPHBOX {
int reserve[64 / 4];
};
struct LIB_LINES1 {
int x0, y0, dx, dy, length, color;
};
struct LIB_LINES0 {
int x0, y0, x1, y1, dummy, color;
};
struct LIB_POINTS {
int x, y, color;
};
//void lib_execcmd(void *EBX);
extern __inline__ void lib_execcmd(void *EBX)
{
__asm__ (" .byte 154 \n\t"
" .byte 0 \n\t"
" .byte 0 \n\t"
" .byte 0 \n\t"
" .byte 0 \n\t"
" .byte 199 \n\t"
" .byte 0 \n\t"
: : "b" (EBX) );
}
void lib_execcmd0(int cmd, ...);
#if 0
extern __inline__ void lib_execcmd0(int cmd, ...)
{
__asm__ (" movl %%esp,%%ebx \n\t"
" .byte 154 \n\t"
" .byte 0 \n\t"
" .byte 0 \n\t"
" .byte 0 \n\t"
" .byte 0 \n\t"
" .byte 199 \n\t"
" .byte 0 \n\t"
: : : "%ebx");
}
#endif
int lib_execcmd1(int ret, int cmd, ...);
int lib_execcmd2(int ret, int cmd, ...);
void *malloc(const unsigned int nbytes);
#if 0
/* 以下の関数はマクロで実現されている(高速化とコンパクト化のため) */
/* 引数の型などが分かりやすいように、関数型宣言を註釈として残してある */
struct LIB_WORK *lib_init(struct LIB_WORK *work);
void lib_init_nm(struct LIB_WORK *work);
struct LIB_WORK *lib_init_am(struct LIB_WORK *work);
void lib_waitsignal(int opt, int signaldw, int nest);
struct LIB_WINDOW *lib_openwindow(struct LIB_WINDOW *window, int slot, int x_size, int y_size);
void lib_openwindow_nm(struct LIB_WINDOW *window, int slot, int x_size, int y_size);
void lib_openwindow_am(struct LIB_WINDOW *window, int slot, int x_size, int y_size);
struct LIB_TEXTBOX *lib_opentextbox(int opt, struct LIB_TEXTBOX *textbox, int backcolor,
int x_size, int y_size, int x_pos, int y_pos, struct LIB_WINDOW *window, int charset,
int init_char);
void lib_opentextbox_nm(int opt, struct LIB_TEXTBOX *textbox, int backcolor, int x_size,
int y_size, int x_pos, int y_pos, struct LIB_WINDOW *window, int charset, int init_char);
void lib_opentextbox_am(int opt, struct LIB_TEXTBOX *textbox, int backcolor, int x_size,
int y_size, int x_pos, int y_pos, struct LIB_WINDOW *window, int charset, int init_char);
void lib_waitsignaltime(int opt, int signaldw, int nest, unsigned int time0, unsigned int time1,
unsigned int time2);
int *lib_opensignalbox(int bytes, int *signalbox, int eos, int rewind);
void lib_opensignalbox_nm(int bytes, int *signalbox, int eos, int rewind);
int *lib_opensignalbox_am(int bytes, int *signalbox, int eos, int rewind);
void lib_definesignal0p0(int opt, int default_assign0, int default_assign1, int default_assign2);
void lib_definesignal1p0(int opt, int default_assign0, int default_assign1,
struct LIB_WINDOW *default_assign2, int signal);
void lib_opentimer(int slot);
void lib_closetimer(int slot);
void lib_settimertime(int opt, int slot, unsigned int time0, unsigned int time1,
unsigned int time2);
void lib_settimer(int opt, int slot);
void lib_opensoundtrack(int slot);
void lib_controlfreq(int slot, int freq);
struct LIB_WINDOW *lib_openwindow1(struct LIB_WINDOW *window, int slot, int x_size, int y_size,
int flags, int base);
void lib_openwindow1_nm(struct LIB_WINDOW *window, int slot, int x_size, int y_size, int flags,
int base);
void lib_openwindow1_am(struct LIB_WINDOW *window, int slot, int x_size, int y_size, int flags,
int base);
void lib_closewindow(int opt, struct LIB_WINDOW *window);
void lib_controlwindow(int opt, struct LIB_WINDOW *window);
void lib_close(int opt);
void lib_loadfontset(int opt, int slot, int len, void *font);
void lib_loadfontset0(int opt, int slot);
void lib_makecharset(int opt, int charset, int fontset, int len, int from, int base);
void lib_drawline(int opt, struct LIB_WINDOW *window, int color, int x0, int y0, int x1, int y1);
void lib_closetextbox(int opt, struct LIB_TEXTBOX *textbox);
void lib_mapmodule(int opt, int slot, int attr, int size, void *addr, int ofs);
void lib_unmapmodule(int opt, int size, void *addr);
void lib_initmodulehandle(int opt, int slot);
void lib_putblock1(struct LIB_WINDOW *win, int x, int y, int sx, int sy, int skip, void *p);
struct LIB_GRAPHBOX *lib_opengraphbox(int opt, struct LIB_GRAPHBOX *gbox, int mode, int mode_opt,
int x_size, int y_size, int x_pos, int y_pos, struct LIB_WINDOW *window);
void lib_opengraphbox_nm(int opt, struct LIB_GRAPHBOX *gbox, int mode, int mode_opt,
int x_size, int y_size, int x_pos, int y_pos, struct LIB_WINDOW *window);
struct LIB_GRAPHBOX *lib_opengraphbox_am(int opt, struct LIB_GRAPHBOX *gbox, int mode, int mode_opt,
int x_size, int y_size, int x_pos, int y_pos, struct LIB_WINDOW *window);
void lib_flushgraphbox(int opt, struct LIB_WINDOW *win, int x, int y, int sx, int sy, int skip,
void *p);
void lib_drawline0(int opt, struct LIB_GRAPHBOX *gbox, int color, int x0, int y0, int x1, int y1);
void lib_drawlines0(int opt, struct LIB_GRAPHBOX *gbox, int x0, int y0, int xsize, int ysize,
int lines, const struct LIB_LINES1 *ofs);
void lib_convlines(int opt, int lines, struct LIB_LINES0 *src, struct LIB_LINES1 *dest);
void lib_initmodulehandle0(int opt, int slot);
void lib_putblock02001(struct LIB_GRAPHBOX *gbox, void *buf, int vx0, int vy0);
struct LIB_GRAPHBOX *lib_opengraphbox2(int opt, struct LIB_GRAPHBOX *gbox, int mode, int mode_opt,
int x_bsize, int y_bsize, int x_vsize, int y_vsize, int x_pos, int y_pos,
struct LIB_WINDOW *window);
void lib_opengraphbox2_nm(int opt, struct LIB_GRAPHBOX *gbox, int mode, int mode_opt,
int x_bsize, int y_bsize, int x_vsize, int y_vsize, int x_pos, int y_pos,
struct LIB_WINDOW *window);
struct LIB_GRAPHBOX *lib_opengraphbox2_am(int opt, struct LIB_GRAPHBOX *gbox, int mode, int mode_opt,
int x_bsize, int y_bsize, int x_vsize, int y_vsize, int x_pos, int y_pos,
struct LIB_WINDOW *window);
void lib_putblock03001(struct LIB_GRAPHBOX *gbox, void *buf, int vx0, int vy0, void *tbuf,
int tbuf_skip, int tcol0);
void lib_drawpoints0(int opt, struct LIB_GRAPHBOX *gbox, int x0, int y0, int xsize, int ysize,
int points, const struct LIB_POINTS *ofs);
void lib_wsjis2gg00jpn0(int len, const char *sjis, int *gg00jpn, int ankbase, int jpnbase);
void lib_loadfontset1(int opt, int slot, int sig);
void lib_drawlines1(int opt, struct LIB_WINDOW *win, int x0, int y0, int xsize, int ysize,
int lines, const struct LIB_LINES1 *ofs);
void lib_drawpoints1(int opt, struct LIB_WINDOW *win, int x0, int y0, int xsize, int ysize,
int points, const struct LIB_POINTS *ofs);
void lib_seuc2gg00(int len, const char *seuc, int *gg00, int ankbase, int rightbase);
void lib_resizemodule(int opt, int slot, int newsize, int sig);
void lib_drawpoint0(int opt, struct LIB_GRAPHBOX *gbox, int color, int x, int y);
const int lib_getrandseed();
void lib_putstring0(int opt, int x_pos, int y_pos, struct LIB_TEXTBOX *textbox,
int color, int bcolor, int len, const int *str);
void lib_putstring1(int opt, int x_pos, int y_pos, struct LIB_TEXTBOX *tbox,
int col, int bcol, int base, int len, const int *str);
#endif
void lib_putstring_ASCII(int opt, int x_pos, int y_pos, struct LIB_TEXTBOX *textbox, int color,
int backcolor, const char *str);
void lib_definesignalhandler(void (*lib_signalhandler)(struct LIB_SIGHNDLREG *));
int lib_readCSb(int offset);
int lib_readCSd(int offset);
int lib_readmodulesize(int slot);
void lib_initmodulehandle1(int slot, int num, int sig);
void lib_steppath0(int opt, int slot, const char *name, int sig);
int lib_decodel2d3(int size, int src_ofs, int src_sel, int dest_ofs, int dest_sel);
void lib_putstring_SJIS0(int opt, int x_pos, int y_pos, struct LIB_TEXTBOX *textbox,
int color, int backcolor, const char *str);
int lib_decodetek0(int size, int src_ofs, int src_sel, int dest_ofs, int dest_sel);
void lib_settimertime2(int opt, int slot0, int slot1, unsigned int *time);
#define lib_init(work) \
(struct LIB_WORK *) lib_execcmd2(1 * 4 + 4, 0x0004, \
(work) ? (void *) (work) : malloc(sizeof (struct LIB_WORK)), 0x0000)
#define lib_init_nm(work) \
lib_execcmd0(0x0004, (void *) (work), 0x0000)
#define lib_init_am(work) \
(struct LIB_WORK *) lib_execcmd2(1 * 4 + 4, 0x0004, \
malloc(sizeof (struct LIB_WORK)), 0x0000)
#define lib_waitsignal(opt, signaldw, nest) \
lib_execcmd0(0x0018, (int) (opt), (int) (signaldw), (int) (nest), 0x0000)
#define lib_openwindow(window, slot, x_size, y_size) \
(struct LIB_WINDOW *) lib_execcmd2(1 * 4 + 4, 0x0020, \
(window) ? (void *) (window) : malloc(sizeof (struct LIB_WINDOW)), \
(int) (slot), (int) (x_size), (int) (y_size), 0x0000)
#define lib_openwindow_nm(window, slot, x_size, y_size) \
lib_execcmd0(0x0020, (void *) (window), (int) (slot), (int) (x_size), \
(int) (y_size), 0x0000)
#define lib_openwindow_am(window, slot, x_size, y_size) \
(struct LIB_WINDOW *) lib_execcmd2(1 * 4 + 4, 0x0020, \
malloc(sizeof (struct LIB_WINDOW)), \
(int) (slot), (int) (x_size), (int) (y_size), 0x0000)
#define lib_opentextbox(opt, textbox, backcolor, x_size, y_size, x_pos, y_pos, window, charset, init_char) \
(struct LIB_TEXTBOX *) lib_execcmd2(2 * 4 + 4, 0x0028, (int) (opt), \
(textbox) ? (void *) (textbox) : malloc(sizeof (struct LIB_TEXTBOX) + 8 * (x_size) * (y_size)), \
(int) (backcolor), (int) (x_size), (int) (y_size), (int) (x_pos), \
(int) (y_pos), (void *) (window), (int) (charset), (int) (init_char), \
0x0000)
#define lib_opentextbox_nm(opt, textbox, backcolor, x_size, y_size, x_pos, y_pos, window, charset, init_char) \
lib_execcmd0(0x0028, (int) (opt), (void *) (textbox), (int) (backcolor), \
(int) (x_size), (int) (y_size), (int) (x_pos), (int) (y_pos), \
(void *) (window), (int) (charset), (int) (init_char), 0x0000)
#define lib_opentextbox_am(opt, textbox, backcolor, x_size, y_size, x_pos, y_pos, window, charset, init_char) \
(struct LIB_TEXTBOX *) lib_execcmd2(2 * 4 + 4, 0x0028, (int) (opt), \
malloc(sizeof (struct LIB_TEXTBOX) + 8 * (x_size) * (y_size)), \
(int) (backcolor), (int) (x_size), (int) (y_size), (int) (x_pos), \
(int) (y_pos), (void *) (window), (int) (charset), (int) (init_char), \
0x0000)
#define lib_waitsignaltime(opt, signaldw, nest, time0, time1, time2) \
lib_execcmd0(0x0018, (int) (opt), (int) (signaldw), (int) (nest), \
(int) (time0), (int) (time1), (int) (time2), 0x0000)
#define lib_opensignalbox(bytes, signalbox, eos, rewind) \
(int *) lib_execcmd2(2 * 4 + 4, 0x0060, (int) (bytes), \
(signalbox) ? (void *) (signalbox) : malloc(bytes), (int) (eos), \
(int) (rewind), 0x0000)
#define lib_opensignalbox_nm(bytes, signalbox, eos, rewind) \
lib_execcmd0(0x0060, (int) (bytes), (void *) (signalbox), (int) (eos), \
(int) (rewind), 0x0000)
#define lib_opensignalbox_am(bytes, signalbox, eos, rewind) \
(int *) lib_execcmd2(2 * 4 + 4, 0x0060, (int) (bytes), \
malloc(bytes), (int) (eos), (int) (rewind), 0x0000)
#define lib_definesignal0p0(opt, default_assign0, default_assign1, default_assign2) \
lib_execcmd0(0x0068, (int) (opt), (int) (default_assign0), \
(int) (default_assign1), (int) (default_assign2), 0, 0, 0x0000)
#define lib_definesignal1p0(opt, default_assign0, default_assign1, default_assign2, signal) \
lib_execcmd0(0x0068, (int) (opt), (int) (default_assign0), \
(int) (default_assign1), (int) (default_assign2), 1, (int) (signal), \
0, 0x0000)
#define lib_opentimer(slot) \
lib_execcmd0(0x0070, (int) (slot), 0x0000)
#define lib_closetimer(slot) \
lib_execcmd0(0x0074, (int) (slot), 0x0000)
#define lib_settimertime(opt, slot, time0, time1, time2) \
lib_execcmd0(0x0078, (int) (opt), (int) (slot), (int) (time0), \
(int) (time1), (int) (time2), 0x0000)
#define lib_settimer(opt, slot) \
lib_execcmd0(0x0078, (int) (opt), (int) (slot), 0x0000)
#define lib_opensoundtrack(slot) \
lib_execcmd0(0x0080, (int) (slot), 0, 0x0000)
#define lib_controlfreq(slot, freq) \
lib_execcmd0(0x008c, (int) (slot), (int) (freq), 0x0000)
#define lib_openwindow1(window, slot, x_size, y_size, flags, base) \
(struct LIB_WINDOW *) lib_execcmd2(1 * 4 + 4, 0x0020, \
(window) ? (void *) (window) : malloc(sizeof (struct LIB_WINDOW)), \
(int) (slot) | 0x01, (int) (x_size), (int) (y_size), \
0x01 | (int) (flags) << 8, (int) (base), 0x0000)
#define lib_openwindow1_nm(window, slot, x_size, y_size, flags, base) \
lib_execcmd0(0x0020, (void *) (window), (int) (slot) | 0x01, \
(int) (x_size), (int) (y_size), 0x01 | (int) (flags) << 8, (int) (base), \
0x0000)
#define lib_openwindow1_am(window, slot, x_size, y_size, flags, base) \
(struct LIB_WINDOW *) lib_execcmd2(1 * 4 + 4, 0x0020, \
malloc(sizeof (struct LIB_WINDOW)), \
(int) (slot) | 0x01, (int) (x_size), (int) (y_size), \
0x01 | (int) (flags) << 8, (int) (base), 0x0000)
#define lib_closewindow(opt, window) \
lib_execcmd0(0x0024, (int) (opt), (void *) (window), 0x0000)
#define lib_controlwindow(opt, window) \
lib_execcmd0(0x003c, (int) (opt), (void *) (window), 0x0000)
#define lib_close(opt) \
lib_execcmd0(0x0008, (int) (opt), 0x0000)
#define lib_loadfontset(opt, slot, len, font) \
lib_execcmd0(0x00e0, (int) (opt), (int) (slot), (int) (len), (int) (font), \
0x000c, 0x0000)
#define lib_loadfontset0(opt, slot) \
lib_execcmd0(0x00e0, (int) (opt), (int) (slot), 0x0000)
#define lib_loadfontset1(opt, slot, sig) \
lib_execcmd0(0x00e0, (int) (opt), (int) (slot), 1, (int) (sig), 0x0000)
#define lib_makecharset(opt, charset, fontset, len, from, base) \
lib_execcmd0(0x00e8, (int) (opt), (int) (charset), (int) (fontset), \
(int) (len), (int) (from), (int) (base), 0x0000)
#define lib_drawline(opt, window, color, x0, y0, x1, y1) \
lib_execcmd0(0x0044, (int) (opt), (void *) (window), (int) (color), \
(int) (x0), (int) (y0), (int) (x1), (int) (y1), 0x0000)
#define lib_closetextbox(opt, textbox) \
lib_execcmd0(0x002c, (int) (opt), (int) (textbox), 0x0000)
#define lib_mapmodule(opt, slot, attr, size, addr, ofs) \
lib_execcmd0(0x00c0, (int) (opt), (int) (slot), (int) (size), \
(void *) (addr), 0x000c, (int) ((ofs) | (attr)), 0x0000)
#define lib_unmapmodule(opt, size, addr) \
lib_execcmd0(0x00c4, (int) (opt), (int) (size), (void *) (addr), 0x000c, \
0x0000)
#define lib_initmodulehandle(opt, slot) \
lib_execcmd0(0x00a0, (int) (opt), (int) (slot), 0x0000)
#define lib_putblock1(win, x, y, sx, sy, skip, p) \
lib_execcmd0(0x004c, 1, (void *) (win), (int) (x), (int) (y), (int) (sx), \
(int) (sy), (int) (skip), (void *) (p), 0x000c, 0x0000)
#define lib_opengraphbox(opt, graphbox, mode, mode_opt, x_size, y_size, x_pos, y_pos, window) \
(struct LIB_GRAPHBOX *) lib_execcmd2(2 * 4 + 4, 0x0030, (int) (opt), \
(graphbox) ? (void *) (graphbox) : malloc(sizeof (struct LIB_GRAPHBOX) + (x_size) * (y_size) * ((mode) & 0xf)), \
(int) (mode), (int) (mode_opt), (int) (x_size), (int) (y_size), \
(int) (x_pos), (int) (y_pos), (void *) (window), 0x0000)
#define lib_opengraphbox_nm(opt, graphbox, mode, mode_opt, x_size, y_size, x_pos, y_pos, window) \
lib_execcmd0(0x0030, (int) (opt), (void *) (graphbox), \
(int) (mode), (int) (mode_opt), (int) (x_size), (int) (y_size), \
(int) (x_pos), (int) (y_pos), (void *) (window), 0x0000)
#define lib_opengraphbox_am(opt, graphbox, mode, mode_opt, x_size, y_size, x_pos, y_pos, window) \
(struct LIB_GRAPHBOX *) lib_execcmd2(2 * 4 + 4, 0x0030, (int) (opt), \
malloc(sizeof (struct LIB_GRAPHBOX) + (x_size) * (y_size) * ((mode) & 0xf)), \
(int) (mode), (int) (mode_opt), (int) (x_size), (int) (y_size), \
(int) (x_pos), (int) (y_pos), (void *) (window), 0x0000)
#define lib_flushgraphbox(opt, win, x, y, sx, sy, skip, p) \
lib_execcmd0(0x004c, opt, (void *) (win), (int) (x), (int) (y), (int) (sx), \
(int) (sy), (int) (skip), (void *) (p), 0x000c, 0x0000)
#define lib_drawline0(opt, gbox, color, x0, y0, x1, y1) \
lib_execcmd0(0x0054, (int) (opt), (void *) (gbox), (int) (color), \
(int) (x0), (int) (y0), (int) (x1), (int) (y1), 0x0000)
#define lib_drawlines0(opt, gbox, x0, y0, xsize, ysize, lines, ofs) \
lib_execcmd0(0x0108, (int) (opt), (void *) (gbox), (int) (x0), \
(int) (y0), (int) (xsize), (int) (ysize), (int) (lines), (void *) (ofs), \
0x000c, 0x0000)
#define lib_convlines(opt, lines, src, dest) \
lib_execcmd0(0x010c, (int) (opt), (int) (lines), \
(struct LIB_LINES0 *) (src), 0x000c, (struct LIB_LINES1 *) (dest), \
0x000c, 0x0000)
#define lib_initmodulehandle0(opt, slot) \
lib_execcmd0(0x00a0, (int) (opt), (int) (slot), 0x0000)
#define lib_putblock02001(gbox, buf, vx0, vy0) \
lib_execcmd0(0x0058, 0x2001, (void *) (gbox), (void *) (buf), \
(int) (vx0), (int) (vy0), 0x0000)
#define lib_opengraphbox2(opt, graphbox, mode, mode_opt, x_bsize, y_bsize, \
x_vsize, y_vsize, x_pos, y_pos, window) \
(struct LIB_GRAPHBOX *) lib_execcmd2(2 * 4 + 4, 0x0030, (int) (opt), \
(graphbox) ? (void *) (graphbox) : malloc(sizeof (struct LIB_GRAPHBOX) + (x_bsize) * (y_bsize) * ((mode) & 0xf)), \
(int) (mode), (int) (mode_opt), (int) (x_bsize), (int) (y_bsize), \
(int) (x_vsize), (int) (y_vsize), (int) (x_pos), (int) (y_pos), \
(void *) (window), 0x0000)
#define lib_opengraphbox2_nm(opt, graphbox, mode, mode_opt, x_bsize, y_bsize, \
x_vsize, y_vsize, x_pos, y_pos, window) \
lib_execcmd0(0x0030, (int) (opt), (void *) (graphbox), \
(int) (mode), (int) (mode_opt), (int) (x_bsize), (int) (y_bsize), \
(int) (x_vsize), (int) (y_vsize), (int) (x_pos), (int) (y_pos), \
(void *) (window), 0x0000)
#define lib_opengraphbox2_am(opt, graphbox, mode, mode_opt, x_bsize, y_bsize, \
x_vsize, y_vsize, x_pos, y_pos, window) \
(struct LIB_GRAPHBOX *) lib_execcmd2(2 * 4 + 4, 0x0030, (int) (opt), \
malloc(sizeof (struct LIB_GRAPHBOX) + (x_bsize) * (y_bsize) * ((mode) & 0xf)), \
(int) (mode), (int) (mode_opt), (int) (x_bsize), (int) (y_bsize), \
(int) (x_vsize), (int) (y_vsize), (int) (x_pos), (int) (y_pos), \
(void *) (window), 0x0000)
#define lib_putblock03001(gbox, buf, vx0, vy0, tbuf, tbuf_skip, tcol0) \
lib_execcmd0(0x0058, 0x3001, (void *) (gbox), (void *) (buf), \
(int) (vx0), (int) (vy0), (void *) (tbuf), (int) (tbuf_skip), \
(int) (tcol0), 0x0000)
#define lib_drawpoints0(opt, gbox, x0, y0, xsize, ysize, points, ofs) \
lib_execcmd0(0x005c, (int) (opt), (void *) (gbox), (int) (x0), \
(int) (y0), (int) (xsize), (int) (ysize), (int) (points), (void *) (ofs), \
0x000c, 0x0000)
#define lib_wsjis2gg00jpn0(len, sjis, gg00jpn, ankbase, jpnbase) \
lib_execcmd0(0x00ec, 0x0001, (int) (len), (void *) (sjis), 0x000c, \
(int *) (gg00jpn), 0x000c, (int) (ankbase), (int) (jpnbase), 0x0000)
#define lib_drawlines1(opt, win, x0, y0, xsize, ysize, lines, ofs) \
lib_execcmd0(0x0110, (int) (opt), (void *) (win), (int) (x0), \
(int) (y0), (int) (xsize), (int) (ysize), (int) (lines), (void *) (ofs), \
0x000c, 0x0000)
#define lib_drawpoints1(opt, win, x0, y0, xsize, ysize, points, ofs) \
lib_execcmd0(0x0050, (int) (opt), (void *) (win), (int) (x0), \
(int) (y0), (int) (xsize), (int) (ysize), (int) (points), (void *) (ofs), \
0x000c, 0x0000)
#define lib_seuc2gg00(len, seuc, gg00, ankbase, rightbase) \
lib_execcmd0(0x00ec, 0x0002, (int) (len), (void *) (seuc), 0x000c, \
(int *) (gg00), 0x000c, (int) (ankbase), (int) (rightbase), 0x0000)
#define lib_resizemodule(opt, slot, newsize, sig) \
lib_execcmd0(0x0120, 0x0000, (int) (slot), (int) (newsize), 1, \
(int) (sig), 0x0000)
#define lib_drawpoint0(opt, gbox, color, x, y) \
lib_execcmd0(0x0054, (int) (opt), (void *) (gbox), (int) (color), \
(int) (x), (int) (y), (int) (x), (int) (y), 0x0000)
#define lib_getrandseed() \
lib_execcmd2(2 * 4 + 4, 0x0118, (int) 0, (int) 0, (int) 0x0000)
#define lib_putstring0(opt, x_pos, y_pos, textbox, color, bcolor, len, str) \
lib_execcmd0(0x0040, (int) (opt) | 0x4000, (int) (x_pos), (int) (y_pos), \
(void *) (textbox), (int) (color), (int) (bcolor), (int) (len), \
(void *) (str), (int) 0x000c, 0x0000)
#define lib_putstring1(opt, x_pos, y_pos, tbox, col, bcol, base, len, str) \
lib_execcmd0(0x0040, (int) (opt) | 0x4000, (int) (x_pos), (int) (y_pos), \
(void *) (tbox), (int) (col), (int) (bcol), (int) (base), (int) (len), \
(void *) (str), (int) 0x000c, 0x0000)
/* <guigui00.h>改良計画のための追記 */
//void lib_initsignalbox0_256(int rewind);
//void lib_initsignalbox0_4k(int rewind);
//void lib_initsignalbox0_64k(int rewind);
extern int lib_work256[256 / 4];
extern int lib_sigrwd_256, *lib_sigptr_256, lib_sigbox_256[256 / 4];
extern int lib_sigrwd_4k, *lib_sigptr_4k, lib_sigbox_4k[4096 / 4];
extern int lib_sigrwd_64k, *lib_sigptr_64k, lib_sigbox_64k[65536 / 4];
int lib_getsig0w(int *sigbox);
int lib_getsig0(int *sigbox);
int lib_getsig1w(int *sigbox);
int lib_getsig1(int *sigbox);
extern int lib_initsignalbox0_256d[1];
extern __inline__ void lib_initsignalbox0_256(int rewind)
{
__asm__ (" movl $_lib_initsignalbox0_256d,%%ebx\n\t" \
" movl %0,24(%%ebx) \n\t" \
" .byte 154 \n\t" \
" .byte 0 \n\t" \
" .byte 0 \n\t" \
" .byte 0 \n\t" \
" .byte 0 \n\t" \
" .byte 199 \n\t" \
" .byte 0 \n\t" \
: : "r" (rewind) : "%ebx" );
}
extern int lib_initsignalbox0_4kd[1];
extern __inline__ void lib_initsignalbox0_4k(int rewind)
{
__asm__ (" movl $_lib_initsignalbox0_4kd,%%ebx \n\t" \
" movl %0,24(%%ebx) \n\t" \
" .byte 154 \n\t" \
" .byte 0 \n\t" \
" .byte 0 \n\t" \
" .byte 0 \n\t" \
" .byte 0 \n\t" \
" .byte 199 \n\t" \
" .byte 0 \n\t" \
: : "r" (rewind) : "%ebx" );
}
extern int lib_initsignalbox0_64kd[1];
extern __inline__ void lib_initsignalbox0_64k(int rewind)
{
__asm__ (" movl $_lib_initsignalbox0_64kd,%%ebx\n\t" \
" movl %0,24(%%ebx) \n\t" \
" .byte 154 \n\t" \
" .byte 0 \n\t" \
" .byte 0 \n\t" \
" .byte 0 \n\t" \
" .byte 0 \n\t" \
" .byte 199 \n\t" \
" .byte 0 \n\t" \
: : "r" (rewind) : "%ebx" );
}
#if (!defined(LIB_FN_INIT))
/* function-number */
#define LIB_FN_INIT 0x0004 /* non-malloc型 */
#define LIB_FN_CLOSE 0x0008
#define LIB_FN_WAITSIGNAL 0x0018
#define LIB_FN_WAITSIGNALTIME 0x0018
#define LIB_FN_OPENWINDOW 0x0020 /* non-malloc型 */
#define LIB_FN_OPENWINDOW1 0x0020 /* non-malloc型 */
/* ↑slotのところに1を足す、flagsのところは256倍してさらに1を足す */
#define LIB_FN_CLOSEWINDOW 0x0024
#define LIB_FN_OPENTEXTBOX 0x0028 /* non-malloc型 */
#define LIB_FN_CLOSETEXTBOX 0x002c
#define LIB_FN_OPENGRAPHBOX 0x0030 /* non-malloc型 */
#define LIB_FN_OPENGRAPHBOX2 0x0030 /* non-malloc型 */
#define LIB_FN_CONTROLWINDOW 0x003c
#define LIB_FN_PUTSTRING 0x0040
/* ↑普通に使うならoptに0x4000を足す */
/* ↑テキスト埋め込みをやるなら0x4000は足さない */
#define LIB_FN_DRAWLINE 0x0044
#define LIB_FN_FLUSHGRAPHBOX 0x004c /* おしりに0x000cを追加 */
#define LIB_FN_PUTBLOCK1 0x004c /* 先頭にoptとして1を追加、さらにおしりに0x000cを追加 */
#define LIB_FN_DRAWPOINTS1 0x0050 /* おしりに0x000cを追加 */
#define LIB_FN_DRAWLINE0 0x0054
#define LIB_FN_DRAWPOINT0 0x0054
/* ↑xとyのあとに、またxとyを追加実はDRAWLINE0でごまかしているため */
#define LIB_FN_PUTBLOCK02001 0x0058 /* 先頭にoptとして0x2001を追加 */
#define LIB_FN_PUTBLOCK03001 0x0058 /* 先頭にoptとして0x3001を追加 */
#define LIB_FN_DRAWPOINTS0 0x005c /* おしりに0x000cを追加 */
#define LIB_FN_OPENSIGNALBOX 0x0060 /* non-malloc型 */
#define LIB_FN_DEFINESIGNAL 0x0068
/* ↑0p0の場合は、おしりに0を2つ追加 */
/* ↑1p0の場合は、signalの前に1を追加、signalの後ろに0を追加 */
#define LIB_FN_OPENTIMER 0x0070
#define LIB_FN_CLOSETIMER 0x0074
#define LIB_FN_SETTIMER 0x0078
#define LIB_FN_SETTIMERTIME 0x0078
#define LIB_FN_OPENSOUNDTRAK 0x0080
#define LIB_FN_CONTROLFREQ 0x008c
#define LIB_FN_MAPMODULE 0x00c0 /* addrの後ろに0x000cを追加、ofsとattrは足し算して一つに */
#define LIB_FN_UNMAPMODULE 0x00c4 /* addrの後ろに0x000cを追加 */
#define LIB_FN_LOADFONTSET 0x00e0 /* おしりに0x000cを追加 */
#define LIB_FN_LOADFONTSET0 0x00e0
#define LIB_FN_MAKECHARSET 0x00e8
#define LIB_FN_WSJIS2GG00JPN0 0x00ec
/* ↑先頭にoptとして1を追加、sjisとgg00jpnのうしろにそれぞれ0x000cを追加 */
#define LIB_FN_SEUC2GG00 0x00ec
/* ↑先頭にoptとして2を追加、seucとgg00のうしろにそれぞれ0x000cを追加 */
#define LIB_FN_DRAWLINES0 0x0108 /* おしりに0x000cを追加 */
#define LIB_FN_CONVLINES 0x010c /* おしりに0x000cを追加 */
#define LIB_FN_DRAWLINES1 0x0110 /* おしりに0x000cを追加 */
#define LIB_FN_RESIZEMODULE 0x0120 /* sigの前に1を追加 */
#endif
#define lib_openwintitle(size, window) \
lib_opentextbox(0x1000, 0, 0, size, 1, 0, 0, window, 0x00c0, 0)
#define lib_settimertime_interval(slot, time0, time1) \
lib_settimertime(0x12, slot, time0, time1, 0)
#define lib_settimertime_fromnow(slot, time0, time1) \
lib_settimertime(0x32, slot, time0, time1, 0)
#define lib_wait_interval(time0, time1) \
lib_waitsignaltime(0x0007, 0, 0, time0, time1, 0)
#define lib_wait_fromnow(time0, time1) \
lib_waitsignaltime(0x000f, 0, 0, time0, time1, 0)
int lib_imul(signed int a, signed int b, int *h);
int lib_idiv(signed int a, signed int b, int *r);
int lib_imuldiv(signed int a, signed int b, signed int c, int *r);
int lib_imod(signed int a, signed int b, int *q);
#endif

View File

@@ -0,0 +1,20 @@
format:
/* このセクションでリンクの方針を記述 */
code(align:1, logic:0x48, file:0x48);
data(align:4, logic:stack_end, file:code_end);
file:
/* このセクションでコマンドラインに書ききれなかった
.objファイル、.libファイルを記載 */
/* なお、このセクションはフルパスで書いてもよい。 */
/* 例: c:/osask/gg00libc.lib; */
../z_tools/guigui00/gg00libc.lib;
../z_tools/guigui00/golibc.lib;
label:
/* 必ずリンクしなければいけないラベルを指定 */
/* エントリポイントを指定すればいいと思ってください */
_OsaskMain;
/* 上記3セクションの順序は入れ替えてはいけません! */

View File

@@ -0,0 +1,23 @@
/* copyright(C) 2002 H.Kawai (under KL-01). */
#if (!defined(LIMITS_H))
#define LIMITS_H 1
#define CHAR_BIT 8
#define CHAR_MAX (+127)
#define CHAR_MIN 0
#define INT_MAX (+0x7fffffff)
#define INT_MIN (-0x7fffffff)
#define LONG_MAX INT_MAX
#define LONG_MIN INT_MIN
#define SCHAR_MAX (+127)
#define SCHAR_MIN (-127)
#define SHRT_MAX (+0x7fff)
#define SHRT_MIN (-0x7fff)
#define UCHAR_MAX (+0xff)
#define UINT_MAX (+0xffffffff)
#define ULONG_MAX UINT_MAX
#define USHRT_MAX (+0xffff)
#endif

View File

@@ -0,0 +1,42 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(MATH_H))
#define MATH_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
double sin(double);
double cos(double);
double sqrt(double);
double ldexp(double x, int n);
double frexp(double x, int *exp);
extern __inline__ double sin(double x)
{
double res;
__asm__ ("fsin" : "=t" (res) : "0" (x));
return res;
}
extern __inline__ double cos(double x)
{
double res;
__asm__ ("fcos" : "=t" (res) : "0" (x));
return res;
}
extern __inline__ double sqrt(double x)
{
double res;
__asm__ ("fsqrt" : "=t" (res) : "0" (x));
return res;
}
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,20 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(SETJMP_H))
#define SETJMP_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
typedef int jmp_buf[3]; /* EBP, EIP, ESP */
#define setjmp(env) __builtin_setjmp(env)
#define longjmp(env, val) __builtin_longjmp(env, val)
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,21 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(STDARG_H))
#define STDARG_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
#define va_start(v,l) __builtin_stdarg_start((v),l)
#define va_end __builtin_va_end
#define va_arg __builtin_va_arg
#define va_copy(d,s) __builtin_va_copy((d),(s))
#define va_list __builtin_va_list
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,17 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(STDDEF_H))
#define STDDEF_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
typedef unsigned int size_t;
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(STDIO_H))
#define STDIO_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
#if (!defined(NULL))
#define NULL ((void *) 0)
#endif
#include <stdarg.h>
int sprintf(char *s, const char *format, ...);
int vsprintf(char *s, const char *format, va_list arg);
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,34 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(STDLIB_H))
#define STDLIB_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
#include <stddef.h> /* size_t */
#define RAND_MAX 0x7fff
#define srand(seed) (void) (rand_seed = (seed))
int abs(int n);
double atof(const char *s);
int atoi(const char *s);
void qsort(void *base, size_t n, size_t size,
int (*cmp)(const void *, const void *));
int rand(void);
extern unsigned int rand_seed;
double strtod(const char *s, const char **endp);
long strtol(const char *s, const char **endp, int base);
unsigned long strtoul(const char *s, const char **endp, int base);
void *malloc(unsigned int nbytes);
void free(void *ap);
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,38 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(STRING_H))
#define STRING_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
#include <stddef.h> /* size_t */
char *strcpy(char *s, const char *ct);
char *strncpy(char *s, const char *ct, size_t n);
char *strcat(char *s, const char *ct);
char *strncat(char *s, const char *ct, size_t n);
int strcmp(const char *cs, const char *ct);
int strncmp(const char *cs, const char *ct, size_t n);
char *strchr(const char *cs, int c);
char *strrchr(const char *cs, int c);
size_t strspn(const char *s, const char *accept);
size_t strcspn(const char *s, const char *reject);
char *strpbrk(const char *s, const char *accept);
char *strstr(const char *cs, const char *ct);
size_t strlen(const char *cs);
void *memcpy(void *s, const void *ct, size_t n);
void *memmove(void *s, const void *ct, size_t n);
int memcmp(const void *cs, const void *ct, size_t n);
void *memchr(const void *cs, int c, size_t n);
void *memset(void *s, int c, size_t n);
char *strdup(const char *s);
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,20 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(ERRNO_H))
#define ERRNO_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
extern int errno;
#define ENOENT 2 /* No such file or directory */
#define ERANGE 34 /* Result too large (or too small) */
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,26 @@
/* copyright(C) 2002 H.Kawai (under KL-01). */
#if (!defined(FLOAT_H))
#define FLOAT_H 1
#define FLT_RADIX 2
#define FLT_ROUNDS 1 /* nearest */
#define FLT_DIG 6
#define FLT_EPSILON 1.19209290e-07F
#define FLT_MANT_DIG 24
#define FLT_MAX 3.40282347e+38F
#define FLT_MAX_EXP (+128)
#define FLT_MIN 1.17549435e-38F
#define FLT_MIN_EXP (-125)
#define DBL_DIG 15
#define DBL_EPSILON 2.2204460492503131e-16
#define DBL_MANT_DIG 53
#define DBL_MAX 1.7976931348623157e+308
#define DBL_MAX_EXP 1024
#define DBL_MIN 2.2250738585072014e-308
#define DBL_MIN_EXP (-1021)
#endif

Binary file not shown.

View File

@@ -0,0 +1,19 @@
format:
/* このセクションでリンクの方針を記述 */
code(align:1, logic:0x24, file:0x24);
data(align:4, logic:stack_end, file:code_end);
file:
/* このセクションでコマンドラインに書ききれなかった
.objファイル、.libファイルを記載 */
/* なお、このセクションはフルパスで書いてもよい。 */
/* 例: c:/osask/gg00libc.lib; */
../z_tools/haribote/harilibc.lib;
../z_tools/haribote/golibc.lib;
label:
/* 必ずリンクしなければいけないラベルを指定 */
/* エントリポイントを指定すればいいと思ってください */
_HariStartup;
/* 上記3セクションの順序は入れ替えてはいけません! */

Binary file not shown.

View File

@@ -0,0 +1,23 @@
/* copyright(C) 2002 H.Kawai (under KL-01). */
#if (!defined(LIMITS_H))
#define LIMITS_H 1
#define CHAR_BIT 8
#define CHAR_MAX (+127)
#define CHAR_MIN 0
#define INT_MAX (+0x7fffffff)
#define INT_MIN (-0x7fffffff)
#define LONG_MAX INT_MAX
#define LONG_MIN INT_MIN
#define SCHAR_MAX (+127)
#define SCHAR_MIN (-127)
#define SHRT_MAX (+0x7fff)
#define SHRT_MIN (-0x7fff)
#define UCHAR_MAX (+0xff)
#define UINT_MAX (+0xffffffff)
#define ULONG_MAX UINT_MAX
#define USHRT_MAX (+0xffff)
#endif

View File

@@ -0,0 +1,42 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(MATH_H))
#define MATH_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
double sin(double);
double cos(double);
double sqrt(double);
double ldexp(double x, int n);
double frexp(double x, int *exp);
extern __inline__ double sin(double x)
{
double res;
__asm__ ("fsin" : "=t" (res) : "0" (x));
return res;
}
extern __inline__ double cos(double x)
{
double res;
__asm__ ("fcos" : "=t" (res) : "0" (x));
return res;
}
extern __inline__ double sqrt(double x)
{
double res;
__asm__ ("fsqrt" : "=t" (res) : "0" (x));
return res;
}
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,20 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(SETJMP_H))
#define SETJMP_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
typedef int jmp_buf[3]; /* EBP, EIP, ESP */
#define setjmp(env) __builtin_setjmp(env)
#define longjmp(env, val) __builtin_longjmp(env, val)
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,21 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(STDARG_H))
#define STDARG_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
#define va_start(v,l) __builtin_stdarg_start((v),l)
#define va_end __builtin_va_end
#define va_arg __builtin_va_arg
#define va_copy(d,s) __builtin_va_copy((d),(s))
#define va_list __builtin_va_list
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,17 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(STDDEF_H))
#define STDDEF_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
typedef unsigned int size_t;
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,24 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(STDIO_H))
#define STDIO_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
#if (!defined(NULL))
#define NULL ((void *) 0)
#endif
#include <stdarg.h>
int sprintf(char *s, const char *format, ...);
int vsprintf(char *s, const char *format, va_list arg);
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,38 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(STRING_H))
#define STRING_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
#include <stddef.h> /* size_t */
char *strcpy(char *s, const char *ct);
char *strncpy(char *s, const char *ct, size_t n);
char *strcat(char *s, const char *ct);
char *strncat(char *s, const char *ct, size_t n);
int strcmp(const char *cs, const char *ct);
int strncmp(const char *cs, const char *ct, size_t n);
char *strchr(const char *cs, int c);
char *strrchr(const char *cs, int c);
size_t strspn(const char *s, const char *accept);
size_t strcspn(const char *s, const char *reject);
char *strpbrk(const char *s, const char *accept);
char *strstr(const char *cs, const char *ct);
size_t strlen(const char *cs);
void *memcpy(void *s, const void *ct, size_t n);
void *memmove(void *s, const void *ct, size_t n);
int memcmp(const void *cs, const void *ct, size_t n);
void *memchr(const void *cs, int c, size_t n);
void *memset(void *s, int c, size_t n);
char *strdup(const char *s);
#if (defined(__cplusplus))
}
#endif
#endif

BIN
tolset/z_tools/imgtol.com Normal file

Binary file not shown.

BIN
tolset/z_tools/ld.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/make.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/makefont.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/nask.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/naskcnv0.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/nothing.com Normal file

Binary file not shown.

BIN
tolset/z_tools/obj2bim.exe Normal file

Binary file not shown.

View File

@@ -0,0 +1,21 @@
MAKE = ..\make.exe -r
OSALINK = ..\osalink1.exe
MV = ren
EDIMG = ..\edimg.exe
RM = del
ALL :
$(MAKE) osaimgqe.bin
osask_qe.exe : Makefile OSASK.EXE timerdrv.tek osalink1.opt
-$(RM) osask_qe.exe
$(MV) OSASK.EXE osask_at.exe
$(OSALINK)
$(MV) osask.exe osask_qe.exe
$(MV) osask_at.exe OSASK.EXE
osask_qe.sys : Makefile osask_qe.exe
$(EDIMG) binin:osask_qe.exe exe2bin seg:2048 binout:osask_qe.sys
osaimgqe.bin : Makefile OSAIMGAT.BIN osask_qe.sys
$(EDIMG) @edimgopt.txt

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,2 @@
setvesa 3 0x114
mouseaccel 1 1

View File

@@ -0,0 +1,4 @@
opt imgin:OSAIMGAT.BIN
ovrcopy from:osask_qe.sys to:@:OSASK.SYS
copy from:OSASK0.PSF to:@:
opt imgout:osaimgqe.bin

View File

@@ -0,0 +1,9 @@
..\nothing.com
del osask_at.exe
del osask_qe.exe
ren OSASK.EXE osask_at.exe
..\osalink1.exe
ren osask.exe osask_qe.exe
ren osask_at.exe OSASK.EXE
..\imgtol.com s osask_qe.exe osask_qe.sys 2048
..\edimg.exe @edimgopt.txt

View File

@@ -0,0 +1,2 @@
osask_at.exe
timerdrv.tek

Binary file not shown.

BIN
tolset/z_tools/osalink1.exe Normal file

Binary file not shown.

View File

@@ -0,0 +1,2 @@
default :
qemu-win.bat

BIN
tolset/z_tools/qemu/SDL.dll Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,4 @@
@set SDL_VIDEODRIVER=windib
@set QEMU_AUDIO_DRV=none
@set QEMU_AUDIO_LOG_TO_MONITOR=0
qemu.exe -L . -m 32 -localtime -std-vga -fda fdimage0.bin

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,2 @@
default :
qemu.exe -L . --fda fdimage0.bin

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
tolset/z_tools/sartol.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/sjisconv.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/t5lzma.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/upx.exe Normal file

Binary file not shown.

BIN
tolset/z_tools/wce.exe Normal file

Binary file not shown.

View File

@@ -0,0 +1,20 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(ERRNO_H))
#define ERRNO_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
extern int errno;
#define ENOENT 2 /* No such file or directory */
#define ERANGE 34 /* Result too large (or too small) */
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,26 @@
/* copyright(C) 2002 H.Kawai (under KL-01). */
#if (!defined(FLOAT_H))
#define FLOAT_H 1
#define FLT_RADIX 2
#define FLT_ROUNDS 1 /* nearest */
#define FLT_DIG 6
#define FLT_EPSILON 1.19209290e-07F
#define FLT_MANT_DIG 24
#define FLT_MAX 3.40282347e+38F
#define FLT_MAX_EXP (+128)
#define FLT_MIN 1.17549435e-38F
#define FLT_MIN_EXP (-125)
#define DBL_DIG 15
#define DBL_EPSILON 2.2204460492503131e-16
#define DBL_MANT_DIG 53
#define DBL_MAX 1.7976931348623157e+308
#define DBL_MAX_EXP 1024
#define DBL_MIN 2.2250738585072014e-308
#define DBL_MIN_EXP (-1021)
#endif

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,23 @@
/* copyright(C) 2002 H.Kawai (under KL-01). */
#if (!defined(LIMITS_H))
#define LIMITS_H 1
#define CHAR_BIT 8
#define CHAR_MAX (+127)
#define CHAR_MIN 0
#define INT_MAX (+0x7fffffff)
#define INT_MIN (-0x7fffffff)
#define LONG_MAX INT_MAX
#define LONG_MIN INT_MIN
#define SCHAR_MAX (+127)
#define SCHAR_MIN (-127)
#define SHRT_MAX (+0x7fff)
#define SHRT_MIN (-0x7fff)
#define UCHAR_MAX (+0xff)
#define UINT_MAX (+0xffffffff)
#define ULONG_MAX UINT_MAX
#define USHRT_MAX (+0xffff)
#endif

View File

@@ -0,0 +1,42 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(MATH_H))
#define MATH_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
double sin(double);
double cos(double);
double sqrt(double);
double ldexp(double x, int n);
double frexp(double x, int *exp);
extern __inline__ double sin(double x)
{
double res;
__asm__ ("fsin" : "=t" (res) : "0" (x));
return res;
}
extern __inline__ double cos(double x)
{
double res;
__asm__ ("fcos" : "=t" (res) : "0" (x));
return res;
}
extern __inline__ double sqrt(double x)
{
double res;
__asm__ ("fsqrt" : "=t" (res) : "0" (x));
return res;
}
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,20 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(SETJMP_H))
#define SETJMP_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
typedef int jmp_buf[3]; /* EBP, EIP, ESP */
#define setjmp(env) __builtin_setjmp(env)
#define longjmp(env, val) __builtin_longjmp(env, val)
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,21 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(STDARG_H))
#define STDARG_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
#define va_start(v,l) __builtin_stdarg_start((v),l)
#define va_end __builtin_va_end
#define va_arg __builtin_va_arg
#define va_copy(d,s) __builtin_va_copy((d),(s))
#define va_list __builtin_va_list
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,17 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(STDDEF_H))
#define STDDEF_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
typedef unsigned int size_t;
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,67 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(STDIO_H))
#define STDIO_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
#if (!defined(NULL))
#define NULL ((void *) 0)
#endif
#include <stdarg.h>
/* golibc */
int sprintf(char *s, const char *format, ...);
int vsprintf(char *s, const char *format, va_list arg);
/* w32clibc */
typedef struct {
unsigned int handle;
int flags; /* bit0:text/bin, bit1:input-enabe, bit2:output-enable */
/* bit3:EOF, bit4:ungetc-enable */
int ungetc;
} FILE;
extern FILE __stdin, __stdout, __stderr;
#define stdin (&__stdin)
#define stdout (&__stdout)
#define stderr (&__stderr)
#define EOF -1
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
unsigned int fwrite(const void *ptr, unsigned int size, unsigned int nmemb, FILE *stream);
int fputs(const char *s, FILE *stream);
int fprintf(FILE *stream, const char *format, ...);
int vfprintf(FILE *stream, const char *format, va_list arg);
int puts(const char *s);
int printf(const char *format, ...);
int vprintf(const char *format, va_list arg);
int fclose(FILE *stream);
int fflush(FILE *stream);
FILE *fopen(const char *filename, const char *mode);
unsigned int fread(void *ptr, unsigned int size, unsigned int nobj, FILE *stream);
int fseek(FILE *stream, int offset, int origin);
int ftell(FILE *stream);
int remove(const char *filename);
int fputc(int c, FILE *stream);
void clearerr(FILE *stream);
void rewind(FILE *stream);
int fgetc(FILE *stream);
int feof(FILE *stream);
#define getc fgetc
#define getchar() getc(stdin)
#define putchar(c) fputc(c, stdout)
char *fgets(char *s, int n, FILE *stream);
char *gets(char *s);
int ungetc(int c, FILE *stream);
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,40 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(STDLIB_H))
#define STDLIB_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
#include <stddef.h> /* size_t */
#define RAND_MAX 0x7fff
#define srand(seed) (void) (rand_seed = (seed))
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
int abs(int n);
double atof(const char *s);
int atoi(const char *s);
void qsort(void *base, size_t n, size_t size,
int (*cmp)(const void *, const void *));
int rand(void);
extern unsigned int rand_seed;
double strtod(const char *s, const char **endp);
long strtol(const char *s, const char **endp, int base);
unsigned long strtoul(const char *s, const char **endp, int base);
void *malloc(unsigned int nbytes);
void free(void *ap);
void exit(int status);
#define abort() exit(EXIT_FAILURE)
int system(const char *s);
#if (defined(__cplusplus))
}
#endif
#endif

View File

@@ -0,0 +1,38 @@
/* copyright(C) 2003 H.Kawai (under KL-01). */
#if (!defined(STRING_H))
#define STRING_H 1
#if (defined(__cplusplus))
extern "C" {
#endif
#include <stddef.h> /* size_t */
char *strcpy(char *s, const char *ct);
char *strncpy(char *s, const char *ct, size_t n);
char *strcat(char *s, const char *ct);
char *strncat(char *s, const char *ct, size_t n);
int strcmp(const char *cs, const char *ct);
int strncmp(const char *cs, const char *ct, size_t n);
char *strchr(const char *cs, int c);
char *strrchr(const char *cs, int c);
size_t strspn(const char *s, const char *accept);
size_t strcspn(const char *s, const char *reject);
char *strpbrk(const char *s, const char *accept);
char *strstr(const char *cs, const char *ct);
size_t strlen(const char *cs);
void *memcpy(void *s, const void *ct, size_t n);
void *memmove(void *s, const void *ct, size_t n);
int memcmp(const void *cs, const void *ct, size_t n);
void *memchr(const void *cs, int c, size_t n);
void *memset(void *s, int c, size_t n);
char *strdup(const char *s);
#if (defined(__cplusplus))
}
#endif
#endif

Binary file not shown.