mirror of
https://github.com/holub/mame
synced 2025-07-06 02:18:09 +03:00
(nw) cd2560: hooked up cassette circuit, it's almost the same as d6800.
This commit is contained in:
parent
5b6d84a949
commit
339de811ec
@ -28,19 +28,19 @@ scratch ram. All other ram is optional.
|
|||||||
|
|
||||||
Commands (must be in uppercase):
|
Commands (must be in uppercase):
|
||||||
A Examine memory; press C to alter memory
|
A Examine memory; press C to alter memory
|
||||||
B Set breakpoint?
|
B Set breakpoint
|
||||||
C View breakpoint?
|
C Clear unused breakpoint
|
||||||
D Dump to tape
|
D Dump to cassette (must save each block separately, then an empty block)
|
||||||
E Execute
|
E Execute
|
||||||
I ?
|
I Inspect Registers after breakpoint
|
||||||
L Load
|
L Load from cassette
|
||||||
R ?
|
R Turn on cassette motor
|
||||||
V Verify?
|
V Verify cassette vs memory
|
||||||
Press Esc to exit most commands.
|
Press Esc to exit most commands.
|
||||||
|
|
||||||
TODO
|
TODO
|
||||||
- Lots, probably. The computer is a complete mystery. No manuals are known to exist.
|
- Cassette doesn't work. Saving is ok because the data can be loaded onto
|
||||||
- Cassette doesn't work.
|
the Super-80, but this system has great difficulty loading its own programs.
|
||||||
|
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -55,6 +55,7 @@ TODO
|
|||||||
#include "imagedev/snapquik.h"
|
#include "imagedev/snapquik.h"
|
||||||
#include "machine/74259.h"
|
#include "machine/74259.h"
|
||||||
#include "machine/keyboard.h"
|
#include "machine/keyboard.h"
|
||||||
|
#include "machine/timer.h"
|
||||||
#include "sound/beep.h"
|
#include "sound/beep.h"
|
||||||
#include "sound/wave.h"
|
#include "sound/wave.h"
|
||||||
#include "emupal.h"
|
#include "emupal.h"
|
||||||
@ -70,23 +71,27 @@ public:
|
|||||||
, m_p_videoram(*this, "videoram")
|
, m_p_videoram(*this, "videoram")
|
||||||
, m_p_chargen(*this, "chargen")
|
, m_p_chargen(*this, "chargen")
|
||||||
, m_cass(*this, "cassette")
|
, m_cass(*this, "cassette")
|
||||||
{
|
{ }
|
||||||
}
|
|
||||||
|
|
||||||
|
void cd2650(machine_config &config);
|
||||||
|
|
||||||
|
private:
|
||||||
|
void cd2650_data(address_map &map);
|
||||||
|
void cd2650_io(address_map &map);
|
||||||
|
void cd2650_mem(address_map &map);
|
||||||
DECLARE_READ8_MEMBER(keyin_r);
|
DECLARE_READ8_MEMBER(keyin_r);
|
||||||
void kbd_put(u8 data);
|
void kbd_put(u8 data);
|
||||||
DECLARE_WRITE_LINE_MEMBER(tape_deck_on_w);
|
DECLARE_WRITE_LINE_MEMBER(tape_deck_on_w);
|
||||||
DECLARE_READ_LINE_MEMBER(cass_r);
|
DECLARE_READ_LINE_MEMBER(cass_r);
|
||||||
DECLARE_WRITE_LINE_MEMBER(cass_w);
|
DECLARE_WRITE_LINE_MEMBER(cass_w);
|
||||||
|
TIMER_DEVICE_CALLBACK_MEMBER(kansas_w);
|
||||||
|
TIMER_DEVICE_CALLBACK_MEMBER(kansas_r);
|
||||||
DECLARE_QUICKLOAD_LOAD_MEMBER(cd2650);
|
DECLARE_QUICKLOAD_LOAD_MEMBER(cd2650);
|
||||||
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
|
||||||
|
|
||||||
void cd2650(machine_config &config);
|
|
||||||
void cd2650_data(address_map &map);
|
|
||||||
void cd2650_io(address_map &map);
|
|
||||||
void cd2650_mem(address_map &map);
|
|
||||||
private:
|
|
||||||
uint8_t m_term_data;
|
uint8_t m_term_data;
|
||||||
|
bool m_flag;
|
||||||
|
bool m_cassold;
|
||||||
|
uint8_t m_cass_data[4];
|
||||||
virtual void machine_reset() override;
|
virtual void machine_reset() override;
|
||||||
required_device<s2650_device> m_maincpu;
|
required_device<s2650_device> m_maincpu;
|
||||||
required_shared_ptr<uint8_t> m_p_videoram;
|
required_shared_ptr<uint8_t> m_p_videoram;
|
||||||
@ -95,20 +100,49 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
TIMER_DEVICE_CALLBACK_MEMBER(cd2650_state::kansas_w)
|
||||||
|
{
|
||||||
|
m_cass_data[3]++;
|
||||||
|
|
||||||
|
if (m_flag != m_cassold)
|
||||||
|
{
|
||||||
|
m_cass_data[3] = 0;
|
||||||
|
m_cassold = m_flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_flag)
|
||||||
|
m_cass->output(BIT(m_cass_data[3], 0) ? -1.0 : +1.0); // 2400Hz
|
||||||
|
else
|
||||||
|
m_cass->output(BIT(m_cass_data[3], 1) ? -1.0 : +1.0); // 1200Hz
|
||||||
|
}
|
||||||
|
|
||||||
|
TIMER_DEVICE_CALLBACK_MEMBER(cd2650_state::kansas_r)
|
||||||
|
{
|
||||||
|
/* cassette - turn 1200/2400Hz to a bit */
|
||||||
|
m_cass_data[1]++;
|
||||||
|
uint8_t cass_ws = (m_cass->input() > +0.03) ? 1 : 0;
|
||||||
|
|
||||||
|
if (cass_ws != m_cass_data[0])
|
||||||
|
{
|
||||||
|
m_cass_data[0] = cass_ws;
|
||||||
|
m_cass_data[2] = ((m_cass_data[1] < 12) ? 1 : 0);
|
||||||
|
m_cass_data[1] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
WRITE_LINE_MEMBER(cd2650_state::tape_deck_on_w)
|
WRITE_LINE_MEMBER(cd2650_state::tape_deck_on_w)
|
||||||
{
|
{
|
||||||
// output polarity not verified
|
m_cass->change_state(state ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
|
||||||
logerror("Cassette tape deck turned %s\n", state ? "on" : "off");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE_LINE_MEMBER(cd2650_state::cass_w)
|
WRITE_LINE_MEMBER(cd2650_state::cass_w)
|
||||||
{
|
{
|
||||||
m_cass->output(state ? -1.0 : +1.0);
|
m_flag = state;
|
||||||
}
|
}
|
||||||
|
|
||||||
READ_LINE_MEMBER(cd2650_state::cass_r)
|
READ_LINE_MEMBER(cd2650_state::cass_r)
|
||||||
{
|
{
|
||||||
return (m_cass->input() > 0.03) ? 1 : 0;
|
return m_cass_data[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
READ8_MEMBER(cd2650_state::keyin_r)
|
READ8_MEMBER(cd2650_state::keyin_r)
|
||||||
@ -319,13 +353,16 @@ void cd2650_state::cd2650(machine_config &config)
|
|||||||
|
|
||||||
/* Sound */
|
/* Sound */
|
||||||
SPEAKER(config, "mono").front_center();
|
SPEAKER(config, "mono").front_center();
|
||||||
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.25);
|
WAVE(config, "wave", m_cass).add_route(ALL_OUTPUTS, "mono", 0.15);
|
||||||
BEEP(config, "beeper", 950).add_route(ALL_OUTPUTS, "mono", 0.50); // guess
|
BEEP(config, "beeper", 950).add_route(ALL_OUTPUTS, "mono", 0.50); // guess
|
||||||
|
|
||||||
/* Devices */
|
/* Devices */
|
||||||
generic_keyboard_device &keyboard(GENERIC_KEYBOARD(config, "keyboard", 0));
|
generic_keyboard_device &keyboard(GENERIC_KEYBOARD(config, "keyboard", 0));
|
||||||
keyboard.set_keyboard_callback(FUNC(cd2650_state::kbd_put));
|
keyboard.set_keyboard_callback(FUNC(cd2650_state::kbd_put));
|
||||||
CASSETTE(config, m_cass);
|
CASSETTE(config, m_cass);
|
||||||
|
m_cass->set_default_state(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED);
|
||||||
|
TIMER(config, "kansas_w").configure_periodic(FUNC(cd2650_state::kansas_w), attotime::from_hz(4800));
|
||||||
|
TIMER(config, "kansas_r").configure_periodic(FUNC(cd2650_state::kansas_r), attotime::from_hz(40000));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ROM definition */
|
/* ROM definition */
|
||||||
|
Loading…
Reference in New Issue
Block a user