mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
set svn:eol-style=native for **.h
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1438 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -1,35 +1,35 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef __SOUNDSTREAM_H__
|
||||
#define __SOUNDSTREAM_H__
|
||||
|
||||
namespace DSound
|
||||
{
|
||||
typedef void (*StreamCallback)(short* buffer, int numSamples, int bits, int rate, int channels);
|
||||
|
||||
bool DSound_StartSound(HWND window, int sampleRate, StreamCallback _callback);
|
||||
void DSound_UpdateSound();
|
||||
void DSound_StopSound();
|
||||
|
||||
float DSound_GetTimer();
|
||||
int DSound_GetCurSample();
|
||||
int DSound_GetSampleRate();
|
||||
}
|
||||
|
||||
|
||||
#endif //__SOUNDSTREAM_H__
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef __SOUNDSTREAM_H__
|
||||
#define __SOUNDSTREAM_H__
|
||||
|
||||
namespace DSound
|
||||
{
|
||||
typedef void (*StreamCallback)(short* buffer, int numSamples, int bits, int rate, int channels);
|
||||
|
||||
bool DSound_StartSound(HWND window, int sampleRate, StreamCallback _callback);
|
||||
void DSound_UpdateSound();
|
||||
void DSound_StopSound();
|
||||
|
||||
float DSound_GetTimer();
|
||||
int DSound_GetCurSample();
|
||||
int DSound_GetSampleRate();
|
||||
}
|
||||
|
||||
|
||||
#endif //__SOUNDSTREAM_H__
|
||||
|
@ -1,163 +1,163 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
#include <list>
|
||||
#include <algorithm>
|
||||
|
||||
#include "../res/resource.h"
|
||||
#include "DisAsmListView.h"
|
||||
#include "RegisterDlg.h"
|
||||
|
||||
class CDisAsmDlg
|
||||
: public CDialogImpl<CDisAsmDlg>, public CUpdateUI<CDisAsmDlg>, public CDialogResize<CDisAsmDlg>
|
||||
{
|
||||
public:
|
||||
|
||||
CDisAsmDlg();
|
||||
|
||||
enum { IDD = IDD_DISASMDLG };
|
||||
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
virtual BOOL OnIdle();
|
||||
|
||||
|
||||
BEGIN_UPDATE_UI_MAP(CDisAsmDlg)
|
||||
END_UPDATE_UI_MAP()
|
||||
|
||||
BEGIN_DLGRESIZE_MAP(CDisAsmDlg)
|
||||
DLGRESIZE_CONTROL(IDR_MAINFRAME, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
||||
END_DLGRESIZE_MAP()
|
||||
|
||||
BEGIN_MSG_MAP(CDisAsmDlg)
|
||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
|
||||
COMMAND_ID_HANDLER(ID_STEP, OnStep)
|
||||
COMMAND_ID_HANDLER(ID_GO, OnGo)
|
||||
COMMAND_ID_HANDLER(ID_SHOW_REGISTER, OnShowRegisters)
|
||||
NOTIFY_CODE_HANDLER(NM_CLICK, OnDblClick)
|
||||
NOTIFY_CODE_HANDLER(NM_RETURN, OnDblClick)
|
||||
NOTIFY_CODE_HANDLER(NM_RCLICK, OnRClick)
|
||||
NOTIFY_CODE_HANDLER(NM_CUSTOMDRAW, OnCustomDraw)
|
||||
NOTIFY_HANDLER(IDC_DISASM_LIST, LVN_ITEMCHANGED, OnLvnItemchangedDisasmList)
|
||||
MESSAGE_HANDLER(WM_SIZE, OnSize)
|
||||
CHAIN_MSG_MAP(CDialogResize<CDisAsmDlg>)
|
||||
|
||||
END_MSG_MAP()
|
||||
|
||||
// Handler prototypes (uncomment arguments if needed):
|
||||
// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||
// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
||||
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
|
||||
|
||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
|
||||
LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
|
||||
|
||||
LRESULT OnStep(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL & /*bHandled*/);
|
||||
LRESULT OnGo(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL & /*bHandled*/);
|
||||
LRESULT OnShowRegisters(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL & /*bHandled*/);
|
||||
LRESULT OnCustomDraw(int /*idCtrl*/, LPNMHDR pnmh, BOOL& _bHandled);
|
||||
|
||||
LRESULT OnDblClick(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/);
|
||||
LRESULT OnRClick(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/);
|
||||
|
||||
void CloseDialog(int nVal);
|
||||
|
||||
bool CanDoStep();
|
||||
|
||||
void DebugBreak();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
enum EColumns
|
||||
{
|
||||
ColumnBP = 0,
|
||||
ColumnFunction = 1,
|
||||
ColumnAddress = 2,
|
||||
ColumnMenmomic = 3,
|
||||
ColumnOpcode = 4,
|
||||
ColumnExt = 5,
|
||||
ColumnParameter = 6
|
||||
};
|
||||
|
||||
enum EState
|
||||
{
|
||||
PAUSE,
|
||||
STEP,
|
||||
RUN,
|
||||
RUN_START // ignores breakpoints and switches after one step to RUN
|
||||
};
|
||||
EState m_State;
|
||||
|
||||
|
||||
CListViewCtrl m_DisAsmListViewCtrl;
|
||||
CRegisterDlg m_RegisterDlg;
|
||||
//CWindow GroupLeft
|
||||
CStatic GroupLeft;
|
||||
|
||||
uint64 m_CachedStepCounter;
|
||||
uint16 m_CachedCR;
|
||||
uint32 m_CachedUCodeCRC;
|
||||
|
||||
typedef std::list<uint16>CBreakPointList;
|
||||
CBreakPointList m_BreakPoints;
|
||||
|
||||
// break point handling
|
||||
bool IsBreakPoint(uint16 _Address);
|
||||
void ToggleBreakPoint(uint16 _Address);
|
||||
void RemoveBreakPoint(uint16 _Address);
|
||||
void AddBreakPoint(uint16 _Address);
|
||||
void ClearBreakPoints();
|
||||
|
||||
|
||||
// update dialog
|
||||
void UpdateDisAsmListView();
|
||||
void UpdateRegisterFlags();
|
||||
void UpdateSymbolMap();
|
||||
void UpdateButtonTexts();
|
||||
|
||||
void RedrawDisAsmListView();
|
||||
void RebuildDisAsmListView();
|
||||
|
||||
|
||||
struct SSymbol
|
||||
{
|
||||
uint32 AddressStart;
|
||||
uint32 AddressEnd;
|
||||
std::string Name;
|
||||
|
||||
SSymbol(uint32 _AddressStart = 0, uint32 _AddressEnd = 0, char* _Name = NULL)
|
||||
: AddressStart(_AddressStart)
|
||||
, AddressEnd(_AddressEnd)
|
||||
, Name(_Name)
|
||||
{}
|
||||
};
|
||||
typedef std::map<uint16, SSymbol>CSymbolMap;
|
||||
CSymbolMap m_SymbolMap;
|
||||
|
||||
void AddSymbol(uint16 _AddressStart, uint16 _AddressEnd, char* _Name);
|
||||
bool LoadSymbolMap(const char* _pFileName);
|
||||
DWORD FindColor(uint16 _Address);
|
||||
void UpdateDialog();
|
||||
|
||||
static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
|
||||
public:
|
||||
LRESULT OnLvnItemchangedDisasmList(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL& /*bHandled*/);
|
||||
LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||
};
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
#include <list>
|
||||
#include <algorithm>
|
||||
|
||||
#include "../res/resource.h"
|
||||
#include "DisAsmListView.h"
|
||||
#include "RegisterDlg.h"
|
||||
|
||||
class CDisAsmDlg
|
||||
: public CDialogImpl<CDisAsmDlg>, public CUpdateUI<CDisAsmDlg>, public CDialogResize<CDisAsmDlg>
|
||||
{
|
||||
public:
|
||||
|
||||
CDisAsmDlg();
|
||||
|
||||
enum { IDD = IDD_DISASMDLG };
|
||||
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
virtual BOOL OnIdle();
|
||||
|
||||
|
||||
BEGIN_UPDATE_UI_MAP(CDisAsmDlg)
|
||||
END_UPDATE_UI_MAP()
|
||||
|
||||
BEGIN_DLGRESIZE_MAP(CDisAsmDlg)
|
||||
DLGRESIZE_CONTROL(IDR_MAINFRAME, DLSZ_SIZE_X | DLSZ_SIZE_Y)
|
||||
END_DLGRESIZE_MAP()
|
||||
|
||||
BEGIN_MSG_MAP(CDisAsmDlg)
|
||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
|
||||
COMMAND_ID_HANDLER(ID_STEP, OnStep)
|
||||
COMMAND_ID_HANDLER(ID_GO, OnGo)
|
||||
COMMAND_ID_HANDLER(ID_SHOW_REGISTER, OnShowRegisters)
|
||||
NOTIFY_CODE_HANDLER(NM_CLICK, OnDblClick)
|
||||
NOTIFY_CODE_HANDLER(NM_RETURN, OnDblClick)
|
||||
NOTIFY_CODE_HANDLER(NM_RCLICK, OnRClick)
|
||||
NOTIFY_CODE_HANDLER(NM_CUSTOMDRAW, OnCustomDraw)
|
||||
NOTIFY_HANDLER(IDC_DISASM_LIST, LVN_ITEMCHANGED, OnLvnItemchangedDisasmList)
|
||||
MESSAGE_HANDLER(WM_SIZE, OnSize)
|
||||
CHAIN_MSG_MAP(CDialogResize<CDisAsmDlg>)
|
||||
|
||||
END_MSG_MAP()
|
||||
|
||||
// Handler prototypes (uncomment arguments if needed):
|
||||
// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||
// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
||||
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
|
||||
|
||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
|
||||
LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
|
||||
|
||||
LRESULT OnStep(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL & /*bHandled*/);
|
||||
LRESULT OnGo(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL & /*bHandled*/);
|
||||
LRESULT OnShowRegisters(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL & /*bHandled*/);
|
||||
LRESULT OnCustomDraw(int /*idCtrl*/, LPNMHDR pnmh, BOOL& _bHandled);
|
||||
|
||||
LRESULT OnDblClick(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/);
|
||||
LRESULT OnRClick(int /*idCtrl*/, LPNMHDR pnmh, BOOL& /*bHandled*/);
|
||||
|
||||
void CloseDialog(int nVal);
|
||||
|
||||
bool CanDoStep();
|
||||
|
||||
void DebugBreak();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
enum EColumns
|
||||
{
|
||||
ColumnBP = 0,
|
||||
ColumnFunction = 1,
|
||||
ColumnAddress = 2,
|
||||
ColumnMenmomic = 3,
|
||||
ColumnOpcode = 4,
|
||||
ColumnExt = 5,
|
||||
ColumnParameter = 6
|
||||
};
|
||||
|
||||
enum EState
|
||||
{
|
||||
PAUSE,
|
||||
STEP,
|
||||
RUN,
|
||||
RUN_START // ignores breakpoints and switches after one step to RUN
|
||||
};
|
||||
EState m_State;
|
||||
|
||||
|
||||
CListViewCtrl m_DisAsmListViewCtrl;
|
||||
CRegisterDlg m_RegisterDlg;
|
||||
//CWindow GroupLeft
|
||||
CStatic GroupLeft;
|
||||
|
||||
uint64 m_CachedStepCounter;
|
||||
uint16 m_CachedCR;
|
||||
uint32 m_CachedUCodeCRC;
|
||||
|
||||
typedef std::list<uint16>CBreakPointList;
|
||||
CBreakPointList m_BreakPoints;
|
||||
|
||||
// break point handling
|
||||
bool IsBreakPoint(uint16 _Address);
|
||||
void ToggleBreakPoint(uint16 _Address);
|
||||
void RemoveBreakPoint(uint16 _Address);
|
||||
void AddBreakPoint(uint16 _Address);
|
||||
void ClearBreakPoints();
|
||||
|
||||
|
||||
// update dialog
|
||||
void UpdateDisAsmListView();
|
||||
void UpdateRegisterFlags();
|
||||
void UpdateSymbolMap();
|
||||
void UpdateButtonTexts();
|
||||
|
||||
void RedrawDisAsmListView();
|
||||
void RebuildDisAsmListView();
|
||||
|
||||
|
||||
struct SSymbol
|
||||
{
|
||||
uint32 AddressStart;
|
||||
uint32 AddressEnd;
|
||||
std::string Name;
|
||||
|
||||
SSymbol(uint32 _AddressStart = 0, uint32 _AddressEnd = 0, char* _Name = NULL)
|
||||
: AddressStart(_AddressStart)
|
||||
, AddressEnd(_AddressEnd)
|
||||
, Name(_Name)
|
||||
{}
|
||||
};
|
||||
typedef std::map<uint16, SSymbol>CSymbolMap;
|
||||
CSymbolMap m_SymbolMap;
|
||||
|
||||
void AddSymbol(uint16 _AddressStart, uint16 _AddressEnd, char* _Name);
|
||||
bool LoadSymbolMap(const char* _pFileName);
|
||||
DWORD FindColor(uint16 _Address);
|
||||
void UpdateDialog();
|
||||
|
||||
static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
|
||||
public:
|
||||
LRESULT OnLvnItemchangedDisasmList(int /*idCtrl*/, LPNMHDR pNMHDR, BOOL& /*bHandled*/);
|
||||
LRESULT OnSize(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
|
||||
};
|
||||
|
@ -1,64 +1,64 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _MYLISTVIEW_H
|
||||
#define _MYLISTVIEW_H
|
||||
|
||||
class CDisAsmListView
|
||||
: public CWindowImpl<CDisAsmListView, CListViewCtrl>,
|
||||
public CCustomDraw<CDisAsmListView>
|
||||
{
|
||||
public:
|
||||
|
||||
BEGIN_MSG_MAP(CDisAsmListView)
|
||||
CHAIN_MSG_MAP(CCustomDraw<CDisAsmListView>)
|
||||
END_MSG_MAP()
|
||||
|
||||
DWORD OnPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)
|
||||
{
|
||||
return(CDRF_NOTIFYITEMDRAW);
|
||||
}
|
||||
|
||||
|
||||
DWORD OnItemPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW lpNMCustomDraw)
|
||||
{
|
||||
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(lpNMCustomDraw);
|
||||
|
||||
// This is the prepaint stage for an item. Here's where we set the
|
||||
// item's text color. Our return value will tell Windows to draw the
|
||||
// item itself, but it will use the new color we set here for the background
|
||||
|
||||
COLORREF crText;
|
||||
|
||||
if ((pLVCD->nmcd.dwItemSpec % 2) == 0)
|
||||
{
|
||||
crText = RGB(200, 200, 255);
|
||||
}
|
||||
else
|
||||
{
|
||||
crText = RGB(255, 255, 255);
|
||||
}
|
||||
|
||||
// Store the color back in the NMLVCUSTOMDRAW struct.
|
||||
pLVCD->clrTextBk = crText;
|
||||
|
||||
// Tell Windows to paint the control itself.
|
||||
return(CDRF_DODEFAULT);
|
||||
}
|
||||
};
|
||||
|
||||
#endif _MYLISTVIEW_H
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _MYLISTVIEW_H
|
||||
#define _MYLISTVIEW_H
|
||||
|
||||
class CDisAsmListView
|
||||
: public CWindowImpl<CDisAsmListView, CListViewCtrl>,
|
||||
public CCustomDraw<CDisAsmListView>
|
||||
{
|
||||
public:
|
||||
|
||||
BEGIN_MSG_MAP(CDisAsmListView)
|
||||
CHAIN_MSG_MAP(CCustomDraw<CDisAsmListView>)
|
||||
END_MSG_MAP()
|
||||
|
||||
DWORD OnPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW /*lpNMCustomDraw*/)
|
||||
{
|
||||
return(CDRF_NOTIFYITEMDRAW);
|
||||
}
|
||||
|
||||
|
||||
DWORD OnItemPrePaint(int /*idCtrl*/, LPNMCUSTOMDRAW lpNMCustomDraw)
|
||||
{
|
||||
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>(lpNMCustomDraw);
|
||||
|
||||
// This is the prepaint stage for an item. Here's where we set the
|
||||
// item's text color. Our return value will tell Windows to draw the
|
||||
// item itself, but it will use the new color we set here for the background
|
||||
|
||||
COLORREF crText;
|
||||
|
||||
if ((pLVCD->nmcd.dwItemSpec % 2) == 0)
|
||||
{
|
||||
crText = RGB(200, 200, 255);
|
||||
}
|
||||
else
|
||||
{
|
||||
crText = RGB(255, 255, 255);
|
||||
}
|
||||
|
||||
// Store the color back in the NMLVCUSTOMDRAW struct.
|
||||
pLVCD->clrTextBk = crText;
|
||||
|
||||
// Tell Windows to paint the control itself.
|
||||
return(CDRF_DODEFAULT);
|
||||
}
|
||||
};
|
||||
|
||||
#endif _MYLISTVIEW_H
|
||||
|
@ -1,60 +1,60 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _GLOBALS_H
|
||||
#define _GLOBALS_H
|
||||
|
||||
#include "pluginspecs_dsp.h"
|
||||
#include "Common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define WITH_DSP_ON_THREAD 1
|
||||
#define DUMP_DSP_IMEM 0
|
||||
#define PROFILE 1
|
||||
|
||||
extern DSPInitialize g_dspInitialize;
|
||||
void DebugLog(const char* _fmt, ...);
|
||||
void ErrorLog(const char* _fmt, ...);
|
||||
void DSP_DebugBreak();
|
||||
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef unsigned short uint16;
|
||||
typedef unsigned int uint32;
|
||||
typedef unsigned long long uint64;
|
||||
typedef unsigned int uint;
|
||||
|
||||
typedef signed char sint8;
|
||||
typedef signed short sint16;
|
||||
typedef signed int sint32;
|
||||
typedef signed long long sint64;
|
||||
|
||||
typedef const uint32 cuint32;
|
||||
|
||||
u16 Memory_Read_U16(u32 _uAddress); // For PB address detection
|
||||
u32 Memory_Read_U32(u32 _uAddress);
|
||||
|
||||
#if PROFILE
|
||||
void ProfilerDump(uint64 _count);
|
||||
void ProfilerInit();
|
||||
void ProfilerAddDelta(int _addr, int _delta);
|
||||
void ProfilerStart();
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _GLOBALS_H
|
||||
#define _GLOBALS_H
|
||||
|
||||
#include "pluginspecs_dsp.h"
|
||||
#include "Common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#define WITH_DSP_ON_THREAD 1
|
||||
#define DUMP_DSP_IMEM 0
|
||||
#define PROFILE 1
|
||||
|
||||
extern DSPInitialize g_dspInitialize;
|
||||
void DebugLog(const char* _fmt, ...);
|
||||
void ErrorLog(const char* _fmt, ...);
|
||||
void DSP_DebugBreak();
|
||||
|
||||
|
||||
typedef unsigned char uint8;
|
||||
typedef unsigned short uint16;
|
||||
typedef unsigned int uint32;
|
||||
typedef unsigned long long uint64;
|
||||
typedef unsigned int uint;
|
||||
|
||||
typedef signed char sint8;
|
||||
typedef signed short sint16;
|
||||
typedef signed int sint32;
|
||||
typedef signed long long sint64;
|
||||
|
||||
typedef const uint32 cuint32;
|
||||
|
||||
u16 Memory_Read_U16(u32 _uAddress); // For PB address detection
|
||||
u32 Memory_Read_U32(u32 _uAddress);
|
||||
|
||||
#if PROFILE
|
||||
void ProfilerDump(uint64 _count);
|
||||
void ProfilerInit();
|
||||
void ProfilerAddDelta(int _addr, int _delta);
|
||||
void ProfilerStart();
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,129 +1,129 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef HLE_HELPER_H
|
||||
#define HLE_HELPER_H
|
||||
|
||||
#include "gdsp_interpreter.h"
|
||||
|
||||
bool WriteDMEM(uint16 addr, uint16 val);
|
||||
uint16 ReadDMEM(uint16 addr);
|
||||
void Update_SR_Register(sint64 _Value);
|
||||
sint8 GetMultiplyModifier();
|
||||
|
||||
template<unsigned N>
|
||||
class TAccumulator
|
||||
{
|
||||
public:
|
||||
|
||||
TAccumulator()
|
||||
{
|
||||
_assert_(N < 2);
|
||||
}
|
||||
|
||||
void operator=(sint64 val)
|
||||
{
|
||||
setValue(val);
|
||||
}
|
||||
|
||||
void operator<<=(sint64 value)
|
||||
{
|
||||
sint64 acc = getValue();
|
||||
acc <<= value;
|
||||
setValue(acc);
|
||||
}
|
||||
|
||||
void operator>>=(sint64 value)
|
||||
{
|
||||
sint64 acc = getValue();
|
||||
acc >>= value;
|
||||
setValue(acc);
|
||||
}
|
||||
|
||||
void operator+=(sint64 value)
|
||||
{
|
||||
sint64 acc = getValue();
|
||||
acc += value;
|
||||
setValue(acc);
|
||||
}
|
||||
|
||||
operator sint64()
|
||||
{
|
||||
return getValue();
|
||||
}
|
||||
|
||||
operator uint64()
|
||||
{
|
||||
return getValue();
|
||||
}
|
||||
|
||||
inline void setValue(sint64 val)
|
||||
{
|
||||
g_dsp.r[0x1c + N] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x1e + N] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x10 + N] = (uint16)val;
|
||||
}
|
||||
|
||||
inline sint64 getValue()
|
||||
{
|
||||
sint64 val;
|
||||
sint64 low_acc;
|
||||
val = (sint8)g_dsp.r[0x10 + N];
|
||||
val <<= 32;
|
||||
low_acc = g_dsp.r[0x1e + N];
|
||||
low_acc <<= 16;
|
||||
low_acc |= g_dsp.r[0x1c + N];
|
||||
val |= low_acc;
|
||||
return(val);
|
||||
}
|
||||
};
|
||||
|
||||
class CProd
|
||||
{
|
||||
public:
|
||||
CProd()
|
||||
{
|
||||
}
|
||||
|
||||
void operator=(sint64 val)
|
||||
{
|
||||
g_dsp.r[0x14] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x15] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x16] = (uint16)val;
|
||||
g_dsp.r[0x17] = 0;
|
||||
}
|
||||
|
||||
operator sint64()
|
||||
{
|
||||
sint64 val;
|
||||
sint64 low_prod;
|
||||
val = (sint8)g_dsp.r[0x16];
|
||||
val <<= 32;
|
||||
low_prod = g_dsp.r[0x15];
|
||||
low_prod += g_dsp.r[0x17];
|
||||
low_prod <<= 16;
|
||||
low_prod |= g_dsp.r[0x14];
|
||||
val += low_prod;
|
||||
return(val);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef HLE_HELPER_H
|
||||
#define HLE_HELPER_H
|
||||
|
||||
#include "gdsp_interpreter.h"
|
||||
|
||||
bool WriteDMEM(uint16 addr, uint16 val);
|
||||
uint16 ReadDMEM(uint16 addr);
|
||||
void Update_SR_Register(sint64 _Value);
|
||||
sint8 GetMultiplyModifier();
|
||||
|
||||
template<unsigned N>
|
||||
class TAccumulator
|
||||
{
|
||||
public:
|
||||
|
||||
TAccumulator()
|
||||
{
|
||||
_assert_(N < 2);
|
||||
}
|
||||
|
||||
void operator=(sint64 val)
|
||||
{
|
||||
setValue(val);
|
||||
}
|
||||
|
||||
void operator<<=(sint64 value)
|
||||
{
|
||||
sint64 acc = getValue();
|
||||
acc <<= value;
|
||||
setValue(acc);
|
||||
}
|
||||
|
||||
void operator>>=(sint64 value)
|
||||
{
|
||||
sint64 acc = getValue();
|
||||
acc >>= value;
|
||||
setValue(acc);
|
||||
}
|
||||
|
||||
void operator+=(sint64 value)
|
||||
{
|
||||
sint64 acc = getValue();
|
||||
acc += value;
|
||||
setValue(acc);
|
||||
}
|
||||
|
||||
operator sint64()
|
||||
{
|
||||
return getValue();
|
||||
}
|
||||
|
||||
operator uint64()
|
||||
{
|
||||
return getValue();
|
||||
}
|
||||
|
||||
inline void setValue(sint64 val)
|
||||
{
|
||||
g_dsp.r[0x1c + N] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x1e + N] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x10 + N] = (uint16)val;
|
||||
}
|
||||
|
||||
inline sint64 getValue()
|
||||
{
|
||||
sint64 val;
|
||||
sint64 low_acc;
|
||||
val = (sint8)g_dsp.r[0x10 + N];
|
||||
val <<= 32;
|
||||
low_acc = g_dsp.r[0x1e + N];
|
||||
low_acc <<= 16;
|
||||
low_acc |= g_dsp.r[0x1c + N];
|
||||
val |= low_acc;
|
||||
return(val);
|
||||
}
|
||||
};
|
||||
|
||||
class CProd
|
||||
{
|
||||
public:
|
||||
CProd()
|
||||
{
|
||||
}
|
||||
|
||||
void operator=(sint64 val)
|
||||
{
|
||||
g_dsp.r[0x14] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x15] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x16] = (uint16)val;
|
||||
g_dsp.r[0x17] = 0;
|
||||
}
|
||||
|
||||
operator sint64()
|
||||
{
|
||||
sint64 val;
|
||||
sint64 low_prod;
|
||||
val = (sint8)g_dsp.r[0x16];
|
||||
val <<= 32;
|
||||
low_prod = g_dsp.r[0x15];
|
||||
low_prod += g_dsp.r[0x17];
|
||||
low_prod <<= 16;
|
||||
low_prod |= g_dsp.r[0x14];
|
||||
val += low_prod;
|
||||
return(val);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1,26 +1,26 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
void startConsoleWin(int width, int height, char* fname);
|
||||
int wprintf(char *fmt, ...);
|
||||
void ClearScreen();
|
||||
HWND GetConsoleHwnd(void);
|
||||
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
void startConsoleWin(int width, int height, char* fname);
|
||||
int wprintf(char *fmt, ...);
|
||||
void ClearScreen();
|
||||
HWND GetConsoleHwnd(void);
|
||||
|
||||
#endif
|
@ -1,23 +1,23 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
void Logging();
|
||||
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
void Logging();
|
||||
|
||||
#endif
|
@ -1,145 +1,145 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
#ifdef _WIN32
|
||||
|
||||
|
||||
#ifndef UCODE_AX_STRUCTS
|
||||
#define UCODE_AX_STRUCTS
|
||||
|
||||
struct PBMixer
|
||||
{
|
||||
u16 volume_left;
|
||||
u16 unknown;
|
||||
u16 volume_right;
|
||||
u16 unknown2;
|
||||
|
||||
u16 unknown3[8];
|
||||
u16 unknown4[6];
|
||||
};
|
||||
|
||||
struct PBInitialTimeDelay
|
||||
{
|
||||
u16 unknown[7];
|
||||
};
|
||||
|
||||
// Update data - read these each 1ms subframe and use them!
|
||||
// It seems that to provide higher time precisions for MIDI events, some games
|
||||
// use this thing to update the parameter blocks per 1ms sub-block (a block is 5ms).
|
||||
// Using this data should fix games that are missing MIDI notes.
|
||||
struct PBUpdates
|
||||
{
|
||||
u16 num_updates[5];
|
||||
u16 data_hi; // These point to main RAM. Not sure about the structure of the data.
|
||||
u16 data_lo;
|
||||
};
|
||||
|
||||
struct PBUnknown
|
||||
{
|
||||
s16 unknown[9];
|
||||
};
|
||||
|
||||
struct PBVolumeEnvelope
|
||||
{
|
||||
u16 cur_volume;
|
||||
s16 cur_volume_delta;
|
||||
};
|
||||
|
||||
struct PBUnknown2
|
||||
{
|
||||
u16 unknown_reserved[3];
|
||||
};
|
||||
|
||||
struct PBAudioAddr
|
||||
{
|
||||
u16 looping;
|
||||
u16 sample_format;
|
||||
u16 loop_addr_hi; // Start of loop (this will point to a shared "zero" buffer if one-shot mode is active)
|
||||
u16 loop_addr_lo;
|
||||
u16 end_addr_hi; // End of sample (and loop), inclusive
|
||||
u16 end_addr_lo;
|
||||
u16 cur_addr_hi;
|
||||
u16 cur_addr_lo;
|
||||
};
|
||||
|
||||
struct PBADPCMInfo
|
||||
{
|
||||
s16 coefs[16];
|
||||
u16 unknown;
|
||||
u16 pred_scale;
|
||||
s16 yn1;
|
||||
s16 yn2;
|
||||
};
|
||||
|
||||
struct PBSampleRateConverter
|
||||
{
|
||||
u16 ratio_hi;
|
||||
u16 ratio_lo;
|
||||
u16 cur_addr_frac;
|
||||
u16 last_samples[4];
|
||||
};
|
||||
|
||||
struct PBADPCMLoopInfo
|
||||
{
|
||||
u16 pred_scale;
|
||||
u16 yn1;
|
||||
u16 yn2;
|
||||
};
|
||||
|
||||
struct AXParamBlock
|
||||
{
|
||||
u16 next_pb_hi;
|
||||
u16 next_pb_lo;
|
||||
|
||||
u16 this_pb_hi;
|
||||
u16 this_pb_lo;
|
||||
|
||||
u16 src_type; // Type of sample rate converter (2 = none, ?, linear)
|
||||
u16 unknown1;
|
||||
|
||||
u16 mixer_control;
|
||||
u16 running; // 1=RUN 0=STOP
|
||||
u16 is_stream; // 1 = stream, 0 = one shot
|
||||
|
||||
PBMixer mixer;
|
||||
PBInitialTimeDelay initial_time_delay;
|
||||
PBUpdates updates;
|
||||
PBUnknown unknown2;
|
||||
PBVolumeEnvelope vol_env;
|
||||
PBUnknown2 unknown3;
|
||||
PBAudioAddr audio_addr;
|
||||
PBADPCMInfo adpcm;
|
||||
PBSampleRateConverter src;
|
||||
PBADPCMLoopInfo adpcm_loop_info;
|
||||
u16 unknown_maybe_padding[3];
|
||||
};
|
||||
|
||||
enum {
|
||||
AUDIOFORMAT_ADPCM = 0,
|
||||
AUDIOFORMAT_PCM8 = 0x19,
|
||||
AUDIOFORMAT_PCM16 = 0xA,
|
||||
};
|
||||
|
||||
enum {
|
||||
SRCTYPE_LINEAR = 1,
|
||||
SRCTYPE_NEAREST = 2,
|
||||
MIXCONTROL_RAMPING = 8,
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
#ifdef _WIN32
|
||||
|
||||
|
||||
#ifndef UCODE_AX_STRUCTS
|
||||
#define UCODE_AX_STRUCTS
|
||||
|
||||
struct PBMixer
|
||||
{
|
||||
u16 volume_left;
|
||||
u16 unknown;
|
||||
u16 volume_right;
|
||||
u16 unknown2;
|
||||
|
||||
u16 unknown3[8];
|
||||
u16 unknown4[6];
|
||||
};
|
||||
|
||||
struct PBInitialTimeDelay
|
||||
{
|
||||
u16 unknown[7];
|
||||
};
|
||||
|
||||
// Update data - read these each 1ms subframe and use them!
|
||||
// It seems that to provide higher time precisions for MIDI events, some games
|
||||
// use this thing to update the parameter blocks per 1ms sub-block (a block is 5ms).
|
||||
// Using this data should fix games that are missing MIDI notes.
|
||||
struct PBUpdates
|
||||
{
|
||||
u16 num_updates[5];
|
||||
u16 data_hi; // These point to main RAM. Not sure about the structure of the data.
|
||||
u16 data_lo;
|
||||
};
|
||||
|
||||
struct PBUnknown
|
||||
{
|
||||
s16 unknown[9];
|
||||
};
|
||||
|
||||
struct PBVolumeEnvelope
|
||||
{
|
||||
u16 cur_volume;
|
||||
s16 cur_volume_delta;
|
||||
};
|
||||
|
||||
struct PBUnknown2
|
||||
{
|
||||
u16 unknown_reserved[3];
|
||||
};
|
||||
|
||||
struct PBAudioAddr
|
||||
{
|
||||
u16 looping;
|
||||
u16 sample_format;
|
||||
u16 loop_addr_hi; // Start of loop (this will point to a shared "zero" buffer if one-shot mode is active)
|
||||
u16 loop_addr_lo;
|
||||
u16 end_addr_hi; // End of sample (and loop), inclusive
|
||||
u16 end_addr_lo;
|
||||
u16 cur_addr_hi;
|
||||
u16 cur_addr_lo;
|
||||
};
|
||||
|
||||
struct PBADPCMInfo
|
||||
{
|
||||
s16 coefs[16];
|
||||
u16 unknown;
|
||||
u16 pred_scale;
|
||||
s16 yn1;
|
||||
s16 yn2;
|
||||
};
|
||||
|
||||
struct PBSampleRateConverter
|
||||
{
|
||||
u16 ratio_hi;
|
||||
u16 ratio_lo;
|
||||
u16 cur_addr_frac;
|
||||
u16 last_samples[4];
|
||||
};
|
||||
|
||||
struct PBADPCMLoopInfo
|
||||
{
|
||||
u16 pred_scale;
|
||||
u16 yn1;
|
||||
u16 yn2;
|
||||
};
|
||||
|
||||
struct AXParamBlock
|
||||
{
|
||||
u16 next_pb_hi;
|
||||
u16 next_pb_lo;
|
||||
|
||||
u16 this_pb_hi;
|
||||
u16 this_pb_lo;
|
||||
|
||||
u16 src_type; // Type of sample rate converter (2 = none, ?, linear)
|
||||
u16 unknown1;
|
||||
|
||||
u16 mixer_control;
|
||||
u16 running; // 1=RUN 0=STOP
|
||||
u16 is_stream; // 1 = stream, 0 = one shot
|
||||
|
||||
PBMixer mixer;
|
||||
PBInitialTimeDelay initial_time_delay;
|
||||
PBUpdates updates;
|
||||
PBUnknown unknown2;
|
||||
PBVolumeEnvelope vol_env;
|
||||
PBUnknown2 unknown3;
|
||||
PBAudioAddr audio_addr;
|
||||
PBADPCMInfo adpcm;
|
||||
PBSampleRateConverter src;
|
||||
PBADPCMLoopInfo adpcm_loop_info;
|
||||
u16 unknown_maybe_padding[3];
|
||||
};
|
||||
|
||||
enum {
|
||||
AUDIOFORMAT_ADPCM = 0,
|
||||
AUDIOFORMAT_PCM8 = 0x19,
|
||||
AUDIOFORMAT_PCM16 = 0xA,
|
||||
};
|
||||
|
||||
enum {
|
||||
SRCTYPE_LINEAR = 1,
|
||||
SRCTYPE_NEAREST = 2,
|
||||
MIXCONTROL_RAMPING = 8,
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif // win32
|
@ -1,30 +1,30 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _MIXER_H
|
||||
#define _MIXER_H
|
||||
|
||||
extern volatile bool mixer_HLEready;
|
||||
|
||||
// Called from audio threads
|
||||
void Mixer(short* buffer, int numSamples, int bits, int rate, int channels);
|
||||
|
||||
// Called from main thread
|
||||
void Mixer_PushSamples(short *buffer, int num_stereo_samples, int sample_rate);
|
||||
|
||||
#endif
|
||||
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _MIXER_H
|
||||
#define _MIXER_H
|
||||
|
||||
extern volatile bool mixer_HLEready;
|
||||
|
||||
// Called from audio threads
|
||||
void Mixer(short* buffer, int numSamples, int bits, int rate, int channels);
|
||||
|
||||
// Called from main thread
|
||||
void Mixer_PushSamples(short *buffer, int num_stereo_samples, int sample_rate);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,81 +1,81 @@
|
||||
// RegSettings.h
|
||||
//
|
||||
// Copyright (c) 2001 Magomed Abdurakhmanov
|
||||
// maq@hotbox.ru, http://mickels.iwt.ru/en
|
||||
//
|
||||
//
|
||||
//
|
||||
// No warranties are given. Use at your own risk.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined (AFX_REGSETTINGS_H__91E69C67_8104_4819_969A_B5E71A9993D5__INCLUDED_)
|
||||
#define AFX_REGSETTINGS_H__91E69C67_8104_4819_969A_B5E71A9993D5__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <AtlMisc.h>
|
||||
#include <AtlCtrls.h>
|
||||
|
||||
class CWindowSettings
|
||||
{
|
||||
public:
|
||||
|
||||
WINDOWPLACEMENT m_WindowPlacement;
|
||||
|
||||
CWindowSettings();
|
||||
void GetFrom(CWindow& Wnd);
|
||||
void ApplyTo(CWindow& Wnd, int nCmdShow = SW_SHOWNORMAL) const;
|
||||
|
||||
bool Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER);
|
||||
bool Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER) const;
|
||||
};
|
||||
|
||||
class CReBarSettings
|
||||
{
|
||||
public:
|
||||
|
||||
struct BandInfo
|
||||
{
|
||||
DWORD ID;
|
||||
DWORD cx;
|
||||
bool BreakLine;
|
||||
}* m_pBands;
|
||||
|
||||
DWORD m_cbBandCount;
|
||||
|
||||
CReBarSettings();
|
||||
~CReBarSettings();
|
||||
|
||||
void GetFrom(CReBarCtrl& ReBar);
|
||||
void ApplyTo(CReBarCtrl& ReBar) const;
|
||||
|
||||
bool Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER);
|
||||
bool Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER) const;
|
||||
};
|
||||
|
||||
class CSplitterSettings
|
||||
{
|
||||
public:
|
||||
|
||||
DWORD m_dwPos;
|
||||
|
||||
template<class T>void GetFrom(const T& Splitter)
|
||||
{
|
||||
m_dwPos = Splitter.GetSplitterPos();
|
||||
}
|
||||
|
||||
|
||||
template<class T>void ApplyTo(T& Splitter) const
|
||||
{
|
||||
Splitter.SetSplitterPos(m_dwPos);
|
||||
}
|
||||
|
||||
|
||||
bool Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER);
|
||||
bool Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER) const;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_REGSETTINGS_H__91E69C67_8104_4819_969A_B5E71A9993D5__INCLUDED_)
|
||||
// RegSettings.h
|
||||
//
|
||||
// Copyright (c) 2001 Magomed Abdurakhmanov
|
||||
// maq@hotbox.ru, http://mickels.iwt.ru/en
|
||||
//
|
||||
//
|
||||
//
|
||||
// No warranties are given. Use at your own risk.
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if !defined (AFX_REGSETTINGS_H__91E69C67_8104_4819_969A_B5E71A9993D5__INCLUDED_)
|
||||
#define AFX_REGSETTINGS_H__91E69C67_8104_4819_969A_B5E71A9993D5__INCLUDED_
|
||||
|
||||
#if _MSC_VER > 1000
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
|
||||
#include <AtlMisc.h>
|
||||
#include <AtlCtrls.h>
|
||||
|
||||
class CWindowSettings
|
||||
{
|
||||
public:
|
||||
|
||||
WINDOWPLACEMENT m_WindowPlacement;
|
||||
|
||||
CWindowSettings();
|
||||
void GetFrom(CWindow& Wnd);
|
||||
void ApplyTo(CWindow& Wnd, int nCmdShow = SW_SHOWNORMAL) const;
|
||||
|
||||
bool Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER);
|
||||
bool Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER) const;
|
||||
};
|
||||
|
||||
class CReBarSettings
|
||||
{
|
||||
public:
|
||||
|
||||
struct BandInfo
|
||||
{
|
||||
DWORD ID;
|
||||
DWORD cx;
|
||||
bool BreakLine;
|
||||
}* m_pBands;
|
||||
|
||||
DWORD m_cbBandCount;
|
||||
|
||||
CReBarSettings();
|
||||
~CReBarSettings();
|
||||
|
||||
void GetFrom(CReBarCtrl& ReBar);
|
||||
void ApplyTo(CReBarCtrl& ReBar) const;
|
||||
|
||||
bool Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER);
|
||||
bool Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER) const;
|
||||
};
|
||||
|
||||
class CSplitterSettings
|
||||
{
|
||||
public:
|
||||
|
||||
DWORD m_dwPos;
|
||||
|
||||
template<class T>void GetFrom(const T& Splitter)
|
||||
{
|
||||
m_dwPos = Splitter.GetSplitterPos();
|
||||
}
|
||||
|
||||
|
||||
template<class T>void ApplyTo(T& Splitter) const
|
||||
{
|
||||
Splitter.SetSplitterPos(m_dwPos);
|
||||
}
|
||||
|
||||
|
||||
bool Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER);
|
||||
bool Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER) const;
|
||||
};
|
||||
|
||||
#endif // !defined(AFX_REGSETTINGS_H__91E69C67_8104_4819_969A_B5E71A9993D5__INCLUDED_)
|
||||
|
@ -1,80 +1,80 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
#include <map>
|
||||
#include "DisAsmListView.h"
|
||||
|
||||
class CRegisterDlg
|
||||
: public CDialogImpl<CRegisterDlg>, public CUpdateUI<CRegisterDlg>
|
||||
{
|
||||
public:
|
||||
|
||||
CRegisterDlg();
|
||||
|
||||
enum { IDD = IDD_REGISTERDLG };
|
||||
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
virtual BOOL OnIdle();
|
||||
|
||||
|
||||
BEGIN_UPDATE_UI_MAP(CRegisterDlg)
|
||||
END_UPDATE_UI_MAP()
|
||||
|
||||
BEGIN_MSG_MAP(CRegisterDlg)
|
||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
|
||||
NOTIFY_CODE_HANDLER(NM_CUSTOMDRAW, OnCustomDraw)
|
||||
|
||||
// COMMAND_ID_HANDLER(ID_STEP, OnStep)
|
||||
// COMMAND_ID_HANDLER(ID_GO, OnGo)
|
||||
// COMMAND_ID_HANDLER(ID_SHOW_REGISTER, OnShowRegisters)
|
||||
END_MSG_MAP()
|
||||
|
||||
// Handler prototypes (uncomment arguments if needed):
|
||||
// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||
// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
||||
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
|
||||
|
||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
|
||||
LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
|
||||
LRESULT OnCustomDraw(int /*idCtrl*/, LPNMHDR pnmh, BOOL& _bHandled);
|
||||
|
||||
|
||||
// LRESULT OnStep(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||
// LRESULT OnGo(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||
// LRESULT OnShowRegisters(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||
|
||||
void CloseDialog(int nVal);
|
||||
|
||||
void UpdateRegisterListView();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
CListViewCtrl m_RegisterListViewCtrl;
|
||||
|
||||
static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
|
||||
|
||||
|
||||
uint64 m_CachedCounter;
|
||||
uint16 m_CachedRegs[32];
|
||||
bool m_CachedRegHasChanged[32];
|
||||
};
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
#include <map>
|
||||
#include "DisAsmListView.h"
|
||||
|
||||
class CRegisterDlg
|
||||
: public CDialogImpl<CRegisterDlg>, public CUpdateUI<CRegisterDlg>
|
||||
{
|
||||
public:
|
||||
|
||||
CRegisterDlg();
|
||||
|
||||
enum { IDD = IDD_REGISTERDLG };
|
||||
|
||||
virtual BOOL PreTranslateMessage(MSG* pMsg);
|
||||
virtual BOOL OnIdle();
|
||||
|
||||
|
||||
BEGIN_UPDATE_UI_MAP(CRegisterDlg)
|
||||
END_UPDATE_UI_MAP()
|
||||
|
||||
BEGIN_MSG_MAP(CRegisterDlg)
|
||||
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
|
||||
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
|
||||
NOTIFY_CODE_HANDLER(NM_CUSTOMDRAW, OnCustomDraw)
|
||||
|
||||
// COMMAND_ID_HANDLER(ID_STEP, OnStep)
|
||||
// COMMAND_ID_HANDLER(ID_GO, OnGo)
|
||||
// COMMAND_ID_HANDLER(ID_SHOW_REGISTER, OnShowRegisters)
|
||||
END_MSG_MAP()
|
||||
|
||||
// Handler prototypes (uncomment arguments if needed):
|
||||
// LRESULT MessageHandler(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
|
||||
// LRESULT CommandHandler(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
|
||||
// LRESULT NotifyHandler(int /*idCtrl*/, LPNMHDR /*pnmh*/, BOOL& /*bHandled*/)
|
||||
|
||||
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
|
||||
LRESULT OnDestroy(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL & /*bHandled*/);
|
||||
LRESULT OnCustomDraw(int /*idCtrl*/, LPNMHDR pnmh, BOOL& _bHandled);
|
||||
|
||||
|
||||
// LRESULT OnStep(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||
// LRESULT OnGo(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||
// LRESULT OnShowRegisters(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
|
||||
|
||||
void CloseDialog(int nVal);
|
||||
|
||||
void UpdateRegisterListView();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
CListViewCtrl m_RegisterListViewCtrl;
|
||||
|
||||
static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
|
||||
|
||||
|
||||
uint64 m_CachedCounter;
|
||||
uint16 m_CachedRegs[32];
|
||||
bool m_CachedRegHasChanged[32];
|
||||
};
|
||||
|
@ -1,50 +1,50 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#pragma once
|
||||
|
||||
// UDSPControl
|
||||
union UDSPControl
|
||||
{
|
||||
uint16 Hex;
|
||||
struct
|
||||
{
|
||||
unsigned DSPReset : 1; // Write 1 to reset and waits for 0
|
||||
unsigned DSPAssertInt : 1;
|
||||
unsigned DSPHalt : 1;
|
||||
|
||||
unsigned AI : 1;
|
||||
unsigned AI_mask : 1;
|
||||
unsigned ARAM : 1;
|
||||
unsigned ARAM_mask : 1;
|
||||
unsigned DSP : 1;
|
||||
unsigned DSP_mask : 1;
|
||||
|
||||
unsigned ARAM_DMAState : 1; // DSPGetDMAStatus() uses this flag
|
||||
unsigned unk3 : 1;
|
||||
unsigned DSPInit : 1; // DSPInit() writes to this flag
|
||||
unsigned pad : 4;
|
||||
};
|
||||
|
||||
UDSPControl(uint16 _Hex = 0)
|
||||
: Hex(_Hex) {}
|
||||
};
|
||||
|
||||
|
||||
bool DumpDSPCode(uint32 _Address, uint32 _Length, uint32 crc);
|
||||
uint32 GenerateCRC(const unsigned char* _pBuffer, int _pLength);
|
||||
bool DumpCWCode(uint32 _Address, uint32 _Length);
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#pragma once
|
||||
|
||||
// UDSPControl
|
||||
union UDSPControl
|
||||
{
|
||||
uint16 Hex;
|
||||
struct
|
||||
{
|
||||
unsigned DSPReset : 1; // Write 1 to reset and waits for 0
|
||||
unsigned DSPAssertInt : 1;
|
||||
unsigned DSPHalt : 1;
|
||||
|
||||
unsigned AI : 1;
|
||||
unsigned AI_mask : 1;
|
||||
unsigned ARAM : 1;
|
||||
unsigned ARAM_mask : 1;
|
||||
unsigned DSP : 1;
|
||||
unsigned DSP_mask : 1;
|
||||
|
||||
unsigned ARAM_DMAState : 1; // DSPGetDMAStatus() uses this flag
|
||||
unsigned unk3 : 1;
|
||||
unsigned DSPInit : 1; // DSPInit() writes to this flag
|
||||
unsigned pad : 4;
|
||||
};
|
||||
|
||||
UDSPControl(uint16 _Hex = 0)
|
||||
: Hex(_Hex) {}
|
||||
};
|
||||
|
||||
|
||||
bool DumpDSPCode(uint32 _Address, uint32 _Length, uint32 crc);
|
||||
uint32 GenerateCRC(const unsigned char* _pBuffer, int _pLength);
|
||||
bool DumpCWCode(uint32 _Address, uint32 _Length);
|
||||
|
@ -1,46 +1,46 @@
|
||||
/*====================================================================
|
||||
|
||||
filename: opcodes.h
|
||||
project: GameCube DSP Tool (gcdsp)
|
||||
created: 2005.03.04
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
|
||||
#pragma once
|
||||
|
||||
typedef struct gd_globals_t
|
||||
{
|
||||
bool print_tabs;
|
||||
bool show_hex;
|
||||
bool show_pc;
|
||||
bool decode_names;
|
||||
bool decode_registers;
|
||||
|
||||
uint16* binbuf;
|
||||
uint16 pc;
|
||||
char* buffer;
|
||||
uint16 buffer_size;
|
||||
char ext_separator;
|
||||
} gd_globals_t;
|
||||
|
||||
|
||||
char* gd_dis_opcode(gd_globals_t* gdg);
|
||||
bool gd_dis_file(gd_globals_t* gdg, char* name, FILE* output);
|
||||
const char* gd_dis_get_reg_name(uint16 reg);
|
||||
/*====================================================================
|
||||
|
||||
filename: opcodes.h
|
||||
project: GameCube DSP Tool (gcdsp)
|
||||
created: 2005.03.04
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
|
||||
#pragma once
|
||||
|
||||
typedef struct gd_globals_t
|
||||
{
|
||||
bool print_tabs;
|
||||
bool show_hex;
|
||||
bool show_pc;
|
||||
bool decode_names;
|
||||
bool decode_registers;
|
||||
|
||||
uint16* binbuf;
|
||||
uint16 pc;
|
||||
char* buffer;
|
||||
uint16 buffer_size;
|
||||
char ext_separator;
|
||||
} gd_globals_t;
|
||||
|
||||
|
||||
char* gd_dis_opcode(gd_globals_t* gdg);
|
||||
bool gd_dis_file(gd_globals_t* gdg, char* name, FILE* output);
|
||||
const char* gd_dis_get_reg_name(uint16 reg);
|
||||
|
@ -1,23 +1,23 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _GDSP_ARAM_H
|
||||
#define _GDSP_ARAM_H
|
||||
|
||||
uint16 dsp_read_aram();
|
||||
|
||||
#endif
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#ifndef _GDSP_ARAM_H
|
||||
#define _GDSP_ARAM_H
|
||||
|
||||
uint16 dsp_read_aram();
|
||||
|
||||
#endif
|
||||
|
@ -1,33 +1,33 @@
|
||||
/*====================================================================
|
||||
|
||||
filename: opcodes.h
|
||||
project: GameCube DSP Tool (gcdsp)
|
||||
created: 2005.03.04
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
|
||||
#ifndef _GDSP_EXT_OP_H
|
||||
#define _GDSP_EXT_OP_H
|
||||
|
||||
void dsp_op_ext_ops_pro(uint16 _Opcode);
|
||||
void dsp_op_ext_ops_epi(uint16 _Opcode);
|
||||
|
||||
|
||||
#endif
|
||||
/*====================================================================
|
||||
|
||||
filename: opcodes.h
|
||||
project: GameCube DSP Tool (gcdsp)
|
||||
created: 2005.03.04
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
|
||||
#ifndef _GDSP_EXT_OP_H
|
||||
#define _GDSP_EXT_OP_H
|
||||
|
||||
void dsp_op_ext_ops_pro(uint16 _Opcode);
|
||||
void dsp_op_ext_ops_epi(uint16 _Opcode);
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,35 +1,35 @@
|
||||
/*====================================================================
|
||||
|
||||
filename: gdsp_ifx.h
|
||||
project: GCemu
|
||||
created: 2004-6-18
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie & Tratax
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
|
||||
// ADPCM hw
|
||||
|
||||
#ifndef _GDSP_IFX_H
|
||||
#define _GDSP_IFX_H
|
||||
|
||||
void gdsp_ifx_write(uint16 addr, uint16 val);
|
||||
uint16 gdsp_ifx_read(uint16 addr);
|
||||
|
||||
|
||||
#endif
|
||||
/*====================================================================
|
||||
|
||||
filename: gdsp_ifx.h
|
||||
project: GCemu
|
||||
created: 2004-6-18
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie & Tratax
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
|
||||
// ADPCM hw
|
||||
|
||||
#ifndef _GDSP_IFX_H
|
||||
#define _GDSP_IFX_H
|
||||
|
||||
void gdsp_ifx_write(uint16 addr, uint16 val);
|
||||
uint16 gdsp_ifx_read(uint16 addr);
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,67 +1,67 @@
|
||||
/*====================================================================
|
||||
|
||||
filename: gdsp_interface.h
|
||||
project: GCemu
|
||||
created: 2004-6-18
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie & Tratax
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
#ifndef _GDSP_INTERFACE_H
|
||||
#define _GDSP_INTERFACE_H
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
#define GDSP_MBOX_CPU 0
|
||||
#define GDSP_MBOX_DSP 1
|
||||
|
||||
#define DSP_DSMAH 0xce
|
||||
#define DSP_DSMAL 0xcf
|
||||
#define DSP_DSCR 0xc9
|
||||
#define DSP_DSPA 0xcd
|
||||
#define DSP_DSBL 0xcb
|
||||
#define DSP_ACSAH 0xd4
|
||||
#define DSP_ACSAL 0xd5
|
||||
#define DSP_ACEAH 0xd6
|
||||
#define DSP_ACEAL 0xd7
|
||||
#define DSP_ACCAH 0xd8
|
||||
#define DSP_ACCAL 0xd9
|
||||
|
||||
#define DSP_COEF_A1_0 0xa0
|
||||
#define DSP_FORMAT 0xd1
|
||||
#define DSP_PRED_SCALE 0xda
|
||||
#define DSP_YN1 0xdb
|
||||
#define DSP_YN2 0xdc
|
||||
#define DSP_ARAM 0xdd
|
||||
#define DSP_GAIN 0xde
|
||||
|
||||
extern uint16 gdsp_ifx_regs[256];
|
||||
|
||||
uint32 gdsp_mbox_peek(uint8 mbx);
|
||||
void gdsp_mbox_write_h(uint8 mbx, uint16 val);
|
||||
void gdsp_mbox_write_l(uint8 mbx, uint16 val);
|
||||
uint16 gdsp_mbox_read_h(uint8 mbx);
|
||||
uint16 gdsp_mbox_read_l(uint8 mbx);
|
||||
|
||||
void gdsp_ifx_init();
|
||||
|
||||
void gdsp_idma_in(uint16 dsp_addr, uint32 addr, uint32 size);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/*====================================================================
|
||||
|
||||
filename: gdsp_interface.h
|
||||
project: GCemu
|
||||
created: 2004-6-18
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie & Tratax
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
#ifndef _GDSP_INTERFACE_H
|
||||
#define _GDSP_INTERFACE_H
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
#define GDSP_MBOX_CPU 0
|
||||
#define GDSP_MBOX_DSP 1
|
||||
|
||||
#define DSP_DSMAH 0xce
|
||||
#define DSP_DSMAL 0xcf
|
||||
#define DSP_DSCR 0xc9
|
||||
#define DSP_DSPA 0xcd
|
||||
#define DSP_DSBL 0xcb
|
||||
#define DSP_ACSAH 0xd4
|
||||
#define DSP_ACSAL 0xd5
|
||||
#define DSP_ACEAH 0xd6
|
||||
#define DSP_ACEAL 0xd7
|
||||
#define DSP_ACCAH 0xd8
|
||||
#define DSP_ACCAL 0xd9
|
||||
|
||||
#define DSP_COEF_A1_0 0xa0
|
||||
#define DSP_FORMAT 0xd1
|
||||
#define DSP_PRED_SCALE 0xda
|
||||
#define DSP_YN1 0xdb
|
||||
#define DSP_YN2 0xdc
|
||||
#define DSP_ARAM 0xdd
|
||||
#define DSP_GAIN 0xde
|
||||
|
||||
extern uint16 gdsp_ifx_regs[256];
|
||||
|
||||
uint32 gdsp_mbox_peek(uint8 mbx);
|
||||
void gdsp_mbox_write_h(uint8 mbx, uint16 val);
|
||||
void gdsp_mbox_write_l(uint8 mbx, uint16 val);
|
||||
uint16 gdsp_mbox_read_h(uint8 mbx);
|
||||
uint16 gdsp_mbox_read_l(uint8 mbx);
|
||||
|
||||
void gdsp_ifx_init();
|
||||
|
||||
void gdsp_idma_in(uint16 dsp_addr, uint32 addr, uint32 size);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,94 +1,94 @@
|
||||
/*====================================================================
|
||||
|
||||
filename: gdsp_interpreter.h
|
||||
project: GCemu
|
||||
created: 2004-6-18
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie & Tratax
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
|
||||
#ifndef _GDSP_INTERPRETER_H
|
||||
#define _GDSP_INTERPRETER_H
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
#define DSP_IRAM_SIZE (0x1000)
|
||||
#define DSP_IRAM_MASK (0x0fff)
|
||||
#define DSP_IROM_SIZE (0x1000)
|
||||
#define DSP_IROM_MASK (0x0fff)
|
||||
#define DSP_DRAM_SIZE (0x1000)
|
||||
#define DSP_DRAM_MASK (0x0fff)
|
||||
#define DSP_DROM_SIZE (0x1000)
|
||||
#define DSP_DROM_MASK (0x0fff)
|
||||
#define DSP_COEF_SIZE (0x1000)
|
||||
#define DSP_COEF_MASK (0x0fff)
|
||||
|
||||
#define DSP_RESET_VECTOR (0x8000)
|
||||
|
||||
#define DSP_STACK_DEPTH 0x20
|
||||
#define DSP_STACK_MASK 0x1f
|
||||
|
||||
struct SDSP
|
||||
{
|
||||
static uint16 r[32];
|
||||
static uint16 pc;
|
||||
static uint16 err_pc;
|
||||
static uint16* iram;
|
||||
static uint16* dram;
|
||||
static uint16* irom;
|
||||
static uint16* drom;
|
||||
static uint16* coef;
|
||||
static uint8* cpu_ram;
|
||||
static uint16 cr;
|
||||
static uint8 reg_stack_ptr[4];
|
||||
// lets make stack depth to 32 for now
|
||||
static uint16 reg_stack[4][DSP_STACK_DEPTH];
|
||||
static void (* irq_request)(void);
|
||||
|
||||
// for debugger only
|
||||
static uint32 iram_crc;
|
||||
static uint64 step_counter;
|
||||
static bool exception_in_progress_hack;
|
||||
};
|
||||
|
||||
extern SDSP g_dsp;
|
||||
|
||||
|
||||
void gdsp_init(void);
|
||||
void gdsp_reset(void);
|
||||
bool gdsp_load_rom(char* fname);
|
||||
bool gdsp_load_coef(char* fname);
|
||||
|
||||
|
||||
// steps through DSP code, returns false if error occured
|
||||
void gdsp_step(void);
|
||||
void gdsp_loop_step();
|
||||
bool gdsp_run(void);
|
||||
bool gdsp_runx(uint16 cnt);
|
||||
void gdsp_stop(void);
|
||||
|
||||
void gdsp_write_cr(uint16 val);
|
||||
uint16 gdsp_read_cr(void);
|
||||
|
||||
uint16* gdsp_get_iram(void);
|
||||
uint16* gdsp_get_irom(void);
|
||||
uint16* gdsp_get_dram(void);
|
||||
uint16* gdsp_get_drom(void);
|
||||
|
||||
#endif
|
||||
/*====================================================================
|
||||
|
||||
filename: gdsp_interpreter.h
|
||||
project: GCemu
|
||||
created: 2004-6-18
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie & Tratax
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
|
||||
#ifndef _GDSP_INTERPRETER_H
|
||||
#define _GDSP_INTERPRETER_H
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
#define DSP_IRAM_SIZE (0x1000)
|
||||
#define DSP_IRAM_MASK (0x0fff)
|
||||
#define DSP_IROM_SIZE (0x1000)
|
||||
#define DSP_IROM_MASK (0x0fff)
|
||||
#define DSP_DRAM_SIZE (0x1000)
|
||||
#define DSP_DRAM_MASK (0x0fff)
|
||||
#define DSP_DROM_SIZE (0x1000)
|
||||
#define DSP_DROM_MASK (0x0fff)
|
||||
#define DSP_COEF_SIZE (0x1000)
|
||||
#define DSP_COEF_MASK (0x0fff)
|
||||
|
||||
#define DSP_RESET_VECTOR (0x8000)
|
||||
|
||||
#define DSP_STACK_DEPTH 0x20
|
||||
#define DSP_STACK_MASK 0x1f
|
||||
|
||||
struct SDSP
|
||||
{
|
||||
static uint16 r[32];
|
||||
static uint16 pc;
|
||||
static uint16 err_pc;
|
||||
static uint16* iram;
|
||||
static uint16* dram;
|
||||
static uint16* irom;
|
||||
static uint16* drom;
|
||||
static uint16* coef;
|
||||
static uint8* cpu_ram;
|
||||
static uint16 cr;
|
||||
static uint8 reg_stack_ptr[4];
|
||||
// lets make stack depth to 32 for now
|
||||
static uint16 reg_stack[4][DSP_STACK_DEPTH];
|
||||
static void (* irq_request)(void);
|
||||
|
||||
// for debugger only
|
||||
static uint32 iram_crc;
|
||||
static uint64 step_counter;
|
||||
static bool exception_in_progress_hack;
|
||||
};
|
||||
|
||||
extern SDSP g_dsp;
|
||||
|
||||
|
||||
void gdsp_init(void);
|
||||
void gdsp_reset(void);
|
||||
bool gdsp_load_rom(char* fname);
|
||||
bool gdsp_load_coef(char* fname);
|
||||
|
||||
|
||||
// steps through DSP code, returns false if error occured
|
||||
void gdsp_step(void);
|
||||
void gdsp_loop_step();
|
||||
bool gdsp_run(void);
|
||||
bool gdsp_runx(uint16 cnt);
|
||||
void gdsp_stop(void);
|
||||
|
||||
void gdsp_write_cr(uint16 val);
|
||||
uint16 gdsp_read_cr(void);
|
||||
|
||||
uint16* gdsp_get_iram(void);
|
||||
uint16* gdsp_get_irom(void);
|
||||
uint16* gdsp_get_dram(void);
|
||||
uint16* gdsp_get_drom(void);
|
||||
|
||||
#endif
|
||||
|
@ -1,37 +1,37 @@
|
||||
/*====================================================================
|
||||
|
||||
filename: gdsp_memory.h
|
||||
project: GCemu
|
||||
created: 2004-6-18
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie & Tratax
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
#ifndef _GDSP_MEMORY_H
|
||||
#define _GDSP_MEMORY_H
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
uint16 dsp_fetch_code(void);
|
||||
uint16 dsp_peek_code(void);
|
||||
uint16 dsp_imem_read(uint16 addr);
|
||||
bool dsp_dmem_write(uint16 addr, uint16 val);
|
||||
uint16 dsp_dmem_read(uint16 addr);
|
||||
|
||||
|
||||
#endif
|
||||
/*====================================================================
|
||||
|
||||
filename: gdsp_memory.h
|
||||
project: GCemu
|
||||
created: 2004-6-18
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie & Tratax
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
#ifndef _GDSP_MEMORY_H
|
||||
#define _GDSP_MEMORY_H
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
uint16 dsp_fetch_code(void);
|
||||
uint16 dsp_peek_code(void);
|
||||
uint16 dsp_imem_read(uint16 addr);
|
||||
bool dsp_dmem_write(uint16 addr, uint16 val);
|
||||
uint16 dsp_dmem_read(uint16 addr);
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,50 +1,50 @@
|
||||
/*====================================================================
|
||||
|
||||
filename: gdsp_opcodes.h
|
||||
project: GCemu
|
||||
created: 2004-6-18
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie & Tratax
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
#ifndef _GDSP_OPCODES_H
|
||||
#define _GDSP_OPCODES_H
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
void dsp_op0(uint16 opc);
|
||||
void dsp_op1(uint16 opc);
|
||||
void dsp_op2(uint16 opc);
|
||||
void dsp_op3(uint16 opc);
|
||||
void dsp_op4(uint16 opc);
|
||||
void dsp_op5(uint16 opc);
|
||||
void dsp_op6(uint16 opc);
|
||||
void dsp_op7(uint16 opc);
|
||||
void dsp_op8(uint16 opc);
|
||||
void dsp_op9(uint16 opc);
|
||||
void dsp_opab(uint16 opc);
|
||||
void dsp_opcd(uint16 opc);
|
||||
void dsp_ope(uint16 opc);
|
||||
void dsp_opf(uint16 opc);
|
||||
|
||||
|
||||
#define R_SR 0x13
|
||||
|
||||
#define FLAG_ENABLE_INTERUPT 11
|
||||
|
||||
#endif
|
||||
/*====================================================================
|
||||
|
||||
filename: gdsp_opcodes.h
|
||||
project: GCemu
|
||||
created: 2004-6-18
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie & Tratax
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
#ifndef _GDSP_OPCODES_H
|
||||
#define _GDSP_OPCODES_H
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
void dsp_op0(uint16 opc);
|
||||
void dsp_op1(uint16 opc);
|
||||
void dsp_op2(uint16 opc);
|
||||
void dsp_op3(uint16 opc);
|
||||
void dsp_op4(uint16 opc);
|
||||
void dsp_op5(uint16 opc);
|
||||
void dsp_op6(uint16 opc);
|
||||
void dsp_op7(uint16 opc);
|
||||
void dsp_op8(uint16 opc);
|
||||
void dsp_op9(uint16 opc);
|
||||
void dsp_opab(uint16 opc);
|
||||
void dsp_opcd(uint16 opc);
|
||||
void dsp_ope(uint16 opc);
|
||||
void dsp_opf(uint16 opc);
|
||||
|
||||
|
||||
#define R_SR 0x13
|
||||
|
||||
#define FLAG_ENABLE_INTERUPT 11
|
||||
|
||||
#endif
|
||||
|
@ -1,258 +1,258 @@
|
||||
/*====================================================================
|
||||
|
||||
filename: opcodes.h
|
||||
project: GameCube DSP Tool (gcdsp)
|
||||
created: 2005.03.04
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
|
||||
#ifndef _GDSP_OPCODES_HELPER_H
|
||||
#define _GDSP_OPCODES_HELPER_H
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
#include "gdsp_opcodes.h"
|
||||
#include "gdsp_memory.h"
|
||||
#include "gdsp_interpreter.h"
|
||||
#include "gdsp_registers.h"
|
||||
#include "gdsp_ext_op.h"
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
//
|
||||
// --- SR
|
||||
//
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
inline void dsp_SR_set_flag(uint8 flag)
|
||||
{
|
||||
g_dsp.r[R_SR] |= (1 << flag);
|
||||
}
|
||||
|
||||
|
||||
inline bool dsp_SR_is_flag_set(uint8 flag)
|
||||
{
|
||||
return((g_dsp.r[R_SR] & (1 << flag)) > 0);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
//
|
||||
// --- reg
|
||||
//
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
inline uint16 dsp_op_read_reg(uint8 reg)
|
||||
{
|
||||
uint16 val;
|
||||
|
||||
switch (reg & 0x1f)
|
||||
{
|
||||
case 0x0c:
|
||||
case 0x0d:
|
||||
case 0x0e:
|
||||
case 0x0f:
|
||||
val = dsp_reg_load_stack(reg - 0x0c);
|
||||
break;
|
||||
|
||||
default:
|
||||
val = g_dsp.r[reg];
|
||||
break;
|
||||
}
|
||||
|
||||
return(val);
|
||||
}
|
||||
|
||||
|
||||
inline void dsp_op_write_reg(uint8 reg, uint16 val)
|
||||
{
|
||||
switch (reg & 0x1f)
|
||||
{
|
||||
case 0x0c:
|
||||
case 0x0d:
|
||||
case 0x0e:
|
||||
case 0x0f:
|
||||
dsp_reg_store_stack(reg - 0x0c, val);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_dsp.r[reg] = val;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
//
|
||||
// --- prod
|
||||
//
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
inline sint64 dsp_get_long_prod()
|
||||
{
|
||||
#if PROFILE
|
||||
ProfilerAddDelta(g_dsp.err_pc, 1);
|
||||
#endif
|
||||
|
||||
sint64 val;
|
||||
sint64 low_prod;
|
||||
val = (sint8)g_dsp.r[0x16];
|
||||
val <<= 32;
|
||||
low_prod = g_dsp.r[0x15];
|
||||
low_prod += g_dsp.r[0x17];
|
||||
low_prod <<= 16;
|
||||
low_prod |= g_dsp.r[0x14];
|
||||
val += low_prod;
|
||||
return(val);
|
||||
}
|
||||
|
||||
|
||||
inline void dsp_set_long_prod(sint64 val)
|
||||
{
|
||||
#if PROFILE
|
||||
ProfilerAddDelta(g_dsp.err_pc, 1);
|
||||
#endif
|
||||
|
||||
g_dsp.r[0x14] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x15] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x16] = (uint16)val;
|
||||
g_dsp.r[0x17] = 0;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
//
|
||||
// --- acc
|
||||
//
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
inline sint64 dsp_get_long_acc(uint8 reg)
|
||||
{
|
||||
#if PROFILE
|
||||
ProfilerAddDelta(g_dsp.err_pc, 1);
|
||||
#endif
|
||||
|
||||
_assert_(reg < 2);
|
||||
sint64 val;
|
||||
sint64 low_acc;
|
||||
val = (sint8)g_dsp.r[0x10 + reg];
|
||||
val <<= 32;
|
||||
low_acc = g_dsp.r[0x1e + reg];
|
||||
low_acc <<= 16;
|
||||
low_acc |= g_dsp.r[0x1c + reg];
|
||||
val |= low_acc;
|
||||
return(val);
|
||||
}
|
||||
|
||||
|
||||
inline uint64 dsp_get_ulong_acc(uint8 reg)
|
||||
{
|
||||
#if PROFILE
|
||||
ProfilerAddDelta(g_dsp.err_pc, 1);
|
||||
#endif
|
||||
|
||||
_assert_(reg < 2);
|
||||
uint64 val;
|
||||
uint64 low_acc;
|
||||
val = (uint8)g_dsp.r[0x10 + reg];
|
||||
val <<= 32;
|
||||
low_acc = g_dsp.r[0x1e + reg];
|
||||
low_acc <<= 16;
|
||||
low_acc |= g_dsp.r[0x1c + reg];
|
||||
val |= low_acc;
|
||||
return(val);
|
||||
}
|
||||
|
||||
|
||||
inline void dsp_set_long_acc(uint8 _reg, sint64 val)
|
||||
{
|
||||
#if PROFILE
|
||||
ProfilerAddDelta(g_dsp.err_pc, 1);
|
||||
#endif
|
||||
|
||||
_assert_(_reg < 2);
|
||||
g_dsp.r[0x1c + _reg] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x1e + _reg] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x10 + _reg] = (uint16)val;
|
||||
}
|
||||
|
||||
|
||||
inline sint16 dsp_get_acc_l(uint8 _reg)
|
||||
{
|
||||
_assert_(_reg < 2);
|
||||
return(g_dsp.r[0x1c + _reg]);
|
||||
}
|
||||
|
||||
|
||||
inline sint16 dsp_get_acc_m(uint8 _reg)
|
||||
{
|
||||
_assert_(_reg < 2);
|
||||
return(g_dsp.r[0x1e + _reg]);
|
||||
}
|
||||
|
||||
|
||||
inline sint16 dsp_get_acc_h(uint8 _reg)
|
||||
{
|
||||
_assert_(_reg < 2);
|
||||
return(g_dsp.r[0x10 + _reg]);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
//
|
||||
// --- acx
|
||||
//
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
inline sint64 dsp_get_long_acx(uint8 _reg)
|
||||
{
|
||||
#if PROFILE
|
||||
ProfilerAddDelta(g_dsp.err_pc, 1);
|
||||
#endif
|
||||
|
||||
_assert_(_reg < 2);
|
||||
sint64 val = (sint16)g_dsp.r[0x1a + _reg];
|
||||
val <<= 16;
|
||||
sint64 low_acc = g_dsp.r[0x18 + _reg];
|
||||
val |= low_acc;
|
||||
return(val);
|
||||
}
|
||||
|
||||
|
||||
inline sint16 dsp_get_ax_l(uint8 _reg)
|
||||
{
|
||||
_assert_(_reg < 2);
|
||||
return(g_dsp.r[0x18 + _reg]);
|
||||
}
|
||||
|
||||
|
||||
inline sint16 dsp_get_ax_h(uint8 _reg)
|
||||
{
|
||||
_assert_(_reg < 2);
|
||||
return(g_dsp.r[0x1a + _reg]);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
/*====================================================================
|
||||
|
||||
filename: opcodes.h
|
||||
project: GameCube DSP Tool (gcdsp)
|
||||
created: 2005.03.04
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
|
||||
#ifndef _GDSP_OPCODES_HELPER_H
|
||||
#define _GDSP_OPCODES_HELPER_H
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
#include "gdsp_opcodes.h"
|
||||
#include "gdsp_memory.h"
|
||||
#include "gdsp_interpreter.h"
|
||||
#include "gdsp_registers.h"
|
||||
#include "gdsp_ext_op.h"
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
//
|
||||
// --- SR
|
||||
//
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
inline void dsp_SR_set_flag(uint8 flag)
|
||||
{
|
||||
g_dsp.r[R_SR] |= (1 << flag);
|
||||
}
|
||||
|
||||
|
||||
inline bool dsp_SR_is_flag_set(uint8 flag)
|
||||
{
|
||||
return((g_dsp.r[R_SR] & (1 << flag)) > 0);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
//
|
||||
// --- reg
|
||||
//
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
inline uint16 dsp_op_read_reg(uint8 reg)
|
||||
{
|
||||
uint16 val;
|
||||
|
||||
switch (reg & 0x1f)
|
||||
{
|
||||
case 0x0c:
|
||||
case 0x0d:
|
||||
case 0x0e:
|
||||
case 0x0f:
|
||||
val = dsp_reg_load_stack(reg - 0x0c);
|
||||
break;
|
||||
|
||||
default:
|
||||
val = g_dsp.r[reg];
|
||||
break;
|
||||
}
|
||||
|
||||
return(val);
|
||||
}
|
||||
|
||||
|
||||
inline void dsp_op_write_reg(uint8 reg, uint16 val)
|
||||
{
|
||||
switch (reg & 0x1f)
|
||||
{
|
||||
case 0x0c:
|
||||
case 0x0d:
|
||||
case 0x0e:
|
||||
case 0x0f:
|
||||
dsp_reg_store_stack(reg - 0x0c, val);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_dsp.r[reg] = val;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
//
|
||||
// --- prod
|
||||
//
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
inline sint64 dsp_get_long_prod()
|
||||
{
|
||||
#if PROFILE
|
||||
ProfilerAddDelta(g_dsp.err_pc, 1);
|
||||
#endif
|
||||
|
||||
sint64 val;
|
||||
sint64 low_prod;
|
||||
val = (sint8)g_dsp.r[0x16];
|
||||
val <<= 32;
|
||||
low_prod = g_dsp.r[0x15];
|
||||
low_prod += g_dsp.r[0x17];
|
||||
low_prod <<= 16;
|
||||
low_prod |= g_dsp.r[0x14];
|
||||
val += low_prod;
|
||||
return(val);
|
||||
}
|
||||
|
||||
|
||||
inline void dsp_set_long_prod(sint64 val)
|
||||
{
|
||||
#if PROFILE
|
||||
ProfilerAddDelta(g_dsp.err_pc, 1);
|
||||
#endif
|
||||
|
||||
g_dsp.r[0x14] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x15] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x16] = (uint16)val;
|
||||
g_dsp.r[0x17] = 0;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
//
|
||||
// --- acc
|
||||
//
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
inline sint64 dsp_get_long_acc(uint8 reg)
|
||||
{
|
||||
#if PROFILE
|
||||
ProfilerAddDelta(g_dsp.err_pc, 1);
|
||||
#endif
|
||||
|
||||
_assert_(reg < 2);
|
||||
sint64 val;
|
||||
sint64 low_acc;
|
||||
val = (sint8)g_dsp.r[0x10 + reg];
|
||||
val <<= 32;
|
||||
low_acc = g_dsp.r[0x1e + reg];
|
||||
low_acc <<= 16;
|
||||
low_acc |= g_dsp.r[0x1c + reg];
|
||||
val |= low_acc;
|
||||
return(val);
|
||||
}
|
||||
|
||||
|
||||
inline uint64 dsp_get_ulong_acc(uint8 reg)
|
||||
{
|
||||
#if PROFILE
|
||||
ProfilerAddDelta(g_dsp.err_pc, 1);
|
||||
#endif
|
||||
|
||||
_assert_(reg < 2);
|
||||
uint64 val;
|
||||
uint64 low_acc;
|
||||
val = (uint8)g_dsp.r[0x10 + reg];
|
||||
val <<= 32;
|
||||
low_acc = g_dsp.r[0x1e + reg];
|
||||
low_acc <<= 16;
|
||||
low_acc |= g_dsp.r[0x1c + reg];
|
||||
val |= low_acc;
|
||||
return(val);
|
||||
}
|
||||
|
||||
|
||||
inline void dsp_set_long_acc(uint8 _reg, sint64 val)
|
||||
{
|
||||
#if PROFILE
|
||||
ProfilerAddDelta(g_dsp.err_pc, 1);
|
||||
#endif
|
||||
|
||||
_assert_(_reg < 2);
|
||||
g_dsp.r[0x1c + _reg] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x1e + _reg] = (uint16)val;
|
||||
val >>= 16;
|
||||
g_dsp.r[0x10 + _reg] = (uint16)val;
|
||||
}
|
||||
|
||||
|
||||
inline sint16 dsp_get_acc_l(uint8 _reg)
|
||||
{
|
||||
_assert_(_reg < 2);
|
||||
return(g_dsp.r[0x1c + _reg]);
|
||||
}
|
||||
|
||||
|
||||
inline sint16 dsp_get_acc_m(uint8 _reg)
|
||||
{
|
||||
_assert_(_reg < 2);
|
||||
return(g_dsp.r[0x1e + _reg]);
|
||||
}
|
||||
|
||||
|
||||
inline sint16 dsp_get_acc_h(uint8 _reg)
|
||||
{
|
||||
_assert_(_reg < 2);
|
||||
return(g_dsp.r[0x10 + _reg]);
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
//
|
||||
// --- acx
|
||||
//
|
||||
// ---------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
inline sint64 dsp_get_long_acx(uint8 _reg)
|
||||
{
|
||||
#if PROFILE
|
||||
ProfilerAddDelta(g_dsp.err_pc, 1);
|
||||
#endif
|
||||
|
||||
_assert_(_reg < 2);
|
||||
sint64 val = (sint16)g_dsp.r[0x1a + _reg];
|
||||
val <<= 16;
|
||||
sint64 low_acc = g_dsp.r[0x18 + _reg];
|
||||
val |= low_acc;
|
||||
return(val);
|
||||
}
|
||||
|
||||
|
||||
inline sint16 dsp_get_ax_l(uint8 _reg)
|
||||
{
|
||||
_assert_(_reg < 2);
|
||||
return(g_dsp.r[0x18 + _reg]);
|
||||
}
|
||||
|
||||
|
||||
inline sint16 dsp_get_ax_h(uint8 _reg)
|
||||
{
|
||||
_assert_(_reg < 2);
|
||||
return(g_dsp.r[0x1a + _reg]);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,42 +1,42 @@
|
||||
/*====================================================================
|
||||
|
||||
filename: gdsp_registers.h
|
||||
project: GCemu
|
||||
created: 2004-6-18
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie & Tratax
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
#ifndef _GDSP_REGISTERS_H
|
||||
#define _GDSP_REGISTERS_H
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
#define DSP_REG_ST0 0x0c
|
||||
#define DSP_REG_ST1 0x0c
|
||||
#define DSP_REG_ST2 0x0c
|
||||
#define DSP_REG_ST3 0x0c
|
||||
|
||||
#define DSP_STACK_C 0
|
||||
#define DSP_STACK_D 1
|
||||
|
||||
void dsp_reg_store_stack(uint8 stack_reg, uint16 val);
|
||||
uint16 dsp_reg_load_stack(uint8 stack_reg);
|
||||
|
||||
|
||||
#endif
|
||||
/*====================================================================
|
||||
|
||||
filename: gdsp_registers.h
|
||||
project: GCemu
|
||||
created: 2004-6-18
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie & Tratax
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
#ifndef _GDSP_REGISTERS_H
|
||||
#define _GDSP_REGISTERS_H
|
||||
|
||||
#include "Globals.h"
|
||||
|
||||
#define DSP_REG_ST0 0x0c
|
||||
#define DSP_REG_ST1 0x0c
|
||||
#define DSP_REG_ST2 0x0c
|
||||
#define DSP_REG_ST3 0x0c
|
||||
|
||||
#define DSP_STACK_C 0
|
||||
#define DSP_STACK_D 1
|
||||
|
||||
void dsp_reg_store_stack(uint8 stack_reg, uint16 val);
|
||||
uint16 dsp_reg_load_stack(uint8 stack_reg);
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -1,86 +1,86 @@
|
||||
/*====================================================================
|
||||
|
||||
filename: opcodes.h
|
||||
project: GameCube DSP Tool (gcdsp)
|
||||
created: 2005.03.04
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
#ifndef _OPCODES_H
|
||||
#define _OPCODES_H
|
||||
|
||||
enum partype_t
|
||||
{
|
||||
P_NONE = 0x0000,
|
||||
P_VAL = 0x0001,
|
||||
P_IMM = 0x0002,
|
||||
P_MEM = 0x0003,
|
||||
P_STR = 0x0004,
|
||||
P_REG = 0x8000,
|
||||
P_REG08 = P_REG | 0x0800,
|
||||
P_REG10 = P_REG | 0x1000,
|
||||
P_REG18 = P_REG | 0x1800,
|
||||
P_REG19 = P_REG | 0x1900,
|
||||
P_REG1A = P_REG | 0x1a00,
|
||||
P_REG1C = P_REG | 0x1c00,
|
||||
P_ACCM = P_REG | 0x1e00,
|
||||
P_ACCM_D = P_REG | 0x1e80,
|
||||
P_ACC = P_REG | 0x2000,
|
||||
P_ACC_D = P_REG | 0x2080,
|
||||
P_AX = P_REG | 0x2200,
|
||||
P_AX_D = P_REG | 0x2280,
|
||||
P_REGS_MASK = 0x03f80,
|
||||
P_REF = P_REG | 0x4000,
|
||||
P_PRG = P_REF | P_REG,
|
||||
};
|
||||
|
||||
#define P_EXT 0x80
|
||||
|
||||
typedef struct opcpar_t
|
||||
{
|
||||
partype_t type;
|
||||
uint8 size;
|
||||
uint8 loc;
|
||||
sint8 lshift;
|
||||
uint16 mask;
|
||||
} opcpar_t;
|
||||
|
||||
typedef struct opc_t
|
||||
{
|
||||
const char* name;
|
||||
uint16 opcode;
|
||||
uint16 opcode_mask;
|
||||
uint8 size;
|
||||
uint8 param_count;
|
||||
opcpar_t params[8];
|
||||
} opc_t;
|
||||
|
||||
extern opc_t opcodes[];
|
||||
extern const uint32 opcodes_size;
|
||||
extern opc_t opcodes_ext[];
|
||||
extern const uint32 opcodes_ext_size;
|
||||
|
||||
inline uint16 swap16(uint16 x)
|
||||
{
|
||||
return((x >> 8) | (x << 8));
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
/*====================================================================
|
||||
|
||||
filename: opcodes.h
|
||||
project: GameCube DSP Tool (gcdsp)
|
||||
created: 2005.03.04
|
||||
mail: duddie@walla.com
|
||||
|
||||
Copyright (c) 2005 Duddie
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
====================================================================*/
|
||||
#ifndef _OPCODES_H
|
||||
#define _OPCODES_H
|
||||
|
||||
enum partype_t
|
||||
{
|
||||
P_NONE = 0x0000,
|
||||
P_VAL = 0x0001,
|
||||
P_IMM = 0x0002,
|
||||
P_MEM = 0x0003,
|
||||
P_STR = 0x0004,
|
||||
P_REG = 0x8000,
|
||||
P_REG08 = P_REG | 0x0800,
|
||||
P_REG10 = P_REG | 0x1000,
|
||||
P_REG18 = P_REG | 0x1800,
|
||||
P_REG19 = P_REG | 0x1900,
|
||||
P_REG1A = P_REG | 0x1a00,
|
||||
P_REG1C = P_REG | 0x1c00,
|
||||
P_ACCM = P_REG | 0x1e00,
|
||||
P_ACCM_D = P_REG | 0x1e80,
|
||||
P_ACC = P_REG | 0x2000,
|
||||
P_ACC_D = P_REG | 0x2080,
|
||||
P_AX = P_REG | 0x2200,
|
||||
P_AX_D = P_REG | 0x2280,
|
||||
P_REGS_MASK = 0x03f80,
|
||||
P_REF = P_REG | 0x4000,
|
||||
P_PRG = P_REF | P_REG,
|
||||
};
|
||||
|
||||
#define P_EXT 0x80
|
||||
|
||||
typedef struct opcpar_t
|
||||
{
|
||||
partype_t type;
|
||||
uint8 size;
|
||||
uint8 loc;
|
||||
sint8 lshift;
|
||||
uint16 mask;
|
||||
} opcpar_t;
|
||||
|
||||
typedef struct opc_t
|
||||
{
|
||||
const char* name;
|
||||
uint16 opcode;
|
||||
uint16 opcode_mask;
|
||||
uint8 size;
|
||||
uint8 param_count;
|
||||
opcpar_t params[8];
|
||||
} opc_t;
|
||||
|
||||
extern opc_t opcodes[];
|
||||
extern const uint32 opcodes_size;
|
||||
extern opc_t opcodes_ext[];
|
||||
extern const uint32 opcodes_ext_size;
|
||||
|
||||
inline uint16 swap16(uint16 x)
|
||||
{
|
||||
return((x >> 8) | (x << 8));
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1,36 +1,36 @@
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
|
||||
// WTL
|
||||
#include <atlbase.h>
|
||||
#include <atlapp.h>
|
||||
|
||||
#include <atlwin.h>
|
||||
#include <atlframe.h>
|
||||
#include <atlctrls.h>
|
||||
#include <atldlgs.h>
|
||||
|
||||
#include "PluginSpecs_DSP.h"
|
||||
|
||||
// Copyright (C) 2003-2008 Dolphin Project.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 2.0.
|
||||
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License 2.0 for more details.
|
||||
|
||||
// A copy of the GPL 2.0 should have been included with the program.
|
||||
// If not, see http://www.gnu.org/licenses/
|
||||
|
||||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#define _CRT_SECURE_NO_DEPRECATE 1
|
||||
|
||||
#include <windows.h>
|
||||
#include <tchar.h>
|
||||
|
||||
// WTL
|
||||
#include <atlbase.h>
|
||||
#include <atlapp.h>
|
||||
|
||||
#include <atlwin.h>
|
||||
#include <atlframe.h>
|
||||
#include <atlctrls.h>
|
||||
#include <atldlgs.h>
|
||||
|
||||
#include "PluginSpecs_DSP.h"
|
||||
|
||||
|
Reference in New Issue
Block a user