summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author angelosa <lordkale4@gmail.com>2018-06-29 04:13:16 +0200
committer angelosa <lordkale4@gmail.com>2018-06-29 04:41:50 +0200
commitecf1219b0532c9bfa9b5912e7ddbefe840443706 (patch)
tree8352809a9402eb15e4b8e0a359efb555d42b8812
parent9d6126ee184cf752e6c8491783d73bffbe2393a2 (diff)
ironhors.cpp: fixed Iron Horse framerate to 61 Hz [Angelo Salese]
-rw-r--r--src/mame/drivers/ironhors.cpp21
-rw-r--r--src/mame/includes/ironhors.h7
2 files changed, 16 insertions, 12 deletions
diff --git a/src/mame/drivers/ironhors.cpp b/src/mame/drivers/ironhors.cpp
index 39776e397bc..9ecef54cfbd 100644
--- a/src/mame/drivers/ironhors.cpp
+++ b/src/mame/drivers/ironhors.cpp
@@ -15,7 +15,6 @@
#include "cpu/m6809/m6809.h"
#include "cpu/z80/z80.h"
#include "sound/2203intf.h"
-#include "screen.h"
#include "speaker.h"
@@ -25,11 +24,11 @@
*
*************************************/
-TIMER_DEVICE_CALLBACK_MEMBER(ironhors_state::irq)
+TIMER_DEVICE_CALLBACK_MEMBER(ironhors_state::ironhors_scanline_tick)
{
int scanline = param;
- if (scanline == 240)
+ if (scanline == 240 && (m_screen->frame_number() & 1) == 0)
{
if (*m_interrupt_enable & 4)
m_maincpu->set_input_line(M6809_FIRQ_LINE, HOLD_LINE);
@@ -384,7 +383,7 @@ MACHINE_CONFIG_START(ironhors_state::ironhors)
/* basic machine hardware */
MCFG_DEVICE_ADD("maincpu", MC6809E, 18432000/6) /* 3.072 MHz??? mod by Shingo Suzuki 1999/10/15 */
MCFG_DEVICE_PROGRAM_MAP(master_map)
- MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ironhors_state, irq, "screen", 0, 1)
+ MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", ironhors_state, ironhors_scanline_tick, "screen", 0, 1)
MCFG_DEVICE_ADD("soundcpu", Z80, 18432000/6) /* 3.072 MHz */
MCFG_DEVICE_PROGRAM_MAP(slave_map)
@@ -393,10 +392,12 @@ MACHINE_CONFIG_START(ironhors_state::ironhors)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(30)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
+// MCFG_SCREEN_REFRESH_RATE(61)
+// MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0))
+// MCFG_SCREEN_SIZE(32*8, 32*8)
+// MCFG_SCREEN_VISIBLE_AREA(1*8, 31*8-1, 2*8, 30*8-1)
+ MCFG_SCREEN_RAW_PARAMS(18432000/4,296,8,256-8,255,16,240) // pixel clock is a guesswork
+
MCFG_SCREEN_UPDATE_DRIVER(ironhors_state, screen_update)
MCFG_SCREEN_PALETTE("palette")
@@ -423,7 +424,7 @@ MACHINE_CONFIG_START(ironhors_state::ironhors)
MACHINE_CONFIG_END
-TIMER_DEVICE_CALLBACK_MEMBER(ironhors_state::farwest_irq)
+TIMER_DEVICE_CALLBACK_MEMBER(ironhors_state::farwest_scanline_tick)
{
int scanline = param;
@@ -450,7 +451,7 @@ MACHINE_CONFIG_START(ironhors_state::farwest)
MCFG_DEVICE_MODIFY("maincpu")
MCFG_DEVICE_PROGRAM_MAP(farwest_master_map)
MCFG_DEVICE_MODIFY("scantimer")
- MCFG_TIMER_DRIVER_CALLBACK(ironhors_state, farwest_irq)
+ MCFG_TIMER_DRIVER_CALLBACK(ironhors_state, farwest_scanline_tick)
MCFG_DEVICE_MODIFY("soundcpu")
MCFG_DEVICE_PROGRAM_MAP(farwest_slave_map)
diff --git a/src/mame/includes/ironhors.h b/src/mame/includes/ironhors.h
index 1887ee67e28..48a9cb351aa 100644
--- a/src/mame/includes/ironhors.h
+++ b/src/mame/includes/ironhors.h
@@ -10,6 +10,7 @@
#include "machine/timer.h"
#include "sound/discrete.h"
#include "emupal.h"
+#include "screen.h"
class ironhors_state : public driver_device
{
@@ -20,6 +21,7 @@ public:
m_soundcpu(*this, "soundcpu"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
+ m_screen(*this, "screen"),
m_soundlatch(*this, "soundlatch"),
m_disc_ih(*this, "disc_ih"),
m_interrupt_enable(*this, "int_enable"),
@@ -45,8 +47,8 @@ private:
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
uint32_t screen_update_farwest(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
- TIMER_DEVICE_CALLBACK_MEMBER(irq);
- TIMER_DEVICE_CALLBACK_MEMBER(farwest_irq);
+ TIMER_DEVICE_CALLBACK_MEMBER(ironhors_scanline_tick);
+ TIMER_DEVICE_CALLBACK_MEMBER(farwest_scanline_tick);
DECLARE_PALETTE_INIT(ironhors);
DECLARE_VIDEO_START(farwest);
@@ -66,6 +68,7 @@ private:
required_device<cpu_device> m_soundcpu;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
+ required_device<screen_device> m_screen;
required_device<generic_latch_8_device> m_soundlatch;
required_device<discrete_device> m_disc_ih;