summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/sh4
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-04-23 16:33:28 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-04-23 16:33:28 +0000
commit7b90e0165903bfd7231c9c39de83def12b1cc793 (patch)
treec8611959e09640db1c7bf42fa4a7448da7a30937 /src/emu/cpu/sh4
parentc8f329e654111e3fd85ac700ab7bd1537556a301 (diff)
Deprecated device_set_info. Almost all devices had a NULL or empty
function here. Remaining devices have been converted to have device-specific functions to do the same thing with proper type checking. CPUs still have a set_info function but it is CPU-specific now and no longer piggybacks on the general device function.
Diffstat (limited to 'src/emu/cpu/sh4')
-rw-r--r--src/emu/cpu/sh4/sh4.c16
-rw-r--r--src/emu/cpu/sh4/sh4.h19
-rw-r--r--src/emu/cpu/sh4/sh4comn.c11
-rw-r--r--src/emu/cpu/sh4/sh4comn.h3
4 files changed, 20 insertions, 29 deletions
diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c
index 4283acffc04..6e1fd66d043 100644
--- a/src/emu/cpu/sh4/sh4.c
+++ b/src/emu/cpu/sh4/sh4.c
@@ -3646,16 +3646,16 @@ static CPU_SET_INFO( sh4 )
case CPUINFO_STR_REGISTER + SH4_XF14: sh4->xf[14] = info->i; break;
case CPUINFO_STR_REGISTER + SH4_XF15: sh4->xf[15] = info->i; break;
#endif
-
- case CPUINFO_INT_SH4_IRLn_INPUT: sh4_set_irln_input(device, info->i); break;
- case CPUINFO_INT_SH4_FRT_INPUT: sh4_set_frt_input(device, info->i); break;
-
- /* --- the following bits of info are set as pointers to data or functions --- */
- case CPUINFO_FCT_SH4_FTCSR_READ_CALLBACK: sh4->ftcsr_read_callback = (void (*) (UINT32 ))info->f; break;
- case CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA: sh4_dma_ddt(sh4, (struct sh4_ddt_dma *)info->f); break;
}
}
+void sh4_set_ftcsr_callback(const device_config *device, sh4_ftcsr_callback callback)
+{
+ SH4 *sh4 = get_safe_token(device);
+ sh4->ftcsr_read_callback = callback;
+}
+
+
#if 0
/*When OC index mode is off (CCR.OIX = 0)*/
static ADDRESS_MAP_START( sh4_internal_map, ADDRESS_SPACE_PROGRAM, 64 )
@@ -3923,7 +3923,5 @@ CPU_GET_INFO( sh4 )
case CPUINFO_STR_REGISTER + SH4_XF14: sprintf(info->s, "XF14 :%08X %f", FP_XS(14),(double)FP_XFS(14)); break;
case CPUINFO_STR_REGISTER + SH4_XF15: sprintf(info->s, "XF15 :%08X %f", FP_XS(15),(double)FP_XFS(15)); break; //%01.2e
#endif
- case CPUINFO_FCT_SH4_FTCSR_READ_CALLBACK: info->f = (genf*)sh4->ftcsr_read_callback; break;
-
}
}
diff --git a/src/emu/cpu/sh4/sh4.h b/src/emu/cpu/sh4/sh4.h
index 3cc9aef2d91..fe7c6b1fff7 100644
--- a/src/emu/cpu/sh4/sh4.h
+++ b/src/emu/cpu/sh4/sh4.h
@@ -56,18 +56,6 @@ enum
enum
{
- CPUINFO_INT_SH4_IRLn_INPUT = CPUINFO_INT_CPU_SPECIFIC,
- CPUINFO_INT_SH4_FRT_INPUT
-};
-
-enum
-{
- CPUINFO_FCT_SH4_FTCSR_READ_CALLBACK = CPUINFO_FCT_CPU_SPECIFIC,
- CPUINFO_PTR_SH4_EXTERNAL_DDT_DMA = CPUINFO_PTR_CPU_SPECIFIC,
-};
-
-enum
-{
SH4_IOPORT_16=8*0,
SH4_IOPORT_4=8*1,
// future use
@@ -101,6 +89,8 @@ struct sh4_ddt_dma
int mode;
};
+typedef void (*sh4_ftcsr_callback)(UINT32);
+
extern CPU_GET_INFO( sh4 );
#define CPU_SH4 CPU_GET_INFO_NAME( sh4 )
@@ -109,5 +99,10 @@ READ32_HANDLER( sh4_internal_r );
extern unsigned DasmSH4( char *dst, unsigned pc, UINT16 opcode );
+void sh4_set_frt_input(const device_config *device, int state);
+void sh4_set_irln_input(const device_config *device, int value);
+void sh4_set_ftcsr_callback(const device_config *device, sh4_ftcsr_callback callback);
+void sh4_dma_ddt(const device_config *device, struct sh4_ddt_dma *s);
+
#endif /* __SH4_H__ */
diff --git a/src/emu/cpu/sh4/sh4comn.c b/src/emu/cpu/sh4/sh4comn.c
index f10d5cd4f1e..0f06c7fe8f0 100644
--- a/src/emu/cpu/sh4/sh4comn.c
+++ b/src/emu/cpu/sh4/sh4comn.c
@@ -1185,12 +1185,13 @@ void sh4_common_init(const device_config *device)
sh4->m = (UINT32 *)auto_malloc(16384*4);
}
-void sh4_dma_ddt(SH4 *sh4, struct sh4_ddt_dma *s)
+void sh4_dma_ddt(const device_config *device, struct sh4_ddt_dma *s)
{
-UINT32 chcr;
-UINT32 *p32bits;
-UINT64 *p32bytes;
-UINT32 pos,len,siz;
+ SH4 *sh4 = get_safe_token(device);
+ UINT32 chcr;
+ UINT32 *p32bits;
+ UINT64 *p32bytes;
+ UINT32 pos,len,siz;
if (sh4->dma_timer_active[s->channel])
return;
diff --git a/src/emu/cpu/sh4/sh4comn.h b/src/emu/cpu/sh4/sh4comn.h
index e448f54cd5d..ccb726f66a4 100644
--- a/src/emu/cpu/sh4/sh4comn.h
+++ b/src/emu/cpu/sh4/sh4comn.h
@@ -144,10 +144,7 @@ void sh4_syncronize_register_bank(SH4 *sh4, int to);
void sh4_swap_fp_registers(SH4 *sh4);
void sh4_default_exception_priorities(SH4 *sh4); // setup default priorities for exceptions
void sh4_parse_configuration(SH4 *sh4, const struct sh4_config *conf);
-void sh4_dma_ddt(SH4 *sh4, struct sh4_ddt_dma *s);
void sh4_set_irq_line(SH4 *sh4, int irqline, int state); // set state of external interrupt line
-void sh4_set_frt_input(const device_config *device, int state);
-void sh4_set_irln_input(const device_config *device, int value);
#ifdef LSB_FIRST
void sh4_swap_fp_couples(SH4 *sh4);
#endif