diff --git a/plugin/ic1.cpp b/plugin/ic1.cpp index 2824ef7..81f31bd 100644 --- a/plugin/ic1.cpp +++ b/plugin/ic1.cpp @@ -955,56 +955,66 @@ // 06c3: 65 4e e0 NEIW $FF4E_midiStatusByte,$E0 // 06c6: 4e c7 JRE $078F // 06c8: 4f 8c JRE $0656 +// ------------------------------------------------- +// handle note on/off +// ------------------------------------------------- // 06ca: 01 3e LDAW $FF3E_midiParam1 -// 06cc: 27 17 GTI A,$17 -// 06ce: 4e 36 JRE $0706 -// 06d0: 37 6d LTI A,$6D -// 06d2: 4e 36 JRE $070A -// 06d4: 74 e0 be SUBW $FFBE_transpose -// 06d7: 1a MOV B,A +// 06cc: 27 17 GTI A,$17 // note < 24 +// 06ce: 4e 36 JRE $0706 // yes, add an octave +// 06d0: 37 6d LTI A,$6D // note < 109 +// 06d2: 4e 36 JRE $070A // yes, subtract an octave +// 06d4: 74 e0 be SUBW $FFBE_transpose // subtract the transpose amount +// 06d7: 1a MOV B,A // work out bitfield column // 06d8: 48 22 SLR B // 06da: 48 22 SLR B // 06dc: 48 22 SLR B -// 06de: 07 07 ANI A,$07 -// 06e0: 75 4e 90 EQIW $FF4E_midiStatusByte,$90 -// 06e3: d5 JR $06F9 -// 06e4: 74 6b 00 NEI C,$00 -// 06e7: d1 JR $06F9 -// 06e8: 34 08 00 LXI HL,$0008 -// 06eb: ac LDAX (HL+A) -// 06ec: 1b MOV C,A -// 06ed: 34 40 ff LXI HL,$FF40 -// 06f0: ad LDAX (HL+B) -// 06f1: 60 9b ORA A,C -// 06f3: bd STAX (HL+B) -// 06f4: 71 3f 01 MVIW $FF3F_midiByteCount,$01 -// 06f7: 4f 53 JRE $064C -// 06f9: 34 10 00 LXI HL,$0010 -// 06fc: ac LDAX (HL+A) -// 06fd: 1b MOV C,A -// 06fe: 34 40 ff LXI HL,$FF40 -// 0701: ad LDAX (HL+B) -// 0702: 60 8b ANA A,C -// 0704: bd STAX (HL+B) -// 0705: ee JR $06F4 -// 0706: 46 0c ADI A,$0C -// 0708: 4f c2 JRE $06CC -// 070a: 66 0c SUI A,$0C -// 070c: 4f c2 JRE $06D0 +// 06de: 07 07 ANI A,$07 // +// 06e0: 75 4e 90 EQIW $FF4E_midiStatusByte,$90 // current status is Note On? +// 06e3: d5 JR $06F9 // no, do Note Off +// 06e4: 74 6b 00 NEI C,$00 // velocity is 0? +// 06e7: d1 JR $06F9 // note off +// 06e8: 34 08 00 LXI HL,$0008 // bitfield lookup table +// 06eb: ac LDAX (HL+A) // get bit for lower 3 bits of note +// 06ec: 1b MOV C,A // store +// 06ed: 34 40 ff LXI HL,$FF40 // MIDI Note bitfield +// 06f0: ad LDAX (HL+B) // fetch the current value +// 06f1: 60 9b ORA A,C // OR it in +// 06f3: bd STAX (HL+B) // save it back +// 06f4: 71 3f 01 MVIW $FF3F_midiByteCount,$01 // expect next message to be two-byte +// 06f7: 4f 53 JRE $064C // jump back to return from interrupt +// 06f9: 34 10 00 LXI HL,$0010 // table for inverted bitmask +// 06fc: ac LDAX (HL+A) // get value +// 06fd: 1b MOV C,A // save +// 06fe: 34 40 ff LXI HL,$FF40 // MIDI note bitfield +// 0701: ad LDAX (HL+B) // load the appropriate column +// 0702: 60 8b ANA A,C // mask it off +// 0704: bd STAX (HL+B) // save it back +// 0705: ee JR $06F4 // return from interrupt +// 0706: 46 0c ADI A,$0C // add 12 to note +// 0708: 4f c2 JRE $06CC // jump back +// 070a: 66 0c SUI A,$0C // subtract 12 from note +// 070c: 4f c2 JRE $06D0 // jump back +// ------------------------------------------------------------------- +// handle +// ------------------------------------------------------------------- // 070e: 63 3e STAW $FF3E_midiParam1 // 0710: 4f 3a JRE $064C +// ------------------------------------------------------------------- +// handle Control Change message +// ------------------------------------------------------------------- +// responds to All Notes Off, Omni On/Off, Poly On, but not Mono On, apparently // 0712: 01 3e LDAW $FF3E_midiParam1 -// 0714: 27 7a GTI A,$7A -// 0716: 4e 35 JRE $074D -// 0718: 45 4f 40 ONIW $FF4F,$40 -// 071b: 4f d7 JRE $06F4 -// 071d: 67 7b NEI A,$7B -// 071f: 4e 51 JRE $0772 -// 0721: 47 02 ONI A,$02 +// 0714: 27 7a GTI A,$7A // greater than 122 = local off? +// 0716: 4e 35 JRE $074D // no, less +// 0718: 45 4f 40 ONIW $FF4F,$40 // flag +// 071b: 4f d7 JRE $06F4 // expect 2-byte message, return from interrupt +// 071d: 67 7b NEI A,$7B // skip if not equal to All Notes Off +// 071f: 4e 51 JRE $0772 +// 0721: 47 02 ONI A,$02 // bit 1 set? // 0723: c8 JR $072C -// 0724: 05 4f fd ANIW $FF4F,$FD -// 0727: 47 01 ONI A,$01 -// 0729: 4e 4d JRE $0778 +// 0724: 05 4f fd ANIW $FF4F,$FD // mask bit +// 0727: 47 01 ONI A,$01 // bit 0 set +// 0729: 4e 4d JRE $0778 // // 072b: c8 JR $0734 // 072c: 05 4f fe ANIW $FF4F,$FE // 072f: 47 01 ONI A,$01 @@ -1021,22 +1031,22 @@ // 0749: 52 DCR B // 074a: fd JR $0748 // 074b: 4f a7 JRE $06F4 -// 074d: 77 40 EQI A,$40 -// 074f: ce JR $075E -// 0750: 74 6b 00 NEI C,$00 +// 074d: 77 40 EQI A,$40 // is the message Sustain On/Off +// 074f: ce JR $075E // no +// 0750: 74 6b 00 NEI C,$00 // skip if value = 0 // 0753: c5 JR $0759 -// 0754: 15 b6 10 ORIW $FFB6,$10 +// 0754: 15 b6 10 ORIW $FFB6,$10 // sustain off // 0757: 4f 9b JRE $06F4 -// 0759: 15 b6 08 ORIW $FFB6,$08 -// 075c: 4f 96 JRE $06F4 -// 075e: 77 01 EQI A,$01 -// 0760: 4f 92 JRE $06F4 +// 0759: 15 b6 08 ORIW $FFB6,$08 // sustain on +// 075c: 4f 96 JRE $06F4 // set up 2-byte and return from interrupt +// 075e: 77 01 EQI A,$01 // is it modwheel +// 0760: 4f 92 JRE $06F4 // no, setup 2-byte and return from interrupt // 0762: 55 a8 20 OFFIW $FFA8_midiSwitch,$20 (MIDI Func1) -// 0765: c7 JR $076D -// 0766: 0b MOV A,C -// 0767: 17 80 ORI A,$80 -// 0769: 63 a2 STAW $FFA2 -// 076b: 4f 87 JRE $06F4 +// 0765: c7 JR $076D // midi function switch +// 0766: 0b MOV A,C // value into a +// 0767: 17 80 ORI A,$80 // OR with $80 +// 0769: 63 a2 STAW $FFA2 // store to Modwheel Amount +// 076b: 4f 87 JRE $06F4 // setup 2-byte, return from interrupt // 076d: 71 a2 80 MVIW $FFA2,$80 // 0770: 4f 82 JRE $06F4 // 0772: 5d 4f BIT 5,$FF4F