From fb50913ccc3061b7e1894961c6a34aa2c5765184 Mon Sep 17 00:00:00 2001 From: Angelo Salese Date: Thu, 10 Jan 2013 18:43:06 +0000 Subject: [PATCH] Converted ggconnie to use the new PCE video core --- src/mame/drivers/ggconnie.c | 106 +++++++++++++++++++++++++++++++----- 1 file changed, 92 insertions(+), 14 deletions(-) diff --git a/src/mame/drivers/ggconnie.c b/src/mame/drivers/ggconnie.c index b9069ba1d76..5211ef6f83f 100644 --- a/src/mame/drivers/ggconnie.c +++ b/src/mame/drivers/ggconnie.c @@ -18,7 +18,9 @@ #include "emu.h" #include "machine/pcecommn.h" -#include "video/vdc.h" +#include "video/huc6270.h" +#include "video/huc6260.h" +#include "video/huc6202.h" #include "cpu/h6280/h6280.h" #include "sound/c6280.h" #include "sound/okim6295.h" @@ -29,15 +31,20 @@ class ggconnie_state : public pce_common_state public: ggconnie_state(const machine_config &mconfig, device_type type, const char *tag) : pce_common_state(mconfig, type, tag), + m_huc6260(*this, "huc6260"), m_oki(*this, "oki") { } + required_device m_huc6260; required_device m_oki; DECLARE_WRITE8_MEMBER(lamp_w); DECLARE_WRITE8_MEMBER(output_w); DECLARE_READ8_MEMBER(rtc_r); DECLARE_WRITE8_MEMBER(rtc_w); DECLARE_WRITE8_MEMBER(oki_bank_w); + DECLARE_WRITE_LINE_MEMBER(pce_irq_changed); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; @@ -179,10 +186,10 @@ static ADDRESS_MAP_START( sgx_mem , AS_PROGRAM, 8, ggconnie_state ) AM_RANGE( 0x1f7200, 0x1f7200) AM_READ_PORT("SWC") AM_RANGE( 0x1f7700, 0x1f7700) AM_READ_PORT("IN1") AM_RANGE( 0x1f7800, 0x1f7800) AM_WRITE(output_w) - AM_RANGE( 0x1fe000, 0x1fe007) AM_READWRITE_LEGACY(vdc_0_r, vdc_0_w) AM_MIRROR(0x03e0) - AM_RANGE( 0x1fe008, 0x1fe00f) AM_READWRITE_LEGACY(vpc_r, vpc_w) AM_MIRROR(0x03e0) - AM_RANGE( 0x1fe010, 0x1fe017) AM_READWRITE_LEGACY(vdc_1_r, vdc_1_w) AM_MIRROR(0x03e0) - AM_RANGE( 0x1fe400, 0x1fe7ff) AM_READWRITE_LEGACY(vce_r, vce_w) + AM_RANGE( 0x1fe000, 0x1fe007) AM_DEVREADWRITE( "huc6270_0", huc6270_device, read, write ) AM_MIRROR(0x03E0) + AM_RANGE( 0x1fe008, 0x1fe00f) AM_DEVREADWRITE( "huc6202", huc6202_device, read, write ) AM_MIRROR(0x03E0) + AM_RANGE( 0x1fe010, 0x1fe017) AM_DEVREADWRITE( "huc6270_1", huc6270_device, read, write ) AM_MIRROR(0x03E0) + AM_RANGE( 0x1fe400, 0x1fe7ff) AM_DEVREADWRITE( "huc6260", huc6260_device, read, write ) AM_RANGE( 0x1fe800, 0x1febff) AM_DEVREADWRITE("c6280", c6280_device, c6280_r, c6280_w) AM_RANGE( 0x1fec00, 0x1fefff) AM_DEVREADWRITE("maincpu", h6280_device, timer_r, timer_w) AM_RANGE( 0x1f7300, 0x1f7300) AM_DEVREADWRITE("oki", okim6295_device, read, write) @@ -193,7 +200,7 @@ static ADDRESS_MAP_START( sgx_mem , AS_PROGRAM, 8, ggconnie_state ) ADDRESS_MAP_END static ADDRESS_MAP_START( sgx_io , AS_IO, 8, ggconnie_state ) - AM_RANGE( 0x00, 0x03) AM_READWRITE_LEGACY(sgx_vdc_r, sgx_vdc_w ) + AM_RANGE( 0x00, 0x03) AM_DEVREADWRITE( "huc6202", huc6202_device, io_read, io_write ) ADDRESS_MAP_END static const c6280_interface c6280_config = @@ -201,26 +208,97 @@ static const c6280_interface c6280_config = "maincpu" }; +UINT32 ggconnie_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_huc6260->video_update( bitmap, cliprect ); + return 0; +} + + +WRITE_LINE_MEMBER(ggconnie_state::pce_irq_changed) +{ + machine().device("maincpu")->execute().set_input_line(0, state); +} + + +static const huc6270_interface pce_huc6270_config = +{ + 0x10000, + DEVCB_DRIVER_LINE_MEMBER(ggconnie_state,pce_irq_changed) +}; + + +static const huc6260_interface pce_huc6260_config = +{ + "screen", + DEVCB_DEVICE_MEMBER16( "huc6270", huc6270_device, next_pixel ), + DEVCB_DEVICE_MEMBER16( "huc6270", huc6270_device, time_until_next_event ), + DEVCB_DEVICE_LINE_MEMBER( "huc6270", huc6270_device, vsync_changed ), + DEVCB_DEVICE_LINE_MEMBER( "huc6270", huc6270_device, hsync_changed ) +}; + + +static const huc6270_interface sgx_huc6270_0_config = +{ + 0x10000, + DEVCB_DRIVER_LINE_MEMBER(ggconnie_state,pce_irq_changed) +}; + + +static const huc6270_interface sgx_huc6270_1_config = +{ + 0x10000, + DEVCB_DRIVER_LINE_MEMBER(ggconnie_state,pce_irq_changed) +}; + + +static const huc6202_interface sgx_huc6202_config = +{ + DEVCB_DEVICE_MEMBER16( "huc6270_0", huc6270_device, next_pixel ), + DEVCB_DEVICE_MEMBER16( "huc6270_0", huc6270_device, time_until_next_event ), + DEVCB_DEVICE_LINE_MEMBER( "huc6270_0", huc6270_device, vsync_changed ), + DEVCB_DEVICE_LINE_MEMBER( "huc6270_0", huc6270_device, hsync_changed ), + DEVCB_DEVICE_MEMBER( "huc6270_0", huc6270_device, read ), + DEVCB_DEVICE_MEMBER( "huc6270_0", huc6270_device, write ), + DEVCB_DEVICE_MEMBER16( "huc6270_1", huc6270_device, next_pixel ), + DEVCB_DEVICE_MEMBER16( "huc6270_1", huc6270_device, time_until_next_event ), + DEVCB_DEVICE_LINE_MEMBER( "huc6270_1", huc6270_device, vsync_changed ), + DEVCB_DEVICE_LINE_MEMBER( "huc6270_1", huc6270_device, hsync_changed ), + DEVCB_DEVICE_MEMBER( "huc6270_1", huc6270_device, read ), + DEVCB_DEVICE_MEMBER( "huc6270_1", huc6270_device, write ), +}; + + +static const huc6260_interface sgx_huc6260_config = +{ + "screen", + DEVCB_DEVICE_MEMBER16( "huc6202", huc6202_device, next_pixel ), + DEVCB_DEVICE_MEMBER16( "huc6202", huc6202_device, time_until_next_event ), + DEVCB_DEVICE_LINE_MEMBER( "huc6202", huc6202_device, vsync_changed ), + DEVCB_DEVICE_LINE_MEMBER( "huc6202", huc6202_device, hsync_changed ) +}; + + static MACHINE_CONFIG_START( ggconnie, ggconnie_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", H6280, PCE_MAIN_CLOCK/3) MCFG_CPU_PROGRAM_MAP(sgx_mem) MCFG_CPU_IO_MAP(sgx_io) - MCFG_TIMER_ADD_SCANLINE("scantimer", sgx_interrupt, "screen", 0, 1) // MCFG_QUANTUM_TIME(attotime::from_hz(60)) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) - MCFG_SCREEN_RAW_PARAMS(PCE_MAIN_CLOCK/2, VDC_WPF, 70, 70 + 512 + 32, VDC_LPF, 14, 14+242) - MCFG_SCREEN_UPDATE_STATIC( pce ) + MCFG_SCREEN_RAW_PARAMS(PCE_MAIN_CLOCK/3, HUC6260_WPF, 64, 64 + 1024 + 64, HUC6260_LPF, 18, 18 + 242) + MCFG_SCREEN_UPDATE_DRIVER( ggconnie_state, screen_update ) - /* MCFG_GFXDECODE( pce_gfxdecodeinfo ) */ - MCFG_PALETTE_LENGTH(1024) - MCFG_PALETTE_INIT( vce ) + MCFG_PALETTE_LENGTH( HUC6260_PALETTE_SIZE ) + MCFG_PALETTE_INIT( huc6260 ) - MCFG_VIDEO_START( pce ) + MCFG_HUC6260_ADD( "huc6260", PCE_MAIN_CLOCK/3, sgx_huc6260_config ) + MCFG_HUC6270_ADD( "huc6270_0", sgx_huc6270_0_config ) + MCFG_HUC6270_ADD( "huc6270_1", sgx_huc6270_1_config ) + MCFG_HUC6202_ADD( "huc6202", sgx_huc6202_config ) MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker") MCFG_SOUND_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)