Skip to content

Commit

Permalink
added sid support, started sid header
Browse files Browse the repository at this point in the history
  • Loading branch information
Mu0n committed Dec 12, 2024
1 parent 0174cbc commit b995d79
Show file tree
Hide file tree
Showing 9 changed files with 13,402 additions and 13,525 deletions.
38 changes: 37 additions & 1 deletion midiTest/.builddir/midiTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,27 @@ uint8_t mainTempo = 120;
uint8_t mainTempoLUT[18];
bool isTwinLinked = false; //when true, sends out midi notes to both channels when using a midi controller or space bar

uint8_t sidLow[] = {
0x0c, 0x1c, 0x2d, 0x3f, 0x52, 0x66, 0x7b, 0x92, 0xaa, 0xc3, 0xde, 0xfa, // 0
0x18, 0x38, 0x5a, 0x7e, 0xa4, 0xcc, 0xf7, 0x24, 0x54, 0x86, 0xbc, 0xf5, // 1
0x31, 0x71, 0xb4, 0xfc, 0x48, 0x98, 0xed, 0x48, 0xa7, 0x0c, 0x78, 0xe9, // 2
0x62, 0xe2, 0x69, 0xf8, 0x90, 0x30, 0xdb, 0x8f, 0x4e, 0x19, 0xf0, 0xd3, // 3
0xc4, 0xc3, 0xd1, 0xf0, 0x1f, 0x61, 0xb6, 0x1e, 0x9d, 0x32, 0xdf, 0xa6, // 4
0x88, 0x86, 0xa3, 0xe0, 0x3f, 0xc2, 0x6b, 0x3d, 0x3a, 0x64, 0xbe, 0x4c, // 5
0x0f, 0x0c, 0x46, 0xbf, 0x7d, 0x84, 0xd6, 0x7a, 0x73, 0xc8, 0x7d, 0x97, // 6
0x1e, 0x18, 0x8b, 0x7f, 0xfb, 0x07, 0xac, 0xf4, 0xe7, 0x8f, 0xf9, 0x2f // 7
};

unsigned char sidHigh[] = {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // 0
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, // 1
0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x06, 0x07, 0x07, 0x07, // 2
0x08, 0x08, 0x09, 0x09, 0x0a, 0x0b, 0x0b, 0x0c, 0x0d, 0x0e, 0x0e, 0x0f, // 3
0x10, 0x11, 0x12, 0x13, 0x15, 0x16, 0x17, 0x19, 0x1a, 0x1c, 0x1d, 0x1f, // 4
0x21, 0x23, 0x25, 0x27, 0x2a, 0x2c, 0x2f, 0x32, 0x35, 0x38, 0x3b, 0x3f, // 5
0x43, 0x47, 0x4b, 0x4f, 0x54, 0x59, 0x5e, 0x64, 0x6a, 0x70, 0x77, 0x7e, // 6
0x86, 0x8e, 0x96, 0x9f, 0xa8, 0xb3, 0xbd, 0xc8, 0xd4, 0xe1, 0xee, 0xfd // 7
};

bool noteColors[88]={1,0,1, 1,0,1,0,1, 1,0,1,0,1,0,1, 1,0,1,0,1, 1,0,1,0,1,0,1, 1,0,1,0,1, 1,0,1,0,1,0,1, 1,0,1,0,1, 1,0,1,0,1,0,1, 1,0,1,0,1, 1,0,1,0,1,0,1, 1,0,1,0,1, 1,0,1,0,1,0,1, 1,0,1,0,1, 1,0,1,0,1,0,1, 1};

Expand Down Expand Up @@ -1253,9 +1274,21 @@ int main(int argc, char *argv[]) {
midiShutAChannel(9);
}
break;
case 115:

POKE(0xD400, sidLow[note-2]); // SET FREQUENCY FOR NOTE 1
POKE(0xD401, sidHigh[note-2]); // SET FREQUENCY FOR NOTE 1


POKE(0xD402, 0x44); // SET PULSE WAVE DUTY LOW BYTE
POKE(0xD403, 0x00); // SET PULSE WAVE DUTY HIGH BYTE
POKE(0xD405, 0x42); // SET ATTACK;DECAY
POKE(0xD406, 0x50); // SET SUSTAIN;RELEASE
POKE(0xD404, 0x11); // SET CONTROL VOICE 1 - pulse;gate
break;
}
//the following line can be used to get keyboard codes
//printf("\n %d",kernelEventData.key.raw);
printf("\n %d",kernelEventData.key.raw);
}
else if(kernelEventData.type == kernelEvent(key.RELEASED))
{
Expand All @@ -1267,6 +1300,9 @@ int main(int argc, char *argv[]) {
case 1: //shift modifier
shiftHit = false;
break;
case 115:
POKE(0xD404, 0x10); // SET CONTROL VOICE 1 - pulse;gate
break;
}
}
}
Expand Down
Binary file modified midiTest/.builddir/midiTest.elf
Binary file not shown.
26,467 changes: 13,125 additions & 13,342 deletions midiTest/.builddir/midiTest.lst

Large diffs are not rendered by default.

240 changes: 122 additions & 118 deletions midiTest/.builddir/midiTest.map

Large diffs are not rendered by default.

128 changes: 65 additions & 63 deletions midiTest/.builddir/midiTest.sym
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
00007a1f b _BITMAP_BASE.0
00007985 b _BITMAP_BASE.0
00000081 b _ZN12_GLOBAL__N_111initializedE
00004175 t _ZN12_GLOBAL__N_112print_stringEPKcP6Status
000040a4 t _ZN12_GLOBAL__N_13putEcP6Status
00004016 t _ZN12_GLOBAL__N_112print_stringEPKcP6Status
00003f45 t _ZN12_GLOBAL__N_13putEcP6Status
0000032e t _ZN12_GLOBAL__N_19FreeChunk6insertEPvj
00000084 b _ZN12_GLOBAL__N_19free_listE
00000082 b _ZN12_GLOBAL__N_19free_sizeE
00002000 A __BLOCK_SIZE
0000a000 A __SLOT_ADDR
0000032a T __after_main
00005137 t __ashlsi3
00004fd8 t __ashlsi3
0a00a000 A __block10_lma
0b00a000 A __block11_lma
0c00a000 A __block12_lma
Expand All @@ -25,35 +25,35 @@
1700a000 A __block23_lma
0800a000 A __block8_lma
0900a000 A __block9_lma
00007a70 B __bss_end
000079d6 B __bss_end
00000051 A __bss_size
00007a1f B __bss_start
00007985 B __bss_start
00000487 T __copy_zp_data
00007a1f R __data_end
00007a1f A __data_load_start
00007985 R __data_end
00007985 A __data_load_start
00000000 A __data_size
00007a1f R __data_start
00005df4 t __divsf3
00007985 R __data_start
00005c95 t __divsf3
00000324 T __do_copy_zp_data
00000316 T __do_init_stack
0000031e T __do_zero_bss
00000321 T __do_zero_zp_bss
00000300 A __f256_start
00006d43 T __fini_array_end
00006d43 T __fini_array_start
00006974 t __fixunssfsi
000069f0 t __floatunsisf
00006be4 T __fini_array_end
00006be4 T __fini_array_start
00006815 t __fixunssfsi
00006891 t __floatunsisf
00001000 W __heap_default_limit
00007a70 B __heap_start
00006d43 T __init_array_end
00006d43 T __init_array_start
0000514e t __lshrsi3
00005117 W __memset
00005222 t __muldi3
00005180 t __mulhi3
00005165 t __mulqi3
0000553c t __mulsf3
000051b2 t __mulsi3
000079d6 B __heap_start
00006be4 T __init_array_end
00006be4 T __init_array_start
00004fef t __lshrsi3
00004fb8 W __memset
000050c3 t __muldi3
00005021 t __mulhi3
00005006 t __mulqi3
000053dd t __mulsf3
00005053 t __mulsi3
00020000 A __palpiano_lma
000003fc A __palpiano_size
00028000 A __pia1_lma
Expand All @@ -62,7 +62,7 @@
00008000 A __pia2_size
00038000 A __pia3_lma
00002c00 A __pia3_size
00004092 t __putchar
00003f33 t __putchar
0000004f b __putchar.s
00000010 A __rc0
00000011 A __rc1
Expand Down Expand Up @@ -96,10 +96,10 @@
00000017 A __rc7
00000018 A __rc8
00000019 A __rc9
00006d43 R __set_v
00006be4 R __set_v
0000a000 A __stack
00005461 t __udivmodhi4
0000531a t __umodsi3
00005302 t __udivmodhi4
000051bb t __umodsi3
00000461 T __zero_bss
00000474 T __zero_zp_bss
00000040 A __zp_bss_size
Expand All @@ -114,42 +114,42 @@
0000004e b _row
00000316 T _start
00000066 b chSelect
00003d2e t channelTextMenu
00007a70 B end_block10
00007a70 B end_block11
00007a70 B end_block12
00007a70 B end_block13
00007a70 B end_block14
00007a70 B end_block15
00007a70 B end_block16
00007a70 B end_block17
00007a70 B end_block18
00007a70 B end_block19
00007a70 B end_block20
00007a70 B end_block21
00007a70 B end_block22
00007a70 B end_block23
00007a70 B end_block8
00007a70 B end_block9
00003bcf t channelTextMenu
000079d6 B end_block10
000079d6 B end_block11
000079d6 B end_block12
000079d6 B end_block13
000079d6 B end_block14
000079d6 B end_block15
000079d6 B end_block16
000079d6 B end_block17
000079d6 B end_block18
000079d6 B end_block19
000079d6 B end_block20
000079d6 B end_block21
000079d6 B end_block22
000079d6 B end_block23
000079d6 B end_block8
000079d6 B end_block9
000203fc R end_palpiano
00030000 R end_pia1
00038000 R end_pia2
0003ac00 R end_pia3
0000409f T exit
00003f40 T exit
0000049e t f256Init
00000844 t f256main
00003ef7 t highLightInstChoice
00003d98 t highLightInstChoice
00000067 b isTwinLinked
00007a6f b kernelError
000079d5 b kernelError
00000046 b kernelEventData
0000083e T main
00000045 d mainTempo
00000068 b mainTempoLUT
00004e3e t malloc
000050eb W memcpy
00007919 r midi_instruments
00004cdf t malloc
00004f8c W memcpy
0000787f r midi_instruments
00000031 d note
00006e94 r noteColors
00006df5 r noteColors
0000007d b oldCursorNote
0000007f b oldNote
000203fc R palpiano_end
Expand All @@ -160,20 +160,22 @@
00030000 R pia2_start
0003ac00 R pia3_end
00038000 R pia3_start
000036da t prepTempoLUT
0000357b t prepTempoLUT
00000052 b prgInst
00004282 t printf
00004e32 t putchar
00004123 t printf
00004cd3 t putchar
0000007c b refTimer.1
00003e08 t refreshBeatTextChoice
00003a11 t refreshInstrumentText
00003ca9 t refreshBeatTextChoice
000038b2 t refreshInstrumentText
00000051 b selectBeat
00006d95 r sidHigh
00006d35 r sidLow
0000007a b spaceNotetimer.1
0000007b b spaceNotetimer.2
00000033 d tempoLUTRef
00006e64 r textColors
00003522 t textPrint
00003fd7 t textPrintUInt
00003796 t textTitle
00007a23 b theBeats
0000373e t updateTempoText
00006d05 r textColors
000033c3 t textPrint
00003e78 t textPrintUInt
00003637 t textTitle
00007989 b theBeats
000035df t updateTempoText
Binary file modified midiTest/midiTest.pgz
Binary file not shown.
Binary file added midiTest/midiTest1-1.pgz
Binary file not shown.
38 changes: 37 additions & 1 deletion midiTest/src/midiTest.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,27 @@ uint8_t mainTempo = 120;
uint8_t mainTempoLUT[18];
bool isTwinLinked = false; //when true, sends out midi notes to both channels when using a midi controller or space bar

