mirror of https://github.com/nmlgc/ReC98.git
[Reduction] #182: bgm_read_sdata
[Binary change] Order of 2 relocations in all modified executables.
This commit is contained in:
parent
17fa89801b
commit
b7aa7291db
|
@ -8,6 +8,13 @@ include libs/master.lib/func.inc
|
|||
include libs/master.lib/super.inc
|
||||
include libs/master.lib/bgm.inc
|
||||
|
||||
; Manually put dseg into DGROUP if we're not tiny. The alternative, renaming
|
||||
; dseg to _DATA, unfortunately doesn't work because that segment is enforced
|
||||
; to be 32-bit after specifying .386...
|
||||
if @model ne 1
|
||||
DGROUP group dseg
|
||||
endif
|
||||
|
||||
nopcall macro func
|
||||
if LDATA
|
||||
nop ; PC-98 Touhou compatibility
|
||||
|
|
|
@ -0,0 +1,226 @@
|
|||
; master library - BGM
|
||||
;
|
||||
; Description:
|
||||
; EFSファイルを読み込む
|
||||
;
|
||||
; Function/Procedures:
|
||||
; int bgm_read_sdata(const char *fname);
|
||||
;
|
||||
; Parameters:
|
||||
; fname ファイルネーム
|
||||
;
|
||||
; Returns:
|
||||
; BGM_COMPLETE 正常終了
|
||||
; BGM_FILE_ERR ファイルがない
|
||||
; BGM_FORMAT_ERR フォーマットが異常
|
||||
; BGM_OVERFLOW メモリが足りない
|
||||
;
|
||||
; Binding Target:
|
||||
; Microsoft-C / Turbo-C / Turbo Pascal
|
||||
;
|
||||
; Running Target:
|
||||
; PC-9801V
|
||||
;
|
||||
; Requiring Resources:
|
||||
; CPU: V30
|
||||
;
|
||||
; Notes:
|
||||
;
|
||||
;
|
||||
; Assembly Language Note:
|
||||
;
|
||||
;
|
||||
; Compiler/Assembler:
|
||||
; TASM 3.0
|
||||
; OPTASM 1.6
|
||||
;
|
||||
; Author:
|
||||
; femy(淀 文武) : オリジナル・C言語版
|
||||
; steelman(千野 裕司) : アセンブリ言語版
|
||||
;
|
||||
; Revision History:
|
||||
; 93/12/19 Initial: b_r_sdat.asm / master.lib 0.22 <- bgmlibs.lib 1.12
|
||||
|
||||
MRETURN macro
|
||||
pop SI
|
||||
pop DI
|
||||
leave
|
||||
ret (DATASIZE*2)
|
||||
EVEN
|
||||
endm
|
||||
|
||||
func BGM_READ_SDATA
|
||||
enter 4,0
|
||||
push DI
|
||||
push SI
|
||||
|
||||
fname = (RETSIZE+1)*2
|
||||
|
||||
fbuf_seg= -2
|
||||
senum = -4
|
||||
|
||||
; 指定したファイルがなければファイルエラー
|
||||
if LDATA
|
||||
push word ptr [BP+fname+2]
|
||||
endif
|
||||
push word ptr [BP+fname]
|
||||
nopcall DOS_ROPEN
|
||||
mov SI,AX
|
||||
cmp SI,FileNotFound
|
||||
jne short @@OPENED
|
||||
mov AX,BGM_FILE_ERR
|
||||
jmp short @@RETURN
|
||||
@@NOMEM:
|
||||
mov AX,InsufficientMemory
|
||||
@@RETURN:
|
||||
MRETURN
|
||||
|
||||
@@OPENED:
|
||||
push AX
|
||||
push 0
|
||||
push 0
|
||||
push 2
|
||||
nopcall DOS_SEEK ; 最後にいく
|
||||
mov DI,AX ; 長さの下位16bitだけみる
|
||||
; 64Kオーバーの動作は予測不能
|
||||
push SI
|
||||
push 0
|
||||
push 0
|
||||
push 0
|
||||
nopcall DOS_SEEK ; 戻る
|
||||
push DI
|
||||
nopcall SMEM_WGET
|
||||
jc short @@NOMEM
|
||||
mov [BP+fbuf_seg],AX
|
||||
push SI
|
||||
push AX
|
||||
push CX
|
||||
push DI
|
||||
nopcall DOS_READ
|
||||
mov ES,[BP+fbuf_seg]
|
||||
mov BX,AX
|
||||
mov byte ptr ES:[BX],255 ; 終わりに0ffhを入れる
|
||||
push SI
|
||||
nopcall DOS_CLOSE
|
||||
|
||||
CLD
|
||||
|
||||
;データセット
|
||||
mov AX,glb.snum
|
||||
mov [BP+senum],AX
|
||||
|
||||
mov BX,AX
|
||||
shl BX,3 ; type SESOUND
|
||||
; mov AX,word ptr esound[BX].sbuf
|
||||
; mov word ptr esound[BX].sptr,AX
|
||||
mov word ptr esound[BX].sptr,0 ; offsetは0のはず
|
||||
mov AX,word ptr esound[BX].sbuf+2
|
||||
mov word ptr esound[BX].sptr+2,AX
|
||||
|
||||
xor DI,DI ; dcnt
|
||||
xor SI,SI
|
||||
@@LOOP_TOP:
|
||||
mov DS,[BP+fbuf_seg]
|
||||
ASSUME DS: NOTHING
|
||||
@@TIL_NUMBER:
|
||||
lodsb
|
||||
cmp AL,';'
|
||||
jne short @@NO_COMMENT
|
||||
@@COMMENT_SKIP:
|
||||
lodsb
|
||||
cmp AL,0ffh
|
||||
je short @@NUMBER_FOUND
|
||||
cmp AL,0ah ; ';'が来たら改行まで飛ばす
|
||||
jne short @@COMMENT_SKIP
|
||||
|
||||
@@NO_COMMENT:
|
||||
cmp AL,'0'
|
||||
jb short @@L01
|
||||
cmp AL,'9'
|
||||
jbe short @@NUMBER_FOUND
|
||||
@@L01:
|
||||
cmp AL,0ffh
|
||||
jne short @@TIL_NUMBER
|
||||
@@NUMBER_FOUND:
|
||||
xor CX,CX ; dat = 0;
|
||||
|
||||
; 数字が来た
|
||||
cmp AL,'0'
|
||||
jb short @@NUMBER_END
|
||||
@@WHILE_NUMBER:
|
||||
cmp AL,'9'
|
||||
ja short @@NUMBER_END
|
||||
cmp AL,0ffh
|
||||
je short @@NUMBER_END
|
||||
|
||||
sub AL,'0'
|
||||
mov DL,AL
|
||||
mov DH,0
|
||||
|
||||
mov AX,CX ; CX = CX * 10
|
||||
shl AX,2
|
||||
add AX,CX
|
||||
add AX,AX
|
||||
add AX,DX ; .... + (c - '0') ;
|
||||
mov CX,AX
|
||||
lodsb
|
||||
cmp AL,'0'
|
||||
jae short @@WHILE_NUMBER
|
||||
@@NUMBER_END:
|
||||
|
||||
; 数字が終わった
|
||||
; CXに数値が入った
|
||||
push seg DGROUP
|
||||
pop DS
|
||||
ASSUME DS: DGROUP
|
||||
|
||||
cmp AL,0ffh
|
||||
je short @@LOOP_BREAK
|
||||
|
||||
mov BX,glb.snum
|
||||
shl BX,3
|
||||
mov DX,BX
|
||||
les BX,esound[BX].sptr
|
||||
mov ES:[BX],CX ; *esound[glb.senum].sptr = data
|
||||
mov BX,DX
|
||||
add word ptr esound[BX].sptr,2 ; esound[glb.senum].sptr++
|
||||
|
||||
or CX,CX ; dat = SEND?
|
||||
je short @@DAT_IS_SEND
|
||||
inc DI ; dcnt
|
||||
cmp DI,SBUFMAX
|
||||
jne short @@NOT_SBUFMAX
|
||||
@@DAT_IS_SEND:
|
||||
mov BX,glb.snum
|
||||
shl BX,3
|
||||
les BX,esound[BX].sptr
|
||||
xor DI,DI ; dcnt = 0;
|
||||
mov ES:[BX],DI ; *esound[glb.senum].sptr = SEND
|
||||
inc glb.snum
|
||||
cmp glb.snum,SMAX
|
||||
je short @@LOOP_BREAK ; break
|
||||
|
||||
; esound[glb.senum].sptr = esound[glb.senum].sbuf ;
|
||||
mov BX,glb.snum
|
||||
shl BX,3
|
||||
; mov CX,word ptr esound[BX].sbuf
|
||||
; mov word ptr esound[BX].sptr,CX
|
||||
mov word ptr esound[BX].sptr,0 ; offsetは0のはず
|
||||
mov CX,word ptr esound[BX].sbuf+2
|
||||
mov word ptr esound[BX].sptr+2,CX
|
||||
@@NOT_SBUFMAX:
|
||||
cmp AL,0ffh
|
||||
je short @@LOOP_BREAK
|
||||
jmp @@LOOP_TOP
|
||||
@@LOOP_BREAK:
|
||||
|
||||
mov AX,glb.snum
|
||||
cmp [BP+senum],AX
|
||||
mov AX,BGM_FORMAT_ERR
|
||||
je short @@FORMERR ; 一つも増えなかったなら失敗
|
||||
xor AX,AX ; BGM_COMPLETE
|
||||
@@FORMERR:
|
||||
push word ptr [BP+fbuf_seg]
|
||||
nopcall SMEM_RELEASE
|
||||
MRETURN
|
||||
endfunc
|
183
th04_main.asm
183
th04_main.asm
|
@ -5920,186 +5920,7 @@ sub_3680 endp
|
|||
|
||||
include libs/master.lib/bgm_bell_org.asm
|
||||
include libs/master.lib/bgm_mget.asm
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
; Attributes: bp-based frame
|
||||
|
||||
sub_3878 proc far
|
||||
|
||||
var_4 = word ptr -4
|
||||
var_2 = word ptr -2
|
||||
arg_0 = word ptr 6
|
||||
arg_2 = word ptr 8
|
||||
|
||||
enter 4, 0
|
||||
push di
|
||||
push si
|
||||
push [bp+arg_2]
|
||||
push [bp+arg_0]
|
||||
nop
|
||||
call dos_ropen
|
||||
mov si, ax
|
||||
cmp si, 0FFFEh
|
||||
jnz short loc_389E
|
||||
mov ax, 0FFFEh
|
||||
jmp short loc_3898
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_3895:
|
||||
mov ax, 0FFF8h
|
||||
|
||||
loc_3898:
|
||||
pop si
|
||||
pop di
|
||||
leave
|
||||
retf 4
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_389E:
|
||||
push ax
|
||||
push 0
|
||||
push 0
|
||||
push 2
|
||||
nopcall dos_seek
|
||||
mov di, ax
|
||||
push si
|
||||
push 0
|
||||
push 0
|
||||
push 0
|
||||
nopcall dos_seek
|
||||
push di
|
||||
nop
|
||||
call smem_wget
|
||||
jb short loc_3895
|
||||
mov [bp+var_2], ax
|
||||
push si
|
||||
push ax
|
||||
push cx
|
||||
push di
|
||||
nopcall dos_read
|
||||
mov es, [bp+var_2]
|
||||
mov bx, ax
|
||||
mov byte ptr es:[bx], 0FFh
|
||||
push si
|
||||
nop
|
||||
call dos_close
|
||||
cld
|
||||
mov ax, glb.snum
|
||||
mov [bp+var_4], ax
|
||||
mov bx, ax
|
||||
shl bx, 3
|
||||
mov word ptr [bx+36A2h], 0
|
||||
mov ax, [bx+36A8h]
|
||||
mov [bx+36A4h], ax
|
||||
xor di, di
|
||||
xor si, si
|
||||
|
||||
loc_38F9:
|
||||
mov ds, [bp+var_2]
|
||||
|
||||
loc_38FC:
|
||||
lodsb
|
||||
cmp al, 3Bh ; ';'
|
||||
jnz short loc_390A
|
||||
|
||||
loc_3901:
|
||||
lodsb
|
||||
cmp al, 0FFh
|
||||
jz short loc_3916
|
||||
cmp al, 0Ah
|
||||
jnz short loc_3901
|
||||
|
||||
loc_390A:
|
||||
cmp al, 30h ; '0'
|
||||
jb short loc_3912
|
||||
cmp al, 39h ; '9'
|
||||
jbe short loc_3916
|
||||
|
||||
loc_3912:
|
||||
cmp al, 0FFh
|
||||
jnz short loc_38FC
|
||||
|
||||
loc_3916:
|
||||
xor cx, cx
|
||||
cmp al, 30h ; '0'
|
||||
jb short loc_393C
|
||||
|
||||
loc_391C:
|
||||
cmp al, 39h ; '9'
|
||||
ja short loc_393C
|
||||
cmp al, 0FFh
|
||||
jz short loc_393C
|
||||
sub al, 30h ; '0'
|
||||
mov dl, al
|
||||
mov dh, 0
|
||||
mov ax, cx
|
||||
shl ax, 2
|
||||
add ax, cx
|
||||
add ax, ax
|
||||
add ax, dx
|
||||
mov cx, ax
|
||||
lodsb
|
||||
cmp al, 30h ; '0'
|
||||
jnb short loc_391C
|
||||
|
||||
loc_393C:
|
||||
push seg dseg
|
||||
pop ds
|
||||
cmp al, 0FFh
|
||||
jz short loc_399D
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
mov dx, bx
|
||||
les bx, [bx+36A2h]
|
||||
mov es:[bx], cx
|
||||
mov bx, dx
|
||||
add word ptr [bx+36A2h], 2
|
||||
or cx, cx
|
||||
jz short loc_3966
|
||||
inc di
|
||||
cmp di, 100h
|
||||
jnz short loc_3996
|
||||
|
||||
loc_3966:
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
les bx, [bx+36A2h]
|
||||
xor di, di
|
||||
mov es:[bx], di
|
||||
inc glb.snum
|
||||
cmp glb.snum, 10h
|
||||
jz short loc_399D
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
mov word ptr [bx+36A2h], 0
|
||||
mov cx, [bx+36A8h]
|
||||
mov [bx+36A4h], cx
|
||||
|
||||
loc_3996:
|
||||
cmp al, 0FFh
|
||||
jz short loc_399D
|
||||
jmp loc_38F9
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_399D:
|
||||
; sub_3878+107j ...
|
||||
mov ax, glb.snum
|
||||
cmp [bp+var_4], ax
|
||||
mov ax, 0FFF5h
|
||||
jz short loc_39AA
|
||||
xor ax, ax
|
||||
|
||||
loc_39AA:
|
||||
push [bp+var_2]
|
||||
nop
|
||||
call smem_release
|
||||
pop si
|
||||
pop di
|
||||
leave
|
||||
retf 4
|
||||
sub_3878 endp
|
||||
|
||||
include libs/master.lib/bgm_read_sdata.asm
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
|
@ -36664,7 +36485,7 @@ loc_134B2:
|
|||
mov byte ptr [si+3966h], 73h ; 's'
|
||||
push ds
|
||||
push offset unk_24CA4
|
||||
call sub_3878
|
||||
call bgm_read_sdata
|
||||
jmp loc_1357B
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
|
|
183
th04_maine.asm
183
th04_maine.asm
|
@ -2977,186 +2977,7 @@ sub_2CFC endp
|
|||
|
||||
include libs/master.lib/bgm_bell_org.asm
|
||||
include libs/master.lib/bgm_mget.asm
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
; Attributes: bp-based frame
|
||||
|
||||
sub_2E94 proc far
|
||||
|
||||
var_4 = word ptr -4
|
||||
var_2 = word ptr -2
|
||||
arg_0 = word ptr 6
|
||||
arg_2 = word ptr 8
|
||||
|
||||
enter 4, 0
|
||||
push di
|
||||
push si
|
||||
push [bp+arg_2]
|
||||
push [bp+arg_0]
|
||||
nop
|
||||
call dos_ropen
|
||||
mov si, ax
|
||||
cmp si, 0FFFEh
|
||||
jnz short loc_2EBA
|
||||
mov ax, 0FFFEh
|
||||
jmp short loc_2EB4
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_2EB1:
|
||||
mov ax, 0FFF8h
|
||||
|
||||
loc_2EB4:
|
||||
pop si
|
||||
pop di
|
||||
leave
|
||||
retf 4
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_2EBA:
|
||||
push ax
|
||||
push 0
|
||||
push 0
|
||||
push 2
|
||||
nopcall dos_seek
|
||||
mov di, ax
|
||||
push si
|
||||
push 0
|
||||
push 0
|
||||
push 0
|
||||
nopcall dos_seek
|
||||
push di
|
||||
nop
|
||||
call smem_wget
|
||||
jb short loc_2EB1
|
||||
mov [bp+var_2], ax
|
||||
push si
|
||||
push ax
|
||||
push cx
|
||||
push di
|
||||
nopcall dos_read
|
||||
mov es, [bp+var_2]
|
||||
mov bx, ax
|
||||
mov byte ptr es:[bx], 0FFh
|
||||
push si
|
||||
nop
|
||||
call dos_close
|
||||
cld
|
||||
mov ax, glb.snum
|
||||
mov [bp+var_4], ax
|
||||
mov bx, ax
|
||||
shl bx, 3
|
||||
mov word ptr [bx+1AB2h], 0
|
||||
mov ax, [bx+1AB8h]
|
||||
mov [bx+1AB4h], ax
|
||||
xor di, di
|
||||
xor si, si
|
||||
|
||||
loc_2F15:
|
||||
mov ds, [bp+var_2]
|
||||
|
||||
loc_2F18:
|
||||
lodsb
|
||||
cmp al, 3Bh ; ';'
|
||||
jnz short loc_2F26
|
||||
|
||||
loc_2F1D:
|
||||
lodsb
|
||||
cmp al, 0FFh
|
||||
jz short loc_2F32
|
||||
cmp al, 0Ah
|
||||
jnz short loc_2F1D
|
||||
|
||||
loc_2F26:
|
||||
cmp al, 30h ; '0'
|
||||
jb short loc_2F2E
|
||||
cmp al, 39h ; '9'
|
||||
jbe short loc_2F32
|
||||
|
||||
loc_2F2E:
|
||||
cmp al, 0FFh
|
||||
jnz short loc_2F18
|
||||
|
||||
loc_2F32:
|
||||
xor cx, cx
|
||||
cmp al, 30h ; '0'
|
||||
jb short loc_2F58
|
||||
|
||||
loc_2F38:
|
||||
cmp al, 39h ; '9'
|
||||
ja short loc_2F58
|
||||
cmp al, 0FFh
|
||||
jz short loc_2F58
|
||||
sub al, 30h ; '0'
|
||||
mov dl, al
|
||||
mov dh, 0
|
||||
mov ax, cx
|
||||
shl ax, 2
|
||||
add ax, cx
|
||||
add ax, ax
|
||||
add ax, dx
|
||||
mov cx, ax
|
||||
lodsb
|
||||
cmp al, 30h ; '0'
|
||||
jnb short loc_2F38
|
||||
|
||||
loc_2F58:
|
||||
push seg dseg
|
||||
pop ds
|
||||
cmp al, 0FFh
|
||||
jz short loc_2FB9
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
mov dx, bx
|
||||
les bx, [bx+1AB2h]
|
||||
mov es:[bx], cx
|
||||
mov bx, dx
|
||||
add word ptr [bx+1AB2h], 2
|
||||
or cx, cx
|
||||
jz short loc_2F82
|
||||
inc di
|
||||
cmp di, 100h
|
||||
jnz short loc_2FB2
|
||||
|
||||
loc_2F82:
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
les bx, [bx+1AB2h]
|
||||
xor di, di
|
||||
mov es:[bx], di
|
||||
inc glb.snum
|
||||
cmp glb.snum, 10h
|
||||
jz short loc_2FB9
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
mov word ptr [bx+1AB2h], 0
|
||||
mov cx, [bx+1AB8h]
|
||||
mov [bx+1AB4h], cx
|
||||
|
||||
loc_2FB2:
|
||||
cmp al, 0FFh
|
||||
jz short loc_2FB9
|
||||
jmp loc_2F15
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_2FB9:
|
||||
; sub_2E94+107j ...
|
||||
mov ax, glb.snum
|
||||
cmp [bp+var_4], ax
|
||||
mov ax, 0FFF5h
|
||||
jz short loc_2FC6
|
||||
xor ax, ax
|
||||
|
||||
loc_2FC6:
|
||||
push [bp+var_2]
|
||||
nop
|
||||
call smem_release
|
||||
pop si
|
||||
pop di
|
||||
leave
|
||||
retf 4
|
||||
sub_2E94 endp
|
||||
|
||||
include libs/master.lib/bgm_read_sdata.asm
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
|
@ -21255,7 +21076,7 @@ loc_D12E:
|
|||
mov byte ptr [si+1B34h], 73h ; 's'
|
||||
push ds
|
||||
push offset unk_10062
|
||||
call sub_2E94
|
||||
call bgm_read_sdata
|
||||
jmp loc_D1F7
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
|
|
183
th04_op.asm
183
th04_op.asm
|
@ -3723,186 +3723,7 @@ sub_349A endp
|
|||
|
||||
include libs/master.lib/bgm_bell_org.asm
|
||||
include libs/master.lib/bgm_mget.asm
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
; Attributes: bp-based frame
|
||||
|
||||
sub_3632 proc far
|
||||
|
||||
var_4 = word ptr -4
|
||||
var_2 = word ptr -2
|
||||
arg_0 = word ptr 6
|
||||
arg_2 = word ptr 8
|
||||
|
||||
enter 4, 0
|
||||
push di
|
||||
push si
|
||||
push [bp+arg_2]
|
||||
push [bp+arg_0]
|
||||
nop
|
||||
call dos_ropen
|
||||
mov si, ax
|
||||
cmp si, 0FFFEh
|
||||
jnz short loc_3658
|
||||
mov ax, 0FFFEh
|
||||
jmp short loc_3652
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_364F:
|
||||
mov ax, 0FFF8h
|
||||
|
||||
loc_3652:
|
||||
pop si
|
||||
pop di
|
||||
leave
|
||||
retf 4
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_3658:
|
||||
push ax
|
||||
push 0
|
||||
push 0
|
||||
push 2
|
||||
nopcall dos_seek
|
||||
mov di, ax
|
||||
push si
|
||||
push 0
|
||||
push 0
|
||||
push 0
|
||||
nopcall dos_seek
|
||||
push di
|
||||
nop
|
||||
call smem_wget
|
||||
jb short loc_364F
|
||||
mov [bp+var_2], ax
|
||||
push si
|
||||
push ax
|
||||
push cx
|
||||
push di
|
||||
nopcall dos_read
|
||||
mov es, [bp+var_2]
|
||||
mov bx, ax
|
||||
mov byte ptr es:[bx], 0FFh
|
||||
push si
|
||||
nop
|
||||
call dos_close
|
||||
cld
|
||||
mov ax, glb.snum
|
||||
mov [bp+var_4], ax
|
||||
mov bx, ax
|
||||
shl bx, 3
|
||||
mov word ptr [bx+2680h], 0
|
||||
mov ax, [bx+2686h]
|
||||
mov [bx+2682h], ax
|
||||
xor di, di
|
||||
xor si, si
|
||||
|
||||
loc_36B3:
|
||||
mov ds, [bp+var_2]
|
||||
|
||||
loc_36B6:
|
||||
lodsb
|
||||
cmp al, 3Bh ; ';'
|
||||
jnz short loc_36C4
|
||||
|
||||
loc_36BB:
|
||||
lodsb
|
||||
cmp al, 0FFh
|
||||
jz short loc_36D0
|
||||
cmp al, 0Ah
|
||||
jnz short loc_36BB
|
||||
|
||||
loc_36C4:
|
||||
cmp al, 30h ; '0'
|
||||
jb short loc_36CC
|
||||
cmp al, 39h ; '9'
|
||||
jbe short loc_36D0
|
||||
|
||||
loc_36CC:
|
||||
cmp al, 0FFh
|
||||
jnz short loc_36B6
|
||||
|
||||
loc_36D0:
|
||||
xor cx, cx
|
||||
cmp al, 30h ; '0'
|
||||
jb short loc_36F6
|
||||
|
||||
loc_36D6:
|
||||
cmp al, 39h ; '9'
|
||||
ja short loc_36F6
|
||||
cmp al, 0FFh
|
||||
jz short loc_36F6
|
||||
sub al, 30h ; '0'
|
||||
mov dl, al
|
||||
mov dh, 0
|
||||
mov ax, cx
|
||||
shl ax, 2
|
||||
add ax, cx
|
||||
add ax, ax
|
||||
add ax, dx
|
||||
mov cx, ax
|
||||
lodsb
|
||||
cmp al, 30h ; '0'
|
||||
jnb short loc_36D6
|
||||
|
||||
loc_36F6:
|
||||
push seg dseg
|
||||
pop ds
|
||||
cmp al, 0FFh
|
||||
jz short loc_3757
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
mov dx, bx
|
||||
les bx, [bx+2680h]
|
||||
mov es:[bx], cx
|
||||
mov bx, dx
|
||||
add word ptr [bx+2680h], 2
|
||||
or cx, cx
|
||||
jz short loc_3720
|
||||
inc di
|
||||
cmp di, 100h
|
||||
jnz short loc_3750
|
||||
|
||||
loc_3720:
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
les bx, [bx+2680h]
|
||||
xor di, di
|
||||
mov es:[bx], di
|
||||
inc glb.snum
|
||||
cmp glb.snum, 10h
|
||||
jz short loc_3757
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
mov word ptr [bx+2680h], 0
|
||||
mov cx, [bx+2686h]
|
||||
mov [bx+2682h], cx
|
||||
|
||||
loc_3750:
|
||||
cmp al, 0FFh
|
||||
jz short loc_3757
|
||||
jmp loc_36B3
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_3757:
|
||||
; sub_3632+107j ...
|
||||
mov ax, glb.snum
|
||||
cmp [bp+var_4], ax
|
||||
mov ax, 0FFF5h
|
||||
jz short loc_3764
|
||||
xor ax, ax
|
||||
|
||||
loc_3764:
|
||||
push [bp+var_2]
|
||||
nop
|
||||
call smem_release
|
||||
pop si
|
||||
pop di
|
||||
leave
|
||||
retf 4
|
||||
sub_3632 endp
|
||||
|
||||
include libs/master.lib/bgm_read_sdata.asm
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
|
@ -22752,7 +22573,7 @@ loc_DDE6:
|
|||
mov byte ptr [si+2702h], 73h ; 's'
|
||||
push ds
|
||||
push offset unk_11A40
|
||||
call sub_3632
|
||||
call bgm_read_sdata
|
||||
jmp loc_DEAF
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
|
|
183
th05_main.asm
183
th05_main.asm
|
@ -5829,186 +5829,7 @@ sub_367A endp
|
|||
|
||||
include libs/master.lib/bgm_bell_org.asm
|
||||
include libs/master.lib/bgm_mget.asm
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
; Attributes: bp-based frame
|
||||
|
||||
sub_3812 proc far
|
||||
|
||||
var_4 = word ptr -4
|
||||
var_2 = word ptr -2
|
||||
arg_0 = word ptr 6
|
||||
arg_2 = word ptr 8
|
||||
|
||||
enter 4, 0
|
||||
push di
|
||||
push si
|
||||
push [bp+arg_2]
|
||||
push [bp+arg_0]
|
||||
nop
|
||||
call dos_ropen
|
||||
mov si, ax
|
||||
cmp si, 0FFFEh
|
||||
jnz short loc_3838
|
||||
mov ax, 0FFFEh
|
||||
jmp short loc_3832
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_382F:
|
||||
mov ax, 0FFF8h
|
||||
|
||||
loc_3832:
|
||||
pop si
|
||||
pop di
|
||||
leave
|
||||
retf 4
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_3838:
|
||||
push ax
|
||||
push 0
|
||||
push 0
|
||||
push 2
|
||||
nopcall dos_seek
|
||||
mov di, ax
|
||||
push si
|
||||
push 0
|
||||
push 0
|
||||
push 0
|
||||
nopcall dos_seek
|
||||
push di
|
||||
nop
|
||||
call smem_wget
|
||||
jb short loc_382F
|
||||
mov [bp+var_2], ax
|
||||
push si
|
||||
push ax
|
||||
push cx
|
||||
push di
|
||||
nopcall dos_read
|
||||
mov es, [bp+var_2]
|
||||
mov bx, ax
|
||||
mov byte ptr es:[bx], 0FFh
|
||||
push si
|
||||
nop
|
||||
call dos_close
|
||||
cld
|
||||
mov ax, glb.snum
|
||||
mov [bp+var_4], ax
|
||||
mov bx, ax
|
||||
shl bx, 3
|
||||
mov word ptr [bx+2FE8h], 0
|
||||
mov ax, [bx+2FEEh]
|
||||
mov [bx+2FEAh], ax
|
||||
xor di, di
|
||||
xor si, si
|
||||
|
||||
loc_3893:
|
||||
mov ds, [bp+var_2]
|
||||
|
||||
loc_3896:
|
||||
lodsb
|
||||
cmp al, 3Bh ; ';'
|
||||
jnz short loc_38A4
|
||||
|
||||
loc_389B:
|
||||
lodsb
|
||||
cmp al, 0FFh
|
||||
jz short loc_38B0
|
||||
cmp al, 0Ah
|
||||
jnz short loc_389B
|
||||
|
||||
loc_38A4:
|
||||
cmp al, 30h ; '0'
|
||||
jb short loc_38AC
|
||||
cmp al, 39h ; '9'
|
||||
jbe short loc_38B0
|
||||
|
||||
loc_38AC:
|
||||
cmp al, 0FFh
|
||||
jnz short loc_3896
|
||||
|
||||
loc_38B0:
|
||||
xor cx, cx
|
||||
cmp al, 30h ; '0'
|
||||
jb short loc_38D6
|
||||
|
||||
loc_38B6:
|
||||
cmp al, 39h ; '9'
|
||||
ja short loc_38D6
|
||||
cmp al, 0FFh
|
||||
jz short loc_38D6
|
||||
sub al, 30h ; '0'
|
||||
mov dl, al
|
||||
mov dh, 0
|
||||
mov ax, cx
|
||||
shl ax, 2
|
||||
add ax, cx
|
||||
add ax, ax
|
||||
add ax, dx
|
||||
mov cx, ax
|
||||
lodsb
|
||||
cmp al, 30h ; '0'
|
||||
jnb short loc_38B6
|
||||
|
||||
loc_38D6:
|
||||
push seg dseg
|
||||
pop ds
|
||||
cmp al, 0FFh
|
||||
jz short loc_3937
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
mov dx, bx
|
||||
les bx, [bx+2FE8h]
|
||||
mov es:[bx], cx
|
||||
mov bx, dx
|
||||
add word ptr [bx+2FE8h], 2
|
||||
or cx, cx
|
||||
jz short loc_3900
|
||||
inc di
|
||||
cmp di, 100h
|
||||
jnz short loc_3930
|
||||
|
||||
loc_3900:
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
les bx, [bx+2FE8h]
|
||||
xor di, di
|
||||
mov es:[bx], di
|
||||
inc glb.snum
|
||||
cmp glb.snum, 10h
|
||||
jz short loc_3937
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
mov word ptr [bx+2FE8h], 0
|
||||
mov cx, [bx+2FEEh]
|
||||
mov [bx+2FEAh], cx
|
||||
|
||||
loc_3930:
|
||||
cmp al, 0FFh
|
||||
jz short loc_3937
|
||||
jmp loc_3893
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_3937:
|
||||
; sub_3812+107j ...
|
||||
mov ax, glb.snum
|
||||
cmp [bp+var_4], ax
|
||||
mov ax, 0FFF5h
|
||||
jz short loc_3944
|
||||
xor ax, ax
|
||||
|
||||
loc_3944:
|
||||
push [bp+var_2]
|
||||
nop
|
||||
call smem_release
|
||||
pop si
|
||||
pop di
|
||||
leave
|
||||
retf 4
|
||||
sub_3812 endp
|
||||
|
||||
include libs/master.lib/bgm_read_sdata.asm
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
|
@ -37801,7 +37622,7 @@ arg_2 = dword ptr 8
|
|||
call sub_3D4E
|
||||
push ds
|
||||
push offset unk_23A48
|
||||
call sub_3812
|
||||
call bgm_read_sdata
|
||||
jmp short loc_14F62
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
|
|
183
th05_maine.asm
183
th05_maine.asm
|
@ -3423,186 +3423,7 @@ sub_2E82 endp
|
|||
|
||||
include libs/master.lib/bgm_bell_org.asm
|
||||
include libs/master.lib/bgm_mget.asm
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
; Attributes: bp-based frame
|
||||
|
||||
sub_301A proc far
|
||||
|
||||
var_4 = word ptr -4
|
||||
var_2 = word ptr -2
|
||||
arg_0 = word ptr 6
|
||||
arg_2 = word ptr 8
|
||||
|
||||
enter 4, 0
|
||||
push di
|
||||
push si
|
||||
push [bp+arg_2]
|
||||
push [bp+arg_0]
|
||||
nop
|
||||
call dos_ropen
|
||||
mov si, ax
|
||||
cmp si, 0FFFEh
|
||||
jnz short loc_3040
|
||||
mov ax, 0FFFEh
|
||||
jmp short loc_303A
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_3037:
|
||||
mov ax, 0FFF8h
|
||||
|
||||
loc_303A:
|
||||
pop si
|
||||
pop di
|
||||
leave
|
||||
retf 4
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_3040:
|
||||
push ax
|
||||
push 0
|
||||
push 0
|
||||
push 2
|
||||
nopcall dos_seek
|
||||
mov di, ax
|
||||
push si
|
||||
push 0
|
||||
push 0
|
||||
push 0
|
||||
nopcall dos_seek
|
||||
push di
|
||||
nop
|
||||
call smem_wget
|
||||
jb short loc_3037
|
||||
mov [bp+var_2], ax
|
||||
push si
|
||||
push ax
|
||||
push cx
|
||||
push di
|
||||
nopcall dos_read
|
||||
mov es, [bp+var_2]
|
||||
mov bx, ax
|
||||
mov byte ptr es:[bx], 0FFh
|
||||
push si
|
||||
nop
|
||||
call dos_close
|
||||
cld
|
||||
mov ax, glb.snum
|
||||
mov [bp+var_4], ax
|
||||
mov bx, ax
|
||||
shl bx, 3
|
||||
mov word ptr [bx+2726h], 0
|
||||
mov ax, [bx+272Ch]
|
||||
mov [bx+2728h], ax
|
||||
xor di, di
|
||||
xor si, si
|
||||
|
||||
loc_309B:
|
||||
mov ds, [bp+var_2]
|
||||
|
||||
loc_309E:
|
||||
lodsb
|
||||
cmp al, 3Bh ; ';'
|
||||
jnz short loc_30AC
|
||||
|
||||
loc_30A3:
|
||||
lodsb
|
||||
cmp al, 0FFh
|
||||
jz short loc_30B8
|
||||
cmp al, 0Ah
|
||||
jnz short loc_30A3
|
||||
|
||||
loc_30AC:
|
||||
cmp al, 30h ; '0'
|
||||
jb short loc_30B4
|
||||
cmp al, 39h ; '9'
|
||||
jbe short loc_30B8
|
||||
|
||||
loc_30B4:
|
||||
cmp al, 0FFh
|
||||
jnz short loc_309E
|
||||
|
||||
loc_30B8:
|
||||
xor cx, cx
|
||||
cmp al, 30h ; '0'
|
||||
jb short loc_30DE
|
||||
|
||||
loc_30BE:
|
||||
cmp al, 39h ; '9'
|
||||
ja short loc_30DE
|
||||
cmp al, 0FFh
|
||||
jz short loc_30DE
|
||||
sub al, 30h ; '0'
|
||||
mov dl, al
|
||||
mov dh, 0
|
||||
mov ax, cx
|
||||
shl ax, 2
|
||||
add ax, cx
|
||||
add ax, ax
|
||||
add ax, dx
|
||||
mov cx, ax
|
||||
lodsb
|
||||
cmp al, 30h ; '0'
|
||||
jnb short loc_30BE
|
||||
|
||||
loc_30DE:
|
||||
push seg dseg
|
||||
pop ds
|
||||
cmp al, 0FFh
|
||||
jz short loc_313F
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
mov dx, bx
|
||||
les bx, [bx+2726h]
|
||||
mov es:[bx], cx
|
||||
mov bx, dx
|
||||
add word ptr [bx+2726h], 2
|
||||
or cx, cx
|
||||
jz short loc_3108
|
||||
inc di
|
||||
cmp di, 100h
|
||||
jnz short loc_3138
|
||||
|
||||
loc_3108:
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
les bx, [bx+2726h]
|
||||
xor di, di
|
||||
mov es:[bx], di
|
||||
inc glb.snum
|
||||
cmp glb.snum, 10h
|
||||
jz short loc_313F
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
mov word ptr [bx+2726h], 0
|
||||
mov cx, [bx+272Ch]
|
||||
mov [bx+2728h], cx
|
||||
|
||||
loc_3138:
|
||||
cmp al, 0FFh
|
||||
jz short loc_313F
|
||||
jmp loc_309B
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_313F:
|
||||
; sub_301A+107j ...
|
||||
mov ax, glb.snum
|
||||
cmp [bp+var_4], ax
|
||||
mov ax, 0FFF5h
|
||||
jz short loc_314C
|
||||
xor ax, ax
|
||||
|
||||
loc_314C:
|
||||
push [bp+var_2]
|
||||
nop
|
||||
call smem_release
|
||||
pop si
|
||||
pop di
|
||||
leave
|
||||
retf 4
|
||||
sub_301A endp
|
||||
|
||||
include libs/master.lib/bgm_read_sdata.asm
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
|
@ -25039,7 +24860,7 @@ arg_2 = dword ptr 8
|
|||
call sub_3556
|
||||
push ds
|
||||
push offset unk_128A6
|
||||
call sub_301A
|
||||
call bgm_read_sdata
|
||||
jmp short loc_EE12
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
|
|
183
th05_op.asm
183
th05_op.asm
|
@ -2843,186 +2843,7 @@ sub_2CBA endp
|
|||
|
||||
include libs/master.lib/bgm_bell_org.asm
|
||||
include libs/master.lib/bgm_mget.asm
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
; Attributes: bp-based frame
|
||||
|
||||
sub_2E52 proc far
|
||||
|
||||
var_4 = word ptr -4
|
||||
var_2 = word ptr -2
|
||||
arg_0 = word ptr 6
|
||||
arg_2 = word ptr 8
|
||||
|
||||
enter 4, 0
|
||||
push di
|
||||
push si
|
||||
push [bp+arg_2]
|
||||
push [bp+arg_0]
|
||||
nop
|
||||
call dos_ropen
|
||||
mov si, ax
|
||||
cmp si, 0FFFEh
|
||||
jnz short loc_2E78
|
||||
mov ax, 0FFFEh
|
||||
jmp short loc_2E72
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_2E6F:
|
||||
mov ax, 0FFF8h
|
||||
|
||||
loc_2E72:
|
||||
pop si
|
||||
pop di
|
||||
leave
|
||||
retf 4
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_2E78:
|
||||
push ax
|
||||
push 0
|
||||
push 0
|
||||
push 2
|
||||
nopcall dos_seek
|
||||
mov di, ax
|
||||
push si
|
||||
push 0
|
||||
push 0
|
||||
push 0
|
||||
nopcall dos_seek
|
||||
push di
|
||||
nop
|
||||
call smem_wget
|
||||
jb short loc_2E6F
|
||||
mov [bp+var_2], ax
|
||||
push si
|
||||
push ax
|
||||
push cx
|
||||
push di
|
||||
nopcall dos_read
|
||||
mov es, [bp+var_2]
|
||||
mov bx, ax
|
||||
mov byte ptr es:[bx], 0FFh
|
||||
push si
|
||||
nop
|
||||
call dos_close
|
||||
cld
|
||||
mov ax, glb.snum
|
||||
mov [bp+var_4], ax
|
||||
mov bx, ax
|
||||
shl bx, 3
|
||||
mov word ptr [bx+37AAh], 0
|
||||
mov ax, [bx+37B0h]
|
||||
mov [bx+37ACh], ax
|
||||
xor di, di
|
||||
xor si, si
|
||||
|
||||
loc_2ED3:
|
||||
mov ds, [bp+var_2]
|
||||
|
||||
loc_2ED6:
|
||||
lodsb
|
||||
cmp al, 3Bh ; ';'
|
||||
jnz short loc_2EE4
|
||||
|
||||
loc_2EDB:
|
||||
lodsb
|
||||
cmp al, 0FFh
|
||||
jz short loc_2EF0
|
||||
cmp al, 0Ah
|
||||
jnz short loc_2EDB
|
||||
|
||||
loc_2EE4:
|
||||
cmp al, 30h ; '0'
|
||||
jb short loc_2EEC
|
||||
cmp al, 39h ; '9'
|
||||
jbe short loc_2EF0
|
||||
|
||||
loc_2EEC:
|
||||
cmp al, 0FFh
|
||||
jnz short loc_2ED6
|
||||
|
||||
loc_2EF0:
|
||||
xor cx, cx
|
||||
cmp al, 30h ; '0'
|
||||
jb short loc_2F16
|
||||
|
||||
loc_2EF6:
|
||||
cmp al, 39h ; '9'
|
||||
ja short loc_2F16
|
||||
cmp al, 0FFh
|
||||
jz short loc_2F16
|
||||
sub al, 30h ; '0'
|
||||
mov dl, al
|
||||
mov dh, 0
|
||||
mov ax, cx
|
||||
shl ax, 2
|
||||
add ax, cx
|
||||
add ax, ax
|
||||
add ax, dx
|
||||
mov cx, ax
|
||||
lodsb
|
||||
cmp al, 30h ; '0'
|
||||
jnb short loc_2EF6
|
||||
|
||||
loc_2F16:
|
||||
push seg dseg
|
||||
pop ds
|
||||
cmp al, 0FFh
|
||||
jz short loc_2F77
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
mov dx, bx
|
||||
les bx, [bx+37AAh]
|
||||
mov es:[bx], cx
|
||||
mov bx, dx
|
||||
add word ptr [bx+37AAh], 2
|
||||
or cx, cx
|
||||
jz short loc_2F40
|
||||
inc di
|
||||
cmp di, 100h
|
||||
jnz short loc_2F70
|
||||
|
||||
loc_2F40:
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
les bx, [bx+37AAh]
|
||||
xor di, di
|
||||
mov es:[bx], di
|
||||
inc glb.snum
|
||||
cmp glb.snum, 10h
|
||||
jz short loc_2F77
|
||||
mov bx, glb.snum
|
||||
shl bx, 3
|
||||
mov word ptr [bx+37AAh], 0
|
||||
mov cx, [bx+37B0h]
|
||||
mov [bx+37ACh], cx
|
||||
|
||||
loc_2F70:
|
||||
cmp al, 0FFh
|
||||
jz short loc_2F77
|
||||
jmp loc_2ED3
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
loc_2F77:
|
||||
; sub_2E52+107j ...
|
||||
mov ax, glb.snum
|
||||
cmp [bp+var_4], ax
|
||||
mov ax, 0FFF5h
|
||||
jz short loc_2F84
|
||||
xor ax, ax
|
||||
|
||||
loc_2F84:
|
||||
push [bp+var_2]
|
||||
nop
|
||||
call smem_release
|
||||
pop si
|
||||
pop di
|
||||
leave
|
||||
retf 4
|
||||
sub_2E52 endp
|
||||
|
||||
include libs/master.lib/bgm_read_sdata.asm
|
||||
|
||||
; =============== S U B R O U T I N E =======================================
|
||||
|
||||
|
@ -22634,7 +22455,7 @@ arg_2 = dword ptr 8
|
|||
call sub_338E
|
||||
push ds
|
||||
push offset unk_1281E
|
||||
call sub_2E52
|
||||
call bgm_read_sdata
|
||||
jmp short loc_DC70
|
||||
; ---------------------------------------------------------------------------
|
||||
|
||||
|
|
Loading…
Reference in New Issue