Skip to content

Commit

Permalink
bball
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed May 19, 2016
1 parent 73b7421 commit 0adab93
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 43 deletions.
88 changes: 45 additions & 43 deletions 29_day/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ haribote.img : haribote/ipl20.bin haribote/haribote.sys Makefile \
lines/lines.hrb walk/walk.hrb noodle/noodle.hrb \
beepdown/beepdown.hrb color/color.hrb color2/color2.hrb \
sosu/sosu.hrb sosu2/sosu2.hrb sosu3/sosu3.hrb \
type/type.hrb iroha/iroha.hrb chklang/chklang.hrb
type/type.hrb iroha/iroha.hrb chklang/chklang.hrb \
notrec/notrec.hrb bball/bball.hrb
$(EDIMG) imgin:../z_tools/fdimg0at.tek \
wbinimg src:haribote/ipl20.bin len:512 from:0 to:0 \
copy from:haribote/haribote.sys to:@: \
Expand Down Expand Up @@ -49,8 +50,9 @@ haribote.img : haribote/ipl20.bin haribote/haribote.sys Makefile \
copy from:type/type.hrb to:@: \
copy from:iroha/iroha.hrb to:@: \
copy from:chklang/chklang.hrb to:@: \
copy from:notrec/notrec.hrb to:@: \
copy from:euc.txt to:@: \
copy from:notrec/notrec.hrb to:@: \
copy from:bball/bball.hrb to:@: \
copy from:nihongo/nihongo.fnt to:@: \
imgout:haribote.img

Expand All @@ -68,7 +70,6 @@ install :
full :
$(MAKE) -C haribote
$(MAKE) -C apilib
$(MAKE) -C stdlib
$(MAKE) -C a
$(MAKE) -C hello3
$(MAKE) -C hello4
Expand All @@ -92,6 +93,7 @@ full :
$(MAKE) -C iroha
$(MAKE) -C chklang
$(MAKE) -C notrec
$(MAKE) -C bball
$(MAKE) haribote.img

run_full :
Expand All @@ -116,59 +118,59 @@ src_only :

clean_full :
$(MAKE) -C haribote clean
$(MAKE) -C apilib clean
$(MAKE) -C stdlib clean
$(MAKE) -C a clean
$(MAKE) -C hello3 clean
$(MAKE) -C hello4 clean
$(MAKE) -C hello5 clean
$(MAKE) -C apilib clean
$(MAKE) -C a clean
$(MAKE) -C hello3 clean
$(MAKE) -C hello4 clean
$(MAKE) -C hello5 clean
$(MAKE) -C winhelo clean
$(MAKE) -C winhelo2 clean
$(MAKE) -C winhelo3 clean
$(MAKE) -C star1 clean
$(MAKE) -C stars clean
$(MAKE) -C stars2 clean
$(MAKE) -C lines clean
$(MAKE) -C walk clean
$(MAKE) -C noodle clean
$(MAKE) -C star1 clean
$(MAKE) -C stars clean
$(MAKE) -C stars2 clean
$(MAKE) -C lines clean
$(MAKE) -C walk clean
$(MAKE) -C noodle clean
$(MAKE) -C beepdown clean
$(MAKE) -C color clean
$(MAKE) -C color2 clean
$(MAKE) -C sosu clean
$(MAKE) -C sosu2 clean
$(MAKE) -C sosu3 clean
$(MAKE) -C type clean
$(MAKE) -C iroha clean
$(MAKE) -C color clean
$(MAKE) -C color2 clean
$(MAKE) -C sosu clean
$(MAKE) -C sosu2 clean
$(MAKE) -C sosu3 clean
$(MAKE) -C type clean
$(MAKE) -C iroha clean
$(MAKE) -C chklang clean
$(MAKE) -C notrec clean
$(MAKE) -C notrec clean
$(MAKE) -C bball clean

src_only_full :
$(MAKE) -C haribote src_only
$(MAKE) -C apilib src_only
$(MAKE) -C stdlib src_only
$(MAKE) -C a src_only
$(MAKE) -C hello3 src_only
$(MAKE) -C hello4 src_only
$(MAKE) -C hello5 src_only
$(MAKE) -C apilib src_only
$(MAKE) -C a src_only
$(MAKE) -C hello3 src_only
$(MAKE) -C hello4 src_only
$(MAKE) -C hello5 src_only
$(MAKE) -C winhelo src_only
$(MAKE) -C winhelo2 src_only
$(MAKE) -C winhelo3 src_only
$(MAKE) -C star1 src_only
$(MAKE) -C stars src_only
$(MAKE) -C stars2 src_only
$(MAKE) -C lines src_only
$(MAKE) -C walk src_only
$(MAKE) -C noodle src_only
$(MAKE) -C star1 src_only
$(MAKE) -C stars src_only
$(MAKE) -C stars2 src_only
$(MAKE) -C lines src_only
$(MAKE) -C walk src_only
$(MAKE) -C noodle src_only
$(MAKE) -C beepdown src_only
$(MAKE) -C color src_only
$(MAKE) -C color2 src_only
$(MAKE) -C sosu src_only
$(MAKE) -C sosu2 src_only
$(MAKE) -C sosu3 src_only
$(MAKE) -C type src_only
$(MAKE) -C iroha src_only
$(MAKE) -C color src_only
$(MAKE) -C color2 src_only
$(MAKE) -C sosu src_only
$(MAKE) -C sosu2 src_only
$(MAKE) -C sosu3 src_only
$(MAKE) -C type src_only
$(MAKE) -C iroha src_only
$(MAKE) -C chklang src_only
$(MAKE) -C notrec src_only
$(MAKE) -C notrec src_only
$(MAKE) -C bball src_only
-$(DEL) haribote.img

refresh :
Expand Down
1 change: 1 addition & 0 deletions 29_day/bball/!cons_9x.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
command
1 change: 1 addition & 0 deletions 29_day/bball/!cons_nt.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cmd.exe
5 changes: 5 additions & 0 deletions 29_day/bball/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
APP = bball
STACK = 52k
MALLOC = 0k

include ../app_make.txt
37 changes: 37 additions & 0 deletions 29_day/bball/bball.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#include "apilib.h"

void HariMain(void)
{
int win, i, j, dis;
char buf[216 * 237];
struct POINT {
int x, y;
};
static struct POINT table[16] = {
{ 204, 129 }, { 195, 90 }, { 172, 58 }, { 137, 38 }, { 98, 34 },
{ 61, 46 }, { 31, 73 }, { 15, 110 }, { 15, 148 }, { 31, 185 },
{ 61, 212 }, { 98, 224 }, { 137, 220 }, { 172, 200 }, { 195, 168 },
{ 204, 129 }
};

win = api_openwin(buf, 216, 237, -1, "bball");
api_boxfilwin(win, 8, 29, 207, 228, 0);
for (i = 0; i <= 14; i++) {
for (j = i + 1; j <= 15; j++) {
dis = j - i; /*两点间的距离*/
if (dis >= 8) {
dis = 15 - dis; /*逆向计数*/
}
if (dis != 0) {
api_linewin(win, table[i].x, table[i].y, table[j].x, table[j].y, 8 - dis);
}
}
}

for (;;) {
if (api_getkey(1) == 0x0a) {
break; /*按下回车键则break; */
}
}
api_end();
}
1 change: 1 addition & 0 deletions 29_day/bball/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
..\..\z_tools\make.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
10 changes: 10 additions & 0 deletions 29_day/haribote/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,16 @@ int *hrb_api(int edi, int esi, int ebp, int esp, int ebx, int edx, int ecx, int
sht = (struct SHEET *) (ebx & 0xfffffffe);
hrb_api_linewin(sht, eax, ecx, esi, edi, ebp);
if ((ebx & 1) == 0) {
if (eax > esi) {
i = eax;
eax = esi;
esi = i;
}
if (ecx > edi) {
i = ecx;
ecx = edi;
edi = i;
}
sheet_refresh(sht, eax, ecx, esi + 1, edi + 1);
}
} else if (edx == 14) {
Expand Down

0 comments on commit 0adab93

Please sign in to comment.