diff --git a/libs/master.lib/super_put_8.asm b/libs/master.lib/super_put_8.asm new file mode 100644 index 00000000..d07a7827 --- /dev/null +++ b/libs/master.lib/super_put_8.asm @@ -0,0 +1,181 @@ +; superimpose & master library module +; +; Description: +; パターン表示 [横8dot単位] +; +; Functions/Procedures: +; void super_put_8( int x, int y, int num ) ; +; +; Parameters: +; x,y 座標 +; num パターン番号 +; +; Returns: +; none +; +; Binding Target: +; Microsoft-C / Turbo-C / Turbo Pascal +; +; Running Target: +; PC-9801V +; +; Requiring Resources: +; CPU: V30 +; GRCG +; +; Notes: +; +; +; Compiler/Assembler: +; TASM 3.0 +; OPTASM 1.6 +; +; Author: +; Kazumi(奥田 仁) +; 恋塚(恋塚昭彦) +; +; Revision History: +; +;$Id: superpt8.asm 0.07 92/05/29 20:37:21 Kazumi Rel $ +; +; 93/ 3/20 Initial: master.lib <- super.lib 0.22b +; 93/ 5/ 4 [M0.16] +; + +func SUPER_PUT_8 + push BP + mov BP,SP + push DS + push SI + push DI + + @@x = (RETSIZE+3)*2 + @@y = (RETSIZE+2)*2 + @@num = (RETSIZE+1)*2 + + mov CX,[BP+@@x] + mov AX,[BP+@@y] + mov BX,[BP+@@num] + + mov BP,AX ;-+ + shl AX,2 ; | + add BP,AX ; |DI=y*80 + shl BP,4 ;-+ + shr CX,3 ;CX=x/8 + add BP,CX ;GVRAM offset address + shl BX,1 ;integer size & near pointer + mov AX,super_patsize[BX] ;pattern size (1-8) + xor SI,SI + mov DS,super_patdata[BX] ;BX+2 -> BX + + mov BL,AH + xor BH,BH + mov DX,80 + sub DL,AH + mov AH,AL + + mov CX,0a800h + mov ES,CX + + mov AL,0c0h ;RMW mode + out 7ch,AL + mov AL,0 + out 7eh,AL + out 7eh,AL + out 7eh,AL + out 7eh,AL + call SUPERPT8_DISP ;cls + + mov AL,11001110b + out 7ch,AL ;RMW mode + mov AL,0ffh + out 7eh,AL + out 7eh,AL + out 7eh,AL + out 7eh,AL + + call SUPERPT8_DISP + mov AL,11001101b + out 7ch,AL ;RMW mode + call SUPERPT8_DISP + mov AL,11001011b + out 7ch,AL ;RMW mode + call SUPERPT8_DISP + mov AL,11000111b + out 7ch,AL ;RMW mode + call SUPERPT8_DISP + + xor AL,AL + out 7ch,AL ;grcg off + + pop DI + pop SI + pop DS + pop BP + ret 6 +endfunc + +; +; 表示サブルーチン +; +SUPERPT8_DISP proc near + mov DI,BP + + mov AL,AH + test DI,1 + jnz short @@ODD_ADDRESS + + shr BX,1 + jb short @@EAOS + + EVEN +@@EAES: + mov CX,BX + rep movsw + add DI,DX + dec AL + jnz short @@EAES + shl BX,1 + ret + + EVEN +@@EAOS: + mov CX,BX + rep movsw + movsb + add DI,DX + dec AL + jnz short @@EAOS + stc + rcl BX,1 + ret + EVEN + +@@ODD_ADDRESS: + shr BX,1 + jb short @@OAOS + EVEN +@@OAES: + mov CX,BX + dec CX + movsb + rep movsw + movsb + add DI,DX + dec AL + jnz short @@OAES + shl BX,1 + ret + + EVEN +@@OAOS: + mov CX,BX + movsb + rep movsw + add DI,DX + dec AL + jnz short @@OAOS + stc + rcl BX,1 + ret +SUPERPT8_DISP endp diff --git a/th01_zunsoft.asm b/th01_zunsoft.asm index 910a484a..432c347b 100644 --- a/th01_zunsoft.asm +++ b/th01_zunsoft.asm @@ -595,14 +595,14 @@ loc_7AE: mov al, ds:2873h cbw push ax - call sub_E9C + call super_put_8 push 140h push 0C0h mov al, ds:2873h cbw inc ax push ax - call sub_E9C + call super_put_8 loc_7CB: pop bp @@ -751,142 +751,7 @@ include libs/master.lib/dos_ropen.asm include libs/master.lib/super_entry_bfnt.asm include libs/master.lib/super_cancel_pat.asm include libs/master.lib/super_entry_pat.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_E9C proc near - -arg_0 = word ptr 4 -arg_2 = word ptr 6 -arg_4 = word ptr 8 - - push bp - mov bp, sp - push ds - push si - push di - mov cx, [bp+arg_4] - mov ax, [bp+arg_2] - mov bx, [bp+arg_0] - mov bp, ax - shl ax, 2 - add bp, ax - shl bp, 4 - shr cx, 3 - add bp, cx - shl bx, 1 - mov ax, [bx+2DC6h] - xor si, si - mov ds, word ptr [bx+29C6h] - mov bl, ah - xor bh, bh - mov dx, 50h - sub dl, ah - mov ah, al - mov cx, 0A800h - mov es, cx - assume es:nothing - mov al, 0C0h - out 7Ch, al - mov al, 0 - out 7Eh, al - out 7Eh, al - out 7Eh, al - out 7Eh, al - call sub_F18 - mov al, 0CEh - out 7Ch, al - mov al, 0FFh - out 7Eh, al - out 7Eh, al - out 7Eh, al - out 7Eh, al - call sub_F18 - mov al, 0CDh - out 7Ch, al - call sub_F18 - mov al, 0CBh - out 7Ch, al - call sub_F18 - mov al, 0C7h - out 7Ch, al - call sub_F18 - xor al, al - out 7Ch, al - pop di - pop si - pop ds - pop bp - retn 6 -sub_E9C endp - - -; =============== S U B R O U T I N E ======================================= - - -sub_F18 proc near - mov di, bp - mov al, ah - test di, 1 - jnz short loc_F44 - shr bx, 1 - jb short loc_F34 - -loc_F26: - mov cx, bx - rep movsw - add di, dx - dec al - jnz short loc_F26 - shl bx, 1 - retn -; --------------------------------------------------------------------------- - nop - -loc_F34: - mov cx, bx - rep movsw - movsb - add di, dx - dec al - jnz short loc_F34 - stc - rcl bx, 1 - retn -; --------------------------------------------------------------------------- - nop - -loc_F44: - shr bx, 1 - jb short loc_F58 - -loc_F48: - mov cx, bx - dec cx - movsb - rep movsw - movsb - add di, dx - dec al - jnz short loc_F48 - shl bx, 1 - retn -; --------------------------------------------------------------------------- - -loc_F58: - mov cx, bx - movsb - rep movsw - add di, dx - dec al - jnz short loc_F58 - stc - rcl bx, 1 - retn -sub_F18 endp - +include libs/master.lib/super_put_8.asm include libs/master.lib/super_free.asm include libs/master.lib/super_entry_at.asm diff --git a/th05_main.asm b/th05_main.asm index 352a1aa4..6aea36b5 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -4061,143 +4061,7 @@ locret_40E5: retf sub_40CE endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_40E6 proc far - -arg_0 = word ptr 6 -arg_2 = word ptr 8 -arg_4 = word ptr 0Ah - - push bp - mov bp, sp - push ds - push si - push di - mov cx, [bp+arg_4] - mov ax, [bp+arg_2] - mov bx, [bp+arg_0] - mov bp, ax - shl ax, 2 - add bp, ax - shl bp, 4 - shr cx, 3 - add bp, cx - shl bx, 1 - mov ax, [bx+2A9Eh] - xor si, si - mov ds, word ptr [bx+269Eh] - mov bl, ah - xor bh, bh - mov dx, 50h ; 'P' - sub dl, ah - mov ah, al - mov cx, 0A800h - mov es, cx - assume es:nothing - mov al, 0C0h ; '' - out 7Ch, al - mov al, 0 - out 7Eh, al - out 7Eh, al - out 7Eh, al - out 7Eh, al - call sub_4162 - mov al, 0CEh ; '' - out 7Ch, al - mov al, 0FFh - out 7Eh, al - out 7Eh, al - out 7Eh, al - out 7Eh, al - call sub_4162 - mov al, 0CDh ; '' - out 7Ch, al - call sub_4162 - mov al, 0CBh ; '' - out 7Ch, al - call sub_4162 - mov al, 0C7h ; '' - out 7Ch, al - call sub_4162 - xor al, al - out 7Ch, al - pop di - pop si - pop ds - pop bp - retf 6 -sub_40E6 endp - - -; =============== S U B R O U T I N E ======================================= - - -sub_4162 proc near - mov di, bp - mov al, ah - test di, 1 - jnz short loc_418E - shr bx, 1 - jb short loc_417E - -loc_4170: - mov cx, bx - rep movsw - add di, dx - dec al - jnz short loc_4170 - shl bx, 1 - retn -; --------------------------------------------------------------------------- - nop - -loc_417E: - mov cx, bx - rep movsw - movsb - add di, dx - dec al - jnz short loc_417E - stc - rcl bx, 1 - retn -; --------------------------------------------------------------------------- - nop - -loc_418E: - shr bx, 1 - jb short loc_41A2 - -loc_4192: - mov cx, bx - dec cx - movsb - rep movsw - movsb - add di, dx - dec al - jnz short loc_4192 - shl bx, 1 - retn -; --------------------------------------------------------------------------- - -loc_41A2: - mov cx, bx - movsb - rep movsw - add di, dx - dec al - jnz short loc_41A2 - stc - rcl bx, 1 - retn -sub_4162 endp - -; --------------------------------------------------------------------------- +include libs/master.lib/super_put_8.asm db 0 ; =============== S U B R O U T I N E ======================================= @@ -29199,7 +29063,7 @@ loc_1115E: push si push word ptr [bp-2] push di - call sub_40E6 + call super_put_8 inc word ptr [bp-4] add si, 40h ; '@' inc di