bus address update fix
This commit is contained in:
parent
67835c7a07
commit
04bd8ac6eb
1 changed files with 6 additions and 19 deletions
23
rk05.cpp
23
rk05.cpp
|
@ -87,14 +87,7 @@ void rk05::writeByte(const uint16_t addr, const uint8_t v)
|
||||||
{
|
{
|
||||||
uint16_t vtemp = registers[(addr - RK05_BASE) / 2];
|
uint16_t vtemp = registers[(addr - RK05_BASE) / 2];
|
||||||
|
|
||||||
if (addr & 1) {
|
update_word(&vtemp, addr & 1, v);
|
||||||
vtemp &= ~0xff00;
|
|
||||||
vtemp |= v << 8;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
vtemp &= ~0x00ff;
|
|
||||||
vtemp |= v;
|
|
||||||
}
|
|
||||||
|
|
||||||
writeWord(addr, vtemp);
|
writeWord(addr, vtemp);
|
||||||
}
|
}
|
||||||
|
@ -135,7 +128,6 @@ void rk05::writeWord(const uint16_t addr, uint16_t v)
|
||||||
|
|
||||||
uint8_t *xfer_buffer = new uint8_t[reclen];
|
uint8_t *xfer_buffer = new uint8_t[reclen];
|
||||||
|
|
||||||
uint32_t p = reclen;
|
|
||||||
for(size_t i=0; i<reclen; i++)
|
for(size_t i=0; i<reclen; i++)
|
||||||
xfer_buffer[i] = b->readUnibusByte(memoff + i);
|
xfer_buffer[i] = b->readUnibusByte(memoff + i);
|
||||||
|
|
||||||
|
@ -145,7 +137,7 @@ void rk05::writeWord(const uint16_t addr, uint16_t v)
|
||||||
if (v & 2048)
|
if (v & 2048)
|
||||||
DOLOG(debug, false, "RK05 inhibit BA increase");
|
DOLOG(debug, false, "RK05 inhibit BA increase");
|
||||||
else
|
else
|
||||||
registers[(RK05_BA - RK05_BASE) / 2] += p;
|
registers[(RK05_BA - RK05_BASE) / 2] += reclen;
|
||||||
|
|
||||||
if (++sector >= 12) {
|
if (++sector >= 12) {
|
||||||
sector = 0;
|
sector = 0;
|
||||||
|
@ -183,20 +175,15 @@ void rk05::writeWord(const uint16_t addr, uint16_t v)
|
||||||
temp_diskoffb += cur;
|
temp_diskoffb += cur;
|
||||||
|
|
||||||
for(uint32_t i=0; i<cur; i++) {
|
for(uint32_t i=0; i<cur; i++) {
|
||||||
if (p >= 0160000)
|
|
||||||
break;
|
|
||||||
|
|
||||||
b->writeUnibusByte(p++, xfer_buffer[i]);
|
b->writeUnibusByte(p++, xfer_buffer[i]);
|
||||||
|
|
||||||
|
if ((v & 2048) == 0)
|
||||||
|
registers[(RK05_BA - RK05_BASE) / 2] += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
temp -= cur;
|
temp -= cur;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (v & 2048)
|
|
||||||
DOLOG(debug, false, "RK05 inhibit BA increase");
|
|
||||||
else
|
|
||||||
registers[(RK05_BA - RK05_BASE) / 2] += p;
|
|
||||||
|
|
||||||
if (++sector >= 12) {
|
if (++sector >= 12) {
|
||||||
sector = 0;
|
sector = 0;
|
||||||
if (++surface >= 2) {
|
if (++surface >= 2) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue