summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/dsp56k/dsp56mem.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-06-08 06:24:21 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-06-08 06:24:21 +0000
commitef0a31ca13fd0598fd9d694d5bc0bee0a0f23f3b (patch)
tree218ccdde1d5bd32fcc015ca18dce4cf845db0d76 /src/emu/cpu/dsp56k/dsp56mem.c
parentce83de86a8c88053081d9f5cb8c6b83baf606fb9 (diff)
From: Atari Ace [mailto:atari_ace@verizon.net]
Sent: Sunday, June 07, 2009 9:54 AM To: submit@mamedev.org Cc: atariace@hotmail.com Subject: [patch] "Regularize" some interfaces in MAME Hi mamedev, This patch adjusts the code in a few places to be more regular in it object approach. It recognizes five idioms. 1. device_configs should be passed const. dsp56k.h took a non-const device_config for no particular reason, necessitating casting where used. A few other places cast to non-const, in most cases unnecessarily. 2. running_machines should be passed non-const. A few places used const in different ways on running_machines, instead of the idiomatic non-const running_machine. 3. Eliminate passing running_machine explicitly where it can be computed. esrip.c, m37710.c, sfbonus.c had cases where the machine could easily be eliminated. 4. Pass the object machine/config first. In some cases this makes the interface object oriented, in some cases it simply makes it more idiomatic with the rest of MAME. 5. Prefer (screen, bitmap, cliprect) to (machine, bitmap, cliprect). Fully implementing this would be a large patch, this patch simply does it for the one core 'device', tms9928a.c.
Diffstat (limited to 'src/emu/cpu/dsp56k/dsp56mem.c')
-rw-r--r--src/emu/cpu/dsp56k/dsp56mem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/emu/cpu/dsp56k/dsp56mem.c b/src/emu/cpu/dsp56k/dsp56mem.c
index fac1b2f89ed..440f7543642 100644
--- a/src/emu/cpu/dsp56k/dsp56mem.c
+++ b/src/emu/cpu/dsp56k/dsp56mem.c
@@ -610,7 +610,7 @@ static void dsp56k_host_interface_reset(dsp56k_core* cpustate)
/* These two functions are exposed to the outside world */
/* They represent the host side of the dsp56k's host interface */
-void dsp56k_host_interface_write(device_config* device, UINT8 offset, UINT8 data)
+void dsp56k_host_interface_write(const device_config* device, UINT8 offset, UINT8 data)
{
dsp56k_core* cpustate = get_safe_token(device);
@@ -706,7 +706,7 @@ void dsp56k_host_interface_write(device_config* device, UINT8 offset, UINT8 data
}
}
-UINT8 dsp56k_host_interface_read(device_config* device, UINT8 offset)
+UINT8 dsp56k_host_interface_read(const device_config* device, UINT8 offset)
{
dsp56k_core* cpustate = get_safe_token(device);
@@ -934,7 +934,7 @@ static void dsp56k_io_reset(dsp56k_core* cpustate)
/* MISC*/
-UINT16 dsp56k_get_peripheral_memory(device_config* device, UINT16 addr)
+UINT16 dsp56k_get_peripheral_memory(const device_config* device, UINT16 addr)
{
// TODO // THIS COMES BACK dsp56k_core* cpustate = get_safe_token(device);
return dsp56k_peripheral_ram[A2O(addr)];