===== TinyMidi Source Code: ===== ;--------------------------------------------- ;TinyMIDI (c) GRG/SHAPE 2007 ;--------------------------------------------- ;This program was made for the Sequential (SCI) Interface. ;It will play the notes you press on your midi keyboard ;with the sid chip. _MIDIReset = %00000011 ;Same for all interfaces _MIDI16CountDiv = %00010101 ;1mhz interfaces: 16 divider _MIDI64CountDIv = %00010110 ;2mhz interfaces: 64 divider _IRQMIDI16 = %10010101 ;1mhz interfaces: IRQ enabled _IRQMIDI64 = %10010110 ;2mhz interfaces: IRQ enabled ;Sequential registers MIDI_ControlReg = $de00 MIDI_StatusReg = $de02 MIDI_Tx = $de01 MIDI_Rx = $de03 ;Adjust hardrestart to 2 for Attack Values 1-F. HARDRESTART = 1 ;1 or 2 buffnotes = $2000 ;All MIDI notes are buffered here * = $0801 .byte $0b,$08,$d7,$07 .byte $9e .text "2061" .byte 0,0,0 lda #message jsr $ab1e sei lda #$35 sta $01 lda #$03 sta MIDI_ControlReg ;Reset Midi interface lda #$95 sta MIDI_ControlReg ;Enable Midi IRQ & Clock 16 jsr init_soundplayer lda #hwirq sta $0315 lda #irq sta $ffff lda #nmi sta $fffb sta $0319 lda #$01 ;Irq on sta $d01a lda #$fb sta $d012 lda $d011 and #$7f sta $d011 lda #$7f sta $dc0d bit $dc0d cli keyloop inc $01 ;36 jsr $ffe4 dec $01 ;35 cmp #0 beq keyloop jmp keyloop midinote .byte 0 ;0-127 ncount .byte 0 ;max 127 (max keys on keyboard) countby .byte 0 ;count bytes in buffer (0-255) mibcount .byte 0 ;Midi byte count (0-255) ;--------------------------------------------------- *= (*+$ff)&$ff00 ;Start the following code on a page ;--------------------------------------------------- ;MIDI IRQ: i80_noteoff1 sta midinote lda #