Skip to content

Commit b730433

Browse files
AkiteruSDAScrewtapello
authored andcommitted
CX4 cache and bus access timing fixes
- Step 1+WS on both reads for cache, not just one - Remove extra cycle on bus reads/writes
1 parent bd4a425 commit b730433

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

bsnes/processor/hg51b/hg51b.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ auto HG51B::cache() -> bool {
8989
for(uint offset : range(256)) {
9090
step(wait(address));
9191
programRAM[io.cache.page][offset] = read(address++) << 0;
92+
step(wait(address));
9293
programRAM[io.cache.page][offset] |= read(address++) << 8;
9394
}
9495
return io.cache.enable = 0, true;

bsnes/processor/hg51b/registers.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ auto HG51B::readRegister(uint7 address) -> uint24 {
1212
case 0x2e:
1313
io.bus.enable = 1;
1414
io.bus.reading = 1;
15-
io.bus.pending = 1 + io.wait.rom;
15+
io.bus.pending = io.wait.rom;
1616
io.bus.address = r.mar;
1717
return 0x000000;
1818
case 0x2f:
1919
io.bus.enable = 1;
2020
io.bus.reading = 1;
21-
io.bus.pending = 1 + io.wait.ram;
21+
io.bus.pending = io.wait.ram;
2222
io.bus.address = r.mar;
2323
return 0x000000;
2424

@@ -76,13 +76,13 @@ auto HG51B::writeRegister(uint7 address, uint24 data) -> void {
7676
case 0x2e:
7777
io.bus.enable = 1;
7878
io.bus.writing = 1;
79-
io.bus.pending = 1 + io.wait.rom;
79+
io.bus.pending = io.wait.rom;
8080
io.bus.address = r.mar;
8181
return;
8282
case 0x2f:
8383
io.bus.enable = 1;
8484
io.bus.writing = 1;
85-
io.bus.pending = 1 + io.wait.ram;
85+
io.bus.pending = io.wait.ram;
8686
io.bus.address = r.mar;
8787
return;
8888

0 commit comments

Comments
 (0)