[Reduction] #387: text_boxfilla

This commit is contained in:
nmlgc 2014-08-31 05:25:58 +02:00
parent c34c0aa09f
commit 8f6d34cfe5
4 changed files with 103 additions and 159 deletions

View File

@ -0,0 +1,95 @@
; master library - PC98
;
; Description:
; テキスト画面の長方形範囲を指定属性で埋める
;
; Function/Procedures:
; void text_boxfilla( unsigned x1, unsigned y1, unsigned x2, unsigned y2,
; unsigned atrb ) ;
;
; Parameters:
; unsigned x1 左端の横座標( 0 〜 79 )
; unsigned y1 上端の縦座標( 0 〜 24 )
; unsigned x2 右端の横座標( 0 〜 79 )
; unsigned y2 下端の縦座標( 0 〜 24 )
; unsigned atrb 属性
;
; Returns:
; none
;
; Binding Target:
; Microsoft-C / Turbo-C / Turbo Pascal
;
; Running Target:
; PC-9801
;
; Requiring Resources:
; CPU: 8086
;
; Notes:
; x1 <= x2 かつ y1 <= y2でなければならない。
;
; Compiler/Assembler:
; TASM 3.0
; OPTASM 1.6
;
; Author:
; 恋塚昭彦
;
; Revision History:
; 92/11/15 Initial
func TEXT_BOXFILLA
push DI
pushf
CLI
add SP,(2+retsize)*2
; パラメータ領域の先頭( flags,DI,retadr )
pop AX ; color
pop DX ; y2
pop BX ; x2
pop CX ; Y1
mov DI,CX
shl DI,1
shl DI,1
add DI,CX
shl DI,1
add DI,TextVramSeg
add DI,200h
mov ES,DI ; これで ESに (0,y1)のテキスト属性セグメントが入った
pop DI ; X1
sub SP,(5+2+retsize)*2
; (5(パラメータの数)+1(リターンアドレス)+2(DI,flags))*2
popf
sub BX,DI ; BX = X2 - X1 + 1
inc BX ;
sub DX,CX
mov CX,DX
shl DX,1
shl DX,1
add DX,CX
shl DX,1
shl DX,1
shl DX,1
shl DX,1
add DI,DX
shl DI,1 ; これで DI には(x1,y2)のoffsetが入った。
lea DX,[BX+80]
shl DX,1 ; 毎回の減少分
EVEN
@@SLOOP: mov CX,BX
rep stosw ; 一行分の書き込み
sub DI,DX ; 下の行に移動
jnb short @@SLOOP
pop DI
ret 10
endfunc

View File

@ -1477,56 +1477,7 @@ include libs/master.lib/random.asm
include libs/master.lib/rottbl.asm
include libs/master.lib/smem_release.asm
include libs/master.lib/smem_wget.asm
; =============== S U B R O U T I N E =======================================
sub_25DA proc far
push di
pushf
cli
add sp, 8
pop ax
pop dx
pop bx
pop cx
mov di, cx
shl di, 1
shl di, 1
add di, cx
shl di, 1
add di, TextVramSeg
add di, 200h
mov es, di
pop di
sub sp, 12h
popf
sub bx, di
inc bx
sub dx, cx
mov cx, dx
shl dx, 1
shl dx, 1
add dx, cx
shl dx, 1
shl dx, 1
shl dx, 1
shl dx, 1
add di, dx
shl di, 1
lea dx, [bx+50h]
shl dx, 1
nop
loc_261C:
mov cx, bx
rep stosw
sub di, dx
jnb short loc_261C
pop di
retf 0Ah
sub_25DA endp
include libs/master.lib/text_boxfilla.asm
include libs/BorlandC/text_clear.asm
include libs/master.lib/text_fillca.asm
@ -8198,7 +8149,7 @@ loc_B8B5:
push large 40001h
push large 330017h
push 5
call sub_25DA
call text_boxfilla
push 30h ; '0' ; n
push ds
push offset unk_1F4AD ; src

View File

@ -1551,56 +1551,7 @@ loc_1F83:
retn
sub_1F78 endp
; =============== S U B R O U T I N E =======================================
sub_1F8C proc far
push di
pushf
cli
add sp, 8
pop ax
pop dx
pop bx
pop cx
mov di, cx
shl di, 1
shl di, 1
add di, cx
shl di, 1
add di, TextVramSeg
add di, 200h
mov es, di
pop di
sub sp, 12h
popf
sub bx, di
inc bx
sub dx, cx
mov cx, dx
shl dx, 1
shl dx, 1
add dx, cx
shl dx, 1
shl dx, 1
shl dx, 1
shl dx, 1
add di, dx
shl di, 1
lea dx, [bx+50h]
shl dx, 1
nop
loc_1FCE:
mov cx, bx
rep stosw
sub di, dx
jnb short loc_1FCE
pop di
retf 0Ah
sub_1F8C endp
include libs/master.lib/text_boxfilla.asm
include libs/BorlandC/text_clear.asm
include libs/master.lib/text_fillca.asm
@ -8406,11 +8357,11 @@ sub_B8F7 proc far
push large 20001h
push large 250018h
push 0E1h ; 'á'
call sub_1F8C
call text_boxfilla
push large 2A0001h
push large 4D0018h
push 0E1h ; 'á'
call sub_1F8C
call text_boxfilla
pop bp
retf
sub_B8F7 endp

View File

@ -1586,60 +1586,7 @@ loc_249F:
retn
sub_2494 endp
; =============== S U B R O U T I N E =======================================
sub_24A8 proc far
push di
pushf
cli
add sp, 8
pop ax
pop dx
pop bx
pop cx
mov di, cx
shl di, 1
shl di, 1
add di, cx
shl di, 1
add di, TextVramSeg
add di, 200h
mov es, di
pop di
sub sp, 12h
popf
sub bx, di
inc bx
sub dx, cx
mov cx, dx
shl dx, 1
shl dx, 1
add dx, cx
shl dx, 1
shl dx, 1
shl dx, 1
shl dx, 1
add di, dx
shl di, 1
lea dx, [bx+50h]
shl dx, 1
nop
loc_24EA:
mov cx, bx
rep stosw
loc_24EE:
sub di, dx
jnb short loc_24EA
pop di
locret_24F3:
retf 0Ah
sub_24A8 endp
include libs/master.lib/text_boxfilla.asm
include libs/BorlandC/text_clear.asm
include libs/master.lib/text_fillca.asm
@ -15222,11 +15169,11 @@ loc_F1F2:
push large 140014h
push large 320017h
push 21h ; '!'
call sub_24A8
call text_boxfilla
push large 6000Ch
push large 24000Fh
push 21h ; '!'
call sub_24A8
call text_boxfilla
push word_2C934
push word_2C936
call sub_EF74