summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/psx/irq.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/cpu/psx/irq.cpp')
-rw-r--r--src/devices/cpu/psx/irq.cpp68
1 files changed, 27 insertions, 41 deletions
diff --git a/src/devices/cpu/psx/irq.cpp b/src/devices/cpu/psx/irq.cpp
index 94aafc73b2f..41706fcf9db 100644
--- a/src/devices/cpu/psx/irq.cpp
+++ b/src/devices/cpu/psx/irq.cpp
@@ -11,23 +11,11 @@
#include "psx.h"
#include "irq.h"
-#define VERBOSE_LEVEL ( 0 )
+#define VERBOSE ( 0 )
+#include "logmacro.h"
#define PSX_IRQ_MASK ( 0x7fd )
-static inline void ATTR_PRINTF(3,4) verboselog( device_t& device, int n_level, const char *s_fmt, ... )
-{
- if( VERBOSE_LEVEL >= n_level )
- {
- va_list v;
- char buf[ 32768 ];
- va_start( v, s_fmt );
- vsprintf( buf, s_fmt, v );
- va_end( v );
- device.logerror( "%s: %s", device.machine().describe_context(), buf );
- }
-}
-
DEFINE_DEVICE_TYPE(PSX_IRQ, psxirq_device, "psxirq", "Sony PSX IRQ")
psxirq_device::psxirq_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
@@ -51,15 +39,13 @@ void psxirq_device::device_post_load()
void psxirq_device::device_start()
{
- m_irq_handler.resolve_safe();
-
- save_item( NAME( n_irqdata ) );
- save_item( NAME( n_irqmask ) );
+ save_item(NAME(n_irqdata));
+ save_item(NAME(n_irqmask));
}
void psxirq_device::set( uint32_t bitmask )
{
- verboselog( *this, 2, "psx_irq_set %08x\n", bitmask );
+ LOG( "%s: psx_irq_set %08x\n", machine().describe_context(), bitmask );
n_irqdata |= bitmask;
psx_irq_update();
}
@@ -68,58 +54,58 @@ void psxirq_device::psx_irq_update( void )
{
if( ( n_irqdata & n_irqmask ) != 0 )
{
- verboselog( *this, 2, "psx irq assert\n" );
+ LOG( "%s: psx irq assert\n", machine().describe_context() );
m_irq_handler( ASSERT_LINE );
}
else
{
- verboselog( *this, 2, "psx irq clear\n" );
+ LOG( "%s: psx irq clear\n", machine().describe_context() );
m_irq_handler( CLEAR_LINE );
}
}
-WRITE32_MEMBER( psxirq_device::write )
+void psxirq_device::write(offs_t offset, uint32_t data, uint32_t mem_mask)
{
switch( offset )
{
case 0x00:
- verboselog( *this, 2, "psx irq data ( %08x, %08x ) %08x -> %08x\n", data, mem_mask, n_irqdata, ( n_irqdata & ~mem_mask ) | ( n_irqdata & n_irqmask & data ) );
+ LOG( "%s: psx irq data ( %08x, %08x ) %08x -> %08x\n", machine().describe_context(), data, mem_mask, n_irqdata, ( n_irqdata & ~mem_mask ) | ( n_irqdata & n_irqmask & data ) );
n_irqdata = ( n_irqdata & ~mem_mask ) | ( n_irqdata & n_irqmask & data );
psx_irq_update();
break;
case 0x01:
- verboselog( *this, 2, "psx irq mask ( %08x, %08x ) %08x -> %08x\n", data, mem_mask, n_irqmask, ( n_irqmask & ~mem_mask ) | data );
+ LOG( "%s: psx irq mask ( %08x, %08x ) %08x -> %08x\n", machine().describe_context(), data, mem_mask, n_irqmask, ( n_irqmask & ~mem_mask ) | data );
n_irqmask = ( n_irqmask & ~mem_mask ) | data;
if( ( n_irqmask &~ PSX_IRQ_MASK ) != 0 )
{
- verboselog( *this, 0, "psx_irq_w( %08x, %08x, %08x ) unknown irq\n", offset, data, mem_mask );
+ logerror( "%s: psx_irq_w( %08x, %08x, %08x ) unknown irq\n", machine().describe_context(), offset, data, mem_mask );
}
psx_irq_update();
break;
default:
- verboselog( *this, 0, "psx_irq_w( %08x, %08x, %08x ) unknown register\n", offset, data, mem_mask );
+ logerror( "%s: psx_irq_w( %08x, %08x, %08x ) unknown register\n", machine().describe_context(), offset, data, mem_mask );
break;
}
}
-READ32_MEMBER( psxirq_device::read )
+uint32_t psxirq_device::read(offs_t offset)
{
switch( offset )
{
case 0x00:
- verboselog( *this, 1, "psx_irq_r irq data %08x\n", n_irqdata );
+ LOG( "%s: psx_irq_r irq data %08x\n", machine().describe_context(), n_irqdata );
return n_irqdata;
case 0x01:
- verboselog( *this, 1, "psx_irq_r irq mask %08x\n", n_irqmask );
+ LOG( "%s: psx_irq_r irq mask %08x\n", machine().describe_context(), n_irqmask );
return n_irqmask;
default:
- verboselog( *this, 0, "psx_irq_r unknown register %d\n", offset );
+ logerror( "%s: psx_irq_r unknown register %d\n", machine().describe_context(), offset );
break;
}
return 0;
}
-WRITE_LINE_MEMBER( psxirq_device::intin0 )
+void psxirq_device::intin0(int state)
{
if( state )
{
@@ -127,7 +113,7 @@ WRITE_LINE_MEMBER( psxirq_device::intin0 )
}
}
-WRITE_LINE_MEMBER( psxirq_device::intin1 )
+void psxirq_device::intin1(int state)
{
if( state )
{
@@ -135,7 +121,7 @@ WRITE_LINE_MEMBER( psxirq_device::intin1 )
}
}
-WRITE_LINE_MEMBER( psxirq_device::intin2 )
+void psxirq_device::intin2(int state)
{
if( state )
{
@@ -143,7 +129,7 @@ WRITE_LINE_MEMBER( psxirq_device::intin2 )
}
}
-WRITE_LINE_MEMBER( psxirq_device::intin3 )
+void psxirq_device::intin3(int state)
{
if( state )
{
@@ -151,7 +137,7 @@ WRITE_LINE_MEMBER( psxirq_device::intin3 )
}
}
-WRITE_LINE_MEMBER( psxirq_device::intin4 )
+void psxirq_device::intin4(int state)
{
if( state )
{
@@ -159,7 +145,7 @@ WRITE_LINE_MEMBER( psxirq_device::intin4 )
}
}
-WRITE_LINE_MEMBER( psxirq_device::intin5 )
+void psxirq_device::intin5(int state)
{
if( state )
{
@@ -167,7 +153,7 @@ WRITE_LINE_MEMBER( psxirq_device::intin5 )
}
}
-WRITE_LINE_MEMBER( psxirq_device::intin6 )
+void psxirq_device::intin6(int state)
{
if( state )
{
@@ -175,7 +161,7 @@ WRITE_LINE_MEMBER( psxirq_device::intin6 )
}
}
-WRITE_LINE_MEMBER( psxirq_device::intin7 )
+void psxirq_device::intin7(int state)
{
if( state )
{
@@ -183,7 +169,7 @@ WRITE_LINE_MEMBER( psxirq_device::intin7 )
}
}
-WRITE_LINE_MEMBER( psxirq_device::intin8 )
+void psxirq_device::intin8(int state)
{
if( state )
{
@@ -191,7 +177,7 @@ WRITE_LINE_MEMBER( psxirq_device::intin8 )
}
}
-WRITE_LINE_MEMBER( psxirq_device::intin9 )
+void psxirq_device::intin9(int state)
{
if( state )
{
@@ -199,7 +185,7 @@ WRITE_LINE_MEMBER( psxirq_device::intin9 )
}
}
-WRITE_LINE_MEMBER( psxirq_device::intin10 )
+void psxirq_device::intin10(int state)
{
if( state )
{