** ** PattEditClassAsm.asm ** ** Copyright (C) 1995,96 Bernardo Innocenti ** ** Pattern Editor gadget assembler subroutines ** INCDIR Include: SECTION __merged,code include libraries/SongClass.i xdef _Note2ASCIIBlank0 xdef _Note2ASCII * void Note2ASCIIBlank0 (UBYTE *s, struct Note *note) * A1 A2 * * Fill the buffer pointed by A1 with the ASCII representation of the * Note structure pointed by A2. The buffer will be able to hold at * least TrackChars> characters. _Note2ASCIIBlank0: move.w d2,-(sp) moveq #0,d1 moveq #0,d2 lea TextNotes(pc),a0 move.b note_Note(a2),d1 ; note_Note add.w d1,d1 add.w d1,d1 move.l (a0,d1.w),d0 move.b note_Inst(a2),d1 lea HexValuesNo0(pc),a0 move.b d1,d2 lsr.b #4,d2 move.b (a0,d2.w),d0 move.l d0,(a1)+ ; Put Note and Instrument high nibble tst.b d1 beq.s .noinst and.w #$0F,d1 lea HexValues(pc),a0 move.b (a0,d1),d1 lsl.w #8,d1 move.b #' ',d1 move.w d1,(a1)+ ; Put Instrument low nibble and white space bra.s .endif .noinst move.w #'- ',(a1)+ ; Put Instrument low nibble and white space .endif moveq #0,d0 lea HexValues(pc),a0 move.b note_EffNum(a2),d0 move.b note_EffVal(a2),d1 move.b d1,d2 sub.b d0,d1 beq.s .noeff moveq #0,d1 move.b (a0,d0.w),d0 move.b d2,d1 lsl.w #8,d0 lsr.b #4,d1 move.b (a0,d1.w),d0 move.w d0,(a1)+ ;Put EffNum and EffVal high nibble and.w #$F,d2 move.b (a0,d2.w),d2 lsl.w #8,d2 move.b #' ',d2 move.w d2,(a1)+ ; Put EffVal low nibble and space move.w (sp)+,d2 rts move.w (sp)+,d2 rts .noeff move.l #' . ',(a1)+ ; Put white spaces move.w (sp)+,d2 rts * void Note2ASCII (UBYTE *s, struct Note *note) * A1 A2 * * Fill the buffer pointed by A1 with the ASCII representation of the * Note structure pointed by A2. The buffer will be able to hold at * least TrackChars> characters. _Note2ASCII: moveq #0,d0 move.b note_Note(a2),d0 ; note_Note beq.s .nonote lea TextNotes(pc),a0 add.w d0,d0 add.w d0,d0 move.l (a0,d0.w),(a1) ; Put Note bra.s .endif .nonote move.l #'--- ',(a1) .endif lea 3(a1),a1 move.b note_Inst(a2),d0 moveq #0,d1 move.b d0,d1 lea HexValuesNo0(pc),a0 lsr.b #4,d1 move.b (a0,d1),(a1)+ ; Put Instrument high nibble and.w #$0F,d0 lea HexValues(pc),a0 move.b (a0,d0),(a1)+ ; Put Instrument low nibble move.b #' ',(a1)+ ; Put white space move.w d2,-(sp) moveq #0,d0 lea HexValues(pc),a0 move.b note_EffNum(a2),d0 move.b note_EffVal(a2),d1 move.b d1,d2 move.b (a0,d0.w),d0 move.b d2,d1 lsl.w #8,d0 lsr.b #4,d1 move.b (a0,d1.w),d0 move.w d0,(a1)+ ;Put EffNum and EffVal high nibble and.w #$F,d2 move.b (a0,d2.w),d2 lsl.w #8,d2 move.b #' ',d2 move.w d2,(a1)+ ; Put EffVal low nibble and space move.w (sp)+,d2 rts CNOP 0,4 TextNotes: dc.l ' - ' dc.l 'C-0 ', 'C#0 ', 'D-0 ', 'D#0 ', 'E-0 ', 'F-0 ' dc.l 'F#0 ', 'G-0 ', 'G#0 ', 'A-0 ', 'A#0 ', 'B-0 ' dc.l 'C-1 ', 'C#1 ', 'D-1 ', 'D#1 ', 'E-1 ', 'F-1 ' dc.l 'F#1 ', 'G-1 ', 'G#1 ', 'A-1 ', 'A#1 ', 'B-1 ' dc.l 'C-2 ', 'C#2 ', 'D-2 ', 'D#2 ', 'E-2 ', 'F-2 ' dc.l 'F#2 ', 'G-2 ', 'G#2 ', 'A-2 ', 'A#2 ', 'B-2 ' dc.l 'C-3 ', 'C#3 ', 'D-3 ', 'D#3 ', 'E-3 ', 'F-3 ' dc.l 'F#3 ', 'G-3 ', 'G#3 ', 'A-3 ', 'A#3 ', 'B-3 ' dc.l 'C-4 ', 'C#4 ', 'D-4 ', 'D#4 ', 'E-4 ', 'F-4 ' dc.l 'F#4 ', 'G-4 ', 'G#4 ', 'A-4 ', 'A#4 ', 'B-4 ' dc.l 'C-5 ', 'C#5 ', 'D-5 ', 'D#5 ', 'E-5 ', 'F-5 ' dc.l 'F#5 ', 'G-5 ', 'G#5 ', 'A-5 ', 'A#5 ', 'B-5 ' HexValues: dc.b '0','1','2','3','4','5','6','7','8','9' dc.b 'A','B','C','D','E','F','G','H','I','J' HexValuesNo0: dc.b ' ','1','2','3','4','5','6','7','8','9' dc.b 'A','B','C','D','E','F'