summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/monzagp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/monzagp.cpp')
-rw-r--r--src/mame/drivers/monzagp.cpp33
1 files changed, 18 insertions, 15 deletions
diff --git a/src/mame/drivers/monzagp.cpp b/src/mame/drivers/monzagp.cpp
index b105b0da967..e860f04acf1 100644
--- a/src/mame/drivers/monzagp.cpp
+++ b/src/mame/drivers/monzagp.cpp
@@ -33,7 +33,7 @@ Lower board (MGP_01):
#include "cpu/mcs48/mcs48.h"
#include "machine/nvram.h"
#include "machine/timer.h"
-//#include "video/dp8350.h"
+#include "video/dp8350.h"
#include "video/resnet.h"
#include "emupal.h"
#include "screen.h"
@@ -46,6 +46,7 @@ public:
monzagp_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
+ m_crtc(*this, "crtc"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_nvram(*this, "nvram"),
@@ -74,6 +75,7 @@ private:
DECLARE_PALETTE_INIT(monzagp);
uint32_t screen_update_monzagp(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
required_device<cpu_device> m_maincpu;
+ required_device<dp8350_device> m_crtc;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
required_device<nvram_device> m_nvram;
@@ -188,7 +190,7 @@ uint32_t monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind1
uint8_t mycar_y = m_mycar_pos;
bool inv = false;
- for(int y=0; y<=256; y++, start_tile += inv ? -1 : +1)
+ for (int y = 0; y < 240; y++, start_tile += inv ? -1 : +1)
{
if (inv_counter++ == 0xff)
inv = true;
@@ -196,7 +198,7 @@ uint32_t monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind1
uint16_t start_x = (((m_video_ctrl[0][3] << 8) | m_video_ctrl[0][2]) ^ 0xffff);
uint8_t mycar_x = m_video_ctrl[1][2];
- for(int x=0; x<=256; x++, start_x++)
+ for (int x = 0; x < 280; x++, start_x++)
{
uint8_t tile_attr = m_tile_attr->base()[((start_x >> 5) & 0x1ff) | ((m_video_ctrl[0][3] & 0x80) ? 0 : 0x200)];
@@ -241,8 +243,10 @@ uint32_t monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind1
}
}
- if (cliprect.contains(x, y))
- bitmap.pix16(y, x) = color;
+ if (cliprect.contains(x * 2, y))
+ bitmap.pix16(y, x * 2) = color;
+ if (cliprect.contains(x * 2 + 1, y))
+ bitmap.pix16(y, x * 2 + 1) = color;
// collisions
uint8_t coll_prom_addr = bitswap<8>(tile_idx, 7, 6, 5, 4, 2, 0, 1, 3);
@@ -253,15 +257,16 @@ uint32_t monzagp_state::screen_update_monzagp(screen_device &screen, bitmap_ind1
}
// characters
- for(int y=0;y<26;y++)
+ for (int y = 0; y < 24; y++)
{
- for(int x=0;x<40;x++)
+ for (int x = 0; x < 40; x++)
{
- m_gfxdecode->gfx(0)->transpen(bitmap,cliprect,
+ m_gfxdecode->gfx(0)->zoom_transpen(bitmap,cliprect,
m_vram[y*40+x],
0,
0, 0,
- x*7,y*10,
+ x*14,y*10,
+ 0x20000, 0x10000,
1);
}
}
@@ -506,15 +511,13 @@ MACHINE_CONFIG_START(monzagp_state::monzagp)
/* video hardware */
MCFG_SCREEN_ADD("screen", RASTER)
- MCFG_SCREEN_REFRESH_RATE(60)
- MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */)
- MCFG_SCREEN_SIZE(32*8, 32*8)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*8, 32*8-1)
MCFG_SCREEN_UPDATE_DRIVER(monzagp_state, screen_update_monzagp)
MCFG_SCREEN_PALETTE("palette")
- MCFG_SCREEN_VBLANK_CALLBACK(INPUTLINE("maincpu", MCS48_INPUT_IRQ)) // inversion of DP8350 pin 2
- //MCFG_DEVICE_ADD("crtc", DP8350, 10920000) // pins 21/22 connected to XTAL, 3 to GND, 5 to +5
+ DP8350(config, m_crtc, 10920000); // pins 21/22 connected to XTAL, 3 to GND, 5 to +5
+ m_crtc->set_screen("screen");
+ m_crtc->refresh_control(0);
+ m_crtc->vsync_callback().set_inputline(m_maincpu, MCS48_INPUT_IRQ).invert(); // active low; no inverter should be needed
MCFG_PALETTE_ADD("palette", 0x200)
MCFG_PALETTE_INIT_OWNER(monzagp_state, monzagp)