***************************************************** **** Nobunaga's Ambition - Custom Module **** **** all adaptions by Wanted Team **** ***************************************************** incdir "dh2:include/" include 'misc/eagleplayer2.01.i' include 'hardware/intbits.i' include 'exec/exec_lib.i' SECTION Player,Code_C NA_Start PLAYERHEADER PlayerTagArray dc.b "$VER: Nobunaga's Ambition - Custom Module,",10 dc.b 'adapted by Don Adan/Wanted Team',0 even PlayerTagArray dc.l DTP_CustomPlayer,1 dc.l DTP_PlayerName,PlayerName dc.l DTP_Interrupt,Interrupt dc.l DTP_InitPlayer,InitPlayer dc.l DTP_EndPlayer,EndPlayer dc.l DTP_InitSound,InitSound dc.l DTP_EndSound,EndSound dc.l DTP_SubSongRange,SubSongRange dc.l EP_Get_ModuleInfo,Get_ModuleInfo dc.l TAG_DONE PlayerName dc.b "CustomPlay",0 Text dc.b 10 dc.b " KOEI PRESENTS",10 dc.b 10 dc.b " NOBUNAGA'S AMBITION",10 dc.b 10 dc.b " (C) 1988 KOEI CORPORATION",10 dc.b " MADE IN JAPAN",10 dc.b " AMIGA VERSION 1990",0 even Timer dc.w 0 *************************************************************************** ***************************** DTP_SubSongRange **************************** *************************************************************************** SubSongRange moveq #1,D0 moveq #9,D1 rts *************************************************************************** ***************************** EP_Get_ModuleInfo *************************** *************************************************************************** Get_ModuleInfo lea InfoBuffer(PC),A0 rts InfoBuffer dc.l MI_SpecialInfo,Text dc.l MI_LoadSize,NA_End-NA_Start dc.l 0 *************************************************************************** ***************************** DTP_InitPlayer ****************************** *************************************************************************** InitPlayer move.l dtg_AudioAlloc(A5),A0 jsr (A0) bsr.w SetAudioVector moveq #0,D0 rts *************************************************************************** ***************************** DTP_EndPlayer ******************************* *************************************************************************** EndPlayer bsr.w ClearAudioVector move.l dtg_AudioFree(A5),A0 jmp (A0) *************************************************************************** ***************************** DTP_Intterrupt ****************************** *************************************************************************** Interrupt movem.l D1-A6,-(SP) lea lbL024748(PC),A1 ; VBI data lea WT(PC),A4 bsr.w Play movem.l (SP)+,D1-A6 moveq #0,D0 rts DMAWait movem.l D0/D1,-(SP) moveq #8,D0 .dma1 move.b $DFF006,D1 .dma2 cmp.b $DFF006,D1 beq.b .dma2 dbeq D0,.dma1 movem.l (SP)+,D0/D1 rts DMAWait2 movem.l D0/D1,-(SP) moveq #2,D0 .dma1 move.b $DFF006,D1 .dma2 cmp.b $DFF006,D1 beq.b .dma2 dbeq D0,.dma1 movem.l (SP)+,D0/D1 rts SetAudioVector movem.l D0/A1/A6,-(A7) movea.l 4.W,A6 lea KOEI1(PC),A1 moveq #INTB_AUD1,D0 jsr _LVOSetIntVector(A6) move.l D0,Channel1 lea KOEI2(PC),A1 moveq #INTB_AUD2,D0 jsr _LVOSetIntVector(A6) move.l D0,Channel2 lea KOEI3(PC),A1 moveq #INTB_AUD3,D0 jsr _LVOSetIntVector(A6) move.l D0,Channel3 movem.l (A7)+,D0/A1/A6 rts ClearAudioVector movea.l 4.W,A6 movea.l Channel1(PC),A1 moveq #INTB_AUD1,D0 jsr _LVOSetIntVector(A6) movea.l Channel2(PC),A1 moveq #INTB_AUD2,D0 jsr _LVOSetIntVector(A6) movea.l Channel3(PC),A1 moveq #INTB_AUD3,D0 jmp _LVOSetIntVector(A6) Channel1 dc.l 0 Channel2 dc.l 0 Channel3 dc.l 0 KOEI1 dc.l 0 dc.l 0 dc.w $205 dc.l IntName1 dc.l lbL024748 dc.l Audio IntName1 dc.b 'KOEI Aud1 Interrupt',0 even KOEI2 dc.l 0 dc.l 0 dc.w $205 dc.l IntName2 dc.l lbL024748+16 dc.l Audio IntName2 dc.b 'KOEI Aud2 Interrupt',0 even KOEI3 dc.l 0 dc.l 0 dc.w $205 dc.l IntName3 dc.l lbL024748+32 dc.l Audio IntName3 dc.b 'KOEI Aud3 Interrupt',0 even *************************************************************************** ***************************** DTP_InitSound ******************************* *************************************************************************** InitSound move.w Timer(PC),D0 bne.b Done move.w dtg_Timer(A5),D0 mulu.w #5,D0 divu.w #6,D0 ; 60Hz lea Timer(PC),A0 move.w D0,(A0) Done move.w D0,dtg_Timer(A5) lea WT(PC),A4 bsr.w _SetUp moveq #0,D7 move.w dtg_SndNum(A5),D7 moveq #2,D6 ; fade value moveq #1,D5 ; repeat on cmp.w #3,D7 ble.b Repeta moveq #0,D5 ; repeat off Repeta bra.w _Play *************************************************************************** ***************************** DTP_EndSound ******************************** *************************************************************************** EndSound lea $DFF000,A0 move.w #15,$96(A0) moveq #0,D0 move.w D0,$A8(A0) move.w D0,$B8(A0) move.w D0,$C8(A0) move.w D0,$D8(A0) rts *************************************************************************** *************************************************************************** *************************************************************************** ; Music from "Nobunaga's Ambition" (c) 1988-90 by KOEI _CXD33 TST.L D0 BPL.L lbC01D83E NEG.L D0 TST.L D1 BPL.L __CXD221 NEG.L D1 BSR.L _CXD22 NEG.L D1 RTS __CXD221 BSR.L _CXD22 NEG.L D0 NEG.L D1 RTS lbC01D83E TST.L D1 BPL.L _CXD22 NEG.L D1 BSR.L _CXD22 NEG.L D0 RTS _CXD22 MOVE.L D2,-(SP) SWAP D1 MOVE.W D1,D2 BNE.L lbC01D878 SWAP D0 SWAP D1 SWAP D2 MOVE.W D0,D2 BEQ.L lbC01D868 DIVU.W D1,D2 MOVE.W D2,D0 lbC01D868 SWAP D0 MOVE.W D0,D2 DIVU.W D1,D2 MOVE.W D2,D0 SWAP D2 MOVE.W D2,D1 MOVE.L (SP)+,D2 RTS lbC01D878 MOVE.L D3,-(SP) MOVEQ #$10,D3 CMPI.W #$80,D1 BCC.L lbC01D888 ROL.L #8,D1 SUBQ.W #8,D3 lbC01D888 CMPI.W #$800,D1 BCC.L lbC01D894 ROL.L #4,D1 SUBQ.W #4,D3 lbC01D894 CMPI.W #$2000,D1 BCC.L lbC01D8A0 ROL.L #2,D1 SUBQ.W #2,D3 lbC01D8A0 TST.W D1 BMI.L lbC01D8AA ROL.L #1,D1 SUBQ.W #1,D3 lbC01D8AA MOVE.W D0,D2 LSR.L D3,D0 SWAP D2 CLR.W D2 LSR.L D3,D2 SWAP D3 DIVU.W D1,D0 MOVE.W D0,D3 MOVE.W D2,D0 MOVE.W D3,D2 SWAP D1 MULU.W D1,D2 SUB.L D2,D0 BCC.L lbC01D8CE SUBQ.W #1,D3 ADD.L D1,D0 lbC01D8CC BCC.S lbC01D8CC lbC01D8CE MOVEQ #0,D1 MOVE.W D3,D1 SWAP D3 ROL.L D3,D0 SWAP D0 EXG D0,D1 MOVE.L (SP)+,D3 MOVE.L (SP)+,D2 RTS __CXM33 MOVEM.L D2/D3,-(SP) MOVE.L D0,D2 MOVE.L D1,D3 SWAP D2 SWAP D3 MULU.W D1,D2 MULU.W D0,D3 MULU.W D1,D0 ADD.W D3,D2 SWAP D2 CLR.W D2 ADD.L D2,D0 MOVEM.L (SP)+,D2/D3 RTS _Play ; CMPA.L __base-WT(A4),SP ; BCS.L ___xcovf ; MOVEM.L D6/D7,-(SP) ; MOVE.L 12(SP),D7 ; MOVE.L $10(SP),D6 MOVE.L D7,D0 MOVEQ #$12,D1 JSR ___CXM33(PC) LEA lbL02468A,A0 ADDA.L D0,A0 MOVE.L D6,-(SP) MOVE.L A0,-(SP) JSR __bgm_start(PC) ; CLR.L (SP) move.l D5,(SP) JSR __bgm_repeat(PC) ADDQ.W #8,SP ; MOVEM.L (SP)+,D6/D7 RTS ;_PlayWithRepeat CMPA.L __base-WT(A4),SP ; BCS.L ___xcovf ; MOVEM.L D6/D7,-(SP) ; MOVE.L 12(SP),D7 ; MOVE.L $10(SP),D6 ; MOVE.L D7,D0 ; MOVEQ #$12,D1 ; JSR ___CXM33(PC) ; LEA lbL02468A,A0 ; ADDA.L D0,A0 ; MOVE.L D6,-(SP) ; MOVE.L A0,-(SP) ; JSR __bgm_start(PC) ; PEA 1 ; JSR __bgm_repeat(PC) ; LEA 12(SP),SP ; MOVEM.L (SP)+,D6/D7 ; RTS ;_PlayStop CMPA.L __base-WT(A4),SP ; BCS.L ___xcovf ; MOVEM.L D6/D7,-(SP) ; MOVE.W 14(SP),D7 ; MOVE.B $13(SP),D6 ; MOVEQ #0,D0 ; MOVE.W D7,D0 ; MOVEQ #0,D1 ; MOVE.B D6,D1 ; MOVE.L D1,-(SP) ; MOVE.L D0,-(SP) ; JSR __bgm_stop(PC) ; ADDQ.W #8,SP ; MOVEM.L (SP)+,D6/D7 ; RTS ;_PlayVolume CMPA.L __base-WT(A4),SP ; BCS.L ___xcovf ; MOVE.L D7,-(SP) ; MOVE.W 10(SP),D7 ; MOVEQ #0,D0 ; MOVE.W D7,D0 ; MOVE.L D0,-(SP) ; JSR __bgm_volume(PC) ; ADDQ.W #4,SP ; MOVE.L (SP)+,D7 ; RTS ;_PlayOnOff CMPA.L __base-WT(A4),SP ; BCS.L ___xcovf ; JSR __bgm_check(PC) ; RTS ;_check_music CMPA.L __base-WT(A4),SP ; BCS.L ___xcovf ; MOVEQ #1,D0 ; CMP.L _replay-WT(A4),D0 ; BNE.S lbC003B18 ; MOVEQ #1,D0 ; BRA.S lbC003B1A ;lbC003B18 MOVEQ #0,D0 ;lbC003B1A RTS ;_PlayWithFadeIn CMPA.L __base-WT(A4),SP ; BCS.L ___xcovf ; MOVE.L D7,-(SP) ; MOVE.L 8(SP),D7 ; PEA $14 ; MOVE.L D7,-(SP) ; BSR.L _PlayWithRepeat ; ADDQ.W #8,SP ; MOVE.L (SP)+,D7 ; RTS ;_QuitWithFadeOut CMPA.L __base-WT(A4),SP ; BCS.L ___xcovf ; MOVE.L D7,-(SP) ; MOVE.L 8(SP),D7 ; MOVE.L D7,D0 ; MOVEQ #0,D1 ; MOVE.W D0,D1 ; PEA 1 ; MOVE.L D1,-(SP) ; BSR.L _PlayStop ; ADDQ.W #8,SP ; MOVE.L (SP)+,D7 ; RTS ;_QuitWithoutFade CMPA.L __base-WT(A4),SP ; BCS.L ___xcovf ; CLR.L -(SP) ; PEA 1 ; BSR.L _PlayStop ; ADDQ.W #8,SP ; RTS ;_out445 LINK.W A5,#0 ; CMPA.L __base-WT(A4),SP ; BCS.L ___xcovf ; UNLK A5 ; RTS ;__bgm_volume JMP _bgm_volume __bgm_start JMP _bgm_start ;__bgm_check JMP _bgm_check __bgm_repeat JMP _bgm_repeat ;__bgm_stop JMP _bgm_stop ; MOVEQ #$61,D0 ;lbC01BF68 LINK.W A5,#-12 ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVEM.L D2/D7/A6,-(SP) ; TST.L lbL02DA1C-WT(A4) ; BEQ.S lbC01BF90 ; MOVEA.L lbL02DA1C-WT(A4),A1 ; MOVEQ #$16,D0 ; MOVEA.L 4,A6 ; JSR -$D2(A6) ; CLR.L lbL02DA1C-WT(A4) ;lbC01BF90 MOVEQ #0,D7 ;lbC01BF92 MOVEQ #3,D0 ; CMP.L D0,D7 ; BGE.S lbC01BFF2 ; MOVE.L D7,D0 ; ASL.L #2,D0 ; LEA lbL02DA20-WT(A4),A0 ; TST.L 0(A0,D0.L) ; BEQ.S lbC01BFEE ; MOVE.L D7,D1 ; ADD.L D1,D1 ; LEA lbW0247CC,A0 ; ADDA.L D1,A0 ; MOVEQ #0,D1 ; MOVE.W (A0),D1 ; MOVE.L D0,$14(SP) ; MOVE.L D1,D0 ; LEA lbL02DA2C-WT(A4),A1 ; MOVE.L $14(SP),D2 ; MOVEA.L 0(A1,D2.L),A1 ; MOVEA.L 4,A6 ; JSR -$A2(A6) ; MOVE.L D7,D0 ; ASL.L #2,D0 ; LEA lbL02DA20-WT(A4),A1 ; MOVEA.L 0(A1,D0.L),A1 ; MOVEQ #$16,D0 ; JSR -$D2(A6) ; MOVE.L D7,D0 ; ASL.L #2,D0 ; LEA lbL02DA20-WT(A4),A0 ; CLR.L 0(A0,D0.L) ;lbC01BFEE ADDQ.L #1,D7 ; BRA.S lbC01BF92 ;lbC01BFF2 TST.L lbL02DA50-WT(A4) ; BEQ.S lbC01C006 ; MOVE.L lbL02DA50-WT(A4),-(SP) ; JSR _DeletePort(PC) ; ADDQ.W #4,SP ; CLR.L lbL02DA50-WT(A4) ;lbC01C006 TST.L lbL02DA4C-WT(A4) ; BEQ.S lbC01C01C ; MOVEA.L lbL02DA44-WT(A4),A1 ; MOVEA.L 4,A6 ; JSR -$1C2(A6) ; CLR.L lbL02DA4C-WT(A4) ;lbC01C01C TST.L lbL02DA48-WT(A4) ; BEQ.S lbC01C034 ; MOVEA.L lbL02DA48-WT(A4),A1 ; MOVEQ #$44,D0 ; MOVEA.L 4,A6 ; JSR -$D2(A6) ; CLR.L lbL02DA48-WT(A4) ;lbC01C034 TST.L lbL02DA44-WT(A4) ; BEQ.S lbC01C04C ; MOVEA.L lbL02DA44-WT(A4),A1 ; MOVEQ #$44,D0 ; MOVEA.L 4,A6 ; JSR -$D2(A6) ; CLR.L lbL02DA44-WT(A4) ;lbC01C04C MOVEM.L (SP)+,D2/D7/A6 ; UNLK A5 ; RTS ;lbC01C054 LINK.W A5,#-4 ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVEM.L D7/A3/A6,-(SP) ; MOVEQ #$44,D0 ; MOVE.L #$10001,D1 ; MOVEA.L 4,A6 ; JSR -$C6(A6) ; MOVE.L D0,lbL02DA44-WT(A4) ; TST.L D0 ; BNE.S lbC01C086 ; BSR.L lbC01BF68 ; MOVEQ #-1,D0 ; BRA.L lbC01C258 ;lbC01C086 MOVEQ #$44,D0 ; MOVE.L #$10001,D1 ; MOVEA.L 4,A6 ; JSR -$C6(A6) ; MOVE.L D0,lbL02DA48-WT(A4) ; TST.L D0 ; BNE.S lbC01C0A8 ; BSR.L lbC01BF68 ; MOVEQ #-1,D0 ; BRA.L lbC01C258 ;lbC01C0A8 LEA audiodevice.MSG-WT(A4),A0 ; MOVEQ #0,D0 ; MOVEA.L lbL02DA44-WT(A4),A1 ; MOVE.L D0,D1 ; MOVEA.L 4,A6 ; JSR -$1BC(A6) ; TST.L D0 ; BEQ.S lbC01C0CA ; BSR.L lbC01BF68 ; MOVEQ #-2,D0 ; BRA.L lbC01C258 ;lbC01C0CA MOVEA.L lbL02DA44-WT(A4),A0 ; MOVE.L $14(A0),lbL02DA4C-WT(A4) ; MOVE.B #$7F,9(A0) ; CLR.L -(SP) ; PEA KOEIsound.MSG-WT(A4) ; JSR _CreatePort(PC) ; ADDQ.W #8,SP ; MOVE.L D0,lbL02DA50-WT(A4) ; BNE.S lbC01C0F6 ; BSR.L lbC01BF68 ; MOVEQ #-3,D0 ; BRA.L lbC01C258 ;lbC01C0F6 MOVEA.L lbL02DA44-WT(A4),A0 ; MOVE.L lbL02DA50-WT(A4),14(A0) ; MOVE.W #$20,$1C(A0) ; MOVE.B #$40,$1E(A0) ; MOVE.L #lbW0247D2,$22(A0) ; MOVEQ #1,D0 ; MOVE.L D0,$26(A0) ; MOVE.L A0,-(SP) ; JSR _BeginIO(PC) ; ADDQ.W #4,SP ; MOVEA.L lbL02DA44-WT(A4),A1 ; MOVEA.L 4,A6 ; JSR -$1DA(A6) ; TST.L D0 ; BEQ.S lbC01C13C ; BSR.L lbC01BF68 ; MOVEQ #-3,D0 ; BRA.L lbC01C258 ;lbC01C13C MOVEA.L lbL02DA48-WT(A4),A0 ; MOVE.L lbL02DA50-WT(A4),14(A0) ; MOVE.L lbL02DA4C-WT(A4),$14(A0) ; MOVEA.L lbL02DA44-WT(A4),A1 ; MOVE.L $18(A1),$18(A0) ; MOVE.W #13,$1C(A0) ; MOVE.W $20(A1),$20(A0) ; MOVEA.L A0,A1 ; MOVEA.L 4,A6 ; JSR -$1CE(A6) ; MOVEA.L lbL02DA48-WT(A4),A1 ; JSR -$1D4(A6) ; TST.L D0 ; BEQ.S lbC01C182 ; BSR.L lbC01BF68 ; MOVEQ #-4,D0 ; BRA.L lbC01C258 ;lbC01C182 MOVEQ #0,D7 ;lbC01C184 MOVEQ #3,D0 ; CMP.L D0,D7 ; BGE.L lbC01C210 ; MOVEQ #$16,D0 ; MOVEQ #1,D1 ; MOVEA.L 4,A6 ; JSR -$C6(A6) ; MOVEA.L D0,A3 ; MOVE.L A3,D0 ; BNE.S lbC01C1A8 ; BSR.L lbC01BF68 ; MOVEQ #-1,D0 ; BRA.L lbC01C258 ;lbC01C1A8 MOVE.L D7,D0 ; ASL.L #2,D0 ; LEA lbL02DA20-WT(A4),A0 ; MOVE.L A3,0(A0,D0.L) ; MOVE.B #2,8(A3) ; CLR.B 9(A3) ; LEA KOEIAUD.MSG-WT(A4),A0 ; MOVE.L A0,10(A3) ; MOVE.L D7,D1 ; ASL.L #4,D1 ; LEA lbL024748,A0 ; ADDA.L D1,A0 ; MOVE.L A0,14(A3) ; MOVE.L #_AUDHandler,$12(A3) ; MOVE.L D7,D1 ; ADD.L D1,D1 ; LEA lbW0247CC,A0 ; ADDA.L D1,A0 ; MOVEQ #0,D1 ; MOVE.W (A0),D1 ; MOVE.L D0,12(SP) ; MOVE.L D1,D0 ; MOVEA.L A3,A1 ; MOVEA.L 4,A6 ; JSR -$A2(A6) ; LEA lbL02DA2C-WT(A4),A0 ; MOVE.L 12(SP),D1 ; MOVE.L D0,0(A0,D1.L) ; ADDQ.L #1,D7 ; BRA.L lbC01C184 ;lbC01C210 MOVEQ #$16,D0 ; MOVE.L #$10001,D1 ; MOVEA.L 4,A6 ; JSR -$C6(A6) ; MOVE.L D0,lbL02DA1C-WT(A4) ; BNE.S lbC01C22E ; BSR.L lbC01BF68 ; MOVEQ #-1,D0 ; BRA.S lbC01C258 ;lbC01C22E MOVEA.L lbL02DA1C-WT(A4),A0 ; instal VBI ; MOVE.B #2,8(A0) ; MOVE.B #$F0,9(A0) ; LEA KOEIsound.MSG0-WT(A4),A1 ; MOVE.L A1,10(A0) ; MOVE.L #lbL024748,14(A0) ; MOVE.L #_VertBServer,$12(A0) ; MOVEQ #0,D0 ;lbC01C258 MOVEM.L (SP)+,D7/A3/A6 ; UNLK A5 ; RTS Audio ;_AUDEntry CMPA.L __base,SP ; BCS.L __xcovf MOVEM.L A2-A4,-(SP) ; LEA lbW02CB5C,A4 MOVEA.L A1,A3 TST.L 8(A3) BEQ.S lbC01C29C TST.W 12(A3) BEQ.S lbC01C290 MOVEA.L (A3),A2 MOVE.L 8(A3),(A2) MOVE.W 12(A3),4(A2) BRA.S lbC01C296 lbC01C290 MOVEQ #1,D0 MOVE.W D0,14(A3) lbC01C296 CLR.L 8(A3) BRA.S lbC01C2B0 lbC01C29C TST.W 14(A3) BEQ.S lbC01C2B0 SUBQ.W #1,14(A3) BNE.S lbC01C2B0 MOVE.W 6(A3),$DFF096 lbC01C2B0 MOVE.W 4(A3),$DFF09C bsr.w DMAWait2 MOVEM.L (SP)+,A2-A4 RTS lbC01C2BE ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf MOVEM.L D6/D7/A3/A6,-(SP) MOVE.W $16(SP),D7 MOVEQ #3,D0 CMP.W D0,D7 BCC.S lbC01C32C ; MOVEA.L 4,A6 ; JSR -$78(A6) MOVEQ #0,D0 MOVE.W D7,D0 ASL.L #4,D0 LEA lbL024748,A0 ADDA.L D0,A0 MOVEA.L (A0),A3 MOVEQ #0,D0 MOVE.W D7,D0 ADD.L D0,D0 LEA lbL0247BA,A0 ADDA.L D0,A0 MOVE.W (A0),D0 MOVE.W lbW0247C4,D1 MULU.W D1,D0 MOVE.L D7,D1 MULU.W #$16,D1 LEA lbL024778,A0 ADDA.L D1,A0 MOVEQ #0,D1 MOVE.W $14(A0),D1 JSR __CXM33(PC) MOVE.L D0,D6 MOVE.L D6,D0 LSR.L #8,D0 LSR.L #4,D0 MOVE.W D0,8(A3) ; JSR -$7E(A6) lbC01C32C MOVEM.L (SP)+,D6/D7/A3/A6 RTS lbC01C332 ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf MOVEM.L D7/A3/A6,-(SP) MOVE.W $12(SP),D7 MOVEQ #3,D0 CMP.W D0,D7 BCC.S lbC01C380 ; MOVEA.L 4,A6 ; JSR -$78(A6) MOVEQ #0,D0 MOVE.W D7,D0 ASL.L #4,D0 LEA lbL024748,A0 ADDA.L D0,A0 MOVEA.L A0,A3 MOVE.W 6(A3),$DFF096 MOVE.W 4(A3),$DFF09A MOVEA.L (A3),A0 MOVE.W #1,6(A0) CLR.L 8(A3) ; JSR -$7E(A6) lbC01C380 MOVEM.L (SP)+,D7/A3/A6 RTS lbC01C386 LINK.W A5,#-$20 ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf MOVEM.L D2/D5-D7/A2/A3/A6,-(SP) MOVE.W 10(A5),D7 MOVE.W 14(A5),D6 MOVE.W $12(A5),D5 MOVEQ #3,D0 CMP.W D0,D7 BCC.L lbC01C4EC MOVEQ #0,D0 MOVE.W D7,D0 MOVE.L D0,-(SP) BSR.S lbC01C332 MOVEQ #0,D0 MOVE.W D7,D0 MOVE.L D0,(SP) BSR.L lbC01C2BE ADDQ.W #4,SP MOVEQ #0,D0 MOVE.W D7,D0 ASL.L #4,D0 LEA lbL024748,A0 ADDA.L D0,A0 MOVEA.L A0,A3 MOVEQ #0,D0 MOVE.W D7,D0 ASL.L #2,D0 LEA lbL02DA38-WT(A4),A0 MOVEA.L 0(A0,D0.L),A2 MOVE.L D6,D0 ANDI.L #$FFFF,D0 DIVU.W #12,D0 MOVE.W D0,-2(A5) MOVEQ #8,D1 CMP.W D1,D0 BCC.L lbC01C4EC MOVE.L A2,D1 BEQ.L lbC01C4EC MOVEQ #0,D1 MOVE.W D0,D1 ASL.L #2,D1 MOVEA.L 0(A2,D1.L),A0 MOVEQ #0,D1 MOVE.W D0,D1 ADD.L D1,D1 MOVE.W $20(A2,D1.L),D0 MOVEM.W D0,-6(A5) MOVEM.L A0,-10(A5) MOVE.L A0,D1 BEQ.L lbC01C4EC TST.W D0 BEQ.L lbC01C4EC MOVEQ #0,D0 MOVE.W 4(A3),D0 ORI.W #$8000,D0 MOVE.W D0,$DFF09A ; MOVEA.L 4,A6 ; JSR -$78(A6) MOVE.L (A3),-$1A(A5) MOVEA.L -$1A(A5),A0 MOVE.L -10(A5),(A0) MOVE.W -6(A5),4(A0) MOVEQ #0,D0 MOVE.W D6,D0 MOVEQ #12,D1 JSR _CXD33(PC) ADD.L D1,D1 LEA lbW0247D4,A1 ADDA.L D1,A1 MOVE.W (A1),D0 MOVE.W D0,6(A0) MOVEQ #0,D1 MOVE.W -2(A5),D1 ASL.L #2,D1 MOVE.L $30(A2,D1.L),8(A3) MOVEQ #0,D1 MOVE.W -2(A5),D1 ADD.L D1,D1 MOVE.W $50(A2,D1.L),D2 MOVE.W D2,12(A3) MOVE.W D0,-4(A5) MOVEM.W D2,-6(A5) TST.W D2 BEQ.S lbC01C4D4 MOVEQ #0,D1 MOVE.W D2,D1 ADD.L D1,D1 MOVEQ #0,D2 MOVE.W D0,D2 MOVE.L D2,D0 JSR __CXM33(PC) MOVE.L D0,$1C(SP) MOVE.L #$369E99,D0 MOVE.L $1C(SP),D1 JSR _CXD33(PC) MOVEQ #0,D1 MOVE.W D5,D1 MOVE.L D0,-14(A5) JSR __CXM33(PC) MOVE.L #$3E8,D1 JSR _CXD33(PC) MOVE.W D0,14(A3) BRA.S lbC01C4D8 lbC01C4D4 CLR.W 14(A3) lbC01C4D8 MOVEQ #0,D0 MOVE.W 6(A3),D0 ORI.W #$8200,D0 bsr.w DMAWait MOVE.W D0,$DFF096 ; JSR -$7E(A6) lbC01C4EC MOVEM.L (SP)+,D2/D5-D7/A2/A3/A6 UNLK A5 RTS lbC01C4F4 ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf MOVEM.L D7/A3,-(SP) MOVE.W 14(SP),D7 MOVEA.L $10(SP),A3 MOVEQ #3,D0 CMP.W D0,D7 BCC.S lbC01C528 MOVEQ #0,D0 MOVE.W D7,D0 MOVE.L D0,-(SP) BSR.L lbC01C332 ADDQ.W #4,SP MOVEQ #0,D0 MOVE.W D7,D0 ASL.L #2,D0 LEA lbL02DA38-WT(A4),A0 MOVE.L A3,0(A0,D0.L) lbC01C528 MOVEM.L (SP)+,D7/A3 RTS lbC01C52E ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf MOVEM.L D5-D7/A3,-(SP) MOVEA.L $14(SP),A3 MOVE.W $82(A3),D7 BTST #0,D7 BEQ.S lbC01C5B6 BTST #4,D7 BEQ.S lbC01C5B6 MOVE.W $7A(A3),D0 MOVE.W $78(A3),D1 CMP.W D0,D1 BLS.S lbC01C59A ADDQ.W #1,$7A(A3) MOVEQ #0,D0 MOVE.W $7A(A3),D0 ASL.L #6,D0 MOVEQ #0,D1 MOVE.W $78(A3),D1 JSR _CXD33(PC) MOVE.L D0,D6 BTST #5,D7 BNE.S lbC01C57E MOVEQ #$40,D0 SUB.W D6,D0 MOVE.L D0,D6 lbC01C57E MOVE.W D6,$7C(A3) MOVEQ #0,D5 lbC01C584 MOVEQ #3,D0 CMP.W D0,D5 BCC.S lbC01C59A MOVEQ #0,D0 MOVE.W D5,D0 MOVE.L D0,-(SP) BSR.L lbC01C2BE ADDQ.W #4,SP ADDQ.W #1,D5 BRA.S lbC01C584 lbC01C59A MOVE.W $78(A3),D0 CMP.W $7A(A3),D0 BHI.S lbC01C5B6 MOVEQ #-$31,D0 AND.W D0,$82(A3) BTST #5,D7 BNE.S lbC01C5B6 BCLR #0,$83(A3) lbC01C5B6 MOVEM.L (SP)+,D5-D7/A3 RTS lbC01C5BC ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf MOVEM.L D7/A2/A3,-(SP) MOVEA.L $10(SP),A3 MOVEA.L $14(SP),A2 MOVE.W $1A(SP),D7 TST.W D7 BNE.S lbC01C5EC TST.L 8(A3) BNE.S lbC01C614 MOVEA.L A2,A0 MOVE.L A0,8(A3) MOVEQ #0,D0 MOVE.W D0,$10(A3) BRA.S lbC01C614 lbC01C5EC TST.L 8(A3) BEQ.S lbC01C614 TST.W $10(A3) BNE.S lbC01C604 MOVE.L A2,12(A3) MOVE.L D7,D0 ADDQ.W #1,D0 MOVE.W D0,$10(A3) lbC01C604 SUBQ.W #1,$10(A3) BEQ.S lbC01C610 MOVEA.L 8(A3),A2 BRA.S lbC01C614 lbC01C610 CLR.L 8(A3) lbC01C614 MOVE.L A2,D0 MOVEM.L (SP)+,D7/A2/A3 RTS Play _VertBEntry LINK.W A5,#-$14 ; Play 60 Hz!!! ; CMPA.L __base,SP ; set A1 !!! ; BCS.L __xcovf MOVEM.L D4-D7/A2-A4,-(SP) ; LEA lbW02CB5C,A4 MOVEA.L A1,A3 BTST #0,$83(A3) BEQ.L lbC01C7E6 MOVE.L A3,-(SP) BSR.L lbC01C52E ADDQ.W #4,SP BTST #0,$83(A3) BEQ.L lbC01C7E6 SUBQ.W #1,$80(A3) BNE.L lbC01C7E6 MOVE.W $7E(A3),$80(A3) MOVEQ #3,D7 LEA $30(A3),A2 MOVEQ #0,D6 lbC01C668 MOVEQ #3,D0 CMP.W D0,D6 BCC.L lbC01C7DC MOVE.L (A2),-$14(A5) TST.L -$14(A5) BNE.S lbC01C680 SUBQ.L #1,D7 BRA.L lbC01C7D2 lbC01C680 SUBQ.W #1,$12(A2) BNE.L lbC01C7D2 lbC01C688 MOVEQ #0,D5 MOVEA.L -$14(A5),A0 MOVE.B (A0)+,D5 MOVEM.L A0,-$14(A5) MOVEQ #$60,D0 CMP.W D0,D5 BCC.S lbC01C6B6 MOVEQ #0,D0 MOVE.W D6,D0 MOVEQ #0,D1 MOVE.W D5,D1 CLR.L -(SP) MOVE.L D1,-(SP) MOVE.L D0,-(SP) BSR.L lbC01C386 LEA 12(SP),SP MOVE.W #$C1,D5 lbC01C6B6 MOVE.L D5,D0 SUBI.W #$C0,D0 BEQ.S lbC01C6DE SUBQ.W #1,D0 BEQ.S lbC01C6EA SUBI.W #$2F,D0 BEQ.S lbC01C712 SUBI.W #13,D0 BEQ.S lbC01C744 SUBQ.W #1,D0 BEQ.L lbC01C75E SUBQ.W #1,D0 BEQ.L lbC01C766 BRA.L lbC01C788 lbC01C6DE MOVEQ #0,D0 MOVE.W D6,D0 MOVE.L D0,-(SP) BSR.L lbC01C332 ADDQ.W #4,SP lbC01C6EA MOVEQ #0,D0 MOVEA.L -$14(A5),A0 MOVE.B (A0)+,D0 MOVEM.W D0,-12(A5) MOVE.L A0,-$14(A5) TST.W D0 BNE.S lbC01C708 MOVE.W #$100,D1 MOVE.W D1,-12(A5) lbC01C708 MOVE.W -12(A5),$12(A2) BRA.L lbC01C7B8 lbC01C712 MOVEQ #0,D0 MOVEA.L -$14(A5),A0 MOVE.B (A0)+,D0 ADDQ.L #1,D0 TST.L D0 BPL.S lbC01C722 ADDQ.L #1,D0 lbC01C722 ASR.L #1,D0 MOVE.L D0,D4 MOVE.L A0,-$14(A5) MOVEQ #$40,D0 CMP.W D0,D4 BLS.S lbC01C732 MOVE.L D0,D4 lbC01C732 MOVE.W D4,$14(A2) MOVEQ #0,D0 MOVE.W D6,D0 MOVE.L D0,-(SP) BSR.L lbC01C2BE ADDQ.W #4,SP BRA.S lbC01C7B8 lbC01C744 TST.L 8(A2) BEQ.S lbC01C7B8 MOVEQ #1,D0 CMP.W $10(A2),D0 BNE.S lbC01C7B8 MOVE.L 12(A2),-$14(A5) CLR.L 8(A2) BRA.S lbC01C7B8 lbC01C75E MOVE.L -$14(A5),4(A2) BRA.S lbC01C7B8 lbC01C766 MOVEQ #0,D0 MOVE.W D6,D0 MOVE.L D0,-(SP) BSR.L lbC01C332 ADDQ.W #4,SP BTST #1,$83(A3) BEQ.S lbC01C782 MOVE.L 4(A2),-$14(A5) BRA.S lbC01C7B8 lbC01C782 CLR.L -$14(A5) BRA.S lbC01C7B8 lbC01C788 MOVEQ #0,D0 MOVE.W D5,D0 MOVEQ #$78,D1 ADD.L D1,D1 AND.L D1,D0 SUBI.L #$D0,D0 BNE.S lbC01C7B8 MOVE.L D5,D0 ANDI.W #15,D0 MOVEQ #0,D1 MOVE.W D0,D1 MOVE.L D1,-(SP) MOVE.L -$14(A5),-(SP) MOVE.L A2,-(SP) BSR.L lbC01C5BC LEA 12(SP),SP MOVE.L D0,-$14(A5) lbC01C7B8 TST.L -$14(A5) BEQ.S lbC01C7C6 TST.W $12(A2) BEQ.L lbC01C688 lbC01C7C6 MOVEA.L -$14(A5),A0 MOVE.L A0,(A2) MOVE.L A0,D0 BNE.S lbC01C7D2 SUBQ.L #1,D7 lbC01C7D2 ADDA.W #$16,A2 ADDQ.W #1,D6 BRA.L lbC01C668 lbC01C7DC TST.L D7 BNE.S lbC01C7E6 MOVEQ #-$32,D0 AND.W D0,$82(A3) lbC01C7E6 MOVEM.L (SP)+,D4-D7/A2-A4 UNLK A5 RTS lbC01C7EE ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf MOVE.L D7,-(SP) MOVE.W lbW0247CA,D0 BTST #15,D0 BNE.S lbC01C808 MOVEQ #1,D0 BRA.S lbC01C836 lbC01C808 MOVEQ #0,D0 MOVE.W lbW0247CA,D0 ANDI.L #$8002,D0 MOVE.W D0,lbW0247CA MOVEQ #0,D7 lbC01C81E MOVEQ #3,D0 CMP.W D0,D7 BCC.S lbC01C834 MOVEQ #0,D0 MOVE.W D7,D0 MOVE.L D0,-(SP) BSR.L lbC01C332 ADDQ.W #4,SP ADDQ.W #1,D7 BRA.S lbC01C81E lbC01C834 MOVEQ #0,D0 lbC01C836 MOVE.L (SP)+,D7 RTS _BGMmount ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf MOVEM.L D6/D7/A6,-(SP) ; BSR.S lbC01C7EE ; TST.L D0 ; BEQ.S lbC01C868 ; BSR.L lbC01C054 ; MOVE.L D0,D7 ; TST.L D7 ; BEQ.S lbC01C85A ; MOVE.L D7,D0 ; BRA.S lbC01C898 ;lbC01C85A MOVEQ #5,D0 ; MOVEA.L lbL02DA1C-WT(A4),A1 ; MOVEA.L 4,A6 ; JSR -$A8(A6) lbC01C868 MOVEQ #0,D6 lbC01C86A MOVEQ #3,D0 CMP.W D0,D6 BCC.S lbC01C886 MOVEQ #0,D0 MOVE.W D6,D0 ADD.L D0,D0 LEA lbL0247BA,A0 ADDA.L D0,A0 MOVE.W #$40,(A0) ADDQ.W #1,D6 BRA.S lbC01C86A lbC01C886 MOVE.W #1,lbW0247C6 MOVE.W #$8000,lbW0247CA MOVEQ #0,D0 lbC01C898 MOVEM.L (SP)+,D6/D7/A6 RTS ;_BGMremove CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVE.L A6,-(SP) ; BSR.L lbC01C7EE ; TST.L D0 ; BNE.S lbC01C8C2 ; MOVEQ #5,D0 ; MOVEA.L lbL02DA1C-WT(A4),A1 ; MOVEA.L 4,A6 ; JSR -$AE(A6) ; BSR.L lbC01BF68 ;lbC01C8C2 CLR.W lbW0247CA ; MOVEA.L (SP)+,A6 ; RTS _BGMstart ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf MOVEM.L D5-D7/A2/A3,-(SP) MOVEA.L $18(SP),A3 MOVE.W $1E(SP),D7 BSR.L lbC01C7EE MOVE.L D0,D6 TST.L D6 BEQ.S lbC01C8F0 MOVE.L D6,D0 BRA.L lbC01C98E lbC01C8F0 LEA lbL024778,A2 MOVEQ #0,D5 lbC01C8F8 MOVEQ #3,D0 CMP.W D0,D5 BCC.S lbC01C93A MOVE.W #$40,$14(A2) MOVEQ #0,D0 MOVE.W D5,D0 ASL.L #2,D0 MOVEA.L 0(A3,D0.L),A0 MOVE.L A0,4(A2) MOVE.L A0,(A2) CLR.L 8(A2) CLR.W $10(A2) MOVE.W #1,$12(A2) MOVEQ #0,D1 MOVE.W D5,D1 MOVE.L 12(A3,D0.L),-(SP) MOVE.L D1,-(SP) BSR.L lbC01C4F4 ADDQ.W #8,SP ADDA.W #$16,A2 ADDQ.W #1,D5 BRA.S lbC01C8F8 lbC01C93A CMPI.W #$100,D7 BLS.S lbC01C944 MOVE.W #$100,D7 lbC01C944 MOVEQ #0,D0 MOVE.W D7,D0 ASL.L #2,D0 MOVE.W D0,lbW0247C0 BEQ.S lbC01C96C CLR.W lbW0247C2 MOVE.W lbW0247CA,D0 MOVE.L D0,D1 ORI.W #$30,D1 MOVE.W D1,lbW0247CA BRA.S lbC01C974 lbC01C96C MOVE.W #$40,lbW0247C4 lbC01C974 MOVEQ #1,D0 MOVE.W D0,lbW0247C8 MOVE.W lbW0247CA,D1 ORI.W #1,D1 MOVE.W D1,lbW0247CA MOVEQ #0,D0 lbC01C98E MOVEM.L (SP)+,D5-D7/A2/A3 RTS ;_BGMstop CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVEM.L D6/D7,-(SP) ; MOVE.W 14(SP),D7 ; MOVE.W lbW0247CA,D0 ; BTST #15,D0 ; BNE.S lbC01C9B4 ; MOVEQ #1,D0 ; BRA.S lbC01C9F8 ;lbC01C9B4 TST.W D7 ; BEQ.S lbC01C9F4 ; MOVE.W lbW0247CA,D0 ; BTST #0,D0 ; BEQ.S lbC01C9F4 ; CMPI.W #$100,D7 ; BLS.S lbC01C9CE ; MOVE.W #$100,D7 ;lbC01C9CE ORI.W #$10,D0 ; MOVE.L D0,D6 ; ANDI.W #$FFDF,D6 ; MOVEQ #0,D0 ; MOVE.W D7,D0 ; ASL.L #2,D0 ; MOVE.W D0,lbW0247C0 ; CLR.W lbW0247C2 ; MOVE.W D6,lbW0247CA ; MOVEQ #0,D0 ; BRA.S lbC01C9F8 ;lbC01C9F4 BSR.L lbC01C7EE ;lbC01C9F8 MOVEM.L (SP)+,D6/D7 ; RTS ;_BGMtempo CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVE.L D7,-(SP) ; MOVE.W 10(SP),D7 ; MOVE.W lbW0247CA,D0 ; BTST #15,D0 ; BNE.S lbC01CA1C ; MOVEQ #1,D0 ; BRA.S lbC01CA48 ;lbC01CA1C MOVEQ #1,D0 ; CMP.W D0,D7 ; BCC.S lbC01CA26 ; MOVE.L D0,D7 ; BRA.S lbC01CA30 ;lbC01CA26 CMPI.W #$1000,D7 ; BLS.S lbC01CA30 ; MOVE.W #$1000,D7 ;lbC01CA30 MOVE.W D7,lbW0247C6 ; MOVE.W lbW0247C8,D0 ; CMP.W D7,D0 ; BLS.S lbC01CA46 ; MOVE.W D7,lbW0247C8 ;lbC01CA46 MOVEQ #0,D0 ;lbC01CA48 MOVE.L (SP)+,D7 ; RTS ;_BGMvolume CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVEM.L D5-D7,-(SP) ; MOVE.W $12(SP),D7 ; MOVE.W $16(SP),D6 ; MOVE.W lbW0247CA,D0 ; BTST #15,D0 ; BNE.S lbC01CA70 ; MOVEQ #1,D0 ; BRA.S lbC01CAAA ;lbC01CA70 MOVEQ #$40,D0 ; CMP.W D0,D6 ; BLS.S lbC01CA78 ; MOVE.L D0,D6 ;lbC01CA78 MOVEQ #0,D5 ;lbC01CA7A MOVEQ #3,D0 ; CMP.W D0,D5 ; BCC.S lbC01CAA8 ; BTST #0,D7 ; BEQ.S lbC01CAA2 ; MOVEQ #0,D0 ; MOVE.W D5,D0 ; ADD.L D0,D0 ; LEA lbL0247BA,A0 ; ADDA.L D0,A0 ; MOVE.W D6,(A0) ; MOVEQ #0,D0 ; MOVE.W D5,D0 ; MOVE.L D0,-(SP) ; BSR.L lbC01C2BE ; ADDQ.W #4,SP ;lbC01CAA2 LSR.W #1,D7 ; ADDQ.W #1,D5 ; BRA.S lbC01CA7A ;lbC01CAA8 MOVEQ #0,D0 ;lbC01CAAA MOVEM.L (SP)+,D5-D7 ; RTS _BGMrepeat ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf MOVE.L D7,-(SP) MOVE.W 10(SP),D7 MOVE.W lbW0247CA,D0 BTST #15,D0 BEQ.S lbC01CAE6 TST.W D7 BEQ.S lbC01CADC MOVE.L D0,D1 ORI.W #2,D1 MOVE.W D1,lbW0247CA BRA.S lbC01CAE6 lbC01CADC ANDI.W #$FFFD,D0 MOVE.W D0,lbW0247CA lbC01CAE6 MOVE.L (SP)+,D7 RTS ;_BGMstatus CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVE.W lbW0247CA,D0 ; RTS ; dc.w 0 ;_AUDHandler MOVEM.L D0-D7/A0-A4,-(SP) ; JSR _AUDEntry(PC) ; MOVEM.L (SP)+,D0-D7/A0-A4 ; RTS ;_VertBServer MOVEM.L D2-D7/A2-A4/A6,-(SP) ; JSR _VertBEntry(PC) ; MOVEM.L (SP)+,D2-D7/A2-A4/A6 ; MOVEQ #0,D0 ; RTS ; dc.w 0 ;_play_sample CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVEM.L D5-D7/A3,-(SP) ; MOVEA.L $14(SP),A3 ; MOVE.L $18(SP),D7 ; MOVE.W $1E(SP),D6 ; MOVE.L $20(SP),D5 ; TST.L lbL02DA90-WT(A4) ; BNE.S __sfx_status ; MOVEQ #0,D0 ; BRA.S lbC01CBA6 ;__sfx_status BSR.L _sfx_status ; TST.W D0 ; BNE.S __sfx_status ; MOVEA.L _AIOptr-WT(A4),A0 ; MOVE.L _port-WT(A4),14(A0) ; MOVEA.L _AIOptr-WT(A4),A0 ; MOVE.W #3,$1C(A0) ; MOVEA.L _AIOptr-WT(A4),A0 ; MOVE.B #$10,$1E(A0) ; MOVEA.L _AIOptr-WT(A4),A0 ; MOVE.L A3,$22(A0) ; MOVEA.L _AIOptr-WT(A4),A0 ; MOVE.L D5,$26(A0) ; MOVE.L _clock,D0 ; MOVE.L D7,D1 ; JSR _CXD22(PC) ; MOVEA.L _AIOptr-WT(A4),A0 ; MOVE.W D0,$2A(A0) ; MOVE.W D6,$2C(A0) ; MOVEA.L _AIOptr-WT(A4),A0 ; MOVE.W #1,$2E(A0) ; MOVE.L _AIOptr-WT(A4),-(SP) ; JSR _BeginIO(PC) ; ADDQ.W #4,SP ; MOVEQ #1,D0 ;lbC01CBA6 MOVEM.L (SP)+,D5-D7/A3 ; RTS ;_sfx_status CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVE.L A6,-(SP) ; MOVEA.L _RdIOptr-WT(A4),A0 ; MOVE.W #2,$1C(A0) ; MOVEA.L _RdIOptr-WT(A4),A0 ; CLR.B $1E(A0) ; MOVEA.L _RdIOptr-WT(A4),A1 ; MOVEA.L 4,A6 ; JSR -$1C8(A6) ; MOVEA.L _RdIOptr-WT(A4),A0 ; MOVE.L $22(A0),D0 ; MOVEA.L (SP)+,A6 ; RTS ;_alloc_sfx CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVEM.L A3/A6,-(SP) ; TST.L lbL02DA90-WT(A4) ; BEQ.S lbC01CBF8 ; MOVEQ #1,D0 ; BRA.L lbC01CD20 ;lbC01CBF8 LEA graphicslibra.MSG0-WT(A4),A1 ; MOVEQ #0,D0 ; MOVEA.L 4,A6 ; JSR -$228(A6) ; MOVEA.L D0,A3 ; MOVE.L A3,D0 ; BNE.S lbC01CC12 ; MOVEQ #0,D0 ; BRA.L lbC01CD20 ;lbC01CC12 BTST #2,$CF(A3) ; BEQ.S lbC01CC26 ; MOVE.L #$361F0F,_clock ; BRA.S lbC01CC30 ;lbC01CC26 MOVE.L #$369E99,_clock ;lbC01CC30 MOVEA.L A3,A1 ; JSR -$19E(A6) ; MOVEQ #$44,D0 ; MOVE.L #$10001,D1 ; JSR -$C6(A6) ; MOVE.L D0,_AIOptr-WT(A4) ; TST.L D0 ; BNE.S lbC01CC50 ; MOVEQ #0,D0 ; BRA.L lbC01CD20 ;lbC01CC50 MOVEQ #$44,D0 ; MOVE.L #$10001,D1 ; JSR -$C6(A6) ; MOVE.L D0,_RdIOptr-WT(A4) ; TST.L D0 ; BNE.S lbC01CC6A ; MOVEQ #0,D0 ; BRA.L lbC01CD20 ;lbC01CC6A CLR.L -(SP) ; CLR.L -(SP) ; JSR _CreatePort(PC) ; ADDQ.W #8,SP ; MOVE.L D0,_port-WT(A4) ; TST.L D0 ; BNE.S lbC01CC82 ; MOVEQ #0,D0 ; BRA.L lbC01CD20 ;lbC01CC82 MOVEA.L _AIOptr-WT(A4),A0 ; MOVE.L _port-WT(A4),14(A0) ; MOVEA.L _AIOptr-WT(A4),A0 ; CLR.B 9(A0) ; MOVEA.L _AIOptr-WT(A4),A0 ; MOVE.W #$20,$1C(A0) ; MOVEA.L _AIOptr-WT(A4),A0 ; MOVE.B #$40,$1E(A0) ; MOVEA.L _AIOptr-WT(A4),A0 ; CLR.W $20(A0) ; MOVEA.L _AIOptr-WT(A4),A0 ; MOVE.L #_channel,$22(A0) ; MOVEQ #4,D0 ; MOVEA.L _AIOptr-WT(A4),A0 ; MOVE.L D0,$26(A0) ; LEA audiodevice.MSG0-WT(A4),A0 ; MOVEQ #0,D0 ; MOVEA.L _AIOptr-WT(A4),A1 ; MOVE.L D0,D1 ; MOVEA.L 4,A6 ; JSR -$1BC(A6) ; MOVE.L D0,_device ; BEQ.S lbC01CCE6 ; MOVEQ #0,D0 ; BRA.S lbC01CD20 ;lbC01CCE6 MOVEA.L _RdIOptr-WT(A4),A0 ; MOVE.L _port-WT(A4),14(A0) ; MOVEA.L _AIOptr-WT(A4),A0 ; MOVEA.L _RdIOptr-WT(A4),A1 ; MOVE.L $18(A0),$18(A1) ; MOVEA.L _AIOptr-WT(A4),A0 ; MOVEA.L _RdIOptr-WT(A4),A1 ; MOVE.L $14(A0),$14(A1) ; MOVEA.L _AIOptr-WT(A4),A0 ; MOVEA.L _RdIOptr-WT(A4),A1 ; MOVE.W $20(A0),$20(A1) ; MOVEQ #1,D0 ; MOVE.L D0,lbL02DA90-WT(A4) ;lbC01CD20 MOVEM.L (SP)+,A3/A6 ; RTS ;_free_sfx CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVE.L A6,-(SP) ; TST.L _port-WT(A4) ; BEQ.S lbC01CD44 ; MOVE.L _port-WT(A4),-(SP) ; JSR _DeletePort(PC) ; ADDQ.W #4,SP ; CLR.L _port-WT(A4) ;lbC01CD44 TST.L _device ; BNE.S lbC01CD60 ; MOVEA.L _AIOptr-WT(A4),A1 ; MOVEA.L 4,A6 ; JSR -$1C2(A6) ; MOVEQ #1,D0 ; MOVE.L D0,_device ;lbC01CD60 TST.L _AIOptr-WT(A4) ; BEQ.S lbC01CD78 ; MOVEA.L _AIOptr-WT(A4),A1 ; MOVEQ #$44,D0 ; MOVEA.L 4,A6 ; JSR -$D2(A6) ; CLR.L _AIOptr-WT(A4) ;lbC01CD78 TST.L _RdIOptr-WT(A4) ; BEQ.S lbC01CD90 ; MOVEA.L _RdIOptr-WT(A4),A1 ; MOVEQ #$44,D0 ; MOVEA.L 4,A6 ; JSR -$D2(A6) ; CLR.L _RdIOptr-WT(A4) ;lbC01CD90 CLR.L lbL02DA90-WT(A4) ; MOVEA.L (SP)+,A6 ; RTS ;_LoadWarSamples CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVE.L D7,-(SP) ; MOVEQ #0,D7 ; PEA Nobunaga_BDAT.MSG43-WT(A4) ; PEA _G_WarSamples-WT(A4) ; BSR.L _load_wave ; MOVE.L D0,D7 ; PEA Nobunaga_BDAT.MSG44-WT(A4) ; PEA lbL030004-WT(A4) ; BSR.L _load_wave ; MOVE.L D0,D7 ; PEA Nobunaga_BDAT.MSG45-WT(A4) ; PEA lbL030010-WT(A4) ; BSR.L _load_wave ; MOVE.L D0,D7 ; PEA Nobunaga_BDAT.MSG46-WT(A4) ; PEA lbL03001C-WT(A4) ; BSR.L _load_wave ; MOVE.L D0,D7 ; PEA Nobunaga_BDAT.MSG47-WT(A4) ; PEA lbL030028-WT(A4) ; BSR.L _load_wave ; LEA $28(SP),SP ; MOVE.L D0,D7 ; TST.W D7 ; BNE.S lbC01CDF6 ; MOVE.L D7,D0 ; EXT.L D0 ;lbC01CDF6 MOVE.L (SP)+,D7 ; RTS ;_FreeWarSamples CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVE.L D7,-(SP) ; TST.L _G_AllocationStatus-WT(A4) ; BNE.S lbC01CE2C ; MOVEQ #0,D7 ;lbC01CE0C MOVEQ #6,D0 ; CMP.L D0,D7 ; BGE.S lbC01CE2C ; MOVE.L D7,D0 ; MOVEQ #12,D1 ; JSR __CXM33(PC) ; LEA _G_WarSamples-WT(A4),A0 ; ADDA.L D0,A0 ; MOVE.L A0,-(SP) ; BSR.L _free_wave ; ADDQ.W #4,SP ; ADDQ.L #1,D7 ; BRA.S lbC01CE0C ;lbC01CE2C MOVE.L (SP)+,D7 ; RTS ;_load_wave CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVEM.L D2/D3/D7/A2/A3/A6,-(SP) ; MOVEA.L $1C(SP),A3 ; MOVEA.L $20(SP),A2 ; MOVE.L A2,D1 ; MOVE.L #$3ED,D2 ; MOVEA.L _DOSBase-WT(A4),A6 ; JSR -$1E(A6) ; MOVE.L D0,D7 ; TST.L D7 ; BNE.S lbC01CE5E ; MOVEQ #0,D0 ; BRA.S lbC01CEA6 ;lbC01CE5E LEA 8(A3),A0 ; MOVE.L D7,D1 ; MOVE.L A0,D2 ; MOVEQ #4,D3 ; JSR -$2A(A6) ; LEA 4(A3),A0 ; MOVE.L D7,D1 ; MOVE.L A0,D2 ; JSR -$2A(A6) ; MOVE.L 4(A3),D0 ; MOVEQ #3,D1 ; MOVEA.L 4,A6 ; JSR -$C6(A6) ; MOVE.L D0,(A3) ; BEQ.S lbC01CE9A ; MOVE.L D7,D1 ; MOVE.L D0,D2 ; MOVE.L 4(A3),D3 ; MOVEA.L _DOSBase-WT(A4),A6 ; JSR -$2A(A6) ;lbC01CE9A MOVE.L D7,D1 ; MOVEA.L _DOSBase-WT(A4),A6 ; JSR -$24(A6) ; MOVEQ #1,D0 ;lbC01CEA6 MOVEM.L (SP)+,D2/D3/D7/A2/A3/A6 ; RTS ;_free_wave CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVEM.L A3/A6,-(SP) ; MOVEA.L 12(SP),A3 ; MOVEA.L (A3),A1 ; MOVE.L 4(A3),D0 ; MOVEA.L 4,A6 ; JSR -$D2(A6) ; MOVEM.L (SP)+,A3/A6 ; RTS ;_play_sfx LINK.W A5,#-$10 ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVEM.L D7/A3,-(SP) ; MOVEA.L 8(A5),A3 ; MOVE.L A3,-(SP) ; PEA -12(A5) ; BSR.L _load_wave ; ADDQ.W #8,SP ; MOVE.L D0,D7 ; TST.W D7 ; BEQ.S lbC01CF14 ; MOVE.L -8(A5),-(SP) ; PEA $3F ; MOVE.L -4(A5),-(SP) ; MOVE.L -12(A5),-(SP) ; BSR.L _play_sample ; PEA -12(A5) ; BSR.S _free_wave ; LEA $14(SP),SP ;lbC01CF14 MOVE.L D7,D0 ; MOVEM.L (SP)+,D7/A3 ; UNLK A5 ; RTS ;_playSFX CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVEM.L D6/D7/A3,-(SP) ; MOVEA.L $10(SP),A3 ; MOVE.W $16(SP),D7 ; TST.L (A3) ; BEQ.S lbC01CF52 ; MOVEQ #0,D0 ; MOVE.W D7,D0 ; MOVE.L 4(A3),-(SP) ; MOVE.L D0,-(SP) ; MOVE.L 8(A3),-(SP) ; MOVE.L (A3),-(SP) ; BSR.L _play_sample ; LEA $10(SP),SP ; MOVE.L D0,D6 ; BRA.S lbC01CF56 ;lbC01CF52 MOVEQ #0,D0 ; BRA.S lbC01CF58 ;lbC01CF56 MOVE.L D6,D0 ;lbC01CF58 MOVEM.L (SP)+,D6/D7/A3 ; RTS ; dc.w 0 ;_m_error CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVE.L A3,-(SP) ; MOVEA.L 8(SP),A3 ; MOVEQ #0,D0 ; MOVE.L D0,-(SP) ; MOVE.L D0,-(SP) ; JSR __klocate0(PC) ; MOVE.L A3,(SP) ; JSR __kputs0(PC) ; ADDQ.W #8,SP ; MOVEA.L (SP)+,A3 ; RTS ;_CleanUp CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVEM.L D7/A2/A3,-(SP) ; MOVEA.L $10(SP),A3 ; TST.L lbL0247F8 ; BEQ.S lbC01D012 ; MOVE.L A3,D0 ; BEQ.S __BGMremove ; MOVE.L A3,-(SP) ; BSR.S _m_error ; ADDQ.W #4,SP ;__BGMremove JSR _BGMremove(PC) ; JSR _free_sfx(PC) ; MOVEQ #0,D7 ;lbC01CFB0 MOVEQ #3,D0 ; CMP.L D0,D7 ; BGE.S lbC01CFF0 ; MOVE.L D7,D0 ; MOVEQ #12,D1 ; JSR __CXM33(PC) ; LEA _voices,A0 ; ADDA.L D0,A0 ; MOVEA.L (A0),A2 ; MOVE.L A2,D0 ; BEQ.S lbC01CFEC ; MOVE.L #$8000,-(SP) ; MOVE.L A2,-(SP) ; JSR _FreeMem(PC) ; ADDQ.W #8,SP ; MOVE.L D7,D0 ; MOVEQ #12,D1 ; JSR __CXM33(PC) ; LEA _voices,A0 ; ADDA.L D0,A0 ; CLR.L (A0) ;lbC01CFEC ADDQ.L #1,D7 ; BRA.S lbC01CFB0 ;lbC01CFF0 TST.L _VoiceFD ; BEQ.S lbC01D00C ; MOVE.L _VoiceFD,-(SP) ; JSR _close(PC) ; ADDQ.W #4,SP ; MOVEQ #0,D0 ; MOVE.L D0,_VoiceFD ;lbC01D00C CLR.L lbL0247F8 ;lbC01D012 MOVEM.L (SP)+,D7/A2/A3 ; RTS _SetUp ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVEM.L D7/A3,-(SP) ; TST.L lbL0247F8 ; BEQ.S __BGMmount ; MOVEQ #1,D0 ; BRA.L lbC01D0BE __BGMmount JSR _BGMmount(PC) ; TST.L D0 ; BEQ.S __alloc_sfx ; PEA BGMDriverinit.MSG-WT(A4) ; BSR.L _CleanUp ; ADDQ.W #4,SP ; MOVEQ #0,D0 ; BRA.S lbC01D0BE ;__alloc_sfx JSR _alloc_sfx(PC) ; TST.L D0 ; BNE.S lbC01D062 ; PEA Cantallocates.MSG-WT(A4) ; BSR.L _m_error ; JSR _free_sfx(PC) ; ADDQ.W #4,SP ; MOVEQ #0,D0 ; BRA.S lbC01D0BE lbC01D062 MOVEQ #0,D7 lbC01D064 MOVEQ #3,D0 CMP.L D0,D7 BGE.S lbC01D0B6 ; PEA 2 ; MOVE.L #$8000,-(SP) ; JSR _AllocMem(PC) ; ADDQ.W #8,SP ; MOVEA.L D0,A3 ; MOVE.L A3,D0 ; BNE.S lbC01D08E ; PEA Cantallocatem.MSG-WT(A4) ; BSR.L _CleanUp ; ADDQ.W #4,SP ; MOVEQ #0,D0 ; BRA.S lbC01D0BE lbC01D08E MOVE.L D7,D0 MOVEQ #12,D1 JSR __CXM33(PC) LEA _voices,A0 MOVEA.L A0,A1 ADDA.L D0,A1 ; MOVE.L A3,(A1) MOVEA.L A0,A1 ADDA.L D0,A1 MOVEQ #-1,D1 MOVE.L D1,4(A1) ADDA.L D0,A0 CLR.L 8(A0) ADDQ.L #1,D7 BRA.S lbC01D064 lbC01D0B6 MOVEQ #1,D0 ; MOVE.L D0,lbL0247F8 ;lbC01D0BE MOVEM.L (SP)+,D7/A3 RTS _read_voice LINK.W A5,#-$38 ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf MOVEM.L D2/D4-D7/A2/A3,-(SP) MOVE.L 8(A5),D7 MOVE.L 12(A5),D6 TST.L D6 BMI.L lbC01D1F2 MOVEQ #$40,D0 ADD.L D0,D0 CMP.L D0,D6 BGE.L lbC01D1F2 MOVE.L D6,D0 ASL.L #2,D0 LEA _VoicePosition,A0 move.l A0,A2 ADDA.L D0,A0 MOVE.L (A0),D0 MOVEM.L D0,-$14(A5) BEQ.L lbC01D1F2 ; CLR.L -(SP) ; MOVE.L D0,-(SP) ; MOVE.L _VoiceFD,-(SP) ; JSR _lseek(PC) ; PEA $20 ; PEA -$38(A5) ; MOVE.L _VoiceFD,-(SP) ; JSR _read(PC) ; LEA $18(SP),SP lea (A2,D0.L),A2 lea -$38(A5),A0 moveq #7,D0 CopyInfo move.l (A2)+,(A0)+ dbf D0,CopyInfo MOVEQ #0,D0 MOVE.L D0,-$10(A5) MOVE.L D7,D0 MOVEQ #12,D1 JSR __CXM33(PC) LEA _voices,A0 ADDA.L D0,A0 move.l A2,(A0) MOVEA.L (A0),A3 MOVE.L D7,D0 MOVEQ #$60,D1 JSR __CXM33(PC) LEA _VoiceInfo,A0 ADDA.L D0,A0 MOVEA.L A0,A2 MOVEQ #0,D5 lbC01D154 MOVEQ #8,D0 CMP.L D0,D5 BGE.S lbC01D1B0 MOVE.L D5,D0 ADD.L D0,D0 MOVE.W -$38(A5,D0.L),D4 MOVE.W -$28(A5,D0.L),D1 MOVE.W D4,$20(A2,D0.L) MOVE.W D1,$50(A2,D0.L) MOVE.W D1,-8(A5) TST.W D4 BEQ.S lbC01D19E MOVE.L D5,D0 ASL.L #2,D0 MOVE.L A3,0(A2,D0.L) MOVEQ #0,D2 MOVE.W D4,D2 ADD.L D2,D2 ADDA.L D2,A3 MOVEQ #0,D2 MOVE.W D1,D2 ADD.L D2,D2 MOVEA.L A3,A0 SUBA.L D2,A0 MOVE.L A0,$30(A2,D0.L) MOVEQ #0,D0 MOVE.W D4,D0 ADD.L D0,-$10(A5) BRA.S lbC01D1AC lbC01D19E MOVE.L D5,D0 ASL.L #2,D0 SUBA.L A0,A0 MOVE.L A0,0(A2,D0.L) MOVE.L A0,$30(A2,D0.L) lbC01D1AC ADDQ.L #1,D5 BRA.S lbC01D154 lbC01D1B0 MOVE.L D7,D0 MOVEQ #12,D1 JSR __CXM33(PC) LEA _voices,A0 ADDA.L D0,A0 MOVE.L -$10(A5),D0 ADD.L D0,D0 MOVE.L D0,-(SP) MOVE.L (A0),-(SP) ; MOVE.L _VoiceFD,-(SP) ; JSR _read(PC) clr.l -(SP) MOVE.L D7,D0 MOVEQ #12,D1 JSR __CXM33(PC) LEA _voices,A0 MOVEA.L A0,A1 ADDA.L D0,A1 MOVE.L D6,4(A1) ADDA.L D0,A0 MOVEQ #1,D0 MOVE.L D0,8(A0) lbC01D1F2 MOVEM.L -$54(A5),D2/D4-D7/A2/A3 UNLK A5 RTS _set_voice ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf MOVEM.L D2/D5-D7/A3,-(SP) MOVE.L $18(SP),D7 MOVEA.L $1C(SP),A3 MOVEQ #3,D0 CMP.L D0,D7 BGE.L lbC01D346 MOVEQ #0,D6 lbC01D21A MOVEQ #3,D0 CMP.L D0,D6 BGE.S lbC01D26E MOVE.L D6,D0 MOVEQ #12,D1 JSR __CXM33(PC) LEA _voices,A0 MOVEA.L A0,A1 ADDA.L D0,A1 MOVE.L D7,D1 ADD.L D1,D1 MOVEQ #0,D2 MOVE.W 12(A3,D1.L),D2 MOVE.L 4(A1),D1 CMP.L D2,D1 BNE.S lbC01D26A ADDA.L D0,A0 MOVEQ #1,D0 MOVE.L D0,8(A0) MOVE.L D7,D0 ASL.L #2,D0 LEA lbL024950,A0 ADDA.L D0,A0 MOVE.L D6,D0 MOVEQ #$60,D1 JSR __CXM33(PC) LEA _VoiceInfo,A1 ADDA.L D0,A1 MOVE.L A1,(A0) lbC01D26A ADDQ.L #1,D6 BRA.S lbC01D21A lbC01D26E MOVE.L D7,D0 ADDQ.L #1,D0 MOVE.L A3,-(SP) MOVE.L D0,-(SP) BSR.S _set_voice ADDQ.W #8,SP MOVE.L D7,D0 ASL.L #2,D0 LEA lbL024950,A0 ADDA.L D0,A0 TST.L (A0) BNE.L lbC01D346 MOVEQ #0,D6 lbC01D28E MOVEQ #3,D0 CMP.L D0,D6 BGE.S lbC01D2E4 MOVE.L D6,D0 MOVEQ #12,D1 JSR __CXM33(PC) LEA _voices,A0 MOVEA.L A0,A1 ADDA.L D0,A1 MOVE.L D7,D1 ADD.L D1,D1 MOVEQ #0,D2 MOVE.W 12(A3,D1.L),D2 MOVE.L 4(A1),D1 CMP.L D2,D1 BNE.S lbC01D2E0 ADDA.L D0,A0 MOVEQ #1,D0 MOVE.L D0,8(A0) MOVE.L D7,D0 ASL.L #2,D0 LEA lbL024950,A0 ADDA.L D0,A0 MOVE.L D6,D0 MOVEQ #$60,D1 JSR __CXM33(PC) LEA _VoiceInfo,A1 ADDA.L D0,A1 MOVE.L A1,(A0) BRA.S lbC01D346 lbC01D2E0 ADDQ.L #1,D6 BRA.S lbC01D28E lbC01D2E4 MOVEQ #0,D6 lbC01D2E6 MOVEQ #3,D0 CMP.L D0,D6 BGE.S lbC01D314 MOVE.L D6,D0 MOVEQ #12,D1 JSR __CXM33(PC) LEA _voices,A0 MOVEA.L A0,A1 ADDA.L D0,A1 TST.L 8(A1) BNE.S lbC01D310 MOVE.L D6,D5 ADDA.L D0,A0 MOVE.L 4(A0),D0 TST.L D0 BMI.S lbC01D314 lbC01D310 ADDQ.L #1,D6 BRA.S lbC01D2E6 lbC01D314 MOVE.L D7,D0 ADD.L D0,D0 MOVEQ #0,D1 MOVE.W 12(A3,D0.L),D1 MOVE.L D1,-(SP) MOVE.L D5,-(SP) BSR.L _read_voice ADDQ.W #8,SP MOVE.L D7,D0 ASL.L #2,D0 LEA lbL024950,A0 ADDA.L D0,A0 MOVE.L D5,D0 MOVEQ #$60,D1 JSR __CXM33(PC) LEA _VoiceInfo,A1 ADDA.L D0,A1 MOVE.L A1,(A0) lbC01D346 MOVEM.L (SP)+,D2/D5-D7/A3 RTS _bgm_start ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf MOVEM.L D6/D7/A3,-(SP) MOVEA.L $10(SP),A3 MOVE.W $16(SP),D7 ; CLR.L -(SP) ; JSR _BGMstop(PC) ; JSR __check_music(PC) ; ADDQ.W #4,SP ; TST.W D0 ; BEQ.S lbC01D3C6 MOVEQ #0,D6 lbC01D372 MOVEQ #3,D0 CMP.L D0,D6 BGE.S lbC01D3AA MOVE.L D6,D0 MOVEQ #12,D1 JSR __CXM33(PC) LEA _voices,A0 ADDA.L D0,A0 CLR.L 8(A0) MOVE.L D6,D0 ASL.L #2,D0 LEA _BGMdata,A0 ADDA.L D0,A0 MOVE.L 0(A3,D0.L),(A0) LEA lbL024950,A0 ADDA.L D0,A0 CLR.L (A0) ADDQ.L #1,D6 BRA.S lbC01D372 lbC01D3AA MOVE.L A3,-(SP) CLR.L -(SP) BSR.L _set_voice MOVEQ #0,D0 MOVE.W D7,D0 MOVE.L D0,(SP) PEA _BGMdata JSR _BGMstart(PC) LEA 12(SP),SP lbC01D3C6 MOVEQ #0,D0 MOVEM.L (SP)+,D6/D7/A3 RTS ;_bgm_stop CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVEM.L D5-D7,-(SP) ; MOVE.W $12(SP),D7 ; MOVE.W $16(SP),D6 ; MOVEQ #-1,D5 ; MOVEQ #0,D0 ; MOVE.W D7,D0 ; MOVE.L D0,-(SP) ; JSR _BGMstop(PC) ; ADDQ.W #4,SP ; TST.L D0 ; BNE.S lbC01D3F6 ; MOVEQ #0,D5 ;lbC01D3F6 TST.W D6 ; BEQ.S lbC01D402 ; BSR.L _bgm_check ; TST.L D0 ; BNE.S lbC01D3F6 ;lbC01D402 MOVE.L D5,D0 ; MOVEM.L (SP)+,D5-D7 ; RTS ;_bgm_check CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; JSR _BGMstatus(PC) ; BTST #0,D0 ; BEQ.S lbC01D420 ; MOVEQ #1,D0 ; BRA.S lbC01D422 ;lbC01D420 MOVEQ #0,D0 ;lbC01D422 RTS _bgm_repeat ; CMPA.L __base-WT(A4),SP ; BCS.L __xcovf MOVE.L D7,-(SP) MOVE.W 10(SP),D7 MOVE.L D7,D0 EXT.L D0 MOVE.L D0,-(SP) JSR _BGMrepeat(PC) ADDQ.W #4,SP MOVE.L D7,D0 EXT.L D0 MOVE.L (SP)+,D7 RTS ;_bgm_volume CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVE.L D7,-(SP) ; MOVE.W 10(SP),D7 ; MOVEQ #0,D0 ; MOVE.W D7,D0 ; MOVE.L D0,-(SP) ; MOVE.L #$FFFF,-(SP) ; JSR _BGMvolume(PC) ; ADDQ.W #8,SP ; TST.L D0 ; BEQ.S lbC01D46E ; MOVEQ #-1,D0 ; BRA.S lbC01D470 ;lbC01D46E MOVEQ #0,D0 ;lbC01D470 MOVE.L (SP)+,D7 ; RTS ;_sound_init_file CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; MOVE.L A3,-(SP) ; MOVEA.L 8(SP),A3 ; MOVEA.W #1,A0 ; MOVE.L A0,-(SP) ; PEA 2 ; JSR _signal(PC) ; ADDQ.W #8,SP ; TST.L _VoiceFD ; BEQ.S __SetUp ; MOVE.L _VoiceFD,-(SP) ; JSR _close(PC) ; ADDQ.W #4,SP ; CLR.L _VoiceFD ;__SetUp BSR.L _SetUp ; TST.L D0 ; BNE.S lbC01D4B8 ; MOVEQ #0,D0 ; BRA.S lbC01D4F2 ;lbC01D4B8 MOVE.L A3,-(SP) ; JSR _ropen(PC) ; ADDQ.W #4,SP ; MOVE.L D0,_VoiceFD ; TST.L D0 ; BNE.S lbC01D4D8 ; PEA CantopenVoice.MSG-WT(A4) ; BSR.L _CleanUp ; ADDQ.W #4,SP ; MOVEQ #0,D0 ; BRA.S lbC01D4F2 ;lbC01D4D8 PEA $200 ; PEA _VoicePosition ; MOVE.L _VoiceFD,-(SP) ; JSR _read(PC) ; LEA 12(SP),SP ; MOVEQ #1,D0 ;lbC01D4F2 MOVEA.L (SP)+,A3 ; RTS ;_sound_init CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; PEA _vce_name ; BSR.L _sound_init_file ; ADDQ.W #4,SP ; RTS ;_CloseVoiceFD CMPA.L __base-WT(A4),SP ; BCS.L __xcovf ; TST.L _VoiceFD ; BEQ.S lbC01D528 ; MOVE.L _VoiceFD,-(SP) ; JSR _close(PC) ; ADDQ.W #4,SP ;lbC01D528 CLR.L _VoiceFD ; RTS ;__check_music JMP _check_music WT ; SECTION nobunaga02430C,DATA lbL02430C dc.l $F073D0C0 dc.l $241E2423 dc.l $12251226 dc.l $1228122A dc.l $6C2A242D dc.l $242C242A dc.l $24281B26 dc.l $9256C2A dc.l $122C122D dc.l $362F1231 dc.l $242F1B2D dc.l $92C362A dc.l $12282425 dc.l $242D09C0 dc.l $92C09C0 dc.l $92A4828 dc.l $242A6CC0 dc.w $24D3 dc.b $FF lbB024353 dc.b $F0 dc.l $73D0C000 dc.l $C1202A24 dc.l $28242624 dc.l $251B2309 dc.l $216CC024 dc.l $256C2724 dc.l $28362712 dc.l $2524C024 dc.l $2A122812 dc.l $26482348 dc.l $22122012 dc.l $2224C024 dc.w $D3FF lbL024386 dc.l $F073D023 dc.l $6C231225 dc.l $12262421 dc.l $242624C0 dc.l $2428902D dc.l $24282421 dc.l $24C0242A dc.l $362C122D dc.l $4831242C dc.l $24254826 dc.l $24260928 dc.l $92A092C dc.l $92D2425 dc.l $242A6C2A dc.w $24D3 dc.b $FF lbB0243C1 dc.b $F0 dc.l $731D2422 dc.l $48242425 dc.l $24240922 dc.l $9205A1D dc.l $24224825 dc.l $2429242C dc.l $9290927 dc.l $6C250924 dc.l $9226C29 dc.l $24274824 dc.l $24202425 dc.l $9240922 dc.l $7E2248C0 dc.w $24FF lbL0243F8 dc.l $F0732224 dc.l $2924C024 dc.l $29242924 dc.l $2924C024 dc.l $29242924 dc.l $2924C024 dc.l $29242924 dc.l $2924C024 dc.l $29242924 dc.l $2924C024 dc.l $29242924 dc.l $2924C024 dc.l $29242924 dc.l $2924C024 dc.l $29242924 dc.l $2224C024 dc.w $2224 dc.b $FF lbB02443B dc.b $F0 dc.l $73C0B41B dc.l $901D9024 dc.l $7E220920 dc.l $91E9020 dc.l $90220920 dc.l $91D7E1F dc.l $48C024FF lbL024458 dc.l $F0731812 dc.l $1D242224 dc.l $21121F12 dc.l $1D121F1B dc.l $1809186C dc.l $1B122024 dc.l $25242412 dc.l $22122012 dc.l $221B2909 dc.l $29482712 dc.l $29122B6C dc.l $24242E48 dc.l $2D182B18 dc.l $29182B1B dc.l $300930B4 dc.w $C048 dc.b $FF lbB024497 dc.b $F0 dc.l $73241B24 dc.l $9221224 dc.l $1B240922 dc.l $12241224 dc.l $9220924 dc.l $1B240922 dc.l $12241B24 dc.l $9221224 dc.l $12240922 dc.l $9271B27 dc.l $9251227 dc.l $1B270925 dc.l $12271227 dc.l $9250927 dc.l $1B270925 dc.l $12271B27 dc.l $9251227 dc.l $12270925 dc.l $9241B24 dc.l $9221224 dc.l $1B240922 dc.l $12241224 dc.l $9220924 dc.l $1B240922 dc.l $12241B24 dc.l $9221224 dc.l $12240922 dc.l $9271B27 dc.l $9251227 dc.l $1B270925 dc.l $12271227 dc.l $9250927 dc.l $1B270925 dc.l $12271B27 dc.l $9251227 dc.l $12270925 dc.w $9FF lbL02452A dc.l $F0732412 dc.l $24122412 dc.l $24122412 dc.l $24122412 dc.l $24122412 dc.l $24122412 dc.l $24122412 dc.l $24122412 dc.l $24122712 dc.l $27122712 dc.l $27122712 dc.l $27122712 dc.l $27122712 dc.l $27122712 dc.l $27122712 dc.l $27122712 dc.l $27122412 dc.l $24122412 dc.l $24122412 dc.l $24122412 dc.l $24122412 dc.l $24122412 dc.l $24122412 dc.l $24122412 dc.l $24122712 dc.l $27122712 dc.l $27122712 dc.l $27122712 dc.l $27122712 dc.l $27122712 dc.l $27122712 dc.l $27122712 dc.w $2712 dc.b $FF lbB0245AD dc.b $F0 dc.l $732E122C dc.l $242B1229 dc.l $242E122C dc.l $242B1229 dc.l $48C024FF lbL0245C2 dc.l $F06E1812 dc.l $18241812 dc.l $18241812 dc.l $18241812 dc.l $1848C024 dc.b $FF lbB0245D7 dc.b $F0 dc.l $6E1B121B dc.l $241B121B dc.l $241B121B dc.l $241B121B dc.l $48C024FF lbL0245EC dc.l $F0732812 dc.l $2A092C09 dc.l $2D122C09 dc.l $2A092F24 dc.w $C024 dc.b $FF lbB0245FF dc.b $F0 dc.l $731A6CC0 dc.w $24FF lbL024606 dc.l $F0641C6C dc.w $C024 dc.b $FF lbB02460D dc.b $F0 dc.l $7326122B dc.l $122A24FF lbL024616 dc.l $F0622224 dc.w $2424 dc.b $FF lbB02461D dc.b $F0 dc.l $73132415 dc.w $24FF lbL024624 dc.l $F0732912 dc.l $2E123012 dc.l $35243309 dc.l $32093012 dc.l $2E12301B dc.l $35093548 dc.l $35243790 dc.b $FF lbB024641 dc.b $F0 dc.l $73C0AB20 dc.l $9204820 dc.l $241F90FF lbL02464E dc.l $F0731D12 dc.l $22122412 dc.l $29242709 dc.l $26092412 dc.l $2212241B dc.l $30093048 dc.l $30242F90 dc.b $FF lbB02466B dc.b $F0 dc.l $731D361F dc.l $12201222 dc.l $12242427 dc.l $24261224 dc.l $122248FF lbL024680 dc.l $F0731D90 dc.l $24481F48 dc.b $FF lbB024689 dc.b $F0 lbL02468A dc.l $73C0481D dc.l $121F1220 dc.l $241F241D dc.l $121B121A dc.w $48FF _MUSICdatas dc.l lbL02430C ; title/repeat dc.l lbB024353 dc.l lbL024386 dc.w 3 dc.w 3 dc.w 2 dc.l lbB0243C1 ; ingame/repeat dc.l lbL0243F8 dc.l lbB02443B dc.w 0 dc.w 1 dc.w 0 dc.l lbL024458 ; battle/repeat dc.l lbB024497 dc.l lbL02452A dc.w 5 dc.w 4 dc.w 4 dc.l lbB0245AD dc.l lbL0245C2 dc.l lbB0245D7 dc.w 3 dc.w 3 dc.w 3 dc.l lbL0245EC dc.l lbB0245FF dc.l lbL024606 dc.w 0 dc.w 0 dc.w 0 dc.l lbB02460D dc.l lbL024616 dc.l lbB02461D dc.w 0 dc.w 0 dc.w 0 dc.l lbL024624 dc.l lbB024641 dc.l lbL02464E dc.w 3 dc.w 3 dc.w 3 dc.l lbB02466B dc.l lbL024680 dc.l lbB024689 dc.w 3 dc.w 3 dc.w 3 dc.l lbL02D9DC dc.l lbB02D9ED dc.l lbW02D9FE dc.w 0 dc.w 0 dc.w 0 dc.w 0 lbL02D9DC dc.l $F0732F24 dc.l $32243148 dc.l $C0242F12 dc.l $32123148 dc.b $FF lbB02D9ED dc.b $F0 dc.l $732B242E dc.l $242D48C0 dc.l $242B122E dc.l $122D48FF lbW02D9FE dc.w $FF00 ; SECTION nobunaga024748,DATA lbL024748 dc.l $DFF0B0 dc.l $1000002 dc.l 0 dc.l 0 dc.l $DFF0C0 dc.l $2000004 dc.l 0 dc.l 0 dc.l $DFF0D0 dc.l $4000008 dc.l 0 dc.l 0 lbL024778 dc.l 0 dc.l 0 dc.l 0 dc.l 0 dc.l 1 dc.l 0 dc.l 0 dc.l 0 dc.l 0 dc.l 0 dc.l $10000 dc.l 0 dc.l 0 dc.l 0 dc.l 0 dc.l 1 dc.w 0 lbL0247BA dc.l 0 dc.w $40 lbW0247C0 dc.w $40 lbW0247C2 dc.w 0 lbW0247C4 dc.w 0 lbW0247C6 dc.w 0 lbW0247C8 dc.w 0 lbW0247CA dc.w 0 ;lbW0247CC dc.w 8 ; dc.w 9 ; dc.w 10 ;lbW0247D2 dc.w $E00 lbW0247D4 dc.w $1AC dc.w $194 dc.w $17D dc.w $168 dc.w $153 dc.w $140 dc.w $12E dc.w $11D dc.w $10D dc.w $FE dc.w $F0 dc.w $E2 ; SECTION nobunaga0247EC,DATA ;_device dc.l $FFFFFFFF ;_clock dc.l 0 ;_channel dc.w $102 ; dc.w $408 ; SECTION nobunaga0247F8,DATA ;lbL0247F8 dc.l 0 _voices dc.l 0 ; samp ptr dc.l $FFFFFFFF dc.l 0 dc.l 0 ; samp ptr dc.l $FFFFFFFF dc.l 0 dc.l 0 ; samp ptr dc.l $FFFFFFFF dc.l 0 ;_VoiceFD dc.l 0 ; SECTION nobunaga024824,BSS _VoiceInfo ds.l $48 _BGMdata ds.l 3 lbL024950 ds.l 3 ;_MUSICnumber dc.w 0 ; dc.w 9 ;lbW02CB5C dc.w $BD ; dc.w $9914 ; dc.w $5A ; dc.w $4208 ;lbL02DA1C dc.l 0 ;lbL02DA20 dc.l 0 ; dc.l 0 ; dc.l 0 ;lbL02DA2C dc.l 0 ; dc.l 0 ; dc.l 0 lbL02DA38 dc.l 0 dc.l 0 dc.l 0 ;lbL02DA44 dc.l 0 ;lbL02DA48 dc.l 0 ;lbL02DA4C dc.l 0 ;lbL02DA50 dc.l 0 ;audiodevice.MSG dc.b 'audio.device',0,0 ;KOEIsound.MSG dc.b 'KOEI sound',0,0 ;KOEIAUD.MSG dc.b 'KOEI-AUD',0,0 ;KOEIsound.MSG0 dc.b 'KOEIsound',0,0 ; dc.b 0 ;_AIOptr dc.l 0 ;_RdIOptr dc.l 0 ;_port dc.l 0 ;lbL02DA90 dc.l 0 ;graphicslibra.MSG0 dc.b 'graphics.library',0,0 ;audiodevice.MSG0 dc.b 'audio.device',0,0 ;Nobunaga_BDAT.MSG43 dc.b 'Nobunaga_B:DATA_B/samples/G-calvary.ksf',0 ;Nobunaga_BDAT.MSG44 dc.b 'Nobunaga_B:DATA_B/samples/G-horserun.ksf',0,0 ;Nobunaga_BDAT.MSG45 dc.b 'Nobunaga_B:DATA_B/samples/gun&scream.ksf',0,0 ;Nobunaga_BDAT.MSG46 dc.b 'Nobunaga_B:DATA_B/samples/G-commander.ksf',0 ;Nobunaga_BDAT.MSG47 dc.b 'Nobunaga_B:DATA_B/samples/war&move2.ksf',0,0 ; dc.b 0 ;BGMDriverinit.MSG dc.b 'BGM Driver initialize failed',0,0 ;Cantallocates.MSG dc.b 'Can''t allocate sound effects driver!',0,0 ;Cantallocatem.MSG dc.b 'Can''t allocate memory for voice',0 ;CantopenVoice.MSG dc.b 'Can''t open Voice data file',0,0 ;_vce_name dc.b 'Nobunaga_B:DATA_B/Music/Nobunaga.mss',0,0 ;__Play JMP _Play ___CXM33 JMP __CXM33 ;_G_WarSamples ds.l 3 ;lbL030004 ds.l 3 ;lbL030010 ds.l 3 ;lbL03001C ds.l 3 ;lbL030028 ds.l 6 ;_G_AllocationStatus ds.l 1 ;_DOSBase ds.l 1 ;_SysBase ds.l 1 ;_replay ;__base ds.l 1 ;__xcovf ;___xcovf _VoicePosition ; ds.l $80 incbin ram:Nobunaga.mss NA_End