Some more changes to the DPC+ ARM emulation code.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2208 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2011-01-23 14:16:02 +00:00
parent ec9c865ec9
commit a71158e1ce
1 changed files with 21 additions and 0 deletions

View File

@ -100,13 +100,21 @@ if(addr<0x50)
}
addr>>=1;
#ifdef __BIG_ENDIAN__
data=((rom[addr]>>8)|(rom[addr]<<8))&0xffff;
#else
data=rom[addr];
#endif
if(DBUG) fprintf(stderr,"0x%04X\n",data);
return(data);
case 0x40000000: //RAM
addr&=RAMADDMASK;
addr>>=1;
#ifdef __BIG_ENDIAN__
data=((ram[addr]>>8)|(ram[addr]<<8))&0xffff;
#else
data=ram[addr];
#endif
if(DBUG) fprintf(stderr,"0x%04X\n",data);
return(data);
}
@ -156,7 +164,11 @@ if(DBUG) fprintf(stderr,"write16(0x%08X,0x%08X)\n",addr,data);
case 0x40000000: //RAM
addr&=RAMADDMASK;
addr>>=1;
#ifdef __BIG_ENDIAN__
ram[addr]=(((data&0xFFFF)>>8)|((data&0xffff)<<8))&0xffff;
#else
ram[addr]=data&0xFFFF;
#endif
return;
}
fprintf(stderr,"write16(0x%08X,0x%08X), abort\n",addr,data);
@ -208,13 +220,21 @@ if(DBUG) fprintf(stderr,"read16(0x%08X)=",addr);
case 0x00000000: //ROM
addr&=ROMADDMASK;
addr>>=1;
#ifdef __BIG_ENDIAN__
data=((rom[addr]>>8)|(rom[addr]<<8))&0xffff;
#else
data=rom[addr];
#endif
if(DBUG) fprintf(stderr,"0x%04X\n",data);
return(data);
case 0x40000000: //RAM
addr&=RAMADDMASK;
addr>>=1;
#ifdef __BIG_ENDIAN__
data=((ram[addr]>>8)|(ram[addr]<<8))&0xffff;
#else
data=ram[addr];
#endif
if(DBUG) fprintf(stderr,"0x%04X\n",data);
return(data);
}
@ -453,6 +473,7 @@ if(DISS) fprintf(stderr,"add r%u,r%u\n",rd,rm);
ra=read_register(rd);
rb=read_register(rm);
rc=ra+rb;
if(rd==15) rc+=2;
//fprintf(stderr,"0x%08X = 0x%08X + 0x%08X\n",rc,ra,rb);
write_register(rd,rc);
return(0);