mirror of https://github.com/nmlgc/ReC98.git
[Reduction] #243: egc_shift_right
This commit is contained in:
parent
b67d68409e
commit
cc2d874c26
|
@ -0,0 +1,192 @@
|
|||
; master library -
|
||||
;
|
||||
; Description:
|
||||
; EGCによる部分右スクロール
|
||||
;
|
||||
; Functions/Procedures:
|
||||
; void egc_shift_right(int x1, int y1, int x2, int y2, int dots);
|
||||
;
|
||||
; Parameters:
|
||||
; x1, y1
|
||||
; x2, y2
|
||||
; 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: rshift.asm 0.04 92/05/28 23:00:46 Kazumi Rel $
|
||||
; 94/ 5/16 Initial: egcsftr.asm/master.lib 0.23
|
||||
;
|
||||
|
||||
func EGC_SHIFT_RIGHT ; egc_shift_right() {
|
||||
push BP
|
||||
mov BP,SP
|
||||
push DS
|
||||
push SI
|
||||
push DI
|
||||
|
||||
x1 = (RETSIZE+5)*2
|
||||
y1 = (RETSIZE+4)*2
|
||||
x2 = (RETSIZE+3)*2
|
||||
y2 = (RETSIZE+2)*2
|
||||
dots = (RETSIZE+1)*2
|
||||
|
||||
mov CX,[BP+x1]
|
||||
mov DX,[BP+x2]
|
||||
mov SI,[BP+y2]
|
||||
mov DI,[BP+dots]
|
||||
mov AX,DI
|
||||
dec AX ; 94/05/13 dots が 16 の倍数のとき
|
||||
shr AX,4
|
||||
shl AX,1
|
||||
mov BYTE PTR CS:[egcsftr_start_di],AL
|
||||
mov AX,SI
|
||||
sub AX,[BP+y1]
|
||||
mov BX,AX
|
||||
inc BX ; line count
|
||||
mov AX,SI
|
||||
shl SI,2
|
||||
add SI,AX
|
||||
shl SI,4 ; y2 * 80
|
||||
mov AX,DX
|
||||
shr AX,3
|
||||
and AX,0fffeh ; LSB = 0
|
||||
add SI,AX ; start address
|
||||
shr AX,1
|
||||
mov BP,CX
|
||||
shr BP,4
|
||||
sub AX,BP
|
||||
inc AX
|
||||
mov BP,DX
|
||||
sub BP,CX ; bit length(not inc !!)
|
||||
mov CX,AX ; 転送 word 数
|
||||
mov AX,DX
|
||||
add DX,DI
|
||||
and DL,0fh
|
||||
mov DH,15
|
||||
sub DH,DL ; Dest Bit Address
|
||||
and AL,0fh
|
||||
mov AH,15
|
||||
sub AH,AL ; Src Bit Address
|
||||
mov AL,AH
|
||||
xor AH,AH
|
||||
mov DL,DH
|
||||
xor DH,DH
|
||||
push BX
|
||||
push BP
|
||||
mov BX,BP
|
||||
add BX,AX
|
||||
shr BX,4
|
||||
add BP,DX
|
||||
shr BP,4
|
||||
cmp AL,DL
|
||||
je short @@none
|
||||
jl short @@less
|
||||
cmp BX,BP
|
||||
jne short @@none
|
||||
jmp SHORT @@plus
|
||||
EVEN
|
||||
@@less: cmp BX,BP
|
||||
jge short @@none
|
||||
EVEN
|
||||
@@plus: inc CX
|
||||
EVEN
|
||||
@@none: pop BP
|
||||
pop BX
|
||||
shl DL,4
|
||||
or DL,AL
|
||||
mov DI,DX
|
||||
mov AX,41
|
||||
sub AX,CX
|
||||
shl AX,1
|
||||
mov BYTE PTR CS:[egcsftr_sub_si],AL
|
||||
mov BYTE PTR CS:[egcsftr_sub_di],AL
|
||||
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,DI ; Dir/Bitアドレス
|
||||
or AX,1000h ; Dir = 1
|
||||
out DX,AX
|
||||
mov DX,04aeh
|
||||
mov AX,BP ; ビット長
|
||||
out DX,AX
|
||||
std
|
||||
mov AX,0a800h
|
||||
mov DS,AX
|
||||
mov ES,AX
|
||||
mov DI,SI
|
||||
inc DI
|
||||
inc DI
|
||||
add DI,80 ; dummy
|
||||
egcsftr_start_di EQU $-1
|
||||
mov DX,CX
|
||||
EVEN
|
||||
@@next_line: mov CX,DX
|
||||
rep movsw
|
||||
inc SI
|
||||
inc SI
|
||||
inc DI
|
||||
inc DI
|
||||
sub SI,80 ; dummy
|
||||
egcsftr_sub_si EQU $-1
|
||||
sub DI,80 ; dummy
|
||||
egcsftr_sub_di EQU $-1
|
||||
dec BX
|
||||
jne @@next_line
|
||||
cld
|
||||
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 5*2
|
||||
endfunc ; }
|
132
th04_main.asm
132
th04_main.asm
|
@ -92,135 +92,7 @@ include libs/master.lib/dos_setvect.asm
|
|||
include libs/master.lib/egc.asm
|
||||
include libs/master.lib/egc_shift_down.asm
|
||||
include libs/master.lib/egc_shift_left.asm
|
||||
|
||||
loc_B24:
|
||||
push bp
|
||||
mov bp, sp
|
||||
push ds
|
||||
push si
|
||||
push di
|
||||
mov cx, [bp+0Eh]
|
||||
mov dx, [bp+0Ah]
|
||||
mov si, [bp+8]
|
||||
mov di, [bp+6]
|
||||
mov ax, di
|
||||
dec ax
|
||||
shr ax, 4
|
||||
shl ax, 1
|
||||
mov cs:byte_C05, al
|
||||
mov ax, si
|
||||
sub ax, [bp+0Ch]
|
||||
mov bx, ax
|
||||
inc bx
|
||||
mov ax, si
|
||||
shl si, 2
|
||||
add si, ax
|
||||
shl si, 4
|
||||
mov ax, dx
|
||||
shr ax, 3
|
||||
and ax, 0FFFEh
|
||||
add si, ax
|
||||
shr ax, 1
|
||||
mov bp, cx
|
||||
shr bp, 4
|
||||
sub ax, bp
|
||||
inc ax
|
||||
mov bp, dx
|
||||
sub bp, cx
|
||||
mov cx, ax
|
||||
mov ax, dx
|
||||
add dx, di
|
||||
and dl, 0Fh
|
||||
mov dh, 0Fh
|
||||
sub dh, dl
|
||||
and al, 0Fh
|
||||
mov ah, 0Fh
|
||||
sub ah, al
|
||||
mov al, ah
|
||||
xor ah, ah
|
||||
mov dl, dh
|
||||
xor dh, dh
|
||||
push bx
|
||||
push bp
|
||||
mov bx, bp
|
||||
add bx, ax
|
||||
shr bx, 4
|
||||
add bp, dx
|
||||
shr bp, 4
|
||||
cmp al, dl
|
||||
jz short loc_BA8
|
||||
jl short loc_BA2
|
||||
cmp bx, bp
|
||||
jnz short loc_BA8
|
||||
jmp short loc_BA6
|
||||
; ---------------------------------------------------------------------------
|
||||
nop
|
||||
|
||||
loc_BA2:
|
||||
cmp bx, bp
|
||||
jge short loc_BA8
|
||||
|
||||
loc_BA6:
|
||||
inc cx
|
||||
nop
|
||||
|
||||
loc_BA8:
|
||||
pop bp
|
||||
pop bx
|
||||
shl dl, 4
|
||||
or dl, al
|
||||
mov di, dx
|
||||
mov ax, 29h ; ')'
|
||||
sub ax, cx
|
||||
shl ax, 1
|
||||
mov cs:byte_C12, al
|
||||
mov cs:byte_C15, al
|
||||
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, di
|
||||
or ax, 1000h
|
||||
out dx, ax
|
||||
mov dx, 4AEh
|
||||
mov ax, bp
|
||||
out dx, ax
|
||||
std
|
||||
mov ax, 0A800h
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov di, si
|
||||
inc di
|
||||
inc di
|
||||
; ---------------------------------------------------------------------------
|
||||
db 83h, 0C7h
|
||||
byte_C05 db 50h
|
||||
db 8Bh, 0D1h, 8Bh, 0CAh, 0F3h, 0A5h, 2 dup(46h), 2 dup(47h)
|
||||
db 83h, 0EEh
|
||||
byte_C12 db 50h
|
||||
db 83h, 0EFh
|
||||
byte_C15 db 50h
|
||||
db 4Bh, 75h, 0EFh, 0FCh, 0BAh, 0A0h, 4, 0B8h, 0F0h, 0FFh
|
||||
db 0EFh, 0B0h, 4, 0E6h, 6Ah, 0B0h, 0, 0E6h, 7Ch, 0B0h
|
||||
db 6, 0E6h, 6Ah, 5Fh, 5Eh, 1Fh, 5Dh, 0CAh, 0Ah, 0
|
||||
; ---------------------------------------------------------------------------
|
||||
include libs/master.lib/egc_shift_right.asm
|
||||
|
||||
loc_C34:
|
||||
push bp
|
||||
|
@ -20884,7 +20756,7 @@ loc_CD88:
|
|||
push large 200000h
|
||||
push large 19F018Fh
|
||||
push word_255BE
|
||||
call far ptr loc_B24
|
||||
call egc_shift_right
|
||||
|
||||
loc_CDA4:
|
||||
mov byte_22B9C, 2
|
||||
|
|
132
th05_main.asm
132
th05_main.asm
|
@ -49,135 +49,7 @@ include libs/master.lib/dos_setvect.asm
|
|||
include libs/master.lib/egc.asm
|
||||
include libs/master.lib/egc_shift_down.asm
|
||||
include libs/master.lib/egc_shift_left.asm
|
||||
|
||||
loc_AB2:
|
||||
push bp
|
||||
mov bp, sp
|
||||
push ds
|
||||
push si
|
||||
push di
|
||||
mov cx, [bp+0Eh]
|
||||
mov dx, [bp+0Ah]
|
||||
mov si, [bp+8]
|
||||
mov di, [bp+6]
|
||||
mov ax, di
|
||||
dec ax
|
||||
shr ax, 4
|
||||
shl ax, 1
|
||||
mov cs:byte_B93, al
|
||||
mov ax, si
|
||||
sub ax, [bp+0Ch]
|
||||
mov bx, ax
|
||||
inc bx
|
||||
mov ax, si
|
||||
shl si, 2
|
||||
add si, ax
|
||||
shl si, 4
|
||||
mov ax, dx
|
||||
shr ax, 3
|
||||
and ax, 0FFFEh
|
||||
add si, ax
|
||||
shr ax, 1
|
||||
mov bp, cx
|
||||
shr bp, 4
|
||||
sub ax, bp
|
||||
inc ax
|
||||
mov bp, dx
|
||||
sub bp, cx
|
||||
mov cx, ax
|
||||
mov ax, dx
|
||||
add dx, di
|
||||
and dl, 0Fh
|
||||
mov dh, 0Fh
|
||||
sub dh, dl
|
||||
and al, 0Fh
|
||||
mov ah, 0Fh
|
||||
sub ah, al
|
||||
mov al, ah
|
||||
xor ah, ah
|
||||
mov dl, dh
|
||||
xor dh, dh
|
||||
push bx
|
||||
push bp
|
||||
mov bx, bp
|
||||
add bx, ax
|
||||
shr bx, 4
|
||||
add bp, dx
|
||||
shr bp, 4
|
||||
cmp al, dl
|
||||
jz short loc_B36
|
||||
jl short loc_B30
|
||||
cmp bx, bp
|
||||
jnz short loc_B36
|
||||
jmp short loc_B34
|
||||
; ---------------------------------------------------------------------------
|
||||
nop
|
||||
|
||||
loc_B30:
|
||||
cmp bx, bp
|
||||
jge short loc_B36
|
||||
|
||||
loc_B34:
|
||||
inc cx
|
||||
nop
|
||||
|
||||
loc_B36:
|
||||
pop bp
|
||||
pop bx
|
||||
shl dl, 4
|
||||
or dl, al
|
||||
mov di, dx
|
||||
mov ax, 29h ; ')'
|
||||
sub ax, cx
|
||||
shl ax, 1
|
||||
mov cs:byte_BA0, al
|
||||
mov cs:byte_BA3, al
|
||||
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, di
|
||||
or ax, 1000h
|
||||
out dx, ax
|
||||
mov dx, 4AEh
|
||||
mov ax, bp
|
||||
out dx, ax
|
||||
std
|
||||
mov ax, 0A800h
|
||||
mov ds, ax
|
||||
mov es, ax
|
||||
mov di, si
|
||||
inc di
|
||||
inc di
|
||||
; ---------------------------------------------------------------------------
|
||||
db 83h, 0C7h
|
||||
byte_B93 db 50h
|
||||
db 8Bh, 0D1h, 8Bh, 0CAh, 0F3h, 0A5h, 2 dup(46h), 2 dup(47h)
|
||||
db 83h, 0EEh
|
||||
byte_BA0 db 50h
|
||||
db 83h, 0EFh
|
||||
byte_BA3 db 50h
|
||||
db 4Bh, 75h, 0EFh, 0FCh, 0BAh, 0A0h, 4, 0B8h, 0F0h, 0FFh
|
||||
db 0EFh, 0B0h, 4, 0E6h, 6Ah, 0B0h, 0, 0E6h, 7Ch, 0B0h
|
||||
db 6, 0E6h, 6Ah, 5Fh, 5Eh, 1Fh, 5Dh, 0CAh, 0Ah, 0
|
||||
; ---------------------------------------------------------------------------
|
||||
include libs/master.lib/egc_shift_right.asm
|
||||
|
||||
loc_BC2:
|
||||
push bp
|
||||
|
@ -27854,7 +27726,7 @@ loc_102F0:
|
|||
push large 200000h
|
||||
push large 19F018Fh
|
||||
push word_2CE02
|
||||
call far ptr loc_AB2
|
||||
call egc_shift_right
|
||||
|
||||
loc_1030C:
|
||||
mov byte_226C2, 2
|
||||
|
|
Loading…
Reference in New Issue