mirror of https://github.com/nmlgc/ReC98.git
[Reduction] #713: super_put_tiny_small
Still finding new unmodified master.lib functions in 2020, apparently… Part of P0115, funded by Lmocinemod and Blue Bolt.
This commit is contained in:
parent
4e6bedf20d
commit
498fa0c7fc
|
@ -0,0 +1,149 @@
|
|||
; superimpose & master library module
|
||||
;
|
||||
; Description:
|
||||
; パターンの表示(8xn限定, 4色以内)
|
||||
;
|
||||
; Functions/Procedures:
|
||||
; void super_put_tiny_small( 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:
|
||||
; ★縦ドット数nは、偶数でなければいけません
|
||||
; あらかじめ、super_convert_tiny でデータを変換しておく必要アリ
|
||||
; データ形式: (super_patdata[])
|
||||
; --------------------------
|
||||
; 1ワード = (ひとつめの色コード << 8) + 80h
|
||||
; nバイト = データ
|
||||
; --------------------------
|
||||
; 1ワード = (ふたつめの色コード << 8) + 80h
|
||||
; nバイト = データ
|
||||
; …
|
||||
; --------------------------
|
||||
; 1ワード = 0 (終わり)
|
||||
;
|
||||
; 色が 4色より多いと、データが元より大きくなるので変換するとき注意
|
||||
;
|
||||
; シューティングゲームなんかで、大量に表示される「弾」は、
|
||||
; 8xn dot でできるよね?それならこれで高速にできるね
|
||||
;
|
||||
;
|
||||
; Compiler/Assembler:
|
||||
; TASM 3.0
|
||||
; OPTASM 1.6
|
||||
;
|
||||
; Author:
|
||||
; 恋塚(恋塚昭彦)
|
||||
;
|
||||
; Revision History:
|
||||
; 93/ 9/18 Initial: supertt8.asm / master.lib 0.21
|
||||
; 94/ 8/16 [M0.23] 縦ドット数を可変に(ただし、偶数に限る)
|
||||
;
|
||||
|
||||
SCREEN_XBYTES equ 80
|
||||
GC_MODEREG equ 07ch
|
||||
GC_TILEREG equ 07eh
|
||||
GC_RMW equ 0c0h ; 書き込みビットが立っているドットにタイルレジスタから書く
|
||||
|
||||
func SUPER_PUT_TINY_SMALL ; super_put_tiny_small() {
|
||||
push BP
|
||||
mov BP,SP
|
||||
push DS
|
||||
push SI
|
||||
push DI
|
||||
|
||||
@@x = (RETSIZE+3)*2
|
||||
@@y = (RETSIZE+2)*2
|
||||
@@num = (RETSIZE+1)*2
|
||||
|
||||
mov ES,graph_VramSeg
|
||||
mov CX,[BP+@@x]
|
||||
mov DI,[BP+@@y]
|
||||
mov BX,[BP+num]
|
||||
shl BX,1
|
||||
mov BP,super_patsize[BX]
|
||||
mov DS,super_patdata[BX]
|
||||
|
||||
mov AX,DI
|
||||
shl AX,2
|
||||
add DI,AX
|
||||
shl DI,4
|
||||
mov AX,CX
|
||||
and CX,7 ; CL = x & 7
|
||||
shr AX,3
|
||||
add DI,AX ; DI = draw start offset
|
||||
|
||||
xor SI,SI
|
||||
|
||||
lodsw
|
||||
cmp AL,80h
|
||||
jne short @@RETURN ; 1色もないとき(おいおい)
|
||||
|
||||
mov AL,GC_RMW
|
||||
pushf
|
||||
CLI
|
||||
out GC_MODEREG,AL
|
||||
popf
|
||||
|
||||
push AX
|
||||
mov DX,BP ; DL=PATTERN_HEIGHT
|
||||
mov AL,SCREEN_XBYTES
|
||||
mul DL
|
||||
mov BP,AX ; BP=PATTERN_HEIGHT * SCREEN_XBYTES
|
||||
shr DL,1 ; 2行単位で描画するから
|
||||
pop AX
|
||||
|
||||
EVEN
|
||||
@@COLOR_LOOP:
|
||||
REPT 4
|
||||
shr AH,1 ; 色の指定あるね
|
||||
sbb AL,AL
|
||||
out GC_TILEREG,AL
|
||||
ENDM
|
||||
|
||||
mov CH,DL
|
||||
EVEN
|
||||
@@YLOOP:
|
||||
lodsw
|
||||
mov BL,AH
|
||||
xor AH,AH
|
||||
ror AX,CL
|
||||
mov ES:[DI],AX
|
||||
|
||||
xor BH,BH
|
||||
ror BX,CL
|
||||
mov ES:[DI+SCREEN_XBYTES],BX
|
||||
|
||||
add DI,SCREEN_XBYTES*2
|
||||
dec CH
|
||||
jnz short @@YLOOP
|
||||
|
||||
sub DI,BP
|
||||
lodsw
|
||||
cmp AL,80H
|
||||
je short @@COLOR_LOOP
|
||||
|
||||
out GC_MODEREG,AL ; grcg off
|
||||
|
||||
@@RETURN:
|
||||
pop DI
|
||||
pop SI
|
||||
pop DS
|
||||
pop BP
|
||||
ret 6
|
||||
endfunc ; }
|
|
@ -127,81 +127,7 @@ include libs/master.lib/super_cancel_pat.asm
|
|||
include libs/master.lib/super_put_rect.asm
|
||||
include libs/master.lib/super_put.asm
|
||||
include libs/master.lib/super_convert_tiny.asm
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
; Attributes: bp-based frame
|
||||
|
||||
sub_2DB6 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 es, graph_VramSeg
|
||||
mov cx, [bp+arg_4]
|
||||
mov di, [bp+arg_2]
|
||||
mov bx, [bp+arg_0]
|
||||
shl bx, 1
|
||||
mov bp, [bx+21DCh]
|
||||
mov ds, word ptr [bx+1DDCh]
|
||||
mov ax, di
|
||||
shl ax, 2
|
||||
add di, ax
|
||||
shl di, 4
|
||||
mov ax, cx
|
||||
and cx, 7
|
||||
shr ax, 3
|
||||
add di, ax
|
||||
xor si, si
|
||||
lodsw
|
||||
cmp al, 80h
|
||||
jnz short loc_2E3F
|
||||
GRCG_NOINT_SETMODE_VIA_MOV al, GC_RMW
|
||||
push ax
|
||||
mov dx, bp
|
||||
mov al, 50h ; 'P'
|
||||
mul dl
|
||||
mov bp, ax
|
||||
shr dl, 1
|
||||
pop ax
|
||||
nop
|
||||
|
||||
loc_2E02:
|
||||
GRCG_SETCOLOR_DIRECT ah
|
||||
mov ch, dl
|
||||
|
||||
loc_2E1C:
|
||||
lodsw
|
||||
mov bl, ah
|
||||
xor ah, ah
|
||||
ror ax, cl
|
||||
mov es:[di], ax
|
||||
xor bh, bh
|
||||
ror bx, cl
|
||||
mov es:[di+50h], bx
|
||||
add di, 0A0h
|
||||
dec ch
|
||||
jnz short loc_2E1C
|
||||
sub di, bp
|
||||
lodsw
|
||||
cmp al, GC_TDW
|
||||
jz short loc_2E02
|
||||
out 7Ch, al
|
||||
|
||||
loc_2E3F:
|
||||
pop di
|
||||
pop si
|
||||
pop ds
|
||||
pop bp
|
||||
retf 6
|
||||
sub_2DB6 endp
|
||||
|
||||
include libs/master.lib/super_put_tiny_small.asm
|
||||
include libs/master.lib/js_start.asm
|
||||
include libs/master.lib/js_sense.asm
|
||||
include libs/master.lib/bgm_bell_org.asm
|
||||
|
@ -6960,15 +6886,15 @@ loc_E053:
|
|||
add ax, _space_window_center.y
|
||||
add ax, -4
|
||||
mov [bp+@@y], ax
|
||||
push [bp+@@x]
|
||||
push ax
|
||||
push [bp+@@x] ; x
|
||||
push ax ; y
|
||||
mov ax, di
|
||||
mov bx, 2
|
||||
cwd
|
||||
idiv bx
|
||||
add dx, 6
|
||||
push dx
|
||||
call sub_2DB6
|
||||
push dx ; num
|
||||
call super_put_tiny_small
|
||||
inc di
|
||||
add [bp+var_A], 4
|
||||
|
||||
|
@ -7106,10 +7032,7 @@ loc_E193:
|
|||
add ax, _space_window_center.y
|
||||
add ax, -4
|
||||
mov [bp+@@y], ax
|
||||
push [bp+@@x]
|
||||
push ax
|
||||
push word ptr [si+0Ch]
|
||||
call sub_2DB6
|
||||
call super_put_tiny_small pascal, [bp+@@x], ax, word ptr [si+0Ch]
|
||||
|
||||
loc_E219:
|
||||
inc di
|
||||
|
|
Loading…
Reference in New Issue