DSP: Fixed case and some printing in asm

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3117 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2009-05-01 12:15:48 +00:00
parent e39f0f9ce8
commit 6cc8c0744b
3 changed files with 12 additions and 7 deletions

View File

@ -41,7 +41,7 @@ void LabelMap::RegisterLabel(const std::string &label, u16 lval, LabelType type)
if (GetLabelValue(label, &old_value) && old_value != lval)
{
printf("WARNING: Redefined label %s to %04x - old value %04x\n",
label, lval, old_value);
label.c_str(), lval, old_value);
DeleteLabel(label);
}
labels.push_back(label_t(label, lval, type));
@ -62,7 +62,7 @@ void LabelMap::DeleteLabel(const std::string &label)
bool LabelMap::GetLabelValue(const std::string &label, u16 *value, LabelType type) const
{
for (int i = 0; i < labels.size(); i++)
for (u32 i = 0; i < labels.size(); i++)
{
if (!label.compare(labels[i].name))
{
@ -70,7 +70,7 @@ bool LabelMap::GetLabelValue(const std::string &label, u16 *value, LabelType typ
*value = labels[i].addr;
return true;
} else {
printf("WARNING: Wrong label type requested. %s\n", label);
printf("WARNING: Wrong label type requested. %s\n", label.c_str());
}
}
}

View File

@ -778,7 +778,8 @@ bool DSPAssembler::AssembleFile(const char *fname, int pass)
param_t params[10] = {{0}};
param_t params_ext[10] = {{0}};
bool upper = true;
for (int i = 0; i < LINEBUF_SIZE; i++)
{
char c = line[i];
@ -814,7 +815,9 @@ bool DSPAssembler::AssembleFile(const char *fname, int pass)
c = 0x00;
if (c == 0x09) // tabs to spaces
c = ' ';
if (c >= 'a' && c <= 'z') // convert to uppercase
if (c == '"')
upper = !upper;
if (upper && c >= 'a' && c <= 'z') // convert to uppercase
c = c - 'a' + 'A';
line[i] = c;
if (c == 0)

View File

@ -95,12 +95,14 @@
// SR bits
#define SR_CARRY 0x0001
#define SR_UNKNOWN 0x0002 // ????????
#define SR_2 0x0002 // overflow???
#define SR_ARITH_ZERO 0x0004
#define SR_SIGN 0x0008
#define SR_TOP2BITS 0x0020 // this is an odd one.
#define SR_10 0x0010 // seem to be set by tst
#define SR_TOP2BITS 0x0020 // this is an odd one. (set by tst)
#define SR_LOGIC_ZERO 0x0040
#define SR_INT_ENABLE 0x0200 // Not 100% sure but duddie says so. This should replace the hack, if so.
#define SR_800 0x0800 // Appears in zelda
#define SR_MUL_MODIFY 0x2000 // 1 = normal. 0 = x2 (M0, M2)
#define SR_40_MODE_BIT 0x4000 // 0 = "16", 1 = "40" (SET16, SET40) Controls sign extension when loading mid accums.
#define SR_TOP_BIT_UNK 0x8000 // 1 = normal. 0 = x2 (CLR15, SET15) ????????