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

📄 melody.asm

📁 asm.rar 拉斯维加丝盘源代码 ASM51
💻 ASM
📖 第 1 页 / 共 3 页
字号:

;;        .IFDEF  ADPCM66
;;T_SlopeTable:
;;        DB      000,001,002,003,004,005,007,009
;;        DB      001,002,003,004,005,007,009,013
;;        DB      002,003,005,008,012,017,023,030
;;        DB      003,006,011,018,027,038,051,066
;;        DB      004,009,014,024,034,044,064,084
;;        DB      005,011,017,029,041,053,077,101
;;        DB      006,013,020,034,048,062,090,118
;;        DB      007,015,023,039,055,071,103,125
;;T_NextStep:
;;        DB      $00,$00,$00,$00,$00,$00,$08,$08
;;        DB      $00,$00,$08,$08,$08,$08,$10,$10
;;        DB      $08,$08,$10,$10,$10,$10,$18,$18
;;        DB      $10,$10,$10,$18,$18,$20,$20,$28
;;        DB      $18,$18,$18,$20,$20,$28,$28,$30
;;        DB      $20,$20,$28,$28,$28,$28,$30,$38
;;        DB      $28,$28,$30,$30,$30,$30,$38,$38
;;        DB      $30,$30,$38,$38,$38,$38,$38,$38
;;        .ENDIF
;;
;;        .IFDEF  ADPCM64
;;T_SlopeTable:                                         ;ADPCM 64 Table
;;        DB      0,  1,  2,  4,  6,  8, 12, 16   ;ADPCM w/ repeat
;;        DB      1,  3,  5,  9, 13, 17, 25, 33   ;
;;        DB      2,  5,  8, 14, 20, 26, 38, 50
;;        DB      3,  7, 11, 19, 27, 35, 41, 67
;;        DB      4,  9, 14, 24, 34, 44, 64, 84
;;        DB      5, 11, 17, 29, 41, 53, 77,111
;;        DB      6, 13, 20, 34, 48, 62, 90,118
;;        DB      7, 15, 23, 39, 55, 71,103,125
;;
;;                ;      -1, -1,  0,  0,  2,  2,  3,  4   ;Step transition table
;;T_NextStep:
;;        DB      $00,$00,$00,$00,$10,$10,$18,$20  ;0  -  7
;;        DB      $00,$00,$08,$08,$18,$18,$20,$28  ;8  - 15
;;        DB      $08,$08,$10,$10,$20,$20,$28,$30  ;16 - 23
;;        DB      $10,$10,$18,$18,$28,$28,$30,$38  ;24 - 31
;;        DB      $18,$18,$20,$20,$30,$30,$38,$38  ;32 - 39
;;        DB      $20,$20,$28,$28,$38,$38,$38,$38  ;40 - 47
;;        DB      $28,$28,$30,$30,$38,$38,$38,$38  ;48 - 55
;;        DB      $30,$30,$38,$38,$38,$38,$38,$38  ;56 - 63
;;        .ENDIF
;;
;;;/**************************************************************************/
;;;/*  R_StatusChx:                                                          */
;;;/*     b7: Active(1) flag                                                 */
;;;/*     b6: Speech(0)/Tone(1)                                              */
;;;/*     b5: RampUp(1) flag                                                 */
;;;/*     b4: RampDown(1) flag                                               */
;;;/*     b3: Nibble flag                                                    */
;;;/**************************************************************************/
;;;/*****************************************************************************/
;;;/* Stack used : 2                                                            */
;;;/*****************************************************************************/
;;F_IntCh1Service:
;;                LDA     R_StatusCh1
;;                AND     #D_ChActive+D_ChPlaySpeech+D_ChPlayTone+D_MuteFlag
;;                EOR     #D_ChActive+D_ChPlaySpeech
;;                BEQ     L_AdpcmTypeCh1
;;                EOR     #D_MuteFlag
;;                BEQ     L_SpeechMuteCh1
;;L_ExitCh1:
;;                RTS
;;L_SpeechMuteCh1:
;;                ;/* Mute Word */
;;                LDA     R_DataDPTRCh1
;;                BNE     L_DecreaseLowerMuteCh1
;;                LDA     R_DataDPTRCh1+1
;;                BEQ     L_EndSpeechCh1
;;                DEC     R_DataDPTRCh1+1
;;L_DecreaseLowerMuteCh1:
;;                DEC     R_DataDPTRCh1
;;                JMP     L_ExitCh1
;;L_EndSpeechCh1:
;;                LDA     R_StatusCh1
;;                AND     #.NOT.(D_ChActive+D_ChPlayTone+D_NibbleFlag+D_MuteFlag)
;;                STA     R_StatusCh1
;;                LDA     R_IntFlags
;;                AND     #.NOT.D_TimerCh1
;;                STA     R_IntFlags                   ;;
;;                STA     P_Ints
;;                JMP     L_ExitCh1
;;;;---------------------               pcm
;;                .IFDEF  PCM
;;L_AdpcmTypeCh1:
;;                %ReadSpeechDataCh1
;;                CMP     #$FF
;;                BEQ     L_EndSpeechCh1
;;                STA     P_DacCh1
;;                %IncSpeechDPTRCh1
;;                JMP     L_ExitCh1
;;                .ENDIF
;;
;;                .IFDEF  ADPCM66
;;L_AdpcmTypeCh1:
;;                LDA     R_StatusCh1             ;toggle nibble flag
;;                EOR     #D_NibbleFlag
;;                STA     R_StatusCh1
;;                AND     #D_NibbleFlag
;;                BNE     L_NeedNewSampleCh1
;;                %IncSpeechDPTRCh1
;;                LDA     R_EncodedCh1
;;                ROR     A
;;                ROR     A
;;                ROR     A
;;                ROR     A
;;                AND     #%00000111
;;                ORA     R_QIndexCh1
;;                BCC     L_NotAdpcmEndCh1
;;                BNE     L_NotAdpcmEndCh1
;;                BCS     L_EndSpeechCh1
;;L_NeedNewSampleCh1:
;;                %ReadSpeechDataCh1
;;                ROR     A
;;                STA     R_EncodedCh1
;;L_ProcessAdpcmCh1:
;;                AND     #%00000111
;;                ORA     R_QIndexCh1
;;                BNE     L_NotAdpcmEndCh1
;;                BCS     L_EndSpeechCh1
;;L_NotAdpcmEndCh1:
;;                TAX
;;                LDA     T_NextStep,X
;;                STA     R_QIndexCh1
;;                LDA     T_SlopeTable,X
;;                BCC     L_AdpcmPlusCh1
;;                EOR     #$FF
;;L_AdpcmPlusCh1:
;;                ADC     R_DacCh1
;;L_AdpcmExitCh1:
;;                STA     R_DacCh1        ;store decoded data
;;                STA     P_DacCh1
;;                JMP     L_ExitCh1
;;                .ENDIF
;;
;;                .IFDEF  ADPCM64
;;L_AdpcmTypeCh1:
;;                LDA     R_StatusCh1             ;toggle nibble flag
;;                EOR     #D_NibbleFlag
;;                STA     R_StatusCh1
;;                AND     #D_NibbleFlag
;;                BNE     L_NeedNewSampleCh1
;;                %IncSpeechDPTRCh1
;;                LDA     R_EncodedCh1
;;                ROR     A
;;                ROR     A
;;                ROR     A
;;                ROR     A
;;                AND     #%00000111
;;                ORA     R_QIndexCh1
;;                BCC     L_NotAdpcmEndCh1
;;                BNE     L_NotAdpcmEndCh1
;;                BCS     L_EndSpeechCh1
;;L_NeedNewSampleCh1:
;;                %ReadSpeechDataCh1
;;                ROR     A
;;                STA     R_EncodedCh1
;;L_ProcessAdpcmCh1:
;;                AND     #%00000111
;;                ORA     R_QIndexCh1
;;                BNE     L_NotAdpcmEndCh1
;;                BCS     L_EndSpeechCh1
;;L_NotAdpcmEndCh1:
;;                TAX
;;                LDA     T_NextStep,X
;;                STA     R_QIndexCh1
;;                LDA     T_SlopeTable,X
;;                BCC     L_AdpcmPlusCh1
;;                ;/* Milus
;;                EOR     #$FF
;;                ADC     R_DacCh1
;;                BCS     L_AdpcmExitCh1
;;                LDA     #0                      ;Test
;;                BCC     L_AdpcmExitCh1
;;L_AdpcmPlusCh1:
;;                ADC     R_DacCh1
;;                BCC     L_AdpcmExitCh1
;;                LDA     #$FF                    ;Test
;;L_AdpcmExitCh1:
;;                STA     R_DacCh1        ;store decoded data
;;                STA     P_DacCh1
;;                JMP     L_ExitCh1
;;                .ENDIF
;;
;;;/*****************************************************************************/
;;;/* Stack used : 2                                                            */
;;;/*****************************************************************************/
;;F_IntCh2Service:
;;                LDA     R_StatusCh2
;;                AND     #D_ChActive+D_ChPlaySpeech+D_ChPlayTone+D_MuteFlag
;;                EOR     #D_ChActive+D_ChPlaySpeech
;;                BEQ     L_AdpcmTypeCh2
;;                EOR     #D_MuteFlag
;;                BEQ     L_SpeechMuteCh2
;;L_ExitCh2:
;;                RTS
;;L_SpeechMuteCh2:
;;                LDA     R_DataDPTRCh2
;;                BNE     L_DecreaseLowerMuteCh2
;;                LDA     R_DataDPTRCh2+1
;;                BEQ     L_EndSpeechCh2
;;                DEC     R_DataDPTRCh2+1
;;L_DecreaseLowerMuteCh2:
;;                DEC     R_DataDPTRCh2
;;                JMP     L_ExitCh2
;;L_EndSpeechCh2:
;;                LDA     R_StatusCh2
;;                AND     #.NOT.(D_ChActive+D_ChPlayTone+D_NibbleFlag+D_MuteFlag)
;;                STA     R_StatusCh2
;;                LDA     R_IntFlags
;;                AND     #.NOT.D_TimerCh2
;;                STA     R_IntFlags
;;                STA     P_Ints
;;                JMP     L_ExitCh2
;;
;;                .IFDEF  PCM
;;;---------
;;L_AdpcmTypeCh2:
;;                %ReadSpeechDataCh2
;;                CMP     #$FF
;;                BEQ     L_EndSpeechCh2
;;                STA     P_DacCh2
;;                %IncSpeechDPTRCh2
;;                JMP     L_ExitCh2
;;                .ENDIF
;;
;;                .IFDEF  ADPCM66
;;L_AdpcmTypeCh2:
;;                LDA     R_StatusCh2             ;toggle nibble flag
;;                EOR     #D_NibbleFlag
;;                STA     R_StatusCh2
;;                AND     #D_NibbleFlag
;;                BNE     L_NeedNewSampleCh2
;;                %IncSpeechDPTRCh2
;;                LDA     R_EncodedCh2
;;                ROR     A
;;                ROR     A
;;                ROR     A
;;                ROR     A
;;                AND     #%00000111
;;                ORA     R_QIndexCh2
;;                BCC     L_NotAdpcmEndCh2
;;                BNE     L_NotAdpcmEndCh2
;;                BCS     L_EndSpeechCh2
;;L_NeedNewSampleCh2:
;;                %ReadSpeechDataCh2
;;                ROR     A
;;                STA     R_EncodedCh2
;;L_ProcessAdpcmCh2:
;;                AND     #%00000111
;;                ORA     R_QIndexCh2
;;                BNE     L_NotAdpcmEndCh2
;;                BCS     L_EndSpeechCh2
;;L_NotAdpcmEndCh2:
;;                TAX
;;                LDA     T_NextStep,X
;;                STA     R_QIndexCh2
;;                LDA     T_SlopeTable,X
;;                BCC     L_AdpcmPlusCh2
;;                ;/* Milus
;;                EOR     #$FF
;;L_AdpcmPlusCh2:
;;                ADC     R_DacCh2
;;L_AdpcmExitCh2:
;;                STA     R_DacCh2        ;store decoded data
;;                STA     P_DacCh2
;;                JMP     L_ExitCh2
;;                .ENDIF
;;
;;                .IFDEF  ADPCM64
;;L_AdpcmTypeCh2:
;;                LDA     R_StatusCh2             ;toggle nibble flag
;;                EOR     #D_NibbleFlag
;;                STA     R_StatusCh2
;;                AND     #D_NibbleFlag
;;                BNE     L_NeedNewSampleCh2
;;                %IncSpeechDPTRCh2
;;                LDA     R_EncodedCh2
;;                ROR     A

⌨️ 快捷键说明

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