summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/upd7725
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/cpu/upd7725')
-rwxr-xr-xsrc/emu/cpu/upd7725/upd7725.c32
-rwxr-xr-xsrc/emu/cpu/upd7725/upd7725.h8
2 files changed, 20 insertions, 20 deletions
diff --git a/src/emu/cpu/upd7725/upd7725.c b/src/emu/cpu/upd7725/upd7725.c
index 9f3d245c791..ec691b41eda 100755
--- a/src/emu/cpu/upd7725/upd7725.c
+++ b/src/emu/cpu/upd7725/upd7725.c
@@ -3,10 +3,10 @@
upd7725.c
Core implementation for the portable NEC uPD7725/uPD96050 emulator
-
+
Original by byuu in the public domain.
MAME conversion by R. Belmont
-
+
****************************************************************************/
#include "emu.h"
@@ -246,7 +246,7 @@ void necdsp_device::device_start()
void necdsp_device::device_reset()
{
- for (unsigned i = 0; i < 2048; i++)
+ for (unsigned i = 0; i < 2048; i++)
{
dataRAM[i] = 0x0000;
}
@@ -335,7 +335,7 @@ offs_t necdsp_device::disasm_disassemble(char *buffer, offs_t pc, const UINT8 *o
return CPU_DISASSEMBLE_NAME(upd7725)(NULL, buffer, pc, oprom, opram, 0);
}
-void necdsp_device::execute_run()
+void necdsp_device::execute_run()
{
UINT32 opcode;
@@ -356,7 +356,7 @@ void necdsp_device::execute_run()
case 2: exec_jp(opcode); break;
case 3: exec_ld(opcode); break;
}
-
+
INT32 result = (INT32)regs.k * regs.l; //sign + 30-bit result
regs.m = result >> 15; //store sign + top 15-bits
regs.n = result << 1; //store low 15-bits + zero
@@ -584,12 +584,12 @@ void necdsp_device::exec_ld(UINT32 opcode) {
}
UINT8 necdsp_device::snesdsp_read(bool mode) {
-
+
if (!mode)
{
return regs.sr >> 8;
}
-
+
if (regs.sr.drc == 0)
{
//16-bit
@@ -597,14 +597,14 @@ UINT8 necdsp_device::snesdsp_read(bool mode) {
{
regs.sr.drs = 1;
return regs.dr >> 0;
- }
- else
+ }
+ else
{
regs.sr.rqm = 0;
regs.sr.drs = 0;
return regs.dr >> 8;
}
- }
+ }
else
{
//8-bit
@@ -615,23 +615,23 @@ UINT8 necdsp_device::snesdsp_read(bool mode) {
void necdsp_device::snesdsp_write(bool mode, UINT8 data) {
if (!mode) return;
-
- if (regs.sr.drc == 0)
+
+ if (regs.sr.drc == 0)
{
//16-bit
if (regs.sr.drs == 0)
{
regs.sr.drs = 1;
regs.dr = (regs.dr & 0xff00) | (data << 0);
- }
- else
+ }
+ else
{
regs.sr.rqm = 0;
regs.sr.drs = 0;
regs.dr = (data << 8) | (regs.dr & 0x00ff);
}
- }
- else
+ }
+ else
{
//8-bit
regs.sr.rqm = 0;
diff --git a/src/emu/cpu/upd7725/upd7725.h b/src/emu/cpu/upd7725/upd7725.h
index 82f65034a4c..4e64e74e57e 100755
--- a/src/emu/cpu/upd7725/upd7725.h
+++ b/src/emu/cpu/upd7725/upd7725.h
@@ -113,7 +113,7 @@ private:
struct Flag
{
bool s1, s0, c, z, ov1, ov0;
-
+
inline operator unsigned() const
{
return (s1 << 5) + (s0 << 4) + (c << 3) + (z << 2) + (ov1 << 1) + (ov0 << 0);
@@ -129,14 +129,14 @@ private:
struct Status
{
bool rqm, usf1, usf0, drs, dma, drc, soc, sic, ei, p1, p0;
-
+
inline operator unsigned() const
{
return (rqm << 15) + (usf1 << 14) + (usf0 << 13) + (drs << 12)
+ (dma << 11) + (drc << 10) + (soc << 9) + (sic << 8)
+ (ei << 7) + (p1 << 1) + (p0 << 0);
}
-
+
inline unsigned operator=(unsigned d)
{
rqm = d & 0x8000; usf1 = d & 0x4000; usf0 = d & 0x2000; drs = d & 0x1000;
@@ -146,7 +146,7 @@ private:
}
};
- struct Regs
+ struct Regs
{
UINT16 pc; //program counter
UINT16 stack[16]; //LIFO