Previous 199869 Revisions Next

r20184 Thursday 10th January, 2013 at 18:43:06 UTC by Angelo Salese
Converted ggconnie to use the new PCE video core
[src/mame/drivers]ggconnie.c

trunk/src/mame/drivers/ggconnie.c
r20183r20184
1818
1919#include "emu.h"
2020#include "machine/pcecommn.h"
21#include "video/vdc.h"
21#include "video/huc6270.h"
22#include "video/huc6260.h"
23#include "video/huc6202.h"
2224#include "cpu/h6280/h6280.h"
2325#include "sound/c6280.h"
2426#include "sound/okim6295.h"
r20183r20184
2931public:
3032   ggconnie_state(const machine_config &mconfig, device_type type, const char *tag)
3133      : pce_common_state(mconfig, type, tag),
34      m_huc6260(*this, "huc6260"),
3235      m_oki(*this, "oki")
3336      { }
3437
38   required_device <huc6260_device> m_huc6260;
3539   required_device <okim6295_device> m_oki;
3640   DECLARE_WRITE8_MEMBER(lamp_w);
3741   DECLARE_WRITE8_MEMBER(output_w);
3842   DECLARE_READ8_MEMBER(rtc_r);
3943   DECLARE_WRITE8_MEMBER(rtc_w);
4044   DECLARE_WRITE8_MEMBER(oki_bank_w);
45   DECLARE_WRITE_LINE_MEMBER(pce_irq_changed);
46
47   UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
4148};
4249
4350
r20183r20184
179186   AM_RANGE( 0x1f7200, 0x1f7200) AM_READ_PORT("SWC")
180187   AM_RANGE( 0x1f7700, 0x1f7700) AM_READ_PORT("IN1")
181188   AM_RANGE( 0x1f7800, 0x1f7800) AM_WRITE(output_w)
182   AM_RANGE( 0x1fe000, 0x1fe007) AM_READWRITE_LEGACY(vdc_0_r, vdc_0_w) AM_MIRROR(0x03e0)
183   AM_RANGE( 0x1fe008, 0x1fe00f) AM_READWRITE_LEGACY(vpc_r, vpc_w) AM_MIRROR(0x03e0)
184   AM_RANGE( 0x1fe010, 0x1fe017) AM_READWRITE_LEGACY(vdc_1_r, vdc_1_w) AM_MIRROR(0x03e0)
185   AM_RANGE( 0x1fe400, 0x1fe7ff) AM_READWRITE_LEGACY(vce_r, vce_w)
189   AM_RANGE( 0x1fe000, 0x1fe007) AM_DEVREADWRITE( "huc6270_0", huc6270_device, read, write ) AM_MIRROR(0x03E0)
190   AM_RANGE( 0x1fe008, 0x1fe00f) AM_DEVREADWRITE( "huc6202", huc6202_device, read, write ) AM_MIRROR(0x03E0)
191   AM_RANGE( 0x1fe010, 0x1fe017) AM_DEVREADWRITE( "huc6270_1", huc6270_device, read, write ) AM_MIRROR(0x03E0)
192   AM_RANGE( 0x1fe400, 0x1fe7ff) AM_DEVREADWRITE( "huc6260", huc6260_device, read, write )
186193   AM_RANGE( 0x1fe800, 0x1febff) AM_DEVREADWRITE("c6280", c6280_device, c6280_r, c6280_w)
187194   AM_RANGE( 0x1fec00, 0x1fefff) AM_DEVREADWRITE("maincpu", h6280_device, timer_r, timer_w)
188195   AM_RANGE( 0x1f7300, 0x1f7300) AM_DEVREADWRITE("oki", okim6295_device, read, write)
r20183r20184
193200ADDRESS_MAP_END
194201
195202static ADDRESS_MAP_START( sgx_io , AS_IO, 8, ggconnie_state )
196   AM_RANGE( 0x00, 0x03) AM_READWRITE_LEGACY(sgx_vdc_r, sgx_vdc_w )
203   AM_RANGE( 0x00, 0x03) AM_DEVREADWRITE( "huc6202", huc6202_device, io_read, io_write )
197204ADDRESS_MAP_END
198205
199206static const c6280_interface c6280_config =
r20183r20184
201208   "maincpu"
202209};
203210
211UINT32 ggconnie_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
212{
213   m_huc6260->video_update( bitmap, cliprect );
214   return 0;
215}
216
217
218WRITE_LINE_MEMBER(ggconnie_state::pce_irq_changed)
219{
220   machine().device("maincpu")->execute().set_input_line(0, state);
221}
222
223
224static const huc6270_interface pce_huc6270_config =
225{
226   0x10000,
227   DEVCB_DRIVER_LINE_MEMBER(ggconnie_state,pce_irq_changed)
228};
229
230
231static const huc6260_interface pce_huc6260_config =
232{
233   "screen",
234   DEVCB_DEVICE_MEMBER16( "huc6270", huc6270_device, next_pixel ),
235   DEVCB_DEVICE_MEMBER16( "huc6270", huc6270_device, time_until_next_event ),
236   DEVCB_DEVICE_LINE_MEMBER( "huc6270", huc6270_device, vsync_changed ),
237   DEVCB_DEVICE_LINE_MEMBER( "huc6270", huc6270_device, hsync_changed )
238};
239
240
241static const huc6270_interface sgx_huc6270_0_config =
242{
243   0x10000,
244   DEVCB_DRIVER_LINE_MEMBER(ggconnie_state,pce_irq_changed)
245};
246
247
248static const huc6270_interface sgx_huc6270_1_config =
249{
250   0x10000,
251   DEVCB_DRIVER_LINE_MEMBER(ggconnie_state,pce_irq_changed)
252};
253
254
255static const huc6202_interface sgx_huc6202_config =
256{
257   DEVCB_DEVICE_MEMBER16( "huc6270_0", huc6270_device, next_pixel ),
258   DEVCB_DEVICE_MEMBER16( "huc6270_0", huc6270_device, time_until_next_event ),
259   DEVCB_DEVICE_LINE_MEMBER( "huc6270_0", huc6270_device, vsync_changed ),
260   DEVCB_DEVICE_LINE_MEMBER( "huc6270_0", huc6270_device, hsync_changed ),
261   DEVCB_DEVICE_MEMBER( "huc6270_0", huc6270_device, read ),
262   DEVCB_DEVICE_MEMBER( "huc6270_0", huc6270_device, write ),
263   DEVCB_DEVICE_MEMBER16( "huc6270_1", huc6270_device, next_pixel ),
264   DEVCB_DEVICE_MEMBER16( "huc6270_1", huc6270_device, time_until_next_event ),
265   DEVCB_DEVICE_LINE_MEMBER( "huc6270_1", huc6270_device, vsync_changed ),
266   DEVCB_DEVICE_LINE_MEMBER( "huc6270_1", huc6270_device, hsync_changed ),
267   DEVCB_DEVICE_MEMBER( "huc6270_1", huc6270_device, read ),
268   DEVCB_DEVICE_MEMBER( "huc6270_1", huc6270_device, write ),
269};
270
271
272static const huc6260_interface sgx_huc6260_config =
273{
274   "screen",
275   DEVCB_DEVICE_MEMBER16( "huc6202", huc6202_device, next_pixel ),
276   DEVCB_DEVICE_MEMBER16( "huc6202", huc6202_device, time_until_next_event ),
277   DEVCB_DEVICE_LINE_MEMBER( "huc6202", huc6202_device, vsync_changed ),
278   DEVCB_DEVICE_LINE_MEMBER( "huc6202", huc6202_device, hsync_changed )
279};
280
281
204282static MACHINE_CONFIG_START( ggconnie, ggconnie_state )
205283   /* basic machine hardware */
206284   MCFG_CPU_ADD("maincpu", H6280, PCE_MAIN_CLOCK/3)
207285   MCFG_CPU_PROGRAM_MAP(sgx_mem)
208286   MCFG_CPU_IO_MAP(sgx_io)
209   MCFG_TIMER_ADD_SCANLINE("scantimer", sgx_interrupt, "screen", 0, 1)
210287
211288//  MCFG_QUANTUM_TIME(attotime::from_hz(60))
212289
213290    /* video hardware */
214
215291   MCFG_SCREEN_ADD("screen", RASTER)
216   MCFG_SCREEN_RAW_PARAMS(PCE_MAIN_CLOCK/2, VDC_WPF, 70, 70 + 512 + 32, VDC_LPF, 14, 14+242)
217   MCFG_SCREEN_UPDATE_STATIC( pce )
292   MCFG_SCREEN_RAW_PARAMS(PCE_MAIN_CLOCK/3, HUC6260_WPF, 64, 64 + 1024 + 64, HUC6260_LPF, 18, 18 + 242)
293   MCFG_SCREEN_UPDATE_DRIVER( ggconnie_state, screen_update )
218294
219   /* MCFG_GFXDECODE( pce_gfxdecodeinfo ) */
220   MCFG_PALETTE_LENGTH(1024)
221   MCFG_PALETTE_INIT( vce )
295   MCFG_PALETTE_LENGTH( HUC6260_PALETTE_SIZE )
296   MCFG_PALETTE_INIT( huc6260 )
222297
223   MCFG_VIDEO_START( pce )
298   MCFG_HUC6260_ADD( "huc6260", PCE_MAIN_CLOCK/3, sgx_huc6260_config )
299   MCFG_HUC6270_ADD( "huc6270_0", sgx_huc6270_0_config )
300   MCFG_HUC6270_ADD( "huc6270_1", sgx_huc6270_1_config )
301   MCFG_HUC6202_ADD( "huc6202", sgx_huc6202_config )
224302
225303   MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker")
226304   MCFG_SOUND_ADD("c6280", C6280, PCE_MAIN_CLOCK/6)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team