⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 691speechmodal.s14

📁 TI 691 的驱动部分
💻 S14
📖 第 1 页 / 共 5 页
字号:
        lda np:PRMBN Spe691SendBufData,y
        sta np:Speech691_len
        
        iny
        lda np:PRMBN Spe691SendBufData,y
        sta np:Speech691_len+1
        
        iny
        lda np:PRMBN Spe691SendBufData,y
        sta _SOper1
        
        iny
        lda np:PRMBN Spe691SendBufData,y
        sta _SOper1+1
        
        
	
Spe691DlgPlay_OK:
	;lda #1
        ;sta np:Sp691_VolumeFlag
        
        ldy   #0ffh
       	sty   np:Sp691_wordTemp
       	lda   #3
       	sta   np:Sp691_wordTemp+1
Spe691DlgPlay_Wait:
        dey
        cpy #0
        bne Spe691DlgPlay_Wait1
         
        sec 
        lda np:Sp691_wordTemp
        sbc #1
        sta np:Sp691_wordTemp
        
        bne Spe691DlgPlay_Wait2
        
        sec 
        lda np:Sp691_wordTemp+1
        sbc #1
        sta np:Sp691_wordTemp+1
        
        bne Spe691DlgPlay_Wait3            
        
        lda #0f5h
        rts
Spe691DlgPlay_Wait3:
        ldy #0ffh
        sty np:Sp691_wordTemp
Spe691DlgPlay_Wait2:
        ldy #0ffh
Spe691DlgPlay_Wait1:
        lda np:_PI
        and #INRDYH       
        bne Spe691DlgPlay_Wait
        
        lda np:Speech691_len
        bne Spe691DlgPlay_SendData
        lda np:Speech691_len+1
        bne Spe691DlgPlay_SendData
        lda #1h
        rts
Spe691DlgPlay_SendData:
	
	ldy #0
	lda (_SOper1),y
	sta np:Sp691_wordNumber
	lsr a
        lsr a
        lsr a
        lsr a
        ora #10h
        jsr Speech691_sendData
        lda np:Sp691_wordNumber
        and #0fh
        ora #010h
        jsr Speech691_sendData
        
        jsr PerformSpeed
        clc
        lda _SOper1
        adc #1
        sta _SOper1        
        lda _SOper1+1
        adc #0
        sta _SOper1+1       
	
	sec
	lda np:Speech691_len   
	sbc #1
	sta np:Speech691_len
	lda np:Speech691_len+1
	sbc #0
	sta np:Speech691_len+1 	
       
        jmp Spe691DlgPlay_Wait1
;============================================================================================
;============================================================================================ 
Spe691DlgState:
	lda np:_PI
	and #OUTRDYH
	bne Spe691DlgState
		
	jsr Spe691_ReadRet
	lda np:Sp691_returnValue+3
	and #0fh
	sta np:Sp691_wordTemp
	lda np:Sp691_returnValue+2
	and #0fh
	asl a
	asl a
	asl a
	asl a
	ora np:Sp691_wordTemp
	cmp #55h
	beq Spe691DlgSuccess
	jmp Spe691DlgState
Spe691DlgSuccess:
	rts
	
	
        
;============================================================================================
;============================================================================================        

	
Spe691CalcuBuf:
	lda #07h
	jsr Speech691_sendData      
	lda #01h
	jsr Speech691_sendData
	
Spe691CalcuBuf_WaitOutReady
	
	lda np:_PI
	and #OUTRDYH
	bne Spe691CalcuBuf_WaitOutReady
	jsr Spe691_ReadRet
	lda np:Sp691_returnValue
	and #0fh
	cmp #0
	beq cmp2
	
	jmp err2
cmp2	lda np:Sp691_returnValue+1
	and #0fh
	cmp #0	
	bne err2
	lda np:Sp691_returnValue+3
	and #0fh
	sta np:Sp691_wordTemp
	lda np:Sp691_returnValue+2
	and #0fh
	asl a
	asl a
	asl a
	asl a
	ora np:Sp691_wordTemp

	
	;;dex
	;;sta zp:0,x	
	rts
err2:
	brk
	RTS
		
Spe691_ReadRet:	
	jsr	Speech691_ReadData
	sty	np:Sp691_returnValue  
Speech691_ReadRet1:
	lda	np:_PI
	and	#OUTRDYH
	bne	Speech691_ReadRet1
	jsr	Speech691_ReadData
	sty	np:Sp691_returnValue+1
Speech691_ReadRet2:
	lda	np:_PI
	and	#OUTRDYH
	bne	Speech691_ReadRet2
	jsr	Speech691_ReadData
	sty	np:Sp691_returnValue+2
Speech691_ReadRet3:	 
	lda	np:_PI
	and	#OUTRDYH
	bne	Speech691_ReadRet3
	jsr	Speech691_ReadData
	sty	np:Sp691_returnValue+3	     	
;Speech691_ReadRet4:               
;	lda	np:_PI
;	and	#INRDYH           
;	bne	Speech691_ReadRet4 
        rts 
;============================================================================================
;============================================================================================
SpeSetVolumeFlag:      
       lda   #01h
       sta   np:Sp691_VolumeFlag
       rts
	
	

        



	      
;*************************************************************************
;*函数名:		    SysSpeGetDlg
;*说明:		    播放4k之内的对话
;*输入参数:   U16	     SLength	    播放语音数据的长度
;*	       U8*	     SAddress	    语音数据堆栈地址
;*返回值:     void
;*修改历史:
;*	   姓名		日期	     说明
;*	  -----		----	     ----
;*************************************************************************
;testcelp:
;       lda #00000001b
;       sta _ChanCONx
;       lda #0b2h
;       sta np:_CSx
;       lda #00h
;       sta np:_ADDRHx
;       sta np:_ADDRMx
;       sta np:_ADDRLx
;       lda np:_INCRx		
;       ora #01h
;       sta np:_INCRx
;       lda #00000001b
;       and #00000111b
;       ora #00100000b
;       sta _ChanCONx       
;       
;       lda #04bh
;       sta np:Speech691_len
;       lda #02h
;       sta np:Speech691_len+1
;       
;       jsr testcelp1
;       lda np:_INCRx
;       and #0feh
;       sta np:_INCRx
;       rts   
;testcelp1:
;       lda   #04
;       jsr   Speech691_sendData
;       lda   #01
;       jsr   Speech691_sendData
;testcelp_start:
;       ldy   #0ffh
;       sty   np:Sp691_wordTemp
;       lda   #3
;       sta   np:Sp691_wordTemp
;testcelp_wait:
;       dey
;       cpy   #0
;       
;       bne   testcelp_wait_Lp1
;       
;       ldy   np:Sp691_wordTemp
;       dey
;       sty   np:Sp691_wordTemp
;       cpy   #0
;       bne   testcelp_wait_Lp2
;       ldy   np:Sp691_wordTemp+1
;       dey   
;       sty   np:Sp691_wordTemp+1
;       bne   testcelp_wait_Lp3
;       
;       jsr   _Speech691_initial
;       lda   #03
;       jsr   _Speech691Sleep
;       rts
;testcelp_wait_Lp3:
;       ldy   #0ffh
;       sty   np:Sp691_wordTemp
;testcelp_wait_Lp2:
;       ldy   #0ffh
;testcelp_wait_Lp1:
;       lda   np:_PI
;       and   #OUTRDYH
;       bne   testcelp_wait_INReady
;       jsr   _Spe691_ReadRetValue
;       lda   #3
;       jsr   _Speech691Sleep
;       lda   np:Speech691_lenResidue
;       and   #01h
;       beq   testcelp_wait
;       jsr   _Speech691_initial
;       lda   #3
;       jsr   _Speech691Sleep
;       lda   #1
;       rts
;testcelp_wait_return:
;       lda   #0	      
;       rts
;	      
;testcelp_wait_INReady: 
;       lda   np:_PI
;       and   #INRDYH
;       
;       bne   testcelp_wait
;       
;       
;       lda   np:Speech691_len+1	      
;       bne   testcelp_wait_GetData
;       lda   np:Speech691_len
;       bne   testcelp_wait_GetData
;      
;testcelp_wait_Stop:
;       lda   #0ffh
;       jsr   Speech691_sendData
;       lda   #0ffh
;       jsr   Speech691_sendData
;       
;       clc 
;       lda  np:Speech691_lenResidue
;       
;       adc  #1
;       sta  np:Speech691_lenResidue
;       
;       jmp  testcelp_start
;       
;testcelp_wait_GetData:
;       pha
;       txa
;       pha
;       lda _DATAx1       
;       tax
;       lsr  a
;       lsr  a
;       lsr  a
;       lsr  a
;       ora  #10h
;       jsr  Speech691_sendData
;       txa
;       and  #0Fh
;       ora  #10h
;       jsr  Speech691_sendData	   
;       
;       lda  np:Speech691_len
;       sbc  #1
;       sta  np:Speech691_len
;       lda  np:Speech691_len+1
;       sbc  #0
;       sta  np:Speech691_len+1     
;       
;       pla
;       tax
;       pla
;       jmp  testcelp_start    
;;===========================================================================
;;MACRO DEFINE
;;1.EnableTP
;;===========================================================================
;EnableTouchPanel	MACRO
;			lda np:_IER1
;			ora #00000010h					;Enable touch-panel pressed interrupt
;			sta np:_IER1	
;			ENDM
;;===========================================================================
;;MACRO DEFINE
;;1.EnableTP
;;===========================================================================
;DisableTouchPanel	MACRO
;			lda np:_IER1
;			and #0ffffffefh					;Disable touch-panel pressed interrupt
;			sta np:_IER1	
;			ENDM	   




