From 45feea42c2fa1b95f2b40ddc6c3314c0fe8318f9 Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Mon, 17 Aug 2009 00:20:04 +0000 Subject: [PATCH] dsp lle: coef is really 0x800 words dspspy: fill the whole iram! crazy thing, normally likes len%4=0, however to fill the whole iram you use 8191 instead of 8192... :s git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4011 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DSPCore/Src/DSPCore.cpp | 2 +- Source/Core/DSPCore/Src/DSPCore.h | 6 +++--- Source/DSPSpy/dsp_interface.cpp | 3 ++- Source/DSPSpy/main_spy.cpp | 6 ++---- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Source/Core/DSPCore/Src/DSPCore.cpp b/Source/Core/DSPCore/Src/DSPCore.cpp index b42e17cac5..aff0a26721 100644 --- a/Source/Core/DSPCore/Src/DSPCore.cpp +++ b/Source/Core/DSPCore/Src/DSPCore.cpp @@ -54,7 +54,7 @@ static bool LoadRom(const char *fname, int size_in_words, u16 *rom) fclose(pFile); // Byteswap the rom. - for (int i = 0; i < DSP_IROM_SIZE; i++) + for (int i = 0; i < size_in_words; i++) rom[i] = Common::swap16(rom[i]); return true; diff --git a/Source/Core/DSPCore/Src/DSPCore.h b/Source/Core/DSPCore/Src/DSPCore.h index c88b5ebce7..6b7cdf3bc6 100644 --- a/Source/Core/DSPCore/Src/DSPCore.h +++ b/Source/Core/DSPCore/Src/DSPCore.h @@ -40,9 +40,9 @@ #define DSP_DRAM_SIZE 0x1000 #define DSP_DRAM_MASK 0x0fff -#define DSP_COEF_BYTE_SIZE 0x2000 -#define DSP_COEF_SIZE 0x1000 -#define DSP_COEF_MASK 0x0fff +#define DSP_COEF_BYTE_SIZE 0x1000 +#define DSP_COEF_SIZE 0x800 +#define DSP_COEF_MASK 0x7ff #define DSP_RESET_VECTOR 0x8000 diff --git a/Source/DSPSpy/dsp_interface.cpp b/Source/DSPSpy/dsp_interface.cpp index 5dbaddfbae..5a935f12ef 100644 --- a/Source/DSPSpy/dsp_interface.cpp +++ b/Source/DSPSpy/dsp_interface.cpp @@ -21,7 +21,8 @@ void IDSP::SendTask(void *addr, u16 iram_addr, u16 len, u16 start) { // addr main ram addr 4byte aligned (1 Gekko word) // iram_addr dsp addr 4byte aligned (2 DSP words) - // len block length in bytes multiple of 4 + // len block length in bytes multiple of 4 (wtf? if you want to fill whole iram, you need 8191) + // (8191 % 4 = 3) wtffff // start dsp iram entry point while (CheckMailTo()); SendMailTo(0x80F3A001); diff --git a/Source/DSPSpy/main_spy.cpp b/Source/DSPSpy/main_spy.cpp index b077338baf..541081bb77 100644 --- a/Source/DSPSpy/main_spy.cpp +++ b/Source/DSPSpy/main_spy.cpp @@ -328,10 +328,8 @@ void handle_dsp_mail(void) // Then send the code. DCFlushRange((void *)dsp_code[curUcode], 0x2000); // DMA ucode to iram base, entry point is just after exception vectors...0x10 - // (shuffle2) 5256 is the highest I could get the dma block length to on my wii - still needs to be looked into - // for the tstaxh test, 5256 only yields up to step 325. There are 532 send_backs in the ucode, and it takes up - // almost all of the iram. - real_dsp.SendTask((void *)MEM_VIRTUAL_TO_PHYSICAL(dsp_code[curUcode]), 0, 5256, 0x10); + // NOTE: for any ucode made by dsptool, the block length will be 8191 + real_dsp.SendTask((void *)MEM_VIRTUAL_TO_PHYSICAL(dsp_code[curUcode]), 0, sizeof(dsp_code[curUcode])-1, 0x10); runningUcode = curUcode + 1;