From 1276b727ff62db01664d06d740325761d78b29f6 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Mon, 1 Sep 2014 07:39:11 +0200 Subject: [PATCH] [Reduction] #425: grcg_settile_1line --- libs/master.lib/grcg_settile_1line.asm | 70 ++++++++++++++++++++++++++ th03_main.asm | 36 ++----------- 2 files changed, 74 insertions(+), 32 deletions(-) create mode 100644 libs/master.lib/grcg_settile_1line.asm diff --git a/libs/master.lib/grcg_settile_1line.asm b/libs/master.lib/grcg_settile_1line.asm new file mode 100644 index 00000000..e1986243 --- /dev/null +++ b/libs/master.lib/grcg_settile_1line.asm @@ -0,0 +1,70 @@ +PAGE 98,120 +; graphics - grcg - tile - 1line +; +; Description: +; タイルパターンの設定(1 line) +; +; Function/Procedures: +;C: void [_far] _pascal grcg_settile_1line( int mode, long tile ) ; +; +;Pas: procedure grcg_settile_1line( mode : integer, tile : longint ) ; + +; Parameters: +; int mode GRCGのモード。 +; long tile タイルパターン。下位バイトから1バイト単位に +; B,R,G,Iプレーンとなる。 +; 0x000000FFLが、青プレーンのみ全てON,それ以外 +; 全てOFFの値となる。 +; +; Binding Target: +; Microsoft-C / Turbo-C / Turbo Pascal +; +; Running Target: +; NEC PC-9801 Normal mode +; +; Requiring Resources: +; CPU: V30 +; GRAPHICS ACCERALATOR: GRCG +; +; Compiler/Assembler: +; TASM 3.0 +; OPTASM 1.6 ( MASM 5.0互換ならば OK ) +; +; NOTES: +; +; AUTHOR: +; 恋塚昭彦 +; +; 関連関数: +; grcg_setcolor() +; grcg_off() +; +; HISTORY: +; 92/ 6/28 Initial + +func GRCG_SETTILE_1LINE + mov CX,BP + mov BP,SP + + ; parameters + @@mode = (retsize+2)*2 + @@tileh = (retsize+1)*2 + @@tilel = (retsize+0)*2 + + mov AL,[BP+@@mode] + out 7ch,AL + mov DX,007eh + + mov AX,[BP+@@tilel] + out DX,AL ; B + mov AL,AH + out DX,AL ; R + + mov AX,[BP+@@tileh] + out DX,AL ; G + mov AL,AH + out DX,AL ; I + + mov BP,CX + ret 6 +endfunc diff --git a/th03_main.asm b/th03_main.asm index 3fcf9705..e0fba5d6 100644 --- a/th03_main.asm +++ b/th03_main.asm @@ -57,35 +57,7 @@ include libs/master.lib/grcg_fill.asm include libs/master.lib/grcg_hline.asm include libs/master.lib/grcg_line.asm include libs/master.lib/grcg_setcolor.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_F8C proc far - ; sub_14511+91P ... - -arg_0 = word ptr 4 -arg_2 = word ptr 6 -arg_4 = byte ptr 8 - - mov cx, bp - mov bp, sp - mov al, [bp+arg_4] - out 7Ch, al - mov dx, 7Eh ; '~' - mov ax, [bp+arg_0] - out dx, al - mov al, ah - out dx, al - mov ax, [bp+arg_2] - out dx, al - mov al, ah - out dx, al - mov bp, cx - retf 6 -sub_F8C endp - +include libs/master.lib/grcg_settile_1line.asm include libs/master.lib/grcg_triangle.asm include libs/master.lib/grcg_vline.asm @@ -24864,7 +24836,7 @@ var_2 = word ptr -2 call egc_off push 0C0h ; '' push large 0AA0055AAh - call sub_F8C + call grcg_settile_1line mov [bp+var_4], 0 mov si, 0Bh jmp short loc_14594 @@ -24906,7 +24878,7 @@ loc_14594: jg short loc_1454D push 0C0h ; '' push large 0FF00AA55h - call sub_F8C + call grcg_settile_1line mov [bp+var_4], 0 mov si, 6 jmp short loc_145F8 @@ -24948,7 +24920,7 @@ loc_145F8: jg short loc_145B1 push 0C0h ; '' push large 0FF55FF55h - call sub_F8C + call grcg_settile_1line mov [bp+var_4], 0 mov si, 3 jmp short loc_1465C