trunk/src/mess/drivers/d6800.c
| r22641 | r22642 | |
| 43 | 43 | #include "imagedev/cassette.h" |
| 44 | 44 | #include "imagedev/snapquik.h" |
| 45 | 45 | #include "sound/wave.h" |
| 46 | | #include "sound/dac.h" |
| 47 | 46 | #include "machine/6821pia.h" |
| 48 | 47 | |
| 49 | 48 | |
| r22641 | r22642 | |
| 55 | 54 | m_maincpu(*this, "maincpu"), |
| 56 | 55 | m_cass(*this, "cassette"), |
| 57 | 56 | m_pia(*this, "pia"), |
| 58 | | m_dac(*this, "dac"), |
| 57 | m_beeper(*this, "beeper"), |
| 59 | 58 | m_videoram(*this, "videoram"), |
| 60 | 59 | m_io_x0(*this, "X0"), |
| 61 | 60 | m_io_x1(*this, "X1"), |
| r22641 | r22642 | |
| 82 | 81 | required_device<cpu_device> m_maincpu; |
| 83 | 82 | required_device<cassette_image_device> m_cass; |
| 84 | 83 | required_device<pia6821_device> m_pia; |
| 85 | | required_device<dac_device> m_dac; |
| 84 | required_device<beep_device> m_beeper; |
| 86 | 85 | required_shared_ptr<UINT8> m_videoram; |
| 87 | 86 | required_ioport m_io_x0; |
| 88 | 87 | required_ioport m_io_x1; |
| r22641 | r22642 | |
| 249 | 248 | WRITE8_MEMBER( d6800_state::d6800_cassette_w ) |
| 250 | 249 | { |
| 251 | 250 | /* |
| 252 | | Cassette circuit consists of a 566 and a transistor. The 556 runs at 2400 |
| 253 | | or 1200 Hz depending on the state of the transistor. This is controlled by |
| 254 | | bit 0 of the PIA. Bit 6 drives the speaker. |
| 251 | A NE556 runs at either 1200 or 2400 Hz, depending on the state of bit 0. |
| 252 | This output drives the speaker and the output signal to the cassette player. |
| 253 | Bit 6 enables the speaker. |
| 255 | 254 | */ |
| 256 | 255 | |
| 257 | 256 | m_cass->output(BIT(data, 0) ? -1.0 : +1.0); |
| 257 | m_beeper->set_frequency(BIT(data, 0) ? 2400 : 1200); |
| 258 | m_beeper->set_state(BIT(data, 6)); |
| 258 | 259 | |
| 259 | | m_dac->write_unsigned8(data); |
| 260 | 260 | m_portb = data; |
| 261 | 261 | } |
| 262 | 262 | |
| r22641 | r22642 | |
| 321 | 321 | |
| 322 | 322 | void d6800_state::machine_reset() |
| 323 | 323 | { |
| 324 | m_beeper->set_state(0); |
| 324 | 325 | } |
| 325 | 326 | |
| 326 | 327 | /* Machine Drivers */ |
| r22641 | r22642 | |
| 401 | 402 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 402 | 403 | MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") |
| 403 | 404 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 404 | | MCFG_SOUND_ADD("dac", DAC, 0) |
| 405 | MCFG_SOUND_ADD("beeper", BEEP, 0) |
| 405 | 406 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 406 | 407 | |
| 407 | 408 | /* devices */ |
| r22641 | r22642 | |
| 410 | 411 | MCFG_TIMER_DRIVER_ADD_PERIODIC("d6800_p", d6800_state, d6800_p, attotime::from_hz(40000)) |
| 411 | 412 | |
| 412 | 413 | /* quickload */ |
| 413 | | MCFG_QUICKLOAD_ADD("quickload", d6800_state, d6800, "ch8", 1) |
| 414 | MCFG_QUICKLOAD_ADD("quickload", d6800_state, d6800, "c8", 1) |
| 414 | 415 | MACHINE_CONFIG_END |
| 415 | 416 | |
| 416 | 417 | /* ROMs */ |
| r22641 | r22642 | |
| 418 | 419 | ROM_START( d6800 ) |
| 419 | 420 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 420 | 421 | ROM_LOAD( "d6800.bin", 0xc000, 0x0400, CRC(3f97ca2e) SHA1(60f26e57a058262b30befceceab4363a5d65d877) ) |
| 422 | //ROM_FILL(0xc2eb,2,1) |
| 421 | 423 | ROM_END |
| 422 | 424 | |
| 423 | 425 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |