OSDN Git Service

[VM] Apply ALL VMs to upstream 2022-12-04 .
[csp-qt/common_source_project-fm7.git] / source / src / vm / rx78 / rx78.cpp
index 081f70d..5ce8d73 100644 (file)
@@ -45,24 +45,25 @@ VM::VM(EMU_TEMPLATE* parent_emu) : VM_TEMPLATE(parent_emu)
        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);
@@ -70,12 +71,12 @@ VM::VM(EMU_TEMPLATE* parent_emu) : VM_TEMPLATE(parent_emu)
        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);
@@ -83,7 +84,7 @@ VM::VM(EMU_TEMPLATE* parent_emu) : VM_TEMPLATE(parent_emu)
 #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);
@@ -92,7 +93,7 @@ VM::VM(EMU_TEMPLATE* parent_emu) : VM_TEMPLATE(parent_emu)
        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);
@@ -169,7 +170,7 @@ void VM::initialize_sound(int rate, int samples)
 {
        // init sound manager
        event->initialize_sound(rate, samples);
-       
+
        // init sound gen
        psg->initialize_sound(rate, 3579545, 8000);
 }
@@ -231,7 +232,7 @@ bool VM::is_cart_inserted(int drv)
 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);
@@ -241,7 +242,7 @@ void VM::play_tape(int drv, const _TCHAR* file_path)
 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);