From d4a5299b2be928e088679d08c73a72adc4521027 Mon Sep 17 00:00:00 2001 From: Gordon JC Pearce Date: Wed, 18 Sep 2024 14:33:57 +0100 Subject: [PATCH] transpose loop --- plugin/calls.txt | 6 +- plugin/ic1.cpp | 431 ++++++++++++++++++++++++----------------------- 2 files changed, 221 insertions(+), 216 deletions(-) diff --git a/plugin/calls.txt b/plugin/calls.txt index 9e8825c..598b56a 100644 --- a/plugin/calls.txt +++ b/plugin/calls.txt @@ -1,6 +1,6 @@ 10 CALF $0D45 // look up digit value 1 CALF $085C // send "Zero DAC" to module board - 1 CALF $087E + 1 CALF $087E // save edited value and send to sysex and module 1 CALF $08E9 // send sysex header if manual pressed 1 CALF $0955 // send pitchbend to midi 1 CALF $097E // send modwheel to midi @@ -11,7 +11,7 @@ 1 CALF $0AAF // voice functions 1 CALF $0AF8 // voice functions 1 CALF $0B30 // voice functions - 1 CALF $0BA9 // send something to module board + 1 CALF $0BA9 // Sustain on/off 1 CALF $0BCC // adjusts switch values 1 CALF $0BDA // adjusts switch values 1 CALF $0BEB // adjusts switch values @@ -28,7 +28,7 @@ 2 CALF $09DC // add midi channel and send 2 CALF $09E6_setRunningStatus 2 CALF $0A0D // to do with note on flags - 2 CALF $0B55 // note on to module board + 2 CALF $0B55 // unison note on to module board 2 CALF $0C47 // manual mode middle bars 2 CALF $0CA7 // calculate address for patch data 2 CALF $0CF1 // transmit 8 bytes to module board diff --git a/plugin/ic1.cpp b/plugin/ic1.cpp index f55e29b..fbd73f8 100644 --- a/plugin/ic1.cpp +++ b/plugin/ic1.cpp @@ -93,142 +93,144 @@ // 0092: 7c 54 CALF $0C54 // 0094: 75 cd 10 EQIW $FFCD,$10 // 0097: fc JR $0094 -// 0098: 7b 81 CALF $0B81 +// 0098: 7b 81 CALF $0b81_clrVoiceTbl // 009a: 4e 71 JRE $010D // startup -// 009c: 69 0e MVI A,$0E -// 009e: 4d d0 MOV MM,A -// 00a0: 69 0e MVI A,$0E +// 009c: 69 0e MVI A,$0E // RAM on, 16kB mode, PF6-7 port mode +// 009e: 4d d0 MOV MM,A // set memory map +// 00a0: 69 0e MVI A,$0E // serial mode clock 24x prescale, RX and TX on // 00a2: 4d c9 MOV SMH,A -// 00a4: 69 4e MVI A,$4E -// 00a6: 4d ca MOV SML,A -// 00a8: 64 80 08 MVI ANM,$08 +// 00a4: 69 4e MVI A,$4E // 8n1 x16 clock +// 00a6: 4d ca MOV SML,A +// 00a8: 64 80 08 MVI ANM,$08 // select DAC 4-7, scan off, HF mode // 00ab: 68 ff MVI V,$FF // 00ad: 10 EXA -// 00ae: 68 ff MVI V,$FF -// 00b0: 04 ff ff LXI SP,$FFFF -// 00b3: 69 00 MVI A,$00 +// 00ae: 68 ff MVI V,$FF // vector pointer to RAM +// 00b0: 04 ff ff LXI SP,$FFFF // stack pointer +// 00b3: 69 00 MVI A,$00 // clear the RAM // 00b5: 34 00 ff LXI HL,$FF00 // 00b8: 3d STAX (HL+) // 00b9: 74 7f 00 EQI L,$00 // 00bc: fb JR $00B8 -// 00bd: 69 03 MVI A,$03 +// 00bd: 69 03 MVI A,$03 // port C serial on // 00bf: 4d d1 MOV MCC,A -// 00c1: 69 3a MVI A,$3A -// 00c3: 4d d4 MOV MC,A -// 00c5: 69 00 MVI A,$00 -// 00c7: 4d d3 MOV MB,A +// 00c1: 69 3a MVI A,$3A // IO bits +// 00c3: 4d d4 MOV MC,A +// 00c5: 69 00 MVI A,$00 +// 00c7: 4d d3 MOV MB,A // port B, F set to outputs and turned off // 00c9: 4d d7 MOV MF,A // 00cb: 4d c5 MOV PF,A // 00cd: 4d c1 MOV PB,A -// 00cf: 69 ff MVI A,$FF +// 00cf: 69 ff MVI A,$FF // port A set to input // 00d1: 4d d2 MOV MA,A -// 00d3: 71 bc 08 MVIW $FFBC,$08 -// 00d6: 7b 81 CALF $0B81 -// 00d8: 71 c8 42 MVIW $FFC8,$42 -// 00db: 24 ff 1f LXI DE,$1FFF -// 00de: 4a de MVIX DE,$DE -// 00e0: 4c c0 MOV A,PA +// 00d3: 71 bc 08 MVIW $FFBC,$08 // sustain flag? +// 00d6: 7b 81 CALF $0b81_clrVoiceTbl +// 00d8: 71 c8 42 MVIW $FFC8,$42 // Bank A Poly 2 +// 00db: 24 ff 1f LXI DE,$1FFF // enable keypad demux +// 00de: 4a de MVIX DE,$DE // enable IC9 column 6 for Transpose button +// 00e0: 4c c0 MOV A,PA // port A // 00e2: 63 a8 STAW $FFA8_midiSwitch -// 00e4: 07 01 ANI A,$01 -// 00e6: 63 b6 STAW $FFB6 -// 00e8: 4a dd MVIX DE,$DD +// 00e4: 07 01 ANI A,$01 // if Transpose was pressed... +// 00e6: 63 b6 STAW $FFB6 // set bit 0 of FFB6 +// 00e8: 4a dd MVIX DE,$DD // read slide switches // 00ea: 4c c0 MOV A,PA -// 00ec: 63 a7 STAW $FFA7 -// 00ee: 4a e8 MVIX DE,$E8 -// 00f0: 64 06 00 MVI MKH,$00 -// 00f3: aa EI -// 00f4: 75 cd 10 EQIW $FFCD,$10 +// 00ec: 63 a7 STAW $FFA7 // store +// 00ee: 4a e8 MVIX DE,$E8 // keyboard? +// 00f0: 64 06 00 MVI MKH,$00 // unmask ints +// 00f3: aa EI +// 00f4: 75 cd 10 EQIW $FFCD,$10 // wait for interrupt counter // 00f7: fc JR $00F4 -// 00f8: 71 b8 2a MVIW $FFB8,$2A -// 00fb: 7c 47 CALF $0C47 +// 00f8: 71 b8 2a MVIW $FFB8,$2A // switches1, 8' Square on Saw off Chorus Off +// 00fb: 7c 47 CALF $0C47_showManual // 00fd: 78 43 CALF $0843_sendOmniOffPoly -// 00ff: 71 ba 20 MVIW $FFBA,$20 -// 0102: 71 bb 01 MVIW $FFBB,$01 -// 0105: 58 b6 BIT 0,$FFB6 -// 0107: 71 ba 10 MVIW $FFBA,$10 -// 010a: 71 be 0c MVIW $FFBE_transpose,$0C -// 010d: 7b 9a CALF $0B9A -// 010f: 78 28 CALF $0828 -// 0111: 58 a8 BIT 0,$FFA8_midiSwitch +// 00ff: 71 ba 20 MVIW $FFBA_bank,$20 +// 0102: 71 bb 01 MVIW $FFBB_patch,$01 +// 0105: 58 b6 BIT 0,$FFB6 // test mode? +// 0107: 71 ba 10 MVIW $FFBA_bank,$10 // if not, set bank +// 010a: 71 be 0c MVIW $FFBE_transpose,$0C // default transpose is 12 +// 010d: 7b 9a CALF $0B9A_clrMidiBits // +// 010f: 78 28 CALF $0828_centreBend +// 0111: 58 a8 BIT 0,$FFA8_midiSwitch // if Transpose is pressed // 0113: c7 JR $011B -// 0114: 55 87 40 OFFIW $FF87,$40 +// 0114: 55 87 40 OFFIW $FF87,$40 // set if we've previously sent an all notes off message // 0117: c3 JR $011B -// 0118: 55 a8 08 OFFIW $FFA8_midiSwitch,$08 (MIDI Ch) -// 011b: 4e 75 JRE $0192 -// 011d: 7b 70 CALF $0B70_stopAllNotes -// 011f: 7b 9e CALF $0B9E -// 0121: 7b 81 CALF $0B81 -// 0123: 7d 33 CALF $0D33 -// 0125: 78 00 CALF $0800 -// 0127: 24 ff 1f LXI DE,$1FFF -// 012a: 34 50 ff LXI HL,$FF50 -// 012d: 6a e8 MVI B,$E8 +// 0118: 55 a8 08 OFFIW $FFA8_midiSwitch,$08 (MIDI Ch) // is MIDI Ch pressed? +// 011b: 4e 75 JRE $0192 // yes +// 011d: 7b 70 CALF $0B70_stopAllNotes +// 011f: 7b 9e CALF $0B9E_clrNoteBits +// 0121: 7b 81 CALF $0b81_clrVoiceTbl +// 0123: 7d 33 CALF $0D33_saveDigitPatt +// 0125: 78 00 CALF $0800_showTranspose +// 0127: 24 ff 1f LXI DE,$1FFF // select MUX +// 012a: 34 50 ff LXI HL,$FF50 // keypad bitfield +// 012d: 6a e8 MVI B,$E8 // first column // 012f: 0a MOV A,B -// 0130: 3a STAX (DE) +// 0130: 3a STAX (DE) // enable // 0131: 00 NOP // 0132: 00 NOP -// 0133: 4c c0 MOV A,PA -// 0135: 3b STAX (HL) +// 0133: 4c c0 MOV A,PA // read keyboard +// 0135: 3b STAX (HL) // save in bitfield // 0136: 0a MOV A,B // 0137: 17 10 ORI A,$10 -// 0139: 3a STAX (DE) -// 013a: 32 INX HL -// 013b: 42 INR B -// 013c: 48 0b SK HC -// 013e: f0 JR $012F -// 013f: 34 50 ff LXI HL,$FF50 -// 0142: 6a 07 MVI B,$07 -// 0144: 24 00 00 LXI DE,$0000 -// 0147: 2d LDAX (HL+) -// 0148: 67 00 NEI A,$00 -// 014a: ca JR $0155 -// 014b: 6b 07 MVI C,$07 -// 014d: 48 01 SLRC A -// 014f: c1 JR $0151 -// 0150: cb JR $015C -// 0151: 22 INX DE -// 0152: 53 DCR C -// 0153: f9 JR $014D -// 0154: c3 JR $0158 -// 0155: 74 45 08 ADI E,$08 -// 0158: 52 DCR B -// 0159: ed JR $0147 -// 015a: 4e 21 JRE $017D -// 015c: 0d MOV A,E -// 015d: 36 0c SUINB A,$0C -// 015f: 46 0c ADI A,$0C -// 0161: 37 25 LTI A,$25 -// 0163: 66 0c SUI A,$0C -// 0165: 37 19 LTI A,$19 -// 0167: 66 0c SUI A,$0C -// 0169: 63 be STAW $FFBE_transpose -// 016b: 77 0c EQI A,$0C -// 016d: c7 JR $0175 -// 016e: 01 c8 LDAW $FFC8 -// 0170: 07 fe ANI A,$FE -// 0172: 63 c8 STAW $FFC8 -// 0174: c6 JR $017B -// 0175: 01 c8 LDAW $FFC8 -// 0177: 17 01 ORI A,$01 -// 0179: 63 c8 STAW $FFC8 -// 017b: 78 00 CALF $0800 -// 017d: 24 ff 1f LXI DE,$1FFF +// 0139: 3a STAX (DE) // disable column +// 013a: 32 INX HL // next bitfield byte +// 013b: 42 INR B // next column +// 013c: 48 0b SK HC // rolled over first nybble? +// 013e: f0 JR $012F // no, go back again for the next +// 013f: 34 50 ff LXI HL,$FF50 // keypad bitfield +// 0142: 6a 07 MVI B,$07 // 8 bits +// 0144: 24 00 00 LXI DE,$0000 // +// 0147: 2d LDAX (HL+) // fetch bitmask +// 0148: 67 00 NEI A,$00 // if it's zero +// 014a: ca JR $0155 // skip past this +// 014b: 6b 07 MVI C,$07 // 8 bits +// 014d: 48 01 SLRC A // shift left skip if carry +// 014f: c1 JR $0151 // bit was zero +// 0150: cb JR $015C // bit was one +// 0151: 22 INX DE // bit was zero, increment DE +// 0152: 53 DCR C // count down bits +// 0153: f9 JR $014D // go back for the next bit +// 0154: c3 JR $0158 // jump ahead to next bitmask +// 0155: 74 45 08 ADI E,$08 // all bits were zero, increment DE by 8 +// 0158: 52 DCR B // count down bytes +// 0159: ed JR $0147 // go back for the next bitmask +// 015a: 4e 21 JRE $017D // jump ahead +// 015c: 0d MOV A,E // save E +// 015d: 36 0c SUINB A,$0C // less than 12? +// 015f: 46 0c ADI A,$0C // yes, add 12 +// 0161: 37 25 LTI A,$25 // less than 37? +// 0163: 66 0c SUI A,$0C // no, subtract 12 +// 0165: 37 19 LTI A,$19 // less than 25 +// 0167: 66 0c SUI A,$0C // no, subtract 12 +// 0169: 63 be STAW $FFBE_transpose // save transpose value +// 016b: 77 0c EQI A,$0C // if it's actually 12 +// 016d: c7 JR $0175 // it isn't +// 016e: 01 c8 LDAW $FFC8 // flags +// 0170: 07 fe ANI A,$FE // transpose off +// 0172: 63 c8 STAW $FFC8 // save it back +// 0174: c6 JR $017B // jump to display +// 0175: 01 c8 LDAW $FFC8 // flags +// 0177: 17 01 ORI A,$01 // transpose on +// 0179: 63 c8 STAW $FFC8 // save it +// 017b: 78 00 CALF $0800_showTranspose + + +// 017d: 24 ff 1f LXI DE,$1FFF // select keypad MUX // 0180: 69 de MVI A,$DE -// 0182: 3a STAX (DE) +// 0182: 3a STAX (DE) // column 6 // 0183: 00 NOP // 0184: 00 NOP -// 0185: 4c c0 MOV A,PA -// 0187: 47 01 ONI A,$01 -// 0189: c2 JR $018C -// 018a: 4f 9b JRE $0127 -// 018c: 7d 3c CALF $0D3C -// 018e: 78 28 CALF $0828 -// 0190: 7b 9a CALF $0B9A -// 0192: 01 cd LDAW $FFCD -// 0194: 07 10 ANI A,$10 -// 0196: 74 f8 bf EQAW $FFBF +// 0185: 4c c0 MOV A,PA // read it +// 0187: 47 01 ONI A,$01 // Transpose? +// 0189: c2 JR $018C // no +// 018a: 4f 9b JRE $0127 // yes, go back to continue transpose routine +// 018c: 7d 3c CALF $0D3C_rstrDigitPatt +// 018e: 78 28 CALF $0828_centreBend +// 0190: 7b 9a CALF $0B9A_clrMidiBits +// 0192: 01 cd LDAW $FFCD // some flag +// 0194: 07 10 ANI A,$10 // +// 0196: 74 f8 bf EQAW $FFBF // some flag // 0199: 71 c0 00 MVIW $FFC0_runningStatus,$00 // 019c: 63 bf STAW $FFBF // 019e: 24 ff 1f LXI DE,$1FFF @@ -289,7 +291,7 @@ // 0201: 52 DCR B // 0202: e8 JR $01EB // 0203: 65 d0 ff NEIW $FFD0,$FF -// 0206: 7b 9e CALF $0B9E +// 0206: 7b 9e CALF $0B9E_clrNoteBits // 0208: 24 ff 1f LXI DE,$1FFF // 020b: 34 a4 ff LXI HL,$FFA4 // 020e: 6a da MVI B,$DA @@ -320,15 +322,15 @@ // 0232: 5b a8 BIT 3,$FFA8_midiSwitch ; MIDI CH button // 0234: d1 JR $0246 // 0235: 78 43 CALF $0843_sendOmniOffPoly -// 0237: 7b 9a CALF $0B9A -// 0239: 78 28 CALF $0828 -// 023b: 7d 33 CALF $0D33 +// 0237: 7b 9a CALF $0B9A_clrMidiBits +// 0239: 78 28 CALF $0828_centreBend +// 023b: 7d 33 CALF $0D33_saveDigitPatt // 023d: 01 bd LDAW $FFBD_midiChannel -// 023f: 34 40 00 LXI HL,$0040 +// 023f: 34 40 00 LXI HL,$0040 // lookup table for numbers from " 1" to "16" // 0242: ac LDAX (HL+A) -// 0243: 7d 45 CALF $0D45_digitLookup +// 0243: 7d 45 CALF $0D45_digitLookup // get bit patterns // 0245: c2 JR $0248 -// 0246: 7d 3c CALF $0D3C +// 0246: 7d 3c CALF $0D3C_rstrDigitPatt // 0248: 5b a8 BIT 3,$FFA8_midiSwitch ; MIDI CH button // 024a: 4e 4f JRE $029B // 024c: 55 87 40 OFFIW $FF87,$40 @@ -359,13 +361,13 @@ // 027c: 07 c7 ANI A,$C7 // 027e: 60 9b ORA A,C // 0280: 63 c8 STAW $FFC8 -// 0282: 75 ba 10 EQIW $FFBA,$10 +// 0282: 75 ba 10 EQIW $FFBA_bank,$10 // 0285: cf JR $0295 // 0286: 59 cd BIT 1,$FFCD // 0288: c7 JR $0290 // 0289: 5f b6 BIT 7,$FFB6 // 028b: 69 30 MVI A,$30 -// 028d: 7b 55 CALF $0B55 +// 028d: 7b 55 CALF $0B55_noteOnUnison // 028f: c5 JR $0295 // 0290: 5f b6 BIT 7,$FFB6 // 0292: c2 JR $0295 @@ -378,13 +380,13 @@ // 02a1: 59 b5 BIT 1,$FFB5 // 02a3: c4 JR $02A8 // 02a4: 5c a9 BIT 4,$FFA9 -// 02a6: 7c 47 CALF $0C47 +// 02a6: 7c 47 CALF $0C47_showManual // 02a8: 5a af BIT 2,$FFAF // 02aa: 4e 20 JRE $02CC // 02ac: 5a a9 BIT 2,$FFA9 // 02ae: d0 JR $02BF -// 02af: 7d 33 CALF $0D33 -// 02b1: 05 b6 fb ANIW $FFB6,$FB +// 02af: 7d 33 CALF $0D33_saveDigitPatt +// 02b1: 05 b6 fb ANIW $FFB6,$FB // omni on/off? // 02b4: 64 4a 10 ONI PC,$10 // 02b7: cf JR $02C7 // 02b8: 69 00 MVI A,$00 @@ -392,8 +394,8 @@ // 02bc: 7d 45 CALF $0D45_digitLookup // 02be: cd JR $02CC // 02bf: 5a b6 BIT 2,$FFB6 -// 02c1: 7d 3c CALF $0D3C -// 02c3: 05 b6 fb ANIW $FFB6,$FB +// 02c1: 7d 3c CALF $0D3C_rstrDigitPatt +// 02c3: 05 b6 fb ANIW $FFB6,$FB // omni on/off? // 02c6: c5 JR $02CC // 02c7: 69 de MVI A,$DE // 02c9: 40 45 0d CALL $0D45_digitLookup @@ -413,8 +415,8 @@ // 02e5: 59 b6 BIT 1,$FFB6 // 02e7: 55 a9 04 OFFIW $FFA9,$04 // 02ea: d4 JR $02FF -// 02eb: 01 bb LDAW $FFBB -// 02ed: 74 98 ba ORAW $FFBA +// 02eb: 01 bb LDAW $FFBB_patch +// 02ed: 74 98 ba ORAW $FFBA_bank // 02f0: 1b MOV C,A // 02f1: 7c d0 CALF $0CD0 // 02f3: 7c 93 CALF $0C93 @@ -425,8 +427,8 @@ // 02ff: 45 b4 06 ONIW $FFB4,$06 // 0302: d3 JR $0316 // 0303: 7b 70 CALF $0B70_stopAllNotes -// 0305: 7b 9e CALF $0B9E -// 0307: 7b 81 CALF $0B81 +// 0305: 7b 9e CALF $0B9E_clrNoteBits +// 0307: 7b 81 CALF $0b81_clrVoiceTbl // 0309: 01 a8 LDAW $FFA8_midiSwitch // 030b: 07 06 ANI A,$06 ; Poly mode switches // 030d: 1b MOV C,A @@ -439,7 +441,7 @@ // 031b: 01 b1 LDAW $FFB1 // 031d: 7c 9d CALF $0C9D // 031f: 07 0f ANI A,$0F -// 0321: 63 bb STAW $FFBB +// 0321: 63 bb STAW $FFBB_patch // 0323: 5a a9 BIT 2,$FFA9 // 0325: 4e 20 JRE $0347 // 0327: 64 4a 10 ONI PC,$10 @@ -450,15 +452,15 @@ // 0331: 01 b9 LDAW $FFB9 // 0333: 07 f0 ANI A,$F0 // 0335: 1a MOV B,A -// 0336: 74 98 bb ORAW $FFBB +// 0336: 74 98 bb ORAW $FFBB_patch // 0339: 7d 45 CALF $0D45_digitLookup -// 033b: 01 bb LDAW $FFBB +// 033b: 01 bb LDAW $FFBB_patch // 033d: 63 b9 STAW $FFB9 // 033f: 74 2a 00 GTI B,$00 // 0342: d9 JR $035C // 0343: 7d 06 CALF $0D06 // 0345: 4e 5f JRE $03A6 -// 0347: 74 98 ba ORAW $FFBA +// 0347: 74 98 ba ORAW $FFBA_bank // 034a: 7d 45 CALF $0D45_digitLookup // 034c: 7c 3c CALF $0C3C // 034e: 7c d0 CALF $0CD0 @@ -475,7 +477,7 @@ // 0367: 48 25 SLL A // 0369: 48 25 SLL A // 036b: 48 25 SLL A -// 036d: 63 ba STAW $FFBA +// 036d: 63 ba STAW $FFBA_bank // 036f: 5a a9 BIT 2,$FFA9 // 0371: df JR $0391 // 0372: 64 4a 10 ONI PC,$10 @@ -486,15 +488,15 @@ // 037c: 01 b9 LDAW $FFB9 // 037e: 07 0f ANI A,$0F // 0380: 1a MOV B,A -// 0381: 74 98 ba ORAW $FFBA +// 0381: 74 98 ba ORAW $FFBA_bank // 0384: 7d 45 CALF $0D45_digitLookup -// 0386: 01 ba LDAW $FFBA +// 0386: 01 ba LDAW $FFBA_bank // 0388: 63 b9 STAW $FFB9 // 038a: 74 2a 00 GTI B,$00 // 038d: d8 JR $03A6 // 038e: 7d 06 CALF $0D06 // 0390: d5 JR $03A6 -// 0391: 74 98 bb ORAW $FFBB +// 0391: 74 98 bb ORAW $FFBB_patch // 0394: 7d 45 CALF $0D45_digitLookup // 0396: 7c 3c CALF $0C3C // 0398: 7c d0 CALF $0CD0 @@ -509,16 +511,16 @@ // 03ac: 59 b6 BIT 1,$FFB6 // 03ae: c6 JR $03B5 // 03af: 7c 3c CALF $0C3C -// 03b1: 01 bb LDAW $FFBB +// 03b1: 01 bb LDAW $FFBB_patch // 03b3: 1b MOV C,A // 03b4: cb JR $03C0 -// 03b5: 01 bb LDAW $FFBB +// 03b5: 01 bb LDAW $FFBB_patch // 03b7: 37 08 LTI A,$08 // 03b9: 69 00 MVI A,$00 // 03bb: 46 01 ADI A,$01 -// 03bd: 63 bb STAW $FFBB +// 03bd: 63 bb STAW $FFBB_patch // 03bf: 1b MOV C,A -// 03c0: 01 ba LDAW $FFBA +// 03c0: 01 ba LDAW $FFBA_bank // 03c2: 60 9b ORA A,C // 03c4: 7d 45 CALF $0D45_digitLookup // 03c6: 7c d0 CALF $0CD0 @@ -542,13 +544,13 @@ // 03eb: 1b MOV C,A // 03ec: 07 07 ANI A,$07 // 03ee: 41 INR A -// 03ef: 63 bb STAW $FFBB +// 03ef: 63 bb STAW $FFBB_patch // 03f1: 0b MOV A,C // 03f2: 07 38 ANI A,$38 // 03f4: 48 25 SLL A // 03f6: 46 10 ADI A,$10 -// 03f8: 63 ba STAW $FFBA -// 03fa: 74 98 bb ORAW $FFBB +// 03f8: 63 ba STAW $FFBA_bank +// 03fa: 74 98 bb ORAW $FFBB_patch // 03fd: 7d 45 CALF $0D45_digitLookup // 03ff: 7c 3c CALF $0C3C // 0401: 7c d0 CALF $0CD0 @@ -1134,8 +1136,8 @@ // 081e: ac LDAX (HL+A) // 081f: 7d 45 CALF $0D45_digitLookup // 0821: 78 43 CALF $0843_sendOmniOffPoly -// 0823: 7b 9a CALF $0B9A -// 0825: 78 28 CALF $0828 +// 0823: 7b 9a CALF $0B9A_clrMidiBits +// 0825: 78 28 CALF $0828_centreBend // 0827: b8 RET // centre bend to module board @@ -1197,53 +1199,54 @@ // 087c: 3b STAX (HL) // 087d: b8 RET - +// called with a value in C +// save edited value, send to module, and optionally send to sysex // 087e: 78 c3 CALF $08C3 -// 0880: 59 b6 BIT 1,$FFB6 +// 0880: 59 b6 BIT 1,$FFB6 // might be "patch changed" flag or something // 0882: 4e 23 JRE $08A7 -// 0884: 55 c5 10 OFFIW $FFC5_leftDigit,$10 -// 0887: df JR $08A7 -// 0888: b3 PUSH HL +// 0884: 55 c5 10 OFFIW $FFC5_leftDigit,$10 // if the decimal point is off skip +// 0887: df JR $08A7 // process notes +// 0888: b3 PUSH HL // save // 0889: b2 PUSH DE -// 088a: 6c ff MVI D,$FF -// 088c: 34 30 00 LXI HL,$0030 -// 088f: ad LDAX (HL+B) -// 0890: 1d MOV E,A -// 0891: 0b MOV A,C -// 0892: 3a STAX (DE) -// 0893: 69 fd MVI A,$FD // select module board -// 0895: 79 e8 CALF $09E8_sendToTx -// 0897: 0d MOV A,E +// 088a: 6c ff MVI D,$FF // upper byte of address in RAM +// 088c: 34 30 00 LXI HL,$0030 // lookup table in ROM, points to patchRam +// 088f: ad LDAX (HL+B) // address +// 0890: 1d MOV E,A // lower byte of address in RAM +// 0891: 0b MOV A,C +// 0892: 3a STAX (DE) // store +// 0893: 69 fd MVI A,$FD // select module board +// 0895: 79 e8 CALF $09E8_sendToTx // select module board +// 0897: 0d MOV A,E // parameter we looked up // 0898: 79 e8 CALF $09E8_sendToTx -// 089a: 0b MOV A,C +// 089a: 0b MOV A,C // value in C // 089b: 79 e8 CALF $09E8_sendToTx // 089d: 45 a8 30 ONIW $FFA8_midiSwitch,$30 (MIDI Func1+2) -// 08a0: 78 d6 CALF $08D6 -// 08a2: a2 POP DE +// 08a0: 78 d6 CALF $08D6 // if sysex is enabled send one value +// 08a2: a2 POP DE // restore // 08a3: a3 POP HL -// 08a4: 2a LDAX (DE) -// 08a5: 3b STAX (HL) -// 08a6: b8 RET -// 08a7: b3 PUSH HL +// 08a4: 2a LDAX (DE) // whatever HL and DE had here +// 08a5: 3b STAX (HL) // move from DE to HL +// 08a6: b8 RET +// 08a7: b3 PUSH HL // save // 08a8: b2 PUSH DE -// 08a9: 6c ff MVI D,$FF -// 08ab: 34 30 00 LXI HL,$0030 -// 08ae: ad LDAX (HL+B) -// 08af: 1d MOV E,A -// 08b0: 2a LDAX (DE) -// 08b1: 57 80 OFFI A,$80 -// 08b3: c9 JR $08BD -// 08b4: 09 MOV A,EAL -// 08b5: 37 10 LTI A,$10 -// 08b7: c3 JR $08BB -// 08b8: a2 POP DE +// 08a9: 6c ff MVI D,$FF // upper byte of address +// 08ab: 34 30 00 LXI HL,$0030 // lookup table for patchRam +// 08ae: ad LDAX (HL+B) // parameter in B +// 08af: 1d MOV E,A // DE now contains pointer to patchRam +// 08b0: 2a LDAX (DE) // a now contains value +// 08b1: 57 80 OFFI A,$80 // upper bit set +// 08b3: c9 JR $08BD // no +// 08b4: 09 MOV A,EAL // what's in EAL +// 08b5: 37 10 LTI A,$10 // less than 16 +// 08b7: c3 JR $08BB // no +// 08b8: a2 POP DE // restore and return // 08b9: a3 POP HL // 08ba: b8 RET -// 08bb: 7d 5b CALF $0D5B -// 08bd: 0b MOV A,C +// 08bb: 7d 5b CALF $0D5B // enable decimal points +// 08bd: 0b MOV A,C // set top bit of value // 08be: 17 80 ORI A,$80 -// 08c0: 3a STAX (DE) -// 08c1: 4f d0 JRE $0893 +// 08c0: 3a STAX (DE) // save it back +// 08c1: 4f d0 JRE $0893 // send to module board (which will get the real value from C) // unknown1 // 08c3: 2a LDAX (DE) @@ -1323,10 +1326,10 @@ // 0935: b8 RET // calculate patch number for MIDI -// 0936: 01 bb LDAW $FFBB +// 0936: 01 bb LDAW $FFBB_patch // 0938: 51 DCR A // 0939: 1b MOV C,A -// 093a: 01 ba LDAW $FFBA +// 093a: 01 ba LDAW $FFBA_bank // 093c: 66 10 SUI A,$10 // 093e: 48 21 SLR A // 0940: 60 9b ORA A,C @@ -1506,7 +1509,7 @@ // 0a41: ca JR $0A4C // 0a42: 75 d0 00 EQIW $FFD0,$00 // 0a45: da JR $0A60 -// 0a46: 7b 55 CALF $0B55 +// 0a46: 7b 55 CALF $0B55_noteOnUnison // 0a48: 71 d0 80 MVIW $FFD0,$80 // 0a4b: d4 JR $0A60 // 0a4c: 7a af CALF $0AAF @@ -1714,23 +1717,24 @@ // 0b53: a3 POP HL // 0b54: b8 RET -// send note on to module board -// 0b55: b3 PUSH HL +// send unison note on to module board +// note in A +// 0b55: b3 PUSH HL // save // 0b56: b1 PUSH BC // 0b57: 74 c0 be ADDW $FFBE_transpose // 0b5a: 1b MOV C,A -// 0b5b: 6a 05 MVI B,$05 -// 0b5d: 34 88 ff LXI HL,$FF88 +// 0b5b: 6a 05 MVI B,$05 // six voices +// 0b5d: 34 88 ff LXI HL,$FF88 // note table // 0b60: 69 fd MVI A,$FD // select module board // 0b62: 79 e8 CALF $09E8_sendToTx -// 0b64: 0f MOV A,L +// 0b64: 0f MOV A,L // voice on // 0b65: 79 e8 CALF $09E8_sendToTx -// 0b67: 0b MOV A,C +// 0b67: 0b MOV A,C // note // 0b68: 79 e8 CALF $09E8_sendToTx -// 0b6a: 32 INX HL -// 0b6b: 52 DCR B -// 0b6c: f7 JR $0B64 -// 0b6d: a1 POP BC +// 0b6a: 32 INX HL // next voice +// 0b6b: 52 DCR B // count down +// 0b6c: f7 JR $0B64 // loop around for the rest +// 0b6d: a1 POP BC // restore and return // 0b6e: a3 POP HL // 0b6f: b8 RET @@ -1748,21 +1752,21 @@ // 0b7f: a1 POP BC // 0b80: b8 RET -// something to do with voice allocation -// 0b81: 34 88 ff LXI HL,$FF88 +// set up new voice allocation table +// 0b81: 34 88 ff LXI HL,$FF88 // $FF88 to $FF8D contains $80 // 0b84: 6a 05 MVI B,$05 // 0b86: 69 80 MVI A,$80 // 0b88: 3d STAX (HL+) // 0b89: 52 DCR B // 0b8a: fd JR $0B88 -// 0b8b: 34 80 ff LXI HL,$FF80 +// 0b8b: 34 80 ff LXI HL,$FF80 // $FF80 to $FF05 contains $88 to $8D // 0b8e: 6a 05 MVI B,$05 // 0b90: 69 88 MVI A,$88 // 0b92: 3d STAX (HL+) // 0b93: 41 INR A // 0b94: 52 DCR B // 0b95: fc JR $0B92 -// 0b96: 71 86 88 MVIW $FF86,$88 +// 0b96: 71 86 88 MVIW $FF86,$88 // finally $FF86 contains $88, first voice // 0b99: b8 RET // clear MIDI on bits @@ -1778,28 +1782,29 @@ // 0ba7: fd JR $0BA5 // 0ba8: b8 RET -// sends stuff to module board +// Send sustain on/off to module board +// called with bit 3 in C set for on and cleared for off // 0ba9: 69 fd MVI A,$FD // select module board // select module board // 0bab: 79 e8 CALF $09E8_sendToTx // 0bad: 0b MOV A,C // 0bae: 47 08 ONI A,$08 -// 0bb0: 69 86 MVI A,$86 -// 0bb2: 69 87 MVI A,$87 -// 0bb4: 79 e8 CALF $09E8_sendToTx +// 0bb0: 69 86 MVI A,$86 // module sustain on +// 0bb2: 69 87 MVI A,$87 // module sustain off +// 0bb4: 79 e8 CALF $09E8_sendToTx // send to module // 0bb6: 69 f9 MVI A,$F9 -// 0bb8: 79 e8 CALF $09E8_sendToTx -// 0bba: 69 b0 MVI A,$B0 -// 0bbc: 79 d5 CALF $09D5 -// 0bbe: 69 40 MVI A,$40 -// 0bc0: 79 e8 CALF $09E8_sendToTx -// 0bc2: 0b MOV A,C +// 0bb8: 79 e8 CALF $09E8_sendToTx // select MIDI +// 0bba: 69 b0 MVI A,$B0 // control change +// 0bbc: 79 d5 CALF $09D5 // send, zero out running status +// 0bbe: 69 40 MVI A,$40 // Sustain CC +// 0bc0: 79 e8 CALF $09E8_sendToTx // send +// 0bc2: 0b MOV A,C // get value again // 0bc3: 47 08 ONI A,$08 -// 0bc5: 69 7f MVI A,$7F -// 0bc7: 69 00 MVI A,$00 -// 0bc9: 79 e8 CALF $09E8_sendToTx +// 0bc5: 69 7f MVI A,$7F // max +// 0bc7: 69 00 MVI A,$00 // min +// 0bc9: 79 e8 CALF $09E8_sendToTx // send // 0bcb: b8 RET -// switches values? +// range switches // 0bcc: 01 b2 LDAW $FFB2 // 0bce: 07 07 ANI A,$07 // 0bd0: 1a MOV B,A @@ -1809,7 +1814,7 @@ // 0bd7: 63 8e STAW $FF8E_switches1 // 0bd9: b8 RET -// switches values +// osc switches // 0bda: 01 b2 LDAW $FFB2 // 0bdc: 74 90 8e XRAW $FF8E_switches1 // 0bdf: 07 18 ANI A,$18 @@ -1820,7 +1825,7 @@ // 0be8: 63 8e STAW $FF8E_switches1 // 0bea: b8 RET -// switches values +// range and osc switches // 0beb: 01 b2 LDAW $FFB2 // 0bed: 07 e0 ANI A,$E0 // 0bef: 1a MOV B,A @@ -1950,10 +1955,10 @@ // 0cae: 46 70 ADI A,$70 // 0cb0: 1f MOV L,A // address is now $0f80 to $fd0 // 0cb1: dd JR $0CCF // return -// 0cb2: 01 bb LDAW $FFBB // patch digit? +// 0cb2: 01 bb LDAW $FFBB_patch // patch digit? // 0cb4: 51 DCR A // -1 // 0cb5: 1b MOV C,A // save -// 0cb6: 01 ba LDAW $FFBA // bank digit +// 0cb6: 01 ba LDAW $FFBA_bank // bank digit // 0cb8: 66 10 SUI A,$10 // -16 // 0cba: 48 21 SLR A // double it // 0cbc: 60 9b ORA A,C // OR in patch digit