enable newline normalization
get revision number via `hg svn info` for svnrev.h
ignore incremental/generated binary files (windows/VS at least)
leave a comment if some files need native eol set in svnprops

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5637 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman
2010-06-09 01:37:08 +00:00
parent dacd557f57
commit 4a0c8fc0c9
200 changed files with 94029 additions and 95353 deletions

View File

@ -1,320 +1,320 @@
/*====================================================================
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.
====================================================================*/
//
//
// At the moment just ls and sl are using the prolog
// perhaps all actions on r03 must be in the prolog
//
#include <stdafx.h>
#include "OutBuffer.h"
//
void dsp_op_ext_r_epi(uint16 _Opcode)
{
uint8 op = (_Opcode >> 2) & 0x3;
uint8 reg = _Opcode & 0x3;
switch (op)
{
case 0x00:
OutBuffer::AddCode("Error: dsp_op_ext_r_epi");
break;
case 0x01:
OutBuffer::AddCode("%s--", OutBuffer::GetRegName(reg));
// g_dsp.r[reg]--;
break;
case 0x02:
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(reg));
//g_dsp.r[reg]++;
break;
case 0x03:
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(reg), OutBuffer::GetRegName(reg+4));
// g_dsp.r[reg] += g_dsp.r[reg + 4];
break;
}
}
void dsp_op_ext_mv(uint16 _Opcode)
{
uint8 sreg = _Opcode & 0x3;
uint8 dreg = ((_Opcode >> 2) & 0x3);
OutBuffer::AddCode("%s = %s", OutBuffer::GetRegName(dreg + 0x18), OutBuffer::GetRegName(sreg + 0x1c));
// g_dsp.r[dreg + 0x18] = g_dsp.r[sreg + 0x1c];
}
void dsp_op_ext_s(uint16 _Opcode)
{
uint8 dreg = _Opcode & 0x3;
uint8 sreg = ((_Opcode >> 3) & 0x3) + 0x1c;
OutBuffer::AddCode("WriteDMEM(%s, %s)", OutBuffer::GetRegName(dreg), OutBuffer::GetRegName(sreg));
// dsp_dmem_write(g_dsp.r[dreg], g_dsp.r[sreg]);
if (_Opcode & 0x04)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(dreg), OutBuffer::GetRegName(dreg+4));
// g_dsp.r[dreg] += g_dsp.r[dreg + 4];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(dreg));
//g_dsp.r[dreg]++;
}
}
void dsp_op_ext_l(uint16 _Opcode)
{
uint8 sreg = _Opcode & 0x3;
uint8 dreg = ((_Opcode >> 3) & 0x7) + 0x18;
OutBuffer::AddCode("%s = ReadDMEM(%s)", OutBuffer::GetRegName(dreg), OutBuffer::GetRegName(sreg));
// uint16 val = dsp_dmem_read(g_dsp.r[sreg]);
// g_dsp.r[dreg] = val;
if (_Opcode & 0x04)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(sreg), OutBuffer::GetRegName(sreg+4));
// g_dsp.r[sreg] += g_dsp.r[sreg + 4];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(sreg));
// g_dsp.r[sreg]++;
}
}
void dsp_op_ext_ls_pro(uint16 _Opcode)
{
uint8 areg = (_Opcode & 0x1) + 0x1e;
OutBuffer::AddCode("WriteDMEM(%s, %s)", OutBuffer::GetRegName(0x03), OutBuffer::GetRegName(areg));
// dsp_dmem_write(g_dsp.r[0x03], g_dsp.r[areg]);
if (_Opcode & 0x8)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(0x03), OutBuffer::GetRegName(0x07));
// g_dsp.r[0x03] += g_dsp.r[0x07];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(0x03));
// g_dsp.r[0x03]++;
}
}
void dsp_op_ext_ls_epi(uint16 _Opcode)
{
uint8 dreg = ((_Opcode >> 4) & 0x3) + 0x18;
OutBuffer::AddCode("%s = ReadDMEM(%s)", OutBuffer::GetRegName(dreg), OutBuffer::GetRegName(0x00));
// uint16 val = dsp_dmem_read(g_dsp.r[0x00]);
// dsp_op_write_reg(dreg, val);
if (_Opcode & 0x4)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(0x00), OutBuffer::GetRegName(0x04));
// g_dsp.r[0x00] += g_dsp.r[0x04];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(0x00));
// g_dsp.r[0x00]++;
}
}
void dsp_op_ext_sl_pro(uint16 _Opcode)
{
uint8 areg = (_Opcode & 0x1) + 0x1e;
OutBuffer::AddCode("WriteDMEM(%s, %s)", OutBuffer::GetRegName(0x00), OutBuffer::GetRegName(areg));
// dsp_dmem_write(g_dsp.r[0x00], g_dsp.r[areg]);
if (_Opcode & 0x4)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(0x00), OutBuffer::GetRegName(0x04));
// g_dsp.r[0x00] += g_dsp.r[0x04];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(0x00));
// g_dsp.r[0x00]++;
}
}
void dsp_op_ext_sl_epi(uint16 _Opcode)
{
uint8 dreg = ((_Opcode >> 4) & 0x3) + 0x18;
OutBuffer::AddCode("%s = ReadDMEM(%s)", OutBuffer::GetRegName(dreg), OutBuffer::GetRegName(0x03));
// uint16 val = dsp_dmem_read(g_dsp.r[0x03]);
// dsp_op_write_reg(dreg, val);
if (_Opcode & 0x8)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(0x03), OutBuffer::GetRegName(0x07));
// g_dsp.r[0x03] += g_dsp.r[0x07];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(0x03));
// g_dsp.r[0x03]++;
}
}
void dsp_op_ext_ld(uint16 _Opcode)
{
uint8 dreg1 = (((_Opcode >> 5) & 0x1) << 1) + 0x18;
uint8 dreg2 = (((_Opcode >> 4) & 0x1) << 1) + 0x19;
uint8 sreg = _Opcode & 0x3;
OutBuffer::AddCode("%s = ReadDMEM(%s)", OutBuffer::GetRegName(dreg1), OutBuffer::GetRegName(sreg));
OutBuffer::AddCode("%s = ReadDMEM(%s)", OutBuffer::GetRegName(dreg2), OutBuffer::GetRegName(0x03));
// g_dsp.r[dreg1] = dsp_dmem_read(g_dsp.r[sreg]);
// g_dsp.r[dreg2] = dsp_dmem_read(g_dsp.r[0x03]);
if (_Opcode & 0x04)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(sreg), OutBuffer::GetRegName(sreg + 0x04));
// g_dsp.r[sreg] += g_dsp.r[sreg + 0x04];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(sreg));
// g_dsp.r[sreg]++;
}
if (_Opcode & 0x08)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(0x03), OutBuffer::GetRegName(sreg + 0x07));
// g_dsp.r[0x03] += g_dsp.r[0x07];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(0x03));
// g_dsp.r[0x03]++;
}
}
// ================================================================================
//
//
//
// ================================================================================
void dsp_op_ext_ops_pro(uint16 _Opcode)
{
if ((_Opcode & 0xFF) == 0){return;}
switch ((_Opcode >> 4) & 0xf)
{
case 0x00:
dsp_op_ext_r_epi(_Opcode);
break;
case 0x01:
dsp_op_ext_mv(_Opcode);
break;
case 0x02:
case 0x03:
dsp_op_ext_s(_Opcode);
break;
case 0x04:
case 0x05:
case 0x06:
case 0x07:
dsp_op_ext_l(_Opcode);
break;
case 0x08:
case 0x09:
case 0x0a:
case 0x0b:
if (_Opcode & 0x2)
{
dsp_op_ext_sl_pro(_Opcode);
}
else
{
dsp_op_ext_ls_pro(_Opcode);
}
return;
case 0x0c:
case 0x0d:
case 0x0e:
case 0x0f:
dsp_op_ext_ld(_Opcode);
break;
}
}
void dsp_op_ext_ops_epi(uint16 _Opcode)
{
if ((_Opcode & 0xFF) == 0){return;}
switch ((_Opcode >> 4) & 0xf)
{
case 0x08:
case 0x09:
case 0x0a:
case 0x0b:
if (_Opcode & 0x2)
{
dsp_op_ext_sl_epi(_Opcode);
}
else
{
dsp_op_ext_ls_epi(_Opcode);
}
return;
}
}
/*====================================================================
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.
====================================================================*/
//
//
// At the moment just ls and sl are using the prolog
// perhaps all actions on r03 must be in the prolog
//
#include <stdafx.h>
#include "OutBuffer.h"
//
void dsp_op_ext_r_epi(uint16 _Opcode)
{
uint8 op = (_Opcode >> 2) & 0x3;
uint8 reg = _Opcode & 0x3;
switch (op)
{
case 0x00:
OutBuffer::AddCode("Error: dsp_op_ext_r_epi");
break;
case 0x01:
OutBuffer::AddCode("%s--", OutBuffer::GetRegName(reg));
// g_dsp.r[reg]--;
break;
case 0x02:
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(reg));
//g_dsp.r[reg]++;
break;
case 0x03:
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(reg), OutBuffer::GetRegName(reg+4));
// g_dsp.r[reg] += g_dsp.r[reg + 4];
break;
}
}
void dsp_op_ext_mv(uint16 _Opcode)
{
uint8 sreg = _Opcode & 0x3;
uint8 dreg = ((_Opcode >> 2) & 0x3);
OutBuffer::AddCode("%s = %s", OutBuffer::GetRegName(dreg + 0x18), OutBuffer::GetRegName(sreg + 0x1c));
// g_dsp.r[dreg + 0x18] = g_dsp.r[sreg + 0x1c];
}
void dsp_op_ext_s(uint16 _Opcode)
{
uint8 dreg = _Opcode & 0x3;
uint8 sreg = ((_Opcode >> 3) & 0x3) + 0x1c;
OutBuffer::AddCode("WriteDMEM(%s, %s)", OutBuffer::GetRegName(dreg), OutBuffer::GetRegName(sreg));
// dsp_dmem_write(g_dsp.r[dreg], g_dsp.r[sreg]);
if (_Opcode & 0x04)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(dreg), OutBuffer::GetRegName(dreg+4));
// g_dsp.r[dreg] += g_dsp.r[dreg + 4];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(dreg));
//g_dsp.r[dreg]++;
}
}
void dsp_op_ext_l(uint16 _Opcode)
{
uint8 sreg = _Opcode & 0x3;
uint8 dreg = ((_Opcode >> 3) & 0x7) + 0x18;
OutBuffer::AddCode("%s = ReadDMEM(%s)", OutBuffer::GetRegName(dreg), OutBuffer::GetRegName(sreg));
// uint16 val = dsp_dmem_read(g_dsp.r[sreg]);
// g_dsp.r[dreg] = val;
if (_Opcode & 0x04)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(sreg), OutBuffer::GetRegName(sreg+4));
// g_dsp.r[sreg] += g_dsp.r[sreg + 4];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(sreg));
// g_dsp.r[sreg]++;
}
}
void dsp_op_ext_ls_pro(uint16 _Opcode)
{
uint8 areg = (_Opcode & 0x1) + 0x1e;
OutBuffer::AddCode("WriteDMEM(%s, %s)", OutBuffer::GetRegName(0x03), OutBuffer::GetRegName(areg));
// dsp_dmem_write(g_dsp.r[0x03], g_dsp.r[areg]);
if (_Opcode & 0x8)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(0x03), OutBuffer::GetRegName(0x07));
// g_dsp.r[0x03] += g_dsp.r[0x07];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(0x03));
// g_dsp.r[0x03]++;
}
}
void dsp_op_ext_ls_epi(uint16 _Opcode)
{
uint8 dreg = ((_Opcode >> 4) & 0x3) + 0x18;
OutBuffer::AddCode("%s = ReadDMEM(%s)", OutBuffer::GetRegName(dreg), OutBuffer::GetRegName(0x00));
// uint16 val = dsp_dmem_read(g_dsp.r[0x00]);
// dsp_op_write_reg(dreg, val);
if (_Opcode & 0x4)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(0x00), OutBuffer::GetRegName(0x04));
// g_dsp.r[0x00] += g_dsp.r[0x04];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(0x00));
// g_dsp.r[0x00]++;
}
}
void dsp_op_ext_sl_pro(uint16 _Opcode)
{
uint8 areg = (_Opcode & 0x1) + 0x1e;
OutBuffer::AddCode("WriteDMEM(%s, %s)", OutBuffer::GetRegName(0x00), OutBuffer::GetRegName(areg));
// dsp_dmem_write(g_dsp.r[0x00], g_dsp.r[areg]);
if (_Opcode & 0x4)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(0x00), OutBuffer::GetRegName(0x04));
// g_dsp.r[0x00] += g_dsp.r[0x04];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(0x00));
// g_dsp.r[0x00]++;
}
}
void dsp_op_ext_sl_epi(uint16 _Opcode)
{
uint8 dreg = ((_Opcode >> 4) & 0x3) + 0x18;
OutBuffer::AddCode("%s = ReadDMEM(%s)", OutBuffer::GetRegName(dreg), OutBuffer::GetRegName(0x03));
// uint16 val = dsp_dmem_read(g_dsp.r[0x03]);
// dsp_op_write_reg(dreg, val);
if (_Opcode & 0x8)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(0x03), OutBuffer::GetRegName(0x07));
// g_dsp.r[0x03] += g_dsp.r[0x07];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(0x03));
// g_dsp.r[0x03]++;
}
}
void dsp_op_ext_ld(uint16 _Opcode)
{
uint8 dreg1 = (((_Opcode >> 5) & 0x1) << 1) + 0x18;
uint8 dreg2 = (((_Opcode >> 4) & 0x1) << 1) + 0x19;
uint8 sreg = _Opcode & 0x3;
OutBuffer::AddCode("%s = ReadDMEM(%s)", OutBuffer::GetRegName(dreg1), OutBuffer::GetRegName(sreg));
OutBuffer::AddCode("%s = ReadDMEM(%s)", OutBuffer::GetRegName(dreg2), OutBuffer::GetRegName(0x03));
// g_dsp.r[dreg1] = dsp_dmem_read(g_dsp.r[sreg]);
// g_dsp.r[dreg2] = dsp_dmem_read(g_dsp.r[0x03]);
if (_Opcode & 0x04)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(sreg), OutBuffer::GetRegName(sreg + 0x04));
// g_dsp.r[sreg] += g_dsp.r[sreg + 0x04];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(sreg));
// g_dsp.r[sreg]++;
}
if (_Opcode & 0x08)
{
OutBuffer::AddCode("%s += %s", OutBuffer::GetRegName(0x03), OutBuffer::GetRegName(sreg + 0x07));
// g_dsp.r[0x03] += g_dsp.r[0x07];
}
else
{
OutBuffer::AddCode("%s++", OutBuffer::GetRegName(0x03));
// g_dsp.r[0x03]++;
}
}
// ================================================================================
//
//
//
// ================================================================================
void dsp_op_ext_ops_pro(uint16 _Opcode)
{
if ((_Opcode & 0xFF) == 0){return;}
switch ((_Opcode >> 4) & 0xf)
{
case 0x00:
dsp_op_ext_r_epi(_Opcode);
break;
case 0x01:
dsp_op_ext_mv(_Opcode);
break;
case 0x02:
case 0x03:
dsp_op_ext_s(_Opcode);
break;
case 0x04:
case 0x05:
case 0x06:
case 0x07:
dsp_op_ext_l(_Opcode);
break;
case 0x08:
case 0x09:
case 0x0a:
case 0x0b:
if (_Opcode & 0x2)
{
dsp_op_ext_sl_pro(_Opcode);
}
else
{
dsp_op_ext_ls_pro(_Opcode);
}
return;
case 0x0c:
case 0x0d:
case 0x0e:
case 0x0f:
dsp_op_ext_ld(_Opcode);
break;
}
}
void dsp_op_ext_ops_epi(uint16 _Opcode)
{
if ((_Opcode & 0xFF) == 0){return;}
switch ((_Opcode >> 4) & 0xf)
{
case 0x08:
case 0x09:
case 0x0a:
case 0x0b:
if (_Opcode & 0x2)
{
dsp_op_ext_sl_epi(_Opcode);
}
else
{
dsp_op_ext_ls_epi(_Opcode);
}
return;
}
}

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -1,48 +1,48 @@
/*====================================================================
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
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
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

View File

@ -1,155 +1,155 @@
// stdafx.cpp : source file that includes just the standard includes
// DSP_InterC.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
#include <stdarg.h>
#include <stdio.h>
namespace OutBuffer
{
void Init()
{
}
void Add(const char* _fmt, ...)
{
static char Msg[2048];
va_list ap;
va_start(ap, _fmt);
vsprintf(Msg, _fmt, ap);
va_end(ap);
printf("%s\n", Msg);
}
void AddCode(const char* _fmt, ...)
{
static char Msg[2048];
va_list ap;
va_start(ap, _fmt);
vsprintf(Msg, _fmt, ap);
va_end(ap);
printf(" %s;\n", Msg);
}
// predefined labels
typedef struct pdlabel_t
{
uint16 addr;
const char* name;
const char* description;
} pdlabels_t;
pdlabel_t regnames[] =
{
{0x00, "R00", "Register 00",},
{0x01, "R01", "Register 01",},
{0x02, "R02", "Register 02",},
{0x03, "R03", "Register 03",},
{0x04, "R04", "Register 04",},
{0x05, "R05", "Register 05",},
{0x06, "R06", "Register 06",},
{0x07, "R07", "Register 07",},
{0x08, "R08", "Register 08",},
{0x09, "R09", "Register 09",},
{0x0a, "R10", "Register 10",},
{0x0b, "R11", "Register 11",},
{0x0c, "ST0", "Call stack",},
{0x0d, "ST1", "Data stack",},
{0x0e, "ST2", "Loop address stack",},
{0x0f, "ST3", "Loop counter",},
{0x00, "ACH0", "Accumulator High 0",},
{0x11, "ACH1", "Accumulator High 1",},
{0x12, "CR", "Config Register",},
{0x13, "SR", "Special Register",},
{0x14, "PROD_l", "PROD L",},
{0x15, "PROD_m1", "PROD M1",},
{0x16, "PROD_h", "PROD H",},
{0x17, "PROD_m2", "PROD M2",},
{0x18, "AX0_l", "Additional Accumulators Low 0",},
{0x19, "AX1_l", "Additional Accumulators Low 1",},
{0x1a, "AX0_h", "Additional Accumulators High 0",},
{0x1b, "AX1_h", "Additional Accumulators High 1",},
{0x1c, "AC0_l", "Register 28",},
{0x1d, "AC1_l", "Register 29",},
{0x1e, "AC0_m", "Register 00",},
{0x1f, "AC1_m", "Register 00",},
// additional to resolve special names
{0x20, "ACC0", "Accumulators 0",},
{0x21, "ACC1", "Accumulators 1",},
{0x22, "AX0", "Additional Accumulators 0",},
{0x23, "AX1", "Additional Accumulators 1",},
};
const pdlabel_t pdlabels[] =
{
{0xffa0, "COEF_A1_0", "COEF_A1_0",},
{0xffa1, "COEF_A2_0", "COEF_A2_0",},
{0xffa2, "COEF_A1_1", "COEF_A1_1",},
{0xffa3, "COEF_A2_1", "COEF_A2_1",},
{0xffa4, "COEF_A1_2", "COEF_A1_2",},
{0xffa5, "COEF_A2_2", "COEF_A2_2",},
{0xffa6, "COEF_A1_3", "COEF_A1_3",},
{0xffa7, "COEF_A2_3", "COEF_A2_3",},
{0xffa8, "COEF_A1_4", "COEF_A1_4",},
{0xffa9, "COEF_A2_4", "COEF_A2_4",},
{0xffaa, "COEF_A1_5", "COEF_A1_5",},
{0xffab, "COEF_A2_5", "COEF_A2_5",},
{0xffac, "COEF_A1_6", "COEF_A1_6",},
{0xffad, "COEF_A2_6", "COEF_A2_6",},
{0xffae, "COEF_A1_7", "COEF_A1_7",},
{0xffaf, "COEF_A2_7", "COEF_A2_7",},
{0xffc9, "DSCR", "DSP DMA Control Reg",},
{0xffcb, "DSBL", "DSP DMA Block Length",},
{0xffcd, "DSPA", "DSP DMA DMEM Address",},
{0xffce, "DSMAH", "DSP DMA Mem Address H",},
{0xffcf, "DSMAL", "DSP DMA Mem Address L",},
{0xffd1, "SampleFormat", "SampleFormat",},
{0xffd3, "Unk Zelda", "Unk Zelda writes to it",},
{0xffd4, "ACSAH", "Accelerator start address H",},
{0xffd5, "ACSAL", "Accelerator start address L",},
{0xffd6, "ACEAH", "Accelerator end address H",},
{0xffd7, "ACEAL", "Accelerator end address L",},
{0xffd8, "ACCAH", "Accelerator current address H",},
{0xffd9, "ACCAL", "Accelerator current address L",},
{0xffda, "pred_scale", "pred_scale",},
{0xffdb, "yn1", "yn1",},
{0xffdc, "yn2", "yn2",},
{0xffdd, "ARAM", "Direct Read from ARAM (uses ADPCM)",},
{0xffde, "GAIN", "Gain",},
{0xffef, "AMDM", "ARAM DMA Request Mask",},
{0xfffb, "DIRQ", "DSP IRQ Request",},
{0xfffc, "DMBH", "DSP Mailbox H",},
{0xfffd, "DMBL", "DSP Mailbox L",},
{0xfffe, "CMBH", "CPU Mailbox H",},
{0xffff, "CMBL", "CPU Mailbox L",},
};
const char* GetRegName(uint16 reg)
{
return regnames[reg].name;
}
const char* GetMemName(uint16 addr)
{
static char Buffer[1024];
for (int i=0; i<sizeof(pdlabels); i++)
{
if (pdlabels[i].addr == addr)
return pdlabels[i].name;
}
sprintf(Buffer, "0x%4x", addr);
return Buffer;
}
}
// stdafx.cpp : source file that includes just the standard includes
// DSP_InterC.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
#include <stdarg.h>
#include <stdio.h>
namespace OutBuffer
{
void Init()
{
}
void Add(const char* _fmt, ...)
{
static char Msg[2048];
va_list ap;
va_start(ap, _fmt);
vsprintf(Msg, _fmt, ap);
va_end(ap);
printf("%s\n", Msg);
}
void AddCode(const char* _fmt, ...)
{
static char Msg[2048];
va_list ap;
va_start(ap, _fmt);
vsprintf(Msg, _fmt, ap);
va_end(ap);
printf(" %s;\n", Msg);
}
// predefined labels
typedef struct pdlabel_t
{
uint16 addr;
const char* name;
const char* description;
} pdlabels_t;
pdlabel_t regnames[] =
{
{0x00, "R00", "Register 00",},
{0x01, "R01", "Register 01",},
{0x02, "R02", "Register 02",},
{0x03, "R03", "Register 03",},
{0x04, "R04", "Register 04",},
{0x05, "R05", "Register 05",},
{0x06, "R06", "Register 06",},
{0x07, "R07", "Register 07",},
{0x08, "R08", "Register 08",},
{0x09, "R09", "Register 09",},
{0x0a, "R10", "Register 10",},
{0x0b, "R11", "Register 11",},
{0x0c, "ST0", "Call stack",},
{0x0d, "ST1", "Data stack",},
{0x0e, "ST2", "Loop address stack",},
{0x0f, "ST3", "Loop counter",},
{0x00, "ACH0", "Accumulator High 0",},
{0x11, "ACH1", "Accumulator High 1",},
{0x12, "CR", "Config Register",},
{0x13, "SR", "Special Register",},
{0x14, "PROD_l", "PROD L",},
{0x15, "PROD_m1", "PROD M1",},
{0x16, "PROD_h", "PROD H",},
{0x17, "PROD_m2", "PROD M2",},
{0x18, "AX0_l", "Additional Accumulators Low 0",},
{0x19, "AX1_l", "Additional Accumulators Low 1",},
{0x1a, "AX0_h", "Additional Accumulators High 0",},
{0x1b, "AX1_h", "Additional Accumulators High 1",},
{0x1c, "AC0_l", "Register 28",},
{0x1d, "AC1_l", "Register 29",},
{0x1e, "AC0_m", "Register 00",},
{0x1f, "AC1_m", "Register 00",},
// additional to resolve special names
{0x20, "ACC0", "Accumulators 0",},
{0x21, "ACC1", "Accumulators 1",},
{0x22, "AX0", "Additional Accumulators 0",},
{0x23, "AX1", "Additional Accumulators 1",},
};
const pdlabel_t pdlabels[] =
{
{0xffa0, "COEF_A1_0", "COEF_A1_0",},
{0xffa1, "COEF_A2_0", "COEF_A2_0",},
{0xffa2, "COEF_A1_1", "COEF_A1_1",},
{0xffa3, "COEF_A2_1", "COEF_A2_1",},
{0xffa4, "COEF_A1_2", "COEF_A1_2",},
{0xffa5, "COEF_A2_2", "COEF_A2_2",},
{0xffa6, "COEF_A1_3", "COEF_A1_3",},
{0xffa7, "COEF_A2_3", "COEF_A2_3",},
{0xffa8, "COEF_A1_4", "COEF_A1_4",},
{0xffa9, "COEF_A2_4", "COEF_A2_4",},
{0xffaa, "COEF_A1_5", "COEF_A1_5",},
{0xffab, "COEF_A2_5", "COEF_A2_5",},
{0xffac, "COEF_A1_6", "COEF_A1_6",},
{0xffad, "COEF_A2_6", "COEF_A2_6",},
{0xffae, "COEF_A1_7", "COEF_A1_7",},
{0xffaf, "COEF_A2_7", "COEF_A2_7",},
{0xffc9, "DSCR", "DSP DMA Control Reg",},
{0xffcb, "DSBL", "DSP DMA Block Length",},
{0xffcd, "DSPA", "DSP DMA DMEM Address",},
{0xffce, "DSMAH", "DSP DMA Mem Address H",},
{0xffcf, "DSMAL", "DSP DMA Mem Address L",},
{0xffd1, "SampleFormat", "SampleFormat",},
{0xffd3, "Unk Zelda", "Unk Zelda writes to it",},
{0xffd4, "ACSAH", "Accelerator start address H",},
{0xffd5, "ACSAL", "Accelerator start address L",},
{0xffd6, "ACEAH", "Accelerator end address H",},
{0xffd7, "ACEAL", "Accelerator end address L",},
{0xffd8, "ACCAH", "Accelerator current address H",},
{0xffd9, "ACCAL", "Accelerator current address L",},
{0xffda, "pred_scale", "pred_scale",},
{0xffdb, "yn1", "yn1",},
{0xffdc, "yn2", "yn2",},
{0xffdd, "ARAM", "Direct Read from ARAM (uses ADPCM)",},
{0xffde, "GAIN", "Gain",},
{0xffef, "AMDM", "ARAM DMA Request Mask",},
{0xfffb, "DIRQ", "DSP IRQ Request",},
{0xfffc, "DMBH", "DSP Mailbox H",},
{0xfffd, "DMBL", "DSP Mailbox L",},
{0xfffe, "CMBH", "CPU Mailbox H",},
{0xffff, "CMBL", "CPU Mailbox L",},
};
const char* GetRegName(uint16 reg)
{
return regnames[reg].name;
}
const char* GetMemName(uint16 addr)
{
static char Buffer[1024];
for (int i=0; i<sizeof(pdlabels); i++)
{
if (pdlabels[i].addr == addr)
return pdlabels[i].name;
}
sprintf(Buffer, "0x%4x", addr);
return Buffer;
}
}

View File

@ -1,23 +1,23 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
namespace OutBuffer
{
void Init();
void Add(const char* _fmt, ...);
void AddCode(const char* _fmt, ...);
const char* GetRegName(uint16 reg);
const char* GetMemName(uint16 addr);
}
// TODO: reference additional headers your program requires here
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
namespace OutBuffer
{
void Init();
void Add(const char* _fmt, ...);
void AddCode(const char* _fmt, ...);
const char* GetRegName(uint16 reg);
const char* GetMemName(uint16 addr);
}
// TODO: reference additional headers your program requires here

View File

@ -1,234 +1,234 @@
/*====================================================================
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()
{
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)
{
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)
{
_dbg_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)
{
_dbg_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)
{
_dbg_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)
{
_dbg_assert_(_reg < 2);
return(g_dsp.r[0x1c + _reg]);
}
inline sint16 dsp_get_acc_m(uint8 _reg)
{
_dbg_assert_(_reg < 2);
return(g_dsp.r[0x1e + _reg]);
}
inline sint16 dsp_get_acc_h(uint8 _reg)
{
_dbg_assert_(_reg < 2);
return(g_dsp.r[0x10 + _reg]);
}
// ---------------------------------------------------------------------------------------
//
// --- acx
//
// ---------------------------------------------------------------------------------------
inline sint64 dsp_get_long_acx(uint8 _reg)
{
_dbg_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)
{
_dbg_assert_(_reg < 2);
return(g_dsp.r[0x18 + _reg]);
}
inline sint16 dsp_get_ax_h(uint8 _reg)
{
_dbg_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()
{
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)
{
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)
{
_dbg_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)
{
_dbg_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)
{
_dbg_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)
{
_dbg_assert_(_reg < 2);
return(g_dsp.r[0x1c + _reg]);
}
inline sint16 dsp_get_acc_m(uint8 _reg)
{
_dbg_assert_(_reg < 2);
return(g_dsp.r[0x1e + _reg]);
}
inline sint16 dsp_get_acc_h(uint8 _reg)
{
_dbg_assert_(_reg < 2);
return(g_dsp.r[0x10 + _reg]);
}
// ---------------------------------------------------------------------------------------
//
// --- acx
//
// ---------------------------------------------------------------------------------------
inline sint64 dsp_get_long_acx(uint8 _reg)
{
_dbg_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)
{
_dbg_assert_(_reg < 2);
return(g_dsp.r[0x18 + _reg]);
}
inline sint16 dsp_get_ax_h(uint8 _reg)
{
_dbg_assert_(_reg < 2);
return(g_dsp.r[0x1a + _reg]);
}
#endif

View File

@ -1,23 +1,23 @@
// stdafx.cpp : source file that includes just the standard includes
// DSP_InterC.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
#include <stdarg.h>
void ErrorLog(const char* _fmt, ...)
{
char Msg[512];
va_list ap;
va_start(ap, _fmt);
vsprintf(Msg, _fmt, ap);
va_end(ap);
printf("Error");
// stdafx.cpp : source file that includes just the standard includes
// DSP_InterC.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H
// and not in this file
#include <stdarg.h>
void ErrorLog(const char* _fmt, ...)
{
char Msg[512];
va_list ap;
va_start(ap, _fmt);
vsprintf(Msg, _fmt, ap);
va_end(ap);
printf("Error");
}

View File

@ -1,39 +1,39 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
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;
extern uint16 FetchOpcode();
extern void ErrorLog(const char* _fmt, ...);
inline uint16 swap16(uint16 x)
{
return((x >> 8) | (x << 8));
}
#include "OutBuffer.h"
// TODO: reference additional headers your program requires here
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#include "targetver.h"
#include <stdio.h>
#include <tchar.h>
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;
extern uint16 FetchOpcode();
extern void ErrorLog(const char* _fmt, ...);
inline uint16 swap16(uint16 x)
{
return((x >> 8) | (x << 8));
}
#include "OutBuffer.h"
// TODO: reference additional headers your program requires here

View File

@ -1,13 +1,13 @@
#pragma once
// The following macros define the minimum required platform. The minimum required platform
// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.
#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows.
#endif
#pragma once
// The following macros define the minimum required platform. The minimum required platform
// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run
// your application. The macros work by enabling all features available on platform versions up to and
// including the version specified.
// Modify the following defines if you have to target a platform prior to the ones specified below.
// Refer to MSDN for the latest info on corresponding values for different platforms.
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.
#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows.
#endif