Compare commits

...

6 Commits

Author SHA1 Message Date
Yourtion
140774a293 bug fix 2016-05-21 00:24:41 +08:00
Yourtion
7c2fc66927 add screen 2016-05-20 15:28:31 +08:00
Yourtion
636c1a8c3d Update README 2016-05-20 15:16:20 +08:00
Yourtion
c177821913 整理 2016-05-20 14:56:29 +08:00
Yourtion
febac10ebf IPL的改良 2016-05-20 14:49:26 +08:00
Yourtion
0e31ff06ca bug fix 2016-05-20 14:27:07 +08:00
24 changed files with 379 additions and 152 deletions

4
.gitignore vendored
View File

@@ -1 +1,5 @@
*.hrb
*.lst
*.map
*.bim
*.hrb

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -14,7 +14,7 @@ default :
#文件生成规则
haribote.img : haribote/ipl20.bin haribote/haribote.sys Makefile \
haribote.img : haribote/ipl10.bin haribote/haribote.sys Makefile \
a/a.hrb hello3/hello3.hrb hello4/hello4.hrb hello5/hello5.hrb \
winhelo/winhelo.hrb winhelo2/winhelo2.hrb winhelo3/winhelo3.hrb \
star1/star1.hrb stars/stars.hrb stars2/stars2.hrb \
@@ -25,7 +25,7 @@ haribote.img : haribote/ipl20.bin haribote/haribote.sys Makefile \
notrec/notrec.hrb bball/bball.hrb invader/invader.hrb \
calc/calc.hrb tview/tview.hrb mmlplay/mmlplay.hrb gview/gview.hrb
$(EDIMG) imgin:../z_tools/fdimg0at.tek \
wbinimg src:haribote/ipl20.bin len:512 from:0 to:0 \
wbinimg src:haribote/ipl10.bin len:512 from:0 to:0 \
copy from:haribote/haribote.sys to:@: \
copy from:haribote/jp.nas to:@: \
copy from:make.bat to:@: \

View File

@@ -3,3 +3,6 @@ STACK = 1k
MALLOC = 0k
include ../app_make.txt
$(APP).hrb : $(APP).org Makefile
$(COPY) $(APP).org $(APP).hrb

Binary file not shown.

View File

@@ -35,10 +35,10 @@ $(STDAPP).bim : $(APP).obj $(STDLIBPATH)stdlib.lib Makefile ../app_make.txt
$(OBJ2BIM) @$(RULEFILE) out:$(APP).bim map:$(APP).map stack:$(STACK) \
$(APP).obj $(STDLIBPATH)stdlib.lib
haribote.img : ../haribote/ipl20.bin ../haribote/haribote.sys $(APP).hrb \
haribote.img : ../haribote/ipl10.bin ../haribote/haribote.sys $(APP).hrb \
Makefile ../app_make.txt
$(EDIMG) imgin:../../z_tools/fdimg0at.tek \
wbinimg src:../haribote/ipl20.bin len:512 from:0 to:0 \
wbinimg src:../haribote/ipl10.bin len:512 from:0 to:0 \
copy from:../haribote/haribote.sys to:@: \
copy from:$(APP).hrb to:@: \
copy from:../nihongo/nihongo.fnt to:@: \

View File

@@ -23,13 +23,13 @@ DEL = del
#默认动作
default :
$(MAKE) ipl20.bin
$(MAKE) ipl10.bin
$(MAKE) haribote.sys
# 镜像文件生成
ipl20.bin : ipl20.nas Makefile
$(NASK) ipl20.nas ipl20.bin ipl20.lst
ipl10.bin : ipl10.nas Makefile
$(NASK) ipl10.nas ipl10.bin ipl10.lst
asmhead.bin : asmhead.nas Makefile
$(NASK) asmhead.nas asmhead.bin asmhead.lst
@@ -75,5 +75,5 @@ clean :
src_only :
$(MAKE) clean
-$(DEL) ipl20.bin
-$(DEL) ipl10.bin
-$(DEL) haribote.sys

View File

