Skip to content

Commit 6b11b28

Browse files
png183LukeUsher
authored andcommitted
fc: improve handling of OAM accesses during rendering
1 parent c79a73e commit 6b11b28

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

ares/fc/ppu/memory.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ auto PPU::writeIO(n16 address, n8 data) -> void {
124124
(Region::PAL() && io.ly >= 264 && io.ly <= vlines() - 2)) {
125125
if (enable()) {
126126
++sprite.oamMainCounterIndex;
127+
sprite.oamMainCounterTiming = 0;
127128
return;
128129
}
129130
}

ares/fc/ppu/sprite.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ auto PPU::cycleSpriteEvaluation() -> void {
7676
}
7777

7878
if (io.lx <= 320) {
79-
u32 index = ((io.lx - 257) >> 3) << 2 + min((io.lx - 257) & 7, 3);
79+
u32 index = (((io.lx - 257) >> 3) << 2) + min((io.lx - 257) & 7, 3);
8080

8181
sprite.oamMainCounter = 0;
8282
sprite.oamTempCounter = 0;

0 commit comments

Comments
 (0)