Previous 199869 Revisions Next

r22642 Thursday 2nd May, 2013 at 14:21:53 UTC by Robbbert
(MESS) d6800: Better implementation of the speaker, keyclick works now. Changed quickload extension of chip8 files to c8, same as Cosmac VIP.
[src/mess/drivers]d6800.c

trunk/src/mess/drivers/d6800.c
r22641r22642
4343#include "imagedev/cassette.h"
4444#include "imagedev/snapquik.h"
4545#include "sound/wave.h"
46#include "sound/dac.h"
4746#include "machine/6821pia.h"
4847
4948
r22641r22642
5554      m_maincpu(*this, "maincpu"),
5655      m_cass(*this, "cassette"),
5756      m_pia(*this, "pia"),
58      m_dac(*this, "dac"),
57      m_beeper(*this, "beeper"),
5958      m_videoram(*this, "videoram"),
6059      m_io_x0(*this, "X0"),
6160      m_io_x1(*this, "X1"),
r22641r22642
8281   required_device<cpu_device> m_maincpu;
8382   required_device<cassette_image_device> m_cass;
8483   required_device<pia6821_device> m_pia;
85   required_device<dac_device> m_dac;
84   required_device<beep_device> m_beeper;
8685   required_shared_ptr<UINT8> m_videoram;
8786   required_ioport m_io_x0;
8887   required_ioport m_io_x1;
r22641r22642
249248WRITE8_MEMBER( d6800_state::d6800_cassette_w )
250249{
251250   /*
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.
255254   */
256255
257256   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));
258259
259   m_dac->write_unsigned8(data);
260260   m_portb = data;
261261}
262262
r22641r22642
321321
322322void d6800_state::machine_reset()
323323{
324   m_beeper->set_state(0);
324325}
325326
326327/* Machine Drivers */
r22641r22642
401402   MCFG_SPEAKER_STANDARD_MONO("mono")
402403   MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette")
403404   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
404   MCFG_SOUND_ADD("dac", DAC, 0)
405   MCFG_SOUND_ADD("beeper", BEEP, 0)
405406   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
406407
407408   /* devices */
r22641r22642
410411   MCFG_TIMER_DRIVER_ADD_PERIODIC("d6800_p", d6800_state, d6800_p, attotime::from_hz(40000))
411412
412413   /* quickload */
413   MCFG_QUICKLOAD_ADD("quickload", d6800_state, d6800, "ch8", 1)
414   MCFG_QUICKLOAD_ADD("quickload", d6800_state, d6800, "c8", 1)
414415MACHINE_CONFIG_END
415416
416417/* ROMs */
r22641r22642
418419ROM_START( d6800 )
419420   ROM_REGION( 0x10000, "maincpu", 0 )
420421   ROM_LOAD( "d6800.bin", 0xc000, 0x0400, CRC(3f97ca2e) SHA1(60f26e57a058262b30befceceab4363a5d65d877) )
422   //ROM_FILL(0xc2eb,2,1)
421423ROM_END
422424
423425/*    YEAR  NAME   PARENT  COMPAT  MACHINE   INPUT       INIT        COMPANY             FULLNAME      FLAGS */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team