dummy = new DEVICE(this, emu); // must be 1st device
event = new EVENT(this, emu); // must be 2nd device
dummy->set_device_name(_T("1st Dummy"));
-
+
drec = new DATAREC(this, emu);
drec->set_context_noise_play(new NOISE(this, emu));
drec->set_context_noise_stop(new NOISE(this, emu));
drec->set_context_noise_fast(new NOISE(this, emu));
io = new IO(this, emu);
+ io->space = 0x100;
psg = new SN76489AN(this, emu);
cpu = new Z80(this, emu);
#ifdef USE_DEBUGGER
// psg->set_context_debugger(new DEBUGGER(this, emu));
#endif
-
+
cmt = new CMT(this, emu);
key = new KEYBOARD(this, emu);
memory = new MEMORY(this, emu);
prt = new PRINTER(this, emu);
vdp = new VDP(this, emu);
-
+
// set contexts
event->set_context_cpu(cpu);
event->set_context_sound(psg);
event->set_context_sound(drec->get_context_noise_play());
event->set_context_sound(drec->get_context_noise_stop());
event->set_context_sound(drec->get_context_noise_fast());
-
+
drec->set_context_ear(cmt, SIG_CMT_IN, 1);
cmt->set_context_drec(drec);
vdp->set_context_cpu(cpu);
vdp->set_vram_ptr(memory->get_vram());
-
+
// cpu bus
cpu->set_context_mem(memory);
cpu->set_context_io(io);
#ifdef USE_DEBUGGER
cpu->set_context_debugger(new DEBUGGER(this, emu));
#endif
-
+
// i/o bus
io->set_iomap_range_rw(0xe2, 0xe3, prt);
io->set_iomap_single_rw(0xf0, cmt);
io->set_iomap_range_w(0xf5, 0xfc, vdp);
io->set_iomap_single_w(0xfe, vdp);
io->set_iomap_single_w(0xff, psg);
-
+
// initialize all devices
#if defined(__GIT_REPO_VERSION)
set_git_repo_version(__GIT_REPO_VERSION);
{
// init sound manager
event->initialize_sound(rate, samples);
-
+
// init sound gen
psg->initialize_sound(rate, 3579545, 8000);
}
void VM::play_tape(int drv, const _TCHAR* file_path)
{
bool remote = drec->get_remote();
-
+
if(drec->play_tape(file_path) && remote) {
// if machine already sets remote on, start playing now
push_play(drv);
void VM::rec_tape(int drv, const _TCHAR* file_path)
{
bool remote = drec->get_remote();
-
+
if(drec->rec_tape(file_path) && remote) {
// if machine already sets remote on, start recording now
push_play(drv);