Sona 0.50 Source

Sona 0.50/src-z80/buildme.z80

    include "define.z80"                ; Registers, constants, etc.
    include "define_sonaop.z80"         ; Stream opcodes
    include "define_z80.z80"            ; Z80 opcodes
    include "macros.z80"                ; Useful macros
    
    di                                  ; Disable interrupts
    ld      sp, StackStart              ; Set up stack pointer
    jp      Init                        ; Jump to init routine
    nop                                 ; Padding to 08h
    
    include "rst.z80"                   ; RST routines (except OutputPcm)
    
    include "pcm_output.z80"            ; PCM output
    include "pcm_render.z80"            ; PCM buffering/mixing
    include "pcm_play.z80"              ; PCM key-on
    
    include "fm_init.z80"               ; FM initialization
    include "fm_key.z80"                ; FM key-on/off and set pitch
    include "fm_volume.z80"             ; FM-specific volume stuff
    include "fm_load.z80"               ; Loading FM instruments
    include "fm_ch3mode.z80"            ; FM ch3 mode setting
    include "fm_lfo.z80"                ; FM LFO and PMS/AMS stuff
    include "fm_pan.z80"                ; FM panning
    include "fm_regwrite.z80"           ; Direct FM register writes
    include "fm_restore.z80"            ; Restore FM channel
    include "fm_stop.z80"               ; Stopping FM channels
    include "fm_ssgeg.z80"              ; SSG-EG support
    
    include "psg_update.z80"            ; Updating PSG output
    include "psg_adsr.z80"              ; Updating PSG ADSR envelopes
    include "psg_key.z80"               ; PSG key-on/off and set pitch
    include "psg_volume.z80"            ; PSG-specific volume stuff
    include "psg_load.z80"              ; Loading PSG instruments
    include "psg_restore.z80"           ; Restore PSG channel
    include "psg_stop.z80"              ; Stopping PSG channels
    
    include "stream.z80"                ; Stream management
    include "stream_process.z80"        ; Stream parsing and processing
    include "stream_delay.z80"          ; Stream delay events
    include "stream_flow.z80"           ; Stream flow control
    include "stream_tempo.z80"          ; Stream speed control
    include "stream_pause.z80"          ; Pausing streams
    include "stream_stop.z80"           ; Stopping streams
    
    include "pitch_parse.z80"           ; Parsing pitch arguments
    include "pitch_math.z80"            ; Pitch-related math
    include "volume_parse.z80"          ; Parsing volume arguments
    
    include "vm.z80"                    ; Miscellaneous VM commands
    include "vm_alu.z80"                ; VM "ALU" commands (move,add,etc.)
    
    include "main.z80"                  ; Init and main loop
    include "memory_read.z80"           ; Accessing 68000 memory
    include "status.z80"                ; Update playback status flags
    include "instruments.z80"           ; Instruments list
    include "lock.z80"                  ; Channel locking
    include "data.z80"                  ; Driver state, tables, etc.
    
    ; The pointers below are not used by the driver proper, but rather so
    ; the 68000 can find the offsets to some internal state (intended for
    ; use by the tester program). It doesn't matter if they get stomped on,
    ; as the 68000 reads them off ROM instead.
    
    ds      $&1
    dw      PsgAdsr                     ; PSG ADSR state
    dw      BgmPsgVol                   ; PSG volume values
    dw      BgmFmVol                    ; FM volume values
    dw      PsgPitch                    ; PSG pitch values
    dw      BgmFmPitch                  ; FM pitch values