summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-10-03 19:48:18 -0400
committer AJR <ajrhacker@users.noreply.github.com>2018-10-03 19:48:44 -0400
commit3a13c26b245ccd842240827e355b254bed50eceb (patch)
treeb63879f0d70e55a1768442402d2b6ef349eb242f
parenta4b155606bbc004a6c42dbc18c49eb0d9da3888d (diff)
vega: Add DP8350 CRTC; misc. tiny cleanups (still nowhere near clean enough) (nw)
-rw-r--r--src/mame/drivers/vega.cpp50
1 files changed, 27 insertions, 23 deletions
diff --git a/src/mame/drivers/vega.cpp b/src/mame/drivers/vega.cpp
index b5206094442..9139b13f7ad 100644
--- a/src/mame/drivers/vega.cpp
+++ b/src/mame/drivers/vega.cpp
@@ -80,6 +80,7 @@ TODO:
#include "machine/i8255.h"
#include "machine/ins8154.h"
#include "sound/ay8910.h"
+#include "video/dp8350.h"
#include "emupal.h"
#include "screen.h"
#include "speaker.h"
@@ -110,6 +111,7 @@ public:
, m_i8255(*this, "ppi8255")
, m_ins8154(*this, "ins8154")
, m_ay8910(*this, "ay8910")
+ , m_crtc(*this, "crtc")
, m_gfxdecode(*this, "gfxdecode")
, m_palette(*this, "palette")
{
@@ -124,6 +126,7 @@ private:
required_device<i8255_device> m_i8255;
required_device<ins8154_device> m_ins8154;
required_device<ay8910_device> m_ay8910;
+ required_device<dp8350_device> m_crtc;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;
@@ -170,7 +173,7 @@ private:
virtual void machine_reset() override;
DECLARE_PALETTE_INIT(vega);
void draw_tilemap(screen_device& screen, bitmap_ind16& bitmap, const rectangle& cliprect);
- uint32_t screen_update_vega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
+ uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void vega_io_map(address_map &map);
void vega_map(address_map &map);
};
@@ -393,7 +396,7 @@ WRITE8_MEMBER(vega_state::rombank_w)
void vega_state::vega_map(address_map &map)
{
map(0x000, 0x7ff).bankr("bank1");
- map(0x800, 0xfff).rom();
+ map(0x800, 0xfff).rom().region("mb1", 0);
}
void vega_state::vega_io_map(address_map &map)
@@ -529,7 +532,7 @@ void vega_state::draw_tilemap(screen_device& screen, bitmap_ind16& bitmap, const
{
//for(int x=0;x<4;++x)
{
- m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, num, 0, 1,flip?1:0, x*4+x0-offset_x, (flip?(3-y):y)*8+y0-offset_y, 0);
+ m_gfxdecode->gfx(1)->zoom_transpen(bitmap,cliprect, num, 0, 1,flip?1:0, (x*4+x0-offset_x)*2, (flip?(3-y):y)*8+y0-offset_y, 0x20000, 0x10000, 0);
++num;
}
}
@@ -545,7 +548,7 @@ void vega_state::draw_tilemap(screen_device& screen, bitmap_ind16& bitmap, const
}
-uint32_t vega_state::screen_update_vega(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
+uint32_t vega_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
++m_frame_counter;
@@ -578,7 +581,7 @@ uint32_t vega_state::screen_update_vega(screen_device &screen, bitmap_ind16 &bit
// if(color==0) color=0xf;
- m_gfxdecode->gfx(0)->transpen(bitmap,cliprect, character, color, 0, 0, x*7, y*10,0);
+ m_gfxdecode->gfx(0)->zoom_transpen(bitmap,cliprect, character, color, 0, 0, x*14, y*10, 0x20000, 0x10000, 0);
++idx;
}
@@ -599,7 +602,7 @@ uint32_t vega_state::screen_update_vega(screen_device &screen, bitmap_ind16 &bit
{
//for(int x=0;x<4;++x)
{
- m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, num, 0, 1, flip?1:0, x*4+x0, (flip?(3-y):y)*8+y0, 0);
+ m_gfxdecode->gfx(2)->zoom_transpen(bitmap,cliprect, num, 0, 1, flip?1:0, (x*4+x0)*2, (flip?(3-y):y)*8+y0, 0x20000, 0x10000, 0);
++num;
}
}
@@ -639,7 +642,7 @@ uint32_t vega_state::screen_update_vega(screen_device &screen, bitmap_ind16 &bit
for(int y=0;y<4;++y)
{
- m_gfxdecode->gfx(3)->transpen(bitmap,cliprect, strip_num, 0, !xor_line, 0, x*4+x0, y*8+y0, 0);
+ m_gfxdecode->gfx(3)->zoom_transpen(bitmap,cliprect, strip_num, 0, !xor_line, 0, (x*4+x0)*2, y*8+y0, 0x20000, 0x10000, 0);
++strip_num;
}
}
@@ -806,7 +809,6 @@ MACHINE_CONFIG_START(vega_state::vega)
MCFG_MCS48_PORT_P2_OUT_CB(WRITE8(*this, vega_state, p2_w))
MCFG_MCS48_PORT_T1_IN_CB(READLINE(*this, vega_state, t1_r))
MCFG_MCS48_PORT_PROG_OUT_CB(NOOP) /* prog - inputs CLK */
- MCFG_DEVICE_VBLANK_INT_DRIVER("screen", vega_state, irq0_line_hold)
I8255A(config, m_i8255);
m_i8255->in_pa_callback().set(FUNC(vega_state::txtram_r));
@@ -823,18 +825,18 @@ MACHINE_CONFIG_START(vega_state::vega)
m_ins8154->out_b().set(FUNC(vega_state::ins8154_pb_w));
/* 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(512, 256)
- MCFG_SCREEN_VISIBLE_AREA(0*8, 280, 0*8, 239)
- MCFG_SCREEN_UPDATE_DRIVER(vega_state, screen_update_vega)
- MCFG_SCREEN_PALETTE("palette")
+ screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
+ screen.set_screen_update(FUNC(vega_state::screen_update));
+ screen.set_palette(m_palette);
- MCFG_PALETTE_ADD("palette", 0x100)
- MCFG_PALETTE_INIT_OWNER(vega_state, vega)
+ DP8350(config, m_crtc, 10920000); // pins 21/22 connected to XTAL, 3 to GND
+ m_crtc->set_screen("screen");
+ m_crtc->refresh_control(0);
+ m_crtc->vblank_callback().set_inputline(m_maincpu, MCS48_INPUT_IRQ); // inverse of pin 2?
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_test_decode)
+ PALETTE(config, m_palette, 0x100).set_init(FUNC(vega_state::palette_init_vega));
+
+ GFXDECODE(config, "gfxdecode", "palette", gfx_test_decode);
/* sound hardware */
@@ -850,9 +852,11 @@ MACHINE_CONFIG_START(vega_state::vega)
MACHINE_CONFIG_END
ROM_START( vega )
- ROM_REGION( 0x10000, "maincpu", 0 )
- ROM_LOAD( "rom9.bin", 0x0800, 0x0800, CRC(191c73cd) SHA1(17b1c3790f82b276e55d25ea8a38a3c9cf20bf12) )
- ROM_LOAD( "rom10a.bin", 0x1000, 0x1000, CRC(fca9a570) SHA1(598772db11b32518ed6bf5155a19f4f1761a4831) )
+ ROM_REGION( 0x01000, "mb0", 0 )
+ ROM_LOAD( "rom10a.bin", 0x0000, 0x1000, CRC(fca9a570) SHA1(598772db11b32518ed6bf5155a19f4f1761a4831) )
+
+ ROM_REGION( 0x00800, "mb1", 0 )
+ ROM_LOAD( "rom9.bin", 0x0000, 0x0800, CRC(191c73cd) SHA1(17b1c3790f82b276e55d25ea8a38a3c9cf20bf12) )
ROM_REGION( 0x01000, "gfx1", ROMREGION_INVERT )
ROM_LOAD( "rom8.bin", 0x0000, 0x0800, CRC(ccb8598c) SHA1(8c4a702f0653bb189db7d8ac4c2a06aacecc0de0) )
@@ -885,8 +889,8 @@ ROM_END
void vega_state::init_vega()
{
- uint8_t *ROM = memregion("maincpu")->base();
- membank("bank1")->configure_entries(0, 2, &ROM[0x1000], 0x800);
+ uint8_t *ROM = memregion("mb0")->base();
+ membank("bank1")->configure_entries(0, 2, &ROM[0], 0x800);
}
GAME( 1982, vega, 0, vega, vega, vega_state, init_vega, ROT270, "Olympia", "Vega", MACHINE_NOT_WORKING|MACHINE_IMPERFECT_GRAPHICS )