summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/sh2
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-01-10 00:29:26 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-01-10 00:29:26 +0000
commit4498faacd93cbb7f204d1b47e5d12bd417cf43b3 (patch)
treeeebf7c70b83ce57ba2707407872a01fe3ef7bb3c /src/emu/cpu/sh2
parent43d93150b5bc214537d5198cd9e7f01f2020eff8 (diff)
First round of an attempted cleanup of header files in the system.
- Created new central header "emu.h"; this should be included by pretty much any driver or device as the first include. This file in turn includes pretty much everything a driver or device will need, minus any other devices it references. Note that emu.h should *never* be included by another header file. - Updated all files in the core (src/emu) to use emu.h. - Removed a ton of redundant and poorly-tracked header includes from within other header files. - Temporarily changed driver.h to map to emu.h until we update files outside of the core. Added class wrapper around tagmap so it can be directly included and accessed within objects that need it. Updated all users to embed tagmap objects and changed them to call through the class. Added nicer functions for finding devices, ports, and regions in a machine: machine->device("tag") -- return the named device, or NULL machine->port("tag") -- return the named port, or NULL machine->region("tag"[, &length[, &flags]]) -- return the named region and optionally its length and flags Made the device tag an astring. This required touching a lot of code that printed the device to explicitly fetch the C-string from it. (Thank you gcc for flagging that issue!)
Diffstat (limited to 'src/emu/cpu/sh2')
-rw-r--r--src/emu/cpu/sh2/sh2.c1
-rw-r--r--src/emu/cpu/sh2/sh2.h1
-rw-r--r--src/emu/cpu/sh2/sh2comn.c32
-rw-r--r--src/emu/cpu/sh2/sh2comn.h1
-rw-r--r--src/emu/cpu/sh2/sh2dasm.c1
-rw-r--r--src/emu/cpu/sh2/sh2drc.c2
-rw-r--r--src/emu/cpu/sh2/sh2fe.c2
7 files changed, 20 insertions, 20 deletions
diff --git a/src/emu/cpu/sh2/sh2.c b/src/emu/cpu/sh2/sh2.c
index e18ce428525..35f162d4865 100644
--- a/src/emu/cpu/sh2/sh2.c
+++ b/src/emu/cpu/sh2/sh2.c
@@ -99,6 +99,7 @@
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "sh2.h"
#include "sh2comn.h"
diff --git a/src/emu/cpu/sh2/sh2.h b/src/emu/cpu/sh2/sh2.h
index ae75a732082..a89adb60801 100644
--- a/src/emu/cpu/sh2/sh2.h
+++ b/src/emu/cpu/sh2/sh2.h
@@ -30,7 +30,6 @@
#ifndef __SH2_H__
#define __SH2_H__
-#include "cpuintrf.h"
#define SH2_INT_NONE -1
#define SH2_INT_VBLIN 0
diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c
index d040a539ef9..865a471a0d2 100644
--- a/src/emu/cpu/sh2/sh2comn.c
+++ b/src/emu/cpu/sh2/sh2comn.c
@@ -6,8 +6,8 @@
*
*****************************************************************************/
+#include "emu.h"
#include "debugger.h"
-#include "cpuexec.h"
#include "sh2.h"
#include "sh2comn.h"
@@ -101,7 +101,7 @@ static void sh2_timer_activate(SH2 *sh2)
sh2->frc_base = cpu_get_total_cycles(sh2->device);
timer_adjust_oneshot(sh2->timer, cpu_clocks_to_attotime(sh2->device, max_delta), 0);
} else {
- logerror("SH2.%s: Timer event in %d cycles of external clock", sh2->device->tag, max_delta);
+ logerror("SH2.%s: Timer event in %d cycles of external clock", sh2->device->tag.cstr(), max_delta);
}
}
}
@@ -138,7 +138,7 @@ static TIMER_CALLBACK( sh2_dmac_callback )
int dma = param & 1;
SH2 *sh2 = (SH2 *)ptr;
- LOG(("SH2.%s: DMA %d complete\n", sh2->device->tag, dma));
+ LOG(("SH2.%s: DMA %d complete\n", sh2->device->tag.cstr(), dma));
sh2->m[0x63+4*dma] |= 2;
sh2->dma_timer_active[dma] = 0;
sh2_recalc_irq(sh2);
@@ -306,7 +306,7 @@ WRITE32_HANDLER( sh2_internal_w )
case 0x04: // TIER, FTCSR, FRC
if((mem_mask & 0x00ffffff) != 0)
sh2_timer_resync(sh2);
-// printf("SH2.%s: TIER write %04x @ %04x\n", sh2->device->tag, data >> 16, mem_mask>>16);
+// printf("SH2.%s: TIER write %04x @ %04x\n", sh2->device->tag.cstr(), data >> 16, mem_mask>>16);
sh2->m[4] = (sh2->m[4] & ~(ICF|OCFA|OCFB|OVF)) | (old & sh2->m[4] & (ICF|OCFA|OCFB|OVF));
COMBINE_DATA(&sh2->frc);
if((mem_mask & 0x00ffffff) != 0)
@@ -314,7 +314,7 @@ WRITE32_HANDLER( sh2_internal_w )
sh2_recalc_irq(sh2);
break;
case 0x05: // OCRx, TCR, TOCR
-// printf("SH2.%s: TCR write %08x @ %08x\n", sh2->device->tag, data, mem_mask);
+// printf("SH2.%s: TCR write %08x @ %08x\n", sh2->device->tag.cstr(), data, mem_mask);
sh2_timer_resync(sh2);
if(sh2->m[5] & 0x10)
sh2->ocrb = (sh2->ocrb & (~mem_mask >> 16)) | ((data & mem_mask) >> 16);
@@ -358,7 +358,7 @@ WRITE32_HANDLER( sh2_internal_w )
{
INT32 a = sh2->m[0x41];
INT32 b = sh2->m[0x40];
- LOG(("SH2 '%s' div+mod %d/%d\n", sh2->device->tag, a, b));
+ LOG(("SH2 '%s' div+mod %d/%d\n", sh2->device->tag.cstr(), a, b));
if (b)
{
sh2->m[0x45] = a / b;
@@ -386,7 +386,7 @@ WRITE32_HANDLER( sh2_internal_w )
{
INT64 a = sh2->m[0x45] | ((UINT64)(sh2->m[0x44]) << 32);
INT64 b = (INT32)sh2->m[0x40];
- LOG(("SH2 '%s' div+mod %" I64FMT "d/%" I64FMT "d\n", sh2->device->tag, a, b));
+ LOG(("SH2 '%s' div+mod %" I64FMT "d/%" I64FMT "d\n", sh2->device->tag.cstr(), a, b));
if (b)
{
INT64 q = a / b;
@@ -536,7 +536,7 @@ void sh2_set_frt_input(const device_config *device, int state)
sh2_timer_resync(sh2);
sh2->icr = sh2->frc;
sh2->m[4] |= ICF;
- logerror("SH2.%s: ICF activated (%x)\n", sh2->device->tag, sh2->pc & AM);
+ logerror("SH2.%s: ICF activated (%x)\n", sh2->device->tag.cstr(), sh2->pc & AM);
sh2_recalc_irq(sh2);
}
@@ -550,11 +550,11 @@ void sh2_set_irq_line(SH2 *sh2, int irqline, int state)
if( state == CLEAR_LINE )
{
- LOG(("SH-2 '%s' cleared nmi\n", sh2->device->tag));
+ LOG(("SH-2 '%s' cleared nmi\n", sh2->device->tag.cstr()));
}
else
{
- LOG(("SH-2 '%s' assert nmi\n", sh2->device->tag));
+ LOG(("SH-2 '%s' assert nmi\n", sh2->device->tag.cstr()));
sh2_exception(sh2, "Set IRQ line", 16);
@@ -571,12 +571,12 @@ void sh2_set_irq_line(SH2 *sh2, int irqline, int state)
if( state == CLEAR_LINE )
{
- LOG(("SH-2 '%s' cleared irq #%d\n", sh2->device->tag, irqline));
+ LOG(("SH-2 '%s' cleared irq #%d\n", sh2->device->tag.cstr(), irqline));
sh2->pending_irq &= ~(1 << irqline);
}
else
{
- LOG(("SH-2 '%s' assert irq #%d\n", sh2->device->tag, irqline));
+ LOG(("SH-2 '%s' assert irq #%d\n", sh2->device->tag.cstr(), irqline));
sh2->pending_irq |= 1 << irqline;
#ifdef USE_SH2DRC
sh2->test_irq = 1;
@@ -647,27 +647,27 @@ void sh2_exception(SH2 *sh2, const char *message, int irqline)
if (sh2->internal_irq_level == irqline)
{
vector = sh2->internal_irq_vector;
- LOG(("SH-2 '%s' exception #%d (internal vector: $%x) after [%s]\n", sh2->device->tag, irqline, vector, message));
+ LOG(("SH-2 '%s' exception #%d (internal vector: $%x) after [%s]\n", sh2->device->tag.cstr(), irqline, vector, message));
}
else
{
if(sh2->m[0x38] & 0x00010000)
{
vector = sh2->irq_callback(sh2->device, irqline);
- LOG(("SH-2 '%s' exception #%d (external vector: $%x) after [%s]\n", sh2->device->tag, irqline, vector, message));
+ LOG(("SH-2 '%s' exception #%d (external vector: $%x) after [%s]\n", sh2->device->tag.cstr(), irqline, vector, message));
}
else
{
sh2->irq_callback(sh2->device, irqline);
vector = 64 + irqline/2;
- LOG(("SH-2 '%s' exception #%d (autovector: $%x) after [%s]\n", sh2->device->tag, irqline, vector, message));
+ LOG(("SH-2 '%s' exception #%d (autovector: $%x) after [%s]\n", sh2->device->tag.cstr(), irqline, vector, message));
}
}
}
else
{
vector = 11;
- LOG(("SH-2 '%s' nmi exception (autovector: $%x) after [%s]\n", sh2->device->tag, vector, message));
+ LOG(("SH-2 '%s' nmi exception (autovector: $%x) after [%s]\n", sh2->device->tag.cstr(), vector, message));
}
#ifdef USE_SH2DRC
diff --git a/src/emu/cpu/sh2/sh2comn.h b/src/emu/cpu/sh2/sh2comn.h
index ba0f197e8f1..2c48eafeacf 100644
--- a/src/emu/cpu/sh2/sh2comn.h
+++ b/src/emu/cpu/sh2/sh2comn.h
@@ -11,7 +11,6 @@
#ifndef __SH2COMN_H__
#define __SH2COMN_H__
-#include "timer.h"
#define USE_SH2DRC
diff --git a/src/emu/cpu/sh2/sh2dasm.c b/src/emu/cpu/sh2/sh2dasm.c
index f4d430a5714..bf051d844f5 100644
--- a/src/emu/cpu/sh2/sh2dasm.c
+++ b/src/emu/cpu/sh2/sh2dasm.c
@@ -1,3 +1,4 @@
+#include "emu.h"
#include "debugger.h"
#include "sh2.h"
diff --git a/src/emu/cpu/sh2/sh2drc.c b/src/emu/cpu/sh2/sh2drc.c
index 0caa462e4d3..0acdb13c448 100644
--- a/src/emu/cpu/sh2/sh2drc.c
+++ b/src/emu/cpu/sh2/sh2drc.c
@@ -15,10 +15,10 @@
***************************************************************************/
+#include "emu.h"
#include "debugger.h"
#include "sh2.h"
#include "sh2comn.h"
-#include "eminline.h"
#include "profiler.h"
CPU_DISASSEMBLE( sh2 );
diff --git a/src/emu/cpu/sh2/sh2fe.c b/src/emu/cpu/sh2/sh2fe.c
index 043340bb63c..89ea586004d 100644
--- a/src/emu/cpu/sh2/sh2fe.c
+++ b/src/emu/cpu/sh2/sh2fe.c
@@ -9,7 +9,7 @@
***************************************************************************/
-#include "cpuintrf.h"
+#include "emu.h"
#include "sh2.h"
#include "sh2comn.h"
#include "cpu/drcfe.h"