Skip to content
shaw02 edited this page Sep 8, 2019 · 2 revisions

Function Reference: nsd_main_se()

Define

    void    __fastcall__    nsd_main_se(void );

Inputs

No inputs


Outputs

No outputs


Contents

This is main routine of sound driver for SE.
This function will play the SE.


Notes

  • User application can call this function nsd_main_se() as the alternative function of nsd_main().
  • If the se data is in another bank outside real memory area, User MUST allocate the se data to the real memory area with the bank change before call this function.
  • By using this nsd_main_se() and nsd_main_bgm() functions, you can place BGM and SE data in different banks.
        .import         _nsd_main_se
        .import         _nsd_main_bgm
.segment        "CODE"
NMI_Start:
        pha
        txa
        pha
        tya
        pha

        ; PPU Control code.
        ; 
        ; to do SHOULD write to VRAM during the vertical blanking period.
        ;       Usually, in first phase of NMI, screen controling are done.

        ; Bank change for SE. (Allocate the SE data to the real memory area.)
        lda     #SE_bank
        jsr     _bank_change            ;   bank_change(SE_bank);

        ; Play BGM & SE.
        jsr     _nsd_main_se            ;   nsd_main_se();

        ; Bank change for BGM. (Allocate the BGM data to the real memory area.)
        lda     #BGM_bank
        jsr     _bank_change            ;   bank_change(BGM_bank);

        ; Play BGM. 
        jsr     _nsd_main_bgm           ;   nsd_main_bgm();

        ; Restore the bank number.
        lda     #prog_bank
        jsr     _bank_change            ;   bank_change(prog_bank);

        pla
        tay
        pla
        tax
        pla
        rti
  • Home
  • Developer's Guide
  • Function reference
  • Structure reference
  • MML command reference
    • Setting command
    • Define Envelope pattern (E(){})
    • Define Patch pattern (P(){})
    • Define Delta PCM (DPCM{})
    • Define FDS carrer wave (FDSC(){})
    • Define FDS modulator wave (FDSM(){})
    • Define VRC7 voice (VRC7(){})
    • Define N16x voice (N163(){})
    • Define Sequence (BGM(){},SE(){},Sub(){})
      • Notes (a,b,c,d,e,f,g)
      • Rest (r,w)
      • Key shift (k)
      • Length (l)
      • Octave (o)
      • Quantize (q)
      • Sweep (s)
      • Tempo (t)
      • Volume (v)
      • Memory witer (y)
      • VRC7 register write (yV)
      • Detune (D,D%)
      • Envelop (E@,Ev,Em,En)
      • Pseudo echo (EC)
      • Pseudo echo buff control
      • SN5b Envelop Frequency (F)
      • Key signature (K{})
      • Scale (scale())
      • Jump (j)
      • Loop (L)
      • n16x channnel number (NC)
      • Portamento (P)
      • Portamento2 ({})
      • Relase control (Rm,R@,Rv)
      • Sub routine call (S)
      • SE call (SE)
      • Track (TR)
      • Call macro ($)
      • Define local macro ($$)
      • Set Instruments (@)
      • Set Patch (@P)
      • Set VRC7 user instruments (@V)
      • Set FDS carrer waveform (@FC)
      • Set FDS modulator wafevorm (@FM)
      • Set FDS modulator frequency (@FF)
      • Set FDS master volume (@FV)
      • Load n16x wafe vorm (@N)
      • Load n16x wafe vorm (@NL)
      • Set n16x sample length (@NS)
      • Relative volume ((,))
      • Relative octave (<,>,",')
      • Repeat type A ([,:,])
      • Repeat type B (|:,\,:|)
      • Tie (^)
      • Transpose (_,__)

Clone this wiki locally