diff options
author | 2010-01-10 00:29:26 +0000 | |
---|---|---|
committer | 2010-01-10 00:29:26 +0000 | |
commit | 4498faacd93cbb7f204d1b47e5d12bd417cf43b3 (patch) | |
tree | eebf7c70b83ce57ba2707407872a01fe3ef7bb3c /src/emu/cpu/sh4/sh4comn.c | |
parent | 43d93150b5bc214537d5198cd9e7f01f2020eff8 (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/sh4/sh4comn.c')
-rw-r--r-- | src/emu/cpu/sh4/sh4comn.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/emu/cpu/sh4/sh4comn.c b/src/emu/cpu/sh4/sh4comn.c index 83c434caee8..93ee5f542b8 100644 --- a/src/emu/cpu/sh4/sh4comn.c +++ b/src/emu/cpu/sh4/sh4comn.c @@ -6,8 +6,8 @@ * *****************************************************************************/ +#include "emu.h" #include "debugger.h" -#include "cpuexec.h" #include "sh4.h" #include "sh4regs.h" #include "sh4comn.h" @@ -179,7 +179,7 @@ void sh4_exception(SH4 *sh4, const char *message, int exception) // handle excep sh4->m[INTEVT] = 0x1c0; vector = 0x600; sh4->irq_callback(sh4->device, INPUT_LINE_NMI); - LOG(("SH-4 '%s' nmi exception after [%s]\n", sh4->device->tag, message)); + LOG(("SH-4 '%s' nmi exception after [%s]\n", sh4->device->tag.cstr(), message)); } else { // if ((sh4->m[ICR] & 0x4000) && (sh4->nmi_line_state == ASSERT_LINE)) // return; @@ -193,7 +193,7 @@ void sh4_exception(SH4 *sh4, const char *message, int exception) // handle excep sh4->irq_callback(sh4->device, SH4_INTC_IRL0-exception+SH4_IRL0); else sh4->irq_callback(sh4->device, SH4_IRL3+1); - LOG(("SH-4 '%s' interrupt exception #%d after [%s]\n", sh4->device->tag, exception, message)); + LOG(("SH-4 '%s' interrupt exception #%d after [%s]\n", sh4->device->tag.cstr(), exception, message)); } sh4_exception_checkunrequest(sh4, exception); @@ -407,7 +407,7 @@ static TIMER_CALLBACK( sh4_dmac_callback ) SH4 *sh4 = (SH4 *)ptr; int channel = param; - LOG(("SH4 '%s': DMA %d complete\n", sh4->device->tag, channel)); + LOG(("SH4 '%s': DMA %d complete\n", sh4->device->tag.cstr(), channel)); sh4->dma_timer_active[channel] = 0; switch (channel) { @@ -1028,7 +1028,7 @@ void sh4_set_frt_input(const device_config *device, int state) sh4_timer_resync(); sh4->icr = sh4->frc; sh4->m[4] |= ICF; - logerror("SH4 '%s': ICF activated (%x)\n", sh4->device->tag, sh4->pc & AM); + logerror("SH4 '%s': ICF activated (%x)\n", sh4->device->tag.cstr(), sh4->pc & AM); sh4_recalc_irq(); #endif } @@ -1056,7 +1056,7 @@ void sh4_set_irq_line(SH4 *sh4, int irqline, int state) // set state of external { if ((state == CLEAR_LINE) && (sh4->nmi_line_state == ASSERT_LINE)) // rising { - LOG(("SH-4 '%s' assert nmi\n", sh4->device->tag)); + LOG(("SH-4 '%s' assert nmi\n", sh4->device->tag.cstr())); sh4_exception_request(sh4, SH4_INTC_NMI); sh4_dmac_nmi(sh4); } @@ -1065,7 +1065,7 @@ void sh4_set_irq_line(SH4 *sh4, int irqline, int state) // set state of external { if ((state == ASSERT_LINE) && (sh4->nmi_line_state == CLEAR_LINE)) // falling { - LOG(("SH-4 '%s' assert nmi\n", sh4->device->tag)); + LOG(("SH-4 '%s' assert nmi\n", sh4->device->tag.cstr())); sh4_exception_request(sh4, SH4_INTC_NMI); sh4_dmac_nmi(sh4); } @@ -1088,12 +1088,12 @@ void sh4_set_irq_line(SH4 *sh4, int irqline, int state) // set state of external if( state == CLEAR_LINE ) { - LOG(("SH-4 '%s' cleared external irq IRL%d\n", sh4->device->tag, irqline)); + LOG(("SH-4 '%s' cleared external irq IRL%d\n", sh4->device->tag.cstr(), irqline)); sh4_exception_unrequest(sh4, SH4_INTC_IRL0+irqline-SH4_IRL0); } else { - LOG(("SH-4 '%s' assert external irq IRL%d\n", sh4->device->tag, irqline)); + LOG(("SH-4 '%s' assert external irq IRL%d\n", sh4->device->tag.cstr(), irqline)); sh4_exception_request(sh4, SH4_INTC_IRL0+irqline-SH4_IRL0); } } @@ -1107,7 +1107,7 @@ void sh4_set_irq_line(SH4 *sh4, int irqline, int state) // set state of external sh4_exception_unrequest(sh4, SH4_INTC_IRLn0+s); if (sh4->irln < 15) sh4_exception_request(sh4, SH4_INTC_IRLn0+sh4->irln); - LOG(("SH-4 '%s' IRLn0-IRLn3 level #%d\n", sh4->device->tag, sh4->irln)); + LOG(("SH-4 '%s' IRLn0-IRLn3 level #%d\n", sh4->device->tag.cstr(), sh4->irln)); } } if (sh4->test_irq && (!sh4->delay)) |