@@ -88,16 +88,16 @@ struct GATE_DESCRIPTOR {
void init_gdtidt(void);
void set_segmdesc(struct SEGMENT_DESCRIPTOR *sd, unsigned int limit, int base, int ar);
void set_gatedesc(struct GATE_DESCRIPTOR *gd, int offset, int selector, int ar);
#define ADR_IDT 0x0026f800
#define LIMIT_IDT 0x000007ff
#define ADR_GDT 0x00270000
#define LIMIT_GDT 0x0000ffff
#define ADR_IDT 0x0026f800
#define LIMIT_IDT 0x000007ff
#define ADR_GDT 0x00270000
#define LIMIT_GDT 0x0000ffff
#define ADR_BOTPAK 0x00280000
#define LIMIT_BOTPAK 0x0007ffff
#define AR_DATA32_RW 0x4092
#define AR_CODE32_ER 0x409a
#define AR_LDT 0x0082
#define AR_TSS32 0x0089
#define AR_LDT 0x0082
#define AR_TSS32 0x0089
#define AR_INTGATE32 0x008e
/* int.c */
@@ -288,10 +288,10 @@ void file_loadfile(int clustno, int size, char *buf, int *fat, char *img);
struct FILEINFO *file_search(char *name, struct FILEINFO *finfo, int max);
char *file_loadfile2(int clustno, int *psize, int *fat);
/* bootpack.c */
struct TASK *open_constask(struct SHEET *sht, unsigned int memtotal);
struct SHEET *open_console(struct SHTCTL *shtctl, unsigned int memtotal);
/* tek.c */
int tek_getsize(unsigned char *p);
int tek_decomp(unsigned char *p, char *q, int size);
/* bootpack.c */
struct TASK *open_constask(struct SHEET *sht, unsigned int memtotal);
struct SHEET *open_console(struct SHTCTL *shtctl, unsigned int memtotal);

View File

@@ -9,8 +9,8 @@ void console_task(struct SHEET *sheet, int memtotal)
struct TASK *task = task_now();
struct MEMMAN *memman = (struct MEMMAN *) MEMMAN_ADDR;
int i, *fat = (int *) memman_alloc_4k(memman, 4 * 2880);
struct FILEHANDLE fhandle[8];
struct CONSOLE cons;
struct FILEHANDLE fhandle[8];
char cmdline[30];
unsigned char *nihongo = (char *) *((int *) 0x0fe8);
@@ -133,19 +133,19 @@ void cons_putchar(struct CONSOLE *cons, int chr, char move)
cons_newline(cons);
}
if (((cons->cur_x - 8) & 0x1f) == 0) {
break; /*32整除则break*/
break; /* 32<EFBFBD>Ŋ<EFBFBD><EFBFBD><EFBFBD>؂ꂽ<EFBFBD><EFBFBD>break */
}
}
} else if (s[0] == 0x0a) { /*换行*/
} else if (s[0] == 0x0a) { /* <20><><EFBFBD>s */
cons_newline(cons);
} else if (s[0] == 0x0d) { /*回车*/
/*先不做任何操作*/
} else { /*一般字符*/
} else if (s[0] == 0x0d) { /* <20><><EFBFBD>A */
/* <20>Ƃ肠<C682><E882A0><EFBFBD><EFBFBD><EFBFBD>Ȃɂ<C882><C982><EFBFBD><EFBFBD>Ȃ<EFBFBD> */
} else { /* <20><><EFBFBD>ʂ̕<CA82><CC95><EFBFBD> */
if (cons->sht != 0) {
putfonts8_asc_sht(cons->sht, cons->cur_x, cons->cur_y, COL8_FFFFFF, COL8_000000, s, 1);
}
if (move != 0) {
/* move为0时光标不后移*/
/* move<EFBFBD><EFBFBD>0<EFBFBD>̂Ƃ<EFBFBD><EFBFBD>̓J<EFBFBD>[<5B>\<5C><><EFBFBD><EFBFBD>i<EFBFBD>߂Ȃ<DF82> */
cons->cur_x += 8;
if (cons->cur_x == 8 + 240) {
cons_newline(cons);
@@ -161,9 +161,9 @@ void cons_newline(struct CONSOLE *cons)
struct SHEET *sheet = cons->sht;
struct TASK *task = task_now();
if (cons->cur_y < 28 + 112) {
cons->cur_y += 16; /*到下一行*/
cons->cur_y += 16; /* <20><><EFBFBD>̍s<CC8D><73> */
} else {
/*滚动*/
/* <20>X<EFBFBD>N<EFBFBD><4E><EFBFBD>[<5B><> */
if (sheet != 0) {
for (y = 28; y < 28 + 112; y++) {
for (x = 8; x < 8 + 240; x++) {
@@ -180,7 +180,7 @@ void cons_newline(struct CONSOLE *cons)
}
cons->cur_x = 8;
if (task->langmode == 1 && task->langbyte1 != 0) {
cons->cur_x += 8;
cons->cur_x = 16;
}
return;
}
@@ -208,7 +208,7 @@ void cons_runcmd(char *cmdline, struct CONSOLE *cons, int *fat, int memtotal)
cmd_mem(cons, memtotal);
} else if (strcmp(cmdline, "cls") == 0 && cons->sht != 0) {
cmd_cls(cons);
} else if ((strcmp(cmdline, "dir") == 0 || strcmp(cmdline, "ls") == 0) && cons->sht != 0) {
} else if (strcmp(cmdline, "dir") == 0 && cons->sht != 0) {
cmd_dir(cons);
} else if (strcmp(cmdline, "exit") == 0) {
cmd_exit(cons, fat);
@@ -218,9 +218,9 @@ void cons_runcmd(char *cmdline, struct CONSOLE *cons, int *fat, int memtotal)
cmd_ncst(cons, cmdline, memtotal);
} else if (strncmp(cmdline, "langmode ", 9) == 0) {
cmd_langmode(cons, cmdline);
}else if (cmdline[0] != 0) {
} else if (cmdline[0] != 0) {
if (cmd_app(cons, fat, cmdline) == 0) {
/*不是命令,不是应用程序,也不是空行*/
/* <20>R<EFBFBD>}<7D><><EFBFBD>h<EFBFBD>ł͂Ȃ<CD82><C882>A<EFBFBD>A<EFBFBD>v<EFBFBD><76><EFBFBD>ł<EFBFBD><C582>Ȃ<EFBFBD><C882>A<EFBFBD><41><EFBFBD><EFBFBD>ɋ<EFBFBD>s<EFBFBD>ł<EFBFBD><C582>Ȃ<EFBFBD> */
cons_putstr0(cons, "Bad command.\n\n");
}
}
@@ -288,9 +288,9 @@ void cmd_exit(struct CONSOLE *cons, int *fat)
memman_free_4k(memman, (int) fat, 4 * 2880);
io_cli();
if (cons->sht != 0) {
fifo32_put(fifo, cons->sht - shtctl->sheets0 + 768); /* 7681023 */
fifo32_put(fifo, cons->sht - shtctl->sheets0 + 768); /* 768<EFBFBD>`1023 */
} else {
fifo32_put(fifo, task - taskctl->tasks0 + 1024); /*10242023*/
fifo32_put(fifo, task - taskctl->tasks0 + 1024); /* 1024<EFBFBD>`2023 */
}
io_sti();
for (;;) {
@@ -306,11 +306,11 @@ void cmd_start(struct CONSOLE *cons, char *cmdline, int memtotal)
int i;
sheet_slide(sht, 32, 4);
sheet_updown(sht, shtctl->top);
/*将命令行输入的字符串逐字复制到新的命令行窗口中*/
/* <20>R<EFBFBD>}<7D><><EFBFBD>h<EFBFBD><68><EFBFBD>C<EFBFBD><43><EFBFBD>ɓ<EFBFBD><C993>͂<EFBFBD><CD82><EFBFBD><EA82BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EA95B6><EFBFBD><EFBFBD><EFBFBD>V<C290><56><EFBFBD><EFBFBD><EFBFBD>R<EFBFBD><52><EFBFBD>\<5C>[<5B><><EFBFBD>ɓ<EFBFBD><C993><EFBFBD> */
for (i = 6; cmdline[i] != 0; i++) {
fifo32_put(fifo, cmdline[i] + 256);
}
fifo32_put(fifo, 10 + 256); /*回车键*/
fifo32_put(fifo, 10 + 256); /* Enter */
cons_newline(cons);
return;
}
@@ -320,12 +320,11 @@ void cmd_ncst(struct CONSOLE *cons, char *cmdline, int memtotal)
struct TASK *task = open_constask(0, memtotal);
struct FIFO32 *fifo = &task->fifo;
int i;
/*将命令行输入的字符串逐字复制到新的命令行窗口中*/
/* <20>R<EFBFBD>}<7D><><EFBFBD>h<EFBFBD><68><EFBFBD>C<EFBFBD><43><EFBFBD>ɓ<EFBFBD><C993>͂<EFBFBD><CD82><EFBFBD><EA82BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EA95B6><EFBFBD><EFBFBD><EFBFBD>V<C290><56><EFBFBD><EFBFBD><EFBFBD>R<EFBFBD><52><EFBFBD>\<5C>[<5B><><EFBFBD>ɓ<EFBFBD><C993><EFBFBD> */
for (i = 5; cmdline[i] != 0; i++) {
fifo32_put(fifo, cmdline[i] + 256);
}
fifo32_put(fifo, 10 + 256); /*回车键*/
fifo32_put(fifo, 10 + 256); /* Enter */
cons_newline(cons);
return;
}
@@ -347,26 +346,25 @@ int cmd_app(struct CONSOLE *cons, int *fat, char *cmdline)
{
struct MEMMAN *memman = (struct MEMMAN *) MEMMAN_ADDR;
struct FILEINFO *finfo;
struct SEGMENT_DESCRIPTOR *gdt = (struct SEGMENT_DESCRIPTOR *) ADR_GDT;
char name[18], *p, *q;
struct TASK *task = task_now();
int i, segsiz, datsiz, esp, dathrb, appsiz;
struct SHTCTL *shtctl;
struct SHEET *sht;
/*根据命令行生成文件名*/
/* <20>R<EFBFBD>}<7D><><EFBFBD>h<EFBFBD><68><EFBFBD>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD>𐶐<EFBFBD> */
for (i = 0; i < 13; i++) {
if (cmdline[i] <= ' ') {
break;
}
name[i] = cmdline[i];
}
name[i] = 0; /*暂且将文件名的后面置为0*/
name[i] = 0; /* <20>Ƃ肠<C682><E882A0><EFBFBD><EFBFBD><EFBFBD>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD>̌<EFBFBD><CC8C><EFBFBD>0<EFBFBD>ɂ<EFBFBD><C982><EFBFBD> */
/*寻找文件 */
/* <20>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD><EFBFBD>T<EFBFBD><54> */
finfo = file_search(name, (struct FILEINFO *) (ADR_DISKIMG + 0x002600), 224);
if (finfo == 0 && name[i - 1] != '.') {
/*由于找不到文件,故在文件名后面加上“.hrb”后重新寻找*/
/* <20><><EFBFBD>‚<EFBFBD><C282><EFBFBD>Ȃ<EFBFBD><C882><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̂Ō<CC82><C58C><EFBFBD>".HRB"<22><><EFBFBD>‚<EFBFBD><C282>Ă<EFBFBD><C482><EFBFBD><EFBFBD><EFBFBD>x<EFBFBD>T<EFBFBD><54><EFBFBD>Ă݂<C482> */
name[i ] = '.';
name[i + 1] = 'H';
name[i + 2] = 'R';
@@ -376,7 +374,7 @@ int cmd_app(struct CONSOLE *cons, int *fat, char *cmdline)
}
if (finfo != 0) {
/*如果找到文件*/
/* <20>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>‚<EFBFBD><C282><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
appsiz = finfo->size;
p = file_loadfile2(finfo->clustno, &appsiz, fat);
if (appsiz >= 36 && strncmp(p + 4, "Hari", 4) == 0 && *p == 0x00) {
@@ -386,8 +384,8 @@ int cmd_app(struct CONSOLE *cons, int *fat, char *cmdline)
dathrb = *((int *) (p + 0x0014));
q = (char *) memman_alloc_4k(memman, segsiz);
task->ds_base = (int) q;
set_segmdesc(task->ldt + 0, finfo->size - 1, (int) p, AR_CODE32_ER + 0x60);
set_segmdesc(task->ldt + 1, segsiz - 1, (int) q, AR_DATA32_RW + 0x60);
set_segmdesc(task->ldt + 0, appsiz - 1, (int) p, AR_CODE32_ER + 0x60);
set_segmdesc(task->ldt + 1, segsiz - 1, (int) q, AR_DATA32_RW + 0x60);
for (i = 0; i < datsiz; i++) {
q[esp + i] = p[dathrb + i];
}
@@ -396,11 +394,11 @@ int cmd_app(struct CONSOLE *cons, int *fat, char *cmdline)
for (i = 0; i < MAX_SHEETS; i++) {
sht = &(shtctl->sheets0[i]);
if ((sht->flags & 0x11) == 0x11 && sht->task == task) {
/*找到被应用程序遗留的窗口*/
sheet_free(sht); /*关闭*/
/* <20>A<EFBFBD>v<EFBFBD><76><EFBFBD><EFBFBD><EFBFBD>J<EFBFBD><4A><EFBFBD><EFBFBD><EFBFBD>ςȂ<CF82><C882>ɂ<EFBFBD><C982><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𔭌<EFBFBD> */
sheet_free(sht); /* <20>‚<EFBFBD><C282><EFBFBD> */
}
}
for (i = 0; i < 8; i++) { /*将未关闭的文件关闭*/
for (i = 0; i < 8; i++) { /* <20>N<EFBFBD><4E><EFBFBD>[<5B>Y<EFBFBD><59><EFBFBD>ĂȂ<C482><C882>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD>N<EFBFBD><4E><EFBFBD>[<5B>Y */
if (task->fhandle[i].buf != 0) {
memman_free_4k(memman, (int) task->fhandle[i].buf, task->fhandle[i].size);
task->fhandle[i].buf = 0;
@@ -416,7 +414,7 @@ int cmd_app(struct CONSOLE *cons, int *fat, char *cmdline)
cons_newline(cons);
return 1;
}
/*没有找到文件的情况*/
/* <20>t<EFBFBD>@<40>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>‚<EFBFBD><C282><EFBFBD>Ȃ<EFBFBD><C882><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
return 0;
}
@@ -428,8 +426,8 @@ int *hrb_api(int edi, int esi, int ebp, int esp, int ebx, int edx, int ecx, int
struct SHTCTL *shtctl = (struct SHTCTL *) *((int *) 0x0fe4);
struct SHEET *sht;
struct FIFO32 *sys_fifo = (struct FIFO32 *) *((int *) 0x0fec);
int *reg = &eax + 1; /* eax后面的地址*/
/*强行改写通过PUSHAD保存的值*/
int *reg = &eax + 1; /* eax<EFBFBD>̎<EFBFBD><EFBFBD>̔Ԓn */
/* <20>ۑ<EFBFBD><DB91>̂<EFBFBD><CC82>߂<EFBFBD>PUSHAD<41><44><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɏ<EFBFBD><C98F><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
/* reg[0] : EDI, reg[1] : ESI, reg[2] : EBP, reg[3] : ESP */
/* reg[4] : EBX, reg[5] : EDX, reg[6] : ECX, reg[7] : EAX */
int i;
@@ -452,7 +450,7 @@ int *hrb_api(int edi, int esi, int ebp, int esp, int ebx, int edx, int ecx, int
sheet_setbuf(sht, (char *) ebx + ds_base, esi, edi, eax);
make_window8((char *) ebx + ds_base, esi, edi, (char *) ecx + ds_base, 0);
sheet_slide(sht, ((shtctl->xsize - esi) / 2) & ~3, (shtctl->ysize - edi) / 2);
sheet_updown(sht, shtctl->top); /*将窗口图层高度指定为当前鼠标所在图层的高度,鼠标移到上层*/
sheet_updown(sht, shtctl->top); /* <20><><EFBFBD>̃}<7D>E<EFBFBD>X<EFBFBD>Ɠ<EFBFBD><C693><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɂȂ<C982><EFBFBD>Ɏw<C98E><77>F <20>}<7D>E<EFBFBD>X<EFBFBD>͂<EFBFBD><CD82>̏<EFBFBD>ɂȂ<C982> */
reg[7] = (int) sht;
} else if (edx == 6) {
sht = (struct SHEET *) (ebx & 0xfffffffe);
@@ -468,13 +466,13 @@ int *hrb_api(int edi, int esi, int ebp, int esp, int ebx, int edx, int ecx, int
}
} else if (edx == 8) {
memman_init((struct MEMMAN *) (ebx + ds_base));
ecx &= 0xfffffff0; /*16字节为单位*/
ecx &= 0xfffffff0; /* 16<EFBFBD>o<EFBFBD>C<EFBFBD>g<EFBFBD>P<EFBFBD>ʂ<EFBFBD> */
memman_free((struct MEMMAN *) (ebx + ds_base), eax, ecx);
} else if (edx == 9) {
ecx = (ecx + 0x0f) & 0xfffffff0; /*16字节为单位进位取整*/
ecx = (ecx + 0x0f) & 0xfffffff0; /* 16<EFBFBD>o<EFBFBD>C<EFBFBD>g<EFBFBD>P<EFBFBD>ʂɐ؂<EFBFBD>*/
reg[7] = memman_alloc((struct MEMMAN *) (ebx + ds_base), ecx);
} else if (edx == 10) {
ecx = (ecx + 0x0f) & 0xfffffff0; /*16字节为单位进位取整*/
ecx = (ecx + 0x0f) & 0xfffffff0; /* 16<EFBFBD>o<EFBFBD>C<EFBFBD>g<EFBFBD>P<EFBFBD>ʂɐ؂<EFBFBD>*/
memman_free((struct MEMMAN *) (ebx + ds_base), eax, ecx);
} else if (edx == 11) {
sht = (struct SHEET *) (ebx & 0xfffffffe);
@@ -508,7 +506,7 @@ int *hrb_api(int edi, int esi, int ebp, int esp, int ebx, int edx, int ecx, int
io_cli();
if (fifo32_status(&task->fifo) == 0) {
if (eax != 0) {
task_sleep(task); /* FIFO为空,休眠并等待*/
task_sleep(task); /* FIFO<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȃ̂ŐQ<EFBFBD>đ҂<EFBFBD> */
} else {
io_sti();
reg[7] = -1;
@@ -517,32 +515,32 @@ int *hrb_api(int edi, int esi, int ebp, int esp, int ebx, int edx, int ecx, int
}
i = fifo32_get(&task->fifo);
io_sti();
if (i <= 1) { /*光标用定时器*/
/*应用程序运行时不需要显示光标因此总是将下次显示用的值置为1*/
timer_init(cons->timer, &task->fifo, 1); /*下次置为1*/
if (i <= 1 && cons->sht != 0) { /* <20>J<EFBFBD>[<5B>\<5C><><EFBFBD>p<EFBFBD>^<5E>C<EFBFBD>} */
/* <20>A<EFBFBD>v<EFBFBD><76><EFBFBD><EFBFBD><EFBFBD>s<EFBFBD><73><EFBFBD>̓J<CD83>[<5B>\<5C><><EFBFBD><EFBFBD><EFBFBD>o<EFBFBD>Ȃ<EFBFBD><C882>̂ŁA<C581><41><EFBFBD>‚<EFBFBD><C282><EFBFBD><EFBFBD>͕\<5C><><EFBFBD>p<EFBFBD><70>1<EFBFBD>𒍕<EFBFBD><F0928D95><EFBFBD><EFBFBD>Ă<EFBFBD><C482><EFBFBD> */
timer_init(cons->timer, &task->fifo, 1); /* <20><><EFBFBD><EFBFBD>1<EFBFBD><31> */
timer_settime(cons->timer, 50);
}
if (i == 2) { /*光标ON */
if (i == 2) { /* <20>J<EFBFBD>[<5B>\<5C><>ON */
cons->cur_c = COL8_FFFFFF;
}
if (i == 3) { /*光标OFF */
if (i == 3) { /* <20>J<EFBFBD>[<5B>\<5C><>OFF */
cons->cur_c = -1;
}
if (i == 4) { /*只关闭命令行窗口*/
if (i == 4) { /* <20>R<EFBFBD><52><EFBFBD>\<5C>[<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>‚<EFBFBD><C282><EFBFBD> */
timer_cancel(cons->timer);
io_cli();
fifo32_put(sys_fifo, cons->sht - shtctl->sheets0 + 2024); /*20242279*/
fifo32_put(sys_fifo, cons->sht - shtctl->sheets0 + 2024); /* 2024<EFBFBD>`2279 */
cons->sht = 0;
io_sti();
}
if (i >= 256) { /*键盘数据通过任务A*/
if (i >= 256) { /* <20>L<EFBFBD>[<5B>{<7B>[<5B>h<EFBFBD>f<EFBFBD>[<5B>^<5E>i<EFBFBD>^<5E>X<EFBFBD>NA<4E>o<EFBFBD>R<EFBFBD>j<EFBFBD>Ȃ<EFBFBD> */
reg[7] = i - 256;
return 0;
}
}
} else if (edx == 16) {
reg[7] = (int) timer_alloc();
((struct TIMER *) reg[7])->flags2 = 1; /*允许自动取消*/
((struct TIMER *) reg[7])->flags2 = 1; /* <20><><EFBFBD><EFBFBD><EFBFBD>L<EFBFBD><4C><EFBFBD><EFBFBD><EFBFBD>Z<EFBFBD><5A><EFBFBD>L<EFBFBD><4C> */
} else if (edx == 17) {
timer_init((struct TIMER *) ebx, &task->fifo, eax + 256);
} else if (edx == 18) {
@@ -570,13 +568,13 @@ int *hrb_api(int edi, int esi, int ebp, int esp, int ebx, int edx, int ecx, int
fh = &task->fhandle[i];
reg[7] = 0;
if (i < 8) {
finfo = file_search((char *) ebx + ds_base, (struct FILEINFO *) (ADR_DISKIMG + 0x002600), 224);
finfo = file_search((char *) ebx + ds_base,
(struct FILEINFO *) (ADR_DISKIMG + 0x002600), 224);
if (finfo != 0) {
reg[7] = (int) fh;
fh->buf = (char *) memman_alloc_4k(memman, finfo->size);
fh->size = finfo->size;
fh->pos = 0;
file_loadfile2(finfo->clustno, &fh->size, task->fat);
fh->buf = file_loadfile2(finfo->clustno, &fh->size, task->fat);
}
}
} else if (edx == 22) {
@@ -644,7 +642,7 @@ int *inthandler0c(int *esp)
cons_putstr0(cons, "\nINT 0C :\n Stack Exception.\n");
sprintf(s, "EIP = %08X\n", esp[11]);
cons_putstr0(cons, s);
return &(task->tss.esp0); /*强制结束程序*/
return &(task->tss.esp0); /* <20>ُ<EFBFBD>I<EFBFBD><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
}
int *inthandler0d(int *esp)
@@ -655,7 +653,7 @@ int *inthandler0d(int *esp)
cons_putstr0(cons, "\nINT 0D :\n General Protected Exception.\n");
sprintf(s, "EIP = %08X\n", esp[11]);
cons_putstr0(cons, s);
return &(task->tss.esp0); /*强制结束程序*/
return &(task->tss.esp0); /* <20>ُ<EFBFBD>I<EFBFBD><49><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
}
void hrb_api_linewin(struct SHEET *sht, int x0, int y0, int x1, int y1, int col)

Binary file not shown.

152
30_day/haribote/ipl10.nas Normal file
View File

@@ -0,0 +1,152 @@
; haribote-ipl
; TAB=4
CYLS EQU 10 ; 声明CYLS=10
ORG 0x7c00 ; 指明程序装载地址
; 标准FAT12格式软盘专用的代码 Stand FAT12 format floppy code
JMP entry
DB 0x90
DB "HARIBOTE" ; 启动扇区名称8字节
DW 512 ; 每个扇区sector大小必须512字节
DB 1 ; 簇cluster大小必须为1个扇区
DW 1 ; FAT起始位置一般为第一个扇区
DB 2 ; FAT个数必须为2
DW 224 ; 根目录大小一般为224项
DW 2880 ; 该磁盘大小必须为2880扇区1440*1024/512
DB 0xf0 ; 磁盘类型必须为0xf0
DW 9 ; FAT的长度必9扇区
DW 18 ; 一个磁道track有几个扇区必须为18
DW 2 ; 磁头数必2
DD 0 ; 不使用分区必须是0
DD 2880 ; 重写一次磁盘大小
DB 0,0,0x29 ; 意义不明(固定)
DD 0xffffffff ; (可能是)卷标号码
DB "HARIBOTEOS " ; 磁盘的名称必须为11字?,不足填空格)
DB "FAT12 " ; 磁盘格式名称(必??8字?,不足填空格)
RESB 18 ; 先空出18字节
; 程序主体
entry:
MOV AX,0 ; 初始化寄存器
MOV SS,AX
MOV SP,0x7c00
MOV DS,AX
; 读取磁盘
MOV AX,0x0820
MOV ES,AX
MOV CH,0 ; 柱面0
MOV DH,0 ; 磁头0
MOV CL,2 ; 扇区2
MOV BX,18*2*CYLS-1 ; 要读取的合计扇区数
CALL readfast ; 告诉读取
; 读取完毕跳转到haribote.sys执行
MOV [0x0ff0],CH ; 记录IPL实际读取了多少内容
JMP 0xc200
error:
MOV AX,0
MOV ES,AX
MOV SI,msg
putloop:
MOV AL,[SI]
ADD SI,1 ; 给SI加1
CMP AL,0
JE fin
MOV AH,0x0e ; 显示一个文字
MOV BX,15 ; 指定字符颜色
INT 0x10 ; 调用显卡BIOS
JMP putloop
fin:
HLT ; 让CPU停止等待指令
JMP fin ; 无限循环
msg:
DB 0x0a, 0x0a ; 换行两次
DB "load error"
DB 0x0a ; 换行
DB 0
readfast: ; 使用AL尽量一次性读取数据 从此开始
; ES:读取地址, CH:柱面, DH:磁头, CL:扇区, BX:读取扇区数
MOV AX,ES ; < 通过ES计算AL的最大值 >
SHL AX,3 ; 将AX除以32将结果存入AHSHL是左移位指令
AND AH,0x7f ; AH是AH除以128所得的余数512*128=64K
MOV AL,128 ; AL = 128 - AH; AH是AH除以128所得的余数512*128=64K
SUB AL,AH
MOV AH,BL ; < 通过BX计算AL的最大值并存入AH >
CMP BH,0 ; if (BH != 0) { AH = 18; }
JE .skip1
MOV AH,18
.skip1:
CMP AL,AH ; if (AL > AH) { AL = AH; }
JBE .skip2
MOV AL,AH
.skip2:
MOV AH,19 ; < 通过CL计算AL的最大值并存入AH >
SUB AH,CL ; AH = 19 - CL;
CMP AL,AH ; if (AL > AH) { AL = AH; }
JBE .skip3
MOV AL,AH
.skip3:
PUSH BX
MOV SI,0 ; 计算失败次数的寄存器
retry:
MOV AH,0x02 ; AH=0x02 : 读取磁盘
MOV BX,0
MOV DL,0x00 ; A盘
PUSH ES
PUSH DX
PUSH CX
PUSH AX
INT 0x13 ; 调用磁盘BIOS
JNC next ; 没有出错的话则跳转至next
ADD SI,1 ; 将SI加1
CMP SI,5 ; 将SI与5比较
JAE error ; SI >= 5则跳转至error
MOV AH,0x00
MOV DL,0x00 ; A盘
INT 0x13 ; 驱动器重置
POP AX
POP CX
POP DX
POP ES
JMP retry
next:
POP AX
POP CX
POP DX
POP BX ; 将ES的内容存入BX
SHR BX,5 ; 将BX由16字节为单位转换为512字节为单位
MOV AH,0
ADD BX,AX ; BX += AL;
SHL BX,5 ; 将BX由512字节为单位转换为16字节为单位
MOV ES,BX ; 相当于EX += AL * 0x20;
POP BX
SUB BX,AX
JZ .ret
ADD CL,AL ; 将CL加上AL
CMP CL,18 ; 将CL与18比较
JBE readfast ; CL <= 18则跳转至readfast
MOV CL,1
ADD DH,1
CMP DH,2
JB readfast ; DH < 2则跳转至readfast
MOV DH,0
ADD CH,1
JMP readfast
.ret:
RET
RESB 0x7dfe-$ ; 到0x7dfe为止用0x00填充的指令
DB 0x55, 0xaa

View File

@@ -43,10 +43,8 @@ entry:
MOV CH,0 ; 柱面0
MOV DH,0 ; 磁头0
MOV CL,2 ; 扇区2
readloop:
MOV SI,0 ; 记录失败次数寄存器
retry:
MOV AH,0x02 ; AH=0x02 : 读入磁盘
MOV AL,1 ; 1个扇区
@@ -82,8 +80,9 @@ next:
JMP 0xc200
error:
MOV AX,0
MOV ES,AX
MOV SI,msg
putloop:
MOV AL,[SI]
ADD SI,1 ; 给SI加1
@@ -93,7 +92,6 @@ putloop:
MOV BX,15 ; 指定字符颜色
INT 0x10 ; 调用显卡BIOS
JMP putloop
fin:
HLT ; 让CPU停止等待指令
JMP fin ; 无限循环

View File

@@ -16,8 +16,8 @@ void inthandler2c(int *esp)
return;
}
#define KEYCMD_SENDTO_MOUSE 0xd4
#define MOUSECMD_ENABLE 0xf4
#define KEYCMD_SENDTO_MOUSE 0xd4
#define MOUSECMD_ENABLE 0xf4
void enable_mouse(struct FIFO32 *fifo, int data0, struct MOUSE_DEC *mdec)
{
@@ -31,7 +31,7 @@ void enable_mouse(struct FIFO32 *fifo, int data0, struct MOUSE_DEC *mdec)
io_out8(PORT_KEYDAT, MOUSECMD_ENABLE);
/* 顺利的话ACK(0xfa)会被发送*/
mdec->phase = 0; /* 等待鼠标的0xfa的阶段*/
return;
return;
}
int mouse_decode(struct MOUSE_DEC *mdec, unsigned char dat)
@@ -40,13 +40,15 @@ int mouse_decode(struct MOUSE_DEC *mdec, unsigned char dat)
/* 等待鼠标的0xfa的阶段 */
if (dat == 0xfa) {
mdec->phase = 1;
}
}
return 0;
}
if (mdec->phase == 1) {
/* 等待鼠标第一字节的阶段 */
mdec->buf[0] = dat;
mdec->phase = 2;
if ((dat & 0xc8) == 0x08) {
mdec->buf[0] = dat;
mdec->phase = 2;
}
return 0;
}
if (mdec->phase == 2) {
@@ -67,7 +69,7 @@ int mouse_decode(struct MOUSE_DEC *mdec, unsigned char dat)
}
if ((mdec->buf[0] & 0x20) != 0) {
mdec->y |= 0xffffff00;
}
}
mdec->y = - mdec->y; /* 鼠标的y方向与画面符号相反 */
return 1;
}

View File

@@ -1,4 +1,4 @@
/* 多任务管理 */
/* <EFBFBD>}<7D><><EFBFBD>`<60>^<5E>X<EFBFBD>N<EFBFBD>֌W */
#include "bootpack.h"
@@ -16,7 +16,7 @@ void task_add(struct TASK *task)
struct TASKLEVEL *tl = &taskctl->level[task->level];
tl->tasks[tl->running] = task;
tl->running++;
task->flags = 2; /*活动中*/
task->flags = 2; /* <20><><EFBFBD>*/
return;
}
@@ -25,38 +25,39 @@ void task_remove(struct TASK *task)
int i;
struct TASKLEVEL *tl = &taskctl->level[task->level];
/*寻找task所在的位置*/
/* task<EFBFBD><EFBFBD><EFBFBD>ǂ<EFBFBD><EFBFBD>ɂ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>T<EFBFBD><EFBFBD> */
for (i = 0; i < tl->running; i++) {
if (tl->tasks[i] == task) {
/*在这里 */
/* <20><><EFBFBD><EFBFBD><EFBFBD>ɂ<EFBFBD><C982><EFBFBD> */
break;
}
}
tl->running--;
if (i < tl->now) {
tl->now--; /*需要移动成员,要相应地处理 */
tl->now--; /* <20><><EFBFBD><EFBFBD><EFBFBD>̂ŁA<C581><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482><EFBFBD> */
}
if (tl->now >= tl->running) {
/*如果now的值出现异常,则进行修正*/
/* now<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȓl<EFBFBD>ɂȂ<EFBFBD><EFBFBD>Ă<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD>C<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
tl->now = 0;
}
task->flags = 1; /* 休眠中 */
task->flags = 1; /* <EFBFBD>X<EFBFBD><EFBFBD><EFBFBD>[<5B>v<EFBFBD><76> */
/* 移动 */
/* <EFBFBD><EFBFBD><EFBFBD> */
for (; i < tl->running; i++) {
tl->tasks[i] = tl->tasks[i + 1];
}
return;
}
void task_switchsub(void)
{
int i;
/*寻找最上层的LEVEL */
/* <20><>ԏ<EFBFBD>̃<EFBFBD><CC83>x<EFBFBD><78><EFBFBD><EFBFBD>T<EFBFBD><54> */
for (i = 0; i < MAX_TASKLEVELS; i++) {
if (taskctl->level[i].running > 0) {
break; /*找到了*/
break; /* <20><><EFBFBD>‚<EFBFBD><C282><EFBFBD><EFBFBD><EFBFBD> */
}
}
taskctl->now_lv = i;
@@ -77,7 +78,6 @@ struct TASK *task_init(struct MEMMAN *memman)
struct TASK *task, *idle;
struct SEGMENT_DESCRIPTOR *gdt = (struct SEGMENT_DESCRIPTOR *) ADR_GDT;
taskctl = (struct TASKCTL *) memman_alloc_4k(memman, sizeof (struct TASKCTL));
for (i = 0; i < MAX_TASKS; i++) {
taskctl->tasks0[i].flags = 0;
@@ -92,11 +92,11 @@ struct TASK *task_init(struct MEMMAN *memman)
}
task = task_alloc();
task->flags = 2; /*活动中标志*/
task->priority = 2; /* 0.02*/
task->level = 0; /*最高LEVEL */
task->flags = 2; /* <20><><EFBFBD><EFBFBD>}<7D>[<5B>N */
task->priority = 2; /* 0.02<EFBFBD>b */
task->level = 0; /* <20>ō<EFBFBD><C58D><EFBFBD><EFBFBD>x<EFBFBD><78> */
task_add(task);
task_switchsub(); /* LEVEL 设置*/
task_switchsub(); /* <EFBFBD><EFBFBD><EFBFBD>x<EFBFBD><EFBFBD><EFBFBD>ݒ<EFBFBD> */
load_tr(task->sel);
task_timer = timer_alloc();
timer_settime(task_timer, task->priority);
@@ -151,7 +151,8 @@ void task_run(struct TASK *task, int level, int priority)
if (priority > 0) {
task->priority = priority;
}
if (task->flags == 2 && task->level != level) {
if (task->flags == 2 && task->level != level) {
/*改变活动中的LEVEL */
task_remove(task); /*这里执行之后flag的值会变为1于是下面的if语句块也会被执行*/
}
@@ -160,6 +161,7 @@ void task_run(struct TASK *task, int level, int priority)
task->level = level;
task_add(task);
}
taskctl->lv_change = 1; /*下次任务切换时检查LEVEL */
return;
}
@@ -181,7 +183,6 @@ void task_sleep(struct TASK *task)
return;
}
void task_switch(void)
{
struct TASKLEVEL *tl = &taskctl->level[taskctl->now_lv];

View File

@@ -231,7 +231,7 @@ static int tek_decode2(int siz, UCHAR *p, UCHAR *q)
if (dsiz > bsiz || (hed & 0x21) != 0x01)
return 1;
if (hed & 0x40)
tek_getnum_s7s(&p);
tek_getnum_s7s(&p); /* <20>I<EFBFBD>v<EFBFBD>V<EFBFBD><56><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ւ̃|<7C>C<EFBFBD><43><EFBFBD>^<5E><>ǂݔ<C782>΂<EFBFBD> */
st = tek_lzrestore_stk2(p1 - p, p, dsiz, q);
}
return st;
@@ -278,7 +278,7 @@ static int tek_lzrestore_tek5(int srcsiz, UCHAR *src, int outsiz, UCHAR *outbuf)
lp = pb;
pb = wrksiz;
}
wrksiz = 0x180 * sizeof (UINT32) + (0x840 + (0x300 << (lc + lp))) * sizeof (tek_TPRB); /* Å’á15KB, lc+lp=3‚È‚çA36KB */
wrksiz = 0x180 * sizeof (UINT32) + (0x840 + (0x300 << (lc + lp))) * sizeof (tek_TPRB); /* <EFBFBD>Œ<EFBFBD>15KB, lc+lp=3<EFBFBD>Ȃ<EFBFBD>A36KB */
work = (int *) memman_alloc_4k((struct MEMMAN *) MEMMAN_ADDR, wrksiz);
if (work == NULL)
return -1;
@@ -457,7 +457,7 @@ static int tek_decmain5(int *work, UCHAR *src, int osiz, UCHAR *q, int lc, int p
for (i = sizeof (struct tek_STR_PRB) / sizeof (tek_TPRB) + (0x300 << (lc + lp)) - 2; i >= 0; i--)
((tek_TPRB *) prb)[i] = 1 << 15;
for (i = 0; i < 32; i++) {
rd->bm[i].lt = (i >= 4);
rd->bm[i].lt = (i >= 4); /* 0..3<EFBFBD>͎<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȃ<EFBFBD> */
rd->bm[i].lt0 = (i < 24) ? 16 * 1024 : 8 * 1024;
rd->bm[i].s &= 0;
rd->bm[i].t = rd->bm[i].m = 5;
@@ -466,7 +466,7 @@ static int tek_decmain5(int *work, UCHAR *src, int osiz, UCHAR *q, int lc, int p
if (stk) {
rd->rmsk = -1 << 11;
for (i = 0; i < 32; i++)
rd->bm[i].lt = 0;
rd->bm[i].lt = 0; /* <20>S<EFBFBD>Ď<EFBFBD><C48E><EFBFBD><EFBFBD>Ȃ<EFBFBD> */
for (i = 0; i < 14; i++)
rd->ptbm[i] = &rd->bm[0];
} else {
@@ -493,7 +493,7 @@ static int tek_decmain5(int *work, UCHAR *src, int osiz, UCHAR *q, int lc, int p
rd->bm[22].t = 0; rd->bm[22].m = 1;
prb->repg3 = 0xffff;
if (flags == -2) { /* z1 */
rd->bm[22].lt = 0;
rd->bm[22].lt = 0; /* repg3<67><33>lt<6C><74>0<EFBFBD><30> */
for (i = 0; i < 14; i++)
pt[i] = pt1[i];
} else {

View File

@@ -1,9 +1,9 @@
#include <stdio.h> /* sprintf */
#include <string.h> /* strlen */
#include "apilib.h"
void putstr(int win, char *winbuf, int x, int y, int col, unsigned char *s);
void wait(int i, int timer, char *keyflag);
void setdec8(char *s, int i);
static unsigned char charset[16 * 8] = {
@@ -171,7 +171,7 @@ next_group:
/* hit ! */
score += point;
point++;
sprintf(s, "%08d", score);
setdec8(s, score);
putstr(win, winbuf, 10, 0, 7, s);
if (high < score) {
high = score;
@@ -279,3 +279,15 @@ void wait(int i, int timer, char *keyflag)
}
return;
}
void setdec8(char *s, int i)
/*将i用十进制表示并存入s*/
{
int j;
for (j = 7; j >= 0; j--) {
s[j] = '0' + i % 10;
i /= 10;
}
s[8] = 0;
return;
}

98
LICENSE.txt Normal file
View File

@@ -0,0 +1,98 @@
川合堂许可协议-01 ver.1.0
2000.12.30 H.Kawai (川合秀实)
0.概要
通俗地说:“这是自由软件,使用前使用后都无须支付任何费用,可以自由使用,也可以
复制、修改以及用于商业目的但是作者对软件的bug以及因此所造成的损失不负任何责
任。”
为了保护软件使用者以及软件修改者、参考者的利益,即便作者将来为该软件中所使用的
算法申请专利,也保证不会向使用者收取授权费用。
1.目的
适用于本协议的软件,旨在为公众带来利益,以及为软件技术的进步做出贡献。
2.宗旨
本协议并不代表作者放弃著作权(仅放弃独家复制发布的权利),使用者可以自由复制并
再次发布本软件的一部分甚至全部内容。使用时无须支付任何费用,对本软件的解析、修改
也无须支付任何费用。
适用于本协议的软件,可以无条件地用作商业目的,甚至可以将软件直接有偿出售。
对于以适用于本协议的软件的一部分或全部内容为基础,在此之上所开发的软件(下称“
派生物”),可以赋予任何种类的许可协议。即,派生物的作者可以禁止对派生物进行复制,
也可以只允许派生物以有偿形式发布。派生物的著作权属于该派生物的生成者,适用于本协
议的软件作者不会对其派生物主张著作权。
在派生物的文档中,没有义务对原始软件的作者进行介绍,但这句话,理所当然地,不意
味着禁止这一行为。
在发布派生物时,没有义务取得原始软件作者的同意,但这句话,理所当然地,不意味着
禁止这一行为。
作者不对软件的质量作出任何保证,因此,由于使用本软件所造成的损害,或者没有达到
所期望的结果,作者不负任何责任。
对于适用于本协议的软件中所使用的技术,除了事先取得作者授权的人以外,禁止其他人
对其申请专利。但如果附加了新的技术并生成了派生物,允许对于追加的部分申请专利。作
者在将来有可能对软件中的技术申请专利,但保证不会向派生物以及软件的使用收取授权费
用。本保证不仅适用于申请专利之前所生成的派生物,也适用于专利取得后所生成的派生物。
将解析结果汇总并申请专利,需要事先取得作者的同意,但对于申请专利以外的行为,没
有任何限制。
3.补充
基本上,作者十分欢迎复制本软件。如果要表示对作者的感谢,请将本软件推荐给更多的
人,并复制给他们使用。作者希望有更多的人使用本软件,因此对于复制的行为非常支持。
除此之外,如果可以将使用后的感想发给作者,作者一定会感到更加高兴。
对于本协议所授权的软件,仅修改著作权信息并再次发布的行为,本协议并没有禁止,而
是作为派生物来处理。这并不是一个漏洞。因此,如果你认为有必要仅修改著作权信息并再
次发布本软件,是完全可以这样做的。
除了修复bug、增加新功能等修改行为以外对于为代码添加注释增加易读性、对文档进行
补充等,不会反映在编译产物及运行结果上的修改也同样欢迎。如果生成了这样的派生物,
欢迎和作者联系(但这并不是义务)。
如果你有任何疑问,或者对于制作派生物方面感到缺少某些信息,可以向作者提问。但是,
受作者精力所限可能无法一一进行回复,请大家谅解。对于协议本身漏洞的指摘,请联系作
者或川合堂。
也许,对于本协议所授权的软件中所使用的技术,禁止未经作者允许申请专利这一点,和
日本的专利法是向抵触的(希望大家提出自己的见解)。对此,最初提出本协议的川合秀实
的见解如下。
指定专利法的背景,是因为如果发明者为了保护自己发明所带来的利益,而拒绝将发明的
详情公开,会阻碍科学技术的进步,因此在法律上对于其所公开的内容,在一定时间内给予
独家使用的保护,这是专利法的精神所在。在本协议中,作者并没有故意隐藏发明的详细内
容,因此即便禁止对其申请专利我认为也不违背专利法的精神。相反,不理解本协议精神的
人,如果申请了专利并对原创的软件及派生物收取授权费用,这种担心反倒阻碍了科学技术
的进步。因此,本协议的目的是事先消除这种担心,我认为和专利法是不抵触的。
当然,最稳妥的做法是,作者对原创软件中可以被认作发明的全部内容申请并取得专利,
事前防止其他人来取得相关的专利,但是这对于作者来说负担很大。申请专利的负担和是否
公开软件内容之间必须要有所取舍的话,可能有些人会放弃公开软件内容。这并不是专利法
精神所期待的,也不符合我们的目的(参见“1.目的”)。
此外,当发明的详细内容由于专利法的形式限制没有记述并明确的,由作者以外的人在未
经许可的情况下将其解析并明确的行为,在本协议中是允许的。对于这部分内容,可以无偿
公开,也可以有偿出售。
不过,对于协议所授权的软件中的所有技术,并不能保证在使用时完全避免支付授权费用
的可能性。如果在发布的时间点仍然有效的专利技术,在软件中被使用的话,该专利的所有
者可以要求支付授权费用。本协议所保证的不收取专利授权费用,是针对软件内被认为是新
发明的那一部分技术。
如果需要将本协议适用于自己开发的软件,在事前事后均无须经过作者同意,可任意使用。
如果有任何不方便之处,可以对协议文本进行修改。如需修改协议文本,为了避免歧义,请
同时修改协议的名称。
4.链接
川合堂URL http://www.imasy.org/~mone/kawaido/
川合秀实URL http://www.imasy.org/~kawai/
e-mail kawai@imasy.org

View File

@@ -7,7 +7,11 @@
运行方法,在 `tolset` 中新建一个 `run` 文件夹,把代码拷贝进去,然后根据系统版本运行 `!cons_**.bat`
一般都是使用 `make run` 运行代码。可以直接看书。
一般都是使用 `make run` 运行代码27天开始使用 `make run_full`。可以直接看书。
## 完成效果
![Screen](Screen.png)
## 内容简介
@@ -49,51 +53,6 @@
剩下的两天用来润色加工。这两天我们来做一些之前没来得及做,但做起来既简单又有趣的内容。
## 川合堂许可协议
### 概要
通俗地说:“这是自由软件,使用前使用后都无须支付任何费用,可以自由使用,也可以
复制、修改以及用于商业目的但是作者对软件的bug以及因此所造成的损失不负任何责
任。”
为了保护软件使用者以及软件修改者、参考者的利益,即便作者将来为该软件中所使用的
算法申请专利,也保证不会向使用者收取授权费用。
### 目的
适用于本协议的软件,旨在为公众带来利益,以及为软件技术的进步做出贡献。
#### 宗旨
本协议并不代表作者放弃著作权(仅放弃独家复制发布的权利),使用者可以自由复制并
再次发布本软件的一部分甚至全部内容。使用时无须支付任何费用,对本软件的解析、修改
也无须支付任何费用。
适用于本协议的软件,可以无条件地用作商业目的,甚至可以将软件直接有偿出售。
对于以适用于本协议的软件的一部分或全部内容为基础,在此之上所开发的软件(下称“
派生物”),可以赋予任何种类的许可协议。即,派生物的作者可以禁止对派生物进行复制,
也可以只允许派生物以有偿形式发布。派生物的著作权属于该派生物的生成者,适用于本协
议的软件作者不会对其派生物主张著作权。
在派生物的文档中,没有义务对原始软件的作者进行介绍,但这句话,理所当然地,不意
味着禁止这一行为。
在发布派生物时,没有义务取得原始软件作者的同意,但这句话,理所当然地,不意味着
禁止这一行为。
作者不对软件的质量作出任何保证,因此,由于使用本软件所造成的损害,或者没有达到
所期望的结果,作者不负任何责任。
对于适用于本协议的软件中所使用的技术,除了事先取得作者授权的人以外,禁止其他人
对其申请专利。但如果附加了新的技术并生成了派生物,允许对于追加的部分申请专利。作
者在将来有可能对软件中的技术申请专利,但保证不会向派生物以及软件的使用收取授权费
用。本保证不仅适用于申请专利之前所生成的派生物,也适用于专利取得后所生成的派生物。
将解析结果汇总并申请专利,需要事先取得作者的同意,但对于申请专利以外的行为,没
有任何限制。
### Links
[川合堂](http://www.imasy.org/~mone/kawaido/)

BIN
Screen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB