4 size_base = 0x8000, size_max = 0x8000
8 size_base = 0x8000, size_max = 0x8000,
11 ppu_ramfind = false, vram_mirrorfind = true
13 function cpu_dump(d, pagesize, banksize)
15 cpu_read(d, 0x8000, 0x4000);
16 cpu_read(d, 0xc000, 0x4000);
18 function ppu_dump(d, pagesize, banksize)
20 local security = 0; //0,1,2,3 or don't care
21 security = security << 4;
22 for(local i = 0; i < pagesize; i++){
23 cpu_write(d, 0x8000, security | i);
24 ppu_read(d, 0, banksize);
28 function program_initalize(d, cpu_banksize, ppu_banksize)
30 cpu_write(d, 0x8000, 0x30);
31 cpu_command(d, 0, 0x8000, cpu_banksize);
32 cpu_command(d, 0x02aa, 0xc000, cpu_banksize);
33 cpu_command(d, 0x0555, 0xc000, cpu_banksize);
34 ppu_command(d, 0, 0x0000, ppu_banksize);
35 ppu_command(d, 0x02aa, 0x0000, ppu_banksize);
36 ppu_command(d, 0x0555, 0x0000, ppu_banksize);
39 function cpu_transfer(d, start, end, cpu_banksize)
41 if(cpu_banksize == 0x8000){
42 cpu_program(d, 0x8000, 0x4000);
44 cpu_program(d, 0xc000, 0x4000);
47 function ppu_transfer(d, start, end, ppu_banksize)
49 for(local i = start; i < end; i++){
50 cpu_write(d, 0x8000, 0xf0 | i);
51 ppu_program(d, 0x0000, ppu_banksize);