2020-05-11 20:34:20 +00:00
|
|
|
|
; The only change in ZUN's fork: The format ID is 'NZ', rather than 'iP'. Lol.
|
2014-11-04 17:38:55 +00:00
|
|
|
|
|
2020-09-05 23:12:42 +00:00
|
|
|
|
; For compatibility with later TASM versions, "segcs movsw" has also been
|
|
|
|
|
; spelled out to what it's actually supposed to mean.
|
|
|
|
|
; (movs word ptr es:[di], word ptr cs:[si])
|
|
|
|
|
; ----------------------------------------------------------------------------
|
|
|
|
|
|
2014-11-04 17:38:55 +00:00
|
|
|
|
;//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
;
|
|
|
|
|
; Pi 16色 グラフィック・ローダ 1990 やなぎさわ
|
|
|
|
|
; 1991-3 電脳科学研究所/BERO
|
|
|
|
|
;
|
|
|
|
|
;//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
line = 1280 ;最大横幅
|
|
|
|
|
lin = 4
|
|
|
|
|
comment |
|
|
|
|
|
Cからの利用
|
|
|
|
|
int PiLoad(char *name,int buff,int Size,int X,int Y,int tone,int option)
|
|
|
|
|
|
|
|
|
|
PASCALからの利用
|
|
|
|
|
functuon PiLoad( name:string; buff,Size,X,Y,tone,option:integer):integer;
|
|
|
|
|
|
|
|
|
|
Assemblerからの利用
|
|
|
|
|
piload0 proc near
|
|
|
|
|
es:dx = name(asciz)
|
|
|
|
|
ds:0 = buff
|
|
|
|
|
si = size
|
|
|
|
|
bx = x
|
|
|
|
|
cx = y
|
|
|
|
|
al = tone
|
|
|
|
|
ah = option
|
|
|
|
|
|
|
|
|
|
引数
|
|
|
|
|
name ファイル名
|
|
|
|
|
buff バッファのセグメント
|
|
|
|
|
Size バッファのサイズ
|
|
|
|
|
X 表示アドレスのX座標
|
|
|
|
|
Y 表示アドレスのY座標
|
|
|
|
|
tone トーン(1~100%)
|
|
|
|
|
option オプション(下記のビットで指定)通常は15(01111b)
|
|
|
|
|
(lsb)0 .. パレット設定 する/しない = 1/0
|
|
|
|
|
1 .. 常駐パレット設定 する/しない = 1/0
|
|
|
|
|
2 .. コメント表示 する/しない = 1/0
|
|
|
|
|
3 .. 画面設定 する/しない = 1/0
|
|
|
|
|
(VRAMのON,400/200line設定)
|
|
|
|
|
4 .. ノート用パレット する/しない = 1/0
|
|
|
|
|
5 .. スクロールロード する/しない = 1/0
|
|
|
|
|
6 .. 透明色利用 する/しない = 1/0
|
|
|
|
|
|
|
|
|
|
戻り値
|
|
|
|
|
0 正常終了
|
|
|
|
|
-8 バッファが足りない
|
|
|
|
|
-31 Piではない
|
|
|
|
|
-32 サポートされていない
|
|
|
|
|
他 エラー(MSDOSのDOSコールエラー参照)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
shl1 macro reg
|
|
|
|
|
add reg,reg
|
|
|
|
|
endm
|
|
|
|
|
rcl1 macro reg
|
|
|
|
|
adc reg,reg
|
|
|
|
|
endm
|
|
|
|
|
|
|
|
|
|
; out cy=bit
|
|
|
|
|
get1bit macro n
|
|
|
|
|
dec dh
|
|
|
|
|
jz gb0&n
|
|
|
|
|
gb1&n: shl1 dl
|
|
|
|
|
endm
|
|
|
|
|
|
|
|
|
|
bitsub macro n
|
|
|
|
|
gb0&n:
|
|
|
|
|
mov dl,[bx]
|
|
|
|
|
inc bx
|
|
|
|
|
mov dh,8
|
|
|
|
|
; cmp bx,buffend
|
|
|
|
|
db 81h,0fbh
|
|
|
|
|
gw&n dw ?
|
|
|
|
|
jnz gb1&n
|
|
|
|
|
call fread
|
|
|
|
|
jmp short gb1&n
|
|
|
|
|
endm
|
|
|
|
|
|
2020-05-11 20:34:20 +00:00
|
|
|
|
.model small
|
|
|
|
|
.186
|
|
|
|
|
coltbl = 0
|
|
|
|
|
PaletteBuff = 100h
|
|
|
|
|
x_pos = word ptr ds:[130h]
|
|
|
|
|
y_pos = word ptr ds:[132h]
|
|
|
|
|
x_wid = word ptr ds:[134h]
|
|
|
|
|
y_wid = word ptr ds:[136h]
|
|
|
|
|
tone = byte ptr ds:[138h]
|
|
|
|
|
option = byte ptr ds:[139h]
|
|
|
|
|
tcol = byte ptr ds:[13ah]
|
|
|
|
|
flg800 = byte ptr ds:[13bh]
|
|
|
|
|
line4 = word ptr ds:[13ch]
|
|
|
|
|
vadr = word ptr ds:[13eh]
|
|
|
|
|
fhandle = word ptr ds:[140h]
|
|
|
|
|
bufbgn = word ptr ds:[142h]
|
|
|
|
|
bufend = word ptr ds:[144h]
|
|
|
|
|
bufsize = word ptr ds:[146h]
|
|
|
|
|
yscroll = word ptr ds:[148h]
|
|
|
|
|
y_wid2 = word ptr ds:[14ah]
|
|
|
|
|
x_wid2 = word ptr ds:[14ch]
|
|
|
|
|
;bfseg = word ptr ds:[14eh]
|
|
|
|
|
tonetbl = 150h
|
|
|
|
|
gbuff = 160h
|
|
|
|
|
buffer = 160h+line*(lin+2)
|
|
|
|
|
parasize = buffer
|
|
|
|
|
.code
|
2014-11-04 17:38:55 +00:00
|
|
|
|
locals
|
|
|
|
|
dftpal db 0,0,0, 0,0,07h, 7h,0,0, 7h,0,7h
|
|
|
|
|
db 0,7h,0, 0,7h,7h, 7h,7h,0, 7h,7h,7h
|
|
|
|
|
db 0,0,0, 0,0,0fh, 0fh,0,0, 0fh,0,0fh
|
|
|
|
|
db 0,0fh,0,0,0fh,0fh, 0fh,0fh,0, 0fh,0fh,0fh
|
|
|
|
|
spreg dw ?
|
|
|
|
|
dsseg dw ?
|
|
|
|
|
|
|
|
|
|
public PiLoad,ToneSet
|
|
|
|
|
PiLoad proc near
|
2020-05-11 20:34:20 +00:00
|
|
|
|
opt = word ptr [bp+4]
|
|
|
|
|
ton = word ptr [bp+6]
|
|
|
|
|
y = word ptr [bp+8]
|
|
|
|
|
x = word ptr [bp+10]
|
|
|
|
|
bufsiz = word ptr [bp+12]
|
|
|
|
|
buf = dword ptr [bp+14]
|
|
|
|
|
nam = dword ptr [bp+18]
|
2014-11-04 17:38:55 +00:00
|
|
|
|
push bp
|
|
|
|
|
mov bp,sp
|
|
|
|
|
push ds
|
2020-05-11 20:34:20 +00:00
|
|
|
|
lds dx,nam
|
|
|
|
|
mov ax,word ptr buf
|
2014-11-04 17:38:55 +00:00
|
|
|
|
add ax,15
|
|
|
|
|
shr ax,4
|
2020-05-11 20:34:20 +00:00
|
|
|
|
add ax,word ptr buf+2
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov es,ax
|
|
|
|
|
cld
|
|
|
|
|
mov si,dx
|
|
|
|
|
xor dx,dx
|
|
|
|
|
mov di,dx
|
|
|
|
|
lodsb
|
|
|
|
|
xor ch,ch
|
|
|
|
|
mov cl,al
|
|
|
|
|
rep movsb
|
|
|
|
|
xor al,al
|
|
|
|
|
stosb
|
|
|
|
|
push es
|
|
|
|
|
pop ds
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov si,bufsiz
|
|
|
|
|
mov ax,word ptr buf
|
2014-11-04 17:38:55 +00:00
|
|
|
|
and ax,15
|
|
|
|
|
sub si,ax
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov bx,x
|
|
|
|
|
mov cx,y
|
|
|
|
|
mov di,ton
|
|
|
|
|
mov ax,opt
|
2014-11-04 17:38:55 +00:00
|
|
|
|
call piload0
|
|
|
|
|
pop ds
|
|
|
|
|
pop bp
|
|
|
|
|
ret 16
|
|
|
|
|
PiLoad endp
|
|
|
|
|
|
|
|
|
|
ToneSet proc near
|
|
|
|
|
mov bx,sp
|
|
|
|
|
push ds
|
|
|
|
|
mov ax,dsseg
|
|
|
|
|
mov ds,ax
|
|
|
|
|
mov es,ax
|
|
|
|
|
mov al,ss:[bx+2]
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov tone,al
|
2014-11-04 17:38:55 +00:00
|
|
|
|
call palset
|
|
|
|
|
pop ds
|
|
|
|
|
ret 2
|
|
|
|
|
ToneSet endp
|
|
|
|
|
|
|
|
|
|
public _PiLoad,_ToneSet
|
|
|
|
|
_PiLoad proc near
|
2020-05-11 20:34:20 +00:00
|
|
|
|
arg nam:word,buf,bufsiz,x,y,ton,opt:word
|
2014-11-04 17:38:55 +00:00
|
|
|
|
push bp
|
|
|
|
|
mov bp,sp
|
|
|
|
|
push si
|
|
|
|
|
push di
|
|
|
|
|
push ds
|
|
|
|
|
mov bx,ds
|
|
|
|
|
mov es,bx
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov dx,nam
|
|
|
|
|
mov ax,buf
|
2014-11-04 17:38:55 +00:00
|
|
|
|
add ax,15
|
|
|
|
|
shr ax,4
|
|
|
|
|
add ax,bx
|
|
|
|
|
mov ds,ax
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov si,bufsiz
|
|
|
|
|
mov ax,buf
|
2014-11-04 17:38:55 +00:00
|
|
|
|
and ax,15
|
|
|
|
|
sub si,ax
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov bx,x
|
|
|
|
|
mov cx,y
|
|
|
|
|
mov di,ton
|
|
|
|
|
mov ax,opt
|
2014-11-04 17:38:55 +00:00
|
|
|
|
call piload0
|
|
|
|
|
pop ds
|
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
pop bp
|
|
|
|
|
ret
|
|
|
|
|
_PiLoad endp
|
|
|
|
|
|
|
|
|
|
_ToneSet proc near
|
|
|
|
|
mov bx,sp
|
|
|
|
|
push ds
|
|
|
|
|
push si
|
|
|
|
|
push di
|
|
|
|
|
mov ax,dsseg
|
|
|
|
|
mov ds,ax
|
|
|
|
|
mov es,ax
|
|
|
|
|
mov al,ss:[bx+2]
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov tone,al
|
2014-11-04 17:38:55 +00:00
|
|
|
|
call palset
|
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
pop ds
|
|
|
|
|
ret
|
|
|
|
|
_ToneSet endp
|
|
|
|
|
|
|
|
|
|
public _PiLoadL,_ToneSetL
|
|
|
|
|
_PiLoadL proc far
|
2020-05-11 20:34:20 +00:00
|
|
|
|
arg nam:dword,buf:dword,bufsiz,x,y,ton,opt:word
|
2014-11-04 17:38:55 +00:00
|
|
|
|
push bp
|
|
|
|
|
mov bp,sp
|
|
|
|
|
push si
|
|
|
|
|
push di
|
|
|
|
|
push ds
|
2020-05-11 20:34:20 +00:00
|
|
|
|
les dx,nam
|
|
|
|
|
mov ax,word ptr buf
|
2014-11-04 17:38:55 +00:00
|
|
|
|
add ax,15
|
|
|
|
|
shr ax,4
|
2020-05-11 20:34:20 +00:00
|
|
|
|
add ax,word ptr buf+2
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov ds,ax
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov si,bufsiz
|
|
|
|
|
mov ax,word ptr buf
|
2014-11-04 17:38:55 +00:00
|
|
|
|
and ax,15
|
|
|
|
|
sub si,ax
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov bx,x
|
|
|
|
|
mov cx,y
|
|
|
|
|
mov di,ton
|
|
|
|
|
mov ax,opt
|
2014-11-04 17:38:55 +00:00
|
|
|
|
call piload0
|
|
|
|
|
pop ds
|
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
pop bp
|
|
|
|
|
retf
|
|
|
|
|
_PiLoadL endp
|
|
|
|
|
|
|
|
|
|
_ToneSetL proc far
|
|
|
|
|
mov bx,sp
|
|
|
|
|
push ds
|
|
|
|
|
push si
|
|
|
|
|
push di
|
|
|
|
|
mov ax,dsseg
|
|
|
|
|
mov ds,ax
|
|
|
|
|
mov es,ax
|
|
|
|
|
mov al,ss:[bx+4]
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov tone,al
|
2014-11-04 17:38:55 +00:00
|
|
|
|
call palset
|
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
pop ds
|
|
|
|
|
retf
|
|
|
|
|
_ToneSetL endp
|
|
|
|
|
|
|
|
|
|
public _PiLoadC
|
|
|
|
|
_PiLoadC proc near
|
2020-05-11 20:34:20 +00:00
|
|
|
|
arg nam:dword,buf:dword,bufsiz,x,y,ton,opt:word
|
2014-11-04 17:38:55 +00:00
|
|
|
|
push bp
|
|
|
|
|
mov bp,sp
|
|
|
|
|
push si
|
|
|
|
|
push di
|
|
|
|
|
push ds
|
2020-05-11 20:34:20 +00:00
|
|
|
|
les dx,nam
|
|
|
|
|
mov ax,word ptr buf
|
2014-11-04 17:38:55 +00:00
|
|
|
|
add ax,15
|
|
|
|
|
shr ax,4
|
2020-05-11 20:34:20 +00:00
|
|
|
|
add ax,word ptr buf+2
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov ds,ax
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov si,bufsiz
|
|
|
|
|
mov ax,word ptr buf
|
2014-11-04 17:38:55 +00:00
|
|
|
|
and ax,15
|
|
|
|
|
sub si,ax
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov bx,x
|
|
|
|
|
mov cx,y
|
|
|
|
|
mov di,ton
|
|
|
|
|
mov ax,opt
|
2014-11-04 17:38:55 +00:00
|
|
|
|
call piload0
|
|
|
|
|
pop ds
|
|
|
|
|
pop di
|
|
|
|
|
pop si
|
|
|
|
|
pop bp
|
|
|
|
|
ret
|
|
|
|
|
_PiLoadC endp
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; in es:dx = filename
|
|
|
|
|
; ds:0 = buff
|
|
|
|
|
; si = size(paragraph)
|
|
|
|
|
; bx = x
|
|
|
|
|
; cx = y
|
|
|
|
|
; di = tone
|
|
|
|
|
; al = option
|
|
|
|
|
; ah = tcol
|
|
|
|
|
public piload0
|
|
|
|
|
error0:
|
|
|
|
|
ret
|
|
|
|
|
piload0:
|
|
|
|
|
cld
|
|
|
|
|
mov spreg,sp
|
|
|
|
|
mov dsseg,ds
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov x_pos,bx
|
|
|
|
|
mov y_pos,cx
|
|
|
|
|
mov word ptr option,ax
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov ax,di
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov tone,al
|
2014-11-04 17:38:55 +00:00
|
|
|
|
|
|
|
|
|
xor ax,ax
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov flg800,al
|
2014-11-04 17:38:55 +00:00
|
|
|
|
|
|
|
|
|
mov ax,-8
|
2020-05-11 20:34:20 +00:00
|
|
|
|
cmp si,parasize+18+48
|
2014-11-04 17:38:55 +00:00
|
|
|
|
jb error0
|
|
|
|
|
mov ax,si
|
2020-05-11 20:34:20 +00:00
|
|
|
|
sub ax,parasize
|
|
|
|
|
mov bufsize,ax
|
|
|
|
|
add ax,buffer
|
2014-11-04 17:38:55 +00:00
|
|
|
|
; mov buffend,ax
|
|
|
|
|
; push cs
|
|
|
|
|
; pop ds
|
|
|
|
|
; assume ds:_TEXT
|
|
|
|
|
irp n,<0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f,g,h,i,j,k,l>
|
|
|
|
|
mov word ptr gw&n,ax ;自己書換(^^;)
|
|
|
|
|
endm
|
|
|
|
|
|
|
|
|
|
push es
|
|
|
|
|
pop ds
|
|
|
|
|
call fopen
|
|
|
|
|
mov bx,dsseg
|
|
|
|
|
mov ds,bx
|
|
|
|
|
mov es,bx
|
|
|
|
|
jc error
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov fhandle,ax
|
2014-11-04 17:38:55 +00:00
|
|
|
|
call fread
|
|
|
|
|
mov si,bx
|
|
|
|
|
lodsw
|
|
|
|
|
cmp ax,'NZ' ;ID check
|
|
|
|
|
mov ax,-31
|
|
|
|
|
jz pilop
|
|
|
|
|
error: ret
|
|
|
|
|
pilop:
|
2020-05-11 20:34:20 +00:00
|
|
|
|
test option,4
|
|
|
|
|
jz @@lop2
|
|
|
|
|
@@lop:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
lodsb
|
|
|
|
|
cmp al,1ah
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jz @@lop2
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov dl,al
|
|
|
|
|
mov ah,2
|
|
|
|
|
int 21h
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jmp short @@lop
|
|
|
|
|
@@lop2:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
lodsb
|
|
|
|
|
or al,al
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jnz @@lop2
|
2014-11-04 17:38:55 +00:00
|
|
|
|
lodsb
|
|
|
|
|
mov bl,al ;palet flag
|
|
|
|
|
lodsw ;ドット比率
|
|
|
|
|
mov cx,ax
|
|
|
|
|
lodsb
|
|
|
|
|
cmp al,4 ;plane check
|
|
|
|
|
mov ax,-32
|
|
|
|
|
jnz error
|
2020-05-11 20:34:20 +00:00
|
|
|
|
test option,8
|
|
|
|
|
jz @@skip
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov ax,cx
|
|
|
|
|
call gmode
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@skip:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
add si,4 ;machine code skip
|
|
|
|
|
lodsw
|
|
|
|
|
xchg ah,al ;dmy
|
|
|
|
|
xor cx,cx
|
|
|
|
|
mov dx,cx
|
|
|
|
|
mov di,ax
|
|
|
|
|
add di,si
|
|
|
|
|
and ax,ax
|
|
|
|
|
jz codee
|
|
|
|
|
|
|
|
|
|
ccode:
|
|
|
|
|
cmp si,di
|
|
|
|
|
jz codee
|
|
|
|
|
lodsb
|
|
|
|
|
cmp al,1
|
|
|
|
|
jz code1
|
|
|
|
|
cmp al,2
|
|
|
|
|
jz code2
|
|
|
|
|
jmp short codee
|
|
|
|
|
|
|
|
|
|
code1:
|
|
|
|
|
lodsw
|
|
|
|
|
xchg ah,al
|
|
|
|
|
mov cx,ax
|
|
|
|
|
lodsw
|
|
|
|
|
xchg ah,al
|
|
|
|
|
mov dx,ax
|
|
|
|
|
jmp short ccode
|
|
|
|
|
|
|
|
|
|
code2:
|
|
|
|
|
add si,3
|
|
|
|
|
lodsb
|
2020-05-11 20:34:20 +00:00
|
|
|
|
test option,40h
|
2014-11-04 17:38:55 +00:00
|
|
|
|
jnz ccode
|
2020-05-11 20:34:20 +00:00
|
|
|
|
cmp tcol,0ffh
|
2014-11-04 17:38:55 +00:00
|
|
|
|
jz ccode
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov tcol,al
|
|
|
|
|
or option,40h
|
2014-11-04 17:38:55 +00:00
|
|
|
|
jmp short ccode
|
|
|
|
|
|
|
|
|
|
codee:
|
|
|
|
|
mov si,di
|
2020-05-11 20:34:20 +00:00
|
|
|
|
cmp x_pos,0
|
|
|
|
|
jge @@jmp@
|
|
|
|
|
mov x_pos,cx
|
|
|
|
|
@@jmp@:
|
|
|
|
|
cmp y_pos,0
|
|
|
|
|
jge @@jmp
|
|
|
|
|
mov y_pos,dx
|
|
|
|
|
@@jmp:
|
|
|
|
|
|
|
|
|
|
mov cx,x_pos
|
|
|
|
|
mov ax,y_pos
|
2014-11-04 17:38:55 +00:00
|
|
|
|
shr cx,3
|
|
|
|
|
shl ax,4
|
|
|
|
|
add cx,ax
|
|
|
|
|
shl ax,2
|
|
|
|
|
add cx,ax
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov vadr,cx
|
2014-11-04 17:38:55 +00:00
|
|
|
|
|
|
|
|
|
lodsw
|
|
|
|
|
xchg ah,al
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov x_wid,ax
|
2014-11-04 17:38:55 +00:00
|
|
|
|
|
|
|
|
|
mov cx,ax ;自己書換(^^;)
|
|
|
|
|
neg ax
|
|
|
|
|
mov line1,ax ;-x_wid
|
|
|
|
|
inc ax
|
|
|
|
|
mov line11,ax ;-x_wid+1
|
|
|
|
|
dec ax
|
|
|
|
|
shl1 ax
|
|
|
|
|
mov line2,ax ;-x_wid*2
|
|
|
|
|
shl1 cx
|
|
|
|
|
mov ax,cx
|
2020-05-11 20:34:20 +00:00
|
|
|
|
add ax,gbuff
|
|
|
|
|
mov bufbgn,ax
|
2014-11-04 17:38:55 +00:00
|
|
|
|
shl1 cx
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov line4,cx
|
2014-11-04 17:38:55 +00:00
|
|
|
|
add ax,cx
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov bufend,ax
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov bufend2,ax
|
|
|
|
|
mov bufend3,ax
|
|
|
|
|
mov bufend4,ax
|
|
|
|
|
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov ax,x_pos
|
2014-11-04 17:38:55 +00:00
|
|
|
|
and ax,7
|
2020-05-11 20:34:20 +00:00
|
|
|
|
add ax,x_wid
|
|
|
|
|
mov x_wid2,ax
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov cx,ax
|
|
|
|
|
lodsw
|
|
|
|
|
xchg ah,al
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov y_wid,ax
|
|
|
|
|
mov y_wid2,ax
|
2014-11-04 17:38:55 +00:00
|
|
|
|
|
|
|
|
|
test bl,080h ;palet check
|
|
|
|
|
jnz nopalet
|
|
|
|
|
mov cx,48
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov di,PaletteBuff
|
|
|
|
|
@@lop1:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
lodsb
|
|
|
|
|
shr al,4
|
|
|
|
|
stosb
|
2020-05-11 20:34:20 +00:00
|
|
|
|
loop @@lop1
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov bx,si
|
|
|
|
|
jmp short palend
|
|
|
|
|
nopalet:
|
|
|
|
|
mov bx,si
|
|
|
|
|
mov si,offset dftpal
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov di,PaletteBuff
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov cx,12
|
2020-09-05 23:12:42 +00:00
|
|
|
|
rep movs word ptr es:[di], word ptr cs:[si]
|
2014-11-04 17:38:55 +00:00
|
|
|
|
palend:
|
2020-05-11 20:34:20 +00:00
|
|
|
|
test option,1
|
|
|
|
|
jz @@skip
|
2014-11-04 17:38:55 +00:00
|
|
|
|
call palset
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@skip:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
call maketbl
|
|
|
|
|
mov dh,1
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov di,gbuff
|
2014-11-04 17:38:55 +00:00
|
|
|
|
xor al,al
|
|
|
|
|
call color ;ax=col
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov cx,x_wid
|
2014-11-04 17:38:55 +00:00
|
|
|
|
rep stosw
|
|
|
|
|
xor bp,bp
|
|
|
|
|
jmp while1
|
|
|
|
|
|
|
|
|
|
bitsub 6
|
|
|
|
|
bitsub 7
|
|
|
|
|
pos2:
|
|
|
|
|
get1bit 6
|
|
|
|
|
db 0BEh ;mov si,nn
|
|
|
|
|
line2 dw ?
|
|
|
|
|
jnc brk
|
|
|
|
|
get1bit 7
|
|
|
|
|
db 0BEh ;mov si,nn
|
|
|
|
|
line11 dw ?
|
|
|
|
|
jnc brk
|
|
|
|
|
dec si
|
|
|
|
|
dec si
|
|
|
|
|
jmp short brk
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bitsub 8
|
|
|
|
|
bitsub 9
|
|
|
|
|
bitsub a
|
|
|
|
|
bitsub b
|
|
|
|
|
bit0:
|
|
|
|
|
movsw
|
|
|
|
|
db 81h,0ffh;cmp di,nn
|
|
|
|
|
bufend4 dw ?
|
|
|
|
|
jnz while1
|
|
|
|
|
call gtrans
|
|
|
|
|
; jmp while1
|
|
|
|
|
while1:
|
|
|
|
|
get1bit 8
|
|
|
|
|
jc pos2
|
|
|
|
|
get1bit 9
|
|
|
|
|
db 0BEh ;mov si,nn
|
|
|
|
|
line1 dw ?
|
|
|
|
|
jc brk
|
|
|
|
|
mov si,-4
|
|
|
|
|
mov ax,[di-2]
|
|
|
|
|
cmp ah,al
|
|
|
|
|
jz pos00
|
|
|
|
|
brk:
|
|
|
|
|
cmp si,bp
|
|
|
|
|
mov bp,si
|
|
|
|
|
jz nopres
|
|
|
|
|
add si,di
|
|
|
|
|
bjmp: get1bit a
|
|
|
|
|
jnc bit0
|
|
|
|
|
mov ax,1
|
|
|
|
|
xor cx,cx
|
|
|
|
|
llop: inc cx
|
|
|
|
|
get1bit b
|
|
|
|
|
jc llop
|
|
|
|
|
bitcx: get1bit c
|
|
|
|
|
rcl1 ax
|
|
|
|
|
loop bitcx
|
|
|
|
|
; call getnbit
|
|
|
|
|
jc jmp0
|
|
|
|
|
jmp1:
|
|
|
|
|
mov cx,ax
|
|
|
|
|
db 0B8h ;mov ax,nn
|
|
|
|
|
bufend2 dw ?
|
|
|
|
|
sub ax,di
|
|
|
|
|
shr ax,1
|
|
|
|
|
cmp cx,ax
|
|
|
|
|
jae jmp2
|
|
|
|
|
rep movsw
|
|
|
|
|
jmp while1
|
|
|
|
|
|
|
|
|
|
; get1bit c
|
|
|
|
|
bitsub c
|
|
|
|
|
|
|
|
|
|
pos00:
|
|
|
|
|
cmp si,bp
|
|
|
|
|
mov bp,si
|
|
|
|
|
jz nopres
|
|
|
|
|
lea si,[di-2]
|
|
|
|
|
jmp short bjmp
|
|
|
|
|
|
|
|
|
|
nopres:
|
|
|
|
|
mov al,[di-1]
|
|
|
|
|
noplop: call color
|
|
|
|
|
stosw
|
|
|
|
|
mov al,ah
|
|
|
|
|
db 81h,0ffh;cmp di,nn
|
|
|
|
|
bufend3 dw ?
|
|
|
|
|
jz cjmp01
|
|
|
|
|
cjmp02:
|
|
|
|
|
get1bit d
|
|
|
|
|
jc noplop
|
|
|
|
|
xor bp,bp
|
|
|
|
|
jmp while1
|
|
|
|
|
cjmp01: call gtrans
|
|
|
|
|
jmp cjmp02
|
|
|
|
|
|
|
|
|
|
jmp2:
|
|
|
|
|
sub cx,ax
|
|
|
|
|
xchg cx,ax
|
|
|
|
|
rep movsw
|
|
|
|
|
call gtrans
|
2020-05-11 20:34:20 +00:00
|
|
|
|
sub si,line4
|
2014-11-04 17:38:55 +00:00
|
|
|
|
jmp short jmp1
|
|
|
|
|
|
|
|
|
|
jmp0:
|
|
|
|
|
xor cx,cx
|
|
|
|
|
lop0:
|
|
|
|
|
movsw
|
2020-05-11 20:34:20 +00:00
|
|
|
|
cmp di,bufend
|
2014-11-04 17:38:55 +00:00
|
|
|
|
loopnz lop0
|
|
|
|
|
jnz jmp1
|
|
|
|
|
call gtrans
|
2020-05-11 20:34:20 +00:00
|
|
|
|
sub si,line4
|
2014-11-04 17:38:55 +00:00
|
|
|
|
jcxz jmp1
|
|
|
|
|
jmp short lop0
|
|
|
|
|
|
|
|
|
|
bitsub d
|
|
|
|
|
|
|
|
|
|
bitsub e
|
|
|
|
|
bitsub 0
|
|
|
|
|
bitsub 1
|
|
|
|
|
bitsub 2
|
|
|
|
|
bitsub 3
|
|
|
|
|
bitsub 4
|
|
|
|
|
|
|
|
|
|
bit01:
|
|
|
|
|
get1bit e
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jc @@jmp
|
2014-11-04 17:38:55 +00:00
|
|
|
|
lodsb
|
|
|
|
|
jmp short color2
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov ax,[si]
|
|
|
|
|
xchg ah,al
|
|
|
|
|
mov [si],ax
|
|
|
|
|
xor ah,ah
|
|
|
|
|
jmp short color2
|
|
|
|
|
|
|
|
|
|
; in al=color
|
|
|
|
|
; out al,ah=color
|
|
|
|
|
color:
|
|
|
|
|
mov bp,di
|
|
|
|
|
xor ah,ah
|
|
|
|
|
mov si,ax
|
2020-05-11 20:34:20 +00:00
|
|
|
|
; add si,coltbl
|
2014-11-04 17:38:55 +00:00
|
|
|
|
|
|
|
|
|
get1bit 0
|
|
|
|
|
jc bit01
|
|
|
|
|
get1bit 1
|
|
|
|
|
mov cx,1
|
|
|
|
|
jnc bit1
|
|
|
|
|
get1bit 2
|
|
|
|
|
jnc bit2
|
|
|
|
|
get1bit 3
|
|
|
|
|
rcl1 cx
|
|
|
|
|
bit2: get1bit 4
|
|
|
|
|
rcl1 cx
|
|
|
|
|
bit1: get1bit 5
|
|
|
|
|
rcl1 cx
|
|
|
|
|
add si,cx
|
|
|
|
|
std
|
|
|
|
|
lodsb
|
|
|
|
|
lea di,[si+1]
|
|
|
|
|
rep movsb
|
|
|
|
|
stosb
|
|
|
|
|
jmp short color2
|
|
|
|
|
|
|
|
|
|
bitsub 5
|
|
|
|
|
bitsub g
|
|
|
|
|
|
|
|
|
|
color2:
|
|
|
|
|
xor ah,ah
|
|
|
|
|
mov si,ax
|
2020-05-11 20:34:20 +00:00
|
|
|
|
; add si,coltbl
|
2014-11-04 17:38:55 +00:00
|
|
|
|
|
|
|
|
|
get1bit g
|
|
|
|
|
jc @bit01
|
|
|
|
|
get1bit h
|
|
|
|
|
mov cx,1
|
|
|
|
|
jnc @bit1
|
|
|
|
|
get1bit i
|
|
|
|
|
jnc @bit2
|
|
|
|
|
get1bit j
|
|
|
|
|
rcl1 cx
|
|
|
|
|
@bit2: get1bit k
|
|
|
|
|
rcl1 cx
|
|
|
|
|
@bit1: get1bit l
|
|
|
|
|
rcl1 cx
|
|
|
|
|
add si,cx
|
|
|
|
|
std
|
|
|
|
|
mov ah,al
|
|
|
|
|
lodsb
|
|
|
|
|
lea di,[si+1]
|
|
|
|
|
rep movsb
|
|
|
|
|
stosb
|
|
|
|
|
xchg ah,al
|
|
|
|
|
mov di,bp
|
|
|
|
|
cld
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
@bit01:
|
|
|
|
|
get1bit f
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jc @@jmp
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov ah,[si]
|
|
|
|
|
mov di,bp
|
|
|
|
|
cld
|
|
|
|
|
ret
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov cx,[si]
|
|
|
|
|
xchg ch,cl
|
|
|
|
|
mov [si],cx
|
|
|
|
|
mov ah,cl
|
|
|
|
|
mov di,bp
|
|
|
|
|
cld
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
bitsub h
|
|
|
|
|
bitsub i
|
|
|
|
|
bitsub j
|
|
|
|
|
bitsub k
|
|
|
|
|
bitsub l
|
|
|
|
|
bitsub f
|
|
|
|
|
|
|
|
|
|
maketbl:
|
2020-05-11 20:34:20 +00:00
|
|
|
|
; mov di,coltbl
|
2014-11-04 17:38:55 +00:00
|
|
|
|
xor di,di
|
|
|
|
|
mov ax,1000h
|
|
|
|
|
@@lop1: mov cx,16
|
|
|
|
|
@@lop2: ;and al,0f0h
|
|
|
|
|
stosb
|
|
|
|
|
sub al,10h
|
|
|
|
|
loop @@lop2
|
|
|
|
|
add al,10h
|
|
|
|
|
dec ah
|
|
|
|
|
jnz @@lop1
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
; MS-DOS依存部
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
fopen:
|
|
|
|
|
comment ;
|
|
|
|
|
push si
|
|
|
|
|
push dx
|
|
|
|
|
mov si,dx
|
|
|
|
|
flop: lodsb
|
|
|
|
|
mov dl,al
|
|
|
|
|
mov ah,2
|
|
|
|
|
int 21h
|
|
|
|
|
or dl,dl
|
|
|
|
|
jnz flop
|
|
|
|
|
pop dx
|
|
|
|
|
pop si
|
|
|
|
|
;
|
|
|
|
|
mov ax,3d00h
|
|
|
|
|
int 21h
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
fread:
|
|
|
|
|
push ax
|
|
|
|
|
push cx
|
|
|
|
|
push dx
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov bx,fhandle
|
|
|
|
|
mov dx,buffer
|
2014-11-04 17:38:55 +00:00
|
|
|
|
push dx
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov cx,bufsize
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov ah,3fh
|
|
|
|
|
int 21h
|
|
|
|
|
jc @err
|
|
|
|
|
pop bx
|
|
|
|
|
pop dx
|
|
|
|
|
pop cx
|
|
|
|
|
pop ax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
@err:
|
|
|
|
|
call fclose
|
|
|
|
|
mov sp,spreg
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
fclose:
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov bx,fhandle
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov ah,3eh
|
|
|
|
|
int 21h
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
; 98依存部
|
|
|
|
|
;-----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
; 画面モード設定
|
|
|
|
|
; in ax=ドット比率データ
|
|
|
|
|
gmode:
|
|
|
|
|
cmp ax,102h
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jz @@next
|
2014-11-04 17:38:55 +00:00
|
|
|
|
; or ax,ax
|
|
|
|
|
; mov ax,-32
|
|
|
|
|
; jnz error
|
|
|
|
|
mov ch,0c0h
|
|
|
|
|
mov ah,42h
|
|
|
|
|
int 18h
|
|
|
|
|
mov ah,40h
|
|
|
|
|
int 18h
|
|
|
|
|
mov al,1
|
|
|
|
|
out 6ah,al
|
|
|
|
|
ret
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@next:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov ch,080h
|
|
|
|
|
mov ah,42h
|
|
|
|
|
int 18h
|
|
|
|
|
mov al,8
|
|
|
|
|
out 68h,al
|
|
|
|
|
mov ah,40h
|
|
|
|
|
int 18h
|
|
|
|
|
mov al,1
|
|
|
|
|
out 6ah,al
|
2020-05-11 20:34:20 +00:00
|
|
|
|
or flg800,4
|
2014-11-04 17:38:55 +00:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
; gbuffからlinライン分表示(gbuff->VRAM)
|
|
|
|
|
gtrans:
|
|
|
|
|
pusha
|
|
|
|
|
push es
|
2020-05-11 20:34:20 +00:00
|
|
|
|
cmp vadr,32000
|
|
|
|
|
jl @@skip
|
|
|
|
|
sub vadr,32000
|
|
|
|
|
or flg800,1
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov al,1
|
|
|
|
|
out 0a6h,al
|
|
|
|
|
; out 0a4h,al
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@skip:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
|
|
|
|
|
disp:
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov si,bufend
|
|
|
|
|
mov di,gbuff
|
|
|
|
|
mov cx,x_wid
|
2014-11-04 17:38:55 +00:00
|
|
|
|
sub si,cx
|
|
|
|
|
sub si,cx
|
|
|
|
|
rep movsw
|
|
|
|
|
mov si,di
|
|
|
|
|
mov cx,lin
|
|
|
|
|
ylop:
|
|
|
|
|
push cx
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov di,vadr
|
|
|
|
|
mov ax,x_pos
|
2014-11-04 17:38:55 +00:00
|
|
|
|
and ax,7
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jz @@skip
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov cx,8
|
|
|
|
|
sub cx,ax
|
|
|
|
|
push cx
|
|
|
|
|
mov ah,0ffh
|
|
|
|
|
shl ah,cl
|
|
|
|
|
not al
|
|
|
|
|
xor bx,bx
|
|
|
|
|
mov dx,bx
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@lop:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
lodsb
|
|
|
|
|
shl1 al
|
|
|
|
|
rcl1 bl
|
|
|
|
|
shl1 al
|
|
|
|
|
rcl1 bh
|
|
|
|
|
shl1 al
|
|
|
|
|
rcl1 dl
|
|
|
|
|
shl1 al
|
|
|
|
|
rcl1 dh
|
2020-05-11 20:34:20 +00:00
|
|
|
|
loop @@lop
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov cx,0a800h
|
|
|
|
|
mov es,cx
|
|
|
|
|
|
|
|
|
|
mov al,0c0h
|
|
|
|
|
out 7ch,al
|
|
|
|
|
mov al,dh
|
|
|
|
|
out 7eh,al
|
|
|
|
|
mov al,dl
|
|
|
|
|
out 7eh,al
|
|
|
|
|
mov al,bh
|
|
|
|
|
out 7eh,al
|
|
|
|
|
mov al,bl
|
|
|
|
|
out 7eh,al
|
|
|
|
|
mov al,ah
|
2020-05-11 20:34:20 +00:00
|
|
|
|
test option,40h
|
|
|
|
|
jz @@skip0
|
|
|
|
|
mov ah,tcol
|
2014-11-04 17:38:55 +00:00
|
|
|
|
shr ah,1
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jnc @@jmp1
|
2014-11-04 17:38:55 +00:00
|
|
|
|
not dh
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp1:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
shr ah,1
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jnc @@jmp2
|
2014-11-04 17:38:55 +00:00
|
|
|
|
not dl
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp2:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
shr ah,1
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jnc @@jmp3
|
2014-11-04 17:38:55 +00:00
|
|
|
|
not bh
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp3:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
shr ah,1
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jnc @@jmp4
|
2014-11-04 17:38:55 +00:00
|
|
|
|
not bl
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp4:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
or bx,dx
|
|
|
|
|
or bl,bh
|
|
|
|
|
or al,bl
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@skip0:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
stosb
|
|
|
|
|
xor al,al
|
|
|
|
|
out 7ch,al
|
|
|
|
|
|
|
|
|
|
pop ax
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov cx,x_wid
|
2014-11-04 17:38:55 +00:00
|
|
|
|
sub cx,ax
|
|
|
|
|
shr cx,3
|
|
|
|
|
jmp short xlop
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@skip:
|
|
|
|
|
mov cx,x_wid
|
2014-11-04 17:38:55 +00:00
|
|
|
|
shr cx,3
|
|
|
|
|
xlop:
|
|
|
|
|
rept 4
|
|
|
|
|
lodsw
|
|
|
|
|
shl1 al
|
|
|
|
|
rcl1 bl
|
|
|
|
|
shl1 ah
|
|
|
|
|
rcl1 bl
|
|
|
|
|
shl1 al
|
|
|
|
|
rcl1 bh
|
|
|
|
|
shl1 ah
|
|
|
|
|
rcl1 bh
|
|
|
|
|
shl1 al
|
|
|
|
|
rcl1 dl
|
|
|
|
|
shl1 ah
|
|
|
|
|
rcl1 dl
|
|
|
|
|
shl1 al
|
|
|
|
|
rcl1 dh
|
|
|
|
|
shl1 ah
|
|
|
|
|
rcl1 dh
|
|
|
|
|
endm
|
|
|
|
|
mov ax,0a800h
|
|
|
|
|
mov es,ax
|
|
|
|
|
|
2020-05-11 20:34:20 +00:00
|
|
|
|
test option,40h
|
|
|
|
|
jnz @@jmp0
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov es:[di],dh
|
|
|
|
|
mov es:[di+8000h],dl
|
|
|
|
|
mov ah,0b8h
|
|
|
|
|
mov es,ax
|
|
|
|
|
mov es:[di],bh
|
|
|
|
|
mov ah,0e0h
|
|
|
|
|
mov es,ax
|
|
|
|
|
mov al,bl
|
|
|
|
|
stosb
|
|
|
|
|
dec cx
|
|
|
|
|
jz xend
|
|
|
|
|
jmp xlop
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp0:
|
|
|
|
|
mov ah,tcol
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov al,0c0h
|
|
|
|
|
out 7ch,al
|
|
|
|
|
mov al,dh
|
|
|
|
|
out 7eh,al
|
|
|
|
|
mov al,dl
|
|
|
|
|
out 7eh,al
|
|
|
|
|
mov al,bh
|
|
|
|
|
out 7eh,al
|
|
|
|
|
mov al,bl
|
|
|
|
|
out 7eh,al
|
|
|
|
|
|
|
|
|
|
shr ah,1
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jnc @@jmp1
|
2014-11-04 17:38:55 +00:00
|
|
|
|
not dh
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp1:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
shr ah,1
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jnc @@jmp2
|
2014-11-04 17:38:55 +00:00
|
|
|
|
not dl
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp2:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
shr ah,1
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jnc @@jmp3
|
2014-11-04 17:38:55 +00:00
|
|
|
|
not bh
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp3:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
shr ah,1
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jnc @@jmp4
|
2014-11-04 17:38:55 +00:00
|
|
|
|
not bl
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp4:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov ax,dx
|
|
|
|
|
or ax,bx
|
|
|
|
|
or al,ah
|
|
|
|
|
stosb
|
|
|
|
|
dec cx
|
|
|
|
|
jz xend
|
|
|
|
|
jmp xlop
|
|
|
|
|
|
|
|
|
|
xend:
|
|
|
|
|
xor al,al
|
|
|
|
|
out 7ch,al
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov cx,x_wid2
|
2014-11-04 17:38:55 +00:00
|
|
|
|
and cx,7
|
|
|
|
|
jz ext
|
|
|
|
|
mov ah,8
|
|
|
|
|
sub ah,cl
|
|
|
|
|
xor bx,bx
|
|
|
|
|
mov dx,bx
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@lop:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
lodsb
|
|
|
|
|
shl1 al
|
|
|
|
|
rcl1 bl
|
|
|
|
|
shl1 al
|
|
|
|
|
rcl1 bh
|
|
|
|
|
shl1 al
|
|
|
|
|
rcl1 dl
|
|
|
|
|
shl1 al
|
|
|
|
|
rcl1 dh
|
2020-05-11 20:34:20 +00:00
|
|
|
|
loop @@lop
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov cl,ah
|
|
|
|
|
mov ch,0ffh
|
|
|
|
|
shl ch,cl
|
|
|
|
|
shl bx,cl
|
|
|
|
|
shl dx,cl
|
|
|
|
|
mov ax,0a800h
|
|
|
|
|
mov es,ax
|
|
|
|
|
|
|
|
|
|
mov al,0c0h
|
|
|
|
|
out 7ch,al
|
|
|
|
|
mov al,dh
|
|
|
|
|
out 7eh,al
|
|
|
|
|
mov al,dl
|
|
|
|
|
out 7eh,al
|
|
|
|
|
mov al,bh
|
|
|
|
|
out 7eh,al
|
|
|
|
|
mov al,bl
|
|
|
|
|
out 7eh,al
|
|
|
|
|
mov al,ch
|
2020-05-11 20:34:20 +00:00
|
|
|
|
test option,40h
|
|
|
|
|
jz @@skip0
|
|
|
|
|
mov ah,tcol
|
2014-11-04 17:38:55 +00:00
|
|
|
|
shr ah,1
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jnc @@jmp1
|
2014-11-04 17:38:55 +00:00
|
|
|
|
not dh
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp1:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
shr ah,1
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jnc @@jmp2
|
2014-11-04 17:38:55 +00:00
|
|
|
|
not dl
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp2:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
shr ah,1
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jnc @@jmp3
|
2014-11-04 17:38:55 +00:00
|
|
|
|
not bh
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp3:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
shr ah,1
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jnc @@jmp4
|
2014-11-04 17:38:55 +00:00
|
|
|
|
not bl
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@jmp4:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
or bx,dx
|
|
|
|
|
or bl,bh
|
|
|
|
|
or al,bl
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@skip0:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
stosb
|
|
|
|
|
xor al,al
|
|
|
|
|
out 7ch,al
|
|
|
|
|
|
|
|
|
|
ext:
|
|
|
|
|
pop cx
|
2020-05-11 20:34:20 +00:00
|
|
|
|
add vadr,80
|
|
|
|
|
dec y_wid2
|
|
|
|
|
jz fin
|
2014-11-04 17:38:55 +00:00
|
|
|
|
dec cx
|
|
|
|
|
jz ext2
|
|
|
|
|
jmp ylop
|
|
|
|
|
ext2:
|
|
|
|
|
pop es
|
|
|
|
|
popa
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov di,bufbgn
|
2014-11-04 17:38:55 +00:00
|
|
|
|
ret
|
2020-05-11 20:34:20 +00:00
|
|
|
|
fin:
|
|
|
|
|
test flg800,1
|
|
|
|
|
jle @@jmp
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov al,0
|
|
|
|
|
; out 0a4h,al
|
|
|
|
|
out 0a6h,al
|
2020-05-11 20:34:20 +00:00
|
|
|
|
and flg800,not 2
|
|
|
|
|
@@jmp:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
call fclose
|
|
|
|
|
mov sp,spreg
|
|
|
|
|
xor ax,ax
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
; パレット設定
|
|
|
|
|
|
|
|
|
|
; in al=tone [PaletteBuff]=palet
|
|
|
|
|
|
|
|
|
|
mul38 dw 0,38,76,114,152,190,228,266,304,342,380,418,456,494,532,570
|
|
|
|
|
mul75 dw 0,75,150,225,300,375,450,525,600,675,750,825,900,975,1050,1125
|
|
|
|
|
mul15 dw 0,15,30,45,60,75,90,105,120,135,150,165,180,195,210,225
|
|
|
|
|
palset:
|
|
|
|
|
push bx
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov bl,tone
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov bh,100
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov di,tonetbl
|
2014-11-04 17:38:55 +00:00
|
|
|
|
xor cx,cx
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@plop:
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov al,cl
|
|
|
|
|
mul bl
|
|
|
|
|
div bh
|
|
|
|
|
stosb
|
|
|
|
|
inc cl
|
|
|
|
|
cmp cl,16
|
2020-05-11 20:34:20 +00:00
|
|
|
|
jnz @@plop
|
2014-11-04 17:38:55 +00:00
|
|
|
|
|
2020-05-11 20:34:20 +00:00
|
|
|
|
mov si,PaletteBuff
|
|
|
|
|
mov bx,tonetbl
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov cx,16
|
|
|
|
|
xor ah,ah
|
2020-05-11 20:34:20 +00:00
|
|
|
|
test option,16
|
|
|
|
|
jnz @@lop2
|
|
|
|
|
@@lop: ;通常
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov al,ah
|
|
|
|
|
out 0a8h,al ;palet no
|
|
|
|
|
lodsb
|
|
|
|
|
xlat [bx]
|
|
|
|
|
out 0ach,al ;red
|
|
|
|
|
lodsb
|
|
|
|
|
xlat [bx]
|
|
|
|
|
out 0aah,al ;green
|
|
|
|
|
lodsb
|
|
|
|
|
xlat [bx]
|
|
|
|
|
out 0aeh,al ;blue
|
|
|
|
|
inc ah
|
2020-05-11 20:34:20 +00:00
|
|
|
|
loop @@lop
|
2014-11-04 17:38:55 +00:00
|
|
|
|
pop bx
|
|
|
|
|
ret
|
2020-05-11 20:34:20 +00:00
|
|
|
|
@@lop2: ;NOTE用
|
2014-11-04 17:38:55 +00:00
|
|
|
|
mov al,16
|
|
|
|
|
sub al,cl
|
|
|
|
|
out 0a8h,al ;palet no
|
|
|
|
|
mov dx,64
|
|
|
|
|
lodsb
|
|
|
|
|
shl1 al
|
|
|
|
|
mov di,ax
|
|
|
|
|
add dx,mul38[di]
|
|
|
|
|
lodsb
|
|
|
|
|
shl1 al
|
|
|
|
|
mov di,ax
|
|
|
|
|
add dx,mul75[di]
|
|
|
|
|
lodsb
|
|
|
|
|
shl1 al
|
|
|
|
|
mov di,ax
|
|
|
|
|
add dx,mul15[di]
|
|
|
|
|
mov al,7
|
|
|
|
|
sub al,dh
|
|
|
|
|
xlat [bx]
|
|
|
|
|
mov dl,al
|
|
|
|
|
irp port,<0aeh,0ach,0aah>
|
|
|
|
|
shr dl,1
|
|
|
|
|
sbb al,al
|
|
|
|
|
out port,al
|
|
|
|
|
endm
|
2020-05-11 20:34:20 +00:00
|
|
|
|
loop @@lop2
|
2014-11-04 17:38:55 +00:00
|
|
|
|
pop bx
|
|
|
|
|
ret
|
|
|
|
|
|
2020-05-11 20:34:20 +00:00
|
|
|
|
end
|
|
|
|
|
|