function cpu_dump(d, prg_size, prg_size_dummy)
{	
	for(local i = 0; i < (prg_size/0x8000) ; i += 1){
		cpu_write(d, 0x8000, i<<1);
		cpu_read(d, 0x8000, 0x8000);
	}
}
function ppu_dump(d, chr_size, chr_size_dummy)
{
	for(local i = 0; i < chr_size/0x2000; i+=1){
		cpu_write(d, 0x8000,i);
		ppu_read(d,0x0000, 0x2000);
	}
}