[Reduction] #173: bgm_set_tempo

This commit is contained in:
nmlgc 2014-08-25 22:57:49 +02:00
parent 509d3b31b9
commit 69daab38b2
7 changed files with 84 additions and 204 deletions

View File

@ -0,0 +1,66 @@
; master library - BGM
;
; Description:
; テンポを変更する
;
; Function/Procedures:
; int bgm_set_tempo(int tempo);
;
; Parameters:
; tempo 設定するテンポ
;
; Returns:
; BGM_COMPLETE 正常終了
; BGM_EXTENT_ERR テンポの値が異常
;
; 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_s_temp.asm / master.lib 0.22 <- bgmlibs.lib 1.12
func BGM_SET_TEMPO
mov BX,SP
tempo = (RETSIZE+0)*2
mov CX,SS:[BX+tempo]
cmp CX,TEMPOMIN
jl short @@ILLEGAL
cmp CX,TEMPOMAX
jg short @@ILLEGAL
CLI
mov glb.tp,CX
mov AX,word ptr glb.clockbase
mov DX,word ptr glb.clockbase+2
div CX
mov glb.tval,AX
STI
xor AX,AX ; BGM_COMPLETE
ret 2
@@ILLEGAL:
mov AX,BGM_EXTENT_ERR
ret 2
endfunc

View File

@ -6090,9 +6090,7 @@ loc_3818:
loc_3826:
call sub_3726
push cx
nop
push cs
call near ptr sub_3D86
nopcall bgm_set_tempo
jmp short loc_3807
; ---------------------------------------------------------------------------
nop
@ -6901,34 +6899,7 @@ loc_3D82:
retf
sub_3D6C endp
; =============== S U B R O U T I N E =======================================
sub_3D86 proc far
; sub_3DB4+12Dp
mov bx, sp
mov cx, ss:[bx+4]
cmp cx, 1Eh
jl short loc_3DAE
cmp cx, 0F0h ; 'ð'
jg short loc_3DAE
cli
mov glb.tp, cx
mov ax, word ptr glb.clockbase
mov dx, word ptr glb.clockbase+2
div cx
mov glb.tval, ax
sti
xor ax, ax
retf 2
; ---------------------------------------------------------------------------
loc_3DAE:
mov ax, 0FFF3h
retf 2
sub_3D86 endp
include libs/master.lib/bgm_set_tempo.asm
; =============== S U B R O U T I N E =======================================
@ -7058,9 +7029,7 @@ loc_3ECE:
mov word ptr glb.clockbase+2, dx
mov word ptr glb.clockbase, ax
push 78h ; 'x'
nop
push cs
call near ptr sub_3D86
nopcall bgm_set_tempo
mov bx, 3664h
xor dx, dx
xor ax, ax

View File

@ -3147,9 +3147,7 @@ loc_2E34:
loc_2E42:
call sub_2D42
push cx
nop
push cs
call near ptr sub_33A2
nopcall bgm_set_tempo
jmp short loc_2E23
; ---------------------------------------------------------------------------
nop
@ -3958,34 +3956,7 @@ loc_339E:
retf
sub_3388 endp
; =============== S U B R O U T I N E =======================================
sub_33A2 proc far
; sub_33D0+12Dp
mov bx, sp
mov cx, ss:[bx+4]
cmp cx, 1Eh
jl short loc_33CA
cmp cx, 0F0h ; 'ð'
jg short loc_33CA
cli
mov glb.tp, cx
mov ax, word ptr glb.clockbase
mov dx, word ptr glb.clockbase+2
div cx
mov glb.tval, ax
sti
xor ax, ax
retf 2
; ---------------------------------------------------------------------------
loc_33CA:
mov ax, 0FFF3h
retf 2
sub_33A2 endp
include libs/master.lib/bgm_set_tempo.asm
; =============== S U B R O U T I N E =======================================
@ -4115,9 +4086,7 @@ loc_34EA:
mov word ptr glb.clockbase+2, dx
mov word ptr glb.clockbase, ax
push 78h ; 'x'
nop
push cs
call near ptr sub_33A2
nopcall bgm_set_tempo
mov bx, 1A74h
xor dx, dx
xor ax, ax

View File

@ -3893,9 +3893,7 @@ loc_35D2:
loc_35E0:
call sub_34E0
push cx
nop
push cs
call near ptr sub_3B40
nopcall bgm_set_tempo
jmp short loc_35C1
; ---------------------------------------------------------------------------
nop
@ -4704,34 +4702,7 @@ loc_3B3C:
retf
sub_3B26 endp
; =============== S U B R O U T I N E =======================================
sub_3B40 proc far
; sub_3B6E+12Dp
mov bx, sp
mov cx, ss:[bx+4]
cmp cx, 1Eh
jl short loc_3B68
cmp cx, 0F0h ; 'ð'
jg short loc_3B68
cli
mov glb.tp, cx
mov ax, word ptr glb.clockbase
mov dx, word ptr glb.clockbase+2
div cx
mov glb.tval, ax
sti
xor ax, ax
retf 2
; ---------------------------------------------------------------------------
loc_3B68:
mov ax, 0FFF3h
retf 2
sub_3B40 endp
include libs/master.lib/bgm_set_tempo.asm
; =============== S U B R O U T I N E =======================================
@ -4861,9 +4832,7 @@ loc_3C88:
mov word ptr glb.clockbase+2, dx
mov word ptr glb.clockbase, ax
push 78h ; 'x'
nop
push cs
call near ptr sub_3B40
nopcall bgm_set_tempo
mov bx, 2642h
xor dx, dx
xor ax, ax

