forked from dolphin-emu/dolphin
an attempt to move docs to trunk. god tortoisesvn was an ass to do this with tortoisesvn and google code (core pdf was refused multiple times) NOTE: docs/WiiMote/Core V2.1 + EDR.pdf is still missing deu to googlecode hating me
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3491 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
52
docs/DSP/DSP_InterC/DSP_InterC/DSP_InterC.cpp
Normal file
52
docs/DSP/DSP_InterC/DSP_InterC/DSP_InterC.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
// DSP_InterC.cpp : Defines the entry point for the console application.
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "DSPOpcodes.h"
|
||||
|
||||
uint16 g_IMemory[0x1000];
|
||||
uint16 g_currentAddress;
|
||||
|
||||
uint16 FetchOpcode()
|
||||
{
|
||||
uint16 value = swap16(g_IMemory[g_currentAddress & 0x0FFF]);
|
||||
g_currentAddress++;
|
||||
return value;
|
||||
}
|
||||
|
||||
void DecodeOpcode(uint16 op);
|
||||
|
||||
void Decode(uint16 startAddress, uint16 endAddress)
|
||||
{
|
||||
g_currentAddress = startAddress;
|
||||
|
||||
while (g_currentAddress < endAddress)
|
||||
{
|
||||
uint16 oldPC = g_currentAddress;
|
||||
uint16 op = FetchOpcode();
|
||||
|
||||
OutBuffer::Add("// l_%4X:", oldPC);
|
||||
DecodeOpcode(op);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
{
|
||||
FILE* pFile = fopen("c:\\_\\dsp_rom.bin", "rb");
|
||||
if (pFile == NULL)
|
||||
return -1;
|
||||
|
||||
fread(g_IMemory, 0x1000, 1, pFile);
|
||||
fclose(pFile);
|
||||
|
||||
|
||||
//////
|
||||
OutBuffer::Init();
|
||||
Decode(0x80e7, 0x81f9);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user