uint8_t sidLow[] = {
0x0c, 0x1c, 0x2d, 0x3f, 0x52, 0x66, 0x7b, 0x92, 0xaa, 0xc3, 0xde, 0xfa, // 0
0x18, 0x38, 0x5a, 0x7e, 0xa4, 0xcc, 0xf7, 0x24, 0x54, 0x86, 0xbc, 0xf5, // 1
0x31, 0x71, 0xb4, 0xfc, 0x48, 0x98, 0xed, 0x48, 0xa7, 0x0c, 0x78, 0xe9, // 2
0x62, 0xe2, 0x69, 0xf8, 0x90, 0x30, 0xdb, 0x8f, 0x4e, 0x19, 0xf0, 0xd3, // 3
0xc4, 0xc3, 0xd1, 0xf0, 0x1f, 0x61, 0xb6, 0x1e, 0x9d, 0x32, 0xdf, 0xa6, // 4
0x88, 0x86, 0xa3, 0xe0, 0x3f, 0xc2, 0x6b, 0x3d, 0x3a, 0x64, 0xbe, 0x4c, // 5
0x0f, 0x0c, 0x46, 0xbf, 0x7d, 0x84, 0xd6, 0x7a, 0x73, 0xc8, 0x7d, 0x97, // 6
0x1e, 0x18, 0x8b, 0x7f, 0xfb, 0x07, 0xac, 0xf4, 0xe7, 0x8f, 0xf9, 0x2f // 7
};

unsigned char sidHigh[] = {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, // 0
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, // 1
0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x06, 0x06, 0x07, 0x07, 0x07, // 2
0x08, 0x08, 0x09, 0x09, 0x0a, 0x0b, 0x0b, 0x0c, 0x0d, 0x0e, 0x0e, 0x0f, // 3
0x10, 0x11, 0x12, 0x13, 0x15, 0x16, 0x17, 0x19, 0x1a, 0x1c, 0x1d, 0x1f, // 4
0x21, 0x23, 0x25, 0x27, 0x2a, 0x2c, 0x2f, 0x32, 0x35, 0x38, 0x3b, 0x3f, // 5
0x43, 0x47, 0x4b, 0x4f, 0x54, 0x59, 0x5e, 0x64, 0x6a, 0x70, 0x77, 0x7e, // 6
0x86, 0x8e, 0x96, 0x9f, 0xa8, 0xb3, 0xbd, 0xc8, 0xd4, 0xe1, 0xee, 0xfd // 7
};

bool noteColors[88]={1,0,1, 1,0,1,0,1, 1,0,1,0,1,0,1, 1,0,1,0,1, 1,0,1,0,1,0,1, 1,0,1,0,1, 1,0,1,0,1,0,1, 1,0,1,0,1, 1,0,1,0,1,0,1, 1,0,1,0,1, 1,0,1,0,1,0,1, 1,0,1,0,1, 1,0,1,0,1,0,1, 1,0,1,0,1, 1,0,1,0,1,0,1, 1};

Expand Down Expand Up @@ -1251,9 +1272,21 @@ int main(int argc, char *argv[]) {
midiShutAChannel(9);
}
break;
case 115:

POKE(0xD400, sidLow[note-2]); // SET FREQUENCY FOR NOTE 1
POKE(0xD401, sidHigh[note-2]); // SET FREQUENCY FOR NOTE 1


POKE(0xD402, 0x44); // SET PULSE WAVE DUTY LOW BYTE
POKE(0xD403, 0x00); // SET PULSE WAVE DUTY HIGH BYTE
POKE(0xD405, 0x42); // SET ATTACK;DECAY
POKE(0xD406, 0x50); // SET SUSTAIN;RELEASE
POKE(0xD404, 0x11); // SET CONTROL VOICE 1 - pulse;gate
break;
}
//the following line can be used to get keyboard codes
//printf("\n %d",kernelEventData.key.raw);
printf("\n %d",kernelEventData.key.raw);
}
else if(kernelEventData.type == kernelEvent(key.RELEASED))
{
Expand All @@ -1265,6 +1298,9 @@ int main(int argc, char *argv[]) {
case 1: //shift modifier
shiftHit = false;
break;
case 115:
POKE(0xD404, 0x10); // SET CONTROL VOICE 1 - pulse;gate
break;
}
}
}
Expand Down
16 changes: 16 additions & 0 deletions midiTest/src/musid.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#ifndef MUSID_H
#define MUSID_H

#define SID1_VOC1 0xD400
#define SID1_VOC2 0xD407
#define SID1_VOC3 0xD40E

#define SID2_VOC1 0xD500
#define SID2_VOC2 0xD507
#define SID2_VOC3 0xD50E

#define

#include "f256lib.h"

#endif // MUSID_H

0 comments on commit b995d79

Please sign in to comment.