From fb5e9617a9b71d5b08bcbd3a3e3e3b20cb73f93a Mon Sep 17 00:00:00 2001 From: espes Date: Sun, 5 Apr 2015 21:39:30 -0700 Subject: [PATCH] adapted --- hw/xbox/dsp/dsp.c | 49 +++++++++------------------------------- hw/xbox/dsp/dsp.h | 5 +--- hw/xbox/dsp/dsp_cpu.c | 2 +- hw/xbox/dsp/dsp_cpu.h | 2 +- hw/xbox/dsp/dsp_disasm.c | 2 +- hw/xbox/dsp/dsp_disasm.h | 2 +- hw/xbox/dsp/dsp_int.h | 3 --- 7 files changed, 16 insertions(+), 49 deletions(-) diff --git a/hw/xbox/dsp/dsp.c b/hw/xbox/dsp/dsp.c index 2c3911f145..88d64748c2 100644 --- a/hw/xbox/dsp/dsp.c +++ b/hw/xbox/dsp/dsp.c @@ -1,7 +1,7 @@ /* DSP56300 emulation - Based on Hatari DSP M56001 emulation + Adapted from Hatari DSP M56001 emulation (C) 2001-2008 ARAnyM developer team Adaption to Hatari (C) 2008 by Thomas Huth @@ -38,16 +38,18 @@ static int32_t save_cycles; -static void dsp_trigger_host_interrupt(void) { - assert(false); -} +/*--- the DSP core itself ---*/ +dsp_core_t dsp_core; /** * Initialize the DSP emulation */ void dsp_init(void) { - dsp_core_init(dsp_trigger_host_interrupt); + DPRINTF("Dsp: init\n"); + + memset(&dsp_core, 0, sizeof(dsp_core_t)); + dsp56k_init_cpu(); save_cycles = 0; } @@ -58,7 +60,8 @@ void dsp_init(void) */ void dsp_uninit(void) { - dsp_core_shutdown(); + dsp_core.running = 0; + DPRINTF("Dsp: core shutdown\n"); } @@ -453,43 +456,13 @@ bool dsp_disasm_set_register(const char *arg, uint32_t value) - - - - - - - - - -/*--- the DSP core itself ---*/ -dsp_core_t dsp_core; - -static void (*dsp_host_interrupt)(void); /* Function to trigger host interrupt */ - -/* Init DSP emulation */ -void dsp_core_init(void (*host_interrupt)(void)) -{ - DPRINTF("Dsp: core init\n"); - - dsp_host_interrupt = host_interrupt; - memset(&dsp_core, 0, sizeof(dsp_core_t)); -} - -/* Shutdown DSP emulation */ -void dsp_core_shutdown(void) -{ - dsp_core.running = 0; - DPRINTF("Dsp: core shutdown\n"); -} - /* Reset */ void dsp_core_reset(void) { int i; DPRINTF("Dsp: core reset\n"); - dsp_core_shutdown(); + dsp_core.running = 0; /* Memory */ memset(dsp_core.periph, 0, sizeof(dsp_core.periph)); @@ -528,4 +501,4 @@ void dsp_core_reset(void) DPRINTF("Dsp: reset done\n"); dsp56k_init_cpu(); -} \ No newline at end of file +} diff --git a/hw/xbox/dsp/dsp.h b/hw/xbox/dsp/dsp.h index 384ba28acb..e6cfc80e2a 100644 --- a/hw/xbox/dsp/dsp.h +++ b/hw/xbox/dsp/dsp.h @@ -1,7 +1,7 @@ /* DSP56300 emulation - Based on Hatari DSP M56001 emulation + Adapted from Hatari DSP M56001 emulation (C) 2001-2008 ARAnyM developer team Adaption to Hatari (C) 2008 by Thomas Huth @@ -33,9 +33,6 @@ void dsp_uninit(void); void dsp_reset(void); void dsp_run(int nHostCycles); -/* Emulator call these to init/stop/reset DSP emulation */ -void dsp_core_init(void (*host_interrupt)(void)); -void dsp_core_shutdown(void); void dsp_core_reset(void); diff --git a/hw/xbox/dsp/dsp_cpu.c b/hw/xbox/dsp/dsp_cpu.c index 128b58d357..4d25b5da30 100644 --- a/hw/xbox/dsp/dsp_cpu.c +++ b/hw/xbox/dsp/dsp_cpu.c @@ -1,7 +1,7 @@ /* DSP56300 emulator - Based on Hatari DSP M56001 emulation + Adapted from Hatari DSP M56001 emulation (C) 2003-2008 ARAnyM developer team This program is free software; you can redistribute it and/or modify diff --git a/hw/xbox/dsp/dsp_cpu.h b/hw/xbox/dsp/dsp_cpu.h index 220462269a..151ae54db1 100644 --- a/hw/xbox/dsp/dsp_cpu.h +++ b/hw/xbox/dsp/dsp_cpu.h @@ -1,7 +1,7 @@ /* DSP56300 emulator - Based on Hatari DSP M56001 emulation + Adapted from Hatari DSP M56001 emulation (C) 2003-2008 ARAnyM developer team This program is free software; you can redistribute it and/or modify diff --git a/hw/xbox/dsp/dsp_disasm.c b/hw/xbox/dsp/dsp_disasm.c index 4970782391..81a6403dba 100644 --- a/hw/xbox/dsp/dsp_disasm.c +++ b/hw/xbox/dsp/dsp_disasm.c @@ -1,7 +1,7 @@ /* DSP56300 Disassembler - Based on Hatari DSP M56001 Disassembler + Adapted from Hatari DSP M56001 Disassembler (C) 2003-2008 ARAnyM developer team This program is free software; you can redistribute it and/or modify diff --git a/hw/xbox/dsp/dsp_disasm.h b/hw/xbox/dsp/dsp_disasm.h index 4a8085cac0..b764bd88ac 100644 --- a/hw/xbox/dsp/dsp_disasm.h +++ b/hw/xbox/dsp/dsp_disasm.h @@ -1,7 +1,7 @@ /* DSP56300 Disassembler - Based on Hatari DSP M56001 Disassembler + Adapted from Hatari DSP M56001 Disassembler (C) 2003-2008 ARAnyM developer team This program is free software; you can redistribute it and/or modify diff --git a/hw/xbox/dsp/dsp_int.h b/hw/xbox/dsp/dsp_int.h index 09276cf051..ffdd4cea72 100644 --- a/hw/xbox/dsp/dsp_int.h +++ b/hw/xbox/dsp/dsp_int.h @@ -93,9 +93,6 @@ #define DSP_PERIPH_BASE 0xFFFF80 #define DSP_PERIPH_SIZE 128 - - - #define DSP_INTERRUPT_NONE 0x0 #define DSP_INTERRUPT_DISABLED 0x1 #define DSP_INTERRUPT_LONG 0x2