- uint32 data = jaguar_wave_rom_32[i];
- data = ((data & 0xFF000000) >> 24) | ((data & 0x0000FF00) << 8)
- | ((data & 0x00FF0000) >> 8) | ((data & 0x000000FF) << 24);
- }*/
-// Why the need for an extra buffer to hold it, when it already exists in the form of wave_table???
-// Also, there was a memory leak, since it was never deallocated... (jerry_wave_rom)
-
- // Copy it to DSP RAM
-//WAS: memcpy(&jerry_ram_8[0xD000], jerry_wave_rom, 0x1000);
- memcpy(&jerry_ram_8[0xD000], wave_table, 0x1000);
+ DSPSetIRQLine(DSPIRQ_SSI, ASSERT_LINE); // This does the 'IRQ enabled' checking...
+ double usecs = (float)jerryI2SCycles * RISC_CYCLE_IN_USEC;
+ SetCallbackTime(JERRYI2SCallback, usecs);
+ }
+ else // JERRY is slave to external word clock
+ {
+//Note that 44100 Hz requires samples every 22.675737 usec.
+//When JERRY is slave to the word clock, we need to do interrupts either at 44.1K
+//sample rate or at a 88.2K sample rate (11.332... usec).
+/* // This is just a temporary kludge to see if the CD bus mastering works
+ // I.e., this is totally faked...!
+// The whole interrupt system is pretty much borked and is need of an overhaul.
+// What we need is a way of handling these interrupts when they happen instead of
+// scanline boundaries the way it is now.
+ jerry_i2s_interrupt_timer -= cycles;
+ if (jerry_i2s_interrupt_timer <= 0)
+ {
+//This is probably wrong as well (i.e., need to check enable lines)... !!! FIX !!! [DONE]
+ if (ButchIsReadyToSend())//Not sure this is right spot to check...
+ {
+// return GetWordFromButchSSI(offset, who);
+ SetSSIWordsXmittedFromButch();
+ DSPSetIRQLine(DSPIRQ_SSI, ASSERT_LINE);
+ }
+ jerry_i2s_interrupt_timer += 602;
+ }*/
+
+ if (ButchIsReadyToSend())//Not sure this is right spot to check...
+ {
+// return GetWordFromButchSSI(offset, who);
+ SetSSIWordsXmittedFromButch();
+ DSPSetIRQLine(DSPIRQ_SSI, ASSERT_LINE);
+ }
+
+ SetCallbackTime(JERRYI2SCallback, 22.675737);
+ }