Skip to content

Commit c33f9c5

Browse files
committed
Fix zero-page address mask
1 parent 1df3667 commit c33f9c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/m6502_inline.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,17 +313,17 @@ INLINE u16 M6502::ZeroPageIndirectAddressing()
313313

314314
INLINE u16 M6502::ZeroPageIndexedIndirectAddressing()
315315
{
316-
u16 address = (ZeroPageAddressing() + m_s.X.GetValue()) & 0x20FF;
316+
u16 address = (ZeroPageAddressing() + m_s.X.GetValue()) & 0x00FF;
317317
u8 l = MemRead8(address);
318-
u8 h = MemRead8((address + 1) & 0x20FF);
318+
u8 h = MemRead8((address + 1) & 0x00FF);
319319
return Address16(h, l);
320320
}
321321

322322
INLINE u16 M6502::ZeroPageIndirectIndexedAddressing()
323323
{
324324
u16 address = ZeroPageAddressing();
325325
u8 l = MemRead8(address);
326-
u8 h = MemRead8((address + 1) & 0x20FF);
326+
u8 h = MemRead8((address + 1) & 0x00FF);
327327
return Address16(h, l) + m_s.Y.GetValue();
328328
}
329329

0 commit comments

Comments
 (0)