--- nono/m680x0/m68040bus.cpp 2026/04/29 17:05:30 1.1 +++ nono/m680x0/m68040bus.cpp 2026/04/29 17:05:57 1.1.1.2 @@ -33,7 +33,6 @@ MPU68040Device::read_data(busaddr addr) busdata data = read_nocache(addr); if (__predict_false(data.IsBusErr())) { bus.laddr = addr; - bus.size = addr.GetSize(); throw M68K::EXCEP_BUSERR; } return data.Data(); @@ -55,14 +54,15 @@ MPU68040Device::read_nocache(busaddr add uint32 data = 0; for (;;) { bus.laddr = addr; - bus.paddr = addr; - if (__predict_false(TranslateRead() == false)) { + busaddr paddr = TranslateRead(addr); + if (__predict_false(paddr.IsBusErr())) { bus.atcfault = true; // ATC フォールトが2ページ目で起きたか。 bus.atcfault2 = span_page; return BusData::BusErr; } - busdata bd = read_phys(); + bus.ci = paddr.IsCInhibit(); + busdata bd = read_phys(paddr); if (__predict_false(bd.IsBusErr())) { return bd; } @@ -113,14 +113,15 @@ MPU68040Device::write_data(busaddr addr, bool span_page = false; for (;;) { bus.laddr = addr; - bus.paddr = addr; - if (__predict_false(TranslateWrite() == false)) { + busaddr paddr = TranslateWrite(addr); + if (__predict_false(paddr.IsBusErr())) { bus.atcfault = true; // ATC フォールトが2ページ目で起きたか。 bus.atcfault2 = span_page; break; } - busdata bd = write_phys(data); + bus.ci = paddr.IsCInhibit(); + busdata bd = write_phys(paddr, data); if (__predict_false(bd.IsBusErr())) { break; } @@ -144,8 +145,7 @@ MPU68040Device::write_data(busaddr addr, } // 報告するのは先頭のアドレス。 - bus.laddr.ChangeAddr(origaddr.Addr()); - bus.size = origaddr.GetSize(); + bus.laddr = origaddr; bus.data = origdata; throw M68K::EXCEP_BUSERR; }