bugfix & code improve for ppu reset and palette rw & mirroring.