I'm using the same function memory_read() to resolve addressing modes, but also to fetch the opcode at PC, and depending on the instruction length, fetching 1 or 2 more bytes starting at PC+1.
The question that arises is if this reads into memory count as regular memory reads, in the sense that, for example, suppose that for some reason the PC is pointing to one byte before a memory-mapped register, then fetching the opcode will be fine, but fetching its operand, if any, will have a side effect of reading the register.
Or it may even happen, I don't know if any game uses this technique, but suppose that the PC at some point has the address of a memory-mapped register, would the opcode fetch read the register?
The question that arises is if this reads into memory count as regular memory reads, in the sense that, for example, suppose that for some reason the PC is pointing to one byte before a memory-mapped register, then fetching the opcode will be fine, but fetching its operand, if any, will have a side effect of reading the register.
Or it may even happen, I don't know if any game uses this technique, but suppose that the PC at some point has the address of a memory-mapped register, would the opcode fetch read the register?