// Originally by David Raingeard
// GCC/SDL port by Niels Wagenaar (Linux/WIN32) and Caz (BeOS)
// Extensive cleanups/rewrites by James L. Hammons
+// (C) 2010 Underground Software
+//
+// JLH = James L. Hammons <jlhamm@acm.org>
+//
+// Who When What
+// --- ---------- -------------------------------------------------------------
+// JLH 01/16/2010 Created this log ;-)
//
#include "dsp.h"
#include "jerry.h"
#include "log.h"
#include "m68k.h"
-#include "memory.h"
+//#include "memory.h"
//#define DSP_DEBUG
//#define DSP_DEBUG_IRQ
{
// Allocate the mirror table
if (!mirror_table)
- mirror_table = (uint16 *)memory_malloc(65536 * sizeof(uint16), "DSP mirror table");
+ mirror_table = (uint16 *)malloc(65536 * sizeof(uint16));
// Fill in the mirror table
if (mirror_table)
if (!dsp_branch_condition_table)
{
- dsp_branch_condition_table = (uint8 *)memory_malloc(32 * 8 * sizeof(uint8), "DSP branch condition table");
+ dsp_branch_condition_table = (uint8 *)malloc(32 * 8 * sizeof(uint8));
// Fill in the condition table
if (dsp_branch_condition_table)
WriteLog("DSP: DSP -> CPU interrupt\n");
#endif
// This was WRONG
-// Why do we check for a valid handler at 64? Isn't that the Jag programmer's responsibility?
+// Why do we check for a valid handler at 64? Isn't that the Jag programmer's responsibility? (YES)
+#warning "!!! DSP IRQs that go to the 68K have to be routed thru TOM !!! FIX !!!"
if (JERRYIRQEnabled(IRQ2_DSP))// && jaguar_interrupt_handler_is_valid(64))
{
JERRYSetPendingIRQ(IRQ2_DSP);
DSPReleaseTimeslice();
- m68k_set_irq(7); // Set 68000 NMI...
+ m68k_set_irq(2); // Set 68000 IPL 2...
}
data &= ~CPUINT;
}
// memory_free(dsp_ram_8);
// memory_free(dsp_reg_bank_0);
// memory_free(dsp_reg_bank_1);
+ if (dsp_branch_condition_table)
+ free(dsp_branch_condition_table);
+
+ if (mirror_table)
+ free(mirror_table);
}