View File

@ -5999,9 +5999,7 @@ loc_37B2:
loc_37C0:
call sub_36C0
push cx
nop
push cs
call near ptr sub_3D20
nopcall bgm_set_tempo
jmp short loc_37A1
; ---------------------------------------------------------------------------
nop
@ -6810,34 +6808,7 @@ loc_3D1C:
retf
sub_3D06 endp
; =============== S U B R O U T I N E =======================================
sub_3D20 proc far
; sub_3D4E+12Dp
mov bx, sp
mov cx, ss:[bx+4]
cmp cx, 1Eh
jl short loc_3D48
cmp cx, 0F0h ; 'ð'
jg short loc_3D48
cli
mov glb.tp, cx
mov ax, word ptr glb.clockbase
mov dx, word ptr glb.clockbase+2
div cx
mov glb.tval, ax
sti
xor ax, ax
retf 2
; ---------------------------------------------------------------------------
loc_3D48:
mov ax, 0FFF3h
retf 2
sub_3D20 endp
include libs/master.lib/bgm_set_tempo.asm
; =============== S U B R O U T I N E =======================================
@ -6968,9 +6939,7 @@ loc_3E68:
mov word ptr glb.clockbase+2, dx
mov word ptr glb.clockbase, ax
push 78h ; 'x'
nop
push cs
call near ptr sub_3D20
nopcall bgm_set_tempo
mov bx, 2FAAh
xor dx, dx
xor ax, ax

View File

@ -3593,9 +3593,7 @@ loc_2FBA:
loc_2FC8:
call sub_2EC8
push cx
nop
push cs
call near ptr sub_3528
nopcall bgm_set_tempo
jmp short loc_2FA9
; ---------------------------------------------------------------------------
nop
@ -4404,34 +4402,7 @@ loc_3524:
retf
sub_350E endp
; =============== S U B R O U T I N E =======================================
sub_3528 proc far
; sub_3556+12Dp
mov bx, sp
mov cx, ss:[bx+4]
cmp cx, 1Eh
jl short loc_3550
cmp cx, 0F0h ; '<27>E
jg short loc_3550
cli
mov glb.tp, cx
mov ax, word ptr glb.clockbase
mov dx, word ptr glb.clockbase+2
div cx
mov glb.tval, ax
sti
xor ax, ax
retf 2
; ---------------------------------------------------------------------------
loc_3550:
mov ax, 0FFF3h
retf 2
sub_3528 endp
include libs/master.lib/bgm_set_tempo.asm
; =============== S U B R O U T I N E =======================================
@ -4561,9 +4532,7 @@ loc_3670:
mov word ptr glb.clockbase+2, dx
mov word ptr glb.clockbase, ax
push 78h ; 'x'
nop
push cs
call near ptr sub_3528
nopcall bgm_set_tempo
mov bx, 26E8h
xor dx, dx
xor ax, ax

View File

@ -3013,9 +3013,7 @@ loc_2DF2:
loc_2E00:
call sub_2D00
push cx
nop
push cs
call near ptr sub_3360
nopcall bgm_set_tempo
jmp short loc_2DE1
; ---------------------------------------------------------------------------
nop
@ -3824,34 +3822,7 @@ loc_335C:
retf
sub_3346 endp
; =============== S U B R O U T I N E =======================================
sub_3360 proc far
; sub_338E+12Dp
mov bx, sp
mov cx, ss:[bx+4]
cmp cx, 1Eh
jl short loc_3388
cmp cx, 0F0h ; 'ð'
jg short loc_3388
cli
mov glb.tp, cx
mov ax, word ptr glb.clockbase
mov dx, word ptr glb.clockbase+2
div cx
mov glb.tval, ax
sti
xor ax, ax
retf 2
; ---------------------------------------------------------------------------
loc_3388:
mov ax, 0FFF3h
retf 2
sub_3360 endp
include libs/master.lib/bgm_set_tempo.asm
; =============== S U B R O U T I N E =======================================
@ -3981,9 +3952,7 @@ loc_34A8:
mov word ptr glb.clockbase+2, dx
mov word ptr glb.clockbase, ax
push 78h ; 'x'
nop
push cs
call near ptr sub_3360
nopcall bgm_set_tempo
mov bx, 376Ch
xor dx, dx
xor ax, ax