summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/machine
diff options
context:
space:
mode:
author Fabio Priuli <etabeta78@users.noreply.github.com>2013-04-22 15:15:05 +0000
committer Fabio Priuli <etabeta78@users.noreply.github.com>2013-04-22 15:15:05 +0000
commit051dae1cdd7569a3c0da0804788f5b03e4546e46 (patch)
tree3beddcdf82be7cae433f6e0efddf0cd8faec4239 /src/mess/machine
parente0577be96c443a48aa9de446f8b56d9979fe304f (diff)
a bunch of cleanups. nw.
Diffstat (limited to 'src/mess/machine')
-rw-r--r--src/mess/machine/md_slot.c5
-rw-r--r--src/mess/machine/nes_bootleg.c3
-rw-r--r--src/mess/machine/nes_bootleg.h1
-rw-r--r--src/mess/machine/nes_event.c3
-rw-r--r--src/mess/machine/nes_event.h2
-rw-r--r--src/mess/machine/nes_jy.c3
-rw-r--r--src/mess/machine/nes_jy.h1
-rw-r--r--src/mess/machine/nes_sunsoft_dcs.c3
-rw-r--r--src/mess/machine/nes_sunsoft_dcs.h1
-rw-r--r--src/mess/machine/nes_tengen.c3
-rw-r--r--src/mess/machine/nes_tengen.h1
11 files changed, 18 insertions, 8 deletions
diff --git a/src/mess/machine/md_slot.c b/src/mess/machine/md_slot.c
index 113d8bb4ae1..0c99b92e727 100644
--- a/src/mess/machine/md_slot.c
+++ b/src/mess/machine/md_slot.c
@@ -901,11 +901,10 @@ int base_md_cart_slot_device::get_cart_type(UINT8 *ROM, UINT32 len)
const char * base_md_cart_slot_device::get_default_card_software(const machine_config &config, emu_options &options)
{
- const char *slot_string = "rom";
-
if (open_image_file(options))
{
- UINT32 len = core_fsize(m_file), offset = 0;;
+ const char *slot_string = "rom";
+ UINT32 len = core_fsize(m_file), offset = 0;
UINT8 *ROM = global_alloc_array(UINT8, len);
int type;
diff --git a/src/mess/machine/nes_bootleg.c b/src/mess/machine/nes_bootleg.c
index ecf28397dbb..94ef6074c32 100644
--- a/src/mess/machine/nes_bootleg.c
+++ b/src/mess/machine/nes_bootleg.c
@@ -202,6 +202,7 @@ void nes_mbaby_device::device_start()
common_start();
irq_timer = timer_alloc(TIMER_IRQ);
irq_timer->reset();
+ timer_freq = machine().device<cpu_device>("maincpu")->cycles_to_attotime(24576);
save_item(NAME(m_irq_enable));
save_item(NAME(m_latch));
@@ -673,7 +674,7 @@ WRITE8_MEMBER(nes_mbaby_device::write_h)
if (!m_irq_enable && (data & 0x02))
{
m_irq_enable = 1;
- irq_timer->adjust(machine().device<cpu_device>("maincpu")->cycles_to_attotime(24576));
+ irq_timer->adjust(timer_freq);
}
if (!(data & 0x02))
{
diff --git a/src/mess/machine/nes_bootleg.h b/src/mess/machine/nes_bootleg.h
index 74c964635f2..09f55f74381 100644
--- a/src/mess/machine/nes_bootleg.h
+++ b/src/mess/machine/nes_bootleg.h
@@ -68,6 +68,7 @@ private:
static const device_timer_id TIMER_IRQ = 0;
emu_timer *irq_timer;
+ attotime timer_freq;
};
diff --git a/src/mess/machine/nes_event.c b/src/mess/machine/nes_event.c
index d59fbf626f7..2eacfbd131f 100644
--- a/src/mess/machine/nes_event.c
+++ b/src/mess/machine/nes_event.c
@@ -48,6 +48,7 @@ void nes_event_device::device_start()
common_start();
event_timer = timer_alloc(TIMER_EVENT);
event_timer->adjust(attotime::never);
+ timer_freq = machine().device<cpu_device>("maincpu")->cycles_to_attotime(1);
save_item(NAME(m_latch));
save_item(NAME(m_count));
@@ -156,7 +157,7 @@ void nes_event_device::set_prg()
if (!m_timer_on && m_timer_enabled)
{
m_timer_count = 0x20000000 | ((m_dsw->read() & 0x0f) << 25);
- event_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(1));
+ event_timer->adjust(attotime::zero, 0, timer_freq);
m_timer_on = 1;
}
}
diff --git a/src/mess/machine/nes_event.h b/src/mess/machine/nes_event.h
index 100937c4890..ecd617576d1 100644
--- a/src/mess/machine/nes_event.h
+++ b/src/mess/machine/nes_event.h
@@ -29,6 +29,8 @@ protected:
static const device_timer_id TIMER_EVENT = 0;
emu_timer *event_timer;
+ attotime timer_freq;
+
UINT32 m_timer_count;
int m_timer_on, m_timer_enabled;
};
diff --git a/src/mess/machine/nes_jy.c b/src/mess/machine/nes_jy.c
index 7f415063498..4862cbcb8e2 100644
--- a/src/mess/machine/nes_jy.c
+++ b/src/mess/machine/nes_jy.c
@@ -75,6 +75,7 @@ void nes_jy_typea_device::device_start()
common_start();
irq_timer = timer_alloc(TIMER_IRQ);
irq_timer->reset();
+ timer_freq = machine().device<cpu_device>("maincpu")->cycles_to_attotime(1);
save_item(NAME(m_mul));
save_item(NAME(m_latch));
@@ -499,7 +500,7 @@ WRITE8_MEMBER(nes_jy_typea_device::write_h)
m_irq_down = data & 0x80;
m_irq_up = data & 0x40;
if (m_irq_mode == 0)
- irq_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(1));
+ irq_timer->adjust(attotime::zero, 0, timer_freq);
else
irq_timer->adjust(attotime::never);
break;
diff --git a/src/mess/machine/nes_jy.h b/src/mess/machine/nes_jy.h
index 6014723b1d5..0cc9df8d91e 100644
--- a/src/mess/machine/nes_jy.h
+++ b/src/mess/machine/nes_jy.h
@@ -58,6 +58,7 @@ protected:
static const device_timer_id TIMER_IRQ = 0;
emu_timer *irq_timer;
+ attotime timer_freq;
};
diff --git a/src/mess/machine/nes_sunsoft_dcs.c b/src/mess/machine/nes_sunsoft_dcs.c
index f38daac472d..eda31ddde14 100644
--- a/src/mess/machine/nes_sunsoft_dcs.c
+++ b/src/mess/machine/nes_sunsoft_dcs.c
@@ -162,6 +162,7 @@ void nes_sunsoft_dcs_device::device_start()
common_start();
ntb_enable_timer = timer_alloc(TIMER_PROTECT);
ntb_enable_timer->reset();
+ timer_freq = machine().device<cpu_device>("maincpu")->cycles_to_attotime(107520);
save_item(NAME(m_latch1));
save_item(NAME(m_latch2));
@@ -248,7 +249,7 @@ WRITE8_MEMBER(nes_sunsoft_dcs_device::write_m)
{
m_timer_on = 1;
// start NTB-ROM timer
- ntb_enable_timer->adjust(machine().device<cpu_device>("maincpu")->cycles_to_attotime(107520));
+ ntb_enable_timer->adjust(timer_freq);
}
}
diff --git a/src/mess/machine/nes_sunsoft_dcs.h b/src/mess/machine/nes_sunsoft_dcs.h
index c3e20ea92b5..4f5d988bd5a 100644
--- a/src/mess/machine/nes_sunsoft_dcs.h
+++ b/src/mess/machine/nes_sunsoft_dcs.h
@@ -126,6 +126,7 @@ private:
static const device_timer_id TIMER_PROTECT = 0;
emu_timer *ntb_enable_timer;
+ attotime timer_freq;
};
diff --git a/src/mess/machine/nes_tengen.c b/src/mess/machine/nes_tengen.c
index 61b6c733217..357c2101e0d 100644
--- a/src/mess/machine/nes_tengen.c
+++ b/src/mess/machine/nes_tengen.c
@@ -84,6 +84,7 @@ void nes_tengen032_device::device_start()
common_start();
irq_timer = timer_alloc(TIMER_IRQ);
irq_timer->reset();
+ timer_freq = machine().device<cpu_device>("maincpu")->cycles_to_attotime(4);
save_item(NAME(m_mmc_prg_bank));
save_item(NAME(m_mmc_vrom_bank));
@@ -304,7 +305,7 @@ WRITE8_MEMBER(nes_tengen032_device::tengen032_write)
case 0x4001: /* $c001 - IRQ scanline latch */
m_irq_mode = data & 0x01;
if (m_irq_mode)
- irq_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(4));
+ irq_timer->adjust(attotime::zero, 0, timer_freq);
else
irq_timer->adjust(attotime::never);
m_irq_reset = 1;
diff --git a/src/mess/machine/nes_tengen.h b/src/mess/machine/nes_tengen.h
index e128f767d3d..f48e9e8a316 100644
--- a/src/mess/machine/nes_tengen.h
+++ b/src/mess/machine/nes_tengen.h
@@ -54,6 +54,7 @@ protected:
static const device_timer_id TIMER_IRQ = 0;
emu_timer *irq_timer;
+ attotime timer_freq;
};