As some may know (I didn't), when doing JMP(6C) on an address
like 0xXXFF (X may be any, let Y = X+1), JMP composes the
final address by reading the lsb from 0xXXFF and the msb from
0xXX00 instead of 0xXY00, as would be logical. JMP doesn't use
carry and as such can't pass over to the next page, and when
incrementing the argumental address (0xXXFF) the msb stays put.
I did now know about any of this, and this is a pretty monumental
exception, I feel more documentation should be written about this,
I only randomly stumbled upon this on 6502.org
@ -39,7 +39,7 @@ void bus_write8(word address, word data){
address=mapper_resolve_write(address,data);//a lot of regions on the NES bus are mirrored/synced, this just ensures we are always writing to the parent region, not to a empty cloned one
#ifdef DEBUG
printf("\nwrite-ram 0x%04X at 0x%04X\n; old_val 0x%04X",data,address,bus_read8(address));
printf("\nwrite-ram at 0x%04X val = 0x%04X\n; old_val 0x%04X",address,data,bus_read8(address));
#endif
bus[address]=(unsignedchar)data;
@ -133,7 +133,7 @@ int main(int argc, char * argv[]){