Skip to content

Commit

Permalink
关闭窗口
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed May 10, 2016
1 parent 975bb8c commit 8de80dc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions 23_day/a_nask.nas
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
GLOBAL _api_point
GLOBAL _api_refreshwin
GLOBAL _api_linewin
GLOBAL _api_closewin

[SECTION .text]

Expand Down Expand Up @@ -170,3 +171,11 @@ _api_linewin: ; void api_linewin(int win, int x0, int y0, int x1, int y1, int c
POP ESI
POP EDI
RET

_api_closewin: ; void api_closewin(int win);
PUSH EBX
MOV EDX,14
MOV EBX,[ESP+8] ; win
INT 0x40
POP EBX
RET
2 changes: 2 additions & 0 deletions 23_day/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ int *hrb_api(int edi, int esi, int ebp, int esp, int ebx, int edx, int ecx, int
if ((ebx & 1) == 0) {
sheet_refresh(sht, eax, ecx, esi + 1, edi + 1);
}
} else if (edx == 14) {
sheet_free((struct SHEET *) ebx);
}
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions 23_day/lines.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ void api_initmalloc(void);
char *api_malloc(int size);
void api_refreshwin(int win, int x0, int y0, int x1, int y1);
void api_linewin(int win, int x0, int y0, int x1, int y1, int col);
void api_closewin(int win);
void api_end(void);

void HariMain(void)
Expand All @@ -17,5 +18,6 @@ void HariMain(void)
api_linewin(win + 1, 88, 26, i * 9 + 88, 89, i);
}
api_refreshwin(win, 6, 26, 154, 90);
api_closewin(win);
api_end();
}

0 comments on commit 8de80dc

Please sign in to comment.