2 IREM G-101 based cartridge
4 $8000-$9fff bank#0, switchable or last - 1
5 $a000-$bfff bank#1, switchable
6 $c000-$dfff bank#2, last - 1 or switchable
9 Major League PCB maybe ignore write operation to $9000-$9fff
10 $9000-$9fff write register are fixed to bank #2 = last -1
16 size_base = 1 * mega, size_max = 2 * mega,
20 size_base = 1 * mega, size_max = 1 * mega,
24 vram_mirrorfind = false
27 function cpu_dump(d, pagesize, banksize)
30 cpu_write(d, 0x9000, 0);
31 for(local i = 0; i < pagesize - 2; i += 2){
32 cpu_write(d, 0x8000, i);
33 cpu_write(d, 0xa000, i | 1);
34 cpu_read(d, 0x8000, banksize * 2);
36 cpu_read(d, 0xc000, banksize);
37 cpu_read(d, 0xe000, banksize);
39 cpu_write(d, 0x9000, 2);
40 for(local i = 0; i < pagesize - 2; i += 2){
41 cpu_write(d, 0x8000, i);
42 cpu_write(d, 0xa000, i | 1);
43 cpu_read(d, 0xc000, banksize);
44 cpu_read(d, 0xa000, banksize);
46 cpu_read(d, 0x8000, banksize);
47 cpu_read(d, 0xe000, banksize);
50 function ppu_dump(d, pagesize, banksize)
52 for(local i = 0; i < pagesize ; i += 8){
53 for(local j = 0; j < 8; j += 1){
54 cpu_write(d, 0xb000 + j, i + j);
56 ppu_read(d, 0, banksize * 8);
60 function program_initalize(d, cpu_banksize, ppu_banksize)
62 cpu_write(d, 0x9000, 0);
63 cpu_write(d, 0x8000, 0);
64 cpu_command(d, 0, 0x8000, cpu_banksize);
65 cpu_command(d, 0x02aa, 0xc000, cpu_banksize);
66 cpu_command(d, 0x0555, 0xc000, cpu_banksize);
67 cpu_write(d, 0xb000, [0xa, 0x15, 0]);
68 cpu_command(d, 0x2aaa, 0x0000, ppu_banksize);
69 cpu_command(d, 0x5555, 0x0400, ppu_banksize);
70 cpu_command(d, 0, 0x0800, ppu_banksize);
73 function cpu_transfer(d, start, end, cpu_banksize)
75 for(local i = start; i < end - 1; i += 1){
76 cpu_write(d, 0x8000, i);
77 cpu_program(d, 0x8000, cpu_banksize);
79 cpu_program(d, 0xc000, cpu_banksize);
82 function ppu_transfer(d, start, end, ppu_banksize)
84 for(local i = start; i < end; i +=4){
85 cpu_write(d, 0xb004, [i, i+1, i+2, i+3]);
86 ppu_program(d, 0x1000, ppu_banksize * 4);