summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/cpu/psx
diff options
context:
space:
mode:
author Vas Crabb <cuavas@users.noreply.github.com>2023-06-17 01:10:05 +1000
committer GitHub <noreply@github.com>2023-06-17 01:10:05 +1000
commite9c1f4a42a6758a6fb75403e28c7dc6cf869081c (patch)
tree8e0b6d960bed4baec2408c9ab950218592ef33ec /src/devices/cpu/psx
parentc1ceb6e016763537c5109cc76fe5d1b4ae72fdb3 (diff)
emu/devcb.h: Eliminated the need to call resolve() on callbacks. (#11333)
Read callbacks now need a default return value supplied at construction. Replaced isnull() with isunset() which tells you if the callback wasn't configured rather than whether it isn't safe to call. Enabled validation of device callbacks (it seems it was disabled at some point, probably accidentally). Device callbacks and object finders now implement the same interface for resolution.
Diffstat (limited to 'src/devices/cpu/psx')
-rw-r--r--src/devices/cpu/psx/dma.cpp2
-rw-r--r--src/devices/cpu/psx/irq.cpp6
-rw-r--r--src/devices/cpu/psx/psx.cpp27
-rw-r--r--src/devices/cpu/psx/rcnt.cpp4
-rw-r--r--src/devices/cpu/psx/sio.cpp6
5 files changed, 12 insertions, 33 deletions
diff --git a/src/devices/cpu/psx/dma.cpp b/src/devices/cpu/psx/dma.cpp
index 957810ff840..64bb8f1c71e 100644
--- a/src/devices/cpu/psx/dma.cpp
+++ b/src/devices/cpu/psx/dma.cpp
@@ -48,8 +48,6 @@ void psxdma_device::device_post_load()
void psxdma_device::device_start()
{
- m_irq_handler.resolve_safe();
-
for( int index = 0; index < 7; index++ )
{
psx_dma_channel *dma = &m_channel[ index ];
diff --git a/src/devices/cpu/psx/irq.cpp b/src/devices/cpu/psx/irq.cpp
index e5dcc5c02b9..41706fcf9db 100644
--- a/src/devices/cpu/psx/irq.cpp
+++ b/src/devices/cpu/psx/irq.cpp
@@ -39,10 +39,8 @@ 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 )
diff --git a/src/devices/cpu/psx/psx.cpp b/src/devices/cpu/psx/psx.cpp
index 1e7ed448c2e..b658b9046d7 100644
--- a/src/devices/cpu/psx/psx.cpp
+++ b/src/devices/cpu/psx/psx.cpp
@@ -1785,16 +1785,16 @@ void psxcpu_device::psxcpu_internal_map(address_map &map)
//-------------------------------------------------
psxcpu_device::psxcpu_device( const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock ) :
- cpu_device( mconfig, type, tag, owner, clock ),
- m_program_config( "program", ENDIANNESS_LITTLE, 32, 32, 0, address_map_constructor(FUNC(psxcpu_device::psxcpu_internal_map), this)),
- m_gpu_read_handler( *this ),
- m_gpu_write_handler( *this ),
- m_spu_read_handler( *this ),
- m_spu_write_handler( *this ),
- m_cd_read_handler( *this ),
- m_cd_write_handler( *this ),
- m_ram( *this, "ram" ),
- m_rom( *this, "rom" )
+ cpu_device(mconfig, type, tag, owner, clock),
+ m_program_config("program", ENDIANNESS_LITTLE, 32, 32, 0, address_map_constructor(FUNC(psxcpu_device::psxcpu_internal_map), this)),
+ m_gpu_read_handler(*this, 0),
+ m_gpu_write_handler(*this),
+ m_spu_read_handler(*this, 0),
+ m_spu_write_handler(*this),
+ m_cd_read_handler(*this, 0),
+ m_cd_write_handler(*this),
+ m_ram(*this, "ram"),
+ m_rom(*this, "rom")
{
m_disable_rom_berr = false;
}
@@ -1988,13 +1988,6 @@ void psxcpu_device::device_start()
// set our instruction counter
set_icountptr(m_icount);
-
- m_gpu_read_handler.resolve_safe( 0 );
- m_gpu_write_handler.resolve_safe();
- m_spu_read_handler.resolve_safe( 0 );
- m_spu_write_handler.resolve_safe();
- m_cd_read_handler.resolve_safe( 0 );
- m_cd_write_handler.resolve_safe();
}
diff --git a/src/devices/cpu/psx/rcnt.cpp b/src/devices/cpu/psx/rcnt.cpp
index c31c9464f8e..0a9b03f89d3 100644
--- a/src/devices/cpu/psx/rcnt.cpp
+++ b/src/devices/cpu/psx/rcnt.cpp
@@ -35,10 +35,6 @@ void psxrcnt_device::device_post_load()
void psxrcnt_device::device_start()
{
- m_irq0_handler.resolve_safe();
- m_irq1_handler.resolve_safe();
- m_irq2_handler.resolve_safe();
-
save_item(STRUCT_MEMBER(root_counter, n_count));
save_item(STRUCT_MEMBER(root_counter, n_mode));
save_item(STRUCT_MEMBER(root_counter, n_target));
diff --git a/src/devices/cpu/psx/sio.cpp b/src/devices/cpu/psx/sio.cpp
index 120fa395d41..07f7bd93bb6 100644
--- a/src/devices/cpu/psx/sio.cpp
+++ b/src/devices/cpu/psx/sio.cpp
@@ -47,12 +47,6 @@ void psxsio_device::device_post_load()
void psxsio_device::device_start()
{
- m_irq_handler.resolve_safe();
- m_sck_handler.resolve_safe();
- m_txd_handler.resolve_safe();
- m_dtr_handler.resolve_safe();
- m_rts_handler.resolve_safe();
-
m_timer = timer_alloc(FUNC( psxsio_device::sio_tick ), this);
m_mode = 0;
m_control = 0;