trunk/src/mame/drivers/ggconnie.c
| r20183 | r20184 | |
| 18 | 18 | |
| 19 | 19 | #include "emu.h" |
| 20 | 20 | #include "machine/pcecommn.h" |
| 21 | | #include "video/vdc.h" |
| 21 | #include "video/huc6270.h" |
| 22 | #include "video/huc6260.h" |
| 23 | #include "video/huc6202.h" |
| 22 | 24 | #include "cpu/h6280/h6280.h" |
| 23 | 25 | #include "sound/c6280.h" |
| 24 | 26 | #include "sound/okim6295.h" |
| r20183 | r20184 | |
| 29 | 31 | public: |
| 30 | 32 | ggconnie_state(const machine_config &mconfig, device_type type, const char *tag) |
| 31 | 33 | : pce_common_state(mconfig, type, tag), |
| 34 | m_huc6260(*this, "huc6260"), |
| 32 | 35 | m_oki(*this, "oki") |
| 33 | 36 | { } |
| 34 | 37 | |
| 38 | required_device <huc6260_device> m_huc6260; |
| 35 | 39 | required_device <okim6295_device> m_oki; |
| 36 | 40 | DECLARE_WRITE8_MEMBER(lamp_w); |
| 37 | 41 | DECLARE_WRITE8_MEMBER(output_w); |
| 38 | 42 | DECLARE_READ8_MEMBER(rtc_r); |
| 39 | 43 | DECLARE_WRITE8_MEMBER(rtc_w); |
| 40 | 44 | 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); |
| 41 | 48 | }; |
| 42 | 49 | |
| 43 | 50 | |
| r20183 | r20184 | |
| 179 | 186 | AM_RANGE( 0x1f7200, 0x1f7200) AM_READ_PORT("SWC") |
| 180 | 187 | AM_RANGE( 0x1f7700, 0x1f7700) AM_READ_PORT("IN1") |
| 181 | 188 | 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 ) |
| 186 | 193 | AM_RANGE( 0x1fe800, 0x1febff) AM_DEVREADWRITE("c6280", c6280_device, c6280_r, c6280_w) |
| 187 | 194 | AM_RANGE( 0x1fec00, 0x1fefff) AM_DEVREADWRITE("maincpu", h6280_device, timer_r, timer_w) |
| 188 | 195 | AM_RANGE( 0x1f7300, 0x1f7300) AM_DEVREADWRITE("oki", okim6295_device, read, write) |
| r20183 | r20184 | |
| 193 | 200 | ADDRESS_MAP_END |
| 194 | 201 | |
| 195 | 202 | static 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 ) |
| 197 | 204 | ADDRESS_MAP_END |
| 198 | 205 | |
| 199 | 206 | static const c6280_interface c6280_config = |
| r20183 | r20184 | |
| 201 | 208 | "maincpu" |
| 202 | 209 | }; |
| 203 | 210 | |
| 211 | UINT32 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 | |
| 218 | WRITE_LINE_MEMBER(ggconnie_state::pce_irq_changed) |
| 219 | { |
| 220 | machine().device("maincpu")->execute().set_input_line(0, state); |
| 221 | } |
| 222 | |
| 223 | |
| 224 | static const huc6270_interface pce_huc6270_config = |
| 225 | { |
| 226 | 0x10000, |
| 227 | DEVCB_DRIVER_LINE_MEMBER(ggconnie_state,pce_irq_changed) |
| 228 | }; |
| 229 | |
| 230 | |
| 231 | static 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 | |
| 241 | static const huc6270_interface sgx_huc6270_0_config = |
| 242 | { |
| 243 | 0x10000, |
| 244 | DEVCB_DRIVER_LINE_MEMBER(ggconnie_state,pce_irq_changed) |
| 245 | }; |
| 246 | |
| 247 | |
| 248 | static const huc6270_interface sgx_huc6270_1_config = |
| 249 | { |
| 250 | 0x10000, |
| 251 | DEVCB_DRIVER_LINE_MEMBER(ggconnie_state,pce_irq_changed) |
| 252 | }; |
| 253 | |
| 254 | |
| 255 | static 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 | |
| 272 | static 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 | |
| 204 | 282 | static MACHINE_CONFIG_START( ggconnie, ggconnie_state ) |
| 205 | 283 | /* basic machine hardware */ |
| 206 | 284 | MCFG_CPU_ADD("maincpu", H6280, PCE_MAIN_CLOCK/3) |
| 207 | 285 | MCFG_CPU_PROGRAM_MAP(sgx_mem) |
| 208 | 286 | MCFG_CPU_IO_MAP(sgx_io) |
| 209 | | MCFG_TIMER_ADD_SCANLINE("scantimer", sgx_interrupt, "screen", 0, 1) |
| 210 | 287 | |
| 211 | 288 | // MCFG_QUANTUM_TIME(attotime::from_hz(60)) |
| 212 | 289 | |
| 213 | 290 | /* video hardware */ |
| 214 | | |
| 215 | 291 | 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 ) |
| 218 | 294 | |
| 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 ) |
| 222 | 297 | |
| 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 ) |
| 224 | 302 | |
| 225 | 303 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker","rspeaker") |
| 226 | 304 | MCFG_SOUND_ADD("c6280", C6280, PCE_MAIN_CLOCK/6) |