delay691:
	pha
	tax
	pha
	
	ldx	#04fh
delay691_lp:	
	ldy	#0ffh
delay691_lp1:
	lda	np:DictSysFlag+3
	and	#01h
	cmp	#0
	bne	delay691_Stop
	
	lda     np:DictSysFlag+1
	and     #02h
	cmp 	#0
	bne     delay691_Stop
	
	dey
	cpy	#0
	bne	delay691_lp1
	dex
	cpx	#0
	bne	delay691_lp
delay691_Stop:	
	pla
	tax
	pla
	rts
;----------------------------------------------------------------------------
;			DelayDlg
;----------------------------------------------------------------------------
;DelayDlg:	
;        lda #0ffh
;        sta np:Sp691_Delay
;DelayDlg_Lp:
;	lda np:Sp691_Delay
;	cmp #0
;	beq DelayDlg_End
;	nop
;	nop
;	nop
;	nop
;	sec
;	lda np:Sp691_Delay
;	sbc #01h
;	sta np:Sp691_Delay
;	jmp DelayDlg_Lp	
;DelayDlg_End:
;	rts
	
	
	
;---------------------------------------------------------------------------------------
; Function	  :	bios_delay_10_Y_ms
; Created	  :	2005-01-26 17:14:09 
; Description : delay 10 * Y ms
; Author	  : fan0ble
; Param       : Y : times to delay
; return      : none
; register    : A, Y
;---------------------------------------------------------------------------------------	
DelayDlg:
		LDY 		#10
		jmp		_bios_delay_10_Y_ms
DelayDlg_10ms:
		LDY             #1
		jmp             _bios_delay_10_Y_ms
_bios_delay_10_Y_ms:					; delay 10ms (35710 cycles)
		TYA				; (4 * n + 17) * m + 17 cycles
		PHA
		LDY		#DLGDELAYTIME	; m
delay_lp0:
		TYA
		PHA
		LDY		#0		; n (256)
delay_lp1:
		DEY
		BNE		delay_lp1
		PLA
		TAY
		DEY
		BNE		delay_lp0
		PLA
		TAY
		DEY
		BNE		_bios_delay_10_Y_ms
		RTS	
	
;*------------------------------------------------------------------------
;*			 SysSpeGetDlg-Main
;*------------------------------------------------------------------------   
SysSpeGetDlg:
	pha
	lda _SOper1
	pha
	lda _SOper1+1
	;pha
	;lda np:_IER1
	;pha
	;lda np:_ADCCON1
	pha
	  
	;lda np:_IER1	;DisableTouchPanel
      	;and #11111110b
      	;sta np:_IER1
      	;
      	;lda #0
      	;sta np:_ADCCON1
      	
      	jsr SysSpeDisableTouchPanel
      	
      	
      	lda np:DictSysFlag+1   
      	and #0fdh
      	sta np:DictSysFlag+1
      	
      	lda np:DictSysFlag+3   
      	and #0feh
      	sta np:DictSysFlag+3	
	
	ldy #0
	lda np:PRMBN SysSpeGetDlg,y    ;dialog length low
	sta np:Speech691_len
	
	iny
	lda np:PRMBN SysSpeGetDlg,y    ;dialog length high
	sta np:Speech691_len+1	      
	
	iny 
	lda np:PRMBN SysSpeGetDlg,y
	sta _SOper1
	
	iny 
	lda np:PRMBN SysSpeGetDlg,y
	sta _SOper1+1
	
	;clc
	;lda _SOper1
	;adc #40h
	;sta _SOper1	
	;lda _SOper1+1
	;adc #0
	;sta _SOper1+1
	
			
	lda np:Sp691_volume
	and #0f0h
	cmp #010h
	bcs SysSpeGetDlg_OK
	
	jsr SysSpeEnableTouchPanel
	
	;pla
	;sta np:_ADCCON1
	;pla
	;sta np:_IER1	;EnableTouchPanel
	pla 
	sta _SOper1+1
	pla
	sta _SOper1
	pla
	
	jsr DelayDlg
        jsr _Speech691_initial			;2005-5-22 04:59下午
        jsr _Speech691Sleep  			;2005-5-22 04:59下午
	
	rts                
SysSpeGetDlg_OK:	
	lda #1
        sta np:Sp691_VolumeFlag

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -