acsim_mios_c
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
acsim_mios_c [2006/09/01 11:24] – added (not working, just-to-compile) MIOS_MIDI_Merger; updated MIOS_Bankstick zeichensprecher | acsim_mios_c [2007/11/17 16:46] (current) – move acsim.zip to "acsim" namespace smashtv | ||
---|---|---|---|
Line 3: | Line 3: | ||
[[acsim_console_h|ACSim_console.h]]\\ | [[acsim_console_h|ACSim_console.h]]\\ | ||
[[acsim_console_c|ACSim_console.c]]\\ | [[acsim_console_c|ACSim_console.c]]\\ | ||
- | |||
- | [[acsim_toolbox_h|ACSim_toolbox.h]]\\ | ||
- | [[acsim_toolbox_c|ACSim_toolbox.c]]\\ | ||
[[acsim_mios_h|ACSim_mios.h]]\\ | [[acsim_mios_h|ACSim_mios.h]]\\ | ||
**[[acsim_mios_c|ACSim_mios.c]]**\\ | **[[acsim_mios_c|ACSim_mios.c]]**\\ | ||
+ | [[acsim_toolbox_h|ACSim_toolbox.h]]\\ | ||
+ | [[acsim_toolbox_c|ACSim_toolbox.c]]\\ | ||
+ | [[acmididefines|ACMidiDefines.h]]\\ | ||
+ | \\ | ||
+ | This code is for viewing only and may not be up to date. You can download the files in a zip file {{acsim: | ||
+ | \\ | ||
\\ | \\ | ||
<code c> | <code c> | ||
/* | /* | ||
| | ||
- | | + | |
* | * | ||
| | ||
Line 30: | Line 33: | ||
* YOU ARE ALLOWED TO COPY AND CHANGE | * YOU ARE ALLOWED TO COPY AND CHANGE | ||
* BUT YOU MUST RELEASE THE SOURCE TOO (UNDER GNU GPL) IF YOU RELEASE YOUR PRODUCT | * BUT YOU MUST RELEASE THE SOURCE TOO (UNDER GNU GPL) IF YOU RELEASE YOUR PRODUCT | ||
- | * YOU ARE NOT ALLOWED | + | * YOU ARE NOT ALLOWED |
*/ | */ | ||
Line 36: | Line 39: | ||
#import < | #import < | ||
+ | #import " | ||
#import " | #import " | ||
- | |||
#import " | #import " | ||
Line 44: | Line 47: | ||
#pragma mark Globals | #pragma mark Globals | ||
// globals | // globals | ||
+ | debug_user_timer_t debug_user_timer; | ||
+ | |||
unsigned char debug_ain_lastPin; | unsigned char debug_ain_lastPin; | ||
unsigned int debug_ain_value[32]; | unsigned int debug_ain_value[32]; | ||
Line 49: | Line 54: | ||
unsigned char debug_din_value[32]; | unsigned char debug_din_value[32]; | ||
unsigned int debug_enc_value[32]; | unsigned int debug_enc_value[32]; | ||
+ | |||
+ | unsigned int debug_MIDI_byteNum = 0; | ||
+ | unsigned int debug_IIC_byteNum = 0; | ||
unsigned char debug_bankstick_ctrl = 0x00; // 1st Bankstick preselected | unsigned char debug_bankstick_ctrl = 0x00; // 1st Bankstick preselected | ||
Line 56: | Line 64: | ||
__PORTCbits_t PORTCbits; | __PORTCbits_t PORTCbits; | ||
__PORTDbits_t PORTDbits; | __PORTDbits_t PORTDbits; | ||
+ | __INTCONbits_t INTCONbits; | ||
mios_box_stat_t MIOS_BOX_STAT; | mios_box_stat_t MIOS_BOX_STAT; | ||
// HLP | // HLP | ||
Line 134: | Line 143: | ||
extern void MIOS_LCD_PrintBCD2(unsigned char v) { printf(" | extern void MIOS_LCD_PrintBCD2(unsigned char v) { printf(" | ||
extern void MIOS_LCD_PrintBCD3(unsigned char v) { printf(" | extern void MIOS_LCD_PrintBCD3(unsigned char v) { printf(" | ||
- | extern void MIOS_LCD_PrintBCD4(unsigned int v) { printf(" | + | extern void MIOS_LCD_PrintBCD4(unsigned int v) { printf(" |
- | extern void MIOS_LCD_PrintBCD5(unsigned int v) { printf(" | + | extern void MIOS_LCD_PrintBCD5(unsigned int v) { printf(" |
extern void MIOS_LCD_PrintChar(unsigned char c) { | extern void MIOS_LCD_PrintChar(unsigned char c) { | ||
switch(c) { | switch(c) { | ||
- | case 0x00: c = '_'; break; | + | case 0x00: printf(" |
- | case 0x01: c = '_'; break; | + | case 0x01: printf(" |
- | case 0x02: c = ' | + | case 0x02: printf(" |
- | case 0x03: c = '-'; break; | + | case 0x03: printf(" |
- | case 0x04: c = '-'; break; | + | case 0x04: printf(" |
- | case 0x05: c = '-'; break; | + | case 0x05: printf(" |
- | case 0x06: c = ' | + | case 0x06: printf(" |
- | case 0x07: c = ' | + | case 0x07: printf(" |
+ | default: | ||
+ | printf(" | ||
} | } | ||
- | printf(" | ||
} | } | ||
extern void MIOS_LCD_PrintHex1(unsigned char h) { printf(" | extern void MIOS_LCD_PrintHex1(unsigned char h) { printf(" | ||
Line 180: | Line 190: | ||
return 0; // no error | return 0; // no error | ||
} | } | ||
- | |||
- | |||
// MIOS_BANKSTICK | // MIOS_BANKSTICK | ||
Line 240: | Line 248: | ||
#pragma mark MIOS_MIDI | #pragma mark MIOS_MIDI | ||
// MIOS_MIDI | // MIOS_MIDI | ||
- | extern void MIOS_MIDI_BeginStream(void) { printf(" | + | extern void MIOS_MIDI_BeginStream(void) { |
- | extern void MIOS_MIDI_TxBufferPut(unsigned char b) { printf(" | + | printf(" |
+ | debug_MIDI_byteNum = 0; | ||
+ | } | ||
+ | extern void MIOS_MIDI_TxBufferPut(unsigned char b) { | ||
+ | unsigned char ch; | ||
+ | printf(" | ||
+ | debug_MIDI_byteNum++; | ||
+ | #if DEBUG_MIDI_VERBOSE | ||
+ | switch(debug_MIDI_byteNum) { | ||
+ | case 1: | ||
+ | // Channel Voice | ||
+ | ch = (b & 0x0f) + 1; | ||
+ | if( (b> | ||
+ | if( (b> | ||
+ | if( (b> | ||
+ | if( (b> | ||
+ | if( (b> | ||
+ | if( (b> | ||
+ | if( (b> | ||
+ | // System Common | ||
+ | if( (b==MIDI_SYSEX) ) { printf(" | ||
+ | if( (b==MIDI_TIMECODE) ) { printf(" | ||
+ | if( (b==MIDI_SONG_POSITION_POINTER) ) { printf(" | ||
+ | if( (b==MIDI_SONG_SELECT) ) { printf(" | ||
+ | if( (b==MIDI_TUNE_REQUEST) ) { printf(" | ||
+ | if( (b==MIDI_EOX) ) { printf(" | ||
+ | // System Realtime | ||
+ | if( (b==MIDI_CLOCK) ) { printf(" | ||
+ | if( (b==MIDI_START) ) { printf(" | ||
+ | if( (b==MIDI_CONTINUE) ) { printf(" | ||
+ | if( (b==MIDI_STOP) ) { printf(" | ||
+ | if( (b==MIDI_ACTIVE_SENSING) ) { printf(" | ||
+ | if( (b==MIDI_RESET) ) { printf(" | ||
+ | break; | ||
+ | case 2: | ||
+ | case 3: | ||
+ | printf(" | ||
+ | break; | ||
+ | } | ||
+ | // reset counter for System Realtime Bytes | ||
+ | if(b >= MIDI_CLOCK) { debug_MIDI_byteNum = 0; } | ||
+ | #endif | ||
+ | } | ||
extern void MIOS_MIDI_EndStream(void) { | extern void MIOS_MIDI_EndStream(void) { | ||
+ | debug_MIDI_byteNum = 0; | ||
printf(" | printf(" | ||
- | DISPLAY_Init(); | ||
} | } | ||
Line 268: | Line 318: | ||
| | ||
*/ | */ | ||
- | |||
#pragma mark MIOS_TIMER | #pragma mark MIOS_TIMER | ||
// MIOS_TIMER | // MIOS_TIMER | ||
- | extern void MIOS_TIMER_Init(unsigned char mode, unsigned int period) { return; } | + | extern void MIOS_TIMER_Init(unsigned char mode, unsigned int period) { |
+ | debug_user_timer.TIMER_ENABLED = TRUE; | ||
+ | return; | ||
+ | } | ||
extern void MIOS_TIMER_Start(void) { return; } | extern void MIOS_TIMER_Start(void) { return; } | ||
- | extern void MIOS_TIMER_Stop(void) { return; } | + | extern void MIOS_TIMER_Stop(void) { |
- | extern void MIOS_TIMER_ReInit(unsigned char mode, unsigned int period) { return; } | + | debug_user_timer.TIMER_ENABLED = FALSE; |
+ | return; | ||
+ | } | ||
+ | extern void MIOS_TIMER_ReInit(unsigned char mode, unsigned int period) { | ||
+ | MIOS_TIMER_Init(mode, | ||
+ | return; | ||
+ | } | ||
#pragma mark MIOS_IIC | #pragma mark MIOS_IIC | ||
// MIOS_IIC | // MIOS_IIC | ||
- | extern void MIOS_IIC_Start(void) { printf(" | + | extern void MIOS_IIC_Start(void) { |
- | extern void MIOS_IIC_Stop(void) { printf(" | + | debug_IIC_byteNum = 0; |
+ | printf(" | ||
+ | } | ||
+ | extern void MIOS_IIC_Stop(void) { | ||
+ | printf(" | ||
+ | } | ||
extern unsigned char MIOS_IIC_ByteSend(unsigned char b) { | extern unsigned char MIOS_IIC_ByteSend(unsigned char b) { | ||
- | printf(" | + | printf(" |
+ | #if DEBUG_SPEAKJET_VERBOSE | ||
+ | if(debug_IIC_byteNum == 1) { | ||
+ | // MSA controls | ||
+ | switch(b) { | ||
+ | case 0: case 1: case 2: case 3: case 4: case 5: case 6: printf(" | ||
+ | case 7: printf(" | ||
+ | case 8: printf(" | ||
+ | case 14: printf(" | ||
+ | case 15: printf(" | ||
+ | case 16: printf(" | ||
+ | case 20: printf(" | ||
+ | |||
+ | case 21: printf(" | ||
+ | case 22: printf(" | ||
+ | case 23: printf(" | ||
+ | case 24: printf(" | ||
+ | case 25: printf(" | ||
+ | case 26: printf(" | ||
+ | |||
+ | case 28: printf(" | ||
+ | case 29: printf(" | ||
+ | case 30: printf(" | ||
+ | case 31: printf(" | ||
+ | |||
+ | default: | ||
+ | if(b > 127) { | ||
+ | if(b < 200) { | ||
+ | printf(" | ||
+ | } else if(b < 255) { | ||
+ | printf(" | ||
+ | } else { | ||
+ | printf(" | ||
+ | } | ||
+ | } | ||
+ | break; | ||
+ | } | ||
+ | } | ||
+ | // SCP controls | ||
+ | switch(b) { | ||
+ | case SCP_ESCAPE: | ||
+ | case SCP_EXIT: | ||
+ | case SCP_READY: | ||
+ | case SCP_CLEAR_BUFFER: | ||
+ | case SCP_START: | ||
+ | case SCP_STOP: | ||
+ | case SCP_MEMTYPE: | ||
+ | case SCP_MEMADDR: | ||
+ | case SCP_MEMWRT: | ||
+ | case SCP_RESET: | ||
+ | } | ||
+ | #endif | ||
+ | debug_IIC_byteNum++; | ||
return 1; | return 1; | ||
} | } |
acsim_mios_c.1157109846.txt.gz · Last modified: 2006/10/15 09:35 (external edit)