diff --git a/m68k/handlers.c b/m68k/handlers.c new file mode 100644 index 0000000..831e190 --- /dev/null +++ b/m68k/handlers.c @@ -0,0 +1,14 @@ +void auto_vector_1(void) __attribute__ ((weak, interrupt_handler)); +void auto_vector_1(void) { return; } +void auto_vector_2(void) __attribute__ ((weak, interrupt_handler)); +void auto_vector_2(void) { return; } +void auto_vector_3(void) __attribute__ ((weak, interrupt_handler)); +void auto_vector_3(void) { return; } +void auto_vector_4(void) __attribute__ ((weak, interrupt_handler)); +void auto_vector_4(void) { return; } +void auto_vector_5(void) __attribute__ ((weak, interrupt_handler)); +void auto_vector_5(void) { return; } +void auto_vector_6(void) __attribute__ ((weak, interrupt_handler)); +void auto_vector_6(void) { return; } +void auto_vector_7(void) __attribute__ ((weak, interrupt_handler)); +void auto_vector_7(void) { return; } diff --git a/m68k/vectors.s b/m68k/vectors.s index 207cd3f..a225749 100644 --- a/m68k/vectors.s +++ b/m68k/vectors.s @@ -25,13 +25,13 @@ .long start /* reserved 22 */ .long start /* reserved 23 */ .long start /* Spurious interrupt */ - .long start /* Auto vector level 1 interrupt */ - .long start /* Auto vector level 2 interrupt */ - .long start /* Auto vector level 3 interrupt */ - .long start /* Auto vector level 4 interrupt */ - .long start /* Auto vector level 5 interrupt */ - .long start /* Auto vector level 6 interrupt */ - .long start /* Auto vector level 7 interrupt */ + .long auto_vector_1 /* Auto vector level 1 interrupt */ + .long auto_vector_2 /* Auto vector level 2 interrupt */ + .long auto_vector_3 /* Auto vector level 3 interrupt */ + .long auto_vector_4 /* Auto vector level 4 interrupt */ + .long auto_vector_5 /* Auto vector level 5 interrupt */ + .long auto_vector_6 /* Auto vector level 6 interrupt */ + .long auto_vector_7 /* Auto vector level 7 interrupt */ .long start /* Trap #0 vector */ .long start /* Trap #1 vector */ .long start /* Trap #2 vector */ @@ -64,4 +64,5 @@ .long start /* reserved 61 */ .long start /* reserved 62 */ .long start /* reserved 63 */ + .align 0x400, 0xee diff --git a/scsp.h b/scsp.h index a0ed924..4d7c04f 100644 --- a/scsp.h +++ b/scsp.h @@ -134,6 +134,31 @@ static_assert((offsetof (struct scsp, reg)) == 0x100000); // bits +enum interrupt_bits { + INT__SAMPLE = (1 << 10), + INT__MIDI_OUTPUT = (1 << 9), + INT__TIMER_C = (1 << 8), + INT__TIMER_B = (1 << 7), + INT__TIMER_A = (1 << 6), + INT__CPU = (1 << 5), + INT__DMA_TRANSFER_END = (1 << 4), + INT__MIDI_INPUT = (1 << 3), + INT__INT2N = (1 << 2), + INT__INT1N = (1 << 1), + INT__INT0N = (1 << 0), +}; + +enum scilv_bits { + SCILV__TIMER_B__TIMER_C__MIDI_OUT__1F = (1 << 7), + SCILV__TIMER_A = (1 << 6), + SCILV__CPU = (1 << 5), + SCILV__DMA_TRANSFER_END = (1 << 4), + SCILV__MIDI_IN = (1 << 3), + SCILV__INT2N = (1 << 2), + SCILV__INT1N = (1 << 1), + SCILV__INT0N = (1 << 0), +}; + enum loop_bits { LOOP__KYONEX = ( 1 << 12), // (KX) execute KEY_ON LOOP__KYONB = ( 1 << 11), // (KB) record KEY_ON, KEY_OFF @@ -193,8 +218,8 @@ enum mixer_bits { }; //enum pitch_bits { -#define PITCH__OCT(n) ((n) << 11) -#define PITCH__FNS(n) ((n) << 0 ) +#define PITCH__OCT(n) (((n) & 0xf) << 11) +#define PITCH__FNS(n) (((n) & 0x3ff) << 0 ) //}; enum scsp_bits {