[Reduction] #210: egc_shift_left_all

... yeah.
This commit is contained in:
nmlgc 2014-08-27 04:57:37 +02:00
parent 7240b80154
commit 9bdc776f19
2 changed files with 122 additions and 96 deletions

View File

@ -0,0 +1,119 @@
; master library -
;
; Description:
; EGCによる左スクロール
;
; Functions/Procedures:
; void egc_shift_left_all(int dots);
;
; Parameters:
; dots
;
; Returns:
; none
;
; Binding Target:
; Microsoft-C / Turbo-C / Turbo Pascal
;
; Running Target:
; PC-9801VX
;
; Requiring Resources:
; CPU: 186
; EGC
;
; Notes:
;
;
; Assembly Language Note:
;
;
; Compiler/Assembler:
; TASM 3.0
; OPTASM 1.6
;
; Author:
; Kazumi
;
; Revision History:
;$Id: lshifta.asm 0.04 92/05/28 22:57:03 Kazumi Rel $
; 94/ 5/16 Initial: egcsftla.asm/master.lib 0.23
;
func EGC_SHIFT_LEFT_ALL ; egc_shift_left_all() {
push BP
mov BP,SP
push DS
push SI
push DI
x = (RETSIZE+1)*2
mov BX,[BP+x]
mov AL,00000111b ; RegWriteEnable
out 6ah,AL
mov AL,80h ; CGmode = 1
out 7ch,AL
mov AL,05h ; ExBit = 1
out 6ah,AL
mov DX,04a0h
mov AX,0fff0h ; アクティブプレーン
out DX,AX
mov DX,04a2h
mov AX,00ffh ; FGC/BGC/リードプレーン
out DX,AX
mov DX,04a4h
mov AX,28f0h ; モードレジスタ/ROPコードレジスタ
out DX,AX
mov DX,04a8h
mov AX,0ffffh ; マスクレジスタ
out DX,AX
mov DX,04ach
mov AX,BX ; dir/Bitアドレス
and AX,000fh
out DX,AX
mov DX,04aeh
mov AX,639
sub AX,BX ; ビット長
out DX,AX
cld
mov AX,0a800h
mov DS,AX
mov ES,AX
mov SI,0000h
mov DI,0fffeh
mov AX,BX
shr BX,4
mov BP,41
sub BP,BX
shl BX,1
dec AX ; 94/05/13 dots が 16 の倍数のとき
shr AX,4
shl AX,1
add SI,AX
mov DX,2
sub DX,BX
mov BX,400
EVEN
@@next_line: mov CX,BP
rep movsw
sub SI,DX
sub DI,DX
dec BX
jne @@next_line
mov DX,04a0h
mov AX,0fff0h
out DX,AX
mov AL,04h ; ExBit = 0
out 6ah,AL
mov AL,00h ; GRCG stop
out 7ch,AL
mov AL,00000110b ; RegWriteDIsable
out 6ah,AL
pop DI
pop SI
pop DS
pop BP
ret 1*2
endfunc ; }

View File

@ -45,100 +45,7 @@ include libs/master.lib/dos_keyclear.asm
include libs/master.lib/dos_puts2.asm
include libs/master.lib/dos_setvect.asm
include libs/master.lib/egc.asm
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_734 proc far
; sub_ADE2+118P
arg_0 = word ptr 6
push bp
mov bp, sp
push ds
push si
push di
mov bx, [bp+arg_0]
mov al, 7
out 6Ah, al ; PC-98 GDC (6a):
;
mov al, 80h ; '€'
out 7Ch, al
mov al, 5
out 6Ah, al ; PC-98 GDC (6a):
;
mov dx, 4A0h
mov ax, 0FFF0h
out dx, ax
mov dx, 4A2h
mov ax, 0FFh
out dx, ax
mov dx, 4A4h
mov ax, 28F0h
out dx, ax
mov dx, 4A8h
mov ax, 0FFFFh
out dx, ax
mov dx, 4ACh
mov ax, bx
and ax, 0Fh
out dx, ax
mov dx, 4AEh
mov ax, 27Fh
sub ax, bx
out dx, ax
cld
mov ax, 0A800h
mov ds, ax
assume ds:nothing
mov es, ax
assume es:nothing
mov si, 0
mov di, 0FFFEh
mov ax, bx
shr bx, 4
mov bp, 29h ; ')'
sub bp, bx
shl bx, 1
dec ax
shr ax, 4
shl ax, 1
add si, ax
mov dx, 2
sub dx, bx
mov bx, 190h
nop
loc_7A2:
mov cx, bp
rep movsw
sub si, dx
sub di, dx
dec bx
jnz short loc_7A2
mov dx, 4A0h
mov ax, 0FFF0h
out dx, ax
mov al, 4
out 6Ah, al ; PC-98 GDC (6a):
;
mov al, 0
out 7Ch, al
mov al, 6
out 6Ah, al ; PC-98 GDC (6a):
;
pop di
pop si
pop ds
assume ds:dseg
pop bp
retf 2
sub_734 endp
; ---------------------------------------------------------------------------
nop
include libs/master.lib/egc_shift_left_all.asm
; =============== S U B R O U T I N E =======================================
@ -17448,7 +17355,7 @@ var_2 = word ptr -2
push 0
call sub_C37B
push 2
call sub_734
call egc_shift_left_all
mov Palettes+45, 0
mov Palettes+46, 0
mov Palettes+47, 0
@ -17506,7 +17413,7 @@ loc_AEE1:
mov dx, 0A6h ; '¦'
out dx, al ; Interrupt Controller #2, 8259A
push 4
call sub_734
call egc_shift_left_all
sub si, 2
loc_AF02: