board <- { mappernum = 64, vram_mirrorfind = false, ppu_ramfind = true, cpu_rom = { size_base = 1 * mega, size_max = 2 * mega, banksize = 0x2000, }, ppu_rom = { size_base = 1 * mega, size_max = 2 * mega, banksize = 0x0400 } }; function cpu_dump(d, pagesize, banksize) { for(local i = 0; i < pagesize -1; i+=1){ cpu_write(d, 0x8000, 6); cpu_write(d, 0x8001, i); cpu_read(d, 0x8000, banksize); } cpu_read(d, 0xe000, banksize); } function ppu_dump(d, pagesize, banksize) { for(local i = 0; i < pagesize; i+=4){ cpu_write(d, 0x8000, 2); cpu_write(d, 0x8001, i); cpu_write(d, 0x8000, 3); cpu_write(d, 0x8001, i | 1); cpu_write(d, 0x8000, 4); cpu_write(d, 0x8001, i | 2); cpu_write(d, 0x8000, 5); cpu_write(d, 0x8001, i | 3); ppu_read(d, 0x1000, banksize * 4); } } /* Mapper 64: Tengen 80032 RAMBO-1 */ /* CPU memory bank cpu address|rom address |page|task $8000-$9fff|0x02000-0x03fff|1 |write 0x2aaa $a000-$bfff|n * 0x2000 |n |write area $c000-$dfff| | | $e000-$ffff|0x7e000-0x7ffff|fix |write 0x5555, boot area PPU memory bank ppu address|rom address |page|task $0000-$07ff|0x02800-0x02fff|0x0a|write 0x2aaa $0800-$0fff|0x05000-0x057ff|0x14|write 0x5555 $1000-$1fff|n * 0x1000 |n |write area */ function program_initalize(d, cpu_banksize, ppu_banksize) { cpu_command(d, 0x0000, 0xa000, cpu_banksize); cpu_command(d, 0x2aaa, 0x8000, 0x2000); cpu_command(d, 0x5555, 0xe000, 0x2000); cpu_write(d, 0x8000, 7); cpu_write(d, 0x8001, 0); cpu_write(d, 0x8000, 6); cpu_write(d, 0x8001, 1); ppu_command(d, 0x0000, 0x1000, ppu_banksize); ppu_command(d, 0x2aaa, 0x0000, 0x0800); ppu_command(d, 0x5555, 0x0800, 0x0800); cpu_write(d, 0x8000, 2); cpu_write(d, 0x8001, 0); cpu_write(d, 0x8000, 0); cpu_write(d, 0x8001, 0x0a); cpu_write(d, 0x8000, 1); cpu_write(d, 0x8001, 0x14); } function cpu_transfer(d, start, end, cpu_banksize) { for(local i = start; i < end - 1; i += 1){ cpu_write(d, 0x8000, 7); cpu_write(d, 0x8001, i); cpu_program(d, 0xa000, cpu_banksize); } cpu_program(d, 0xe000, cpu_banksize) } function ppu_transfer(d, start, end, ppu_banksize) { for(local i = start; i < end; i += 4){ cpu_write(d, 0x8000, 2); cpu_write(d, 0x8001, i); cpu_write(d, 0x8000, 3); cpu_write(d, 0x8001, i | 1); cpu_write(d, 0x8000, 4); cpu_write(d, 0x8001, i | 2); cpu_write(d, 0x8000, 5); cpu_write(d, 0x8001, i | 3); ppu_program(d, 0x1000, ppu_banksize * 4); } }