trunk/src/mame/drivers/stuntair.c
| r22898 | r22899 | |
| 1 | 1 | /* |
| 2 | 2 | |
| 3 | |
| 4 | |
| 3 | 5 | Stunt Air - is this a bootleg of something? (it's not Star Jacker / Star Force) |
| 4 | 6 | |
| 5 | 7 | Stunt Air by Nuova Videotron 1983 |
| r22898 | r22899 | |
| 73 | 75 | |
| 74 | 76 | #include "emu.h" |
| 75 | 77 | #include "cpu/z80/z80.h" |
| 78 | #include "sound/ay8910.h" |
| 76 | 79 | |
| 77 | 80 | class stuntair_state : public driver_device |
| 78 | 81 | { |
| r22898 | r22899 | |
| 106 | 109 | UINT8 m_nmienable; |
| 107 | 110 | UINT8 m_spritebank0; |
| 108 | 111 | UINT8 m_spritebank1; |
| 112 | UINT8 m_soundlatch; |
| 109 | 113 | |
| 110 | 114 | DECLARE_WRITE8_MEMBER(stuntair_fgram_w); |
| 111 | 115 | TILE_GET_INFO_MEMBER(get_stuntair_fg_tile_info); |
| r22898 | r22899 | |
| 147 | 151 | // lower 2 bits are coin counters |
| 148 | 152 | if (data&~0x3) printf("stuntair_coin_w %02x\n", data); |
| 149 | 153 | } |
| 154 | |
| 155 | DECLARE_WRITE8_MEMBER(stuntair_sound_w) |
| 156 | { |
| 157 | m_soundlatch = data; |
| 158 | m_audiocpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 159 | |
| 160 | } |
| 150 | 161 | |
| 151 | 162 | |
| 152 | 163 | INTERRUPT_GEN_MEMBER(stuntair_irq); |
| 153 | 164 | |
| 165 | INTERRUPT_GEN_MEMBER(stuntair_sound_irq) |
| 166 | { |
| 167 | m_audiocpu->set_input_line(0, HOLD_LINE); |
| 168 | } |
| 154 | 169 | |
| 170 | DECLARE_READ8_MEMBER(ay8910_in0_r) |
| 171 | { |
| 172 | return m_soundlatch; |
| 173 | } |
| 174 | |
| 175 | DECLARE_READ8_MEMBER(ay8910_in1_r) |
| 176 | { |
| 177 | printf("ay8910_in1_r\n"); |
| 178 | return 0x00;//m_soundlatch; |
| 179 | |
| 180 | } |
| 181 | |
| 155 | 182 | virtual void machine_start(); |
| 156 | 183 | virtual void machine_reset(); |
| 157 | 184 | virtual void video_start(); |
| r22898 | r22899 | |
| 182 | 209 | AM_RANGE(0xf800, 0xfbff) AM_RAM_WRITE(stuntair_fgram_w) AM_SHARE("fgram") |
| 183 | 210 | |
| 184 | 211 | |
| 185 | | AM_RANGE(0xfc03, 0xfc03) AM_WRITENOP //? register or overrun? |
| 212 | AM_RANGE(0xfc03, 0xfc03) AM_WRITE(stuntair_sound_w) |
| 186 | 213 | |
| 187 | 214 | ADDRESS_MAP_END |
| 188 | 215 | |
| r22898 | r22899 | |
| 193 | 220 | |
| 194 | 221 | static ADDRESS_MAP_START( stuntair_sound_portmap, AS_IO, 8, stuntair_state ) |
| 195 | 222 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 196 | | AM_RANGE(0x03, 0x03) AM_WRITENOP |
| 197 | | AM_RANGE(0x07, 0x07) AM_WRITENOP |
| 198 | | AM_RANGE(0x0c, 0x0c) AM_WRITENOP |
| 199 | | AM_RANGE(0x0d, 0x0d) AM_WRITENOP |
| 223 | AM_RANGE(0x03, 0x03) AM_DEVWRITE("ay2", ay8910_device, address_w) |
| 224 | AM_RANGE(0x07, 0x07) AM_DEVWRITE("ay2", ay8910_device, data_w) |
| 225 | |
| 226 | AM_RANGE(0x0c, 0x0d) AM_DEVREADWRITE("ay1", ay8910_device, data_r, address_data_w) |
| 200 | 227 | ADDRESS_MAP_END |
| 201 | 228 | |
| 202 | 229 | |
| r22898 | r22899 | |
| 455 | 482 | m_maincpu->set_input_line(INPUT_LINE_NMI, PULSE_LINE); |
| 456 | 483 | } |
| 457 | 484 | |
| 485 | |
| 486 | |
| 487 | |
| 488 | |
| 489 | static const ay8910_interface ay8910_config = |
| 490 | { |
| 491 | AY8910_LEGACY_OUTPUT, |
| 492 | AY8910_DEFAULT_LOADS, |
| 493 | DEVCB_DRIVER_MEMBER(stuntair_state,ay8910_in0_r), |
| 494 | DEVCB_DRIVER_MEMBER(stuntair_state,ay8910_in1_r), |
| 495 | DEVCB_NULL, |
| 496 | DEVCB_NULL |
| 497 | }; |
| 498 | |
| 499 | |
| 500 | static const ay8910_interface ay8910_2_config = |
| 501 | { |
| 502 | AY8910_LEGACY_OUTPUT, |
| 503 | AY8910_DEFAULT_LOADS, |
| 504 | DEVCB_NULL, |
| 505 | DEVCB_NULL, |
| 506 | DEVCB_NULL, |
| 507 | DEVCB_NULL |
| 508 | }; |
| 509 | |
| 510 | |
| 458 | 511 | static MACHINE_CONFIG_START( stuntair, stuntair_state ) |
| 459 | 512 | |
| 460 | 513 | /* basic machine hardware */ |
| 461 | | MCFG_CPU_ADD("maincpu", Z80, 18432000/4) /* ? MHz */ |
| 514 | MCFG_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/4) /* ? MHz */ |
| 462 | 515 | MCFG_CPU_PROGRAM_MAP(stuntair_map) |
| 463 | 516 | MCFG_CPU_VBLANK_INT_DRIVER("screen", stuntair_state, stuntair_irq) |
| 464 | 517 | |
| 465 | | MCFG_CPU_ADD("audiocpu", Z80, 18432000/4) /* ? MHz */ |
| 518 | MCFG_CPU_ADD("audiocpu", Z80, XTAL_18_432MHz/4) /* ? MHz */ |
| 466 | 519 | MCFG_CPU_PROGRAM_MAP(stuntair_sound_map) |
| 467 | 520 | MCFG_CPU_IO_MAP(stuntair_sound_portmap) |
| 521 | MCFG_CPU_PERIODIC_INT_DRIVER(stuntair_state, stuntair_sound_irq, 60*8) // guessed, probably wrong ?? drives music tempo.. |
| 468 | 522 | |
| 469 | 523 | /* video hardware */ |
| 470 | 524 | MCFG_SCREEN_ADD("screen", RASTER) |
| r22898 | r22899 | |
| 476 | 530 | |
| 477 | 531 | MCFG_GFXDECODE(stuntair) |
| 478 | 532 | MCFG_PALETTE_LENGTH(0x100) |
| 533 | |
| 534 | |
| 535 | /* sound hardware */ |
| 536 | MCFG_SPEAKER_STANDARD_MONO("mono") // stereo? |
| 537 | |
| 538 | MCFG_SOUND_ADD("ay1", AY8910, XTAL_18_432MHz/12) |
| 539 | MCFG_SOUND_CONFIG(ay8910_config) |
| 540 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 541 | |
| 542 | MCFG_SOUND_ADD("ay2", AY8910, XTAL_18_432MHz/12) |
| 543 | MCFG_SOUND_CONFIG(ay8910_2_config) |
| 544 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 479 | 545 | MACHINE_CONFIG_END |
| 480 | 546 | |
| 481 | 547 | |