mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
Fix some edge cases
This commit is contained in:
parent
be35aa9315
commit
3004aa99f2
@ -775,7 +775,7 @@ export class HiresPage2D implements HiresPage {
|
|||||||
this._refreshing = true;
|
this._refreshing = true;
|
||||||
const bb: bank = bank ? 0 : 1;
|
const bb: bank = bank ? 0 : 1;
|
||||||
for (let rr = addr - 1; rr <= addr + 1; rr++) {
|
for (let rr = addr - 1; rr <= addr + 1; rr++) {
|
||||||
const vv = this._buffer[bb][rr - 0x2000 * this.page];
|
const vv = this._buffer[bb][rr & 0x1FFF];
|
||||||
this._write(rr >> 8, rr & 0xff, vv, bb);
|
this._write(rr >> 8, rr & 0xff, vv, bb);
|
||||||
}
|
}
|
||||||
this._refreshing = false;
|
this._refreshing = false;
|
||||||
|
@ -839,6 +839,7 @@ export default class CPU6502 {
|
|||||||
this.readByte(this.pc);
|
this.readByte(this.pc);
|
||||||
const oldPage = this.pc >> 8;
|
const oldPage = this.pc >> 8;
|
||||||
this.pc += off > 127 ? off - 256 : off;
|
this.pc += off > 127 ? off - 256 : off;
|
||||||
|
this.pc &= 0xffff;
|
||||||
const newPage = this.pc >> 8;
|
const newPage = this.pc >> 8;
|
||||||
const newOff = this.pc & 0xff;
|
const newOff = this.pc & 0xff;
|
||||||
if (newPage != oldPage) this.readByte(oldPage << 8 | newOff);
|
if (newPage != oldPage) this.readByte(oldPage << 8 | newOff);
|
||||||
@ -851,6 +852,7 @@ export default class CPU6502 {
|
|||||||
this.readByte(this.pc);
|
this.readByte(this.pc);
|
||||||
const oldPage = this.pc >> 8;
|
const oldPage = this.pc >> 8;
|
||||||
this.pc += off > 127 ? off - 256 : off;
|
this.pc += off > 127 ? off - 256 : off;
|
||||||
|
this.pc &= 0xffff;
|
||||||
const newPage = this.pc >> 8;
|
const newPage = this.pc >> 8;
|
||||||
const newOff = this.pc & 0xff;
|
const newOff = this.pc & 0xff;
|
||||||
if (newPage != oldPage) this.readByte(oldPage << 8 | newOff);
|
if (newPage != oldPage) this.readByte(oldPage << 8 | newOff);
|
||||||
@ -870,6 +872,7 @@ export default class CPU6502 {
|
|||||||
const oldPage = oldPc >> 8;
|
const oldPage = oldPc >> 8;
|
||||||
this.readByte(oldPc);
|
this.readByte(oldPc);
|
||||||
this.pc += off > 127 ? off - 256 : off;
|
this.pc += off > 127 ? off - 256 : off;
|
||||||
|
this.pc &= 0xffff;
|
||||||
const newPage = this.pc >> 8;
|
const newPage = this.pc >> 8;
|
||||||
if (oldPage != newPage) {
|
if (oldPage != newPage) {
|
||||||
this.readByte(oldPc);
|
this.readByte(oldPc);
|
||||||
@ -888,6 +891,7 @@ export default class CPU6502 {
|
|||||||
const oldPage = oldPc >> 8;
|
const oldPage = oldPc >> 8;
|
||||||
this.readByte(oldPc);
|
this.readByte(oldPc);
|
||||||
this.pc += off > 127 ? off - 256 : off;
|
this.pc += off > 127 ? off - 256 : off;
|
||||||
|
this.pc &= 0xffff;
|
||||||
const newPage = this.pc >> 8;
|
const newPage = this.pc >> 8;
|
||||||
if (oldPage != newPage) {
|
if (oldPage != newPage) {
|
||||||
this.readByte(oldPc);
|
this.readByte(oldPc);
|
||||||
|
10
js/gl.ts
10
js/gl.ts
@ -572,16 +572,6 @@ export class HiresPageGL implements Memory, Restorable<GraphicsState> {
|
|||||||
bits >>= 1;
|
bits >>= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this._refreshing) {
|
|
||||||
this._refreshing = true;
|
|
||||||
const bb: bank = bank ? 0 : 1;
|
|
||||||
for (let rr = addr - 1; rr <= addr + 1; rr++) {
|
|
||||||
const vv = this._buffer[bb][rr - 0x2000 * this.page];
|
|
||||||
this._write(rr >> 8, rr & 0xff, vv, bb);
|
|
||||||
}
|
|
||||||
this._refreshing = false;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
val = this._buffer[0][base];
|
val = this._buffer[0][base];
|
||||||
const hbs = val & 0x80;
|
const hbs = val & 0x80;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user